-
Notifications
You must be signed in to change notification settings - Fork 803
Integrate Random into DigestAuth #6177
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
Conversation
@deprecated( | ||
"Uses a side-effecting NonceKeeper. Use challenge(String, AuthStore, Blocker, Duration, Int, Int).", | ||
"0.22.13", | ||
) | ||
def challenge[F[_], A]( |
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'm not sure whether this signature is still valid, but I thought NonceKeeper
was considered dirty.
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.
It's impossible to be called publicly, since NonceKeeper
is package private -- I had a @deprecated
on it but it must have gotten lost. Thanks for putting it back
@@ -42,14 +43,15 @@ private[authentication] object NonceKeeperF { | |||
currentMillis <- Clock[F].monotonic(MILLISECONDS) | |||
lastCleanupMillis <- Ref[F].of(currentMillis) | |||
nonces = new LinkedHashMap[String, NonceF[F]] | |||
random <- Random.javaSecuritySecureRandom[F](blocker) |
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.
This is as high up as we can pull Random
without making it public API. In Cats-Effect 3, we can consider surfacing it all the way to the top.
server/src/main/scala/org/http4s/server/middleware/authentication/Nonce.scala
Outdated
Show resolved
Hide resolved
…ion/Nonce.scala Co-authored-by: Daniel Esik <e.danicheg@yandex.ru>
I'll hold just to confirm that new deprecation was desired. |
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.
Excellent, thanks for the assistance here!
@deprecated( | ||
"Uses a side-effecting NonceKeeper. Use challenge(String, AuthStore, Blocker, Duration, Int, Int).", | ||
"0.22.13", | ||
) | ||
def challenge[F[_], A]( |
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.
It's impossible to be called publicly, since NonceKeeper
is package private -- I had a @deprecated
on it but it must have gotten lost. Thanks for putting it back
👍 Okay, yeah, I thought that was maybe the signature that motivated this whole thing. |
Integrates
Random
intoDigestAuth
to avoid blocking.