-
Notifications
You must be signed in to change notification settings - Fork 441
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
CloudFlare Zero Trust authentication #1938
CloudFlare Zero Trust authentication #1938
Conversation
Hi @cristineguadelupe! Just to recap, I think API wise there are two levels:
We will add this to our supervision tree based on the value of Then In other words, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Two nitpicks and ship it!
Co-authored-by: José Valim <[email protected]>
Uffizzi Preview |
|
||
def authenticate(name, conn) do | ||
token = get_req_header(conn, @assertion) | ||
GenServer.call(name, {:authenticate, token}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Our GenServer stores things in ets, but we never access them in this function, in the caller. Thus I believe ets is an overkill and we might as well store things in server state. To take full advantage of ets and avoid a single genserver bottleneck, I believe we want something like this:
def authenticate(name, conn) do
token = Plug.Conn.get_req_header(conn, @assertion)
do_authenticate(name, token) || GenServer.call(name, {:authenticate, token})
end
where both do_authenticate
and handle_call({:authenticate
fetches things from ets.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good find, added to #1941. Using ets also means the table has to be named, which means we need to require the :name
option.
Co-authored-by: Alexandre de Souza <[email protected]>
This PR adds support for CloudFlare Zero Trust authentication