Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var MagicSigningPackage signing.SigningPackageInterface
Functions ¶
func ExpireOld ¶
func ExpireOld(db database.DatabaseAccessor, lookupUserID string, manuallyExpireTokenID ...string)
func FilterActive ¶
func FilterActive(activeMagics chan MagicAuthentications, magics MagicAuthentications, manuallyExpireTokenID ...string)
Useful if you've already queried the user and just need a list of active magics back. Used in: the end of Validate() + ValidateSession()
Types ¶
type MagicAuthentication ¶
type MagicAuthentication struct { Code string // authentication code (hashed) AllowedPermissions []string // what the user can DO ExpiresAt int64 // when the token expires InheritRole string // filled in at validation time Username string // filled in at validation time }
func CreateMagicAuthentication ¶
func CreateMagicAuthentication(macVariables MagicAuthenticationVariables) (MagicAuthentication, string, error)
Returns The MagicAuth for saving in the Database The Identifier String (userID:code:signature) Error, if any.
func MagicFromMap ¶
func MagicFromMap(input map[string]interface{}) MagicAuthentication
func Validate ¶
func Validate(db database.DatabaseAccessor, tokenIdentifer string) (MagicAuthentication, map[string]interface{}, error)
func (MagicAuthentication) ToMap ¶
func (m MagicAuthentication) ToMap() map[string]interface{}
type MagicAuthentications ¶
type MagicAuthentications []MagicAuthentication
func MagicsFromMap ¶
func MagicsFromMap(input []interface{}) MagicAuthentications
func (MagicAuthentications) ToMap ¶
func (m MagicAuthentications) ToMap() []interface{}
Click to show internal directories.
Click to hide internal directories.