oso-oso 0.8.2 → 0.9.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 8d51e82a017eaa54ea9a33b9199461015e3eac36
4
- data.tar.gz: 6903b31bf79562138d28d96c1c33d51270f65ba5
3
+ metadata.gz: c567d76126dbe08f29eb4f7c3bec635a17224718
4
+ data.tar.gz: a9632184c981bcd2501d21da0dbe8850c6b53446
5
5
  SHA512:
6
- metadata.gz: 91cc12a5af5fc9b16492681e398b8d09d341ac4dd4af34ca0b216c774248024723844937b1c106e7aceba03dc574b6377530cb74f2e591c86cab62ae836538df
7
- data.tar.gz: 1cd76a3ba326f3e505e956f22f41ae1a572bc995e990be19e294dae803bd0683f01b7d3589ca4a44923848deb150ccb401ee77bfaf99faacc6e9b032a61b0fe7
6
+ metadata.gz: 12d72946b6e4af9d109757b6fcc0f983e2bf2f53df5dbd6f02d13ec4e0ff46c3a42adceaec2cc5c8433481dc48d5742290ce7ea469bcad55120f70feb21a7460
7
+ data.tar.gz: a0914390d8667609a6d908c50212899111cc2324f9283383d9e17e6863cafa31bf6752ca4b975760e8c3c20714d3bed6defc4df26e95b05765336e00d8c99688
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- oso-oso (0.8.2)
4
+ oso-oso (0.9.0)
5
5
  ffi (~> 1.0)
6
6
 
7
7
  GEM
Binary file
Binary file
data/lib/oso.rb CHANGED
@@ -1,8 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'oso/http'
4
3
  require 'oso/oso'
5
- require 'oso/path_mapper'
6
4
  require 'oso/polar'
7
5
  require 'oso/version'
8
6
 
@@ -7,8 +7,6 @@ module Oso
7
7
  class Oso < Polar::Polar
8
8
  def initialize
9
9
  super
10
- register_class(Http, name: 'Http')
11
- register_class(PathMapper, name: 'PathMapper')
12
10
  end
13
11
 
14
12
  # Query the knowledge base to determine whether an actor is allowed to
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Oso
4
- VERSION = '0.8.2'
4
+ VERSION = '0.9.0'
5
5
  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.8.2
4
+ version: 0.9.0
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: 2020-11-25 00:00:00.000000000 Z
11
+ date: 2020-12-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: ffi
@@ -130,9 +130,7 @@ files:
130
130
  - ext/oso-oso/lib/libpolar.so
131
131
  - ext/oso-oso/lib/polar.dll
132
132
  - lib/oso.rb
133
- - lib/oso/http.rb
134
133
  - lib/oso/oso.rb
135
- - lib/oso/path_mapper.rb
136
134
  - lib/oso/polar.rb
137
135
  - lib/oso/polar/errors.rb
138
136
  - lib/oso/polar/ffi.rb
@@ -1,16 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Oso
4
- # An HTTP resource.
5
- class Http
6
- def initialize(hostname, path, query)
7
- @hostname = hostname
8
- @path = path
9
- @query = query
10
- end
11
-
12
- private
13
-
14
- attr_reader :hostname, :path, :query
15
- end
16
- end
@@ -1,29 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Oso
4
- # Map from a template string with capture groups of the form
5
- # `{name}` to a dictionary of the form `{name: captured_value}`
6
- class PathMapper
7
- def initialize(template)
8
- capture_group = /({([^}]+)})/
9
-
10
- template = template.dup
11
- template.scan(capture_group).each do |outer, inner|
12
- template = if inner == '*'
13
- template.gsub! outer, '.*'
14
- else
15
- template.gsub! outer, "(?<#{inner}>[^/]+)"
16
- end
17
- end
18
- @pattern = /\A#{template}\Z/
19
- end
20
-
21
- def map(string)
22
- string.match(pattern)&.named_captures || {}
23
- end
24
-
25
- private
26
-
27
- attr_reader :pattern
28
- end
29
- end