You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
refactor(server): resolve every grant's connector in the pipeline
Address review: the refresh grant re-implemented the connector-authorization
invariant (ConnectorAllowed + GrantTypeAllowed) inline and held its own connector
cache, duplicating the endpoint's resolve step.
ConnectorID now takes the context and client and may look the id up in storage, so
grants whose connector is recorded on a stored token — refresh reads it off the
refresh token — still source it through the same hook. The endpoint resolves the
connector and enforces the invariant once, in one place, and hands it to Authorize.
The refresh grant drops its connector cache and inline checks; it validates the
token in ConnectorID, stashes it on the request, and reuses it in Authorize.
Also replace the hand-rolled contains helper with slices.Contains.
Signed-off-by: maksim.nabokikh <max.nabokih@gmail.com>
e.logger.ErrorContext(ctx, "connector does not allow grant", "connector_id", connID, "grant_type", grantType)
318
327
return connectors.Connector{}, &oauth2.Error{Type: oauth2.InvalidRequest, Description: "Requested connector does not support this grant type.", Status: http.StatusBadRequest}
0 commit comments