phi_attrs 0.2.0 → 0.2.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: ba341e9dd1cd04be0df49bb9fde3ed07efe919b0
4
- data.tar.gz: 347e29ebed345ca44efb5a40526d17c5d259d394
2
+ SHA256:
3
+ metadata.gz: f6271ebbfae4a5ddad7aa1ad27b812cc4056a5a4958b1067ddf2aa717975b738
4
+ data.tar.gz: '098ec65389f50bbe24876657a1ff9eb78bbbe17fb5192804ebbc2f75eedd97f4'
5
5
  SHA512:
6
- metadata.gz: 3c04bcfdf0147373ed81c48110345b1d39eb68aa9912c263d4178faa36fde1bae35d9e8eff7fb5a17d890402b8402706f8ea5a1d218a567ae2975f08f3c03e1d
7
- data.tar.gz: c8800bf401bd64809f91b481798beb143bb10b78cc7ed85e9cb6d32a9cca48f07133e1e3b36456b1caf80420efd4b1c92406be92acdefd7527fa609ebcb1fc7c
6
+ metadata.gz: a5832351881d96019071f9b77ac4e08b991104dca6f47c8a1917f5c3546002d7510c5d0fe7ceaa4fe37df7006ec71105acbbcc99a5c9928e57e78b43a7cd2d5d
7
+ data.tar.gz: 3a153bd1a992dbbb94de889f8a82c22f969dd1bb9b9f36254485d0265f70cba89d89f1c8b424e30056aa1c23c5b8e8be3142d7b5ccfed05c970ec67aa3614d69
@@ -0,0 +1,25 @@
1
+ name: Spec CI
2
+
3
+ on: [push, pull_request]
4
+
5
+ jobs:
6
+ build:
7
+ runs-on: ubuntu-latest
8
+ name: Ruby ${{ matrix.ruby }}
9
+ strategy:
10
+ matrix:
11
+ ruby: [2.5, 2.6, 2.7]
12
+
13
+ steps:
14
+ - uses: actions/checkout@v2
15
+ - name: Set up Ruby ${{ matrix.ruby }}
16
+ uses: actions/setup-ruby@v1
17
+ with:
18
+ ruby-version: ${{ matrix.ruby }}
19
+ - name: Install dependencies
20
+ run: |
21
+ gem install bundler
22
+ bundle install
23
+ bundle exec appraisal install
24
+ - name: Run rspec
25
+ run: bundler exec appraisal rspec
data/.gitignore CHANGED
@@ -12,9 +12,11 @@
12
12
  .byebug_history
13
13
 
14
14
  /test/sample/tmp/
15
+ *.sqlite
15
16
  *.sqlite3
16
17
  *.log
17
18
  .rspec_status
19
+ gemfiles/*.gemfile.lock
18
20
 
19
21
  # Macs. Ugh.
20
22
  .DS_Store
@@ -4,6 +4,7 @@ Rails:
4
4
  AllCops:
5
5
  Exclude:
6
6
  - 'bin/**/*'
7
+ - 'gemfiles/**/*'
7
8
  - 'spec/internal/db/schema.rb'
8
9
  TargetRubyVersion: 2.5
9
10
 
data/Appraisals CHANGED
@@ -2,5 +2,15 @@
2
2
 
3
3
  appraise 'rails-5.1' do
4
4
  gem 'rails', '5.1.3'
5
- gem 'tzinfo-data'
5
+ gem 'sqlite3', '~> 1.3', '< 1.4'
6
6
  end
7
+
8
+ appraise 'rails-5.2' do
9
+ gem 'rails', '5.2.4'
10
+ gem 'sqlite3', '~> 1.4'
11
+ end
12
+
13
+ appraise 'rails-6.0' do
14
+ gem 'rails', '6.0.3'
15
+ gem 'sqlite3', '~> 1.4'
16
+ end
data/README.md CHANGED
@@ -1,4 +1,5 @@
1
- # phi_attrs [![Gem Version](https://badge.fury.io/rb/phi_attrs.svg)](https://badge.fury.io/rb/phi_attrs) [![Build Status](https://travis-ci.org/apsislabs/phi_attrs.svg?branch=master)](https://travis-ci.org/apsislabs/phi_attrs)
1
+ # phi_attrs [![Gem Version](https://badge.fury.io/rb/phi_attrs.svg)](https://badge.fury.io/rb/phi_attrs) [![Spec CI](https://github.com/apsislabs/phi_attrs/workflows/Spec%20CI/badge.svg)](https://github.com/apsislabs/phi_attrs/actions)
2
+
2
3
 
3
4
  HIPAA compliant PHI access logging for Ruby on Rails.
4
5
 
