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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 68585960729029037de661b49771b7766ae1c2c5
4
- data.tar.gz: 74381326cc5605fdd6b8b3a1d044bf65fc4915e0
3
+ metadata.gz: 4c53a1e9c7573ea3d6e97727aa00e435c485b3d7
4
+ data.tar.gz: ff596d704a4e53c462d45251d64108cb85918d0f
5
5
  SHA512:
6
- metadata.gz: c8ae9e8fa88060efe6c39e36f5bce7750d739c382e9137c9ba409dfe3587674774a16bd491369fb7fd6e05ccf00e5366f7eed4a06435807b7ff00be6c9f6a473
7
- data.tar.gz: be505aafa56fe22050682280c7c09a53ceddb25044a01ee4ee7479eb77e992cb349151adc4f7becec0519c43b595b63872f86df31b3cd93e1c24e80e821ff834
6
+ metadata.gz: 4399983b1f108c80f30c497f5db66d406c95168271fcaa5c559e6b8b22f4ae99772b721db7b4e325694b896b29ef16e48a8cbc6a17e7df06d00df62ad5c87393
7
+ data.tar.gz: 2895cdf553890ae507ca160e5f40afc6b5c098ac461a1cf458bd1e7d73befcd4232c476fa5570e2e9e369fdadcbc2fd8737a9cb64eb66f9af995e9a2727a8191
@@ -43,6 +43,7 @@ If you store the entire object, that would be a major security risk and allow fo
43
43
  class Warden::SessionSerializer
44
44
  def serialize(passport)
45
45
  Redis.set passport.id, passport.to_json
46
+ passport.id
46
47
  end
47
48
 
48
49
  def deserialize(passport_id)
@@ -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
@@ -41,7 +41,6 @@ module SSO
41
41
 
42
42
  private
43
43
 
44
-
45
44
  def verifier
46
45
  ::SSO::Client::PassportVerifier.new passport_id: passport.id, passport_state: passport.state, passport_secret: passport.secret, user_ip: ip, user_agent: agent, device_id: device_id
47
46
  end
@@ -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!(:server_user) { create :user, name: 'Emily', tags: %i(cool nice) }
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
@@ -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
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sso
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0.beta1
4
+ version: 0.1.0.beta2
5
5
  platform: ruby
6
6
  authors:
7
7
  - halo