Documentation ¶
Index ¶
- func CreateTransferCode(myID mtid.MTID, jwt string, newMT bool, responseType model.ResponseType, ...) (string, uint64, error)
- type Mytoken
- func (mt *Mytoken) ExpiresIn() uint64
- func (mt Mytoken) Rotate() *Mytoken
- func (mt *Mytoken) ToJWT() (string, error)
- func (mt *Mytoken) ToTokenResponse(responseType model.ResponseType, maxTokenLen int, ...) (response.MytokenResponse, error)
- func (mt *Mytoken) ToUsedMytoken(tx *sqlx.Tx) (*UsedMytoken, error)
- func (mt *Mytoken) Valid() error
- func (mt *Mytoken) VerifyCapabilities(required ...api.Capability) bool
- type UsedMytoken
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Mytoken ¶
type Mytoken struct { // On update also update api.Mytoken Version api.TokenVersion `json:"ver"` TokenType string `json:"token_type"` Issuer string `json:"iss"` Subject string `json:"sub"` ExpiresAt unixtime.UnixTime `json:"exp,omitempty"` NotBefore unixtime.UnixTime `json:"nbf"` IssuedAt unixtime.UnixTime `json:"iat"` ID mtid.MTID `json:"jti"` SeqNo uint64 `json:"seq_no"` Audience string `json:"aud"` OIDCSubject string `json:"oidc_sub"` OIDCIssuer string `json:"oidc_iss"` Restrictions restrictions.Restrictions `json:"restrictions,omitempty"` Capabilities api.Capabilities `json:"capabilities"` SubtokenCapabilities api.Capabilities `json:"subtoken_capabilities,omitempty"` Rotation *api.Rotation `json:"rotation,omitempty"` // contains filtered or unexported fields }
Mytoken is a mytoken Mytoken
func NewMytoken ¶
func NewMytoken(oidcSub, oidcIss string, r restrictions.Restrictions, c, sc api.Capabilities, rot *api.Rotation) *Mytoken
NewMytoken creates a new Mytoken
func (*Mytoken) ToTokenResponse ¶
func (mt *Mytoken) ToTokenResponse(responseType model.ResponseType, maxTokenLen int, networkData api.ClientMetaData, jwt string) (response.MytokenResponse, error)
ToTokenResponse creates a MytokenResponse for this Mytoken according to the passed model.ResponseType
func (*Mytoken) ToUsedMytoken ¶
func (mt *Mytoken) ToUsedMytoken(tx *sqlx.Tx) (*UsedMytoken, error)
ToUsedMytoken turns a Mytoken into a UsedMytoken by adding information about its usages
func (*Mytoken) VerifyCapabilities ¶
VerifyCapabilities verifies that this Mytoken has the required capabilities
type UsedMytoken ¶
type UsedMytoken struct { Mytoken Restrictions []restrictions.UsedRestriction `json:"restrictions,omitempty"` }
UsedMytoken is a type for a Mytoken that has been used, it additionally has information how often it has been used
Click to show internal directories.
Click to hide internal directories.