testutil

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 23, 2026 License: MIT Imports: 7 Imported by: 0 modules, 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 testutil holds helpers shared across package tests. Nothing in here ships in a binary — it is imported only from _test.go files.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HydraAuthorize

func HydraAuthorize(ctx context.Context, adm, authURL, subject string) (string, error)

HydraAuthorize drives a real Hydra authorize flow: opens authURL in a cookie-carrying client, accepts the login request on the admin API as subject, accepts consent for the openid scope, and returns the authorization code. The caller exchanges it (Verifier.Exchange). The only human step faked is "who clicked accept" — every token is minted by real Hydra.

Expects a dev Hydra (`serve all --dev`, DSN=memory) with URLS_SELF_ISSUER matching the public URL, e.g.:

docker run -d --name veil-hydra-test -p 5555:4444 -p 5556:4445 \
  -e DSN=memory -e SECRETS_SYSTEM=test-system-secret-0123456789abcdef \
  -e OIDC_SUBJECT_IDENTIFIERS_PAIRWISE_SALT=test-salt-0123456789abcdef \
  -e URLS_SELF_ISSUER=http://127.0.0.1:5555 \
  oryd/hydra:v26.2.0 serve all --dev

func HydraEnsureClient

func HydraEnsureClient(ctx context.Context, adm, clientID, redirectURI string) error

HydraEnsureClient registers a public PKCE client on a dev Hydra admin API; tolerates an existing registration (409).

Types

This section is empty.

Jump to

Keyboard shortcuts

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