maestrano-connector-rails 0.4.4 → 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (57) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile +2 -0
  3. data/README.md +1 -1
  4. data/VERSION +1 -1
  5. data/app/controllers/maestrano/connec_controller.rb +17 -19
  6. data/app/jobs/maestrano/connector/rails/all_synchronizations_job.rb +1 -1
  7. data/app/jobs/maestrano/connector/rails/push_to_connec_job.rb +11 -11
  8. data/app/jobs/maestrano/connector/rails/synchronization_job.rb +20 -11
  9. data/app/models/maestrano/connector/rails/concerns/complex_entity.rb +66 -74
  10. data/app/models/maestrano/connector/rails/concerns/connec_helper.rb +102 -0
  11. data/app/models/maestrano/connector/rails/concerns/entity.rb +233 -231
  12. data/app/models/maestrano/connector/rails/concerns/external.rb +7 -0
  13. data/app/models/maestrano/connector/rails/concerns/sub_entity_base.rb +14 -43
  14. data/app/models/maestrano/connector/rails/connec_helper.rb +5 -0
  15. data/app/models/maestrano/connector/rails/organization.rb +8 -2
  16. data/db/20160524112054_add_encryption_on_oauth_keys.rb +8 -0
  17. data/lib/generators/connector/install_generator.rb +1 -0
  18. data/lib/generators/connector/templates/complex_entity_example/contact.rb +1 -1
  19. data/lib/generators/connector/templates/complex_entity_example/contact_and_lead.rb +2 -2
  20. data/lib/generators/connector/templates/entity.rb +13 -19
  21. data/lib/generators/connector/templates/example_entity.rb +2 -2
  22. data/lib/generators/connector/templates/example_entity_spec.rb +73 -0
  23. data/lib/generators/connector/templates/external.rb +11 -0
  24. data/maestrano-connector-rails.gemspec +13 -8
  25. data/release_notes.md +81 -0
  26. data/spec/controllers/connec_controller_spec.rb +19 -6
  27. data/spec/dummy/app/models/maestrano/connector/rails/entity.rb +0 -7
  28. data/spec/dummy/app/models/maestrano/connector/rails/external.rb +7 -0
  29. data/spec/dummy/app/views/home/index.html.erb +1 -36
  30. data/spec/factories.rb +3 -0
  31. data/spec/integration/connec_to_external_spec.rb +188 -0
  32. data/spec/integration/external_to_connec_spec.rb +155 -0
  33. data/spec/integration/integration_complex_spec.rb +281 -0
  34. data/spec/integration/singleton_spec.rb +288 -0
  35. data/spec/jobs/all_synchronizations_job_spec.rb +5 -0
  36. data/spec/jobs/push_to_connec_job_spec.rb +3 -6
  37. data/spec/jobs/synchronization_job_spec.rb +29 -17
  38. data/spec/models/complex_entity_spec.rb +257 -412
  39. data/spec/models/connec_helper_spec.rb +143 -0
  40. data/spec/models/entity_spec.rb +420 -348
  41. data/spec/models/external_spec.rb +4 -0
  42. data/spec/models/organization_spec.rb +2 -1
  43. data/spec/models/sub_entity_base_spec.rb +28 -69
  44. data/template/factories.rb +3 -1
  45. data/template/maestrano-connector-template.rb +11 -13
  46. data/template/maestrano.rb +2 -1
  47. data/template/settings/development.yml +4 -2
  48. data/template/settings/production.yml +1 -11
  49. data/template/settings/settings.yml +8 -0
  50. data/template/settings/test.yml +2 -0
  51. data/template/settings/uat.yml +1 -9
  52. metadata +12 -7
  53. data/Gemfile.lock +0 -256
  54. data/realse_notes.md +0 -16
  55. data/spec/dummy/app/views/admin/index.html.erb +0 -51
  56. data/spec/dummy/db/development.sqlite3 +0 -0
  57. data/spec/dummy/db/test.sqlite3 +0 -0
@@ -12,4 +12,8 @@ describe Maestrano::Connector::Rails::External do
12
12
 
13
13
  it { expect(subject.get_client(organization)).to eql(nil) }
14
14
  end
15
+
16
+ describe 'entities_list' do
17
+ it { expect(subject.entities_list).to eql(%w(entity1 entity2))}
18
+ end
15
19
  end
@@ -5,6 +5,7 @@ describe Maestrano::Connector::Rails::Organization do
5
5
  # Attributes
6
6
  it { should validate_presence_of(:name) }
7
7
  it { should validate_presence_of(:tenant) }
8
+ it { should validate_uniqueness_of(:uid) }
8
9
  it { should serialize(:synchronized_entities) }
9
10
 
10
11
  # Indexes
@@ -20,7 +21,7 @@ describe Maestrano::Connector::Rails::Organization do
20
21
  subject { Maestrano::Connector::Rails::Organization.new }
21
22
 
22
23
  it 'initializes the synchronized entities' do
23
- entities_list = Maestrano::Connector::Rails::Entity.entities_list
24
+ entities_list = Maestrano::Connector::Rails::External.entities_list
24
25
  expect(subject.synchronized_entities).to include(entities_list.first.to_sym)
