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

Recent commit caused custom providers to break #5383

Closed
2 tasks done
vikas-rajvanshy opened this issue Aug 1, 2024 · 3 comments · Fixed by #5398
Closed
2 tasks done

Recent commit caused custom providers to break #5383

vikas-rajvanshy opened this issue Aug 1, 2024 · 3 comments · Fixed by #5398
Assignees
Labels

Comments

@vikas-rajvanshy
Copy link

Initial checklist

  • I understand this is a bug report and questions should be posted in the Community Forum
  • I searched issues and couldn’t find anything (or linked relevant results below)

Link to runnable example

No response

Steps to reproduce

Create a custom provider, when running companion and requesting the custom provider service will throw an exception here:

packages/@uppy/companion/src/server/provider/index.js
module.exports.getProviderMiddleware = (providers, grantConfig) => {
const { secret } = providerOptions[providerName];

Reason is that secret is not set in providerOptions for custom providers (since they have their own object). I believe this is a recent regression from #5249

Expected behavior

Request should not bail for custom providers

Actual behavior

Exception occurs

@Murderlon
Copy link
Member

Hi, do you have a minimal reproducible example for us that fails?

@vikas-rajvanshy
Copy link
Author

vikas-rajvanshy commented Aug 6, 2024

The following custom provider illustrates the issue:

const companionOptions = {
    customProviders: {
		sharefile: {
			config: {
				authorize_url: 'https://secure.sharefile.com/oauth/authorize',
				access_url: 'https://secure.sharefile.com/oauth/token',
				oauth: 2,
				key: 'xxxx',
				secret: 'xxxx',
                                redirect_uri: 'https:<domain>/sharefile/redirect',
			},
			module: ShareFile,
		},
	},    
};

If you make request for this particular provider, it will hit the codepath in middleware that expects it to be in the built in provider set and crash.

mifi added a commit that referenced this issue Aug 9, 2024
@mifi
Copy link
Contributor

mifi commented Aug 9, 2024

#5398

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants