Documentation
¶
Index ¶
- func GenerateJti() string
- func GetJwks(jwksUrl string) (*keyfunc.JWKS, error)
- type DecentralizedIdentifier
- type EmailIdentifier
- type EventSubject
- type ExternalIdentifier
- type IssuerSubjectIdentifier
- type OpaqueIdentifier
- type PhoneNumberIdentifier
- type SecurityEventToken
- func (set *SecurityEventToken) AddEventPayload(eventUri string, eventClaims map[string]interface{})
- func (set *SecurityEventToken) GetEventIds() []string
- func (set *SecurityEventToken) IsBefore(jtiVal []byte) (bool, error)
- func (set *SecurityEventToken) JWS(signingMethod jwt.SigningMethod, key *rsa.PrivateKey) (string, error)
- func (set *SecurityEventToken) JWT() *jwt.Token
- func (set *SecurityEventToken) JsonBytes() []byte
- func (set *SecurityEventToken) String() string
- type SubIdentifier
- type SubjectIdentifier
- type UniformResourceIdentifier
- type UsernameIdentifier
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GenerateJti ¶
func GenerateJti() string
Types ¶
type DecentralizedIdentifier ¶
type DecentralizedIdentifier struct {
Url string `json:"url,omitempty"`
}
type EmailIdentifier ¶
type EmailIdentifier struct {
Email string `json:"email,omitempty"`
}
type EventSubject ¶
type EventSubject struct { SubIdentifier // Supports top-level sub claim SubjectIdentifier // Used for draft-ietf-secevent-subject-identifier format }
type ExternalIdentifier ¶
type ExternalIdentifier struct {
ExternalId string `json:"externalId,omitempty"`
}
type IssuerSubjectIdentifier ¶
type OpaqueIdentifier ¶
type OpaqueIdentifier struct {
Id string `json:"id,omitempty"`
}
type PhoneNumberIdentifier ¶
type PhoneNumberIdentifier struct {
PhoneNumber string `json:"phone_number,omitempty"`
}
type SecurityEventToken ¶
type SecurityEventToken struct { jwt.RegisteredClaims TimeOfEvent *jwt.NumericDate `json:"toe,omitempty"` TransactionId string `json:"txn,omitempty"` SubjectId *SubjectIdentifier `json:"sub_id,omitempty"` Events map[string]interface{} `json:"events"` }
func CreateSet ¶
func CreateSet(subject *EventSubject, issuer string, audience []string) SecurityEventToken
CreateSet is used to create a SecurityEventToken object that can be used to generate a JWT or JWS token. 'subject' allows the specification of a "sub" or "sub-id" top-level JWT claim. If 'subject' is nil, no top-level claim is created which may be useful for OpenID RISC and CAEP events.
func Parse ¶
func Parse(tokenString string, issuerPublicJwks *keyfunc.JWKS) (*SecurityEventToken, error)
Parse will parse a SET or JWT into a SecurityEventToken. If issuerPublicJwks is provided the JWT will be validated. Note that if issuerPublicJwks is nil, the token will be validated if the header has alg=none only.
func (*SecurityEventToken) AddEventPayload ¶
func (set *SecurityEventToken) AddEventPayload(eventUri string, eventClaims map[string]interface{})
func (*SecurityEventToken) GetEventIds ¶
func (set *SecurityEventToken) GetEventIds() []string
func (*SecurityEventToken) IsBefore ¶
func (set *SecurityEventToken) IsBefore(jtiVal []byte) (bool, error)
func (*SecurityEventToken) JWS ¶
func (set *SecurityEventToken) JWS(signingMethod jwt.SigningMethod, key *rsa.PrivateKey) (string, error)
func (*SecurityEventToken) JWT ¶
func (set *SecurityEventToken) JWT() *jwt.Token
func (*SecurityEventToken) JsonBytes ¶
func (set *SecurityEventToken) JsonBytes() []byte
func (*SecurityEventToken) String ¶
func (set *SecurityEventToken) String() string
type SubIdentifier ¶
type SubIdentifier struct { // This is here to allow top-level sub claim Sub string `json:"sub,omitempty"` }
type SubjectIdentifier ¶
type SubjectIdentifier struct { Format string `json:"format,omitempty"` UsernameIdentifier EmailIdentifier IssuerSubjectIdentifier OpaqueIdentifier PhoneNumberIdentifier DecentralizedIdentifier UniformResourceIdentifier ExternalIdentifier }
func NewScimSubjectIdentifier ¶
func NewScimSubjectIdentifier(path string) *SubjectIdentifier
func (*SubjectIdentifier) AddEmail ¶
func (sid *SubjectIdentifier) AddEmail(email string) *SubjectIdentifier
func (*SubjectIdentifier) AddExternalId ¶
func (sid *SubjectIdentifier) AddExternalId(id string) *SubjectIdentifier
func (*SubjectIdentifier) AddScimId ¶
func (sid *SubjectIdentifier) AddScimId(id string) *SubjectIdentifier
func (*SubjectIdentifier) AddUsername ¶
func (sid *SubjectIdentifier) AddUsername(username string) *SubjectIdentifier
type UniformResourceIdentifier ¶
type UniformResourceIdentifier struct { // Note: this may cause issues as "Uri" is the same JSON attribute as AccountIdentifier Uri Uri string `json:"uri,omitempty"` }
type UsernameIdentifier ¶
type UsernameIdentifier struct {
Username string `json:"username,omitempty"`
}
Click to show internal directories.
Click to hide internal directories.