oso-oso 0.26.4 → 0.27.3

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: 4311981abc4251866255686e5a71fe94cb4975de
4
- data.tar.gz: 8406c83551e576295aa198a1cdb5d5bf2416146f
2
+ SHA256:
3
+ metadata.gz: f7d992230292bf72430961dbad9bae7ad4aeeae196ce1aacd7129258c584d9b2
4
+ data.tar.gz: 4df54cb43fed5053cd8cab3fa08348edfbd7647677312473490ff77626afb858
5
5
  SHA512:
6
- metadata.gz: f3603bb5c44a27af07a22224b0e052cd4baa5a15ba3c0d2e00bdde2504c1c3c02d8aadf49b70a6bafd1765dce71ce5b3e5ca1a0376654bd38357e70b59f8a2fc
7
- data.tar.gz: efd8e2c709f694eb6ae0824bccf61db8ea719623f036913704e22443b9956316f1c9da72f9f058d363ff864fabe335c6f06e507e1a2acd82e3a7a72eb0cd9cde
6
+ metadata.gz: ee6e3a81baa5069ce4ab9aabbe1bd07c1b18905818af6c197c2733e828d7888dd0fdb48f93f7b3561e7039c987cae813bfc467bbde2a566e0bb392aa381051a1
7
+ data.tar.gz: ed3a2432dfeb6ac046127e789d7b7c56481e7a6cee58c42816c8a386e83b3f07124286b58f41c0aca8223bb0ada08501d18de108bc3e1c2d82df012601498d9f
data/.gitignore CHANGED
@@ -11,3 +11,4 @@ vendor
11
11
 
12
12
  # rspec failure tracking
13
13
  .rspec_status
14
+ ext
data/.rubocop.yml CHANGED
@@ -1,10 +1,50 @@
1
1
  AllCops:
2
- TargetRubyVersion: 2.4
2
+ TargetRubyVersion: 2.6
3
3
  Exclude:
4
4
  - "**/*~"
5
5
  - "bin/oso"
6
6
  - "vendor/**/*"
7
7
  NewCops: enable
8
+ SuggestExtensions: false
9
+
8
10
  Naming/FileName:
9
11
  Exclude:
10
12
  - "lib/oso-oso.rb"
13
+
14
+ Layout/EmptyLineBetweenDefs:
15
+ Enabled: false
16
+ Layout/LineContinuationSpacing:
17
+ Enabled: false
18
+
19
+ Gemspec/RequireMFA:
20
+ Enabled: false
21
+ Gemspec/DevelopmentDependencies:
22
+ Enabled: false
23
+
24
+ Lint/ConstantDefinitionInBlock:
25
+ Enabled: false
26
+ Lint/SymbolConversion:
27
+ Enabled: false
28
+ Lint/NonAtomicFileOperation:
29
+ Enabled: false
30
+ Lint/EmptyBlock:
31
+ Enabled: false
32
+ Lint/AmbiguousOperatorPrecedence:
33
+ Enabled: false
34
+
35
+ Style/FetchEnvVar:
36
+ Enabled: false
37
+ Style/RedundantCurrentDirectoryInPath:
38
+ Enabled: false
39
+ Style/QuotedSymbols:
40
+ Enabled: false
41
+ Style/RedundantConstantBase:
42
+ Enabled: false
43
+ Style/RedundantInitialize:
44
+ Enabled: false
45
+ Style/CommentAnnotation:
46
+ Enabled: false
47
+ Style/FileRead:
48
+ Enabled: false
49
+ Style/HashConversion:
50
+ Enabled: false
data/.ruby-version ADDED
@@ -0,0 +1 @@
1
+ 3.2.2
data/Gemfile.lock CHANGED
@@ -1,104 +1,135 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- oso-oso (0.26.4)
4
+ oso-oso (0.27.3)
5
5
  ffi (~> 1.0)
6
6
 
7
7
  GEM
8
8
  remote: https://rubygems.org/
9
9
  specs:
10
- activemodel (5.2.6)
11
- activesupport (= 5.2.6)
12
- activerecord (5.2.6)
13
- activemodel (= 5.2.6)
14
- activesupport (= 5.2.6)
15
- arel (>= 9.0)
16
- activesupport (5.2.6)
10
+ activemodel (7.1.2)
11
+ activesupport (= 7.1.2)
12
+ activerecord (7.1.2)
13
+ activemodel (= 7.1.2)
14
+ activesupport (= 7.1.2)
15
+ timeout (>= 0.4.0)
16
+ activesupport (7.1.2)
17
+ base64
18
+ bigdecimal
17
19
  concurrent-ruby (~> 1.0, >= 1.0.2)
