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) ToJWT() (string, error)
- func (mt *Mytoken) ToTokenResponse(responseType model.ResponseType, networkData api.ClientMetaData, jwt string) (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 ¶
func CreateTransferCode ¶
func CreateTransferCode(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 {
// On update also update api.Mytoken
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 *rotation.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) *Mytoken
NewMytoken creates a new Mytoken
func (*Mytoken) ToTokenResponse ¶
func (mt *Mytoken) ToTokenResponse(responseType model.ResponseType, 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)
func (*Mytoken) VerifyCapabilities ¶
func (mt *Mytoken) VerifyCapabilities(required ...api.Capability) bool
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.