Repository navigation
feat: Moved IDP response and template behaviour to single class - #876
Merged
Merged
Conversation
RubenVerborgh
approved these changes
Jul 30, 2021
| "@type": "TemplateHandler", | ||
| "templateEngine": { "@type": "EjsTemplateEngine" } | ||
| }, | ||
| "interactionCompleter": { |
Member
There was a problem hiding this comment.
At this point I'm wondering what a completer is. Comment?
Member
Author
There was a problem hiding this comment.
Going to add a comment, but just in case you were wondering: this sends the request back to the OIDC library with the extra metadata we added (specifically: log in in with the given WebID) and then tell it to continue doing its OIDC magic handshake thingy.
jvherweg
force-pushed
the
feat/idp-architecture
branch
from
August 2, 2021 09:04
98ba20e to
7cfa1f9
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Partial solution for #722 .
Have been dragging this branch along for a while, finally got it at a point I'm sort of happy with it. :D
This is quite a big change to the IDP although none of the behaviour actually changes.
Might be too much for 1.0.0 (since I'm guessing this one might require some back and forth).
What it does
All the IDP handlers (
InteractionHandlers) no longer write to the Response object themselves. Currently they still receive the Response object since 1 of them needs it for a call to the OIDC library.Behaviour that redirects initial request based on prompt was moved to
IdentityProviderHttpHandler(fromInitialInteractionHandler).Behaviour that shows templates on GET and handles interactions on POST now also moved to
IdentityProviderHttpHandler(fromIdpRouteController).Because of the above, the
IdentityProviderHttpHandleris now the only class aware of all URL and template paths relevant for the IDP.This might be too much for 1 class? Could move the second part back to the individual
IdpRouteControllers. Also will depend a bit on the things that still should be done, see belowThings I still want to do
All things mentioned here would be done in separate PRs. This PR already stands on it own without them.
Find a way to no longer have to send the Response object along. I'm not even sure why the OIDC library needs it since the function in question gives information about the Request. Could handle the one class that needs this completely separately since this is also going to be an issue once we remove the Request parameter.
Remove the Request paramater. Specifically: have a body parser/URL extractor in the
IdentityProviderHttpHandler, similarly to the IDP handler. We could even use the same one, although we probably don't want to pass Representation objects to the handlers since we'll always have JSON-like objects.Remove the
TemplateHandlerand instead make use of the sameResponseWriteras the LDP handler. This should just require a layer inbetween that converts the handler output to the valid input for the ResponseWriter.Support JSON output besides HTML output.
Go through the IDP issues now that they should be easier to fix.