mirror of
https://github.com/steveiliop56/tinyauth.git
synced 2025-10-28 12:45:47 +00:00
fix: fix key normalization function handing more cases than it needs to
This commit is contained in:
@@ -14,6 +14,8 @@ func TestNormalizeKeys(t *testing.T) {
|
||||
"PROVIDERS_CLIENT1_CLIENT_SECRET": "my-client-secret",
|
||||
"PROVIDERS_MY_AWESOME_CLIENT_CLIENT_ID": "my-awesome-client-id",
|
||||
"PROVIDERS_MY_AWESOME_CLIENT_CLIENT_SECRET_FILE": "/path/to/secret",
|
||||
"I_LOOK_LIKE_A_KEY_CLIENT_ID": "should-not-appear",
|
||||
"PROVIDERS_CLIENT_ID": "should-not-appear",
|
||||
}
|
||||
expected := map[string]string{
|
||||
"tinyauth.providers.client1.clientId": "my-client-id",
|
||||
@@ -31,6 +33,9 @@ func TestNormalizeKeys(t *testing.T) {
|
||||
"providers-client1-client-secret": "my-client-secret",
|
||||
"providers-my-awesome-client-client-id": "my-awesome-client-id",
|
||||
"providers-my-awesome-client-client-secret-file": "/path/to/secret",
|
||||
"providers-should-not-appear-client": "should-not-appear",
|
||||
"i-look-like-a-key-client-id": "should-not-appear",
|
||||
"providers-client-id": "should-not-appear",
|
||||
}
|
||||
expected = map[string]string{
|
||||
"tinyauth.providers.client1.clientId": "my-client-id",
|
||||
|
||||
Reference in New Issue
Block a user