spi

package
v1.0.5 Latest Latest
Warning

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

Go to latest
Published: Dec 6, 2017 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Affiliation

type Affiliation interface {
	GetName() string
	GetPrekey() string
}

Affiliation is the API for a user's affiliation

type AffiliationImpl

type AffiliationImpl struct {
	Name   string `db:"name"`
	Prekey string `db:"prekey"`
}

AffiliationImpl defines a group name and its parent

func (*AffiliationImpl) GetName

func (g *AffiliationImpl) GetName() string

GetName returns the name of the affiliation

func (*AffiliationImpl) GetPrekey

func (g *AffiliationImpl) GetPrekey() string

GetPrekey returns the prekey of the affiliation

type User

type User interface {
	// Returns the enrollment ID of the user
	GetName() string
	// Login the user with a password
	Login(password string, caMaxEnrollment int) error
	// Get the complete path for the user's affiliation.
	GetAffiliationPath() []string
	// GetAttribute returns the value for an attribute name
	GetAttribute(name string) string
}

User is the SPI for a user

type UserInfo

type UserInfo struct {
	Name           string
	Pass           string
	Type           string
	Affiliation    string
	Attributes     []api.Attribute
	State          int
	MaxEnrollments int
}

UserInfo contains information about a user

type UserRegistry

type UserRegistry interface {
	GetUser(id string, attrs []string) (User, error)
	GetUserInfo(id string) (UserInfo, error)
	InsertUser(user UserInfo) error
	UpdateUser(user UserInfo) error
	DeleteUser(id string) error
	GetAffiliation(name string) (Affiliation, error)
	InsertAffiliation(name string, prekey string) error
	DeleteAffiliation(name string) error
}

UserRegistry is the API for retreiving users and groups

Jump to

Keyboard shortcuts

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