appmanager

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Dec 22, 2019 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetDeploymentByName

func GetDeploymentByName(ctx context.Context, apiClient *appmanager.APIClient, namespace string, name string) (appmanager.Deployment, error)

GetDeploymentByName fetches a deployment from the VP by namespace and name

Types

type AuthStore

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

func NewAuthStore

func NewAuthStore(tokenManager TokenManager) *AuthStore

func (*AuthStore) ContextForNamespace

func (s *AuthStore) ContextForNamespace(baseCtx context.Context, namespace string) (context.Context, error)

ContextForNamespace gets a context with an authorization token for a namespace

func (*AuthStore) RemoveAllCreatedTokens

func (s *AuthStore) RemoveAllCreatedTokens(ctx context.Context) ([]string, error)

RemoveAllCreatedTokens deletes all tokens that have been created by the store

type PlatformTokenManager

type PlatformTokenManager struct {
	PlatformAPIClient *platformApiClient.APIClient
}

PlatformTokenManager manages creation / deletion / querying of Platform API Tokens

func (*PlatformTokenManager) CreateToken

func (p *PlatformTokenManager) CreateToken(ctx context.Context, name, role, namespace string) (string, error)

func (*PlatformTokenManager) RemoveToken

func (p *PlatformTokenManager) RemoveToken(ctx context.Context, name, namespace string) (bool, error)

func (*PlatformTokenManager) TokenExists

func (p *PlatformTokenManager) TokenExists(ctx context.Context, name, namespace string) (bool, error)

type TokenData

type TokenData struct {
	Name string
	// contains filtered or unexported fields
}

type TokenManager

type TokenManager interface {
	// TokenExists checks if a token exists in a namespace by name
	TokenExists(ctx context.Context, name, namespace string) (bool, error)
	// CreateToken creates a token under a namespace with a given role and returns the secret
	CreateToken(ctx context.Context, name, role, namespace string) (string, error)
	// RemoveToken deletes a token from a namespace and returns whether it existed
	RemoveToken(ctx context.Context, name, namespace string) (bool, error)
}

type TokenNotFoundError

type TokenNotFoundError struct {
	Namespace string
	Name      string
}

TokenNotFoundError represents when no auth token can be found for a namespace

func (TokenNotFoundError) Error

func (err TokenNotFoundError) Error() string

Jump to

Keyboard shortcuts

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