auth

package
v0.0.0-...-84c3946 Latest Latest
Warning

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

Go to latest
Published: Aug 20, 2026 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ApplyAuthentication

func ApplyAuthentication(req *http.Request, strategy AuthStrategy, creds Credentials) error

ApplyAuthentication applies the authentication strategy to the request.

func ApplyGRPCAuthentication

func ApplyGRPCAuthentication(ctx context.Context, strategy AuthStrategy, creds Credentials) (context.Context, error)

func GetGRPCMetadata

func GetGRPCMetadata(strategy AuthStrategy, creds Credentials) (map[string]string, error)

Types

type AuthStrategy

type AuthStrategy struct {
	Type   string                 `json:"type"`
	Config map[string]interface{} `json:"config"`
}

AuthStrategy represents the configuration for an authentication method.

type Credentials

type Credentials map[string]interface{}

Credentials is a type alias for a map of credential values.

type Token

type Token struct {
	Strategy    AuthStrategy
	Credentials Credentials
	ExpiresAt   int64 // Unix timestamp
}

Token holds the resolved authentication details for a connection.

type TokenProvider

type TokenProvider interface {
	GetToken(ctx context.Context, connectionID string) (*Token, error)
	RefreshConnection(ctx context.Context, connectionID string) (*Token, error)
}

TokenProvider retrieves and refreshes tokens for managed connections. Implementations typically wrap the nexus-sdk HTTP client.

Jump to

Keyboard shortcuts

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