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

Implements Uphold /capabilities spec change. #14057

Conversation

szilardszaloki
Copy link
Collaborator

@szilardszaloki szilardszaloki commented Jul 5, 2022

Resolves brave/brave-browser#23849.

Submitter Checklist:

  • I confirm that no security/privacy review is needed, or that I have requested one
  • There is a ticket for my issue
  • Used Github auto-closing keywords in the PR description above
  • Wrote a good PR/commit description
  • Squashed any review feedback or "fixup" commits before merge, so that history is a record of what happened in the repo, not your PR
  • Added appropriate labels (QA/Yes or QA/No; release-notes/include or release-notes/exclude; OS/...) to the associated issue
  • Checked the PR locally: npm run test -- brave_browser_tests, npm run test -- brave_unit_tests, npm run lint, npm run gn_check, npm run tslint
  • Ran git rebase master (if needed)

Reviewer Checklist:

  • A security review is not needed, or a link to one is included in the PR description
  • New files have MPL-2.0 license header
  • Adequate test coverage exists to prevent regressions
  • Major classes, functions and non-trivial code blocks are well-commented
  • Changes in component dependencies are properly reflected in gn
  • Code follows the style guide
  • Test plan is specified in PR before merging

After-merge Checklist:

Test Plan:

Make sure to edit the response of /v0/me/capabilities with Charles Proxy according to the below:

  1. Sufficient capabilities:
    • receives: "enabled": true, "requirements": []
    • sends: "enabled": true, "requirements": []
  2. Insufficient receives 1:
    • receives: "enabled": true, "requirements": [ "user-must-submit-customer-due-diligence" ]
    • sends: "enabled": true, "requirements": []
  3. Insufficient receives 2:
    • receives: "enabled": false, "requirements": []
    • sends: "enabled": true, "requirements": []
  4. Insufficient sends 1:
    • receives: "enabled": true, "requirements": []
    • sends: "enabled": true, "requirements": [ "user-must-submit-customer-due-diligence" ]
  5. Insufficient sends 2:
    • receives: "enabled": true, "requirements": []
    • sends: "enabled": false, "requirements": []
  6. Insufficient receives and sends 1:
    • receives: "enabled": true, "requirements": [ "user-must-submit-customer-due-diligence" ]
    • sends: "enabled": false, "requirements": []
  7. Insufficient receives and sends 2:
    • receives: "enabled": false, "requirements": []
    • sends: "enabled": true, "requirements": [ "user-must-submit-customer-due-diligence" ]

