Skip to content

Conversation

@ramnes
Copy link

@ramnes ramnes commented Dec 6, 2025

Hey team,

Here is some work around #1069 and #1071 to allow a discussion based on an actual implementation.

I think the changes here are pretty obvious:

  • Renames;
  • A Credential can have multiple passwords now;
  • Added OnAuthSuccess and OnAuthFailure to the new AuthenticationHandler.

One side effect of the multiple passwords per user is that we can't have Xor update inplace anymore, because otherwise we would XOR the password we received every time we compare it to a new hash in the list of hashes to try.

About hashes – I moved the Credential passwords hash at comparison-time to avoid paying the full price for every connection. Let's say you have 1000 passwords to match against but match after 5 comparisons: it's better to hash only 5 passwords, not 1000.

@ramnes ramnes force-pushed the ramnes/credentials-passwords branch from 6ec779a to fb6703a Compare December 6, 2025 00:26
@ramnes ramnes changed the title Replace CredentialProvider with a more powerful AuthHandler Implement AuthenticationHandler for custom auth mechanisms Dec 6, 2025
@ramnes ramnes force-pushed the ramnes/credentials-passwords branch from fb6703a to 55d7dfb Compare December 6, 2025 00:30
@lance6716
Copy link
Collaborator

(This PR is a bit large than the other one you opened, I'll take a look later)

@ramnes
Copy link
Author

ramnes commented Dec 6, 2025

Yeah, the PR is a bit too large for my taste too. :)

I didn’t mean for it to be merged as-is, more as a starting point for discussion around the issues I opened. Happy to split it up once we have a clearer idea of what we want to do for each one!

@ramnes ramnes force-pushed the ramnes/credentials-passwords branch from c650a68 to 8c72c7d Compare December 6, 2025 20:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants