maestrano-rails 0.2.0 → 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -4,6 +4,21 @@
4
4
 
5
5
  Maestrano Cloud Integration is currently in closed beta. Want to know more? Send us an email to <contact@maestrano.com>.
6
6
 
7
+
8
+ - - -
9
+
10
+ 1. [Getting Setup](#getting-setup)
11
+ 2. [Getting Started](#getting-started)
12
+ * [User Model](#user-model)
13
+ * [Group Model](#group-model)
14
+ * [Controller Setup](#controller-setup)
15
+ 3. [API](https://github.com/maestrano/maestrano-ruby#api)
16
+ * [Bill](https://github.com/maestrano/maestrano-ruby#bill)
17
+ * [Recurring Bill](https://github.com/maestrano/maestrano-ruby#recurring-bill)
18
+
19
+ - - -
20
+
21
+
7
22
  ## Getting Setup
8
23
  Before integrating with us you will need an API Key. Maestrano Cloud Integration being still in closed beta you will need to contact us beforehand to gain production access.
9
24
 
@@ -152,6 +167,11 @@ class Maestrano::Auth::SamlController < Maestrano::Rails::SamlBaseController
152
167
  end
153
168
  ```
154
169
 
170
+ ## API
171
+ The maestrano-rails gem also provides bindings to its REST API allowing you to access, create, update or delete various entities under your account (e.g: billing).
172
+
173
+ Your can read the API documentation directly on the [maestrano gem project page](https://github.com/maestrano/maestrano-ruby#api).
174
+
155
175
  ## Support
156
176
  This README is still in the process of being written and improved. As such it might not cover some of the questions you might have.
157
177
 
@@ -33,11 +33,7 @@ class Maestrano::Rails::SamlBaseController < ApplicationController
33
33
  if @saml_response.validate!
34
34
  @user_auth_hash = Maestrano::SSO::BaseUser.new(@saml_response).to_hash
35
35
  @group_auth_hash = Maestrano::SSO::BaseGroup.new(@saml_response).to_hash
36
- @user_group_rel_hash = {
37
- user_uid: @user_auth_hash[:uid],
38
- group_uid: @group_auth_hash[:uid],
39
- role: @user_auth_hash[:extra][:group][:role]
40
- }
36
+ @user_group_rel_hash = Maestrano::SSO::BaseMembership.new(@saml_response).to_hash
41
37
  end
42
38
  end
43
39
  end
@@ -1,5 +1,5 @@
1
1
  module Maestrano
2
2
  module Rails
3
- VERSION = "0.2.0"
3
+ VERSION = "0.3.0"
4
4
  end
5
5
  end
@@ -72,6 +72,7 @@ class SamlBaseControllerTest < ActionController::TestCase
72
72
  should "set the user_group_rel_hash in scope" do
73
73
  post :consume, SAMLResponse: "g45ad5v40xc4b3fd478"
74
74
  expected_hash = {
75
+ provider: 'maestrano',
75
76
  user_uid: @saml_attr['uid'],
76
77
  group_uid: @saml_attr['group_uid'],
77
78
  role: @saml_attr['group_role'],
@@ -3730,3 +3730,184 @@ Completed 302 Found in 0.6ms (ActiveRecord: 0.0ms)
3730
3730
   (0.1ms) rollback transaction
3731
3731
   (0.0ms) begin transaction
3732
3732
   (0.1ms) rollback transaction
3733
+ Connecting to database specified by database.yml
3734
+  (0.6ms) begin transaction
3735
+ MnoCrew Load (0.5ms) SELECT "mno_crews".* FROM "mno_crews" WHERE "mno_crews"."provider" = 'maestrano' AND "mno_crews"."uid" = 'usr-2' LIMIT 1
3736
+  (0.1ms) SAVEPOINT active_record_1
3737
+ SQL (16.9ms) INSERT INTO "mno_crews" ("created_at", "name", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Thu, 29 May 2014 13:29:11 UTC +00:00], ["name", "Monster Co"], ["provider", "maestrano"], ["uid", "usr-2"], ["updated_at", Thu, 29 May 2014 13:29:11 UTC +00:00]]
3738
+  (0.1ms) RELEASE SAVEPOINT active_record_1
3739
+  (0.3ms) rollback transaction
3740
+  (0.0ms) begin transaction
3741
+  (0.0ms) SAVEPOINT active_record_1
3742
+ SQL (0.4ms) INSERT INTO "mno_crews" ("created_at", "name", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Thu, 29 May 2014 13:29:11 UTC +00:00], ["name", "SomeOtherCrew"], ["provider", "someoneelse"], ["uid", "usr-1"], ["updated_at", Thu, 29 May 2014 13:29:11 UTC +00:00]]
3743
+  (0.0ms) RELEASE SAVEPOINT active_record_1
3744
+ MnoCrew Load (0.1ms) SELECT "mno_crews".* FROM "mno_crews" WHERE "mno_crews"."provider" = 'maestrano' AND "mno_crews"."uid" = 'cld-1' LIMIT 1
3745
+  (0.0ms) SAVEPOINT active_record_1
3746
+ SQL (1.3ms) INSERT INTO "mno_crews" ("created_at", "name", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Thu, 29 May 2014 13:29:11 UTC +00:00], ["name", "Your Group"], ["provider", "maestrano"], ["uid", "cld-1"], ["updated_at", Thu, 29 May 2014 13:29:11 UTC +00:00]]
3747
+  (0.0ms) RELEASE SAVEPOINT active_record_1
3748
+  (0.5ms) rollback transaction
3749
+  (0.0ms) begin transaction
3750
+  (0.0ms) SAVEPOINT active_record_1
3751
+ SQL (0.4ms) INSERT INTO "mno_crews" ("created_at", "name", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Thu, 29 May 2014 13:29:11 UTC +00:00], ["name", "SomeCrew"], ["provider", "maestrano"], ["uid", "cld-1"], ["updated_at", Thu, 29 May 2014 13:29:11 UTC +00:00]]
3752
+  (0.0ms) RELEASE SAVEPOINT active_record_1
3753
+ MnoCrew Load (0.2ms) SELECT "mno_crews".* FROM "mno_crews" WHERE "mno_crews"."provider" = 'maestrano' AND "mno_crews"."uid" = 'cld-1' LIMIT 1
3754
+  (0.5ms) rollback transaction
3755
+  (0.0ms) begin transaction
3756
+  (0.0ms) rollback transaction
3757
+  (0.0ms) begin transaction
3758
+  (0.0ms) rollback transaction
3759
+  (0.0ms) begin transaction
3760
+  (0.0ms) rollback transaction
3761
+  (0.0ms) begin transaction
3762
+  (0.0ms) rollback transaction
3763
+  (0.0ms) begin transaction
3764
+  (0.0ms) rollback transaction
3765
+  (0.0ms) begin transaction
3766
+ MnoMonster Load (0.5ms) SELECT "mno_monsters".* FROM "mno_monsters" WHERE "mno_monsters"."provider" = 'maestrano' AND "mno_monsters"."uid" = 'usr-2' LIMIT 1
3767
+  (0.1ms) SAVEPOINT active_record_1
3768
+ SQL (0.6ms) INSERT INTO "mno_monsters" ("created_at", "email", "first_name", "last_name", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?) [["created_at", Thu, 29 May 2014 13:29:11 UTC +00:00], ["email", "monster@monst.com"], ["first_name", "Mon"], ["last_name", "Ster"], ["provider", "maestrano"], ["uid", "usr-2"], ["updated_at", Thu, 29 May 2014 13:29:11 UTC +00:00]]
3769
+  (0.0ms) RELEASE SAVEPOINT active_record_1
3770
+  (0.5ms) rollback transaction
3771
+  (0.0ms) begin transaction
3772
+  (0.0ms) SAVEPOINT active_record_1
3773
+ SQL (0.4ms) INSERT INTO "mno_monsters" ("created_at", "email", "first_name", "last_name", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?) [["created_at", Thu, 29 May 2014 13:29:11 UTC +00:00], ["email", "monster@co.com"], ["first_name", "John"], ["last_name", "Jack"], ["provider", "someoneelse"], ["uid", "usr-1"], ["updated_at", Thu, 29 May 2014 13:29:11 UTC +00:00]]
3774
+  (0.0ms) RELEASE SAVEPOINT active_record_1
3775
+ MnoMonster Load (0.1ms) SELECT "mno_monsters".* FROM "mno_monsters" WHERE "mno_monsters"."provider" = 'maestrano' AND "mno_monsters"."uid" = 'usr-1' LIMIT 1
3776
+  (0.0ms) SAVEPOINT active_record_1
3777
+ SQL (0.5ms) INSERT INTO "mno_monsters" ("created_at", "email", "first_name", "last_name", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?) [["created_at", Thu, 29 May 2014 13:29:11 UTC +00:00], ["email", nil], ["first_name", nil], ["last_name", nil], ["provider", "maestrano"], ["uid", "usr-1"], ["updated_at", Thu, 29 May 2014 13:29:11 UTC +00:00]]
3778
+  (0.0ms) RELEASE SAVEPOINT active_record_1
3779
+  (0.4ms) rollback transaction
3780
+  (0.1ms) begin transaction
3781
+  (0.0ms) SAVEPOINT active_record_1
3782
+ SQL (0.5ms) INSERT INTO "mno_monsters" ("created_at", "email", "first_name", "last_name", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?) [["created_at", Thu, 29 May 2014 13:29:11 UTC +00:00], ["email", "monster@co.com"], ["first_name", "John"], ["last_name", "Jack"], ["provider", "maestrano"], ["uid", "usr-1"], ["updated_at", Thu, 29 May 2014 13:29:11 UTC +00:00]]
3783
+  (0.0ms) RELEASE SAVEPOINT active_record_1
3784
+ MnoMonster Load (0.1ms) SELECT "mno_monsters".* FROM "mno_monsters" WHERE "mno_monsters"."provider" = 'maestrano' AND "mno_monsters"."uid" = 'usr-1' LIMIT 1
3785
+  (0.5ms) rollback transaction
3786
+  (0.1ms) begin transaction
3787
+  (0.0ms) rollback transaction
3788
+  (0.0ms) begin transaction
3789
+  (0.0ms) rollback transaction
3790
+  (0.1ms) begin transaction
3791
+  (0.0ms) rollback transaction
3792
+  (0.0ms) begin transaction
3793
+  (0.0ms) rollback transaction
3794
+  (0.0ms) begin transaction
3795
+ Processing by PagesController#home as HTML
3796
+ Rendered pages/home.html.erb within layouts/application (10.9ms)
3797
+ Completed 200 OK in 47.8ms (Views: 47.2ms | ActiveRecord: 0.0ms)
3798
+  (0.1ms) rollback transaction
3799
+  (0.1ms) begin transaction
3800
+ Processing by PagesController#home as HTML
3801
+ Redirected to http://localhost::3000/maestrano/auth/saml/init
3802
+ Filter chain halted as :verify_maestrano_session rendered or redirected
3803
+ Completed 302 Found in 0.3ms (ActiveRecord: 0.0ms)
3804
+  (0.1ms) rollback transaction
3805
+  (0.0ms) begin transaction
3806
+ Processing by PagesController#home as HTML
3807
+ Completed 200 OK in 1.4ms (Views: 1.3ms | ActiveRecord: 0.0ms)
3808
+  (0.1ms) rollback transaction
3809
+  (0.0ms) begin transaction
3810
+ Processing by PagesController#home as HTML
3811
+ Completed 200 OK in 1.3ms (Views: 1.1ms | ActiveRecord: 0.0ms)
3812
+  (0.0ms) rollback transaction
3813
+  (0.0ms) begin transaction
3814
+ Processing by PagesController#home as HTML
3815
+ Completed 200 OK in 1.4ms (Views: 1.3ms | ActiveRecord: 0.0ms)
3816
+  (0.0ms) rollback transaction
3817
+  (0.0ms) begin transaction
3818
+ Processing by Maestrano::Auth::SamlController#consume as HTML
3819
+ Parameters: {"SAMLResponse"=>"g45ad5v40xc4b3fd478"}
3820
+ Bla
3821
+ Redirected to http://api-sandbox.maestrano.io/app_access_unauthorized?err=internal
3822
+ Completed 302 Found in 0.8ms (ActiveRecord: 0.0ms)
3823
+  (0.1ms) rollback transaction
3824
+  (0.0ms) begin transaction
3825
+ Processing by Maestrano::Auth::SamlController#consume as HTML
3826
+ Parameters: {"SAMLResponse"=>"g45ad5v40xc4b3fd478"}
3827
+ Redirected to http://test.host/
3828
+ Completed 302 Found in 0.7ms (ActiveRecord: 0.0ms)
3829
+  (0.1ms) rollback transaction
3830
+  (0.0ms) begin transaction
3831
+ Processing by Maestrano::Auth::SamlController#consume as HTML
3832
+ Parameters: {"SAMLResponse"=>"g45ad5v40xc4b3fd478"}
3833
+ Redirected to http://test.host/
3834
+ Completed 302 Found in 0.6ms (ActiveRecord: 0.0ms)
3835
+  (0.1ms) rollback transaction
3836
+  (0.0ms) begin transaction
3837
+ Processing by Maestrano::Auth::SamlController#consume as HTML
3838
+ Parameters: {"SAMLResponse"=>"g45ad5v40xc4b3fd478"}
3839
+ Redirected to http://test.host/
3840
+ Completed 302 Found in 0.5ms (ActiveRecord: 0.0ms)
3841
+  (0.1ms) rollback transaction
3842
+  (0.0ms) begin transaction
3843
+ Processing by Maestrano::Auth::SamlController#consume as HTML
3844
+ Parameters: {"SAMLResponse"=>"g45ad5v40xc4b3fd478"}
3845
+ Redirected to http://test.host/
3846
+ Completed 302 Found in 0.5ms (ActiveRecord: 0.0ms)
3847
+  (0.0ms) rollback transaction
3848
+  (0.0ms) begin transaction
3849
+ Processing by Maestrano::Auth::SamlController#consume as HTML
3850
+ Parameters: {"SAMLResponse"=>"g45ad5v40xc4b3fd478"}
3851
+ Redirected to http://test.host/
3852
+ Completed 302 Found in 0.6ms (ActiveRecord: 0.0ms)
3853
+  (0.1ms) rollback transaction
3854
+  (0.0ms) begin transaction
3855
+ Processing by Maestrano::Auth::SamlController#consume as HTML
3856
+ Parameters: {"SAMLResponse"=>"g45ad5v40xc4b3fd478"}
3857
+ Redirected to http://test.host/
3858
+ Completed 302 Found in 0.5ms (ActiveRecord: 0.0ms)
3859
+  (0.1ms) rollback transaction
3860
+  (0.0ms) begin transaction
3861
+ Processing by Maestrano::Auth::SamlController#init as HTML
3862
+ Parameters: {"a_param"=>"value"}
3863
+ Redirected to http://idpprovider.com?r=request
3864
+ Completed 302 Found in 0.5ms (ActiveRecord: 0.0ms)
3865
+  (0.0ms) rollback transaction
3866
+  (0.0ms) begin transaction
3867
+ Processing by Maestrano::Auth::SamlController#init as HTML
3868
+ Parameters: {"a_param"=>"value"}
3869
+ Redirected to http://idpprovider.com?r=request
3870
+ Completed 302 Found in 0.3ms (ActiveRecord: 0.0ms)
3871
+  (0.1ms) rollback transaction
3872
+  (0.1ms) begin transaction
3873
+  (0.1ms) rollback transaction
3874
+  (0.0ms) begin transaction
3875
+  (0.1ms) rollback transaction
3876
+  (0.0ms) begin transaction
3877
+  (0.1ms) rollback transaction
3878
+  (0.0ms) begin transaction
3879
+  (0.1ms) rollback transaction
3880
+  (0.0ms) begin transaction
3881
+  (0.1ms) rollback transaction
3882
+  (0.1ms) begin transaction
3883
+  (0.1ms) rollback transaction
3884
+  (0.0ms) begin transaction
3885
+  (0.1ms) rollback transaction
3886
+  (0.1ms) begin transaction
3887
+  (0.1ms) rollback transaction
3888
+  (0.0ms) begin transaction
3889
+  (0.1ms) rollback transaction
3890
+  (0.0ms) begin transaction
3891
+  (0.1ms) rollback transaction
3892
+  (0.0ms) begin transaction
3893
+  (0.1ms) rollback transaction
3894
+  (0.0ms) begin transaction
3895
+  (0.1ms) rollback transaction
3896
+  (0.0ms) begin transaction
3897
+  (0.1ms) rollback transaction
3898
+  (0.1ms) begin transaction
3899
+  (0.1ms) rollback transaction
3900
+  (0.0ms) begin transaction
3901
+  (0.1ms) rollback transaction
3902
+  (0.1ms) begin transaction
3903
+  (0.1ms) rollback transaction
3904
+  (0.0ms) begin transaction
3905
+  (0.1ms) rollback transaction
3906
+  (0.0ms) begin transaction
3907
+  (0.1ms) rollback transaction
3908
+  (0.0ms) begin transaction
3909
+  (0.1ms) rollback transaction
3910
+  (0.1ms) begin transaction
3911
+  (0.1ms) rollback transaction
3912
+  (0.0ms) begin transaction
3913
+  (0.1ms) rollback transaction
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: maestrano-rails
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.2.0
5
+ version: 0.3.0
6
6
  platform: ruby
7
7
  authors:
8
8
  - Arnaud Lachaume
@@ -10,7 +10,7 @@ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
12
 
13
- date: 2014-05-28 00:00:00 Z
13
+ date: 2014-05-29 00:00:00 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: rails
@@ -31,7 +31,7 @@ dependencies:
31
31
  requirements:
32
32
  - - ~>
33
33
  - !ruby/object:Gem::Version
34
- version: "0.2"
34
+ version: "0.3"
35
35
  type: :runtime
36
36
  version_requirements: *id002
37
37
  - !ruby/object:Gem::Dependency