Skip to content

Commit

Permalink
feat!: fold access-api into upload-api (#194)
Browse files Browse the repository at this point in the history
Get `@web3-storage/access-api` handlers running in the `upload-api`
service.

This introduces two new DynamoDB tables to store "delegations" and
"provisions". NB: I have a related PR in
#200 that uses "consumers"
and "subscriptions" tables rather than "provisions".

This also adds a new Lambda to handle the email verification flow - I've
brought some HTML utilities over from `@web3-storage/access-api` for
this purpose and wired the handlers up to the same path they were at in
the old service `/validate-email`.

This is the part 2 of a larger project (started in
storacha/w3up#790) to integrate the access
service into the w3infra upload service, which will let us move
operational details out of w3up, retire D1, consolidate our operations
around AWS Lambdas, deprecate now-unused functionality like the voucher
flows and generally streamline our UCAN handlers and the infrastructure
that supports them.

---------

Co-authored-by: Irakli Gozalishvili <[email protected]>
  • Loading branch information
travis and Gozala authored Jul 18, 2023
1 parent 3aefc29 commit f2a7a11
Show file tree
Hide file tree
Showing 39 changed files with 16,967 additions and 3,741 deletions.
12 changes: 8 additions & 4 deletions .env.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,10 @@
EIPFS_INDEXER_SQS_ARN = 'arn:aws:sqs:us-west-2:505595374361:staging-ep-indexer-topic'
EIPFS_INDEXER_SQS_URL = 'https://sqs.us-west-2.amazonaws.com/505595374361/staging-ep-indexer-topic'

# Following variables are only required to run integration tests
INTEGRATION_TESTS_UCAN_KEY = ''
INTEGRATION_TESTS_PROOF = ''

ACCESS_SERVICE_DID = ''
UPLOAD_API_DID = ''
ACCESS_SERVICE_URL = ''
POSTMARK_TOKEN = ''
R2_ACCESS_KEY_ID = ''
R2_CARPARK_BUCKET_NAME = ''
R2_DUDEWHERE_BUCKET_NAME = ''
Expand All @@ -30,3 +27,10 @@ R2_SATNAV_BUCKET_NAME = ''
R2_SECRET_ACCESS_KEY = ''
R2_UCAN_BUCKET_NAME = ''
SATNAV_BUCKET_NAME = ''

# Following variables are only required to run integration tests

# Mailslurp
MAILSLURP_API_KEY = ''
MAILSLURP_TIMEOUT = '120000'

2 changes: 1 addition & 1 deletion .github/workflows/fetch-metrics-for-space.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
- uses: actions/setup-node@v3
with:
registry-url: 'https://registry.npmjs.org'
node-version: 16
node-version: 18
cache: 'npm'
- run: npm ci
- name: Run job
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
- uses: actions/setup-node@v3
with:
registry-url: 'https://registry.npmjs.org'
node-version: 16
node-version: 18
cache: 'npm'
- run: npm ci
- run: npm run lint
Expand Down
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,14 @@ AWS ARN for Elastic IPFS SQS indexer used to request Elastic IPFS to index given

AWS URL for Elastic IPFS SQS indexer used to request Elastic IPFS to index given CAR files.

#### `POSTMARK_TOKEN`

Postmark API token, which is used by the email verification system to send emails.

#### `MAILSLURP_API_KEY`

API token for [Mailslurp](https://www.mailslurp.com/), which is used in [integration tests](./test/integration.test.js). To invalidate or refresh tokens, head to the [Mailslurp dashboard](https://app.mailslurp.com/dashboard/).

### Secrets

Set production secrets in aws SSM via [`sst secrets`](https://docs.sst.dev/config#sst-secrets). The region must be set to the one you deploy that stage to
Expand Down
Loading

0 comments on commit f2a7a11

Please sign in to comment.