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

access token handler is now a pass through handler, it no longer retu… #19

Merged
merged 5 commits into from
Nov 15, 2016

Conversation

jdslavin
Copy link
Member

…rns a 401 error when the access token is invalid or missing, it just calls the next handler with no user on the request

(handler request)
{:status 401}))
((or invalid-token-handler (constantly false)) request)
(handler request))
Copy link
Contributor

Choose a reason for hiding this comment

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

This doesn't seem right, wouldn't you always be returning false if there's no invalid-token-handler?
Also wouldn't it not even use that return value, but always call (handler request)?

Copy link
Member Author

@jdslavin jdslavin Oct 25, 2016

Choose a reason for hiding this comment

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

All it does now is pass through the handler chain, when we do not have a valid token, without the user will be associated with the request. This is what we discussed with Tony. This puts control into the actual code that cares about authorization to look for the user and do the right things based on that.

@awkay
Copy link
Contributor

awkay commented Oct 26, 2016

Is everyone ok with this PR? @Pancia @jdslavin ?

@awkay
Copy link
Contributor

awkay commented Oct 26, 2016

I might need you guys to resolve conflicts...I merged @Pancia branch first

@Pancia
Copy link
Contributor

Pancia commented Oct 26, 2016

I'm not sure if I want to merge this just yet, I might just prefer to create/use untangled-auth once it's ready instead of having auth/openid things in untangled-server.

But I can merge this now if that'd be best, but I'm not sure I really want to have to upgrade other apps that use this so soon after refactoring a big part of the server code.

@awkay
Copy link
Contributor

awkay commented Oct 27, 2016

ok, well let me know

@jdslavin
Copy link
Member Author

I created https://github.com/jdslavin/untangled-openid that has the mock openid server and the openid connet middleware. I still need to do some docs but wanted to get that up there. If we remove these components from untangled-server we can drop this pull request

jdslavin and others added 3 commits November 5, 2016 14:18
…rns a 401 error when the access token is invalid or missing, it just calls the next handler with no user on the request
@Pancia Pancia force-pushed the feature/access-token-handling branch from c9684f9 to c378d46 Compare November 5, 2016 21:22
@awkay
Copy link
Contributor

awkay commented Nov 7, 2016

I'm game for a new repo. If it's ready to pull in, then I can create a repo for you to push to.

@Pancia
Copy link
Contributor

Pancia commented Nov 7, 2016

Is the intent for it to be untangled-openid or untangled-auth?
I would prefer it to be generic, but I can be persuaded either way.

I would also recommend we pull code from untangled-server & this branch, as I've done a few changes to the server code, eg: jeff's untangled-openid still uses set-*-hook.

@Pancia
Copy link
Contributor

Pancia commented Nov 15, 2016

ready for merging once CI tests pass

@awkay awkay merged commit 2d68925 into develop Nov 15, 2016
@Pancia Pancia deleted the feature/access-token-handling branch November 15, 2016 23:02
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.

3 participants