Skip to content

Commit

Permalink
Remove jwks from auth storage (#461)
Browse files Browse the repository at this point in the history
* Remove jwks from auth storage

* Remove jwks endpoint from storage
  • Loading branch information
vicentepinto98 authored Aug 26, 2024
1 parent dcad93e commit 0c732f9
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 14 deletions.
11 changes: 0 additions & 11 deletions internal/pkg/auth/auth_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,6 @@ func TestAuthenticationConfig(t *testing.T) {
saKey string
privateKeySet bool
tokenEndpoint string
jwksEndpoint string
isValid bool
expectedCustomAuthSet bool
expectedTokenSet bool
Expand Down Expand Up @@ -102,7 +101,6 @@ func TestAuthenticationConfig(t *testing.T) {
saKey: testServiceAccountKey,
privateKeySet: true,
tokenEndpoint: "token_url",
jwksEndpoint: "jwks_url",
isValid: true,
expectedCustomAuthSet: true,
},
Expand All @@ -115,7 +113,6 @@ func TestAuthenticationConfig(t *testing.T) {
saKey: testServiceAccountKey,
privateKeySet: true,
tokenEndpoint: "token_url",
jwksEndpoint: "jwks_url",
isValid: false,
},
{
Expand Down Expand Up @@ -180,7 +177,6 @@ func TestAuthenticationConfig(t *testing.T) {
authFields[REFRESH_TOKEN] = tt.refreshToken
authFields[SERVICE_ACCOUNT_KEY] = tt.saKey
authFields[TOKEN_CUSTOM_ENDPOINT] = tt.tokenEndpoint
authFields[JWKS_CUSTOM_ENDPOINT] = tt.jwksEndpoint

err = SetAuthFlow(tt.flow)
if err != nil {
Expand Down Expand Up @@ -245,7 +241,6 @@ func TestInitKeyFlow(t *testing.T) {
saKey string
privateKeySet bool
tokenEndpoint string
jwksEndpoint string
isValid bool
}{
{
Expand All @@ -255,7 +250,6 @@ func TestInitKeyFlow(t *testing.T) {
saKey: testServiceAccountKey,
privateKeySet: true,
tokenEndpoint: "token_url",
jwksEndpoint: "jwks_url",
isValid: true,
},
{
Expand All @@ -265,7 +259,6 @@ func TestInitKeyFlow(t *testing.T) {
saKey: "",
privateKeySet: true,
tokenEndpoint: "token_url",
jwksEndpoint: "jwks_url",
isValid: false,
},
{
Expand All @@ -275,7 +268,6 @@ func TestInitKeyFlow(t *testing.T) {
saKey: testServiceAccountKey,
privateKeySet: false,
tokenEndpoint: "token_url",
jwksEndpoint: "jwks_url",
isValid: false,
},
{
Expand All @@ -285,7 +277,6 @@ func TestInitKeyFlow(t *testing.T) {
saKey: testServiceAccountKey,
privateKeySet: true,
tokenEndpoint: "token_url",
jwksEndpoint: "jwks_url",
isValid: false,
},
{
Expand All @@ -295,7 +286,6 @@ func TestInitKeyFlow(t *testing.T) {
saKey: testServiceAccountKey,
privateKeySet: true,
tokenEndpoint: "token_url",
jwksEndpoint: "jwks_url",
isValid: false,
},
}
Expand Down Expand Up @@ -326,7 +316,6 @@ func TestInitKeyFlow(t *testing.T) {
authFields[REFRESH_TOKEN] = tt.refreshToken
authFields[SERVICE_ACCOUNT_KEY] = tt.saKey
authFields[TOKEN_CUSTOM_ENDPOINT] = tt.tokenEndpoint
authFields[JWKS_CUSTOM_ENDPOINT] = tt.jwksEndpoint
err = SetAuthFieldMap(authFields)
if err != nil {
t.Fatalf("Failed to set in auth storage: %v", err)
Expand Down
1 change: 0 additions & 1 deletion internal/pkg/auth/service_account.go
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,6 @@ func initKeyFlowWithStorage() (*keyFlowWithStorage, error) {
SERVICE_ACCOUNT_KEY: "",
PRIVATE_KEY: "",
TOKEN_CUSTOM_ENDPOINT: "",
JWKS_CUSTOM_ENDPOINT: "",
}
err := GetAuthFieldMap(authFields)
if err != nil {
Expand Down
2 changes: 0 additions & 2 deletions internal/pkg/auth/storage.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ const (
SERVICE_ACCOUNT_KEY authFieldKey = "service_account_key"
PRIVATE_KEY authFieldKey = "private_key"
TOKEN_CUSTOM_ENDPOINT authFieldKey = "token_custom_endpoint"
JWKS_CUSTOM_ENDPOINT authFieldKey = "jwks_custom_endpoint"
)

const (
Expand All @@ -58,7 +57,6 @@ var authFieldKeys = []authFieldKey{
SERVICE_ACCOUNT_KEY,
PRIVATE_KEY,
TOKEN_CUSTOM_ENDPOINT,
JWKS_CUSTOM_ENDPOINT,
authFlowType,
}

Expand Down

0 comments on commit 0c732f9

Please sign in to comment.