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

fix: VerifyApiKey config getter and conditions #637

Merged

Conversation

stelam
Copy link
Contributor

@stelam stelam commented Oct 24, 2023

I've been experimenting with Filestash, particularly its API, and encountered a weird issue: any API key I provided was being accepted.

I suspect the VerifyApiKey() function has been broken for some time:

  1. The api_key parameter wasn't utilized within the function. All conditions and comparisons were conducted against the apiKey, sourced from the config.
  2. There's a typo in the config path when retrieving the apiKey config value. Consequently, the apiKey value always returns as an empty string. This also means any API key will be accepted if the API_KEY environment variable isn't defined.

Other things (feel free to change):

  • I renamed apiKey to allowedApiKeys for clarity
  • Added the --legacy-peer-deps flag in the contribution doc, that flag seems to be required (and it's also present in the Dockerfile)

@stelam stelam changed the title fix: VerifyApiKey config getter and conditions, update CONTRIBUTING.md fix: VerifyApiKey config getter and conditions Oct 24, 2023
@stelam
Copy link
Contributor Author

stelam commented Oct 30, 2023

PTAL @mickael-kerjean 🙏

@mickael-kerjean mickael-kerjean merged commit 3c379d5 into mickael-kerjean:master Oct 30, 2023
2 of 3 checks passed
@mickael-kerjean
Copy link
Owner

thanks!

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