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

Move password reset code to AuthenticationSubsystem #4086

Conversation

battermann
Copy link
Contributor

@battermann battermann commented Jun 6, 2024

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

Checklist

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

@zebot zebot added the ok-to-test Approved for running tests in CI, overrides not-ok-to-test if both labels exist label Jun 6, 2024
Copy link
Contributor

@fisx fisx left a comment

Choose a reason for hiding this comment

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

glanced through about half of the PR. looks good!

libs/wire-subsystems/src/Wire/MiniBackend.hs Show resolved Hide resolved
@fisx fisx force-pushed the WPB-8890-polysemy-user-subsystem-add-password-reset-operation-s branch 3 times, most recently from e6f4ec2 to 1e1db5c Compare June 17, 2024 11:41
@akshaymankar akshaymankar force-pushed the WPB-8890-polysemy-user-subsystem-add-password-reset-operation-s branch from 1e1db5c to e648388 Compare June 17, 2024 12:46
@fisx fisx force-pushed the WPB-8890-polysemy-user-subsystem-add-password-reset-operation-s branch 2 times, most recently from f392fc4 to 207284e Compare June 20, 2024 08:58
@akshaymankar akshaymankar force-pushed the WPB-8890-polysemy-user-subsystem-add-password-reset-operation-s branch from 18ae8b8 to 50150df Compare June 25, 2024 09:40
@akshaymankar akshaymankar changed the title WPB-8890 UserSubsystem Password reset Move password reset code to AuthenticationSubsystem Jun 25, 2024
@akshaymankar akshaymankar force-pushed the WPB-8890-polysemy-user-subsystem-add-password-reset-operation-s branch from 42850d1 to 52dfb19 Compare June 26, 2024 08:55
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

@akshaymankar akshaymankar marked this pull request as ready for review June 26, 2024 09:13
@akshaymankar akshaymankar force-pushed the WPB-8890-polysemy-user-subsystem-add-password-reset-operation-s branch from 7b7be56 to baf9c13 Compare June 26, 2024 12:56
@echoes-hq echoes-hq bot added echoes: technical-roadmap/throughput More specific category, to highlight task aiming at improving the development velocity and effici... echoes: technical-roadmap/technical-debt More specific category, to highlight Technical Debt being tackled. labels Jun 27, 2024
@akshaymankar akshaymankar force-pushed the WPB-8890-polysemy-user-subsystem-add-password-reset-operation-s branch from baf9c13 to 9eff1d1 Compare June 27, 2024 07:33
@fisx
Copy link
Contributor

fisx commented Jun 28, 2024

one more failure (flake? unrelated? serious?) -

      failure - invalid signature:                                                                   FAIL
        Exception: Error executing request: token invalid
        CallStack (from HasCallStack):
          error, called at test/integration/API/OAuth.hs:417:26 in main:API.OAuth
        CallStack (from HasCallStack):
          error, called at src/Bilge/Assert.hs:101:18 in bilge-0.22.0-6Cxcfrpv0gi69IBgCcDsiP:Bilge.Assert
          <!!, called at src/Bilge/Assert.hs:109:19 in bilge-0.22.0-6Cxcfrpv0gi69IBgCcDsiP:Bilge.Assert
          !!!, called at test/integration/API/OAuth.hs:419:82 in main:API.OAuth
        Use -p '(!/turn/&&!/user.auth.cookies.limit/)&&/failure - invalid signature/' to rerun this test only.

@fisx
Copy link
Contributor

fisx commented Jun 28, 2024

one more failure (flake? unrelated? serious?) -

      failure - invalid signature:                                                                   FAIL
        Exception: Error executing request: token invalid
        CallStack (from HasCallStack):
          error, called at test/integration/API/OAuth.hs:417:26 in main:API.OAuth
        CallStack (from HasCallStack):
          error, called at src/Bilge/Assert.hs:101:18 in bilge-0.22.0-6Cxcfrpv0gi69IBgCcDsiP:Bilge.Assert
          <!!, called at src/Bilge/Assert.hs:109:19 in bilge-0.22.0-6Cxcfrpv0gi69IBgCcDsiP:Bilge.Assert
          !!!, called at test/integration/API/OAuth.hs:419:82 in main:API.OAuth
        Use -p '(!/turn/&&!/user.auth.cookies.limit/)&&/failure - invalid signature/' to rerun this test only.

flake!

@fisx
Copy link
Contributor

fisx commented Jun 28, 2024

integration tests run times on CI:

base line: 9:26:10-9:49:48 => ~23
this PR, last run: 13:54:41-14:15:31 => ~19

not sure how representative these figures are, but they sure don't provide cause for worry. :-)

Co-authored-by: Akshay Mankar <akshay@wire.com>
@@ -94,7 +94,7 @@ newCookie uid cid typ label = do
cookieSucc = Nothing,
cookieValue = tok
}
DB.insertCookie uid c Nothing
adhocSessionStoreInterpreter $ Store.insertCookie uid (toUnitCookie c) Nothing
Copy link
Contributor

Choose a reason for hiding this comment

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

couldn't the effect signature have Cookie any instead of Cookie () to make toUnitCookie unnecessary?

anyway i don't want to create another hold-up. just wondering.

Copy link
Member

@akshaymankar akshaymankar Jul 1, 2024

Choose a reason for hiding this comment

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

It was that, but then writing the mock was a pain. I thought it made more sense anyway to make it () so its clear that the value is not stored.

interpret \case
GetLocalUserAccountByUserKey localUserKey -> case (tUnqualified localUserKey) of
UserEmailKey (EmailKey _ email) -> pure $ find (\u -> userEmail u.accountUser == Just email) initialUsers
UserPhoneKey _ -> pure Nothing -- Phone stuff is deprecated and soon to be deleted anyway
Copy link
Contributor

Choose a reason for hiding this comment

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

i would have made this an error, but ok.

fisx added 2 commits July 1, 2024 10:01
…ser-subsystem-add-password-reset-operation-s' into WPB-8890-polysemy-user-subsystem-add-password-reset-operation-s
@akshaymankar akshaymankar merged commit 6056721 into develop Jul 1, 2024
10 checks passed
@akshaymankar akshaymankar deleted the WPB-8890-polysemy-user-subsystem-add-password-reset-operation-s branch July 1, 2024 08:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
echoes: technical-roadmap/technical-debt More specific category, to highlight Technical Debt being tackled. echoes: technical-roadmap/throughput More specific category, to highlight task aiming at improving the development velocity and effici... 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