profile

package
v0.0.0-...-a70b9b0 Latest Latest
Warning

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

Go to latest
Published: Dec 20, 2024 License: GPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const FHIRBaseURLEndpointName = "fhirBaseUrl"

FHIRBaseURLEndpointName is the name of the endpoint in the CSD that contains the FHIR Base URL.

View Source
const FHIRNotificationURLEndpointName = "fhirNotificationURL"

FHIRNotificationURLEndpointName is the name of the endpoint in the CSD that contains the FHIR Notification URL.

Variables

This section is empty.

Functions

This section is empty.

Types

type Provider

type Provider interface {
	// Authenticator returns a middleware http.HandlerFunc that authenticates the caller according to the profile's authentication method.
	// It sets the authenticate user as auth.Principal in the request context.
	// The resourceServerURL is the external base URL of the resource being accessed.
	Authenticator(resourceServerURL *url.URL, fn func(writer http.ResponseWriter, request *http.Request)) func(writer http.ResponseWriter, request *http.Request)
	// RegisterHTTPHandlers register's the Profile's custom HTTP handlers on the given router.
	// The resourceServerURL and basePath are there to support multiple contexts (e.g. CarePlanContributor and CarePlanService), for instance:
	// resourceServerURL: https://example.com/cpc
	// basePath: /cpc
	RegisterHTTPHandlers(basePath string, resourceServerURL *url.URL, mux *http.ServeMux)
	// HttpClient returns an HTTP Client that can be used to perform Shared Care Planning transactions at a Care Plan Contributor or Care Plan Service.
	// The HTTP client handles acquiring the required authentication credentials (e.g. OAuth2 access tokens).
	HttpClient() *http.Client
	// CsdDirectory returns the directory service for finding endpoints and organizations through Care Service Discovery (IHE-CSD).
	CsdDirectory() csd.Directory
	// Identities returns the identities of the local tenant (e.g., a care organization).
	Identities(ctx context.Context) ([]fhir.Identifier, error)
}

type TestCsdDirectory

type TestCsdDirectory struct {
	Endpoint string
}

func (TestCsdDirectory) LookupEndpoint

func (t TestCsdDirectory) LookupEndpoint(_ context.Context, owner *fhir.Identifier, endpointName string) ([]fhir.Endpoint, error)

func (TestCsdDirectory) LookupEntity

func (t TestCsdDirectory) LookupEntity(ctx context.Context, identifier fhir.Identifier) (*fhir.Reference, error)

type TestProfile

type TestProfile struct {
	Principal *auth.Principal

	CSD csd.Directory
	// contains filtered or unexported fields
}

TestProfile is a Profile implementation for testing purposes, that does very basic authentication that asserts the right HTTP Client is used.

func Test

func Test() TestProfile

func (TestProfile) Authenticator

func (t TestProfile) Authenticator(_ *url.URL, fn func(writer http.ResponseWriter, request *http.Request)) func(writer http.ResponseWriter, request *http.Request)

func (TestProfile) CsdDirectory

func (t TestProfile) CsdDirectory() csd.Directory

func (TestProfile) HttpClient

func (t TestProfile) HttpClient() *http.Client

func (TestProfile) Identities

func (t TestProfile) Identities(_ context.Context) ([]fhir.Identifier, error)

func (TestProfile) RegisterHTTPHandlers

func (t TestProfile) RegisterHTTPHandlers(_ string, _ *url.URL, _ *http.ServeMux)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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