Repository navigation
feat(identitybroker): authorize gateway calls with a per-call ID-JAG and gateway token - #2786
Conversation
e903f3e to
a9d9519
Compare
0a48c57 to
be15152
Compare
jhrozek
left a comment
There was a problem hiding this comment.
Reviewed this PR's own commit (a9d9519178..be15152187).
The AS-1 exchange and the AS-2 redemption match steps (7) and (8), and the error mapping matches the error-reasons table. The session is checked again before every external step and before the token is returned. Retries are bounded at four tries, and an ID-JAG is never sent twice. The ID-JAG record and the success record are saved before redeeming and before returning. No secret reaches an error or a record.
One comment that can't go inline, because sessions.go isn't in this diff: the CloseSession comment at internal/identitybroker/sessions.go:208 says "Calls already in progress may finish." With this PR, a call in progress is refused with the closing reason at its next session check and gets no token, even after AS-2 has issued one. Could it say that instead?
Two small inline comments below.
…and gateway token A call that passes the checks exchanges the session's refresh token at AS-1 for an ID-JAG (IDJAGIssuer), records it, and redeems it at the gateway's AS-2 (GatewayAuthServer) for a token used by that call alone, retrying once per design rule. AS-2 is bound late with BindGatewayAS2; authserverclient implements both ports. Co-authored-by: Mecatl <noreply@mecatl.dev>
be15152 to
352a4d3
Compare
…lowances Address review comments on #2786: - The retry-allowance table now checks one decision matching the returned error, one ID-JAG record per issued ID-JAG, no token on failure, and that the try after a revoked grant presents the session's new grant. - Mark the dropped AS-2 error_uri as a shortcut removed by #2735. - CloseSession's comment says a call in progress is refused at its next session check and gets no token. Co-authored-by: Mecatl <noreply@mecatl.dev>
…lowances Address review comments on #2786: - The retry-allowance table now checks one decision matching the returned error, one ID-JAG record per issued ID-JAG, no token on failure, and that the try after a revoked grant presents the session's new grant. - Mark the dropped AS-2 error_uri as a shortcut removed by #2735. - CloseSession's comment says a call in progress is refused at its next session check and gets no token. Co-authored-by: Mecatl <noreply@mecatl.dev>
…lowances Address review comments on #2786: - The retry-allowance table now checks one decision matching the returned error, one ID-JAG record per issued ID-JAG, no token on failure, and that the try after a revoked grant presents the session's new grant. - Mark the dropped AS-2 error_uri as a shortcut removed by #2735. - CloseSession's comment says a call in progress is refused at its next session check and gets no token. Co-authored-by: Mecatl <noreply@mecatl.dev>
Part 3 of 4 for #2535. Stack: #2784 → #2785 → this PR → #2783.
Steps (7) and (8): each call gets an ID-JAG from AS-1 and redeems it at AS-2 for a one-call gateway token.
IDJAGIssuerandGatewayAuthServer, implemented byauthserverclient(IssueIDJAG,Redeem).invalid_grant, and a revoked grant with a newer one; one rejected-token retry per issued attempt;revokedwith nothing newer closes the session; a closed or expired session is re-checked before every try and before returning.BindGatewayAS2), and unbinding waits for calls in flight.Shortcuts (marked in code): AS-2 bound late in process (#2560); no
authorization_details(#2727); gateway token unbound, lifetime from AS-2 (#2538, #2727);upstream_revoked/owner_action_requirednot recorded against the session (#2568); a non-JWT gateway token has no record reference (#2541).API compatibility
No wire change: in-process until #2560.