Skip to content

WPB-23422 endpoint to rotate and mark cookie#5033

Closed
battermann wants to merge 13 commits intodevelopfrom
WPB-23422-implement-single-shared-device-enforcement-logout-by-cookie-label-logout-event
Closed

WPB-23422 endpoint to rotate and mark cookie#5033
battermann wants to merge 13 commits intodevelopfrom
WPB-23422-implement-single-shared-device-enforcement-logout-by-cookie-label-logout-event

Conversation

@battermann
Copy link
Contributor

@battermann battermann commented Feb 16, 2026

This is part of https://wearezeta.atlassian.net/browse/WPB-23422

Checklist

  • Add a new entry in an appropriate subdirectory of changelog.d
  • Read and follow the PR guidelines

@battermann battermann marked this pull request as ready for review February 16, 2026 15:15
@battermann battermann requested review from a team as code owners February 16, 2026 15:15
@zebot zebot added the ok-to-test Approved for running tests in CI, overrides not-ok-to-test if both labels exist label Feb 16, 2026
@battermann battermann requested a review from Copilot February 16, 2026 15:23
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR introduces a new endpoint /access/rotate that provides cookie rotation functionality with optional labeling. This is particularly useful for scenarios where devices or sessions need to be marked (e.g., "shared-device") while obtaining new authentication tokens.

Changes:

  • Added new /access/rotate endpoint that validates existing cookies, revokes them, and issues new cookies with optional labels
  • Introduced RotateCookie data type to support optional cookie labeling in the request body
  • Refactored SAML login test helpers to extract reusable cookie retrieval functions
  • Added integration test coverage for SSO users using the new endpoint

Reviewed changes

Copilot reviewed 10 out of 10 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
services/nginz/integration-test/conf/nginz/nginx.conf Added nginx route configuration for /cookies endpoint
services/brig/src/Brig/API/Public.hs Wired up the new access-rotate-cookie handler in the servant sitemap
services/brig/src/Brig/API/Auth.hs Implemented accessRotateCookie handler with cookie rotation logic and validation
libs/wire-api/src/Wire/API/User/Auth.hs Added RotateCookie newtype with optional label field
libs/wire-api/src/Wire/API/Routes/Public/Brig.hs Defined the new API route with documentation
integration/test/Test/Auth.hs Added integration test for SSO user cookie rotation scenario
integration/test/SetupHelpers.hs Refactored SAML login helpers to extract reusable getCookieWithSamlLogin function
integration/test/API/Nginz.hs Added accessRotate client function for testing
integration/test/API/Brig.hs Added getCookies client function (contains typo in query parameter)
changelog.d/2-features/WPB-23422 Added changelog entry documenting the new feature

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Member

@akshaymankar akshaymankar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good overall. Most in-line comments at nits, I understand its just copy paste, but now that we understand the code we can take time to clean it up a bit.

Apart from that can we please add unit tests for the functions moved? Or at least the new function?

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 45 out of 45 changed files in this pull request and generated 3 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@battermann battermann force-pushed the WPB-23422-implement-single-shared-device-enforcement-logout-by-cookie-label-logout-event branch from 275420b to c765f94 Compare February 19, 2026 09:59
@battermann battermann marked this pull request as draft February 20, 2026 10:56
@battermann
Copy link
Contributor Author

obsolete. implemented by #5049

@battermann battermann closed this Feb 23, 2026
@battermann battermann deleted the WPB-23422-implement-single-shared-device-enforcement-logout-by-cookie-label-logout-event branch February 23, 2026 17:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ok-to-test Approved for running tests in CI, overrides not-ok-to-test if both labels exist

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants