Documentation
¶
Index ¶
- func ApplyAuthentication(req *http.Request, strategy AuthStrategy, creds Credentials) error
- func ApplyGRPCAuthentication(ctx context.Context, strategy AuthStrategy, creds Credentials) (context.Context, error)
- func GetGRPCMetadata(strategy AuthStrategy, creds Credentials) (map[string]string, error)
- type AuthStrategy
- type Credentials
- type Token
- type TokenProvider
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.
Click to show internal directories.
Click to hide internal directories.