conformance

package
v0.0.1-dev.8 Latest Latest
Warning

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

Go to latest
Published: Nov 5, 2026 License: Apache-2.0 Imports: 21 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 conformance tests a live issuer and adapter against the rules of package profile. A backend's own tests call Run. Rules a browser must drive run only when Config.SignIn is set and are skipped by name otherwise.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Run

func Run(t *testing.T, cfg Config)

Run runs every rule of package profile that cfg can drive as a subtest of t.

Types

type Config

type Config struct {
	Issuer                     string
	Adapter                    string
	Bearer                     string
	BrowserClientID            string
	BrowserClientSecret        string
	CLIClientID                string
	ServiceAccountClientID     string
	ServiceAccountClientSecret string
	Resource                   Resource
	HTTP                       *http.Client
	BrowserRedirectURI         string
	SignIn                     SignIn
}

Config names the backend under test. The service account is a confidential client allowed the client credentials grant of RFC 6749 §4.4. HTTP must trust the issuer and the adapter. Resource must already be registered, with at least one binding so that a permission-set group exists. BrowserRedirectURI must be on the base origin, and the browser client must have {origin}/?signedOut=1 registered as a post-logout redirect URI for that origin and for the admin and dev origins protocol.PlaneOrigin derives from it.

type Resource

type Resource struct {
	Audience string
	Scopes   []string
}

Resource is a resource the backend has registered: Audience is its RFC 8707 §2 resource indicator and Scopes the RFC 6749 §3.3 scope tokens it accepts.

type SignIn

type SignIn func(context.Context, SignInRequest) (*url.URL, error)

SignIn drives a browser through one sign-in. It answers the URL the issuer redirected to, without following it, or an error when the issuer refused the sign-in. The device grant redirects nowhere, so its answer is ignored.

type SignInRequest

type SignInRequest struct {
	AuthorizationURL string
	UserCode         string
	Invitation       bool
	UserName         string
	Password         string
	NewPassword      string
	Name             *scim.Name
}

SignInRequest is one sign-in. AuthorizationURL is the page to open: an RFC 6749 §4.1.1 request or an RFC 8628 §3.3 verification URI. When Invitation is set there is no AuthorizationURL, and the hook opens the link in the latest message sent to UserName instead. An empty UserName means the caller's own test person, who holds Resource.Scopes through a permission set. Otherwise UserName and Password identify a person the suite created. UserCode, NewPassword and Name are what to submit if the issuer asks for them.

Jump to

Keyboard shortcuts

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