25
26
  expect(subject.synchronized_entities).to include(entities_list.last.to_sym)
26
27
  end
@@ -68,54 +68,16 @@ describe Maestrano::Connector::Rails::SubEntityBase do
68
68
  end
69
69
  end
70
70
 
71
- describe 'create_idmap_from_external_entity' do
72
- let(:organization) { create(:organization) }
73
- let(:bool) { true }
74
- before {
75
- allow(Maestrano::Connector::Rails::SubEntityBase).to receive(:external?).and_return(bool)
76
- allow(Maestrano::Connector::Rails::SubEntityBase).to receive(:entity_name).and_return('Name')
77
- allow(Maestrano::Connector::Rails::SubEntityBase).to receive(:id_from_external_entity_hash).and_return('id')
78
- allow(Maestrano::Connector::Rails::SubEntityBase).to receive(:object_name_from_external_entity_hash).and_return('object name')
79
- }
80
-
81
- context 'when external' do
82
- it {
83
- expect(Maestrano::Connector::Rails::IdMap).to receive(:create).with({:external_entity=>"name", :external_id=>"id", :name=>"object name", :connec_entity=>"lala", :organization_id=>1})
84
- subject.create_idmap_from_external_entity({}, 'lala', organization)
85
- }
86
- end
87
- context 'when not external' do
88
- let(:bool) { false }
89
- it { expect{ subject.create_idmap_from_external_entity({}, '', organization) }.to raise_error('Forbidden call: cannot call create_idmap_from_external_entity for a connec entity') }
90
- end
91
- end
92
-
93
- describe 'create_idmap_from_connec_entity' do
94
- let(:organization) { create(:organization) }
95
- let(:bool) { true }
96
- before {
97
- allow(Maestrano::Connector::Rails::SubEntityBase).to receive(:external?).and_return(bool)
98
- allow(Maestrano::Connector::Rails::SubEntityBase).to receive(:entity_name).and_return('Name')
99
- allow(Maestrano::Connector::Rails::SubEntityBase).to receive(:object_name_from_connec_entity_hash).and_return('object name')
100
- }
101
-
102
- context 'when external' do
103
- it { expect{ subject.create_idmap_from_connec_entity({}, '', organization) }.to raise_error('Forbidden call: cannot call create_idmap_from_connec_entity for an external entity') }
104
- end
105
- context 'when not external' do
106
- let(:bool) { false }
107
- it {
108
- expect(Maestrano::Connector::Rails::IdMap).to receive(:create).with({:connec_entity=>"name", :connec_id=>"lili", :name=>"object name", :external_entity=>"lala", :organization_id=>1})
109
- subject.create_idmap_from_connec_entity({'id' => 'lili'}, 'lala', organization)
110
- }
111
- end
112
- end
113
-
114
71
  it { expect(subject.mapper_classes).to eql({}) }
115
72
  end
116
73
 
117
74
  describe 'instance methods' do
118
- subject { Maestrano::Connector::Rails::SubEntityBase.new }
75
+ let!(:organization) { create(:organization, uid: 'cld-123') }
76
+ let!(:connec_client) { Maestrano::Connec::Client[organization.tenant].new(organization.uid) }
77
+ let!(:external_client) { Object.new }
78
+ let(:opts) { {} }
79
+ subject { Maestrano::Connector::Rails::Entity.new(organization, connec_client, external_client, opts) }
80
+ subject { Maestrano::Connector::Rails::SubEntityBase.new(organization, connec_client, external_client, opts) }
119
81
 
120
82
  describe 'map_to' do
121
83
  before {
@@ -125,30 +87,37 @@ describe Maestrano::Connector::Rails::SubEntityBase do
125
87
  allow(subject.class).to receive(:mapper_classes).and_return('Name' => AMapper)
126
88
  }
127
89
 
90
+ describe 'failure' do
91
+ it { expect{ subject.map_to('Not an entity', {}) }.to raise_error(RuntimeError) }
92
+ end
93
+
128
94
  context 'when external' do
129
95
  before {
130
96
  allow(subject.class).to receive(:external?).and_return(true)
97
+ allow(subject.class).to receive(:id_from_external_entity_hash).and_return('this id')
131
98
  }
132
99
 
133
100
  it 'calls the mapper denormalize' do
134
101
  expect(AMapper).to receive(:denormalize).and_return({})
135
- subject.map_to('Name', {}, nil)
102
+ subject.map_to('Name', {})
136
103
  end
137
104
 
