auth_origin_control 0.0.3 → 0.0.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- ZDJmMWQ5Y2E1YTllODI4ZDM0MTJlMjAyMDJhMDUzZmZiOGJkYzYyZQ==
4
+ YjdkMzYxZmNkM2Y5MTViOGI3ZTE2YTBiNTkzNjhjNDgyZTY2YjY3NA==
5
5
  data.tar.gz: !binary |-
6
- NzQ5OGQyNjFjMmE0NWY3YjhiOGJlNzI3ZDFhZTFhM2FlMzgwMjJmYw==
6
+ OWI3N2QxYmE2NmJiZjhmMTEwZTQ5MGE2MWI0MDJhMTdjYmIyNGFmMA==
7
7
  !binary "U0hBNTEy":
8
8
  metadata.gz: !binary |-
9
- NGJlM2M3NWMxMGNmYTdlNjYxMDQ1YzE5MmZmMTAxMDU4OWFiMzY2NzYxY2U0
10
- OTc4NGU4MWJkN2FkYjNhY2JjOTE1NjcxZjk0NTM3ZTM1ZWM4ZTA3MzYxNWVl
11
- MWQ3ZWNiNzQ0ZDg1Y2MxZGNiNGFlZWIxY2RkNzBiZGNmYzljYTQ=
9
+ Y2JhM2ExNmY0ODQ0MGVlZTAyNTI3NTk4ZTg3MDY0ZDFiNTcxNzg2ODE2ZDk0
10
+ NGJjOGZjMTVlYzIxZDRlNDQyYmFiNWNjNWRkMGEyODMzYzYxNWQ1ZjMxYzIx
11
+ ZGI1YTY1YzUzMGVjZjhmNmExODMxZWE1YmUzNTVmMzQ0ZDgyMDI=
12
12
  data.tar.gz: !binary |-
13
- ODU0Y2U1NjhjNzVmMjU5M2IwNWI1YjIzNjU1ZDE1MjkzMDkyODFjZmUxYTBm
14
- NjA3N2FhODJjY2MyZTE2MjlmMDZhNmJlODdhMzhlMmViNGMyNWRmYmMxNDE1
15
- ZTYyODBjOWRkMmQ5YTA0OTg3YTJmYjNjNjUxOWY5ZmU4OGVkZTk=
13
+ YjZlNWI5ODk1MzU2ZDUzZmY4ZTAzODBhZTU0MjQ4MmQ0YjRhMDYzOTNjMTY2
14
+ YTQxY2E0YWRjODdhNTIyYTlhN2MzYzI1MjI0Yzc0YWUzOWI5ZjczZmRlOTk3
15
+ ZDEwMTM5NWQ5NGQ2NThhZjM2ZTdmZjE1Y2RkZTIzZmIyZGZhYzg=
@@ -18,11 +18,14 @@ module AuthOriginControl
18
18
  end
19
19
 
20
20
  def secret_key access_id = @app.access_id
21
- _secret_from_authority = secret_key_from_authority
22
- _secret_from_authority.try(:[],'error') ? _secret_from_authority : _secret_from_authority.try(:gsub, /\\n/,"\n")
21
+ if AuthOriginControl.no_connection
22
+ AuthOriginControl.registered_apps[access_id]
23
+ else
24
+ _secret_from_authority = secret_key_from_authority
25
+ _secret_from_authority.try(:[],'error') ? _secret_from_authority : _secret_from_authority.try(:gsub, /\\n/,"\n")
26
+ end
23
27
  end
24
-
25
-
28
+
26
29
  private
27
30
 
28
31
  def secret_key_from_authority
@@ -1,3 +1,3 @@
1
1
  module AuthOriginControl
2
- VERSION = "0.0.3"
2
+ VERSION = "0.0.4"
3
3
  end
@@ -46,6 +46,9 @@ module AuthOriginControl
46
46
  def self.path
47
47
  @@path ||= '/'
48
48
  end
49
+
50
+ # allow working offline without looking for online auth api
51
+ mattr_accessor :no_connection, :registered_apps
49
52
 
50
53
  def self.setup
51
54
  yield self
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: auth_origin_control
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - NicoArbogast