18
- i18n (>= 0.7, < 2)
19
- minitest (~> 5.1)
20
- tzinfo (~> 1.1)
21
- arel (9.0.0)
20
+ connection_pool (>= 2.2.5)
21
+ drb
22
+ i18n (>= 1.6, < 2)
23
+ minitest (>= 5.1)
24
+ mutex_m
25
+ tzinfo (~> 2.0)
22
26
  ast (2.4.2)
23
27
  backport (1.2.0)
24
- benchmark (0.2.0)
28
+ base64 (0.2.0)
29
+ benchmark (0.3.0)
30
+ bigdecimal (3.1.4)
25
31
  byebug (11.1.3)
26
32
  coderay (1.1.3)
27
- concurrent-ruby (1.1.9)
28
- diff-lcs (1.4.4)
33
+ concurrent-ruby (1.2.2)
34
+ connection_pool (2.4.1)
35
+ diff-lcs (1.5.0)
36
+ drb (2.2.0)
37
+ ruby2_keywords
29
38
  e2mmap (0.1.0)
30
- ffi (1.15.4)
31
- i18n (1.8.11)
39
+ ffi (1.16.3)
40
+ i18n (1.14.1)
32
41
  concurrent-ruby (~> 1.0)
33
- jaro_winkler (1.5.4)
34
- maruku (0.7.3)
42
+ jaro_winkler (1.5.6)
43
+ json (2.7.1)
44
+ kramdown (2.4.0)
45
+ rexml
46
+ kramdown-parser-gfm (1.1.0)
47
+ kramdown (~> 2.0)
48
+ language_server-protocol (3.17.0.3)
35
49
  method_source (1.0.0)
36
- mini_portile2 (2.4.0)
37
- minitest (5.14.4)
38
- nokogiri (1.10.10)
39
- mini_portile2 (~> 2.4.0)
40
- parallel (1.20.1)
41
- parser (2.7.2.0)
50
+ mini_portile2 (2.8.5)
51
+ minitest (5.20.0)
52
+ mutex_m (0.2.0)
53
+ nokogiri (1.15.5)
54
+ mini_portile2 (~> 2.8.2)
55
+ racc (~> 1.4)
56
+ nokogiri (1.15.5-x86_64-darwin)
57
+ racc (~> 1.4)
58
+ nokogiri (1.15.5-x86_64-linux)
59
+ racc (~> 1.4)
60
+ parallel (1.23.0)
61
+ parser (3.2.2.4)
42
62
  ast (~> 2.4.1)
43
- pry (0.13.1)
63
+ racc
64
+ pry (0.14.2)
44
65
  coderay (~> 1.1)
45
66
  method_source (~> 1.0)
46
- pry-byebug (3.9.0)
67
+ pry-byebug (3.10.1)
47
68
  byebug (~> 11.0)
48
- pry (~> 0.13.0)
49
- rainbow (3.0.0)
69
+ pry (>= 0.13, < 0.15)
70
+ racc (1.7.3)
71
+ rainbow (3.1.1)
50
72
  rake (12.3.3)
51
- regexp_parser (2.1.1)
73
+ rbs (2.8.4)
74
+ regexp_parser (2.8.3)
52
75
  reverse_markdown (2.1.1)
53
76
  nokogiri
54
- rexml (3.2.5)
55
- rspec (3.10.0)
56
- rspec-core (~> 3.10.0)
57
- rspec-expectations (~> 3.10.0)
58
- rspec-mocks (~> 3.10.0)
59
- rspec-core (3.10.1)
60
- rspec-support (~> 3.10.0)
61
- rspec-expectations (3.10.1)
77
+ rexml (3.2.6)
78
+ rspec (3.12.0)
79
+ rspec-core (~> 3.12.0)
80
+ rspec-expectations (~> 3.12.0)
81
+ rspec-mocks (~> 3.12.0)
82
+ rspec-core (3.12.2)
83
+ rspec-support (~> 3.12.0)
84
+ rspec-expectations (3.12.3)
62
85
  diff-lcs (>= 1.2.0, < 2.0)
63
- rspec-support (~> 3.10.0)
64
- rspec-mocks (3.10.2)
86
+ rspec-support (~> 3.12.0)
87
+ rspec-mocks (3.12.6)
65
88
  diff-lcs (>= 1.2.0, < 2.0)
66
- rspec-support (~> 3.10.0)
67
- rspec-support (3.10.3)
68
- rubocop (0.89.1)
89
+ rspec-support (~> 3.12.0)
90
+ rspec-support (3.12.1)
91
+ rubocop (1.58.0)
92
+ json (~> 2.3)
93
+ language_server-protocol (>= 3.17.0)
69
94
  parallel (~> 1.10)
