Documentation
¶
Overview ¶
Package infernotest provides helpers and a reference SMART host profile for Inferno conformance checks.
Index ¶
- Constants
- func AssertStandaloneLaunchFlow(t *testing.T, baseURL, fhirBase, clientID, redirectURI, scope string)
- func AssertWellKnownCapabilitiesSTU2(t *testing.T, config map[string]any)
- func AssertWellKnownEndpoint(t *testing.T, status int, headers http.Header, raw []byte) map[string]any
- func FetchWellKnownConfiguration(ctx context.Context, client *http.Client, fhirBase string) ([]byte, http.Header, int, error)
- func ParseWellKnownConfiguration(raw []byte) (map[string]any, error)
- func WellKnownURL(fhirBase string) string
- type ReferenceMeta
Constants ¶
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 ¶
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 ¶
ParseWellKnownConfiguration parses a SMART discovery JSON document.
func WellKnownURL ¶
WellKnownURL returns the Inferno SMART discovery URL for a FHIR base endpoint.
Types ¶
type ReferenceMeta ¶
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.