maestrano 0.9.0 → 0.9.1
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/maestrano/sso/base_group.rb +3 -1
- data/lib/maestrano/version.rb +1 -1
- data/test/maestrano/sso/base_group_test.rb +16 -13
- 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: 91a57ad052de3e763e9bb093be5d323f2cac6104
|
4
|
+
data.tar.gz: c55d04040324a83014afd6d801f87c128c05b1d5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 23fb6893f379f0a5d997170f53dadae889906bbb65aa02943cd50e4ea68bd3448a4ef1598dbb2daea35061f89ccca5b63e2be2e5bdfed5e27748ea39755e2afe
|
7
|
+
data.tar.gz: 14f110e3573189d0b1b84e02832ebac11e529bf7fcc5355ac63b43c7a601e0a97883b218218eece460d7d578c737781c8b3a9c1da8420169884053582b6ca96a
|
@@ -2,13 +2,14 @@ module Maestrano
|
|
2
2
|
module SSO
|
3
3
|
class BaseGroup
|
4
4
|
attr_accessor :local_id
|
5
|
-
attr_reader :uid,:country, :company_name, :free_trial_end_at
|
5
|
+
attr_reader :uid,:country, :company_name, :free_trial_end_at, :has_credit_card
|
6
6
|
|
7
7
|
# Initializer
|
8
8
|
# @param Maestrano::SAML::Response
|
9
9
|
def initialize(saml_response)
|
10
10
|
att = saml_response.attributes
|
11
11
|
@uid = att['group_uid']
|
12
|
+
@has_credit_card = (att['group_has_credit_card'] == 'true')
|
12
13
|
@country = att['country']
|
13
14
|
@free_trial_end_at = Time.iso8601(att['group_end_free_trial'])
|
14
15
|
@company_name = att['company_name']
|
@@ -21,6 +22,7 @@ module Maestrano
|
|
21
22
|
info: {
|
22
23
|
free_trial_end_at: self.free_trial_end_at,
|
23
24
|
company_name: self.company_name,
|
25
|
+
has_credit_card: self.has_credit_card,
|
24
26
|
country: self.country,
|
25
27
|
},
|
26
28
|
extra: {}
|
data/lib/maestrano/version.rb
CHANGED
@@ -8,19 +8,20 @@ module Maestrano
|
|
8
8
|
setup do
|
9
9
|
@saml_response = Maestrano::Saml::Response.new(response_document)
|
10
10
|
@saml_response.stubs(:attributes).returns({
|
11
|
-
'mno_session'
|
12
|
-
'mno_session_recheck'
|
13
|
-
'group_uid'
|
14
|
-
'
|
15
|
-
'
|
16
|
-
'
|
17
|
-
'
|
18
|
-
'
|
19
|
-
'
|
20
|
-
'
|
21
|
-
|
22
|
-
"
|
23
|
-
"
|
11
|
+
'mno_session' => 'f54sd54fd64fs5df4s3d48gf2',
|
12
|
+
'mno_session_recheck' => Time.now.utc.iso8601,
|
13
|
+
'group_uid' => 'cld-1',
|
14
|
+
'group_has_credit_card' => 'true',
|
15
|
+
'group_end_free_trial' => Time.now.utc.iso8601,
|
16
|
+
'group_role' => 'Admin',
|
17
|
+
'uid' => "usr-1",
|
18
|
+
'virtual_uid' => "usr-1.cld-1",
|
19
|
+
'email' => "j.doe@doecorp.com",
|
20
|
+
'virtual_email' => "usr-1.cld-1@mail.maestrano.com",
|
21
|
+
'name' => "John",
|
22
|
+
"surname" => "Doe",
|
23
|
+
"country" => "AU",
|
24
|
+
"company_name" => "DoeCorp"
|
24
25
|
})
|
25
26
|
end
|
26
27
|
|
@@ -31,6 +32,7 @@ module Maestrano
|
|
31
32
|
should "extract the rights attributes from the saml response" do
|
32
33
|
group = Maestrano::SSO::BaseGroup.new(@saml_response)
|
33
34
|
assert group.uid == @saml_response.attributes['group_uid']
|
35
|
+
assert group.has_credit_card == (@saml_response.attributes['group_has_credit_card'] == 'true')
|
34
36
|
assert group.free_trial_end_at == Time.iso8601(@saml_response.attributes['group_end_free_trial'])
|
35
37
|
assert group.company_name == @saml_response.attributes['company_name']
|
36
38
|
assert group.country == @saml_response.attributes['country']
|
@@ -44,6 +46,7 @@ module Maestrano
|
|
44
46
|
info: {
|
45
47
|
free_trial_end_at: sso_group.free_trial_end_at,
|
46
48
|
company_name: sso_group.company_name,
|
49
|
+
has_credit_card: sso_group.has_credit_card,
|
47
50
|
country: sso_group.country,
|
48
51
|
},
|
49
52
|
extra: {}
|