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

Make IDP routes independent of handlers #1159

Merged
merged 2 commits into from
Feb 16, 2022
Merged

Conversation

joachimvh
Copy link
Member

✍️ Description

This is a minor change to the updated IDP architecture so the classes responsible for the routes are independent of the handlers (and a small HTML fix).

This will make it easier to update the OIDC library to v7 as otherwise there would currently be a cyclical dependency (the consent handlers needs the provider to create classes in v7, but the provider needs the consent path for redirects), and it also is how it should have been done in the first place anyway.

@joachimvh joachimvh added the semver.major Requires a major version bump label Feb 14, 2022
Copy link
Member

@RubenVerborgh RubenVerborgh left a comment

Choose a reason for hiding this comment

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

it also is how it should have been done in the first place anyway

https://www.youtube.com/watch?v=qeMFqkcPYcg&t=11s

this.path = path;
}

public getPath(): string {
Copy link
Member

Choose a reason for hiding this comment

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

Why not just make path public then?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yea, I guess I should do that. My mind is still set very hard on "only expose functions" 😄.

Copy link
Member Author

Choose a reason for hiding this comment

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

Discovered a good reason to do it. That would turn the InteractionRoute interface into { path: string } which the Components.js generator is going to deconstruct. So for the InteractionHandler constructor

public constructor(route: InteractionRoute, source: InteractionHandler)

Components.js no longer expects a "route" entry, but a "route_path" entry.

Copy link
Member

Choose a reason for hiding this comment

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

That would turn the InteractionRoute interface into { path: string }

Also if read-only (i.e., with getter)? Might be a bug then, @rubensworks?

Copy link
Member Author

Choose a reason for hiding this comment

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

Adding readonly to the interface did not have an impact. But it does make sense I think, since we also use interfaces to define input parameters for constructors with a lot of variables and otherwise that would become unfeasible: https://github.com/solid/community-server/blob/d2870e5c8bc2d86b1a43db3a8e039f8b494657da/config/app/setup/handlers/setup.json#L17-L24

You could perhaps expect Components.js to handle this differently when the parameters are defined as readonly but that might cause confusion (and make @rubensworks's life more difficult 😉)

Copy link
Contributor

Choose a reason for hiding this comment

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

Interfaces are indeed deconstructed atm. But we could definitely add something like a tsdoc option to disable this.

@joachimvh joachimvh merged commit 1769b79 into versions/3.0.0 Feb 16, 2022
@joachimvh joachimvh deleted the fix/idp-routes branch February 16, 2022 11:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
semver.major Requires a major version bump
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants