digdir

package
v0.0.0-...-daa1dba Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2024 License: MIT Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ServerError = errors.New("ServerError")
	ClientError = errors.New("ClientError")
)

Functions

This section is empty.

Types

type Client

type Client struct {
	HttpClient *http.Client
	Signer     jose.Signer
	Config     *config.Config
	// contains filtered or unexported fields
}

func NewClient

func NewClient(config *config.Config, httpClient *http.Client, signer jose.Signer) (Client, error)

func (Client) AddToScopeACL

func (c Client) AddToScopeACL(ctx context.Context, scope, consumerOrgno string) (*types.ConsumerRegistration, error)

func (Client) CanAccessScope

func (c Client) CanAccessScope(ctx context.Context, scope nais_io_v1.ConsumedScope) (bool, error)

CanAccessScope checks if the authenticated organization can access given scope.

func (Client) DeactivateConsumer

func (c Client) DeactivateConsumer(ctx context.Context, scope, consumerOrgno string) (*types.ConsumerRegistration, error)

func (Client) Delete

func (c Client) Delete(ctx context.Context, clientID string) error

func (Client) DeleteScope

func (c Client) DeleteScope(ctx context.Context, scope string) (*types.ScopeRegistration, error)

func (Client) Exists

func (c Client) Exists(ctx context.Context, desired clients.Instance, clusterName string) (bool, error)

func (Client) GetAccessibleScopes

func (c Client) GetAccessibleScopes(ctx context.Context) ([]types.Scope, error)

GetAccessibleScopes returns all scopes that the authenticated organization has been granted access to.

func (Client) GetKeys

func (c Client) GetKeys(ctx context.Context, clientID string) (*types.JwksResponse, error)

func (Client) GetOpenScopes

func (c Client) GetOpenScopes(ctx context.Context) ([]types.ScopeRegistration, error)

GetOpenScopes returns all scopes that are accessible to any organization.

func (Client) GetRegistration

func (c Client) GetRegistration(desired clients.Instance, ctx context.Context, clusterName string) (*types.ClientRegistration, error)

func (Client) GetScopeACL

func (c Client) GetScopeACL(ctx context.Context, scope string) (*[]types.ConsumerRegistration, error)

func (Client) GetScopes

func (c Client) GetScopes(ctx context.Context) ([]types.ScopeRegistration, error)

func (Client) Register

func (Client) RegisterKeys

func (c Client) RegisterKeys(ctx context.Context, clientID string, payload *jose.JSONWebKeySet) (*types.JwksResponse, error)

func (Client) RegisterScope

func (c Client) RegisterScope(ctx context.Context, payload types.ScopeRegistration) (*types.ScopeRegistration, error)

func (Client) Update

func (c Client) Update(ctx context.Context, payload types.ClientRegistration, clientID string) (*types.ClientRegistration, error)

func (Client) UpdateScope

func (c Client) UpdateScope(ctx context.Context, payload types.ScopeRegistration, scope string) (*types.ScopeRegistration, error)

type Error

type Error struct {
	Err        error
	Status     string
	StatusCode int
	Message    string
}

func (*Error) Error

func (in *Error) Error() string

func (*Error) Unwrap

func (in *Error) Unwrap() error

type TokenResponse

type TokenResponse struct {
	AccessToken string `json:"access_token"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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