cc

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Feb 16, 2022 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	NeedLoginErr    = errors.Errorf("user is not logged in, please login using '%s login'", x.AppName)
	TokenExpiredErr = errors.Errorf("the access token has expired, please login using '%s login'", x.AppName)
	NeedTenantIDErr = errors.Errorf("operation requires tenant-id, please login using '%s login' or use --tenant to specify an id.", x.AppName)
)

Functions

This section is empty.

Types

type CachedToken added in v0.8.0

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

func NewCachedToken added in v0.8.0

func NewCachedToken(env string) CachedToken

func (CachedToken) Get added in v0.8.0

func (t CachedToken) Get() *api.Token

func (CachedToken) TenantID added in v0.8.0

func (t CachedToken) TenantID() string

func (CachedToken) Verify added in v0.8.0

func (t CachedToken) Verify() error

type ClientFactoryBuilder added in v0.8.0

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

func NewClientFactoryBuilder added in v0.8.0

func NewClientFactoryBuilder() *ClientFactoryBuilder

func (*ClientFactoryBuilder) ClientFactory added in v0.8.0

func (b *ClientFactoryBuilder) ClientFactory(env *x.Services, tenantID string, token CachedToken) (*client.AsertoFactory, error)

func (*ClientFactoryBuilder) Override added in v0.8.0

func (b *ClientFactoryBuilder) Override(svc x.Service, overrides client.Overrides)

func (*ClientFactoryBuilder) RequireToken added in v0.8.0

func (b *ClientFactoryBuilder) RequireToken()

type CommonCtx

type CommonCtx struct {
	Context   context.Context
	OutWriter io.Writer
	ErrWriter io.Writer
	Services  *x.Services
	// contains filtered or unexported fields
}

func NewCommonCtx added in v0.8.0

func NewCommonCtx(env *x.Services, tenantID string, clientFactory client.Factory, token *api.Token) *CommonCtx

func (*CommonCtx) AccessToken

func (ctx *CommonCtx) AccessToken() string

func (*CommonCtx) AuthorizerAPIKey

func (ctx *CommonCtx) AuthorizerAPIKey() string

func (*CommonCtx) AuthorizerClient added in v0.8.0

func (ctx *CommonCtx) AuthorizerClient() (*authorizer.Client, error)

func (*CommonCtx) DecisionLogsClient added in v0.8.0

func (ctx *CommonCtx) DecisionLogsClient() (dl.DecisionLogsClient, error)

func (*CommonCtx) DecisionLogsKey added in v0.8.0

func (ctx *CommonCtx) DecisionLogsKey() string

func (*CommonCtx) Environment

func (ctx *CommonCtx) Environment() string

func (*CommonCtx) Logf added in v0.1.3

func (ctx *CommonCtx) Logf(format string, v ...interface{})

func (*CommonCtx) TenantClient added in v0.8.0

func (ctx *CommonCtx) TenantClient() (*tenant.Client, error)

func (*CommonCtx) TenantID

func (ctx *CommonCtx) TenantID() string

func (*CommonCtx) Token

func (ctx *CommonCtx) Token() *api.Token

Jump to

Keyboard shortcuts

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