-
Notifications
You must be signed in to change notification settings - Fork 21
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
url-param auth POC #463
base: main
Are you sure you want to change the base?
url-param auth POC #463
Conversation
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.
looks like a good direction
@@ -0,0 +1,63 @@ | |||
(ns lrsql.auth.interceptor |
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.
interceptor i am assuming will be renamed?
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.
I concur - it should be in the /admin/interceptors
directory
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.
can I push back on this? It's not actually an admin
functionality. Its function is 100% focused on just making /statements
work. Has no bearing on any admin route.
src/main/lrsql/auth/interceptor.clj
Outdated
(let [lrs (:com.yetanalytics/lrs ctx) | ||
conn (-> lrs :connection :conn-pool) | ||
backend (:backend lrs) | ||
input (auth-input/query-credential-by-id-input cred-id) |
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.
need handling for doesnt exist?
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.
fixed
src/main/lrsql/auth/interceptor.clj
Outdated
[lrsql.util :as util] | ||
[next.jdbc :as jdbc])) | ||
|
||
(def holder (atom nil)) |
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.
I am failing to see the necessity of state here. Even looking at it i can't untangle why we would introduce it. We inject an interceptor, and then it modifies ctx, why are there atoms?
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.
state removed
src/main/lrsql/system/webserver.clj
Outdated
@@ -14,6 +15,8 @@ | |||
[lrsql.util.cert :as cu] | |||
[lrsql.util.interceptor :refer [handle-json-parse-exn]])) | |||
|
|||
(def holder (atom nil)) |
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.
again, this feels odd
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.
state removed
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.
Agreed with Cliff - I recall that having an atom would make this not work once load balancers are involved (@cliffcaseyyet correct me if I'm wrong)
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.
double-dog removed
:clamav-port 3310 | ||
:auth-by-cred-id false ;may need to be set to true if lrsql behind proxy |
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.
When adding config vars, make sure you don't forget to also add them to a) the production config and b) the documentation.
if
auth-by-cred-id
flag is true, authorizes by credentialID in query params.