client

package
v1.53.0 Latest Latest
Warning

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

Go to latest
Published: Nov 18, 2023 License: Unlicense Imports: 10 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// GenerateServiceToken for client.
	GenerateServiceToken string

	// VerifyServiceToken for client.
	VerifyServiceToken string
)
View Source
var (
	// Module for fx.
	Module = fx.Options(
		v1.Module,
		fx.Provide(NewClient),
	)

	// CommandModule for fx.
	CommandModule = fx.Options(
		Module,
		fx.Invoke(RunCommand),
	)
)
View Source
var (
	// Kind for client.
	Kind = contextKey("kind")

	// Audience for client.
	Audience = contextKey("audience")

	// Audience for client.
	Action = contextKey("action")
)

Functions

func NewGenerator added in v1.51.0

func NewGenerator(client *Client) token.Generator

NewGenerator for client.

func NewVerifier added in v1.51.0

func NewVerifier(client *Client) token.Verifier

NewVerifier for client.

func RunCommand added in v1.27.0

func RunCommand(params RunCommandParams)

RunCommand for client.

Types

type Client

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

Client for auth.

func NewClient

func NewClient(client v1.ServiceClient, config *v1c.Config) *Client

NewClient for auth.

func (*Client) GenerateServiceToken

func (c *Client) GenerateServiceToken(ctx context.Context, kind, audience string) (string, error)

GenerateServiceToken for client.

func (*Client) VerifyServiceToken

func (c *Client) VerifyServiceToken(ctx context.Context, token, kind, audience, action string) error

VerifyServiceToken for client.

type Config

type Config struct {
	V1 v1.Config `yaml:"v1" json:"v1" toml:"v1"`
}

Config for client.

type Param added in v1.51.0

type Param string

Param is used to pass parameters through context.

type RunCommandParams added in v1.27.0

type RunCommandParams struct {
	fx.In

	Lifecycle fx.Lifecycle
	Logger    *zap.Logger
	Generator token.Generator
	Verifier  token.Verifier
}

RunCommandParams for client.

Directories

Path Synopsis
v1

Jump to

Keyboard shortcuts

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