Documentation
¶
Overview ¶
Package gatewayauth authenticates requests addressed to a specific MooX node.
Index ¶
- Constants
- func NewTRPCClientFilter(credentials Credentials, targetNode string, now func() time.Time) filter.ClientFilter
- func NewTRPCClientOptions(target, targetNode string, credentials Credentials) []client.Option
- func ReadSigningSecret(path string) (string, error)
- func Sign(c Credentials, req Request, now time.Time) (http.Header, error)
- func ValidateTargetNode(value string) error
- type Claims
- type CredentialRegistry
- type Credentials
- type Request
Constants ¶
const Version = "moox-gateway-auth-v1"
Variables ¶
This section is empty.
Functions ¶
func NewTRPCClientFilter ¶
func NewTRPCClientFilter(credentials Credentials, targetNode string, now func() time.Time) filter.ClientFilter
NewTRPCClientFilter signs the serialized request body before it crosses the native Node Service Gateway. The generated Storage clients remain unchanged; only their target and this filter are supplied by the caller.
func NewTRPCClientOptions ¶
func NewTRPCClientOptions(target, targetNode string, credentials Credentials) []client.Option
NewTRPCClientOptions returns the common target, protocol, and HMAC options for a generated client that must use the native Node Service Gateway.
func ReadSigningSecret ¶
ReadSigningSecret loads a bounded private signing key without following symlinks.
func ValidateTargetNode ¶
ValidateTargetNode applies the same target validation used by signing, so services can reject unusable gateway configuration before opening resources.
Types ¶
type CredentialRegistry ¶
type CredentialRegistry struct {
// contains filtered or unexported fields
}
func LoadCredentialRegistry ¶
func LoadCredentialRegistry(path string) (*CredentialRegistry, error)
func NewCredentialRegistry ¶
func NewCredentialRegistry(credentials []Credentials) (*CredentialRegistry, error)
NewCredentialRegistry indexes by KeyID. A caller may have both its current and retiring key during a controlled rotation; KeyIDs are globally unique.
type Credentials ¶
func CredentialsFromKeyFile ¶
func CredentialsFromKeyFile(keyID, path string) (Credentials, error)
CredentialsFromKeyFile loads a service secret without accepting symlinks or group/world-readable files. The gateway and every native tRPC client use the same fail-closed file contract.
Directories
¶
| Path | Synopsis |
|---|---|
|
Package nativewire installs the process-wide tRPC frame ceiling before any client or listener starts.
|
Package nativewire installs the process-wide tRPC frame ceiling before any client or listener starts. |