70
- parser (>= 2.7.1.1)
95
+ parser (>= 3.2.2.4)
71
96
  rainbow (>= 2.2.2, < 4.0)
72
- regexp_parser (>= 1.7)
73
- rexml
74
- rubocop-ast (>= 0.3.0, < 1.0)
97
+ regexp_parser (>= 1.8, < 3.0)
98
+ rexml (>= 3.2.5, < 4.0)
99
+ rubocop-ast (>= 1.30.0, < 2.0)
75
100
  ruby-progressbar (~> 1.7)
76
- unicode-display_width (>= 1.4.0, < 2.0)
77
- rubocop-ast (0.8.0)
78
- parser (>= 2.7.1.5)
79
- ruby-progressbar (1.11.0)
80
- solargraph (0.39.17)
81
- backport (~> 1.1)
101
+ unicode-display_width (>= 2.4.0, < 3.0)
102
+ rubocop-ast (1.30.0)
103
+ parser (>= 3.2.1.0)
104
+ ruby-progressbar (1.13.0)
105
+ ruby2_keywords (0.0.5)
106
+ solargraph (0.49.0)
107
+ backport (~> 1.2)
82
108
  benchmark
83
- bundler (>= 1.17.2)
109
+ bundler (~> 2.0)
110
+ diff-lcs (~> 1.4)
84
111
  e2mmap
85
112
  jaro_winkler (~> 1.5)
86
- maruku (~> 0.7, >= 0.7.3)
87
- nokogiri (~> 1.9, >= 1.9.1)
88
- parser (~> 2.3)
89
- reverse_markdown (>= 1.0.5, < 3)
90
- rubocop (~> 0.52)
113
+ kramdown (~> 2.3)
114
+ kramdown-parser-gfm (~> 1.1)
115
+ parser (~> 3.0)
116
+ rbs (~> 2.0)
117
+ reverse_markdown (~> 2.0)
118
+ rubocop (~> 1.38)
91
119
  thor (~> 1.0)
92
120
  tilt (~> 2.0)
93
121
  yard (~> 0.9, >= 0.9.24)
94
- sqlite3 (1.4.2)
95
- thor (1.1.0)
96
- thread_safe (0.3.6)
97
- tilt (2.0.10)
98
- tzinfo (1.2.9)
99
- thread_safe (~> 0.1)
100
- unicode-display_width (1.8.0)
101
- yard (0.9.26)
122
+ sqlite3 (1.6.9)
123
+ mini_portile2 (~> 2.8.0)
124
+ sqlite3 (1.6.9-x86_64-darwin)
125
+ sqlite3 (1.6.9-x86_64-linux)
126
+ thor (1.3.0)
127
+ tilt (2.3.0)
128
+ timeout (0.4.1)
129
+ tzinfo (2.0.6)
130
+ concurrent-ruby (~> 1.0)
131
+ unicode-display_width (2.5.0)
132
+ yard (0.9.34)
102
133
 
103
134
  PLATFORMS
104
135
  ruby
@@ -108,13 +139,13 @@ PLATFORMS
108
139
  DEPENDENCIES
109
140
  activerecord
110
141
  oso-oso!
111
- pry-byebug (~> 3.9.0)
142
+ pry-byebug (~> 3.10.1)
112
143
  rake (~> 12.0)
113
144
  rspec (~> 3.0)
114
- rubocop (~> 0.89.1)
115
- solargraph (~> 0.39.14)
145
+ rubocop (~> 1.58.0)
146
+ solargraph (~> 0.49.0)
116
147
  sqlite3
117
148
  yard (~> 0.9.25)
118
149
 
119
150
  BUNDLED WITH
120
- 2.2.4
151
+ 2.4.22
data/Makefile CHANGED
@@ -1,12 +1,28 @@
1
- .PHONY: rust install test lint typecheck repl
1
+ .PHONY: rust copy_lib install test lint typecheck repl
2
+
3
+ UNAME_S := $(shell uname -s)
4
+ UNAME_M := $(shell uname -m)
2
5
 
3
6
  rust:
4
7
  $(MAKE) -C ../.. rust-build
5
8
 
9
+ copy_lib:
10
+ mkdir -p ext/oso-oso/lib/
11
+ ifeq ($(UNAME_S),Linux)
12
+ ifeq ($(UNAME_M),x86_64)
13
+ cp ../../target/debug/libpolar.so ext/oso-oso/lib/libpolar-x86_64.so
14
+ else
15
+ cp ../../target/debug/libpolar.so ext/oso-oso/lib/libpolar-aarch64.so
16
+ endif
17
+ endif
18
+ ifeq ($(UNAME_S),Darwin)
19
+ cp ../../target/debug/libpolar.dylib ext/oso-oso/lib/
20
+ endif
21
+
6
22
  install:
