-
Notifications
You must be signed in to change notification settings - Fork 333
AuthenticationSubsystem: Move newCookie into it #4479
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
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
e5c5529
to
bdf3ff7
Compare
6707f3f
to
80c4577
Compare
35f5e92
to
3fbad60
Compare
This needs more changes to the zauth library before it can be integrated in the the AuthenticationSubsystem.
The 'newAccessToken' function is moved to the 'AccessTokenLike' typeclass returns an 'AccessToken' type which contains the serialized token, removing the need for polymorphism. Similarly 'renewAccessToken' function in the 'UserTokenLike' typeclass returns an 'AccessToken'. We might be able to get rid of all of this polymophism as things are not _so_ complicated. This is just the first step.
It was only used in integration tests and only for one type of access token
…ntom type paramter These are essentially same things and we have invented type classes to treat them so, but if they contain the same data structures inside and have same serialisation/de-serialisation logic, there is little point in having new type wrappers for LegalHoldUser and LegalHoldAccess. The phantom type parameter is of type `UserTokenType` with values `ActualUser` and `LHUser`. These names don't completely make any sense because there is no such thing as a `LegalHoldUser` different from `ActualUser`. It _should_ rather be called something like `TokenType`, but that name is taken by something else. I suspect this type will go away soon, so while transitioning its probably fine to keep it as it. Doing all this makes it easier for The typeclasses `AccessTokenLike` and `UserTokenLike` to be merged. The actual use of those type classes is to determine which ttls to apply to these the `UserTokenType`, which can now be made clearer in the code.
These help de-dupe bit more code.
The wrong type was applied couple of commits ago.
Delete bunch of unused code.
The old code is good enough, and singletons may add more complexity than they abstract away.
This would require to take the type apart in the individual actions again, and doing so without handing the context for the entire effect to every action seems to get too boilerplaty.
0c1b720
to
83f96f1
Compare
This reverts commit 49a4f1f.
Brig updates its time every second. If we create many cookies very quickly all of them get assigned the same cookie creation time, this makes it impossible to guess which cookie will get evicted when we have too many cookies. So waiting a second between cookie creation gets around this problem.
The MonadThrow was being caught at the time of hosting the servant application, this throwing error in the subsystem is much better.
Move the required settings to AuthenticationSubsystemConfig.
71193d3
to
95ed333
Compare
battermann
approved these changes
Apr 7, 2025
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.
LGTM only very minor comments
libs/wire-subsystems/src/Wire/AuthenticationSubsystem/Config.hs
Outdated
Show resolved
Hide resolved
libs/wire-subsystems/src/Wire/AuthenticationSubsystem/Cookie.hs
Outdated
Show resolved
Hide resolved
This was referenced May 12, 2025
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
https://wearezeta.atlassian.net/browse/WPB-12118
Checklist
changelog.d