action_policy-graphql 0.5.3 → 0.5.4

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
2
  SHA256:
3
- metadata.gz: bd65d3395a5a17016bbf6437bdcc300c1c515d3a6ec72aa4a9f499c0f642fbce
4
- data.tar.gz: 3fde00df90ed713411873303ddf920937c9bcc92d7db37f765eecfc7e03a408c
3
+ metadata.gz: cbcbb5943f46f12ea7f7941986a35c6bccb7cdbb4dabc412bad172cad69fc2fa
4
+ data.tar.gz: 3080d536b2fd332526ef247097374eac0254a1a7ff15c9fea1ae90d622a2e2d4
5
5
  SHA512:
6
- metadata.gz: 7474adcbe2a40bb7ac9f30ac3068987ac419c56e394dafd1440d6ad1f4457f7a07aa5c5ef8ec07e8fee348bd8e464a753fd4306070a00af500af0e53755925dc
7
- data.tar.gz: 04aaf4d7dacd8ad07324dc913e45b04a43f515e79ca6de7d530436d357b559bdd52632ae9231a799b9255139d574e744e2a3c1c453e3838213a33d409efea5be
6
+ metadata.gz: 1cbb934cd6b7cd5699149281484b3642af7be899a362712614018a146bc951db298a8c8d5ea278d3312d92f614ca4c10d1b376d0d351ea24f654a9b465d59a03
7
+ data.tar.gz: eafccbc78d510fe23397fb7f166bdbf5b51275b22ff75b40f0c70d9f5910d050b16b0382ebab0ec3f16db22ebc4ce4d171defc336e38710101856ed736a33e88
data/CHANGELOG.md CHANGED
@@ -2,6 +2,12 @@
2
2
 
3
3
  ## master (unreleased)
4
4
 
5
+ ## 0.5.4 (2023-12-22)
6
+
7
+ - Do not mutate passed field options. ([@palkan][])
8
+
9
+ Fixes compatibility with `with_options` approach.
10
+
5
11
  ## 0.5.3 (2021-02-26)
6
12
 
7
13
  - Fix compatibility with graphql-ruby 1.12.4 ([@haines][])
@@ -80,3 +86,4 @@ Action Policy helpers there.
80
86
  [@haines]: https://github.com/haines
81
87
  [@sponomarev]: https://github.com/sponomarev
82
88
  [@bibendi]: https://github.com/bibendi
89
+ [@rzaharenkov]: https://github.com/rzaharenkov
data/README.md CHANGED
@@ -5,6 +5,9 @@
5
5
 
6
6
  # Action Policy GraphQL
7
7
 
8
+ <img align="right" height="150" width="129"
9
+ title="Action Policy logo" src="./assets/logo.svg">
10
+
8
11
  This gem provides an integration for using [Action Policy](https://github.com/palkan/action_policy) as an authorization framework for GraphQL applications (built with [`graphql` ruby gem](https://graphql-ruby.org)).
9
12
 
10
13
  This integration includes the following features:
@@ -14,6 +14,10 @@ module ActionPolicy
14
14
  # end
15
15
  module AuthorizedField
16
16
  class Extension < ::GraphQL::Schema::FieldExtension
17
+ def initialize(field:, options:)
18
+ super(field: field, options: options&.dup || {})
19
+ end
20
+
17
21
  def extract_option(key, &default)
18
22
  value = options.fetch(key, &default)
19
23
  options.delete key
@@ -128,7 +132,7 @@ module ActionPolicy
128
132
  "options could be specified. You can use `preauthorize` or `authorize_field` along with scoping"
129
133
  end
130
134
 
131
- if !!authorize == !!preauthorize ? authorize : authorize_field
135
+ if (!!authorize == !!preauthorize) ? authorize : authorize_field
132
136
  raise ArgumentError, "Only one of `authorize`, `preauthorize` or `authorize_field` " \
133
137
  "options could be specified."
134
138
  end
@@ -2,6 +2,6 @@
2
2
 
3
3
  module ActionPolicy
4
4
  module GraphQL
5
- VERSION = "0.5.3"
5
+ VERSION = "0.5.4"
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: action_policy-graphql
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.3
4
+ version: 0.5.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Vladimir Dementyev
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-02-26 00:00:00.000000000 Z
11
+ date: 2023-12-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: action_policy
@@ -70,28 +70,28 @@ dependencies:
70
70
  name: rake
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
- - - "~>"
73
+ - - ">="
74
74
  - !ruby/object:Gem::Version
75
75
  version: '13.0'
76
76
  type: :development
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
- - - "~>"
80
+ - - ">="
81
81
  - !ruby/object:Gem::Version
82
82
  version: '13.0'
83
83
  - !ruby/object:Gem::Dependency
84
84
  name: rspec
85
85
  requirement: !ruby/object:Gem::Requirement
86
86
  requirements:
87
- - - "~>"
87
+ - - ">="
88
88
  - !ruby/object:Gem::Version
89
89
  version: '3.8'
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
96
  version: '3.8'
97
97
  - !ruby/object:Gem::Dependency
@@ -135,7 +135,7 @@ metadata:
135
135
  documentation_uri: https://actionpolicy.evilmartians.io/#/graphql
136
136
  homepage_uri: https://github.com/palkan/action_policy-graphql
137
137
  source_code_uri: https://github.com/palkan/action_policy-graphql
138
- post_install_message:
138
+ post_install_message:
139
139
  rdoc_options: []
140
140
  require_paths:
141
141
  - lib
@@ -150,8 +150,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
150
150
  - !ruby/object:Gem::Version
151
151
  version: '0'
152
152
  requirements: []
153
- rubygems_version: 3.0.6
154
- signing_key:
153
+ rubygems_version: 3.4.20
154
+ signing_key:
155
155
  specification_version: 4
156
156
  summary: Action Policy integration for GraphQL-Ruby
157
157
  test_files: []