infernotest

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Sep 22, 2026 License: Apache-2.0 Imports: 24 Imported by: 0

Documentation

Overview

Package infernotest provides helpers and a reference SMART host profile for Inferno conformance checks.

Index

Constants

View Source
const (
	// DefaultClientID is the registered SMART client on the reference host.
	DefaultClientID = "inferno-reference"
	// DefaultRedirectURI is accepted for Inferno launcher redirects.
	DefaultRedirectURI = "https://inferno.healthit.gov/launcher/custom/smart/redirect"
)

Variables

This section is empty.

Functions

func AssertStandaloneLaunchFlow

func AssertStandaloneLaunchFlow(t *testing.T, baseURL, fhirBase, clientID, redirectURI, scope string)

AssertStandaloneLaunchFlow exercises Inferno-aligned standalone SMART launch: discovery at FHIR base, PKCE authorization code flow, and token exchange.

func AssertWellKnownCapabilitiesSTU2

func AssertWellKnownCapabilitiesSTU2(t *testing.T, config map[string]any)

AssertWellKnownCapabilitiesSTU2 mirrors Inferno's well_known_capabilities_stu2 test.

func AssertWellKnownEndpoint

func AssertWellKnownEndpoint(t *testing.T, status int, headers http.Header, raw []byte) map[string]any

AssertWellKnownEndpoint mirrors Inferno's well_known_endpoint test.

func FetchWellKnownConfiguration

func FetchWellKnownConfiguration(ctx context.Context, client *http.Client, fhirBase string) ([]byte, http.Header, int, error)

FetchWellKnownConfiguration performs the GET request used by Inferno's well_known_endpoint test.

func ParseWellKnownConfiguration

func ParseWellKnownConfiguration(raw []byte) (map[string]any, error)

ParseWellKnownConfiguration parses a SMART discovery JSON document.

func WellKnownURL

func WellKnownURL(fhirBase string) string

WellKnownURL returns the Inferno SMART discovery URL for a FHIR base endpoint.

Types

type ReferenceMeta

type ReferenceMeta struct {
	BaseURL     string
	FHIRBaseURL string
}

ReferenceMeta describes the URLs exposed by the reference host.

func BuildReferenceHandler

func BuildReferenceHandler(ctx context.Context, baseURL string) (http.Handler, ReferenceMeta, func(), error)

BuildReferenceHandler wires pkg/oauth and a minimal FHIR API for Inferno discovery checks.

func StartReferenceServer

func StartReferenceServer(ctx context.Context, addr string) (*http.Server, ReferenceMeta, func(), error)

StartReferenceServer listens on addr and serves the Inferno reference host.

Jump to

Keyboard shortcuts

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