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

Authentication & Authorization (open ended discussion) #5

Open
withoutboats opened this issue Nov 2, 2016 · 0 comments
Open

Authentication & Authorization (open ended discussion) #5

withoutboats opened this issue Nov 2, 2016 · 0 comments

Comments

@withoutboats
Copy link
Collaborator

cargonauts currently has no strategy for authentication and authorization. I'm not sure exactly what the best way to proceed here is.

My preference is that these be handled somehow in the routing layer, before the "api trait" gets hit. For basic use case of auth, controlling whether a user can access an end point, this seems fairly simple. But for more complex case, where authentication determines which response a user receives at an endpoint (for example, having a singleton resource like a Cart which has the current user's shopping cart), its much less clear how to create a clean API.

I think the best approach might be to disallow this kind of authentication based routing except for "entrypoints." Entrypoints are a future feature in which the author can designate a particular route as pointing to a particular endpoint (in general, routes are auto-generated), so that they can access it to begin traversing the API. The internal API for entrypoints can include the ability to pass auth info as a part of determining which resource the entrypoint accesses; from that point on, all routing will be fully qualified by the URL path.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant