nuts

package
v0.0.0-...-25571b7 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2024 License: GPL-3.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type APIConfig

type APIConfig struct {
	URL string `koanf:"url"`
}

func (APIConfig) Parse

func (n APIConfig) Parse() *url.URL

type Config

type Config struct {
	API              APIConfig    `koanf:"api"`
	Public           PublicConfig `koanf:"public"`
	OwnSubject       string       `koanf:"subject"`
	DiscoveryService string       `koanf:"discoveryservice"`
}

func (Config) Validate

func (c Config) Validate() error

type CsdDirectory

type CsdDirectory struct {
	// APIClient is a REST API client to invoke the Nuts node's private Discovery Service API.
	APIClient discovery.ClientWithResponsesInterface
	ServiceID string
	// contains filtered or unexported fields
}

CsdDirectory is a CSD Directory that is backed by Nuts Discovery Services. It looks up fhir.Endpoint instances of owning entities (e.g. care organizations) in the Nuts Discovery Service.

func (*CsdDirectory) LookupEndpoint

func (n *CsdDirectory) LookupEndpoint(ctx context.Context, owner fhir.Identifier, endpointName string) ([]fhir.Endpoint, error)

LookupEndpoint searches for endpoints of the given owner, with the given endpointName in the given Discovery Service. It queries the Nuts Discovery Service, translating the owner's identifier to a credential attribute (see IdentifierCredentialMapping). The endpoint is retrieved from the Nuts Discovery Service registration's registrationParameters, identified by endpointName.

func (*CsdDirectory) LookupEntity

func (n *CsdDirectory) LookupEntity(ctx context.Context, identifier fhir.Identifier) (*fhir.Reference, error)

type DutchNutsProfile

type DutchNutsProfile struct {
	Config Config
	// contains filtered or unexported fields
}

DutchNutsProfile is the Profile for running the SCP-node using the Nuts, with Dutch Verifiable Credential configuration and code systems. - Authentication: Nuts RFC021 Access Tokens - Care Services Discovery: Nuts Discovery Service

func New

func New(config Config) (*DutchNutsProfile, error)

func (DutchNutsProfile) Authenticator

func (d DutchNutsProfile) Authenticator(resourceServerURL *url.URL, fn func(writer http.ResponseWriter, request *http.Request)) func(writer http.ResponseWriter, request *http.Request)

Authenticator authenticates the caller according to the Nuts authentication. The caller is required to provide an OAuth2 access token in the Authorization header, which is introspected at the Nuts node. The result is then mapped to a FHIR Organization resource, using Dutch coding systems (URA).

func (DutchNutsProfile) CsdDirectory

func (d DutchNutsProfile) CsdDirectory() csd.Directory

func (DutchNutsProfile) HttpClient

func (d DutchNutsProfile) HttpClient() *http.Client

func (*DutchNutsProfile) Identities

func (d *DutchNutsProfile) Identities(ctx context.Context) ([]fhir.Identifier, error)

Identities consults the Nuts node to retrieve the local identities of the SCP node, given the credentials in the subject's wallet.

func (DutchNutsProfile) RegisterHTTPHandlers

func (d DutchNutsProfile) RegisterHTTPHandlers(basePath string, resourceServerURL *url.URL, mux *http.ServeMux)

RegisterHTTPHandlers registers the well-known OAuth2 Protected Resource HTTP endpoint that is used by OAuth2 Relying Parties to discover the OAuth2 Authorization Server.

type PublicConfig

type PublicConfig struct {
	URL string `koanf:"url"`
}

func (PublicConfig) Parse

func (c PublicConfig) Parse() *url.URL

Jump to

Keyboard shortcuts

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