Testing linkage (2. - 7. above):

  • PENDING ==> NOT_CONNECTED (during linking attempt): only modal – no notification (since they haven't been verified)

Upgrade tests (2. - 7. above):

Make sure you're on brave://rewards when upgrading to the new version!

  • VERIFIED ==> NOT_CONNECTED (on Rewards page):
    • modal + notification
    • check in logs that linkage is terminated successfully on server side (search for response of DELETE /v3/wallet/uphold/[wallet-payment-id]/claim)

Make sure you're not on brave://rewards when upgrading to the new version!

  • VERIFIED ==> NOT_CONNECTED (on Rewards panel):
    • only notification – no modal (since they're not on Rewards page)
    • check in logs that linkage is terminated successfully on server side (search for response of DELETE /v3/wallet/uphold/[wallet-payment-id]/claim)

Copy link
Contributor

@emerick emerick left a comment

Choose a reason for hiding this comment

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

LGTM

@szilardszaloki szilardszaloki force-pushed the sszaloki-23849-implement-uphold-capabilities-spec-change branch from 25c454c to 040f90d Compare July 6, 2022 00:01
@szilardszaloki szilardszaloki force-pushed the sszaloki-23849-implement-uphold-capabilities-spec-change branch from 040f90d to 71a31c3 Compare July 6, 2022 21:21
@szilardszaloki szilardszaloki force-pushed the sszaloki-23849-implement-uphold-capabilities-spec-change branch from 71a31c3 to 16551af Compare July 6, 2022 23:58
@szilardszaloki szilardszaloki merged commit d9addf9 into master Jul 7, 2022
@szilardszaloki szilardszaloki deleted the sszaloki-23849-implement-uphold-capabilities-spec-change branch July 7, 2022 13:37
@github-actions github-actions bot added this to the 1.43.x - Nightly milestone Jul 7, 2022
brave-builds pushed a commit that referenced this pull request Jul 7, 2022
@LaurenWags
Copy link
Member

LaurenWags commented Jul 13, 2022

Verified with

Brave | 1.43.20 Chromium: 103.0.5060.114 (Official Build) nightly (x86_64)
-- | --
Revision | a1c2360c5b02a6d4d6ab33796ad8a268a6128226-refs/branch-heads/5060@{#1124}
OS | macOS Version 12.4 (Build 21F79)

Note - while running the below tests you may encounter known issue brave/brave-browser#16376 on the brave://rewards-internals page.

Case 1 - Sufficient capabilities - PASSED

Scenario 1 - Clean profile - PASSED

  1. Launched with a clean profile and staging env
  2. Enabled Rewards and verify w/ Uphold account that has sufficient capabilities
  3. Confirmed /v0/me/capabilities returned as expected for this case per Implements Uphold /capabilities spec change. #14057 (comment)
[ REQUEST ]
> URL: https://api-sandbox.uphold.com/v0/me/capabilities
> Method: GET
[58227:259:0713/143127.147899:VERBOSE6:logging_util.cc(137)] 
[ RESPONSE - OnRequest ]
> Url: https://api-sandbox.uphold.com/v0/me/capabilities
> Result: Success
> HTTP Code: 200
> Body:
........
  {
    "category": "permissions",
    "enabled": true,
    "key": "receives",
    "name": "Receives",
    "requirements": [],
    "restrictions": []
  },
  {
    "category": "permissions",
    "enabled": true,
    "key": "sends",
    "name": "Sends",
    "requirements": [],
    "restrictions": []
  },
..........
  1. Confirmed balance displayed on brave://rewards and panel
  2. Confirmed no notifications/messages about needing to complete additional requirements
Example Example
a b

Scenario 2 - Upgrade profile - on brave://rewards page prior to Upgrade - PASSED

  1. Launched 1.41.x with a clean profile and staging env
  2. Enabled Rewards and verify w/ Uphold account that has sufficient capabilities
  3. Confirmed /v0/me/capabilities returned as expected for this case per Implements Uphold /capabilities spec change. #14057 (comment)
  4. Confirmed balance displayed on brave://rewards and panel
  5. Ensured brave://rewards page was active tab
  6. Closed 1.41.x and "Upgraded" version (renamed profile)
  7. Launched with upgraded version
  8. Confirmed /v0/me/capabilities still returned as expected for this case per Implements Uphold /capabilities spec change. #14057 (comment)
[ REQUEST ]
> URL: https://api-sandbox.uphold.com/v0/me/capabilities
> Method: GET
[58860:259:0713/150617.803329:VERBOSE6:logging_util.cc(137)] 
[ RESPONSE - OnRequest ]
> Url: https://api-sandbox.uphold.com/v0/me/capabilities
> Result: Success
> HTTP Code: 200
> Body:
..........
  {
    "category": "permissions",
    "enabled": true,
    "key": "receives",
    "name": "Receives",
    "requirements": [],
    "restrictions": []
  },
  {
    "category": "permissions",
    "enabled": true,
    "key": "sends",
    "name": "Sends",
    "requirements": [],
    "restrictions": []
  },
............
  1. Confirmed balance displayed on brave://rewards and panel
  2. Confirmed no notifications/messages about needing to complete additional requirements

Scenario 3 - Upgrade profile - brave://rewards page is not open prior to Upgrade - PASSED

  1. Launched 1.41.x with a clean profile and staging env
  2. Enabled Rewards and verify w/ Uphold account that has sufficient capabilities
  3. Confirmed /v0/me/capabilities returned as expected for this case per Implements Uphold /capabilities spec change. #14057 (comment)
  4. Confirmed balance displayed on brave://rewards and panel
  5. Ensured brave://rewards page was not open
  6. Closed 1.41.x and "Upgraded" version (renamed profile)
  7. Launched with upgraded version
  8. Confirmed /v0/me/capabilities still returned as expected for this case per Implements Uphold /capabilities spec change. #14057 (comment)
[ REQUEST ]
> URL: https://api-sandbox.uphold.com/v0/me/capabilities
> Method: GET
[58860:259:0713/150617.803329:VERBOSE6:logging_util.cc(137)] 
[ RESPONSE - OnRequest ]
> Url: https://api-sandbox.uphold.com/v0/me/capabilities
> Result: Success
> HTTP Code: 200
> Body:
..........
  {
    "category": "permissions",
    "enabled": true,
    "key": "receives",
    "name": "Receives",
    "requirements": [],
    "restrictions": []
  },
  {
    "category": "permissions",
    "enabled": true,
    "key": "sends",
    "name": "Sends",
    "requirements": [],
    "restrictions": []
  },
............
  1. Confirmed balance displayed on panel
  2. Confirmed no notifications/messages about needing to complete additional requirements
Case 2 - Insufficient capabilities, receives=1 with requirements - PASSED

Scenario 1 - Clean profile - PASSED

  1. Configured a Charles Proxy rule for the body of /v0/me/capabilities as per Implements Uphold /capabilities spec change. #14057 (comment), ensure rule is running
  2. Launched with a clean profile and staging env
  3. Enabled Rewards and linked Uphold account
  4. Confirmed /v0/me/capabilities was overwritten per the Charles Proxy rule as expected for this case per Implements Uphold /capabilities spec change. #14057 (comment)
[ REQUEST ]
> URL: https://api-sandbox.uphold.com/v0/me/capabilities
> Method: GET
[59329:259:0713/153411.343745:VERBOSE6:logging_util.cc(137)] 
[ RESPONSE - OnRequest ]
> Url: https://api-sandbox.uphold.com/v0/me/capabilities
> Result: Success
> HTTP Code: 200
> Body:
........
  {
    "category": "permissions",
    "enabled": true,
    "key": "receives",
    "name": "Receives",
    "requirements": ["user-must-submit-customer-due-diligence"],
    "restrictions": []
  },
  {
    "category": "permissions",
    "enabled": true,
    "key": "sends",
    "name": "Sends",
    "requirements": [],
    "restrictions": []
  },
........
  1. Confirmed message displayed on brave://rewards page
  2. Confirmed no notification on BAT logo in URL bar
  3. Confirmed balance not shown on brave://rewards page or panel
  4. Confirmed status was as expected on brave://rewards-internals
Example Example
a b

Scenario 2 - Upgrade profile - on brave://rewards page prior to Upgrade - PASSED

  1. Using same Charles Proxy rule from "Clean Profile" case for this scenario, launched 1.41.x with a clean profile and staging env
  2. Enabled Rewards and verify w/ Uphold account
  3. Confirmed balance displayed on brave://rewards and panel
  4. Confirmed /v0/me/capabilities returned as expected for this case per Charles Proxy rule written as per Implements Uphold /capabilities spec change. #14057 (comment)
  5. Ensured brave://rewards page was active tab
  6. Closed 1.41.x
  7. "Upgraded" version (renamed profile) and Launched with upgraded version
  8. Confirmed /v0/me/capabilities still returned as expected for this case per Implements Uphold /capabilities spec change. #14057 (comment)
[ REQUEST ]
> URL: https://api-sandbox.uphold.com/v0/me/capabilities
> Method: GET
[58860:259:0713/150617.803329:VERBOSE6:logging_util.cc(137)] 
[ RESPONSE - OnRequest ]
> Url: https://api-sandbox.uphold.com/v0/me/capabilities
> Result: Success
> HTTP Code: 200
> Body:
..........
  {
    "category": "permissions",
    "enabled": true,
    "key": "receives",
    "name": "Receives",
    "requirements": ["user-must-submit-customer-due-diligence"],
    "restrictions": []
  },
  {
    "category": "permissions",
    "enabled": true,
    "key": "sends",
    "name": "Sends",
    "requirements": [],
    "restrictions": []
  },
............
  1. Confirmed modal and notification (on BAT logo) are shown
  2. Confirmed balance no longer displayed on rewards page or panel
  3. Confirmed status was as expected on brave://rewards-internals (VERIFIED --> NOT CONNECTED)
  4. Confirmed logs showed the below as per the PR:
[ REQUEST ]
> URL: https://grant.rewards.bravesoftware.com/v3/wallet/uphold/eee9bc41-5a0e-4d54-b4eb-cd864e4a8786/claim
> Method: DEL
> Content Type: application/json; charset=utf-8
> Header digest: SHA-256=47DEQpj8HBSa+/TImW+5JCeuQeRkm5NMpJWZG3hSuFU=
> Header signature: keyId="eee9bc41-5a0e-4d54-b4eb-cd864e4a8786",algorithm="ed25519",headers="digest (request-target)",signature="znTfrbNlgfnhwr1HfUoz8lnSZ/fg/ub62egbXJgHAELQk/Q8TN9hMdSIvMBSkwnA9Jj8GhSa987Pr+in5/7PAg=="
> Header accept: application/json
[63796:259:0714/083007.274496:VERBOSE6:logging_util.cc(137)] 
[ RESPONSE - OnRequest ]
> Url: https://grant.rewards.bravesoftware.com/v3/wallet/uphold/eee9bc41-5a0e-4d54-b4eb-cd864e4a8786/claim
[63796:259:0714/083007.274561:VERBOSE9:logging_util.cc(138)] 
[ RESPONSE HEADERS ]
> Url: https://grant.rewards.bravesoftware.com/v3/wallet/uphold/eee9bc41-5a0e-4d54-b4eb-cd864e4a8786/claim
[63796:259:0714/083007.274960:VERBOSE1:uphold.cc(186)] Disconnecting wallet
Example Example Example
a b c

Scenario 3 - Upgrade profile - brave://rewards page is not open prior to Upgrade - PASSED

  1. Using same Charles Proxy rule from "Clean Profile" case for this scenario, launched 1.41.x with a clean profile and staging env
  2. Enabled Rewards and verify w/ Uphold account
  3. Confirmed balance displayed on brave://rewards and panel
  4. Confirmed /v0/me/capabilities returned as expected for this case per Charles Proxy rule written as per Implements Uphold /capabilities spec change. #14057 (comment)
  5. Ensured brave://rewards page was not open tab
  6. Closed 1.41.x
  7. "Upgraded" version (renamed profile) and Launched with upgraded version
  8. Confirmed /v0/me/capabilities still returned as expected for this case per Implements Uphold /capabilities spec change. #14057 (comment)
[ REQUEST ]
> URL: https://api-sandbox.uphold.com/v0/me/capabilities
> Method: GET
[58860:259:0713/150617.803329:VERBOSE6:logging_util.cc(137)] 
[ RESPONSE - OnRequest ]
> Url: https://api-sandbox.uphold.com/v0/me/capabilities
> Result: Success
> HTTP Code: 200
> Body:
..........
  {
    "category": "permissions",
    "enabled": true,
    "key": "receives",
    "name": "Receives",
    "requirements": ["user-must-submit-customer-due-diligence"],
    "restrictions": []
  },
  {
    "category": "permissions",
    "enabled": true,
    "key": "sends",
    "name": "Sends",
    "requirements": [],
    "restrictions": []
  },
............
  1. Confirmed only notification (on BAT logo) is shown (no modal)
  2. Confirmed balance no longer displayed on rewards page or panel
  3. Confirmed status was as expected on brave://rewards-internals (VERIFIED --> NOT CONNECTED)
  4. Confirmed logs showed the below as per the PR:
[ REQUEST ]
> URL: https://grant.rewards.bravesoftware.com/v3/wallet/uphold/eee9bc41-5a0e-4d54-b4eb-cd864e4a8786/claim
> Method: DEL
> Content Type: application/json; charset=utf-8
> Header digest: SHA-256=47DEQpj8HBSa+/TImW+5JCeuQeRkm5NMpJWZG3hSuFU=
> Header signature: keyId="eee9bc41-5a0e-4d54-b4eb-cd864e4a8786",algorithm="ed25519",headers="digest (request-target)",signature="znTfrbNlgfnhwr1HfUoz8lnSZ/fg/ub62egbXJgHAELQk/Q8TN9hMdSIvMBSkwnA9Jj8GhSa987Pr+in5/7PAg=="
> Header accept: application/json
[63981:259:0714/083741.065665:VERBOSE6:logging_util.cc(137)] 
...........
[ RESPONSE - OnRequest ]
> Url: https://grant.rewards.bravesoftware.com/v3/wallet/uphold/eee9bc41-5a0e-4d54-b4eb-cd864e4a8786/claim
[63981:259:0714/083741.230202:VERBOSE9:logging_util.cc(138)] 
[ RESPONSE HEADERS ]
> Url: https://grant.rewards.bravesoftware.com/v3/wallet/uphold/eee9bc41-5a0e-4d54-b4eb-cd864e4a8786/claim
[63981:259:0714/083741.230903:VERBOSE1:uphold.cc(186)] Disconnecting wallet
Example Example
a b
Case 4 - Insufficient capabilities, sends=1 with requirements - PASSED

Scenario 1 - Clean profile - PASSED

  1. Configured a Charles Proxy rule for the body of /v0/me/capabilities as per Implements Uphold /capabilities spec change. #14057 (comment), ensure rule is running
  2. Launched with a clean profile and staging env
  3. Enabled Rewards and linked Uphold account
  4. Confirmed /v0/me/capabilities was overwritten per the Charles Proxy rule as expected for this case per Implements Uphold /capabilities spec change. #14057 (comment)
[ REQUEST ]
> URL: https://api-sandbox.uphold.com/v0/me/capabilities
> Method: GET
[59329:259:0713/153411.343745:VERBOSE6:logging_util.cc(137)] 
[ RESPONSE - OnRequest ]
> Url: https://api-sandbox.uphold.com/v0/me/capabilities
> Result: Success
> HTTP Code: 200
> Body:
........
  {
    "category": "permissions",
    "enabled": true,
    "key": "receives",
    "name": "Receives",
    "requirements": [],
    "restrictions": []
  },
  {
    "category": "permissions",
    "enabled": true,
    "key": "sends",
    "name": "Sends",
    "requirements": ["user-must-submit-customer-due-diligence"],
    "restrictions": []
  },
........
  1. Confirmed message displayed on brave://rewards page
  2. Confirmed no notification on BAT logo in URL bar
  3. Confirmed balance not shown on brave://rewards page or panel
  4. Confirmed status was as expected on brave://rewards-internals
Example Example
a b

Scenario 2 - Upgrade profile - on brave://rewards page prior to Upgrade - PASSED

  1. Using same Charles Proxy rule from "Clean Profile" case for this scenario, launched 1.41.x with a clean profile and staging env
  2. Enabled Rewards and verify w/ Uphold account
  3. Confirmed balance displayed on brave://rewards and panel
  4. Confirmed /v0/me/capabilities returned as expected for this case per Charles Proxy rule written as per Implements Uphold /capabilities spec change. #14057 (comment)
  5. Ensured brave://rewards page was active tab
  6. Closed 1.41.x
  7. "Upgraded" version (renamed profile) and Launched with upgraded version
  8. Confirmed /v0/me/capabilities still returned as expected for this case per Implements Uphold /capabilities spec change. #14057 (comment)
[ REQUEST ]
> URL: https://api-sandbox.uphold.com/v0/me/capabilities
> Method: GET
[58860:259:0713/150617.803329:VERBOSE6:logging_util.cc(137)] 
[ RESPONSE - OnRequest ]
> Url: https://api-sandbox.uphold.com/v0/me/capabilities
> Result: Success
> HTTP Code: 200
> Body:
..........
  {
    "category": "permissions",
    "enabled": true,
    "key": "receives",
    "name": "Receives",
    "requirements": [],
    "restrictions": []
  },
  {
    "category": "permissions",
    "enabled": true,
    "key": "sends",
    "name": "Sends",
    "requirements": ["user-must-submit-customer-due-diligence"],
    "restrictions": []
  },
............
  1. Confirmed modal and notification (on BAT logo) are shown
  2. Confirmed balance no longer displayed on rewards page or panel
  3. Confirmed status was as expected on brave://rewards-internals (VERIFIED --> NOT CONNECTED)
  4. Confirmed logs showed the below as per the PR:
[ REQUEST ]
> URL: https://grant.rewards.bravesoftware.com/v3/wallet/uphold/b97d2673-9f0a-47b1-82b4-9e37456355b6/claim
> Method: DEL
> Content Type: application/json; charset=utf-8
> Header digest: SHA-256=47DEQpj8HBSa+/TImW+5JCeuQeRkm5NMpJWZG3hSuFU=
> Header signature: keyId="b97d2673-9f0a-47b1-82b4-9e37456355b6",algorithm="ed25519",headers="digest (request-target)",signature="KM89izVj1SyL+mK5ox6PZ5WOX+p2+y6UQLw5sOYT8BMrHWlnC4wVyzUqy7H8wp2RnGygUe4tBCl2H5T+mxpWAA=="
> Header accept: application/json
..........
[ RESPONSE - OnRequest ]
> Url: https://grant.rewards.bravesoftware.com/v3/wallet/uphold/b97d2673-9f0a-47b1-82b4-9e37456355b6/claim
> Result: Success
> HTTP Code: 200
> Body: null

[64768:259:0714/092521.240018:VERBOSE9:logging_util.cc(138)] 
[ RESPONSE HEADERS ]
> Url: https://grant.rewards.bravesoftware.com/v3/wallet/uphold/b97d2673-9f0a-47b1-82b4-9e37456355b6/claim
.........
[64768:259:0714/092521.240461:VERBOSE1:uphold.cc(186)] Disconnecting wallet
Example Example Example
a b c

Scenario 3 - Upgrade profile - brave://rewards page is not open prior to Upgrade - PASSED

  1. Using same Charles Proxy rule from "Clean Profile" case for this scenario, launched 1.41.x with a clean profile and staging env
  2. Enabled Rewards and verify w/ Uphold account
  3. Confirmed balance displayed on brave://rewards and panel
  4. Confirmed /v0/me/capabilities returned as expected for this case per Charles Proxy rule written as per Implements Uphold /capabilities spec change. #14057 (comment)
  5. Ensured brave://rewards page was not open tab
  6. Closed 1.41.x
  7. "Upgraded" version (renamed profile) and Launched with upgraded version
  8. Confirmed /v0/me/capabilities still returned as expected for this case per Implements Uphold /capabilities spec change. #14057 (comment)
[ REQUEST ]
> URL: https://api-sandbox.uphold.com/v0/me/capabilities
> Method: GET
[58860:259:0713/150617.803329:VERBOSE6:logging_util.cc(137)] 
[ RESPONSE - OnRequest ]
> Url: https://api-sandbox.uphold.com/v0/me/capabilities
> Result: Success
> HTTP Code: 200
> Body:
..........
  {
    "category": "permissions",
    "enabled": true,
    "key": "receives",
    "name": "Receives",
    "requirements": [],
    "restrictions": []
  },
  {
    "category": "permissions",
    "enabled": true,
    "key": "sends",
    "name": "Sends",
    "requirements": ["user-must-submit-customer-due-diligence"],
    "restrictions": []
  },
............
  1. Confirmed only notification (on BAT logo) is shown (no modal)
  2. Confirmed balance no longer displayed on rewards page or panel
  3. Confirmed status was as expected on brave://rewards-internals (VERIFIED --> NOT CONNECTED)
  4. Confirmed logs showed the below as per the PR:
[ REQUEST ]
> URL: https://grant.rewards.bravesoftware.com/v3/wallet/uphold/b97d2673-9f0a-47b1-82b4-9e37456355b6/claim
> Method: DEL
> Content Type: application/json; charset=utf-8
> Header digest: SHA-256=47DEQpj8HBSa+/TImW+5JCeuQeRkm5NMpJWZG3hSuFU=
> Header signature: keyId="b97d2673-9f0a-47b1-82b4-9e37456355b6",algorithm="ed25519",headers="digest (request-target)",signature="KM89izVj1SyL+mK5ox6PZ5WOX+p2+y6UQLw5sOYT8BMrHWlnC4wVyzUqy7H8wp2RnGygUe4tBCl2H5T+mxpWAA=="
> Header accept: application/json
[64980:259:0714/093750.676672:VERBOSE6:logging_util.cc(137)] 
[ RESPONSE - OnRequest ]
> Url: https://grant.rewards.bravesoftware.com/v3/wallet/uphold/b97d2673-9f0a-47b1-82b4-9e37456355b6/claim
> Result: Success
> HTTP Code: 200
> Body: null
[64980:259:0714/093750.676756:VERBOSE9:logging_util.cc(138)] 
[ RESPONSE HEADERS ]
> Url: https://grant.rewards.bravesoftware.com/v3/wallet/uphold/b97d2673-9f0a-47b1-82b4-9e37456355b6/claim
[64980:259:0714/093750.677237:VERBOSE1:uphold.cc(186)] Disconnecting wallet
Example Example
1 2
Case 3 - Insufficient capabilities, receives=2 - PASSED

Scenario 1 - Clean profile - PASSED

  1. Configured a Charles Proxy rule for the body of /v0/me/capabilities as per Implements Uphold /capabilities spec change. #14057 (comment), ensure rule is running
  2. Launched with a clean profile and staging env
  3. Enabled Rewards and linked Uphold account
  4. Confirmed /v0/me/capabilities was overwritten per the Charles Proxy rule as expected for this case per Implements Uphold /capabilities spec change. #14057 (comment)
[ REQUEST ]
> URL: https://api-sandbox.uphold.com/v0/me/capabilities
> Method: GET
[59329:259:0713/153411.343745:VERBOSE6:logging_util.cc(137)] 
[ RESPONSE - OnRequest ]
> Url: https://api-sandbox.uphold.com/v0/me/capabilities
> Result: Success
> HTTP Code: 200
> Body:
........
  {
    "category": "permissions",
    "enabled": false,
    "key": "receives",
    "name": "Receives",
    "requirements": [],
    "restrictions": []
  },
  {
    "category": "permissions",
    "enabled": true,
    "key": "sends",
    "name": "Sends",
    "requirements": [],
    "restrictions": []
  },
........
  1. Confirmed message displayed on brave://rewards page
  2. Confirmed no notification on BAT logo in URL bar
  3. Confirmed balance not shown on brave://rewards page or panel
  4. Confirmed status was as expected on brave://rewards-internals
Example Example
a b

Scenario 2 - Upgrade profile - on brave://rewards page prior to Upgrade - PASSED

  1. Using same Charles Proxy rule from "Clean Profile" case for this scenario, launched 1.41.x with a clean profile and staging env
  2. Enabled Rewards and verify w/ Uphold account
  3. Confirmed /v0/me/capabilities returned as expected for this case per Charles Proxy rule written as per Implements Uphold /capabilities spec change. #14057 (comment)
  4. Confirm unable to verify wallet due to "sends" or "receives" being false (implemented with previously with Implement error modal if user does not have receives OR sends capabilities on Uphold brave-browser#22508)
  • modal with message is shown
  • no balance displayed on rewards page or panel
  1. Ensured brave://rewards page was active tab
  2. Closed 1.41.x
  3. "Upgraded" version (renamed profile) and Launched with upgraded version
  4. Confirmed status was as expected on brave://rewards-internals (still NOT CONNECTED)
  5. Attempt to link account again (with Charles Proxy still running the rewrite rule)
  6. Confirmed /v0/me/capabilities still returned as expected for this case per Implements Uphold /capabilities spec change. #14057 (comment)
[ REQUEST ]
> URL: https://api-sandbox.uphold.com/v0/me/capabilities
> Method: GET
[58860:259:0713/150617.803329:VERBOSE6:logging_util.cc(137)] 
[ RESPONSE - OnRequest ]
> Url: https://api-sandbox.uphold.com/v0/me/capabilities
> Result: Success
> HTTP Code: 200
> Body:
..........
  {
    "category": "permissions",
    "enabled": false,
    "key": "receives",
    "name": "Receives",
    "requirements": [],
    "restrictions": []
  },
  {
    "category": "permissions",
    "enabled": true,
    "key": "sends",
    "name": "Sends",
    "requirements": [],
    "restrictions": []
  },
............
  1. Confirmed modal message is shown
  2. Confirmed balance not displayed on rewards page or panel
  3. Confirmed status was as expected on brave://rewards-internals (still NOT CONNECTED)
Example Example
a b

Scenario 3 - Upgrade profile - brave://rewards page not open prior to Upgrade - PASSED

  1. Using same Charles Proxy rule from "Clean Profile" case for this scenario, launched 1.41.x with a clean profile and staging env
  2. Enabled Rewards and verify w/ Uphold account
  3. Confirmed /v0/me/capabilities returned as expected for this case per Charles Proxy rule written as per Implements Uphold /capabilities spec change. #14057 (comment)
  4. Confirm unable to verify wallet due to "sends" or "receives" being false (implemented with previously with Implement error modal if user does not have receives OR sends capabilities on Uphold brave-browser#22508)
  • modal with message is shown
  • no balance displayed on rewards page or panel
  1. Ensured brave://rewards page was not open
  2. Closed 1.41.x
  3. "Upgraded" version (renamed profile) and Launched with upgraded version
  4. Confirmed status was as expected on brave://rewards-internals (still NOT CONNECTED)
  5. Attempt to link account again (with Charles Proxy still running the rewrite rule)
  6. Confirmed /v0/me/capabilities still returned as expected for this case per Implements Uphold /capabilities spec change. #14057 (comment)
[ REQUEST ]
> URL: https://api-sandbox.uphold.com/v0/me/capabilities
> Method: GET
[58860:259:0713/150617.803329:VERBOSE6:logging_util.cc(137)] 
[ RESPONSE - OnRequest ]
> Url: https://api-sandbox.uphold.com/v0/me/capabilities
> Result: Success
> HTTP Code: 200
> Body:
..........
  {
    "category": "permissions",
    "enabled": false,
    "key": "receives",
    "name": "Receives",
    "requirements": [],
    "restrictions": []
  },
  {
    "category": "permissions",
    "enabled": true,
    "key": "sends",
    "name": "Sends",
    "requirements": [],
    "restrictions": []
  },
............
  1. Confirmed modal message is shown
  2. Confirmed balance not displayed on rewards page or panel
  3. Confirmed status was as expected on brave://rewards-internals (still NOT CONNECTED)
Example Example
a b
Case 5 - Insufficient capabilities, sends=2 - PASSED

Scenario 1 - Clean profile - PASSED

  1. Configured a Charles Proxy rule for the body of /v0/me/capabilities as per Implements Uphold /capabilities spec change. #14057 (comment), ensure rule is running
  2. Launched with a clean profile and staging env
  3. Enabled Rewards and linked Uphold account
  4. Confirmed /v0/me/capabilities was overwritten per the Charles Proxy rule as expected for this case per Implements Uphold /capabilities spec change. #14057 (comment)
[ REQUEST ]
> URL: https://api-sandbox.uphold.com/v0/me/capabilities
> Method: GET
[59329:259:0713/153411.343745:VERBOSE6:logging_util.cc(137)] 
[ RESPONSE - OnRequest ]
> Url: https://api-sandbox.uphold.com/v0/me/capabilities
> Result: Success
> HTTP Code: 200
> Body:
........
  {
    "category": "permissions",
    "enabled": true,
    "key": "receives",
    "name": "Receives",
    "requirements": [],
    "restrictions": []
  },
  {
    "category": "permissions",
    "enabled": false,
    "key": "sends",
    "name": "Sends",
    "requirements": [],
    "restrictions": []
  },
........
  1. Confirmed message displayed on brave://rewards page
  2. Confirmed no notification on BAT logo in URL bar
  3. Confirmed balance not shown on brave://rewards page or panel
  4. Confirmed status was as expected on brave://rewards-internals
Example Example
a b

Scenario 2 - Upgrade profile - on brave://rewards page prior to Upgrade - PASSED

  1. Using same Charles Proxy rule from "Clean Profile" case for this scenario, launched 1.41.x with a clean profile and staging env
  2. Enabled Rewards and verify w/ Uphold account
  3. Confirmed /v0/me/capabilities returned as expected for this case per Charles Proxy rule written as per Implements Uphold /capabilities spec change. #14057 (comment)
  4. Confirm unable to verify wallet due to "sends" or "receives" being false (implemented with previously with Implement error modal if user does not have receives OR sends capabilities on Uphold brave-browser#22508)
  • modal with message is shown
  • no balance displayed on rewards page or panel
  1. Ensured brave://rewards page was active tab
  2. Closed 1.41.x
  3. "Upgraded" version (renamed profile) and Launched with upgraded version
  4. Confirmed status was as expected on brave://rewards-internals (still NOT CONNECTED)
  5. Attempt to link account again (with Charles Proxy still running the rewrite rule)
  6. Confirmed /v0/me/capabilities still returned as expected for this case per Implements Uphold /capabilities spec change. #14057 (comment)
[ REQUEST ]
> URL: https://api-sandbox.uphold.com/v0/me/capabilities
> Method: GET
[58860:259:0713/150617.803329:VERBOSE6:logging_util.cc(137)] 
[ RESPONSE - OnRequest ]
> Url: https://api-sandbox.uphold.com/v0/me/capabilities
> Result: Success
> HTTP Code: 200
> Body:
..........
  {
    "category": "permissions",
    "enabled": true,
    "key": "receives",
    "name": "Receives",
    "requirements": [],
    "restrictions": []
  },
  {
    "category": "permissions",
    "enabled": false,
    "key": "sends",
    "name": "Sends",
    "requirements": [],
    "restrictions": []
  },
............
  1. Confirmed modal message is shown
  2. Confirmed balance not displayed on rewards page or panel
  3. Confirmed status was as expected on brave://rewards-internals (still NOT CONNECTED)
Example Example
a b

Scenario 3 - Upgrade profile - brave://rewards page not open prior to Upgrade - PASSED

  1. Using same Charles Proxy rule from "Clean Profile" case for this scenario, launched 1.41.x with a clean profile and staging env
  2. Enabled Rewards and verify w/ Uphold account
  3. Confirmed /v0/me/capabilities returned as expected for this case per Charles Proxy rule written as per Implements Uphold /capabilities spec change. #14057 (comment)
  4. Confirm unable to verify wallet due to "sends" or "receives" being false (implemented with previously with Implement error modal if user does not have receives OR sends capabilities on Uphold brave-browser#22508)
  • modal with message is shown
  • no balance displayed on rewards page or panel
  1. Ensured brave://rewards page was not open
  2. Closed 1.41.x
  3. "Upgraded" version (renamed profile) and Launched with upgraded version
  4. Confirmed status was as expected on brave://rewards-internals (still NOT CONNECTED)
  5. Attempt to link account again (with Charles Proxy still running the rewrite rule)
  6. Confirmed /v0/me/capabilities still returned as expected for this case per Implements Uphold /capabilities spec change. #14057 (comment)
[ REQUEST ]
> URL: https://api-sandbox.uphold.com/v0/me/capabilities
> Method: GET
[58860:259:0713/150617.803329:VERBOSE6:logging_util.cc(137)] 
[ RESPONSE - OnRequest ]
> Url: https://api-sandbox.uphold.com/v0/me/capabilities
> Result: Success
> HTTP Code: 200
> Body:
..........
  {
    "category": "permissions",
    "enabled": true,
    "key": "receives",
    "name": "Receives",
    "requirements": [],
    "restrictions": []
  },
  {
    "category": "permissions",
    "enabled": false,
    "key": "sends",
    "name": "Sends",
    "requirements": [],
    "restrictions": []
  },
............
  1. Confirmed modal message is shown
  2. Confirmed balance not displayed on rewards page or panel
  3. Confirmed status was as expected on brave://rewards-internals (still NOT CONNECTED)
Example Example
a b
Case 6 - Insufficient capabilities, receives=1 with requirements, sends=2 - PASSED

Scenario 1 - Clean profile - PASSED

  1. Configured a Charles Proxy rule for the body of /v0/me/capabilities as per Implements Uphold /capabilities spec change. #14057 (comment), ensure rule is running
  2. Launched with a clean profile and staging env
  3. Enabled Rewards and linked Uphold account
  4. Confirmed /v0/me/capabilities was overwritten per the Charles Proxy rule as expected for this case per Implements Uphold /capabilities spec change. #14057 (comment)
[ REQUEST ]
> URL: https://api-sandbox.uphold.com/v0/me/capabilities
> Method: GET
[59329:259:0713/153411.343745:VERBOSE6:logging_util.cc(137)] 
[ RESPONSE - OnRequest ]
> Url: https://api-sandbox.uphold.com/v0/me/capabilities
> Result: Success
> HTTP Code: 200
> Body:
........
  {
    "category": "permissions",
    "enabled": true,
    "key": "receives",
    "name": "Receives",
    "requirements": ["user-must-submit-customer-due-diligence"],
    "restrictions": []
  },
  {
    "category": "permissions",
    "enabled": false,
    "key": "sends",
    "name": "Sends",
    "requirements": [],
    "restrictions": []
  },
........
  1. Confirmed message displayed on brave://rewards page
  2. Confirmed no notification on BAT logo in URL bar
  3. Confirmed balance not shown on brave://rewards page or panel
  4. Confirmed status was as expected on brave://rewards-internals
Example Example
a b

Scenario 2 - Upgrade profile - on brave://rewards page prior to Upgrade - PASSED

  1. Using same Charles Proxy rule from "Clean Profile" case for this scenario, launched 1.41.x with a clean profile and staging env
  2. Enabled Rewards and verify w/ Uphold account
  3. Confirmed /v0/me/capabilities returned as expected for this case per Charles Proxy rule written as per Implements Uphold /capabilities spec change. #14057 (comment)
  4. Confirm unable to verify wallet due to "sends" or "receives" being false (implemented with previously with Implement error modal if user does not have receives OR sends capabilities on Uphold brave-browser#22508)
  • modal with message is shown
  • no balance displayed on rewards page or panel
  1. Ensured brave://rewards page was active tab
  2. Closed 1.41.x
  3. "Upgraded" version (renamed profile) and Launched with upgraded version
  4. Confirmed status was as expected on brave://rewards-internals (still NOT CONNECTED)
  5. Attempt to link account again (with Charles Proxy still running the rewrite rule)
  6. Confirmed /v0/me/capabilities still returned as expected for this case per Implements Uphold /capabilities spec change. #14057 (comment)
[ REQUEST ]
> URL: https://api-sandbox.uphold.com/v0/me/capabilities
> Method: GET
[58860:259:0713/150617.803329:VERBOSE6:logging_util.cc(137)] 
[ RESPONSE - OnRequest ]
> Url: https://api-sandbox.uphold.com/v0/me/capabilities
> Result: Success
> HTTP Code: 200
> Body:
..........
  {
    "category": "permissions",
    "enabled": true,
    "key": "receives",
    "name": "Receives",
    "requirements": ["user-must-submit-customer-due-diligence"],
    "restrictions": []
  },
  {
    "category": "permissions",
    "enabled": false,
    "key": "sends",
    "name": "Sends",
    "requirements": [],
    "restrictions": []
  },
............
  1. Confirmed modal message is shown
  2. Confirmed balance not displayed on rewards page or panel
  3. Confirmed status was as expected on brave://rewards-internals (still NOT CONNECTED)
Example Example
a b

Scenario 3 - Upgrade profile - brave://rewards page not open prior to Upgrade - PASSED

  1. Using same Charles Proxy rule from "Clean Profile" case for this scenario, launched 1.41.x with a clean profile and staging env
  2. Enabled Rewards and verify w/ Uphold account
  3. Confirmed /v0/me/capabilities returned as expected for this case per Charles Proxy rule written as per Implements Uphold /capabilities spec change. #14057 (comment)
  4. Confirm unable to verify wallet due to "sends" or "receives" being false (implemented with previously with Implement error modal if user does not have receives OR sends capabilities on Uphold brave-browser#22508)
  • modal with message is shown
  • no balance displayed on rewards page or panel
  1. Ensured brave://rewards page was not open
  2. Closed 1.41.x
  3. "Upgraded" version (renamed profile) and Launched with upgraded version
  4. Confirmed status was as expected on brave://rewards-internals (still NOT CONNECTED)
  5. Attempt to link account again (with Charles Proxy still running the rewrite rule)
  6. Confirmed /v0/me/capabilities still returned as expected for this case per Implements Uphold /capabilities spec change. #14057 (comment)
[ REQUEST ]
> URL: https://api-sandbox.uphold.com/v0/me/capabilities
> Method: GET
[58860:259:0713/150617.803329:VERBOSE6:logging_util.cc(137)] 
[ RESPONSE - OnRequest ]
> Url: https://api-sandbox.uphold.com/v0/me/capabilities
> Result: Success
> HTTP Code: 200
> Body:
..........
  {
    "category": "permissions",
    "enabled": true,
    "key": "receives",
    "name": "Receives",
    "requirements": ["user-must-submit-customer-due-diligence"],
    "restrictions": []
  },
  {
    "category": "permissions",
    "enabled": false,
    "key": "sends",
    "name": "Sends",
    "requirements": [],
    "restrictions": []
  },
............
  1. Confirmed modal message is shown
  2. Confirmed balance not displayed on rewards page or panel
  3. Confirmed status was as expected on brave://rewards-internals (still NOT CONNECTED)
Example Example
a b
Case 7 - Insufficient capabilities, receives=2, sends=1 with requirements - PASSED

Scenario 1 - Clean profile - PASSED

  1. Configured a Charles Proxy rule for the body of /v0/me/capabilities as per Implements Uphold /capabilities spec change. #14057 (comment), ensure rule is running
  2. Launched with a clean profile and staging env
  3. Enabled Rewards and linked Uphold account
  4. Confirmed /v0/me/capabilities was overwritten per the Charles Proxy rule as expected for this case per Implements Uphold /capabilities spec change. #14057 (comment)
[ REQUEST ]
> URL: https://api-sandbox.uphold.com/v0/me/capabilities
> Method: GET
[59329:259:0713/153411.343745:VERBOSE6:logging_util.cc(137)] 
[ RESPONSE - OnRequest ]
> Url: https://api-sandbox.uphold.com/v0/me/capabilities
> Result: Success
> HTTP Code: 200
> Body:
........
  {
    "category": "permissions",
    "enabled": false,
    "key": "receives",
    "name": "Receives",
    "requirements": [],
    "restrictions": []
  },
  {
    "category": "permissions",
    "enabled": true,
    "key": "sends",
    "name": "Sends",
    "requirements": ["user-must-submit-customer-due-diligence"],
    "restrictions": []
  },
........
  1. Confirmed message displayed on brave://rewards page
  2. Confirmed no notification on BAT logo in URL bar
  3. Confirmed balance not shown on brave://rewards page or panel
  4. Confirmed status was as expected on brave://rewards-internals
Example Example
a b

Scenario 2 - Upgrade profile - on brave://rewards page prior to Upgrade - PASSED

  1. Using same Charles Proxy rule from "Clean Profile" case for this scenario, launched 1.41.x with a clean profile and staging env
  2. Enabled Rewards and verify w/ Uphold account
  3. Confirmed /v0/me/capabilities returned as expected for this case per Charles Proxy rule written as per Implements Uphold /capabilities spec change. #14057 (comment)
  4. Confirm unable to verify wallet due to "sends" or "receives" being false (implemented with previously with Implement error modal if user does not have receives OR sends capabilities on Uphold brave-browser#22508)
  • modal with message is shown
  • no balance displayed on rewards page or panel
  1. Ensured brave://rewards page was active tab
  2. Closed 1.41.x
  3. "Upgraded" version (renamed profile) and Launched with upgraded version
  4. Confirmed status was as expected on brave://rewards-internals (still NOT CONNECTED)
  5. Attempt to link account again (with Charles Proxy still running the rewrite rule)
  6. Confirmed /v0/me/capabilities still returned as expected for this case per Implements Uphold /capabilities spec change. #14057 (comment)
[ REQUEST ]
> URL: https://api-sandbox.uphold.com/v0/me/capabilities
> Method: GET
[58860:259:0713/150617.803329:VERBOSE6:logging_util.cc(137)] 
[ RESPONSE - OnRequest ]
> Url: https://api-sandbox.uphold.com/v0/me/capabilities
> Result: Success
> HTTP Code: 200
> Body:
..........
  {
    "category": "permissions",
    "enabled": false,
    "key": "receives",
    "name": "Receives",
    "requirements": [],
    "restrictions": []
  },
  {
    "category": "permissions",
    "enabled": true,
    "key": "sends",
    "name": "Sends",
    "requirements": ["user-must-submit-customer-due-diligence"],
    "restrictions": []
  },
............
  1. Confirmed modal message is shown
  2. Confirmed balance not displayed on rewards page or panel
  3. Confirmed status was as expected on brave://rewards-internals (still NOT CONNECTED)
Example Example
a b

Scenario 3 - Upgrade profile - brave://rewards page not open prior to Upgrade - PASSED

  1. Using same Charles Proxy rule from "Clean Profile" case for this scenario, launched 1.41.x with a clean profile and staging env
  2. Enabled Rewards and verify w/ Uphold account
  3. Confirmed /v0/me/capabilities returned as expected for this case per Charles Proxy rule written as per Implements Uphold /capabilities spec change. #14057 (comment)
  4. Confirm unable to verify wallet due to "sends" or "receives" being false (implemented with previously with Implement error modal if user does not have receives OR sends capabilities on Uphold brave-browser#22508)
  • modal with message is shown
  • no balance displayed on rewards page or panel
  1. Ensured brave://rewards page was not open
  2. Closed 1.41.x
  3. "Upgraded" version (renamed profile) and Launched with upgraded version
  4. Confirmed status was as expected on brave://rewards-internals (still NOT CONNECTED)
  5. Attempt to link account again (with Charles Proxy still running the rewrite rule)
  6. Confirmed /v0/me/capabilities still returned as expected for this case per Implements Uphold /capabilities spec change. #14057 (comment)
[ REQUEST ]
> URL: https://api-sandbox.uphold.com/v0/me/capabilities
> Method: GET
[58860:259:0713/150617.803329:VERBOSE6:logging_util.cc(137)] 
[ RESPONSE - OnRequest ]
> Url: https://api-sandbox.uphold.com/v0/me/capabilities
> Result: Success
> HTTP Code: 200
> Body:
..........
  {
    "category": "permissions",
    "enabled": false,
    "key": "receives",
    "name": "Receives",
    "requirements": [],
    "restrictions": []
  },
  {
    "category": "permissions",
    "enabled": true,
    "key": "sends",
    "name": "Sends",
    "requirements": ["user-must-submit-customer-due-diligence"],
    "restrictions": []
  },
............
  1. Confirmed modal message is shown
  2. Confirmed balance not displayed on rewards page or panel
  3. Confirmed status was as expected on brave://rewards-internals (still NOT CONNECTED)
Example Example
a b
Additional Notes

Test cases differ slightly from those mentioned in PR due to discussion with Szilard. Confirmed the following with him prior to verification:

Screen Shot 2022-07-14 at 12 45 45 PM

With the above,

Case 1 - no modals/notifications ever (this is happy path, user is all verified and good)
Case 1 - no messages in log/terminal since linkage isn't removed after upgrade
Case 2, 4 - modals/notifications on upgrade will be displayed depending on which page is active on upgrade
Case 2, 4 - messages in log/terminal due to removal of linkage after upgrade
Case 3, 5, 6, 7 - no modals/notifications on upgrade due to being NOT_CONNECTED prior to upgrade
Case 3, 5, 6, 7 - no messages in log/terminal (as seen with 2,4 after upgrade) since there was no linkage in previous version

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Uphold /capabilities endpoint spec changed — need to adjust get_capabilities
4 participants