@@ -413,6 +414,11 @@ Tests are written using [RSpec](http://rspec.info/) and are setup to use [Apprai
413
414
  $ bin/ssh_to_container
414
415
  $ bundle exec appraisal rspec spec/path/to/spec.rb
415
416
 
417
+ To run just a particular rails version:
418
+ $ bundle exec appraisal rails-5.1 rspec
419
+ $ bundle exec appraisal rails-5.2 rspec
420
+ $ bundle exec appraisal rails-6.0 rspec
421
+
416
422
  ### Console
417
423
 
418
424
  An interactive prompt that will allow you to experiment with the gem.
File without changes
data/config.ru CHANGED
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'rubygems'
4
- require 'bundler'
3
+ require "rubygems"
4
+ require "bundler"
5
5
 
6
6
  Bundler.require :default, :development
7
7
 
@@ -7,7 +7,7 @@ services:
7
7
  - bundle_cache:/bundle
8
8
  - .:/app
9
9
  environment:
10
- - BUNDLER_VERSION=2.0.1
10
+ - BUNDLER_VERSION=2.1.4
11
11
  - BUNDLE_JOBS=5
12
12
  - BUNDLE_PATH=/bundle
13
13
  - BUNDLE_BIN=/bundle/bin
@@ -1,10 +1,8 @@
1
- # frozen_string_literal: true
2
-
3
1
  # This file was generated by Appraisal
4
2
 
5
- source 'https://rubygems.org'
3
+ source "https://rubygems.org"
6
4
 
7
- gem 'rails', '5.1.3'
8
- gem 'tzinfo-data'
5
+ gem "rails", "5.1.3"
6
+ gem "sqlite3", "~> 1.3", "< 1.4"
9
7
 
10
- gemspec path: '../'
8
+ gemspec path: "../"
@@ -0,0 +1,8 @@
1
+ # This file was generated by Appraisal
2
+
3
+ source "https://rubygems.org"
4
+
5
+ gem "rails", "5.2.4"
6
+ gem "sqlite3", "~> 1.4"
7
+
8
+ gemspec path: "../"
@@ -0,0 +1,8 @@
1
+ # This file was generated by Appraisal
2
+
3
+ source "https://rubygems.org"
4
+
5
+ gem "rails", "6.0.3"
6
+ gem "sqlite3", "~> 1.4"
7
+
8
+ gemspec path: "../"
@@ -16,14 +16,12 @@ module PhiAttrs
16
16
  class_attribute :__phi_extend_methods
17
17
  class_attribute :__phi_methods_wrapped
18
18
  class_attribute :__phi_methods_to_extend
19
- class_attribute :__instances_with_extended_phi
20
19
 
21
20
  after_initialize :wrap_phi
22
21
 
23
22
  # These have to default to an empty array
24
23
  self.__phi_methods_wrapped = []
25
24
  self.__phi_methods_to_extend = []
26
- self.__instances_with_extended_phi = Set.new
27
25
  end
28
26
 
29
27
  class_methods do
@@ -223,6 +221,10 @@ module PhiAttrs
223
221
  __phi_stack.present? && __phi_stack[-1][:phi_access_allowed]
224
222
  end
225
223
 
224
+ def __instances_with_extended_phi
225
+ RequestStore.store[:phi_instances_with_extended_phi] ||= Set.new
226
+ end
227
+
226
228
  def __phi_stack
227
229
  RequestStore.store[:phi_access] ||= {}
228
230
  RequestStore.store[:phi_access][name] ||= []
@@ -422,6 +424,11 @@ module PhiAttrs
422
424
  !phi_context.nil? && phi_context[:phi_access_allowed]
423
425
  end
424
426
 
427
+ def reload
428
+ @__phi_relations_extended.clear
429
+ super
430
+ end
431
+
425
432
  protected
426
433
 
427
434
  # Adds a disallow phi flag to instance internal stack.
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module PhiAttrs
4
- VERSION = '0.2.0'
4
+ VERSION = '0.2.1'
5
5
  end
@@ -31,17 +31,17 @@ Gem::Specification.new do |spec|
31
31
  spec.add_runtime_dependency 'rails', '>= 4.2.0'
32
32
  spec.add_runtime_dependency 'request_store', '~> 1.4'
33
33
 
34
- spec.add_development_dependency 'appraisal', '~> 2.1'
34
+ spec.add_development_dependency 'appraisal'
35
35
  spec.add_development_dependency 'bundler', '~> 2.0'
36
36
  spec.add_development_dependency 'byebug'
37
37
  spec.add_development_dependency 'chandler'
38
- spec.add_development_dependency 'combustion', '~> 0.9.1'
38
+ spec.add_development_dependency 'combustion'
39
39
  spec.add_development_dependency 'factory_bot_rails'
40
40
  spec.add_development_dependency 'faker'
41
- spec.add_development_dependency 'rake', '~> 10.0'
41
+ spec.add_development_dependency 'rake'
42
42
  spec.add_development_dependency 'rspec', '~> 3.7'
43
43
  spec.add_development_dependency 'rspec-rails', '~> 3.7'
44
44
  spec.add_development_dependency 'rubocop'
45
45
  spec.add_development_dependency 'simplecov', '~> 0.16'
46
- spec.add_development_dependency 'sqlite3', '~> 1.3'
46
+ spec.add_development_dependency 'tzinfo-data'
47
47
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: phi_attrs
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Wyatt Kirby
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-03-30 00:00:00.000000000 Z
11
+ date: 2020-11-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -42,16 +42,16 @@ dependencies:
42
42
  name: appraisal
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - "~>"
45
+ - - ">="
46
46
  - !ruby/object:Gem::Version
47
- version: '2.1'
47
+ version: '0'
48
48
  type: :development
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - "~>"
52
+ - - ">="
53
53
  - !ruby/object:Gem::Version
54
- version: '2.1'
54
+ version: '0'
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: bundler
57
57
  requirement: !ruby/object:Gem::Requirement
@@ -98,16 +98,16 @@ dependencies:
98
98
  name: combustion
99
99
  requirement: !ruby/object:Gem::Requirement
100
100
  requirements:
101
- - - "~>"
101
+ - - ">="
102
102
  - !ruby/object:Gem::Version
103
- version: 0.9.1
103
+ version: '0'
104
104
  type: :development
105
105
  prerelease: false
106
106
  version_requirements: !ruby/object:Gem::Requirement
107
107
  requirements:
108
- - - "~>"
108
+ - - ">="
109
109
  - !ruby/object:Gem::Version
110
- version: 0.9.1
110
+ version: '0'
111
111
  - !ruby/object:Gem::Dependency
112
112
  name: factory_bot_rails
113
113
  requirement: !ruby/object:Gem::Requirement
@@ -140,16 +140,16 @@ dependencies:
140
140
  name: rake
141
141
  requirement: !ruby/object:Gem::Requirement
142
142
  requirements:
143
- - - "~>"
143
+ - - ">="
144
144
  - !ruby/object:Gem::Version
145
- version: '10.0'
145
+ version: '0'
146
146
  type: :development
147
147
  prerelease: false
148
148
  version_requirements: !ruby/object:Gem::Requirement
149
149
  requirements:
150
- - - "~>"
150
+ - - ">="
151
151
  - !ruby/object:Gem::Version
152
- version: '10.0'
152
+ version: '0'
153
153
  - !ruby/object:Gem::Dependency
154
154
  name: rspec
155
155
  requirement: !ruby/object:Gem::Requirement
@@ -207,19 +207,19 @@ dependencies:
207
207
  - !ruby/object:Gem::Version
208
208
  version: '0.16'
209
209
  - !ruby/object:Gem::Dependency
210
- name: sqlite3
210
+ name: tzinfo-data
211
211
  requirement: !ruby/object:Gem::Requirement
212
212
  requirements:
213
- - - "~>"
213
+ - - ">="
214
214
  - !ruby/object:Gem::Version
215
- version: '1.3'
215
+ version: '0'
216
216
  type: :development
217
217
  prerelease: false
218
218
  version_requirements: !ruby/object:Gem::Requirement
219
219
  requirements:
220
- - - "~>"
220
+ - - ">="
221
221
  - !ruby/object:Gem::Version
222
- version: '1.3'
222
+ version: '0'
223
223
  description:
224
224
  email:
225
225
  - wyatt@apsis.io
@@ -227,10 +227,10 @@ executables: []
227
227
  extensions: []
228
228
  extra_rdoc_files: []
229
229
  files:
230
+ - ".github/workflows/build.yml"
230
231
  - ".gitignore"
231
232
  - ".rspec"
232
233
  - ".rubocop.yml"
233
- - ".travis.yml"
234
234
  - Appraisals
235
235
  - CHANGELOG.md
236
236
  - DISCLAIMER.txt
@@ -250,6 +250,8 @@ files:
250
250
  - docker/start.sh
251
251
  - gemfiles/.bundle/config
252
252
  - gemfiles/rails_5.1.gemfile
253
+ - gemfiles/rails_5.2.gemfile
254
+ - gemfiles/rails_6.0.gemfile
253
255
  - lib/phi_attrs.rb
254
256
  - lib/phi_attrs/configure.rb
255
257
  - lib/phi_attrs/exceptions.rb
@@ -281,8 +283,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
281
283
  - !ruby/object:Gem::Version
282
284
  version: '0'
283
285
  requirements: []
284
- rubyforge_project:
285
- rubygems_version: 2.6.13
286
+ rubygems_version: 3.0.3
286
287
  signing_key:
287
288
  specification_version: 4
288
289
  summary: PHI Access Restriction & Logging for Rails ActiveRecord
@@ -1,8 +0,0 @@
1
- sudo: false
2
- language: ruby
3
- cache: bundler
4
- rvm:
5
- - 2.4.2
6
- before_install:
7
- - gem update --system
8
- - gem install bundler