Documentation ¶
Index ¶
- func CreateTransferCode(rlog log.Ext1FieldLogger, myID mtid.MTID, jwt string, newMT bool, ...) (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(rlog log.Ext1FieldLogger, responseType model.ResponseType, maxTokenLen int, ...) (response.MytokenResponse, error)
- func (mt *Mytoken) ToUniversalMytoken() universalmytoken.UniversalMytoken
- func (mt *Mytoken) ToUsedMytoken(rlog log.Ext1FieldLogger, 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 ¶
func CreateTransferCode ¶
func CreateTransferCode( rlog log.Ext1FieldLogger, myID mtid.MTID, jwt string, newMT bool, responseType model.ResponseType, clientMetaData api.ClientMetaData, ) (string, uint64, error)
CreateTransferCode creates a transfer code for the passed mytoken id
Types ¶
type Mytoken ¶
type Mytoken struct { api.Mytoken ExpiresAt unixtime.UnixTime `json:"exp,omitempty"` NotBefore unixtime.UnixTime `json:"nbf"` IssuedAt unixtime.UnixTime `json:"iat"` AuthTime unixtime.UnixTime `json:"auth_time,omitempty"` ID mtid.MTID `json:"jti"` Restrictions restrictions.Restrictions `json:"restrictions,omitempty"` Rotation *api.Rotation `json:"rotation,omitempty"` // contains filtered or unexported fields }
Mytoken is a mytoken Mytoken
func NewMytoken ¶
func NewMytoken( oidcSub, oidcIss, name string, r restrictions.Restrictions, c api.Capabilities, rot *api.Rotation, authTime unixtime.UnixTime, ) *Mytoken
NewMytoken creates a new Mytoken
func ParseJWTWithoutClaimsValidation ¶ added in v0.3.3
ParseJWTWithoutClaimsValidation parses a token string into a Mytoken
func (*Mytoken) ToTokenResponse ¶
func (mt *Mytoken) ToTokenResponse( rlog log.Ext1FieldLogger, 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) ToUniversalMytoken ¶ added in v0.4.0
func (mt *Mytoken) ToUniversalMytoken() universalmytoken.UniversalMytoken
ToUniversalMytoken returns a universalmytoken.UniversalMytoken for this Mytoken
func (*Mytoken) ToUsedMytoken ¶
func (mt *Mytoken) ToUsedMytoken(rlog log.Ext1FieldLogger, 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