Skip to content

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

Merged
battermann merged 3 commits intodevelopfrom
sb/replace-keypackages
Jul 17, 2024
Merged

WPB-10207 Match cipher suite tag in query parameters against key packages on replacing key packages#4158
battermann merged 3 commits intodevelopfrom
sb/replace-keypackages

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>
@stefanwire stefanwire requested a review from battermann July 17, 2024 05:07
@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.

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