More refactoring and code restructure

This commit is contained in:
David Allen 2024-03-10 20:20:53 -06:00
parent 45e8cd7f15
commit f6bf8a8960
No known key found for this signature in database
GPG key ID: 1D2A29322FBB6FCB
4 changed files with 254 additions and 40 deletions

View file

@ -16,7 +16,7 @@ type IdentityProvider struct {
Issuer string `db:"issuer" json:"issuer" yaml:"issuer"`
Endpoints Endpoints `db:"endpoints" json:"endpoints" yaml:"endpoints"`
Supported Supported `db:"supported" json:"supported" yaml:"supported"`
Jwks jwk.Set
KeySet jwk.Set
}
type Endpoints struct {
@ -142,7 +142,7 @@ func (p *IdentityProvider) FetchJwks() error {
ctx, cancel := context.WithCancel(context.Background())
defer cancel()
var err error
p.Jwks, err = jwk.Fetch(ctx, p.Endpoints.JwksUri)
p.KeySet, err = jwk.Fetch(ctx, p.Endpoints.JwksUri)
if err != nil {
return fmt.Errorf("failed to fetch JWKS: %v", err)
}