Move options to the provisioner.

pull/312/head
Mariano Cano 4 years ago
parent 206bc6757a
commit ca2fb42d68

@ -26,12 +26,13 @@ type stepPayload struct {
// JWK is the default provisioner, an entity that can sign tokens necessary for // JWK is the default provisioner, an entity that can sign tokens necessary for
// signature requests. // signature requests.
type JWK struct { type JWK struct {
base *base
Type string `json:"type"` Type string `json:"type"`
Name string `json:"name"` Name string `json:"name"`
Key *jose.JSONWebKey `json:"key"` Key *jose.JSONWebKey `json:"key"`
EncryptedKey string `json:"encryptedKey,omitempty"` EncryptedKey string `json:"encryptedKey,omitempty"`
Claims *Claims `json:"claims,omitempty"` Claims *Claims `json:"claims,omitempty"`
Options *ProvisionerOptions `json:"options"`
claimer *Claimer claimer *Claimer
audiences Audiences audiences Audiences
} }

@ -245,7 +245,7 @@ func (l *List) UnmarshalJSON(data []byte) error {
continue continue
} }
if err := json.Unmarshal(data, p); err != nil { if err := json.Unmarshal(data, p); err != nil {
return errors.Errorf("error unmarshaling provisioner") return errors.Wrap(err, "error unmarshaling provisioner")
} }
*l = append(*l, p) *l = append(*l, p)
} }
@ -279,9 +279,7 @@ func SanitizeSSHUserPrincipal(email string) string {
}, strings.ToLower(email)) }, strings.ToLower(email))
} }
type base struct { type base struct{}
Options *ProvisionerOptions `json:"options"`
}
// AuthorizeSign returns an unimplemented error. Provisioners should overwrite // AuthorizeSign returns an unimplemented error. Provisioners should overwrite
// this method if they will support authorizing tokens for signing x509 Certificates. // this method if they will support authorizing tokens for signing x509 Certificates.

Loading…
Cancel
Save