admin

package
v1.5.2 Latest Latest
Warning

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

Go to latest
Published: Sep 24, 2022 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	HD    = "hd"
	Email = "bff@rotational.io"
	Name  = "GDS BFF"
)

Variables

This section is empty.

Functions

func New

func New(conf config.AdminConfig) (client admin.DirectoryAdministrationClient, err error)

New creates a new DirectoryAdministrationClient which uses its own self signed credentials to make authenticated requests to a GDS Admin service.

func NewCredentials

func NewCredentials(tokenKeys map[string]string, audience string) (_ admin.Credentials, err error)

NewCredentials creates a new Credentials object with the given token keys and audience which can generate self signed access tokens for authenticated requests.

func NewCredentialsFromTokens

func NewCredentialsFromTokens(tm *tokens.TokenManager) (_ admin.Credentials, err error)

NewCredentialsFromTokens creates a new Credentials object from a token manager for testing purposes.

Types

type Credentials

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

Credentials implements the admin.Credentials interface to provide access tokens to authenticated requests.

func (*Credentials) Generate

func (c *Credentials) Generate(api admin.DirectoryAdministrationClient) (err error)

Generate signs a new access token using the token manager if a valid one does not already exist.

func (*Credentials) Login

func (c *Credentials) Login(api admin.DirectoryAdministrationClient) (accessToken, _ string, err error)

Login creates new access and refresh tokens if they don't already exist.

func (*Credentials) Logout

func (c *Credentials) Logout(api admin.DirectoryAdministrationClient) (err error)

Logout deletes the access token.

func (*Credentials) Refresh

func (c *Credentials) Refresh(api admin.DirectoryAdministrationClient) (accessToken, _ string, err error)

Refresh

func (*Credentials) Valid

func (c *Credentials) Valid() bool

Check if the access token is valid and not expired.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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