memory

package
Version: v0.0.0-...-1a7bac6 Latest Latest
Warning

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

Go to latest
Published: Jun 23, 2021 License: AGPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type NonceStore

type NonceStore struct {
	DB *Store
}

NonceStore is a nonce store backed by database

func (*NonceStore) Accept

func (s *NonceStore) Accept(endpoint, nonce string) error

Accept implements openid.NonceStore.Accept

type Store

type Store struct {
	Users    []datastore.User
	Orgs     []datastore.Organization
	OrgUsers []datastore.OrganizationUser
	// contains filtered or unexported fields
}

Store implements an in-memory store for testing

func NewStore

func NewStore() *Store

NewStore creates a new memory store

func (*Store) CreateUser

func (mem *Store) CreateUser(user datastore.User) (int64, error)

CreateUser creates a new user

func (*Store) GetUser

func (mem *Store) GetUser(username string) (datastore.User, error)

GetUser gets an existing user

func (*Store) OpenIDNonceStore

func (mem *Store) OpenIDNonceStore() openid.NonceStore

OpenIDNonceStore returns an openid nonce store

func (*Store) OrgUserAccess

func (mem *Store) OrgUserAccess(orgID, username string, role int) bool

OrgUserAccess checks if the user has permissions to access the organization

func (*Store) OrganizationCreate

func (mem *Store) OrganizationCreate(org datastore.Organization) error

OrganizationCreate creates a new organization

func (*Store) OrganizationForUserToggle

func (mem *Store) OrganizationForUserToggle(orgID, username string) error

OrganizationForUserToggle toggles the user access for an organization

func (*Store) OrganizationGet

func (mem *Store) OrganizationGet(orgID string) (datastore.Organization, error)

OrganizationGet returns an organization

func (*Store) OrganizationUpdate

func (mem *Store) OrganizationUpdate(org datastore.Organization) error

OrganizationUpdate updates an organization

func (*Store) OrganizationsForUser

func (mem *Store) OrganizationsForUser(username string) ([]datastore.Organization, error)

OrganizationsForUser returns the organizations a user can access

func (*Store) UserDelete

func (mem *Store) UserDelete(username string) error

UserDelete removes a user

func (*Store) UserList

func (mem *Store) UserList() ([]datastore.User, error)

UserList lists existing users

func (*Store) UserUpdate

func (mem *Store) UserUpdate(user datastore.User) error

UserUpdate updates a user

Jump to

Keyboard shortcuts

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