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: rm upload-api-proxy ability to route to separate environment audiences #407

Merged
merged 5 commits into from
Feb 6, 2023

Conversation

gobengo
Copy link
Contributor

@gobengo gobengo commented Jan 30, 2023

Motivation:

@gobengo gobengo temporarily deployed to dev January 30, 2023 22:54 — with GitHub Actions Inactive
@gobengo gobengo temporarily deployed to dev January 30, 2023 22:59 — with GitHub Actions Inactive
@gobengo gobengo changed the title rm upload-api-proxy ability to route to separate environment audiences feat: rm upload-api-proxy ability to route to separate environment audiences Jan 30, 2023
@gobengo
Copy link
Contributor Author

gobengo commented Jan 30, 2023

@hugomrdias does this fulfill what you asked for here?

@gobengo gobengo marked this pull request as ready for review January 30, 2023 23:01
@@ -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" }
Copy link
Contributor

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

Copy link
Contributor Author

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

Comment on lines 78 to 81
// 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,
Copy link
Contributor

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 ?

Copy link
Contributor Author

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 }
Copy link
Contributor

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@gobengo gobengo temporarily deployed to dev January 31, 2023 20:02 — with GitHub Actions Inactive
Copy link
Contributor

@hugomrdias hugomrdias left a comment

Choose a reason for hiding this comment

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

LGTM

@gobengo gobengo temporarily deployed to dev February 3, 2023 20:19 — with GitHub Actions Inactive
@gobengo gobengo merged commit 5cfe274 into main Feb 6, 2023
@gobengo gobengo deleted the 1675118088-no-staging-proxy branch February 6, 2023 23:40
travis pushed a commit that referenced this pull request Feb 16, 2023
🤖 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).
gobengo added a commit that referenced this pull request Apr 11, 2023
…diences (#407)

Motivation:
* #406
* tl;dr remove some code/behavior that's not strictly needed and
@hugomrdias asked me to remove
gobengo pushed a commit that referenced this pull request Apr 11, 2023
🤖 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).
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.

2 participants