Documentation ¶
Index ¶
- Constants
- Variables
- func ConvertLDAPUser(response *ldapproto.User) *domain.User
- func CreateUser(user *domain.User, plainPass string) errors.Error
- func DeleteEndpointAuths(epas []*domain.EndpointAuth) error
- func DeleteSession(rowKey, deviceType string) error
- func DeleteUser(user *domain.User) error
- func DeleteUserIndexes(user *domain.User, uid string, ids []domain.Id) error
- func IsLDAPUser(app domain.Application, uid string) (username, domain string, ok bool)
- func MultiReadUser(app domain.Application, ids []string) ([]*domain.User, error)
- func ReadActiveSessionFor(authMechanism, deviceType, userId string) (*domain.Session, error)
- func ReadActiveSessionIdsFor(userId string) (sessionIds map[string]string, err error)
- func ReadEndpointAuth(service string) ([]*domain.EndpointAuth, error)
- func ReadSession(rowKey string) (*domain.Session, error)
- func ReadUser(app domain.Application, uid string) (*domain.User, error)
- func ReadUserList(app domain.Application, start, end time.Time, count int, lastId string) ([]*domain.User, string, error)
- func ReadUserLogins(app domain.Application, uid string, start, end time.Time, count int, ...) ([]*domain.Login, string, error)
- func ReindexUsers()
- func UpdateUser(user *domain.User) error
- func WriteEndpointAuths(epas []*domain.EndpointAuth) error
- func WriteLogin(login *domain.Login) error
- func WriteSession(sess *domain.Session) error
Constants ¶
const (
Keyspace = "login"
)
Variables ¶
var (
Cfs []string = []string{cfSessions, cfUsers, cfEndpointAuths, cfUserIndex, cfUserIndexIndex}
)
Functions ¶
func CreateUser ¶
CreateUser will create a new user so long as none of the IDs already exist If another user is already using an index or ID, it will return an appropriate platform error The plainPass is used to give idempotence to the storage of a user
func DeleteEndpointAuths ¶
func DeleteEndpointAuths(epas []*domain.EndpointAuth) error
DeleteEndpointAuths will revoke these rules for allowing things to talk to each other
func DeleteSession ¶
DeleteSession will remove all knowledge of a session. The session device type must be specified because it needs to be expunged from the userSessions column family
func DeleteUser ¶
DeleteUser deletes a user and expires all their active sessions
func DeleteUserIndexes ¶
func IsLDAPUser ¶
func IsLDAPUser(app domain.Application, uid string) (username, domain string, ok bool)
isLDAPUser checks if the user ID is an LDAP user, a user is an LDAP user if:
- The user is an ADMIN user
- The uid is an email address
func MultiReadUser ¶
If a user isn't found then returned array length won't match ids length
func ReadActiveSessionFor ¶
ReadSession fetches a single session by secondary auth mechanism + device type + user ID index
func ReadActiveSessionIdsFor ¶
ReadActiveSessionIdsFor retrieves all active session IDs (keyed in a map by their device type) for a given user ID
func ReadEndpointAuth ¶
func ReadEndpointAuth(service string) ([]*domain.EndpointAuth, error)
ReadEndpointAuth grabs a list of all authorised services that can make requests to the supplied service
func ReadSession ¶
ReadSession fetches a single session - usually by base64-encoded sessionId, but also called by ReadActiveSessionFor for secondary indexed sessions
func ReadUserList ¶
func ReadUserList(app domain.Application, start, end time.Time, count int, lastId string) ([]*domain.User, string, error)
ReadUserList returns a timeseries list of all users, ordered by created timestamp. This function will only return users stored in cassandra (H2 users).
func ReadUserLogins ¶
func ReadUserLogins(app domain.Application, uid string, start, end time.Time, count int, lastId string) ([]*domain.Login, string, error)
ReadUserLogins will return a list of user logins for a single user, within a time range
func ReindexUsers ¶
func ReindexUsers()
ReindexUsers is **temporary** so we can upgrade-in-place our data model and put users into a TS index
func UpdateUser ¶
UpdateUser will update details of an existing user
func WriteEndpointAuths ¶
func WriteEndpointAuths(epas []*domain.EndpointAuth) error
WriteEndpointAuths defines a new rule that allows some service to call some endpoint
func WriteLogin ¶
WriteLogin will record details of a user login
func WriteSession ¶
WriteSession is create/update combined (we don't care) for sessions
Types ¶
This section is empty.