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

feat(cab): Use new verifiers with custom domains, update torus libs #4942

Merged
merged 8 commits into from
Feb 23, 2024

Conversation

jophish
Copy link
Contributor

@jophish jophish commented Feb 20, 2024

Description

Kind of a two-birds-one-stone PR, both for ACT-875 and ACT-876. Basically the work that led to this PR progressed as follows:

  • Updated Auth0 to use custom domains for prod/dev
  • Tried to update our custom verifiers in web3auth dashboard to use new Auth0 domains
    • Our existing verifiers were nowhere to be found in the dashboard
    • Created new verifiers using the newest Sapphire main/devnets (as opposed to deprecated Cyan network, which our previous verifiers were on)
  • Had trouble adapting our existing wallet code to integrate with the new verifiers
  • Updated @torus/* libraries and referred to their docs for how to migrate, was able to connect to new verifiers
  • Was able to go through backup + restore using custom Auth0 domains and new verifiers on Alfajores.

This fulfills the requirements for both ACT-875 and ACT-876 AFAICT. I haven't yet tried to directly use the web3auth libs instead of the torus libs; I'll give it a shot, but if it doesn't seem to work, the changes in this ticket should also suffice.

Test plan

Manual tested.

Related issues

Backwards compatibility

This is not backwards compatible, in the sense that someone who's backed up will not be able to restore, but this shouldn't matter since we haven't gone live with CAB yet.

Network scalability

If a new NetworkId and/or Network are added in the future, the changes in this PR will:

  • Continue to work without code changes, OR trigger a compilation error (guaranteeing we find it when a new network is added)

Copy link

codecov bot commented Feb 20, 2024

Codecov Report

Attention: Patch coverage is 91.66667% with 1 lines in your changes are missing coverage. Please review.

Project coverage is 85.43%. Comparing base (b8156cc) to head (dee9e32).

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #4942      +/-   ##
==========================================
+ Coverage   85.36%   85.43%   +0.07%     
==========================================
  Files         716      716              
  Lines       29232    29232              
  Branches     5086     5084       -2     
==========================================
+ Hits        24954    24975      +21     
+ Misses       4039     4018      -21     
  Partials      239      239              
Files Coverage Δ
src/keylessBackup/saga.ts 91.50% <100.00%> (ø)
src/keylessBackup/web3auth.ts 100.00% <100.00%> (+74.07%) ⬆️
src/config.ts 96.22% <80.00%> (-0.89%) ⬇️

... and 2 files with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update b8156cc...dee9e32. Read the comment docs.

"@toruslabs/torus.js": "^6.4.1",
"@toruslabs/constants": "^13.1.0",
"@toruslabs/fetch-node-details": "^13.1.1",
"@toruslabs/torus.js": "^12.1.1",
Copy link
Contributor

Choose a reason for hiding this comment

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

6 major versions! 🤯

Copy link
Contributor

@jh2oman jh2oman left a comment

Choose a reason for hiding this comment

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

Awesome! @jophish can you add test coverage for src/keylessBackup/web3auth.ts ? Then we could close out this TODO https://github.com/valora-inc/wallet/pull/4942/files#diff-85d748cd60f247c80e4683d73906b699e600482591a17a57dc39a382055ee038R9-R10

This comment was marked as duplicate.

This comment was marked as outdated.

@jophish jophish merged commit e916b99 into main Feb 23, 2024
16 checks passed
@jophish jophish deleted the jophish/custom-domains branch February 23, 2024 23:07
jeanregisser added a commit that referenced this pull request Feb 26, 2024
### Description

This fixes the following [error happening during the iOS
build](https://github.com/valora-inc/release-automation/actions/runs/8045843098/job/21971906062):
```
[08:38:58]: ▸ + /opt/homebrew/bin/jq -r '.mainnet|to_entries|map("\(.key)=\(.value|tostring)")|.[]' /Users/runner/work/release-automation/release-automation/wallet/ios/../secrets.json
[08:38:58]: ▸ jq: parse error: Expected another key-value pair at line 18, column 3
```

The problem was introduced in
#4942

### Test plan

iOS build works again.

### Related issues

N/A

### Backwards compatibility

Yes

### Network scalability

If a new NetworkId and/or Network are added in the future, the changes
in this PR will:

- [x] Continue to work without code changes, OR trigger a compilation
error (guaranteeing we find it when a new network is added)
shottah pushed a commit to zed-io/kolektivo that referenced this pull request May 15, 2024
…alora-inc#4942)

### Description

Kind of a two-birds-one-stone PR, both for
[ACT-875](https://linear.app/valora/issue/ACT-875/use-a-custom-domain-with-auth0)
and
[ACT-876](https://linear.app/valora/issue/ACT-876/refactor-gettorusprivatekey-to-use-updated-torusweb3auth-dependencies).
Basically the work that led to this PR progressed as follows:
* Updated Auth0 to use custom domains for prod/dev
* Tried to update our custom verifiers in web3auth dashboard to use new
Auth0 domains
  * Our existing verifiers were nowhere to be found in the dashboard
* Created new verifiers using the newest Sapphire main/devnets (as
opposed to deprecated Cyan network, which our previous verifiers were
on)
* Had trouble adapting our existing wallet code to integrate with the
new verifiers
* Updated `@torus/*` libraries and referred to their docs for how to
migrate, was able to connect to new verifiers
* Was able to go through backup + restore using custom Auth0 domains
_and_ new verifiers on Alfajores.

This fulfills the requirements for both ACT-875 and ACT-876 AFAICT. I
haven't yet tried to directly use the web3auth libs _instead_ of the
torus libs; I'll give it a shot, but if it doesn't seem to work, the
changes in this ticket should also suffice.

### Test plan

Manual tested.

### Related issues

- Fixes
[ACT-875](https://linear.app/valora/issue/ACT-875/use-a-custom-domain-with-auth0)
and
[ACT-876](https://linear.app/valora/issue/ACT-876/refactor-gettorusprivatekey-to-use-updated-torusweb3auth-dependencies).

### Backwards compatibility

This is not backwards compatible, in the sense that someone who's backed
up will not be able to restore, but this shouldn't matter since we
haven't gone live with CAB yet.

### Network scalability

If a new NetworkId and/or Network are added in the future, the changes
in this PR will:

- [x] Continue to work without code changes, OR trigger a compilation
error (guaranteeing we find it when a new network is added)

---------

Co-authored-by: Tom McGuire <Mcgtom10@gmail.com>
Co-authored-by: Jacob Waterman <jacobrwaterman@gmail.com>
shottah pushed a commit to zed-io/kolektivo that referenced this pull request May 15, 2024
### Description

This fixes the following [error happening during the iOS
build](https://github.com/valora-inc/release-automation/actions/runs/8045843098/job/21971906062):
```
[08:38:58]: ▸ + /opt/homebrew/bin/jq -r '.mainnet|to_entries|map("\(.key)=\(.value|tostring)")|.[]' /Users/runner/work/release-automation/release-automation/wallet/ios/../secrets.json
[08:38:58]: ▸ jq: parse error: Expected another key-value pair at line 18, column 3
```

The problem was introduced in
valora-inc#4942

### Test plan

iOS build works again.

### Related issues

N/A

### Backwards compatibility

Yes

### Network scalability

If a new NetworkId and/or Network are added in the future, the changes
in this PR will:

- [x] Continue to work without code changes, OR trigger a compilation
error (guaranteeing we find it when a new network is added)
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.

None yet

3 participants