-
Notifications
You must be signed in to change notification settings - Fork 7
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
fix: re-enable support for multiple providers #217
Conversation
we lost this in the D1 migration work - go back to parsing the PROVIDERS env var and use the result as the list of supported providers
I've cleaned this up in a different PR
local was in a weird state, finally bit the bullet and clean/installed
good idea to make sure these are actually ServiceDIDs since that's what the types want
View stack outputs
|
upload-api/config.js
Outdated
* @param {string} providersEnvVar | ||
* @returns {import('@web3-storage/upload-api').ServiceDID[]} | ||
*/ | ||
export function parseProviders(providersEnvVar) { |
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.
This doesn't really have anything to do with providers - it's parsing a CSV of did:web prefixed DIDs. I'd call it something to that effect.
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.
Cool - renamed to parseServiceDids since that's what feels natural for the types. I think this could be further generalized to parseDidWebs
or something but I do want to return ServiceDIDs
in this case and have a ServiceDID-specific error message and don't feel like diving down the generics rabbithole right this sec, so feel pretty good about this level of abstraction for now.
per PR comment, make the name better reflect the implementation
we lost this in the D1 migration work - go back to parsing the PROVIDERS env var and use the result as the list of supported providers