-
Notifications
You must be signed in to change notification settings - Fork 21
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
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?
(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?
[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?
@@ -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
the mechanism here is a bit convoluted:
:credentialID
from the:params
map, and attaches it to a new key in the:request
map::com.yetanalytics.url-credential-ID
. This has to be done here or elselrs
will throw a fitcredentialID
not being in spec:com.yetanalytics.url-credential-ID
in the:request
map, and, if it finds it, will query for the actual creds and modify the request so it passes Basic auth. However, I now think I can move this functionality into the interceptor and avoid muddyinglrs.clj