checkpoint 1.1.0 → 1.1.1
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 +4 -4
- data/README.md +5 -2
- data/checkpoint.gemspec +1 -1
- data/lib/checkpoint/resource.rb +16 -0
- data/lib/checkpoint/resource/token.rb +15 -0
- data/lib/checkpoint/version.rb +1 -1
- metadata +5 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bf80606ac6b3eb3ea5e17811e5277a4bff2544fc14175a43787bdeb34d0e7c9d
|
4
|
+
data.tar.gz: 5c7458c59d16a9e71a3741e4c289c4019e1a8c86726f267e62b242b3bcc199cc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2980132b509d3df0540895110ca6aec7dfe1502c7e93178e2410998bb7ba625728280ba67058e34d2f041aaed03f3d65b1d410206b38d8f76fb609c0ca430aa4
|
7
|
+
data.tar.gz: 2820e73cda2b10a56f2557b4cac142b561c1fb2783989a77f71c9225180bf72780d364bbd5c707900976d24ac9c8e8fe66a92fbad548649d2847457e6f3de46b
|
data/README.md
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
[](https://travis-ci.org/mlibrary/checkpoint?branch=master)
|
2
2
|
[](https://coveralls.io/github/mlibrary/checkpoint?branch=master)
|
3
|
-
[](https://checkpoint.readthedocs.io/en/latest)
|
4
|
+
[](https://www.rubydoc.info/gems/checkpoint)
|
4
5
|
|
5
6
|
# Checkpoint
|
6
7
|
|
@@ -21,9 +22,11 @@ And then execute:
|
|
21
22
|
|
22
23
|
## Documentation
|
23
24
|
|
24
|
-
User documentation source is available in the `docs` directory
|
25
|
+
User documentation source is available in the `docs` directory and in rendered format
|
25
26
|
on [readthedocs](https://checkpoint.readthedocs.io/en/latest/).
|
26
27
|
|
28
|
+
API/class documentation is in YARD format and in rendered format on [rubydoc.info](https://www.rubydoc.info/gems/checkpoint).
|
29
|
+
|
27
30
|
## License
|
28
31
|
|
29
32
|
Checkpoint is licensed under the BSD-3-Clause license. See [LICENSE.md](LICENSE.md).
|
data/checkpoint.gemspec
CHANGED
@@ -28,7 +28,7 @@ Gem::Specification.new do |spec|
|
|
28
28
|
spec.add_dependency "ettin", "~> 1.1"
|
29
29
|
spec.add_dependency "sequel", "~> 5.6"
|
30
30
|
|
31
|
-
spec.add_development_dependency "bundler", "~>
|
31
|
+
spec.add_development_dependency "bundler", "~> 2.0"
|
32
32
|
spec.add_development_dependency "coveralls", "~> 0.8"
|
33
33
|
spec.add_development_dependency "pry"
|
34
34
|
spec.add_development_dependency "pry-byebug"
|
data/lib/checkpoint/resource.rb
CHANGED
@@ -54,6 +54,14 @@ module Checkpoint
|
|
54
54
|
AllOfAnyType.new
|
55
55
|
end
|
56
56
|
|
57
|
+
# Test whether this Resource represents all entities of all types.
|
58
|
+
#
|
59
|
+
# @see {::all}
|
60
|
+
# @return [Boolean] true if this is a universal wildcard
|
61
|
+
def all?
|
62
|
+
type == ALL && id == ALL
|
63
|
+
end
|
64
|
+
|
57
65
|
# Convert this object to a Resource.
|
58
66
|
#
|
59
67
|
# For Checkpoint-supplied Resources, this is an identity operation,
|
@@ -117,6 +125,14 @@ module Checkpoint
|
|
117
125
|
Resource::AllOfType.new(type)
|
118
126
|
end
|
119
127
|
|
128
|
+
# Test whether this is a Resource wildcard of some specific type.
|
129
|
+
#
|
130
|
+
# @return [Boolean] true if this Resource has a specific type, but
|
131
|
+
# has the any/all ID, representing any Resources of that type
|
132
|
+
def all_of_type?
|
133
|
+
type != ALL && id == ALL
|
134
|
+
end
|
135
|
+
|
120
136
|
# Check whether two Resources refer to the same entity.
|
121
137
|
# @param other [Resource] Another Resource to compare with
|
122
138
|
# @return [Boolean] true when the other Resource's entity is the same as
|
@@ -37,6 +37,21 @@ module Checkpoint
|
|
37
37
|
@all ||= new(Resource::ALL, Resource::ALL).freeze
|
38
38
|
end
|
39
39
|
|
40
|
+
# Test whether this token is for the special "all" Resource.
|
41
|
+
#
|
42
|
+
# @return [Boolean] true if this token represents any/all resources
|
43
|
+
def all?
|
44
|
+
type == Resource::ALL && id == Resource::ALL
|
45
|
+
end
|
46
|
+
|
47
|
+
# Test whether this token is a wildcard for some specific type.
|
48
|
+
#
|
49
|
+
# @return [Boolean] true if this token has a specific type, but
|
50
|
+
# represents any/all resources of that type
|
51
|
+
def all_of_type?
|
52
|
+
type != Resource::ALL && id == Resource::ALL
|
53
|
+
end
|
54
|
+
|
40
55
|
# @return [Token] self; for convenience of taking a Resource or token
|
41
56
|
def token
|
42
57
|
self
|
data/lib/checkpoint/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: checkpoint
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Noah Botimer
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2019-05-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: ettin
|
@@ -44,14 +44,14 @@ dependencies:
|
|
44
44
|
requirements:
|
45
45
|
- - "~>"
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version: '
|
47
|
+
version: '2.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: '
|
54
|
+
version: '2.0'
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: coveralls
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
@@ -277,8 +277,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
277
277
|
- !ruby/object:Gem::Version
|
278
278
|
version: '0'
|
279
279
|
requirements: []
|
280
|
-
|
281
|
-
rubygems_version: 2.7.3
|
280
|
+
rubygems_version: 3.0.3
|
282
281
|
signing_key:
|
283
282
|
specification_version: 4
|
284
283
|
summary: Checkpoint provides a model and infrastructure for policy-based authorization,
|