Skip to content

Conversation

rossabaker
Copy link
Member

Integrates Random into DigestAuth to avoid blocking.

@mergify mergify bot added series/0.22 PRs targeting 0.22.x module:server labels Mar 24, 2022
@deprecated(
"Uses a side-effecting NonceKeeper. Use challenge(String, AuthStore, Blocker, Duration, Int, Int).",
"0.22.13",
)
def challenge[F[_], A](
Copy link
Member Author

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.

/cc @blast-hardcheese

Copy link
Contributor

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)
Copy link
Member Author

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.

@rossabaker rossabaker mentioned this pull request Mar 24, 2022
…ion/Nonce.scala

Co-authored-by: Daniel Esik <e.danicheg@yandex.ru>
@rossabaker
Copy link
Member Author

I'll hold just to confirm that new deprecation was desired.

Copy link
Contributor

@blast-hardcheese blast-hardcheese left a 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](
Copy link
Contributor

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

@rossabaker
Copy link
Member Author

👍 Okay, yeah, I thought that was maybe the signature that motivated this whole thing.

@rossabaker rossabaker merged commit e6e7466 into http4s:series/0.22 Mar 24, 2022
@rossabaker rossabaker deleted the digest-auth-random branch March 24, 2022 18:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
module:server series/0.22 PRs targeting 0.22.x
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants