Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: fixes during conformance testing #150

Open
wants to merge 6 commits into
base: develop
Choose a base branch
from

Conversation

sanderPostma
Copy link
Contributor

No description provided.

//fixme: Create correlationId if not provided. Might need to be deferred to registry though
this._correlationId = args.correlationId
this._timestamp = Date.now()
this._subject = args.subject
this._redirectUri = args.redirectUri
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Huh, we have a generic subject. Why are we creating something very specific (a redirectUri) on every event type. That should not happen

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's optional and it's not every event type, just AuthorizationEvent types.

await this.emitEvent(AuthorizationEvents.ON_AUTH_RESPONSE_SENT_SUCCESS, { correlationId, subject: response, redirectUri: redirectUri })

Alternatively I can create a new type wrapping response & redirectUri. That would be a breaking change, but I do not think we are using that event anywhere else in our codebase.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just saw there is a simpler solution without using the event. Will revert

@@ -96,10 +96,10 @@ export const getRequestObjectJwtVerifier = async (
if (jwt.payload.redirect_uri && jwt.payload.redirect_uri !== clientId) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There probably should be a else if here, that does the exact same check but then for jwt.payload,response_uri (the new name) instead of redirect_uri

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is client_id_scheme still redirect_uri in case jwt.payload,response_uri is used?
I don't see redirect_uri as valid value for client_id_scheme

@@ -96,10 +96,10 @@ export const getRequestObjectJwtVerifier = async (
if (jwt.payload.redirect_uri && jwt.payload.redirect_uri !== clientId) {
throw new Error(SIOPErrors.INVALID_CLIENT_ID_MUST_MATCH_REDIRECT_URI)
}
const parts = options.raw.split('.')
/*const parts = options.raw.split('.') this can be signed and execution shouldn't even be here when alg = none
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are we removing this, instead of not checking it when alg === none ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Execution never gets here if alg is none
line 83

  if (!clientIdScheme || jwt.header.alg === 'none') {
    return getJwtVerifierWithContext(jwt, { type })
  }

@sanderPostma sanderPostma changed the base branch from develop to develop-20240918 September 26, 2024 07:38
@sanderPostma sanderPostma changed the base branch from develop-20240918 to develop September 26, 2024 07:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants