tokens

package
Version: v2.0.0-beta-001+incomp... Latest Latest
Warning

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

Go to latest
Published: Jun 15, 2018 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InitRepositoryProvider

func InitRepositoryProvider(databaseProvider string)

InitRepositoryProvider - One time init for the given DB Provider

Types

type PgsqlTokenRepository

type PgsqlTokenRepository struct {
	// contains filtered or unexported fields
}

PgsqlTokenRepository is a PostgreSQL-backed token repository

func (*PgsqlTokenRepository) DeleteCNSIToken

func (p *PgsqlTokenRepository) DeleteCNSIToken(cnsiGUID string, userGUID string) error

DeleteCNSIToken - remove a CNSI token (disconnect from a given CNSI)

func (*PgsqlTokenRepository) FindAuthToken

func (p *PgsqlTokenRepository) FindAuthToken(userGUID string, encryptionKey []byte) (interfaces.TokenRecord, error)

FindAuthToken - return the UAA token from the datastore

func (*PgsqlTokenRepository) FindCNSIToken

func (p *PgsqlTokenRepository) FindCNSIToken(cnsiGUID string, userGUID string, encryptionKey []byte) (interfaces.TokenRecord, error)

func (*PgsqlTokenRepository) FindCNSITokenIncludeDisconnected

func (p *PgsqlTokenRepository) FindCNSITokenIncludeDisconnected(cnsiGUID string, userGUID string, encryptionKey []byte) (interfaces.TokenRecord, error)

func (*PgsqlTokenRepository) SaveAuthToken

func (p *PgsqlTokenRepository) SaveAuthToken(userGUID string, tr interfaces.TokenRecord, encryptionKey []byte) error

saveAuthToken - Save the Auth token to the datastore

func (*PgsqlTokenRepository) SaveCNSIToken

func (p *PgsqlTokenRepository) SaveCNSIToken(cnsiGUID string, userGUID string, tr interfaces.TokenRecord, encryptionKey []byte) error

SaveCNSIToken - Save the CNSI (UAA) token to the datastore

type Repository

type Repository interface {
	FindAuthToken(userGUID string, encryptionKey []byte) (interfaces.TokenRecord, error)
	SaveAuthToken(userGUID string, tokenRecord interfaces.TokenRecord, encryptionKey []byte) error

	FindCNSIToken(cnsiGUID string, userGUID string, encryptionKey []byte) (interfaces.TokenRecord, error)
	FindCNSITokenIncludeDisconnected(cnsiGUID string, userGUID string, encryptionKey []byte) (interfaces.TokenRecord, error)
	DeleteCNSIToken(cnsiGUID string, userGUID string) error
	SaveCNSIToken(cnsiGUID string, userGUID string, tokenRecord interfaces.TokenRecord, encryptionKey []byte) error
}

Repository is an application of the repository pattern for storing tokens

func NewPgsqlTokenRepository

func NewPgsqlTokenRepository(dcp *sql.DB) (Repository, error)

NewPgsqlTokenRepository - get a reference to the token data source

type Token

type Token struct {
	UserGUID  string
	TokenType string
	Record    interfaces.TokenRecord
}

Token -

Jump to

Keyboard shortcuts

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