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-8707] Remove phone functionality in the development client API version #4149

Merged
merged 20 commits into from
Jul 29, 2024

Conversation

mdimjasevic
Copy link
Contributor

@mdimjasevic mdimjasevic commented Jul 15, 2024

The PR removes phone numbers and phone functionality from the development client API version, namely from v6.

A couple of up-for-debate choices have been made, and I'm open to discuss them:

  1. The phone key was dropped from Brig's team_invitation DB table. Previous releases were still reading this column. As there is no Team Settings UI action to enter a phone number, so the column was never written to; hence not reading from the column will not miss to read actual phone numbers. Therefore, during deployment this will lead to benign 5xx errors. Related to this, the "phone" field for endpoints that get one or more team invitations is silently ignored and the field has been removed from the request body of the v6 endpoint to send a team invitation.
  2. The "phone" field of the request body to POST /register is now ignored instead of giving an error.

Tracked by https://wearezeta.atlassian.net/browse/WPB-8707.

Checklist

  • Remove the POST /login/send endpoint,
  • Remove the PUT /self/phone endpoint,
  • Remove the DELETE /self/phone endpoint,
  • Modify the GET /self endpoint to remove the phone key from the response,
  • Modify the GET /activate endpoint to remove the phone key from the response,
  • Modify the POST /activate/send endpoint to remove the phone key from the request body, i.e., no ability to send an activation code via SMS,
  • Drop the phone field in the response to the GET /teams/invitations/info endpoint,
  • Drop the phone field in the response to the GET /teams/{tid}/invitations endpoint,
  • Drop the phone field in the response to the GET /teams/{tid}/invitations/{iid} endpoint,
  • Drop the phone field from the request body of POST /teams/{tid}/invitations endpoint,
  • Modify the POST /register endpoint to remove the phone key both from the request and the response,
  • Modify the POST /login endpoint by removing phone-related keys, namely phone and code, from the request body,
  • Modify the POST /activate endpoint by removing the phone key from the request body,
  • 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 Jul 15, 2024
@mdimjasevic mdimjasevic force-pushed the wpb-8707/no-phone-fields-nor-endpoints-v6 branch 18 times, most recently from 9ca6d09 to 5fa63a1 Compare July 22, 2024 13:30
@mdimjasevic mdimjasevic marked this pull request as ready for review July 22, 2024 13:30
@mdimjasevic mdimjasevic force-pushed the wpb-8707/no-phone-fields-nor-endpoints-v6 branch 4 times, most recently from 82940a7 to a244b39 Compare July 24, 2024 09:20
@mdimjasevic mdimjasevic changed the base branch from develop to wpb-10204/db-schema-change July 24, 2024 09:21
Base automatically changed from wpb-10204/db-schema-change to develop July 24, 2024 11:52
Copy link
Contributor

@battermann battermann 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. If there is a good reason not to use the VersionedReqBody wrapper, I'd like to know, and then it's good to go. Otherwise, it might be a sensible change?

:> CanThrow 'InvalidEmail
:> CanThrow 'InvalidPhone
:> "activate"
:> ReqBody '[JSON] ActivateV5
Copy link
Contributor

Choose a reason for hiding this comment

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

I think we have a special type that can be used here as a wrapper: VersionedReqBody

:> CanThrow 'UserKeyExists
:> CanThrow 'InvalidEmail
:> CanThrow 'InvalidPhone
:> CanThrow 'BlacklistedEmail
:> CanThrow 'CustomerExtensionBlockedDomain
:> "activate"
:> "send"
:> ReqBody '[JSON] SendActivationCodeV5
Copy link
Contributor

Choose a reason for hiding this comment

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

Same as above

:> Summary "Authenticate a user to obtain a cookie and first access token"
:> Description "Logins are throttled at the server's discretion"
:> MakesFederatedCall 'Brig "send-connection-action"
:> ReqBody '[JSON] LoginV5
Copy link
Contributor

Choose a reason for hiding this comment

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

Same as above... and more below, will not comment on all

@mdimjasevic mdimjasevic force-pushed the wpb-8707/no-phone-fields-nor-endpoints-v6 branch from a244b39 to efc32b9 Compare July 25, 2024 07:42
mdimjasevic and others added 16 commits July 29, 2024 09:40
For client API versions up to and including V5, the response is the same
and the 'phone' field is always null. The field does not exist in
versions V6 and above.
The response to `POST /register` no longer throws an error when the
request contains a phone number. Instead, the "phone" and "phone_code"
fields are not parsed and are therefore ignored.
The tests should have been dropped when removing phone number support in
client API versions v0..v5 as they lost meaning at least then, if not
even before that.
The test's name is suggesting one, but testing a different thing. The
test does not make much sense in the current situation.
@mdimjasevic mdimjasevic force-pushed the wpb-8707/no-phone-fields-nor-endpoints-v6 branch from 44a031f to e88c6e6 Compare July 29, 2024 07:50
@mdimjasevic mdimjasevic force-pushed the wpb-8707/no-phone-fields-nor-endpoints-v6 branch from e88c6e6 to 1d1171a Compare July 29, 2024 08:42
@mdimjasevic mdimjasevic merged commit 96300a7 into develop Jul 29, 2024
10 checks passed
@mdimjasevic mdimjasevic deleted the wpb-8707/no-phone-fields-nor-endpoints-v6 branch July 29, 2024 10:09
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.

3 participants