Summary
Implement SMART App Launch 2.2 granular scopes in pkg/smart and enforce them across FHIR data paths. Today HAIStack supports SMART 1.x-style scopes (patient/*.read, user/Patient.write) and documents 2.2 granular scopes as deferred in smart.SMARTVersion.
Background
SMART 2.0+ replaces coarse .read/.write suffixes with CRUDS letters (r, s, c, u, d). SMART 2.2 adds optional FHIR search-parameter filters on scopes:
patient/Observation.rs?category=laboratory
Servers must enforce filters on read, search, create, update, delete, and must not leak out-of-scope resources via _include, _revinclude, bundles, or $everything.
HAIStack already enforces patient compartment via TenantContext.PatientScope and ApplyPatientSearchScopeToParams — granular scopes are the next layer of search-parameter narrowing within that compartment.
Proposed scope
Phase 1 — Parsing and metadata
Phase 2 — Enforcement
Phase 3 — Tests
Acceptance criteria
Out of scope
- Full OAuth2/OIDC authorization server
- Dynamic client registration server
- EHR launch UI orchestration
Related
References
Summary
Implement SMART App Launch 2.2 granular scopes in
pkg/smartand enforce them across FHIR data paths. Today HAIStack supports SMART 1.x-style scopes (patient/*.read,user/Patient.write) and documents 2.2 granular scopes as deferred insmart.SMARTVersion.Background
SMART 2.0+ replaces coarse
.read/.writesuffixes with CRUDS letters (r,s,c,u,d). SMART 2.2 adds optional FHIR search-parameter filters on scopes:Servers must enforce filters on read, search, create, update, delete, and must not leak out-of-scope resources via
_include,_revinclude, bundles, or$everything.HAIStack already enforces patient compartment via
TenantContext.PatientScopeandApplyPatientSearchScopeToParams— granular scopes are the next layer of search-parameter narrowing within that compartment.Proposed scope
Phase 1 — Parsing and metadata
pkg/smart/scope.goto parse CRUDS suffixes (patient/Observation.rs,user/*.cruds)?param=valuefilter suffix (2.2).read→.rs,.write→.cud,.*→.cruds)permission-v2andpermission-v2.2insmart.Configuration/ reference hostpkg/smart/README.mdPhase 2 — Enforcement
ScopeSetmatching per operation letter (read vs search vs write)pkg/search/ HTTP search path_include/_revinclude/ bundle results (extendfilterSearchBundlePatientScopepattern)authztestscenarios)Phase 3 — Tests
pkg/testkit/authztestfor filter enforcementAcceptance criteria
patient/Observation.rs?category=Xcannot return out-of-filter resourcessmart.SMARTVersionupdated to reflect 2.2 support levelOut of scope
Related
examples/smart-authzpolicy-narrowing demoReferences