doorkeeper_sso 0.4.6 → 0.4.8

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: 2bd334100cf66c77b3f645412a863eabdc1662d2
4
- data.tar.gz: dc41d49dbc70d8372eafd3f3b4d4992d46f70ec7
3
+ metadata.gz: 229918057255c549df3c4f5f01fb54df4710c160
4
+ data.tar.gz: 42ddf70c03c67529561f1cfb35fc055c409baa9f
5
5
  SHA512:
6
- metadata.gz: 733ec62c0762c923ccd25322e5670641f531850fddb84778a408c1d45bdac1b19c928db1114caeb296391e57bb4b2ec26f69cd43414ba53face2da3ab5cdd606
7
- data.tar.gz: efdd2637c8a3b766f47766d985e7ffab1d1ee2643e2299b0b156dc049c474de6970983bf3e66e384742fff00915285100f24f9b877e94dc84e80d7dfe1ad94a7
6
+ metadata.gz: 44c906adddda2b0b95057f4eac2e699d3c470400c4e681b32eb6408ee4ffcf21708c361288c4788d74781a05b77fd55f308a732561d880aa457abddbdf8b5f6d
7
+ data.tar.gz: 1ab043955e3b4375a7bccd034f5f67e0d45f48b8c23fe401aba653a6aac4a11e0f3231b690a04b91413e1009df172b58709c6a6d966f73b2f258a0b51a75ed17
@@ -13,8 +13,6 @@ module Sso
13
13
  scope :with_access_grant, -> { where.not(access_grant: nil) }
14
14
  scope :with_access_token, -> { where.not(access_token: nil) }
15
15
 
16
- before_save :ensure_random_token
17
-
18
16
  class << self
19
17
  def find_by_grant_token(token)
20
18
  find_by(access_grant: ::Doorkeeper::AccessGrant.by_token(token))
@@ -34,10 +32,5 @@ module Sso
34
32
  return false unless oauth_token = ::Doorkeeper::AccessToken.by_token(token)
35
33
  update(access_token_id: oauth_token.id, application_id: oauth_token.application.id)
36
34
  end
37
-
38
- private
39
- def ensure_random_token
40
- self.random_token ||= SecureRandom.hex
41
- end
42
35
  end
43
36
  end
@@ -3,7 +3,7 @@ module Sso
3
3
  delegate :id, :active?, :revoked_at, :revoke_reason, :secret, to: :session
4
4
 
5
5
  attribute :id, :key => :client_id
6
- attributes :id, :active?, :revoked_at, :revoke_reason, :secret, :random_token
6
+ attributes :id, :active?, :revoked_at, :revoke_reason, :secret
7
7
 
8
8
 
9
9
  belongs_to :owner, serializer: Sso::OwnerSerializer # WTH : hack to load owner using serializer
@@ -6,11 +6,5 @@ class AddDeviceInformationToSsoClients < ActiveRecord::Migration
6
6
  t.string "device_model"
7
7
  t.string "random_token"
8
8
  end
9
-
10
- Sso::Client.find_each do |client|
11
- client.save
12
- end
13
-
14
- change_column :sso_clients, :random_token, :string, :null => true
15
9
  end
16
10
  end
@@ -0,0 +1,7 @@
1
+ class RemoveRandomTokenFromSsoClients < ActiveRecord::Migration
2
+ def change
3
+ change_table :sso_clients do |t|
4
+ t.remove :random_token
5
+ end
6
+ end
7
+ end
data/lib/sso/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Sso
2
- VERSION = "0.4.6"
2
+ VERSION = "0.4.8"
3
3
  end
@@ -0,0 +1,9 @@
1
+ {
2
+ "type": "object",
3
+ "required" : [
4
+ "error"
5
+ ],
6
+ "properties": {
7
+ "error" : { "type" : "string" }
8
+ }
9
+ }
@@ -5,8 +5,7 @@
5
5
  "id",
6
6
  "active?",
7
7
  "secret",
8
- "owner",
9
- "random_token"
8
+ "owner"
10
9
  ],
