-
Notifications
You must be signed in to change notification settings - Fork 13
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
current_auth API #160
Comments
|
In Lastuser, the The |
Clarified in hasgeek/lastuser#91 (comment): principals with agency may be explicitly recognised as "actor" or "agent". |
We've dropped |
Coaster received an auth framework in #154 and #155 with a proxy named
current_auth
. The proxy expects a login manager attached to the app that implements a_load_user
method. However, as demonstrated in hasgeek/lastuser#229 (the first login manager to attempt a full switch tocurrent_auth
), the login manager has two distinct phases during a request:Using
current_auth
in its current form replaces the first. It triggers a check for a user only when first required, so requests that don't require auth don't run the code. It also allows otherbefore_request
handlers to require a user without risk of being called before the user is loaded.We now need a protocol for the second phase. Previously, we assumed the first phase runs on every request, so post-processing is required for every request. Now we need a flag somewhere to indicate
current_auth
was invoked during the request.Perhaps:
CurrentAuth
object is constructed every timecurrent_auth
is invoked. It should be constructed once and stored on the request context stack ascurrent_auth
.user
andauth
attributes on the request stack. Is this still necessary? Why not mutate the CurrentAuth object itself? (Using the existingadd_auth_attribute
helper, as the primary interface is better off read-only.)request_had_auth
can indicate if the CurrentAuth instance exists.after_request
handlers that do tear down, but onlyif request_had_auth()
.The text was updated successfully, but these errors were encountered: