action_policy-graphql 0.5.3 → 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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: bd65d3395a5a17016bbf6437bdcc300c1c515d3a6ec72aa4a9f499c0f642fbce
4
- data.tar.gz: 3fde00df90ed713411873303ddf920937c9bcc92d7db37f765eecfc7e03a408c
3
+ metadata.gz: a7642906ab346f7d8dbc1df8a74fb9c3357fc385920fc02cc2c0fcbf49b1ba94
4
+ data.tar.gz: 899162aa41e240bf9f5e09203faa4a53f4103a45a38cceba164b95e28cfb8f87
5
5
  SHA512:
6
- metadata.gz: 7474adcbe2a40bb7ac9f30ac3068987ac419c56e394dafd1440d6ad1f4457f7a07aa5c5ef8ec07e8fee348bd8e464a753fd4306070a00af500af0e53755925dc
7
- data.tar.gz: 04aaf4d7dacd8ad07324dc913e45b04a43f515e79ca6de7d530436d357b559bdd52632ae9231a799b9255139d574e744e2a3c1c453e3838213a33d409efea5be
6
+ metadata.gz: 167d81b9844a337b023df20ccdad4a26272f04438449ada1b881e2bf162f3060fff04c80d512c75302b5fcc16a1ebbb8644eccac79d8e2119dde34b01a40dd64
7
+ data.tar.gz: b6c3ec027f5b686454a8d3fd7a20c546381c20b2d8ef59bc8a01f484ad0a42c481baf6db565b87c5596730c730f2cb8541547bf381a70584c9003c1a43a2d476
data/CHANGELOG.md CHANGED
@@ -2,6 +2,16 @@
2
2
 
3
3
  ## master (unreleased)
4
4
 
5
+ ## 0.6.0 (2024-07-08)
6
+
7
+ - Fix compatibility with Action Policy 0.7.0. ([@palkan][])
8
+
9
+ ## 0.5.4 (2023-12-22)
10
+
11
+ - Do not mutate passed field options. ([@palkan][])
12
+
13
+ Fixes compatibility with `with_options` approach.
14
+
5
15
  ## 0.5.3 (2021-02-26)
6
16
 
7
17
  - Fix compatibility with graphql-ruby 1.12.4 ([@haines][])
@@ -80,3 +90,4 @@ Action Policy helpers there.
80
90
  [@haines]: https://github.com/haines
81
91
  [@sponomarev]: https://github.com/sponomarev
82
92
  [@bibendi]: https://github.com/bibendi
93
+ [@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
@@ -109,7 +113,7 @@ module ActionPolicy
109
113
  private
110
114
 
111
115
  def underscored_field_name
112
- "#{field.instance_variable_get(:@underscored_name)}?".to_sym
116
+ :"#{field.instance_variable_get(:@underscored_name)}?"
113
117
  end
114
118
  end
115
119
 
@@ -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
@@ -17,7 +17,7 @@ module ActionPolicy
17
17
  base.extend ActionPolicy::Behaviours::Namespaced
18
18
 
19
19
  # Authorization context could't be defined for the class
20
- def base.authorization_context
20
+ def base.build_authorization_context
21
21
  {}
22
22
  end
23
23
 
@@ -2,6 +2,6 @@
2
2
 
3
3
  module ActionPolicy
4
4
  module GraphQL
5
- VERSION = "0.5.3"
5
+ VERSION = "0.6.0"
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,43 +1,43 @@
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.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Vladimir Dementyev
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-02-26 00:00:00.000000000 Z
11
+ date: 2024-07-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: action_policy
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - ">="
17
+ - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: 0.5.0
19
+ version: '0.7'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - ">="
24
+ - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: 0.5.0
26
+ version: '0.7'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: ruby-next-core
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - ">="
31
+ - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: 0.10.0
33
+ version: '1.0'
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - ">="
38
+ - - "~>"
39
39
  - !ruby/object:Gem::Version
40
- version: 0.10.0
40
+ version: '1.0'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: graphql
43
43
  requirement: !ruby/object:Gem::Requirement
@@ -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
@@ -150,7 +150,7 @@ 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
153
+ rubygems_version: 3.4.19
154
154
  signing_key:
155
155
  specification_version: 4
156
156
  summary: Action Policy integration for GraphQL-Ruby