138
- context 'with references' do
139
- let!(:organization) { create(:organization) }
140
- let!(:idmap) { create(:idmap, organization: organization) }
141
- before {
142
- clazz = Maestrano::Connector::Rails::Entity
143
- allow(clazz).to receive(:find_idmap).and_return(idmap)
144
- allow(subject.class).to receive(:references).and_return({'Name' => [{reference_class: clazz, connec_field: 'organization_id', external_field: 'contact_id'}]})
145
- }
146
-
147
- it 'returns the mapped entity with its references' do
148
- expect(subject.map_to('Name', {'contact_id' => idmap.external_id}, organization)).to eql({organization_id: idmap.connec_id})
105
+ it 'calls for reference folding' do
106
+ refs = %w(organization_id person_id)
107
+ allow(subject.class).to receive(:references).and_return({'Name' => refs})
108
+ expect(Maestrano::Connector::Rails::ConnecHelper).to receive(:fold_references).with({id: 'this id'}, refs, organization)
109
+ subject.map_to('Name', {})
110
+ end
111
+
112
+ context 'when no refs' do
113
+ it 'calls for reference folding' do
114
+ allow(subject.class).to receive(:references).and_return({})
115
+ expect(Maestrano::Connector::Rails::ConnecHelper).to receive(:fold_references).with({id: 'this id'}, [], organization)
116
+ subject.map_to('Name', {})
149
117
  end
150
118
  end
151
119
  end
120
+
152
121
  context 'when not external' do
