-
Notifications
You must be signed in to change notification settings - Fork 22
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: rm upload-api-proxy ability to route to separate environment audiences #407
Conversation
… and did:web:staging.web3.storage audiences
@hugomrdias does this fulfill what you asked for here? |
@@ -60,7 +60,7 @@ unsafe = { bindings = [ | |||
[env.staging] | |||
name = "w3access-staging" | |||
workers_dev = true | |||
vars = { ENV = "staging", DEBUG = "false", DID = "did:web:staging.web3.storage" } | |||
vars = { ENV = "staging", DEBUG = "false", DID = "did:web:staging.web3.storage", UPLOAD_API_URL = "https://staging.up.web3.storage" } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we should define this in all 4 envs
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
like this? a0f07b5
afaict upload-api doesn't have a 'dev' environment so I pointed it to upload-api staging
// use production environment | ||
...uploadApiEnvironments.production, | ||
...(uploadApi.production && { url: uploadApi.production }), | ||
fetch, | ||
}), | ||
[uploadApiEnvironments.staging.audience]: createUcantoHttpConnection({ | ||
...uploadApiEnvironments.staging, | ||
url: uploadApi.staging ?? uploadApiEnvironments.staging.url, | ||
// but override uploadApi.url from configuration, if provided | ||
...uploadApi.ucanto, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do we still need this function ? can't we just create a connection here https://github.com/web3-storage/w3protocol/blob/main/packages/access-api/src/utils/context.js#L48 ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I removed this default behavior by making the relevant options required and removed this function. cc94bad#diff-969dad085be9e4a6140a50e5f0142a0e6f106b12a5c3375f5857006fbe71dab8L74
@@ -55,8 +54,7 @@ export interface RouteContext { | |||
validations: Validations | |||
} | |||
uploadApi: { | |||
production?: URL | |||
staging?: URL | |||
ucanto?: { url: URL } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe we should just have the connection in the context directly
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I did it here, wdyt? cc94bad#diff-a7cd4d05e6cba234e750cd72e2c9301b4cecec823d94002c39e928edd73b5b41L56
…just the url. also remove some code
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
🤖 I have created a release *beep* *boop* --- ## [4.10.0](access-api-v4.9.0...access-api-v4.10.0) (2023-02-16) ### Features * add support for access/authorize and update ([#392](#392)) ([9c8ca0b](9c8ca0b)), closes [#386](#386) * optional override for Postmark email From: field ([#354](#354)) ([f6b2350](f6b2350)) * rm /reproduce-cloudflare-error route ([#426](#426)) ([99cbd2f](99cbd2f)) * rm upload-api-proxy ability to route to separate environment audiences ([#407](#407)) ([5cfe274](5cfe274)) ### Bug Fixes * align postmark/welcome.txt with .html version ([#431](#431)) ([a53d6e6](a53d6e6)) * avoid email delegation via GET request ([#430](#430)) ([d282d6a](d282d6a)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
…diences (#407) Motivation: * #406 * tl;dr remove some code/behavior that's not strictly needed and @hugomrdias asked me to remove
🤖 I have created a release *beep* *boop* --- ## [4.10.0](access-api-v4.9.0...access-api-v4.10.0) (2023-02-16) ### Features * add support for access/authorize and update ([#392](#392)) ([bf41071](bf41071)), closes [#386](#386) * optional override for Postmark email From: field ([#354](#354)) ([00db0ec](00db0ec)) * rm /reproduce-cloudflare-error route ([#426](#426)) ([158f309](158f309)) * rm upload-api-proxy ability to route to separate environment audiences ([#407](#407)) ([eefb6c6](eefb6c6)) ### Bug Fixes * align postmark/welcome.txt with .html version ([#431](#431)) ([0d72795](0d72795)) * avoid email delegation via GET request ([#430](#430)) ([e0f67e8](e0f67e8)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
Motivation: