auth

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Oct 24, 2026 License: MIT Imports: 14 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package auth provides token providers and an authenticated HTTP client wrapper for the QuantumBPM SDK.

The TokenProvider interface is the extension point. ZitadelTokenProvider implements service-account JWT auth against Zitadel; StaticTokenProvider supplies a fixed bearer token for Enterprise / API-key flows. Implementing TokenProvider yourself integrates any other OIDC source.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewClient

func NewClient(baseURL string, provider TokenProvider) (*generated.ClientWithResponses, error)

NewClient returns a generated.ClientWithResponses that injects a Bearer token from the supplied TokenProvider into every request.

Types

type StaticTokenProvider

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

StaticTokenProvider returns the same bearer token on every call. Use it for Enterprise deployments that issue long-lived API keys, or in tests where a pre-acquired token is supplied directly.

func NewStaticTokenProvider

func NewStaticTokenProvider(token string) *StaticTokenProvider

NewStaticTokenProvider wraps token in a TokenProvider.

func (*StaticTokenProvider) Token

type TokenProvider

type TokenProvider interface {
	Token(ctx context.Context) (string, error)
}

TokenProvider returns a valid access token for the next request. The provider is invoked on every request and is responsible for caching.

type TokenProviderFunc

type TokenProviderFunc func(ctx context.Context) (string, error)

TokenProviderFunc adapts a plain function to the TokenProvider interface.

func (TokenProviderFunc) Token

func (f TokenProviderFunc) Token(ctx context.Context) (string, error)

type ZitadelTokenProvider

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

ZitadelTokenProvider authenticates against a Zitadel instance using a service-account JSON Key file (the JWT Profile grant). Acquired tokens are cached in-memory until shortly before expiry.

func NewZitadelTokenProvider

func NewZitadelTokenProvider(keyPath, issuer, projectID string) (*ZitadelTokenProvider, error)

NewZitadelTokenProvider builds a provider from a Zitadel service-account key file. issuer is the Zitadel instance base URL (e.g. https://auth.quantumbpm.com). projectID, when set, adds the project audience scope so issued tokens are accepted by the platform API.

func (*ZitadelTokenProvider) Token

func (p *ZitadelTokenProvider) Token(ctx context.Context) (string, error)

Token returns a cached bearer token if still valid, otherwise exchanges a freshly-signed JWT assertion for a new access token.

Jump to

Keyboard shortcuts

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