7
23
  bundle install
8
24
 
9
- test: install rust
25
+ test: install rust copy_lib
10
26
  POLAR_IGNORE_NO_ALLOW_WARNING=1 bundle exec rake spec
11
27
 
12
28
  lint: install
@@ -15,5 +31,5 @@ lint: install
15
31
  typecheck: install
16
32
  bundle exec solargraph typecheck
17
33
 
18
- repl: install rust
34
+ repl: install rust copy_lib
19
35
  bundle exec oso
Binary file
Binary file
Binary file
Binary file
data/lib/oso/polar/ffi.rb CHANGED
@@ -6,12 +6,17 @@ module Oso
6
6
  module Polar
7
7
  # FFI classes shared between all ffi/*.rb modules
8
8
  module FFI
9
- LIB = "#{::FFI::Platform::LIBPREFIX}polar.#{::FFI::Platform::LIBSUFFIX}"
10
- RELEASE_PATH = File.expand_path(File.join(__dir__, "../../../ext/oso-oso/lib/#{LIB}"))
11
- DEV_PATH = File.expand_path(File.join(__dir__, "../../../../../target/debug/#{LIB}"))
12
- # If the lib exists in the ext/ dir, use it. Otherwise, fall back to
13
- # checking the local Rust target dir.
14
- LIB_PATH = File.file?(RELEASE_PATH) ? RELEASE_PATH : DEV_PATH
9
+ LIB =
10
+ case ::FFI::Platform::OS
11
+ when /darwin/
12
+ 'libpolar.dylib'
13
+ when /windows|cygwin|msys/
14
+ 'polar.dll'
15
+ else
16
+ "libpolar-#{::FFI::Platform::ARCH}.so"
17
+ end
18
+
19
+ LIB_PATH = File.expand_path(File.join(__dir__, "../../../ext/oso-oso/lib/#{LIB}"))
15
20
 
16
21
  # Wrapper classes defined upfront to fix Ruby loading issues. Actual
17
22
  # implementations live in the sibling `ffi/` directory and are `require`d
@@ -153,14 +153,11 @@ module Oso
153
153
 
154
154
  # Query for a Polar predicate or string.
155
155
  #
156
- # @overload query(query)
157
- # @param query [String]
158
- # @return [Enumerator] of resulting bindings
159
- # @raise [Error] if the FFI call raises one.
160
- # @overload query(query)
161
- # @param query [Predicate]
162
- # @return [Enumerator] of resulting bindings
163
- # @raise [Error] if the FFI call raises one.
156
+ # @param query [String, Predicate]
157
+ # @param host [Host]
158
+ # @param bindings [Hash]
159
+ # @return [Enumerator] of resulting bindings
160
+ # @raise [Error] if the FFI call raises one.
164
161
  def query(query, host: self.host.dup, bindings: {})
165
162
  case query
166
163
  when String
data/lib/oso/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Oso
4
- VERSION = '0.26.4'
4
+ VERSION = '0.27.3'
5
5
  end
data/oso-oso.gemspec CHANGED
@@ -8,10 +8,15 @@ Gem::Specification.new do |spec|
8
8
  spec.authors = ['Oso Security, Inc.']
9
9
  spec.email = ['support@osohq.com']
10
10
  spec.licenses = ['Apache-2.0']
11
- spec.summary = 'Oso authorization library.'
11
+ spec.summary = 'We have deprecated the legacy Oso open source library. We have plans for the next open ' \
12
+ "source release and we're looking forward to getting feedback from the community leading up " \
13
+ 'to that point (please reach out to us in the Slack #help channel). In the meantime, if ' \
14
+ "you're happy using the Oso open source library now, nothing needs to change – i.e., we are " \
15
+ "not end-of-lifing (EOL) the library and we'll continue to provide support and critical bug " \
16
+ 'fixes. More context: [here](https://www.osohq.com/docs/oss/getting-started/deprecation.html).'
12
17
  spec.homepage = 'https://www.osohq.com/'
13
18
 
14
- spec.required_ruby_version = Gem::Requirement.new('>= 2.4.0')
19
+ spec.required_ruby_version = Gem::Requirement.new('>= 2.6.10')
15
20
 
16
21
  spec.metadata['homepage_uri'] = spec.homepage
17
22
  spec.metadata['source_code_uri'] = 'https://github.com/osohq/oso'
