gds-sso 6.0.0 → 7.0.0
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.
- data/README.md +2 -1
- data/app/controllers/api/user_controller.rb +1 -1
- data/lib/gds-sso/user.rb +2 -2
- data/lib/gds-sso/version.rb +1 -1
- data/lib/gds-sso/warden_config.rb +1 -1
- data/spec/controller/api_user_controller_spec.rb +2 -2
- data/spec/internal/app/models/user.rb +1 -1
- data/spec/internal/db/combustion_test.sqlite +0 -0
- data/spec/internal/db/schema.rb +1 -1
- data/spec/internal/log/test.log +2292 -0
- data/test/user_test.rb +2 -2
- metadata +6 -6
data/README.md
CHANGED
@@ -35,10 +35,11 @@ Create a `config/initializers/gds-sso.rb` that looks like:
|
|
35
35
|
The user model must include the GDS::SSO::User module.
|
36
36
|
|
37
37
|
It should have the following fields:
|
38
|
+
|
38
39
|
string "name"
|
39
40
|
string "email"
|
40
41
|
string "uid"
|
41
|
-
string "
|
42
|
+
string "organisation_slug"
|
42
43
|
array "permissions"
|
43
44
|
boolean "remotely_signed_out", :default => false
|
44
45
|
|
data/lib/gds-sso/user.rb
CHANGED
@@ -4,7 +4,7 @@ module GDS
|
|
4
4
|
module SSO
|
5
5
|
module User
|
6
6
|
def included(base)
|
7
|
-
attr_accessible :uid, :email, :name, :permissions, :
|
7
|
+
attr_accessible :uid, :email, :name, :permissions, :organisation_slug, as: :oauth
|
8
8
|
end
|
9
9
|
|
10
10
|
def has_permission?(permission)
|
@@ -19,7 +19,7 @@ module GDS
|
|
19
19
|
'email' => auth_hash['info']['email'],
|
20
20
|
'name' => auth_hash['info']['name'],
|
21
21
|
'permissions' => auth_hash['extra']['user']['permissions'],
|
22
|
-
'
|
22
|
+
'organisation_slug' => auth_hash['extra']['user']['organisation_slug'],
|
23
23
|
}
|
24
24
|
end
|
25
25
|
|
data/lib/gds-sso/version.rb
CHANGED
@@ -7,7 +7,7 @@ def user_update_json
|
|
7
7
|
"name" => "Joshua Marshall",
|
8
8
|
"email" => "user@domain.com",
|
9
9
|
"permissions" => ["signin", "new permission"],
|
10
|
-
"
|
10
|
+
"organisation_slug" => "justice-league"
|
11
11
|
}
|
12
12
|
}.to_json
|
13
13
|
end
|
@@ -61,7 +61,7 @@ describe Api::UserController, type: :controller do
|
|
61
61
|
expected_permissions = ["signin", "new permission"]
|
62
62
|
assert_equal expected_permissions, @user_to_update.permissions
|
63
63
|
expected_organisation = "justice-league"
|
64
|
-
assert_equal expected_organisation, @user_to_update.
|
64
|
+
assert_equal expected_organisation, @user_to_update.organisation_slug
|
65
65
|
end
|
66
66
|
end
|
67
67
|
|
Binary file
|