11
10
  "properties": {
12
11
  "client_id" : { "type" : "string" },
@@ -15,7 +14,6 @@
15
14
  "revoked_at" : { "type": ["string", "null"], "format": "date-time" },
16
15
  "revoke_reason" : { "type": ["string", "null"] },
17
16
  "secret" : { "type" : "string" },
18
- "random_token" : { "type" : "string" },
19
17
  "owner" : {
20
18
  "type" : "object",
21
19
  "required" : [
@@ -0,0 +1,9 @@
1
+ {
2
+ "type": "object",
3
+ "required" : [
4
+ "passport_id"
5
+ ],
6
+ "properties": {
7
+ "passport_id" : { "type" : "string" }
8
+ }
9
+ }
@@ -56,13 +56,4 @@ RSpec.describe Sso::Client, :type => :model do
56
56
  expect(client.access_token).to eq access_token
57
57
  end
58
58
  end
59
-
60
- describe "#ensure_random_token" do
61
- subject!(:client) { Fabricate('Sso::Client', session: session,
62
- application_id: application.id,
63
- access_grant_id: access_grant.id) }
64
-
65
- it { expect(client.random_token).not_to be_blank }
66
- end
67
-
68
59
  end
@@ -11,7 +11,7 @@
11
11
  #
12
12
  # It's strongly recommended that you check this file into your version control system.
13
13
 
14
- ActiveRecord::Schema.define(version: 20151104090509) do
14
+ ActiveRecord::Schema.define(version: 20151221071537) do
15
15
 
16
16
  # These are extensions that must be enabled in order to support this database
17
17
  enable_extension "plpgsql"
@@ -83,7 +83,6 @@ ActiveRecord::Schema.define(version: 20151104090509) do
83
83
  t.string "device_os"
84
84
  t.string "device_os_version"
85
85
  t.string "device_model"
86
- t.string "random_token", null: false
87
86
  end
88
87
 
89
88
  add_index "sso_clients", ["access_grant_id"], name: "index_sso_clients_on_access_grant_id", using: :btree
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: doorkeeper_sso
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.6
4
+ version: 0.4.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - John Wong
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-11-05 00:00:00.000000000 Z
11
+ date: 2015-12-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: warden
@@ -351,6 +351,7 @@ files:
351
351
  - db/migrate/20150603145730_add_pingback_uri_to_doorkeeper_applications.rb
352
352
  - db/migrate/20151030064515_add_device_information_to_sso_clients.rb
353
353
  - db/migrate/20151104090509_remove_group_id_from_sessions.rb
354
+ - db/migrate/20151221071537_remove_random_token_from_sso_clients.rb
354
355
  - lib/doorkeeper_sso.rb
355
356
  - lib/sso.rb
356
357
  - lib/sso/doorkeeper/access_grant_mixin.rb
@@ -371,7 +372,9 @@ files:
371
372
  - lib/sso/warden/hooks/session_check.rb
372
373
  - lib/sso/warden/support.rb
373
374
  - lib/tasks/sso_tasks.rake
375
+ - spec/api/schemas/error.json
374
376
  - spec/api/schemas/session.json
377
+ - spec/api/schemas/sso_session_id.json
375
378
  - spec/controllers/sso/sessions_controller_spec.rb
376
379
  - spec/fabricators/api_application_fabricator.rb
377
380
  - spec/fabricators/doorkeeper_access_grant_fabricator.rb
@@ -431,7 +434,9 @@ signing_key:
431
434
  specification_version: 4
432
435
  summary: Leveraging Doorkeeper as single-sign-on OAuth server.
433
436
  test_files:
437
+ - spec/api/schemas/error.json
434
438
  - spec/api/schemas/session.json
439
+ - spec/api/schemas/sso_session_id.json
435
440
  - spec/controllers/sso/sessions_controller_spec.rb
436
441
  - spec/fabricators/api_application_fabricator.rb
437
442
  - spec/fabricators/doorkeeper_access_grant_fabricator.rb