Documentation ¶
Index ¶
- type ProxyToken
- func (pt ProxyToken) Delete(rlog log.Ext1FieldLogger, tx *sqlx.Tx) error
- func (pt *ProxyToken) ID() string
- func (pt *ProxyToken) JWT(rlog log.Ext1FieldLogger, tx *sqlx.Tx) (jwt string, valid bool, err error)
- func (pt ProxyToken) MTID() mtid.MTID
- func (pt *ProxyToken) SetJWT(jwt string, mID mtid.MTID) (err error)
- func (pt ProxyToken) Store(rlog log.Ext1FieldLogger, tx *sqlx.Tx) error
- func (pt ProxyToken) String() string
- func (pt ProxyToken) Token() string
- func (pt ProxyToken) Update(rlog log.Ext1FieldLogger, tx *sqlx.Tx) error
- type ShortToken
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ProxyToken ¶
type ProxyToken struct {
// contains filtered or unexported fields
}
ProxyToken holds information for proxy tokens, i.e. tokens that proxy another token, e.g. a short token
func CreateProxyToken ¶
func CreateProxyToken(token string) *ProxyToken
CreateProxyToken creates a new *ProxyToken for a token
func NewProxyToken ¶
func NewProxyToken(size int) *ProxyToken
NewProxyToken creates a new ProxyToken of the given length
func ParseProxyToken ¶
func ParseProxyToken(token string) *ProxyToken
ParseProxyToken parses the proxy token string into a proxyToken
func (ProxyToken) Delete ¶
func (pt ProxyToken) Delete(rlog log.Ext1FieldLogger, tx *sqlx.Tx) error
Delete deletes the proxyToken from the database, it does not delete the linked Mytoken, the jwt should have been retrieved earlier and the Mytoken if desired be revoked separately
func (*ProxyToken) JWT ¶
func (pt *ProxyToken) JWT(rlog log.Ext1FieldLogger, tx *sqlx.Tx) (jwt string, valid bool, err error)
JWT returns the decrypted jwt that is linked to this proxyToken
func (ProxyToken) MTID ¶
func (pt ProxyToken) MTID() mtid.MTID
MTID returns the mtid.MTID of this ProxyToken
func (*ProxyToken) SetJWT ¶
func (pt *ProxyToken) SetJWT(jwt string, mID mtid.MTID) (err error)
SetJWT sets the jwt for this proxyToken
func (ProxyToken) Store ¶
func (pt ProxyToken) Store(rlog log.Ext1FieldLogger, tx *sqlx.Tx) error
Store stores the proxyToken
func (ProxyToken) String ¶
func (pt ProxyToken) String() string
func (ProxyToken) Token ¶
func (pt ProxyToken) Token() string
Token returns the token of this ProxyToken
func (ProxyToken) Update ¶
func (pt ProxyToken) Update(rlog log.Ext1FieldLogger, tx *sqlx.Tx) error
Update updates the jwt of the proxyToken
type ShortToken ¶
type ShortToken struct {
ProxyToken
}
ShortToken holds database information of a short token
func NewShortToken ¶
func NewShortToken(jwt string, mID mtid.MTID) (*ShortToken, error)
NewShortToken creates a new short token from the given jwt of a normal Mytoken
func ParseShortToken ¶
func ParseShortToken(token string) *ShortToken
ParseShortToken creates a new short token from a short token string