apsislabs / apsislabs/phi_attrs
PHIPromise
- Dominant language
- Ruby
- Stars
- 31
- Forks
- 3
- PR merge metrics
- No merged PRs in 30d
Description
This is something I want:
Sometimes I want to capture PHI at a certain point in time, but not use it until the future (capture before/after data, send it).
Being able to grab phi into a `Promise` like object and then record the access when (and if) it's actually accessed would be really useful.
```rb
# Data accessed, but Access not recorded:
before_promise = phi_object.capture_phi { |po| { secret: po.phi_protected_field } }
if update_protected_fields(phi_object)
# Access Recorded (data *not* freshly recorded):
before = before_promise.result
# Data accesed *and* access recorded:
after = phi_object.allow_phi { |po| { secret: po.phi_protected_field } }
else
# Since before_promise.result was *not* called, the access was not logged
end
```
Contributor guide
No contributing guide indexed for this repository
Research direction
Start by tracing the existing PHI access APIs represented by capture_phi, result, and allow_phi; the issue does not identify files or tests. Compare the current logging behavior with the example, especially deferred access, result evaluation, and the branch where result is never called, then define tests for those cases before implementation.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rails, ruby
- Domain
- backend, security
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100