graphql_authorizer 1.0.3 → 1.0.4
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/Gemfile.lock +1 -1
- data/lib/errors/configuration.rb +1 -1
- data/lib/graphql_authorizer/configuration.rb +3 -1
- data/lib/graphql_authorizer/request.rb +12 -0
- data/lib/graphql_authorizer/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f8bb17b10a19de442ec39c96ae049990c321ca100ed1312ba0dcb64cef140d34
|
4
|
+
data.tar.gz: 388282560932d873fb7b0936cd26c67948fa8516c30a5f13103168348d4dbeeb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ad191a8caede355a94da2f5fd4259e01a166a300a998a0d826d011147532d98a6ba57f43092a527c24b1b967d95d108189e2921fe8c24022b783682f79ee8712
|
7
|
+
data.tar.gz: 20f9d5aac17a44254a6c886ddf755c1efd85f50246c953df0668a94873fadfad198739b75a238e4cbd20235ebbdab4f6ad80a39ed352cab9751b587b4794df23
|
data/Gemfile.lock
CHANGED
data/lib/errors/configuration.rb
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
require "errors/configuration"
|
2
|
+
|
1
3
|
module GraphQLAuthorizer
|
2
4
|
# Configuration Class
|
3
5
|
class Configuration
|
@@ -8,7 +10,7 @@ module GraphQLAuthorizer
|
|
8
10
|
end
|
9
11
|
|
10
12
|
def access_key
|
11
|
-
raise Errors::Configuration, "access key missing!" unless @access_key
|
13
|
+
raise GraphQLAuthorizer::Errors::Configuration, "access key missing!" unless @access_key
|
12
14
|
@access_key
|
13
15
|
end
|
14
16
|
end
|
@@ -1,4 +1,5 @@
|
|
1
1
|
require "active_support/core_ext/array/conversions"
|
2
|
+
require "errors/configuration"
|
2
3
|
require_relative "validator/signature"
|
3
4
|
require_relative "validator/timestamp"
|
4
5
|
|
@@ -13,6 +14,8 @@ module GraphQLAuthorizer
|
|
13
14
|
@sig = sig
|
14
15
|
@timestamp = timestamp
|
15
16
|
@errors = []
|
17
|
+
config = GraphQLAuthorizer.configuration
|
18
|
+
raise_missing_configuration unless config
|
16
19
|
end
|
17
20
|
|
18
21
|
def valid?
|
@@ -32,5 +35,14 @@ module GraphQLAuthorizer
|
|
32
35
|
def invalid_timestamp
|
33
36
|
"Invalid Timestamp!"
|
34
37
|
end
|
38
|
+
|
39
|
+
def raise_missing_configuration
|
40
|
+
raise GraphQLAuthorizer::Errors::Configuration,
|
41
|
+
"Missing Configuration block in initializers #{readme_link}"
|
42
|
+
end
|
43
|
+
|
44
|
+
def readme_link
|
45
|
+
"https://bitbucket.org/gorated/graphql-authorizer/src/development/README.md"
|
46
|
+
end
|
35
47
|
end
|
36
48
|
end
|