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.
type TokenProvider ¶
TokenProvider returns a valid access token for the next request. The provider is invoked on every request and is responsible for caching.
type TokenProviderFunc ¶
TokenProviderFunc adapts a plain function to the TokenProvider interface.
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.