Documentation
¶
Index ¶
- func ActionAuthentication(token string) models.Action
- func ActionGrantsReadAbility(action models.Action) bool
- func ActionGrantsWriteAbility(action models.Action) bool
- func ActiveClients() []models.Client
- func ActiveClientsForUser(userIID uint) []models.Client
- func ActiveSessionsForClient(clientIID, userIID uint) int64
- func ClientAuthentication(key, secret string) models.Client
- func CreateAction(user models.User, client models.Client, ip, userAgent, scopes string) models.Action
- func CreateNewClient(name, description, secret, scopes, canonicalURI, redirectURI string) models.Client
- func CreateSession(user models.User, client models.Client, ...) models.Session
- func FindClientByKey(key string) models.Client
- func FindClientByUUID(uuid string) models.Client
- func FindOrCreateClient(name string) models.Client
- func FindOrCreateLanguage(name, isoCode string) models.Language
- func FindSessionByToken(token, tokenType string) models.Session
- func FindSessionByUUID(uuid string) models.Session
- func FindUserByAccountHolder(holder string) models.User
- func FindUserByPublicID(publicID string) models.User
- func FindUserByUUID(uuid string) models.User
- func InvalidateSession(session models.Session)
- func RevokeClientAccess(clientIID, userIID uint)
- func SessionGrantsReadAbility(session models.Session) bool
- func SessionGrantsWriteAbility(session models.Session) bool
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ActionAuthentication ¶
ActionAuthentication authenticates an ephemeral Action entry (time-based)
func ActionGrantsReadAbility ¶
ActionGrantsReadAbility checks if an action entry has read-ability
func ActionGrantsWriteAbility ¶
ActionGrantsWriteAbility checks if an action entry has write-ability
func ActiveClients ¶ added in v0.2.1
ActiveClients lists all client applications
func ActiveClientsForUser ¶
ActiveClientsForUser lists client applications for a given user
func ActiveSessionsForClient ¶
ActiveSessionsForClient gets the number of active sessions for a given user in a client application
func ClientAuthentication ¶
ClientAuthentication gets a client application by its key-secret pair
func CreateAction ¶
func CreateAction(user models.User, client models.Client, ip, userAgent, scopes string) models.Action
CreateAction creates an ephemeral Action entry
func CreateNewClient ¶
func CreateNewClient(name, description, secret, scopes, canonicalURI, redirectURI string) models.Client
CreateNewClient creates a new client application entry
func CreateSession ¶
func CreateSession(user models.User, client models.Client, ip, userAgent, scopes, tokenType string) models.Session
CreateSession creates a session entry
func FindClientByKey ¶
FindClientByKey gets a client application by its key
func FindClientByUUID ¶
FindClientByUUID gets a client application by its UUID
func FindOrCreateClient ¶
FindOrCreateClient attempts to find a client application by its name; otherwise, it creates a new one
func FindOrCreateLanguage ¶
FindOrCreateLanguage attempts to obtain a Language entry through its `name` and ISO Code;
if that's not available, it creates one
func FindSessionByToken ¶
FindSessionByToken gets a session entry by its token string
func FindSessionByUUID ¶
FindSessionByUUID gets a session entry by its UUID
func FindUserByAccountHolder ¶
FindUserByAccountHolder gets an user by its account holder (username or email)
func FindUserByPublicID ¶ added in v0.1.10
FindUserByPublicID gets an user by its public ID (used by client applications)
func FindUserByUUID ¶
FindUserByUUID gets an user by its UUID (internal use only)
func InvalidateSession ¶
InvalidateSession invalidates a session entry
func RevokeClientAccess ¶
func RevokeClientAccess(clientIID, userIID uint)
RevokeClientAccess revokes client application access to user's data
func SessionGrantsReadAbility ¶
SessionGrantsReadAbility checks if a session entry has read-ability
func SessionGrantsWriteAbility ¶
SessionGrantsWriteAbility checks if a session entry has write-ability
Types ¶
This section is empty.