Skip to content
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

WPB-10207 Match cipher suite tag in query parameters against key packages on replacing key packages #4158

Merged
merged 3 commits into from
Jul 17, 2024

Conversation

stefanwire
Copy link
Contributor

https://wearezeta.atlassian.net/browse/WPB-10207

Checklist

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

…ages on replacing key packages (#4157)

* check query parameter against key packages when replacing key packages

* tests for error cases

* changelog

* Update services/brig/src/Brig/API/MLS/CipherSuite.hs

Co-authored-by: Stefan Berthold <stefan.berthold@wire.com>

---------

Co-authored-by: Stefan Berthold <stefan.berthold@wire.com>
@zebot zebot added the ok-to-test Approved for running tests in CI, overrides not-ok-to-test if both labels exist label Jul 17, 2024
@echoes-hq echoes-hq bot added the echoes: unplanned Any work item that isn’t part of the product or technical roadmap. label Jul 17, 2024
Copy link
Contributor

@pcapriotti pcapriotti left a comment

Choose a reason for hiding this comment

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

LGTM. Minor comment below.

replaceKeyPackages cid suites kps = do
replaceKeyPackages cid suites kps = replaceKeyPackages' cid (Just suites) kps

replaceKeyPackages' :: ClientIdentity -> Maybe [Ciphersuite] -> [ByteString] -> App Response
Copy link
Contributor

Choose a reason for hiding this comment

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

The convention we've been sticking to in cases like this one is to create a data type say ReplaceKeyPackages with a Default instance and redefine replaceKeyPackages as ClientIdentity -> ReplaceKeyPackages -> App Response, so we can have something that resembles named arguments. Having primed method names is confusing and doesn't really scale.

@battermann battermann merged commit 1506ebf into develop Jul 17, 2024
10 checks passed
@battermann battermann deleted the sb/replace-keypackages branch July 17, 2024 09:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
echoes: unplanned Any work item that isn’t part of the product or technical roadmap. 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.

4 participants