sso 0.1.0.beta1 → 0.1.0.beta2
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/lib/sso/client/README.md +1 -0
- data/lib/sso/client/authentications/passport.rb +1 -0
- data/lib/sso/client/warden/hooks/after_fetch.rb +0 -1
- data/spec/lib/sso/client/authentications/passport_spec.rb +9 -1
- data/spec/lib/sso/server/middleware/passport_destruction_spec.rb +0 -8
- data/spec/spec_helper.rb +0 -2
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4c53a1e9c7573ea3d6e97727aa00e435c485b3d7
|
4
|
+
data.tar.gz: ff596d704a4e53c462d45251d64108cb85918d0f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4399983b1f108c80f30c497f5db66d406c95168271fcaa5c559e6b8b22f4ae99772b721db7b4e325694b896b29ef16e48a8cbc6a17e7df06d00df62ad5c87393
|
7
|
+
data.tar.gz: 2895cdf553890ae507ca160e5f40afc6b5c098ac461a1cf458bd1e7d73befcd4232c476fa5570e2e9e369fdadcbc2fd8737a9cb64eb66f9af995e9a2727a8191
|
data/lib/sso/client/README.md
CHANGED
@@ -41,6 +41,7 @@ module SSO
|
|
41
41
|
debug { 'Retrieving Passport from server...' }
|
42
42
|
if verification.success? && verification.code == :passport_valid_and_modified
|
43
43
|
passport = verification.object
|
44
|
+
passport.modified!
|
44
45
|
|
45
46
|
debug { "Successfully retrieved Passport with ID #{passport_id} from server." }
|
46
47
|
return passport
|
@@ -32,7 +32,7 @@ RSpec.describe SSO::Client::Authentications::Passport, type: :request, db: true
|
|
32
32
|
|
33
33
|
# Server
|
34
34
|
let(:insider) { false }
|
35
|
-
let
|
35
|
+
let(:server_user) { create :user, name: 'Emily', tags: %i(cool nice) }
|
36
36
|
let!(:server_passport) { create :passport, user: server_user, owner_id: server_user.id, ip: ip, agent: agent, insider: insider }
|
37
37
|
|
38
38
|
before do
|
@@ -53,6 +53,10 @@ RSpec.describe SSO::Client::Authentications::Passport, type: :request, db: true
|
|
53
53
|
expect(passport).to be_verified
|
54
54
|
end
|
55
55
|
|
56
|
+
it 'modifies the passport' do
|
57
|
+
expect(passport).to be_modified
|
58
|
+
end
|
59
|
+
|
56
60
|
it 'tracks the immediate request IP' do
|
57
61
|
expect(server_passport.reload.ip).to eq '127.0.0.1'
|
58
62
|
end
|
@@ -76,6 +80,10 @@ RSpec.describe SSO::Client::Authentications::Passport, type: :request, db: true
|
|
76
80
|
expect(passport).to be_verified
|
77
81
|
end
|
78
82
|
|
83
|
+
it 'modifies the passport' do
|
84
|
+
expect(passport).to be_modified
|
85
|
+
end
|
86
|
+
|
79
87
|
it 'tracks the untrusted client IP' do
|
80
88
|
expect(server_passport.reload.ip).to eq ip
|
81
89
|
end
|
@@ -20,14 +20,6 @@ RSpec.describe SSO::Server::Middleware::PassportDestruction, type: :request, db:
|
|
20
20
|
delete "/oauth/sso/v1/passports/#{passport.id}"
|
21
21
|
expect(updated_passport.revoked_at.to_i).to eq Time.now.to_i
|
22
22
|
end
|
23
|
-
|
24
|
-
it 'logs out from warden' do
|
25
|
-
Warden.on_next_request do |proxy|
|
26
|
-
expect(proxy).to receive(:logout)
|
27
|
-
end
|
28
|
-
|
29
|
-
delete "/oauth/sso/v1/passports/#{passport.id}"
|
30
|
-
end
|
31
23
|
end
|
32
24
|
|
33
25
|
end
|
data/spec/spec_helper.rb
CHANGED
@@ -23,7 +23,6 @@ RSpec.configure do |config|
|
|
23
23
|
|
24
24
|
config.include FactoryGirl::Syntax::Methods
|
25
25
|
config.include SSO::Test::Helpers
|
26
|
-
config.include Warden::Test::Helpers
|
27
26
|
|
28
27
|
config.color = true
|
29
28
|
config.disable_monkey_patching!
|
@@ -46,7 +45,6 @@ RSpec.configure do |config|
|
|
46
45
|
|
47
46
|
config.after :each do
|
48
47
|
Timecop.return
|
49
|
-
Warden.test_reset!
|
50
48
|
end
|
51
49
|
|
52
50
|
config.after :each, db: true do
|