goSet

package
v0.7.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 17, 2023 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateJti

func GenerateJti() string

func GetJwks

func GetJwks(jwksUrl string) (*keyfunc.JWKS, error)

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 IssuerSubjectIdentifier struct {
	Issuer string `json:"iss,omitempty"`
	Sub    string `json:"sub,omitempty"`
}

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

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"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL