Documentation
¶
Index ¶
- Variables
- func NewPolicyInput(request PDPRequest) (PolicyInput, PolicyResult)
- type Component
- func (c *Component) HandleGetBundle(w http.ResponseWriter, r *http.Request)
- func (c *Component) HandleListBundles(w http.ResponseWriter, r *http.Request)
- func (c *Component) HandleMainPolicy(w http.ResponseWriter, r *http.Request)
- func (c *Component) HandlePolicy(w http.ResponseWriter, r *http.Request)
- func (c *Component) RegisterHttpHandlers(publicMux *http.ServeMux, internalMux *http.ServeMux)
- func (c *Component) Start() error
- func (c *Component) Stop(ctx context.Context) error
- type Config
- type FHIRRestData
- type HTTPRequest
- type OtherSubjectProperties
- type PDPContext
- type PDPInput
- type PDPRequest
- type PDPResponse
- type PIPConfig
- type Params
- type PathDef
- type PolicyAction
- type PolicyContext
- type PolicyInput
- type PolicyResource
- type PolicyResourceProperties
- type PolicyResult
- type ResultReason
- type Subject
- type SubjectProperties
- type Tokens
- type TypeResultCode
Constants ¶
This section is empty.
Variables ¶
View Source
var FS embed.FS
Functions ¶
func NewPolicyInput ¶ added in v0.5.0
func NewPolicyInput(request PDPRequest) (PolicyInput, PolicyResult)
Types ¶
type Component ¶
type Component struct {
Config Config
// contains filtered or unexported fields
}
func New ¶
func New(config Config, consentChecker mitz.ConsentChecker) (*Component, error)
New creates an instance of the pdp component, which provides a simple policy decision endpoint.
func (*Component) HandleGetBundle ¶ added in v0.5.0
func (c *Component) HandleGetBundle(w http.ResponseWriter, r *http.Request)
HandleGetBundle serves an OPA policy bundle for a specific scope
func (*Component) HandleListBundles ¶ added in v0.5.0
func (c *Component) HandleListBundles(w http.ResponseWriter, r *http.Request)
HandleListBundles returns a list of available OPA policy bundles
func (*Component) HandleMainPolicy ¶
func (c *Component) HandleMainPolicy(w http.ResponseWriter, r *http.Request)
func (*Component) HandlePolicy ¶
func (c *Component) HandlePolicy(w http.ResponseWriter, r *http.Request)
func (*Component) RegisterHttpHandlers ¶
type Config ¶
func DefaultConfig ¶
func DefaultConfig() Config
type FHIRRestData ¶ added in v0.6.0
type FHIRRestData struct {
CapabilityChecked bool `json:"capability_checked"`
Include []string `json:"include"`
InteractionType fhir.TypeRestfulInteraction `json:"interaction_type"`
Operation *string `json:"operation"`
Revinclude []string `json:"revinclude"`
SearchParams map[string]string `json:"search_params"`
}
type HTTPRequest ¶ added in v0.5.0
type OtherSubjectProperties ¶ added in v0.7.0
type PDPContext ¶ added in v0.5.0
type PDPInput ¶ added in v0.5.0
type PDPInput struct {
Subject Subject `json:"subject"`
Request HTTPRequest `json:"request"`
Context PDPContext `json:"context"`
}
type PDPRequest ¶ added in v0.5.0
type PDPRequest struct {
Input PDPInput `json:"input"`
}
type PDPResponse ¶ added in v0.5.0
type PDPResponse struct {
Result PolicyResult `json:"result"`
}
type PathDef ¶ added in v0.5.0
type PathDef struct {
Interaction fhir.TypeRestfulInteraction
PathDef []string
Verb string
}
type PolicyAction ¶ added in v0.5.0
type PolicyAction struct {
Name string `json:"name"`
ConnectionTypeCode string `json:"connection_type_code"`
Request HTTPRequest `json:"request"`
FHIRRest FHIRRestData `json:"fhir_rest"`
}
type PolicyContext ¶ added in v0.5.0
type PolicyContext struct {
DataHolderFacilityType string `json:"data_holder_facility_type"`
DataHolderOrganizationId string `json:"data_holder_organization_id"`
MitzConsent bool `json:"mitz_consent"`
PatientBSN string `json:"patient_bsn"`
PatientID string `json:"patient_id"`
PurposeOfUse string `json:"purpose_of_use"`
}
type PolicyInput ¶ added in v0.5.0
type PolicyInput struct {
Subject Subject `json:"subject"`
Resource PolicyResource `json:"resource"`
Action PolicyAction `json:"action"`
Context PolicyContext `json:"context"`
}
type PolicyResource ¶ added in v0.5.0
type PolicyResource struct {
Type *fhir.ResourceType `json:"type"`
Properties PolicyResourceProperties `json:"properties"`
}
type PolicyResourceProperties ¶ added in v0.5.0
type PolicyResult ¶ added in v0.4.0
type PolicyResult struct {
Policy string `json:"policy"`
Allow bool `json:"allow"`
Reasons []ResultReason `json:"reasons"`
}
func Allow ¶ added in v0.4.0
func Allow() PolicyResult
Allow helper for creating an allowed result without reasons
func Deny ¶ added in v0.4.0
func Deny(reason ResultReason) PolicyResult
Deny Helper for creating a result with a single deny reason
func (*PolicyResult) AddReasons ¶ added in v0.5.0
func (p *PolicyResult) AddReasons(input []string, format string, code TypeResultCode)
type ResultReason ¶ added in v0.4.0
type ResultReason struct {
Code TypeResultCode `json:"code"`
Description string `json:"description"`
}
func (ResultReason) String ¶ added in v0.7.0
func (r ResultReason) String() string
type Subject ¶ added in v0.5.0
type Subject struct {
Type string `json:"type"`
Id string `json:"id"`
Properties SubjectProperties `json:"properties"`
}
type SubjectProperties ¶ added in v0.5.0
type SubjectProperties struct {
OtherProps map[string]any `json:"-"`
ClientId string `json:"client_id"`
ClientQualifications []string `json:"client_qualifications"`
SubjectId string `json:"subject_id"`
SubjectOrganizationId string `json:"subject_organization_id"`
SubjectOrganization string `json:"subject_organization"`
SubjectFacilityType string `json:"subject_facility_type"`
SubjectRole string `json:"subject_role"`
}
func (SubjectProperties) MarshalJSON ¶ added in v0.7.0
func (s SubjectProperties) MarshalJSON() ([]byte, error)
func (*SubjectProperties) UnmarshalJSON ¶ added in v0.7.0
func (s *SubjectProperties) UnmarshalJSON(data []byte) error
type Tokens ¶ added in v0.5.0
type Tokens struct {
Interaction fhir.TypeRestfulInteraction
ResourceType *fhir.ResourceType
ResourceId string
OperationName string
VersionId string
}
type TypeResultCode ¶ added in v0.5.0
type TypeResultCode string
const ( TypeResultCodeMissingRequiredValue TypeResultCode = "missing_required_value" TypeResultCodeUnexpectedInput TypeResultCode = "unexpected_input" TypeResultCodeNotAllowed TypeResultCode = "not_allowed" TypeResultCodeNotImplemented TypeResultCode = "not_implemented" TypeResultCodeInternalError TypeResultCode = "internal_error" TypeResultCodePIPError TypeResultCode = "pip_error" TypeResultCodeInformational TypeResultCode = "info" )
Source Files
¶
Click to show internal directories.
Click to hide internal directories.