services

package
v0.2.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 31, 2020 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ActionAuthentication

func ActionAuthentication(token string) models.Action

ActionAuthentication authenticates an ephemeral Action entry (time-based)

func ActionGrantsReadAbility

func ActionGrantsReadAbility(action models.Action) bool

ActionGrantsReadAbility checks if an action entry has read-ability

func ActionGrantsWriteAbility

func ActionGrantsWriteAbility(action models.Action) bool

ActionGrantsWriteAbility checks if an action entry has write-ability

func ActiveClients added in v0.2.1

func ActiveClients() []models.Client

ActiveClients lists all client applications

func ActiveClientsForUser

func ActiveClientsForUser(userIID uint) []models.Client

ActiveClientsForUser lists client applications for a given user

func ActiveSessionsForClient

func ActiveSessionsForClient(clientIID, userIID uint) int64

ActiveSessionsForClient gets the number of active sessions for a given user in a client application

func ClientAuthentication

func ClientAuthentication(key, secret string) models.Client

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

func FindClientByKey(key string) models.Client

FindClientByKey gets a client application by its key

func FindClientByUUID

func FindClientByUUID(uuid string) models.Client

FindClientByUUID gets a client application by its UUID

func FindOrCreateClient

func FindOrCreateClient(name string) models.Client

FindOrCreateClient attempts to find a client application by its name; otherwise, it creates a new one

func FindOrCreateLanguage

func FindOrCreateLanguage(name, isoCode string) models.Language

FindOrCreateLanguage attempts to obtain a Language entry through its `name` and ISO Code;

if that's not available, it creates one

func FindSessionByToken

func FindSessionByToken(token, tokenType string) models.Session

FindSessionByToken gets a session entry by its token string

func FindSessionByUUID

func FindSessionByUUID(uuid string) models.Session

FindSessionByUUID gets a session entry by its UUID

func FindUserByAccountHolder

func FindUserByAccountHolder(holder string) models.User

FindUserByAccountHolder gets an user by its account holder (username or email)

func FindUserByPublicID added in v0.1.10

func FindUserByPublicID(publicID string) models.User

FindUserByPublicID gets an user by its public ID (used by client applications)

func FindUserByUUID

func FindUserByUUID(uuid string) models.User

FindUserByUUID gets an user by its UUID (internal use only)

func InvalidateSession

func InvalidateSession(session models.Session)

InvalidateSession invalidates a session entry

func RevokeClientAccess

func RevokeClientAccess(clientIID, userIID uint)

RevokeClientAccess revokes client application access to user's data

func SessionGrantsReadAbility

func SessionGrantsReadAbility(session models.Session) bool

SessionGrantsReadAbility checks if a session entry has read-ability

func SessionGrantsWriteAbility

func SessionGrantsWriteAbility(session models.Session) bool

SessionGrantsWriteAbility checks if a session entry has write-ability

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL