maestrano 0.9.0 → 0.9.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: d7b52772f9c6a0b6f00927d0b361d6c35512cfc2
4
- data.tar.gz: 6dd4ac9f9718ea41f5f9293b6b2cdfb178842fd5
3
+ metadata.gz: 91a57ad052de3e763e9bb093be5d323f2cac6104
4
+ data.tar.gz: c55d04040324a83014afd6d801f87c128c05b1d5
5
5
  SHA512:
6
- metadata.gz: addeb6545bd045619468ba85bb75042e89e1f25939a69c117926c256a5870023e44db735c472d6ad181cf959a0e89192bb603cfeafe9b179358497558850aa81
7
- data.tar.gz: 73bada943c7f5fd95852fd1493a22d18e7e1784e8a0e64b2f4edf1eefd76edf4e187e26d395389288438968b7298b706b0b7082c8bd0ec0aaa9b504800ef92bb
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: {}
@@ -1,3 +1,3 @@
1
1
  module Maestrano
2
- VERSION = '0.9.0'
2
+ VERSION = '0.9.1'
3
3
  end
@@ -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' => 'f54sd54fd64fs5df4s3d48gf2',
12
- 'mno_session_recheck' => Time.now.utc.iso8601,
13
- 'group_uid' => 'cld-1',
14
- 'group_end_free_trial' => Time.now.utc.iso8601,
15
- 'group_role' => 'Admin',
16
- 'uid' => "usr-1",
17
- 'virtual_uid' => "usr-1.cld-1",
18
- 'email' => "j.doe@doecorp.com",
19
- 'virtual_email' => "usr-1.cld-1@mail.maestrano.com",
20
- 'name' => "John",
21
- "surname" => "Doe",
22
- "country" => "AU",
23
- "company_name" => "DoeCorp"
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: {}
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: maestrano
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.0
4
+ version: 0.9.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Arnaud Lachaume