orfeas_pam_dsl 0.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/CHANGELOG.md +84 -0
- data/MIT-LICENSE +21 -0
- data/README.md +1365 -0
- data/Rakefile +11 -0
- data/lib/pam_dsl/consent.rb +110 -0
- data/lib/pam_dsl/field.rb +76 -0
- data/lib/pam_dsl/gdpr_compliance.rb +560 -0
- data/lib/pam_dsl/pii_detector.rb +442 -0
- data/lib/pam_dsl/pii_masker.rb +121 -0
- data/lib/pam_dsl/policy.rb +175 -0
- data/lib/pam_dsl/policy_comparator.rb +296 -0
- data/lib/pam_dsl/policy_generator.rb +558 -0
- data/lib/pam_dsl/purpose.rb +78 -0
- data/lib/pam_dsl/railtie.rb +25 -0
- data/lib/pam_dsl/registry.rb +50 -0
- data/lib/pam_dsl/reporter.rb +789 -0
- data/lib/pam_dsl/retention.rb +102 -0
- data/lib/pam_dsl/tasks/privacy.rake +139 -0
- data/lib/pam_dsl/version.rb +3 -0
- data/lib/pam_dsl.rb +67 -0
- metadata +136 -0
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
module PamDsl
|
|
2
|
+
# Registry for storing and retrieving policies
|
|
3
|
+
class Registry
|
|
4
|
+
attr_reader :policies
|
|
5
|
+
|
|
6
|
+
def initialize
|
|
7
|
+
@policies = {}
|
|
8
|
+
end
|
|
9
|
+
|
|
10
|
+
# Register a policy
|
|
11
|
+
def register(name, policy)
|
|
12
|
+
@policies[name.to_sym] = policy
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
# Get a policy by name
|
|
16
|
+
def get(name)
|
|
17
|
+
@policies[name.to_sym]
|
|
18
|
+
end
|
|
19
|
+
|
|
20
|
+
# Get all policies
|
|
21
|
+
def all
|
|
22
|
+
@policies.values
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
# Get all policy names
|
|
26
|
+
def names
|
|
27
|
+
@policies.keys
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
# Check if policy exists
|
|
31
|
+
def exists?(name)
|
|
32
|
+
@policies.key?(name.to_sym)
|
|
33
|
+
end
|
|
34
|
+
|
|
35
|
+
# Remove a policy
|
|
36
|
+
def remove(name)
|
|
37
|
+
@policies.delete(name.to_sym)
|
|
38
|
+
end
|
|
39
|
+
|
|
40
|
+
# Clear all policies
|
|
41
|
+
def clear
|
|
42
|
+
@policies.clear
|
|
43
|
+
end
|
|
44
|
+
|
|
45
|
+
# Count of registered policies
|
|
46
|
+
def count
|
|
47
|
+
@policies.count
|
|
48
|
+
end
|
|
49
|
+
end
|
|
50
|
+
end
|