authsome

package
v1.9.1 Latest Latest
Warning

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

Go to latest
Published: Oct 28, 2026 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package authsome provides an adapter that bridges an external Authsome authentication service to the Nexus auth.Provider interface.

Deprecated: nothing consults an auth.Provider, so wiring this adapter through nexus.WithAuth authenticates nothing. The gateway checks its own gateway keys (nxs_...), and an Authsome Bearer token sent to it counts as a presented key and is refused 401. The package stays only so existing code compiles, and goes in the v1 break.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Adapter

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

Adapter bridges Authsome to Nexus auth.Provider.

func New

func New(authenticator Authenticator) *Adapter

New creates an Authsome auth adapter.

func (*Adapter) Authenticate

func (a *Adapter) Authenticate(_ context.Context) (*auth.Claims, error)

Authenticate validates credentials from the request context. It extracts the bearer token from context and validates via Authsome.

func (*Adapter) AuthenticateAPIKey

func (a *Adapter) AuthenticateAPIKey(ctx context.Context, apiKey string) (*auth.Claims, error)

AuthenticateAPIKey validates a Nexus API key via the Authsome service.

type Authenticator

type Authenticator interface {
	// Authenticate validates a token and returns the subject (e.g., tenant ID).
	Authenticate(ctx context.Context, token string) (subject string, err error)
}

Authenticator represents an external Authsome authentication service. This is the minimal interface that the Authsome adapter requires.

Jump to

Keyboard shortcuts

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