au_pair 1.0.6 → 1.0.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/au_pair.gemspec +1 -1
- data/lib/au_pair.rb +6 -2
- data/lib/au_pair/authentication_token.rb +1 -0
- data/lib/au_pair/version.rb +1 -1
- data/spec/authentication_token_spec.rb +12 -0
- data/spec/configuration_spec.rb +5 -0
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8d788499eea88ae11eb57b5b5a7103b806a03ccd
|
4
|
+
data.tar.gz: 9d3c9d5d5563c27c7d316a0f5ac1c2ef3c598b24
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1b476e3b4bff35b30003c7014be362fb0090733ea1238bd9d7172d3449cb2a200bbd2d265436b3fcaf749a18082bedb8227b38f5079250e3fdd67b29d330ab12
|
7
|
+
data.tar.gz: b3d61c6cd4af2384e5e473ebba2c69aeb4bff9f17c94e80dff964cf2224f14581844f9f22866b671c02740c11c66c2186f051a02c1ea6ee25db2319f38941c56
|
data/au_pair.gemspec
CHANGED
@@ -6,7 +6,7 @@ require 'au_pair/version'
|
|
6
6
|
Gem::Specification.new do |spec|
|
7
7
|
spec.name = "au_pair"
|
8
8
|
spec.version = AuPair::VERSION
|
9
|
-
spec.authors = ["Corey Ehmke"]
|
9
|
+
spec.authors = ["Corey Ehmke", "Jay Wengrow"]
|
10
10
|
spec.email = ["cehmke@apartments.com"]
|
11
11
|
spec.description = %q{AuPair provides token-based authentication and versioning for Rails API applications.}
|
12
12
|
spec.summary = %q{API versioning and token authentication}
|
data/lib/au_pair.rb
CHANGED
@@ -3,7 +3,7 @@ require "au_pair/authentication_token"
|
|
3
3
|
require "au_pair/authenticates"
|
4
4
|
require 'au_pair/api_constraint'
|
5
5
|
|
6
|
-
module AuPair
|
6
|
+
module AuPair
|
7
7
|
|
8
8
|
def self.configure(&block)
|
9
9
|
@config = Configuration.new
|
@@ -18,8 +18,12 @@ module AuPair
|
|
18
18
|
config.tokens
|
19
19
|
end
|
20
20
|
|
21
|
+
def self.authentication_disabled?
|
22
|
+
config.authentication_disabled
|
23
|
+
end
|
24
|
+
|
21
25
|
class Configuration
|
22
|
-
attr_accessor :tokens
|
26
|
+
attr_accessor :tokens, :authentication_disabled
|
23
27
|
end
|
24
28
|
|
25
29
|
end
|
data/lib/au_pair/version.rb
CHANGED
@@ -30,4 +30,16 @@ describe AuPair::AuthenticationToken do
|
|
30
30
|
|
31
31
|
end
|
32
32
|
|
33
|
+
context 'when authentication is disabled' do
|
34
|
+
|
35
|
+
before do
|
36
|
+
AuPair.configure{ |config| config.authentication_disabled = true}
|
37
|
+
end
|
38
|
+
|
39
|
+
it 'should authenticate request even when no token is provided' do
|
40
|
+
expect(AuPair::AuthenticationToken.valid?(nil, nil)).to be_true
|
41
|
+
end
|
42
|
+
|
43
|
+
end
|
44
|
+
|
33
45
|
end
|
data/spec/configuration_spec.rb
CHANGED
@@ -8,4 +8,9 @@ describe AuPair do
|
|
8
8
|
expect(AuPair.config.tokens).to eq tokens
|
9
9
|
end
|
10
10
|
|
11
|
+
it 'accepts an option to disable authentication as part of its configuration' do
|
12
|
+
AuPair.configure{ |config| config.authentication_disabled = true }
|
13
|
+
expect(AuPair.authentication_disabled?).to be_true
|
14
|
+
end
|
15
|
+
|
11
16
|
end
|
metadata
CHANGED
@@ -1,14 +1,15 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: au_pair
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Corey Ehmke
|
8
|
+
- Jay Wengrow
|
8
9
|
autorequire:
|
9
10
|
bindir: bin
|
10
11
|
cert_chain: []
|
11
|
-
date: 2014-02-
|
12
|
+
date: 2014-02-12 00:00:00.000000000 Z
|
12
13
|
dependencies:
|
13
14
|
- !ruby/object:Gem::Dependency
|
14
15
|
name: bundler
|