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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e8ccd9cc9442b770961d526d815e0463550b487e983242857bb5ee01eee27a38
4
- data.tar.gz: ee31ef763a57554ef9b4b26557320d55d39a78ce363c823f1b7ee95e8a155404
3
+ metadata.gz: f8bb17b10a19de442ec39c96ae049990c321ca100ed1312ba0dcb64cef140d34
4
+ data.tar.gz: 388282560932d873fb7b0936cd26c67948fa8516c30a5f13103168348d4dbeeb
5
5
  SHA512:
6
- metadata.gz: dff8266f4a78793f1c1650307f6258be4670d678686920a7caa466a543034b59b3be93b3c3c7dd119ad0589a024ec1e81e1bc7ef1005adf0b300ceeeaa7b6b75
7
- data.tar.gz: 0e39c55cc3bd1ae808abaa77bb9a7580b4345866542414f0b2292b1911380b08a7b78d6b24dd7d5603162e0f3c9b80f9b1d799f73c0d691ae421fb92b6ed4d4c
6
+ metadata.gz: ad191a8caede355a94da2f5fd4259e01a166a300a998a0d826d011147532d98a6ba57f43092a527c24b1b967d95d108189e2921fe8c24022b783682f79ee8712
7
+ data.tar.gz: 20f9d5aac17a44254a6c886ddf755c1efd85f50246c953df0668a94873fadfad198739b75a238e4cbd20235ebbdab4f6ad80a39ed352cab9751b587b4794df23
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- graphql_authorizer (1.0.2)
4
+ graphql_authorizer (1.0.3)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
@@ -1,4 +1,4 @@
1
- module GraphQAuthorizer
1
+ module GraphQLAuthorizer
2
2
  module Errors
3
3
  class Configuration < StandardError; end
4
4
  end
@@ -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
@@ -1,3 +1,3 @@
1
1
  module GraphQLAuthorizer
2
- VERSION = "1.0.3".freeze
2
+ VERSION = "1.0.4".freeze
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: graphql_authorizer
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.3
4
+ version: 1.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Peter John Alvarado