153
122
  before {
154
123
  allow(subject.class).to receive(:external?).and_return(false)
@@ -156,21 +125,11 @@ describe Maestrano::Connector::Rails::SubEntityBase do
156
125
 
157
126
  it 'calls the mapper normalize' do
158
127
  expect(AMapper).to receive(:normalize).and_return({})
159
- subject.map_to('Name', {}, nil)
128
+ subject.map_to('Name', {})
160
129
  end
161
130
 
162
- context 'with references' do
163
- let!(:organization) { create(:organization) }
164
- let!(:idmap) { create(:idmap, organization: organization) }
165
- before {
166
- clazz = Maestrano::Connector::Rails::Entity
167
- allow(clazz).to receive(:find_idmap).and_return(idmap)
168
- allow(subject.class).to receive(:references).and_return({'Name' => [{reference_class: clazz, connec_field: 'organization_id', external_field: 'contact_id'}]})
169
- }
170
-
171
- it 'returns the mapped entity with its references' do
172
- expect(subject.map_to('Name', {'organization_id' => idmap.connec_id}, organization)).to eql({contact_id: idmap.external_id})
173
- end
131
+ it 'preserve the __connec_id' do
132
+ expect(subject.map_to('Name', {__connec_id: 'connec id'})).to eql({__connec_id: 'connec id'}.with_indifferent_access)
174
133
  end
175
134
  end
176
135
  end
@@ -3,10 +3,12 @@ FactoryGirl.define do
3
3
  factory :organization, class: Maestrano::Connector::Rails::Organization do
4
4
  name "My company"
5
5
  tenant "default"
6
+ sequence(:uid) { |n| "cld-11#{n}" }
7
+ oauth_uid 'sfuiy765'
8
+ oauth_provider 'this_app'
6
9
  end
7
10
 
8
11
  factory :idmap, class: Maestrano::Connector::Rails::IdMap do
9
- connec_id '6798-ada6-te43'
10
12
  connec_entity 'person'
11
13
  external_id '4567ada66'
12
14
  external_entity 'contact'
@@ -31,19 +31,6 @@ add_source 'https://rubygems.org'
31
31
 
32
32
  if yes?("Use JRuby? [y/n]")
33
33
  run 'echo "ruby \'2.2.3\', :engine => \'jruby\', :engine_version => \'9.0.5.0\'" | cat - Gemfile > temp && mv temp Gemfile'
34
- gem_group :production, :uat do
35
- gem 'activerecord-jdbcpostgresql-adapter'
36
- gem 'rails_12factor'
37
- end
38
- gem_group :test, :develpment do
39
- gem 'activerecord-jdbcsqlite3-adapter'
40
- end
41
- else
42
- gem 'sqlite3'
43
-
44
- gem_group :production, :uat do
45
- gem 'rails_12factor'
46
- end
47
34
  end
48
35
 
49
36
  gem 'haml-rails'
@@ -60,6 +47,7 @@ gem 'uglifier', '>= 1.3.0'
60
47
 
61
48
  gem 'maestrano-connector-rails'
62
49
  gem 'config'
50
+ # gem 'attr_encrypted', '~> 3.0.0'
63
51
 
64
52
  # Background jobs
65
53
  gem 'sinatra', :require => nil
@@ -67,6 +55,16 @@ gem 'sidekiq'
67
55
  gem 'sidekiq-cron'
68
56
  gem 'slim'
69
57
 
58
+ gem_group :production, :uat do
59
+ gem 'activerecord-jdbcpostgresql-adapter', :platforms => :jruby
60
+ gem 'pg', :platforms => :ruby
61
+ gem 'rails_12factor'
62
+ end
63
+
64
+ gem_group :test, :develpment do
65
+ gem 'activerecord-jdbcsqlite3-adapter', :platforms => :jruby
66
+ gem 'sqlite3', :platforms => :ruby
67
+ end
70
68
 
71
69
  gem_group :test do
72
70
  gem 'simplecov'
@@ -24,6 +24,7 @@
24
24
  # on http://api-sandbox.maestrano.io
25
25
  #
26
26
  config.api.host = Settings[tenant][:api_host]
27
+ config.connec.host = Settings[tenant][:connec_host]
27
28
  config.api.id = ENV[Settings[tenant][:api_id]]
28
29
  config.api.key = ENV[Settings[tenant][:api_key]]
29
30
 
@@ -129,7 +130,7 @@
129
130
  config.webhook.account.group_users_path = Settings[tenant][:webhook][:account][:group_users_path]
130
131
 
131
132
  config.webhook.connec.notifications_path = Settings[tenant][:webhook][:connec][:notifications_path]
132
-
133
+ config.webhook.connec.external_ids = true
133
134
  #
134
135
  # == Subscriptions
135
136
  # This is the list of entities (organizations,people,invoices etc.) for which you want to be
@@ -1,9 +1,11 @@
1
1
  app_host: 'http://localhost:3001/'
2
2
 
3
+ # encryption_key: 'This is a key that is 256 bits!!'
4
+
3
5
  default:
4
- environment: 'production'
5
6
  api_host: 'https://maestrano.com'
7
+ connec_host: 'https://api-connec.maestrano.com'
6
8
 
7
9
  maestrano-uat:
8
- environment: 'uat'
9
10
  api_host: 'https://uat.maestrano.io'
11
+ connec_host: 'https://api-connec-uat.maestrano.io'
@@ -1,11 +1 @@
1
- app_host: 'https://connector-xxx.herokuapp.com/'
2
-
3
-
4
- default:
5
- environment: 'production'
6
- api_host: 'https://maestrano.com'
7
-
8
- maestrano-uat:
9
- environment: 'uat'
10
- api_host: 'https://uat.maestrano.io'
11
-
1
+ app_host: 'https://connector-xxx.herokuapp.com/'
@@ -1,11 +1,16 @@
1
+ # encryption_key: <%= ENV['encryption_key'] %>
2
+
1
3
  # tenant config
2
4
  default:
5
+ environment: 'production'
3
6
  x509_certificate: "-----BEGIN CERTIFICATE-----\nMIIDezCCAuSgAwIBAgIJAPFpcH2rW0pyMA0GCSqGSIb3DQEBBQUAMIGGMQswCQYD\nVQQGEwJBVTEMMAoGA1UECBMDTlNXMQ8wDQYDVQQHEwZTeWRuZXkxGjAYBgNVBAoT\nEU1hZXN0cmFubyBQdHkgTHRkMRYwFAYDVQQDEw1tYWVzdHJhbm8uY29tMSQwIgYJ\nKoZIhvcNAQkBFhVzdXBwb3J0QG1hZXN0cmFuby5jb20wHhcNMTQwMTA0MDUyNDEw\nWhcNMzMxMjMwMDUyNDEwWjCBhjELMAkGA1UEBhMCQVUxDDAKBgNVBAgTA05TVzEP\nMA0GA1UEBxMGU3lkbmV5MRowGAYDVQQKExFNYWVzdHJhbm8gUHR5IEx0ZDEWMBQG\nA1UEAxMNbWFlc3RyYW5vLmNvbTEkMCIGCSqGSIb3DQEJARYVc3VwcG9ydEBtYWVz\ndHJhbm8uY29tMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQD3feNNn2xfEz5/\nQvkBIu2keh9NNhobpre8U4r1qC7h7OeInTldmxGL4cLHw4ZAqKbJVrlFWqNevM5V\nZBkDe4mjuVkK6rYK1ZK7eVk59BicRksVKRmdhXbANk/C5sESUsQv1wLZyrF5Iq8m\na9Oy4oYrIsEF2uHzCouTKM5n+O4DkwIDAQABo4HuMIHrMB0GA1UdDgQWBBSd/X0L\n/Pq+ZkHvItMtLnxMCAMdhjCBuwYDVR0jBIGzMIGwgBSd/X0L/Pq+ZkHvItMtLnxM\nCAMdhqGBjKSBiTCBhjELMAkGA1UEBhMCQVUxDDAKBgNVBAgTA05TVzEPMA0GA1UE\nBxMGU3lkbmV5MRowGAYDVQQKExFNYWVzdHJhbm8gUHR5IEx0ZDEWMBQGA1UEAxMN\nbWFlc3RyYW5vLmNvbTEkMCIGCSqGSIb3DQEJARYVc3VwcG9ydEBtYWVzdHJhbm8u\nY29tggkA8WlwfatbSnIwDAYDVR0TBAUwAwEB/zANBgkqhkiG9w0BAQUFAAOBgQDE\nhe/18oRh8EqIhOl0bPk6BG49AkjhZZezrRJkCFp4dZxaBjwZTddwo8O5KHwkFGdy\nyLiPV326dtvXoKa9RFJvoJiSTQLEn5mO1NzWYnBMLtrDWojOe6Ltvn3x0HVo/iHh\nJShjAn6ZYX43Tjl1YXDd1H9O+7/VgEWAQQ32v8p5lA==\n-----END CERTIFICATE-----"
4
7
  x509_fingerprint: '2f:57:71:e4:40:19:57:37:a6:2c:f0:c5:82:52:2f:2e:41:b7:9d:7e'
5
8
  api_id: 'connec_api_id'
6
9
  api_key: 'connec_api_key'
7
10
  sso_init_path: '/maestrano/auth/saml/init/default'
8
11
  sso_consume_path: '/maestrano/auth/saml/consume/default'
12
+ api_host: 'https://maestrano.com'
13
+ connec_host: 'https://api-connec.maestrano.com'
9
14
  webhook:
10
15
  account:
11
16
  groups_path: '/maestrano/account/groups/:id/default'
@@ -14,12 +19,15 @@ default:
14
19
  notifications_path: '/maestrano/connec/notifications/default'
15
20
 
16
21
  maestrano-uat:
22
+ environment: 'uat'
17
23
  x509_certificate: "-----BEGIN CERTIFICATE-----\nMIIDezCCAuSgAwIBAgIJAMzy+weDPp7qMA0GCSqGSIb3DQEBBQUAMIGGMQswCQYD\nVQQGEwJBVTEMMAoGA1UECBMDTlNXMQ8wDQYDVQQHEwZTeWRuZXkxGjAYBgNVBAoT\nEU1hZXN0cmFubyBQdHkgTHRkMRYwFAYDVQQDEw1tYWVzdHJhbm8uY29tMSQwIgYJ\nKoZIhvcNAQkBFhVzdXBwb3J0QG1hZXN0cmFuby5jb20wHhcNMTQwMTA0MDUyMzE0\nWhcNMzMxMjMwMDUyMzE0WjCBhjELMAkGA1UEBhMCQVUxDDAKBgNVBAgTA05TVzEP\nMA0GA1UEBxMGU3lkbmV5MRowGAYDVQQKExFNYWVzdHJhbm8gUHR5IEx0ZDEWMBQG\nA1UEAxMNbWFlc3RyYW5vLmNvbTEkMCIGCSqGSIb3DQEJARYVc3VwcG9ydEBtYWVz\ndHJhbm8uY29tMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQC+2uyQeAOc/iro\nhCyT33RkkWfTGeJ8E/mu9F5ORWoCZ/h2J+QDuzuc69Rf1LoO4wZVQ8LBeWOqMBYz\notYFUIPlPfIBXDNL/stHkpg28WLDpoJM+46WpTAgp89YKgwdAoYODHiUOcO/uXOO\n2i9Ekoa+kxbvBzDJf7uuR/io6GERXwIDAQABo4HuMIHrMB0GA1UdDgQWBBTGRDBT\nie5+fHkB0+SZ5g3WY/D2RTCBuwYDVR0jBIGzMIGwgBTGRDBTie5+fHkB0+SZ5g3W\nY/D2RaGBjKSBiTCBhjELMAkGA1UEBhMCQVUxDDAKBgNVBAgTA05TVzEPMA0GA1UE\nBxMGU3lkbmV5MRowGAYDVQQKExFNYWVzdHJhbm8gUHR5IEx0ZDEWMBQGA1UEAxMN\nbWFlc3RyYW5vLmNvbTEkMCIGCSqGSIb3DQEJARYVc3VwcG9ydEBtYWVzdHJhbm8u\nY29tggkAzPL7B4M+nuowDAYDVR0TBAUwAwEB/zANBgkqhkiG9w0BAQUFAAOBgQAw\nRxg3rZrML//xbsS3FFXguzXiiNQAvA4KrMWhGh3jVrtzAlN1/okFNy6zuN8gzdKD\nYw2n0c/u3cSpUutIVZOkwQuPCMC1hoP7Ilat6icVewNcHayLBxKgRxpBhr5Sc4av\n3HOW5Bi/eyC7IjeBTbTnpziApEC7uUsBou2rlKmTGw==\n-----END CERTIFICATE-----"
18
24
  x509_fingerprint: '8a:1e:2e:76:c4:67:80:68:6c:81:18:f7:d3:29:5d:77:f8:79:54:2f'
19
25
  api_id: 'maestrano_uat_connec_api_id'
20
26
  api_key: 'maestrano_uat_connec_api_key'
21
27
  sso_consume_path: '/maestrano/auth/saml/consume/maestrano-uat'
22
28
  sso_init_path: '/maestrano/auth/saml/init/maestrano-uat'
29
+ api_host: 'https://uat.maestrano.io'
30
+ connec_host: 'https://api-connec-uat.maestrano.io'
23
31
  webhook:
24
32
  account:
25
33
  groups_path: '/maestrano/account/groups/:id/maestrano-uat'
@@ -1,5 +1,7 @@
1
1
  app_host: 'http://localhost:3001/'
2
2
 
3
+ # encryption_key: 'This is a key that is 256 bits!!'
4
+
3
5
  default:
4
6
  environment: 'local'
5
7
  api_host: 'http://localhost:3000'
@@ -1,9 +1 @@
1
- app_host: 'https://connector-xxx-uat.herokuapp.com/'
2
-
3
- default:
4
- environment: 'production'
5
- api_host: 'https://maestrano.com'
6
-
7
- maestrano-uat:
8
- environment: 'uat'
9
- api_host: 'https://uat.maestrano.io'
1
+ app_host: 'https://connector-xxx-uat.herokuapp.com/'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: maestrano-connector-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.4
4
+ version: 1.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Pierre Berard
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-05-11 00:00:00.000000000 Z
11
+ date: 2016-05-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: maestrano-rails
@@ -233,7 +233,6 @@ files:
233
233
  - ".rspec"
234
234
  - DEVELOPER.md
235
235
  - Gemfile
236
- - Gemfile.lock
237
236
  - LICENSE
238
237
  - README.md
239
238
  - Rakefile
@@ -250,10 +249,12 @@ files:
250
249
  - app/jobs/maestrano/connector/rails/synchronization_job.rb
251
250
  - app/models/maestrano/connector/rails/complex_entity.rb
252
251
  - app/models/maestrano/connector/rails/concerns/complex_entity.rb
252
+ - app/models/maestrano/connector/rails/concerns/connec_helper.rb
253
253
  - app/models/maestrano/connector/rails/concerns/connector_logger.rb
254
254
  - app/models/maestrano/connector/rails/concerns/entity.rb
255
255
  - app/models/maestrano/connector/rails/concerns/external.rb
256
256
  - app/models/maestrano/connector/rails/concerns/sub_entity_base.rb
257
+ - app/models/maestrano/connector/rails/connec_helper.rb
257
258
  - app/models/maestrano/connector/rails/connector_logger.rb
258
259
  - app/models/maestrano/connector/rails/entity.rb
259
260
  - app/models/maestrano/connector/rails/external.rb
@@ -265,6 +266,7 @@ files:
265
266
  - app/models/maestrano/connector/rails/user_organization_rel.rb
266
267
  - bin/rails
267
268
  - config/routes.rb
269
+ - db/20160524112054_add_encryption_on_oauth_keys.rb
268
270
  - db/migrate/20151122162100_create_users.rb
269
271
  - db/migrate/20151122162414_create_organizations.rb
270
272
  - db/migrate/20151122162613_create_user_organization_rels.rb
@@ -284,6 +286,7 @@ files:
284
286
  - lib/generators/connector/templates/complex_entity_example/person.rb
285
287
  - lib/generators/connector/templates/entity.rb
286
288
  - lib/generators/connector/templates/example_entity.rb
289
+ - lib/generators/connector/templates/example_entity_spec.rb
287
290
  - lib/generators/connector/templates/external.rb
288
291
  - lib/generators/connector/templates/home_controller.rb
289
292
  - lib/generators/connector/templates/home_controller_spec.rb
@@ -305,7 +308,7 @@ files:
305
308
  - lib/maestrano/connector/rails.rb
306
309
  - maestrano-connector-rails.gemspec
307
310
  - maestrano.png
308
- - realse_notes.md
311
+ - release_notes.md
309
312
  - spec/controllers/connec_controller_spec.rb
310
313
  - spec/controllers/group_users_controller_spec.rb
311
314
  - spec/controllers/groups_controller_spec.rb
@@ -326,7 +329,6 @@ files:
326
329
  - spec/dummy/app/models/entities/example_entitiy.rb
327
330
  - spec/dummy/app/models/maestrano/connector/rails/entity.rb
328
331
  - spec/dummy/app/models/maestrano/connector/rails/external.rb
329
- - spec/dummy/app/views/admin/index.html.erb
330
332
  - spec/dummy/app/views/home/index.html.erb
331
333
  - spec/dummy/app/views/layouts/application.html.erb
332
334
  - spec/dummy/bin/bundle
@@ -353,9 +355,7 @@ files:
353
355
  - spec/dummy/config/locales/en.yml
354
356
  - spec/dummy/config/routes.rb
355
357
  - spec/dummy/config/secrets.yml
356
- - spec/dummy/db/development.sqlite3
357
358
  - spec/dummy/db/schema.rb
358
- - spec/dummy/db/test.sqlite3
359
359
  - spec/dummy/lib/assets/.keep
360
360
  - spec/dummy/log/.keep
361
361
  - spec/dummy/public/404.html
@@ -363,10 +363,15 @@ files:
363
363
  - spec/dummy/public/500.html
364
364
  - spec/dummy/public/favicon.ico
365
365
  - spec/factories.rb
366
+ - spec/integration/connec_to_external_spec.rb
367
+ - spec/integration/external_to_connec_spec.rb
368
+ - spec/integration/integration_complex_spec.rb
369
+ - spec/integration/singleton_spec.rb
366
370
  - spec/jobs/all_synchronizations_job_spec.rb
367
371
  - spec/jobs/push_to_connec_job_spec.rb
368
372
  - spec/jobs/synchronization_job_spec.rb
369
373
  - spec/models/complex_entity_spec.rb
374
+ - spec/models/connec_helper_spec.rb
370
375
  - spec/models/connector_logger_spec.rb
371
376
  - spec/models/entity_spec.rb
372
377
  - spec/models/external_spec.rb
data/Gemfile.lock DELETED
@@ -1,256 +0,0 @@
1
- GEM
2
- remote: http://rubygems.org/
3
- specs:
4
- actionmailer (4.2.6)
5
- actionpack (= 4.2.6)
6
- actionview (= 4.2.6)
7
- activejob (= 4.2.6)
8
- mail (~> 2.5, >= 2.5.4)
9
- rails-dom-testing (~> 1.0, >= 1.0.5)
10
- actionpack (4.2.6)
11
- actionview (= 4.2.6)
12
- activesupport (= 4.2.6)
13
- rack (~> 1.6)
14
- rack-test (~> 0.6.2)
15
- rails-dom-testing (~> 1.0, >= 1.0.5)
16
- rails-html-sanitizer (~> 1.0, >= 1.0.2)
17
- actionview (4.2.6)
18
- activesupport (= 4.2.6)
19
- builder (~> 3.1)
20
- erubis (~> 2.7.0)
21
- rails-dom-testing (~> 1.0, >= 1.0.5)
22
- rails-html-sanitizer (~> 1.0, >= 1.0.2)
23
- activejob (4.2.6)
24
- activesupport (= 4.2.6)
25
- globalid (>= 0.3.0)
26
- activemodel (4.2.6)
27
- activesupport (= 4.2.6)
28
- builder (~> 3.1)
29
- activerecord (4.2.6)
30
- activemodel (= 4.2.6)
31
- activesupport (= 4.2.6)
32
- arel (~> 6.0)
33
- activesupport (4.2.6)
34
- i18n (~> 0.7)
35
- json (~> 1.7, >= 1.7.7)
36
- minitest (~> 5.1)
37
- thread_safe (~> 0.3, >= 0.3.4)
38
- tzinfo (~> 1.1)
39
- addressable (2.4.0)
40
- arel (6.0.3)
41
- autoprefixer-rails (6.3.6)
42
- execjs
43
- bootstrap-sass (3.3.6)
44
- autoprefixer-rails (>= 5.2.1)
45
- sass (>= 3.3.4)
46
- builder (3.2.2)
47
- concurrent-ruby (1.0.2)
48
- connection_pool (2.2.0)
49
- descendants_tracker (0.0.4)
50
- thread_safe (~> 0.3, >= 0.3.1)
51
- diff-lcs (1.2.5)
52
- docile (1.1.5)
53
- domain_name (0.5.20160310)
54
- unf (>= 0.0.5, < 1.0.0)
55
- erubis (2.7.0)
56
- execjs (2.6.0)
57
- factory_girl (4.7.0)
58
- activesupport (>= 3.0.0)
59
- factory_girl_rails (4.7.0)
60
- factory_girl (~> 4.7.0)
61
- railties (>= 3.0.0)
62
- faraday (0.9.2)
63
- multipart-post (>= 1.2, < 3)
64
- git (1.3.0)
65
- github_api (0.13.1)
66
- addressable (~> 2.4.0)
67
- descendants_tracker (~> 0.0.4)
68
- faraday (~> 0.8, < 0.10)
69
- hashie (>= 3.4)
70
- multi_json (>= 1.7.5, < 2.0)
71
- oauth2
72
- globalid (0.3.6)
73
- activesupport (>= 4.1.0)
74
- haml (4.0.7)
75
- tilt
76
- haml-rails (0.9.0)
77
- actionpack (>= 4.0.1)
78
- activesupport (>= 4.0.1)
79
- haml (>= 4.0.6, < 5.0)
80
- html2haml (>= 1.0.1)
81
- railties (>= 4.0.1)
82
- hash_mapper (0.2.1)
83
- activesupport (~> 4)
84
- hashie (3.4.4)
85
- highline (1.7.8)
86
- html2haml (2.0.0)
87
- erubis (~> 2.7.0)
88
- haml (~> 4.0.0)
89
- nokogiri (~> 1.6.0)
90
- ruby_parser (~> 3.5)
91
- http-cookie (1.0.2)
92
- domain_name (~> 0.5)
93
- httparty (0.13.7)
94
- json (~> 1.8)
95
- multi_xml (>= 0.5.2)
96
- i18n (0.7.0)
97
- jeweler (2.0.1)
98
- builder
99
- bundler (>= 1.0)
100
- git (>= 1.2.5)
101
- github_api
102
- highline (>= 1.6.15)
103
- nokogiri (>= 1.5.10)
104
- rake
105
- rdoc
106
- jquery-rails (4.1.1)
107
- rails-dom-testing (>= 1, < 3)
108
- railties (>= 4.2.0)
109
- thor (>= 0.14, < 2.0)
110
- json (1.8.3)
111
- jwt (1.5.1)
112
- loofah (2.0.3)
113
- nokogiri (>= 1.5.9)
114
- macaddr (1.7.1)
115
- systemu (~> 2.6.2)
116
- maestrano (0.12.4)
117
- httparty (~> 0.13)
118
- json (~> 1.8)
119
- mime-types (~> 1.25)
120
- nokogiri (>= 1.5.0)
121
- rest-client (~> 1.4)
122
- uuid (~> 2.3)
123
- maestrano-rails (0.15.2)
124
- jquery-rails
125
- maestrano
126
- rails
127
- mail (2.6.4)
128
- mime-types (>= 1.16, < 4)
129
- mime-types (1.25.1)
130
- mini_portile2 (2.0.0)
131
- minitest (5.8.4)
132
- multi_json (1.12.0)
133
- multi_xml (0.5.5)
134
- multipart-post (2.0.0)
135
- netrc (0.11.0)
136
- nokogiri (1.6.7.2)
137
- mini_portile2 (~> 2.0.0.rc2)
138
- oauth2 (1.1.0)
139
- faraday (>= 0.8, < 0.10)
140
- jwt (~> 1.0, < 1.5.2)
141
- multi_json (~> 1.3)
142
- multi_xml (~> 0.5)
143
- rack (>= 1.2, < 3)
144
- rack (1.6.4)
145
- rack-test (0.6.3)
146
- rack (>= 1.0)
147
- rails (4.2.6)
148
- actionmailer (= 4.2.6)
149
- actionpack (= 4.2.6)
150
- actionview (= 4.2.6)
151
- activejob (= 4.2.6)
152
- activemodel (= 4.2.6)
153
- activerecord (= 4.2.6)
154
- activesupport (= 4.2.6)
155
- bundler (>= 1.3.0, < 2.0)
156
- railties (= 4.2.6)
157
- sprockets-rails
158
- rails-deprecated_sanitizer (1.0.3)
159
- activesupport (>= 4.2.0.alpha)
160
- rails-dom-testing (1.0.7)
161
- activesupport (>= 4.2.0.beta, < 5.0)
162
- nokogiri (~> 1.6.0)
163
- rails-deprecated_sanitizer (>= 1.0.1)
164
- rails-html-sanitizer (1.0.3)
165
- loofah (~> 2.0)
166
- railties (4.2.6)
167
- actionpack (= 4.2.6)
168
- activesupport (= 4.2.6)
169
- rake (>= 0.8.7)
170
- thor (>= 0.18.1, < 2.0)
171
- rake (11.1.2)
172
- rdoc (3.12.2)
173
- json (~> 1.4)
174
- redis (3.3.0)
175
- rest-client (1.8.0)
176
- http-cookie (>= 1.0.2, < 2.0)
177
- mime-types (>= 1.16, < 3.0)
178
- netrc (~> 0.7)
179
- rspec-core (3.4.4)
180
- rspec-support (~> 3.4.0)
181
- rspec-expectations (3.4.0)
182
- diff-lcs (>= 1.2.0, < 2.0)
183
- rspec-support (~> 3.4.0)
184
- rspec-mocks (3.4.1)
185
- diff-lcs (>= 1.2.0, < 2.0)
186
- rspec-support (~> 3.4.0)
187
- rspec-rails (3.4.2)
188
- actionpack (>= 3.0, < 4.3)
189
- activesupport (>= 3.0, < 4.3)
190
- railties (>= 3.0, < 4.3)
191
- rspec-core (~> 3.4.0)
192
- rspec-expectations (~> 3.4.0)
193
- rspec-mocks (~> 3.4.0)
194
- rspec-support (~> 3.4.0)
195
- rspec-support (3.4.1)
196
- ruby_parser (3.8.1)
197
- sexp_processor (~> 4.1)
198
- sass (3.4.22)
199
- sexp_processor (4.7.0)
200
- shoulda (3.5.0)
201
- shoulda-context (~> 1.0, >= 1.0.1)
202
- shoulda-matchers (>= 1.4.1, < 3.0)
203
- shoulda-context (1.2.1)
204
- shoulda-matchers (2.8.0)
205
- activesupport (>= 3.0.0)
206
- sidekiq (4.1.1)
207
- concurrent-ruby (~> 1.0)
208
- connection_pool (~> 2.2, >= 2.2.0)
209
- redis (~> 3.2, >= 3.2.1)
210
- simplecov (0.11.2)
211
- docile (~> 1.1.0)
212
- json (~> 1.8)
213
- simplecov-html (~> 0.10.0)
214
- simplecov-html (0.10.0)
215
- sprockets (3.6.0)
216
- concurrent-ruby (~> 1.0)
217
- rack (> 1, < 3)
218
- sprockets-rails (3.0.4)
219
- actionpack (>= 4.0)
220
- activesupport (>= 4.0)
221
- sprockets (>= 3.0.0)
222
- sqlite3 (1.3.11)
223
- systemu (2.6.5)
224
- thor (0.19.1)
225
- thread_safe (0.3.5)
226
- tilt (2.0.2)
227
- tzinfo (1.2.2)
228
- thread_safe (~> 0.1)
229
- unf (0.1.4)
230
- unf_ext
231
- unf_ext (0.0.7.2)
232
- uuid (2.3.8)
233
- macaddr (~> 1.0)
234
-
235
- PLATFORMS
236
- ruby
237
-
238
- DEPENDENCIES
239
- autoprefixer-rails
240
- bootstrap-sass
241
- bundler (~> 1.0)
242
- factory_girl_rails
243
- haml-rails
244
- hash_mapper
245
- jeweler (~> 2.0.1)
246
- maestrano-rails
247
- rdoc (~> 3.12)
248
- rspec-rails
249
- shoulda
250
- shoulda-matchers
251
- sidekiq
252
- simplecov
253
- sqlite3
254
-
255
- BUNDLED WITH
256
- 1.11.2