Repository navigation
Fix/introspection basic auth base64 - #66
Conversation
TNetEncoding.Base64 inserts CRLF after every 76 characters, so a client_id:client_secret of 57 bytes or more produced a broken Authorization header on the introspection request and every token was rejected. TNetEncoding.Base64String encodes without line breaks. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WbQohkUArrh3cWmZirXpzu
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WbQohkUArrh3cWmZirXpzu
Both introspection tests start the local Indy server through StartIntrospection, the client id and active token are constants, and the new test keeps its values in locals. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WbQohkUArrh3cWmZirXpzu
| end; | ||
|
|
||
| procedure TAuthorizationTests.Introspection_PostsTokenWithClientCredentials; | ||
| function TAuthorizationTests.StartIntrospection: string; |
There was a problem hiding this comment.
@claude Deze functienaam veronderstelt dat je iets start. In feite voert het de binding uit, maar het retourneert ook de URL. Dat is niet duidelijk uit deze functienaam.
There was a problem hiding this comment.
Opgelost in 6273fb2: gesplitst in StartIntrospectionServer (start de server) en IntrospectionUrl (geeft het adres terug).
| begin | ||
| const Url = StartIntrospection; | ||
|
|
||
| const Authorizer: IMCPAuthorizer = TMCPIntrospectionAuthorizer.Create(AUDIENCE, Url, IntrospectionClientId, 's3cret'); |
There was a problem hiding this comment.
@claude Als je in de code AUDIENCE gebruikt, dan mag deze conform de GDK skills ook aangepast worden naar de correcte PascalCase.
There was a problem hiding this comment.
Opgelost in 6273fb2: AUDIENCE heet nu Audience, alle gebruikplekken in de unit zijn aangepast.
…onstant StartIntrospectionServer starts the local server and IntrospectionUrl returns its address, so each name says what it does. AUDIENCE becomes Audience. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WbQohkUArrh3cWmZirXpzu
Code reviewNo issues found. Checked for bugs and CLAUDE.md compliance. |
| var Authorizer: IMCPAuthorizer := TClaimsAuthorizer.Create(AUDIENCE, | ||
| Format('{"sub":"u","aud":["https://other","%s"],"exp":%d,"scp":["a","b"]}', [AUDIENCE.ToUpper, Future])); | ||
| var Authorizer: IMCPAuthorizer := TClaimsAuthorizer.Create(Audience, | ||
| Format('{"sub":"u","aud":["https://other","%s"],"exp":%d,"scp":["a","b"]}', [Audience.ToUpper, Future])); |
There was a problem hiding this comment.
Deze uitlijning is niet conform de GDK regels.
There was a problem hiding this comment.
Opgelost in 418f4d9: de claims-JSON staat nu in een eigen const, waardoor de meerregelige aanroep verdwijnt. Dezelfde regels zijn toegepast op alle andere regels die deze PR raakt.
Claims JSON, credentials and expiry are built in their own locals instead of nested calls as arguments, immutable locals are const, and the repeated claims format is a constant. This also removes the misaligned continuation line. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WbQohkUArrh3cWmZirXpzu
No description provided.