@@ -1441,27 +1441,16 @@ func (a *auth) ResolveJWKS(ctx context.Context, fsys afero.Fs) (string, error) {
1441
1441
jwks .Keys = append (jwks .Keys , rJWKS .Keys ... )
1442
1442
}
1443
1443
1444
- // If SIGNING_KEYS_PATH is provided, read from file and convert to public keys
1445
- if len ( a . SigningKeysPath ) > 0 {
1446
- f , err := fsys . Open ( a . SigningKeysPath )
1444
+ // Convert each signing key to public-only version
1445
+ for _ , key := range a . SigningKeys {
1446
+ publicKeyEncoded , err := json . Marshal ( key . ToPublicJWK () )
1447
1447
if err != nil {
1448
- return "" , errors .Errorf ("failed to read signing key: %w" , err )
1448
+ return "" , errors .Errorf ("failed to marshal public key: %w" , err )
1449
1449
}
1450
- jwtKeysArray , err := fetcher.ParseJSON [[]JWK ](f )
1451
- if err != nil {
1452
- return "" , err
1453
- }
1454
- // Convert each signing key to public-only version
1455
- for _ , key := range jwtKeysArray {
1456
- publicKey := key .ToPublicJWK ()
1457
- publicKeyEncoded , err := json .Marshal (publicKey )
1458
- if err != nil {
1459
- return "" , errors .Errorf ("failed to marshal public key: %w" , err )
1460
- }
1461
- jwks .Keys = append (jwks .Keys , json .RawMessage (publicKeyEncoded ))
1462
- }
1463
- } else {
1464
- // Fallback to JWT_SECRET for backward compatibility
1450
+ jwks .Keys = append (jwks .Keys , json .RawMessage (publicKeyEncoded ))
1451
+ }
1452
+ // Fallback to JWT_SECRET for backward compatibility
1453
+ if len (a .SigningKeys ) == 0 {
1465
1454
jwtSecret := secretJWK {
1466
1455
KeyType : "oct" ,
1467
1456
KeyBase64URL : base64 .RawURLEncoding .EncodeToString ([]byte (a .JwtSecret .Value )),
0 commit comments