@@ -32,11 +37,11 @@ Gem::Specification.new do |spec|
32
37
 
33
38
  # Development dependencies
34
39
  spec.add_development_dependency 'activerecord'
35
- spec.add_development_dependency 'pry-byebug', '~> 3.9.0'
40
+ spec.add_development_dependency 'pry-byebug', '~> 3.10.1'
36
41
  spec.add_development_dependency 'rake', '~> 12.0'
37
42
  spec.add_development_dependency 'rspec', '~> 3.0'
38
- spec.add_development_dependency 'rubocop', '~> 0.89.1'
39
- spec.add_development_dependency 'solargraph', '~> 0.39.14'
43
+ spec.add_development_dependency 'rubocop', '~> 1.58.0'
44
+ spec.add_development_dependency 'solargraph', '~> 0.49.0'
40
45
  spec.add_development_dependency 'sqlite3'
41
46
  spec.add_development_dependency 'yard', '~> 0.9.25'
42
47
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: oso-oso
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.26.4
4
+ version: 0.27.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Oso Security, Inc.
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-12-05 00:00:00.000000000 Z
11
+ date: 2024-01-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: ffi
@@ -44,14 +44,14 @@ dependencies:
44
44
  requirements:
45
45
  - - "~>"
46
46
  - !ruby/object:Gem::Version
47
- version: 3.9.0
47
+ version: 3.10.1
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: 3.9.0
54
+ version: 3.10.1
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: rake
57
57
  requirement: !ruby/object:Gem::Requirement
@@ -86,28 +86,28 @@ dependencies:
86
86
  requirements:
87
87
  - - "~>"
88
88
  - !ruby/object:Gem::Version
89
- version: 0.89.1
89
+ version: 1.58.0
90
90
  type: :development
91
91
  prerelease: false
92
92
  version_requirements: !ruby/object:Gem::Requirement
93
93
  requirements:
94
94
  - - "~>"
95
95
  - !ruby/object:Gem::Version
96
- version: 0.89.1
96
+ version: 1.58.0
97
97
  - !ruby/object:Gem::Dependency
98
98
  name: solargraph
99
99
  requirement: !ruby/object:Gem::Requirement
100
100
  requirements:
101
101
  - - "~>"
102
102
  - !ruby/object:Gem::Version
103
- version: 0.39.14
103
+ version: 0.49.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.39.14
110
+ version: 0.49.0
111
111
  - !ruby/object:Gem::Dependency
112
112
  name: sqlite3
113
113
  requirement: !ruby/object:Gem::Requirement
@@ -147,6 +147,7 @@ files:
147
147
  - ".gitignore"
148
148
  - ".rspec"
149
149
  - ".rubocop.yml"
150
+ - ".ruby-version"
150
151
  - ".solargraph.yml"
151
152
  - Gemfile
152
153
  - Gemfile.lock
@@ -154,8 +155,9 @@ files:
154
155
  - README.md
155
156
  - Rakefile
156
157
  - bin/oso
158
+ - ext/oso-oso/lib/libpolar-aarch64.so
159
+ - ext/oso-oso/lib/libpolar-x86_64.so
157
160
  - ext/oso-oso/lib/libpolar.dylib
158
- - ext/oso-oso/lib/libpolar.so
159
161
  - ext/oso-oso/lib/polar.dll
160
162
  - lib/oso-oso.rb
161
163
  - lib/oso.rb
@@ -197,16 +199,20 @@ required_ruby_version: !ruby/object:Gem::Requirement
197
199
  requirements:
198
200
  - - ">="
199
201
  - !ruby/object:Gem::Version
200
- version: 2.4.0
202
+ version: 2.6.10
201
203
  required_rubygems_version: !ruby/object:Gem::Requirement
202
204
  requirements:
203
205
  - - ">="
204
206
  - !ruby/object:Gem::Version
205
207
  version: '0'
206
208
  requirements: []
207
- rubyforge_project:
208
- rubygems_version: 2.6.14.4
209
+ rubygems_version: 3.4.10
209
210
  signing_key:
210
211
  specification_version: 4
211
- summary: Oso authorization library.
212
+ summary: 'We have deprecated the legacy Oso open source library. We have plans for
213
+ the next open source release and we''re looking forward to getting feedback from
214
+ the community leading up to that point (please reach out to us in the Slack #help
215
+ channel). In the meantime, if you''re happy using the Oso open source library now,
216
+ nothing needs to change – i.e., we are not end-of-lifing (EOL) the library and we''ll
217
+ continue to provide support and critical bug fixes. More context: [here](https://www.osohq.com/docs/oss/getting-started/deprecation.html).'
212
218
  test_files: []
Binary file