[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
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

Add auth.keys and deprecate auth.api_keys #466

Merged
merged 2 commits into from
Oct 1, 2024
Merged

Add auth.keys and deprecate auth.api_keys #466

merged 2 commits into from
Oct 1, 2024

Conversation

ronenh
Copy link
Contributor
@ronenh ronenh commented Sep 30, 2024

In order to load API keys from environemnt variables, the keys cannot appear in a map key. If an env var appears in a map key, Viper lowercases its value. In addition, since there is no internal authorization, there's no point in requiring arbitrary identities that aren't ever going to be resolved anywhere.
This PR changes the structure to a list instead of a map.

With these changes, the config looks like this:

auth:
  keys:
    - "asdf1234567890"
    - "${MY_API_KEY}"

The existing api_keys map is still supported but a warning message is logged if it's used.

In order to load API keys from environemnt variables, the keys
cannot appear in a map key. If an env var appears in a map key,
Viper lowercases its value.
@ronenh ronenh changed the title Add auth.keys to config and deprecate auth.api_keys Add auth.keys and deprecate auth.api_keys Sep 30, 2024
@coveralls
Copy link
coveralls commented Sep 30, 2024

Pull Request Test Coverage Report for Build 11127056523

Details

  • 7 of 10 (70.0%) changed or added relevant lines in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.2%) to 28.405%

Changes Missing Coverage Covered Lines Changed/Added Lines %
pkg/cc/config/topaz_config.go 7 10 70.0%
Totals Coverage Status
Change from base Build 11078086130: 0.2%
Covered Lines: 1320
Relevant Lines: 4647

💛 - Coveralls

@ronenh ronenh requested a review from gertd October 1, 2024 14:06
@ronenh ronenh merged commit 54e1c17 into main Oct 1, 2024
5 checks passed
@ronenh ronenh deleted the api-keys branch October 1, 2024 15:38
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.

3 participants