maestrano-connector-rails 2.0.0 → 2.0.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: 36e8c6a37e11c68b3ccd1826bf62ad1c0125e6d8
4
- data.tar.gz: 97c18f4676235c9e30582dcd9feddc47aad237f2
3
+ metadata.gz: f98ffd30f0c9e18fb5ad95d5a52849bba5e437d0
4
+ data.tar.gz: 9864988bffd82f6ce6d66aec534f5822b59c36db
5
5
  SHA512:
6
- metadata.gz: a2ca112ca802402e496fc20ed0457b3cc0296bd18847b2617d61dd82621526d9929abd9f4654a5e45a5a0536b2b41cfc7d975ee320e3fc761205ed17f04a23fe
7
- data.tar.gz: efdfbcbc6d52e7f84584b36af8078dc995370088766cbb9d026a28405851b01a6cb09a815f45357350982f60f63023e39b66af8bfcfb5a6ffd0a7709f5eaa79a
6
+ metadata.gz: 303ce74c7bd93ad0874971fd5faec32ffd2e65db3581a255725fde10a7db198471ef2f76ac6c340a14c8c08bc1276e59c640c86ca1385b3f5cccd492ec4dea8c
7
+ data.tar.gz: 9f369354a387999193b660096617465b41549acd6123e58ec4590cda4ade4ad7a10c74a552e061862bd5467fd92347c27fa84071d367ef8441b508de9bc06225
data/Gemfile CHANGED
@@ -3,36 +3,36 @@ source 'http://rubygems.org'
3
3
  # Add dependencies required to use your gem here.
4
4
  gem 'rails', '~> 4.2'
5
5
 
6
- gem 'maestrano-rails', '1.0.0'
6
+ gem 'maestrano-rails', '~> 1.0.0'
7
7
 
8
- gem 'hash_mapper', '>= 0.2.2'
9
- gem 'haml-rails'
10
- gem 'bootstrap-sass'
11
- gem 'autoprefixer-rails'
12
8
  gem 'attr_encrypted', '~> 1.4.0'
9
+ gem 'autoprefixer-rails'
10
+ gem 'bootstrap-sass'
13
11
  gem 'config'
14
12
  gem 'figaro'
13
+ gem 'haml-rails'
14
+ gem 'hash_mapper', '>= 0.2.2'
15
15
 
16
16
  gem 'sidekiq'
17
17
  # The missing unique jobs for sidekiq
18
+ gem 'sidekiq-cron'
18
19
  gem 'sidekiq-unique-jobs'
19
20
  gem 'sinatra', require: false
20
- gem 'sidekiq-cron'
21
21
  gem 'slim'
22
22
 
23
23
  # Add dependencies to develop your gem here.
24
24
  group :development do
25
- gem 'shoulda'
26
- gem 'rdoc'
25
+ gem 'activerecord-jdbcsqlite3-adapter', platforms: :jruby
27
26
  gem 'bundler'
27
+ gem 'factory_girl_rails'
28
+ gem 'github_changelog_generator'
28
29
  gem 'jeweler'
29
- gem 'simplecov', '>= 0'
30
+ gem 'rdoc'
30
31
  gem 'rspec-rails'
31
- gem 'factory_girl_rails'
32
- gem 'activerecord-jdbcsqlite3-adapter', platforms: :jruby
33
- gem 'sqlite3', platforms: :ruby
34
- gem 'shoulda-matchers'
35
32
  gem 'rubocop', '~> 0.43'
33
+ gem 'shoulda'
34
+ gem 'shoulda-matchers'
35
+ gem 'simplecov', '>= 0'
36
+ gem 'sqlite3', platforms: :ruby
36
37
  gem 'timecop'
37
- gem 'github_changelog_generator'
38
38
  end
data/VERSION CHANGED
@@ -1 +1 @@
1
- 2.0.0
1
+ 2.0.1
@@ -1,9 +1,12 @@
1
1
  class VersionController < ApplicationController
2
2
  def index
3
3
  framework_version = Gem.loaded_specs['maestrano-connector-rails'].version.version
4
+ branch = ENV['GIT_BRANCH']
5
+ commit = ENV['GIT_COMMIT_ID']
6
+
4
7
  respond_to do |format|
5
- format.html { render text: "framework_version=#{framework_version}\n" }
6
- format.json { render json: {framework_version: framework_version, env: Rails.env, ruby_version: RUBY_VERSION, ruby_engine: RUBY_ENGINE} }
8
+ format.html { render text: "framework_version=#{framework_version}\nci_branch=#{branch}\nci_commit=#{commit}\nenv=#{Rails}\nnv, ruby_version=#{RUBY_VERSION}\nruby_engine=#{RUBY_ENGINE}\n" }
9
+ format.json { render json: {framework_version: framework_version, ci_branch: branch, ci_commit: commit, env: Rails.env, ruby_version: RUBY_VERSION, ruby_engine: RUBY_ENGINE} }
7
10
  end
8
11
  end
9
12
  end
@@ -114,5 +114,11 @@ module Maestrano::Connector::Rails
114
114
  def last_synchronization_date
115
115
  last_successful_synchronization&.updated_at || date_filtering_limit
116
116
  end
117
+
118
+ def reset_synchronized_entities
119
+ synchronized_entities.slice!(*External.entities_list.map(&:to_sym))
120
+ External.entities_list.each { |entity| synchronized_entities[entity.to_sym] ||= false }
121
+ save
122
+ end
117
123
  end
118
124
  end
@@ -16,6 +16,7 @@ $text-color: #000
16
16
 
17
17
  $navbar-bg-color: #aaa
18
18
  $navbar-text-color: #fff
19
+ $navbar-links: #0066ff
19
20
 
20
21
  $navbar-link-hover: #ffa
21
22
 
@@ -2,19 +2,19 @@
2
2
  # DO NOT EDIT THIS FILE DIRECTLY
3
3
  # Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
4
4
  # -*- encoding: utf-8 -*-
5
- # stub: maestrano-connector-rails 2.0.0 ruby lib
5
+ # stub: maestrano-connector-rails 2.0.1 ruby lib
6
6
 
7
7
  Gem::Specification.new do |s|
8
- s.name = "maestrano-connector-rails"
9
- s.version = "2.0.0"
8
+ s.name = "maestrano-connector-rails".freeze
9
+ s.version = "2.0.1"
10
10
 
11
- s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
12
- s.require_paths = ["lib"]
13
- s.authors = ["Maestrano"]
14
- s.date = "2016-11-25"
15
- s.description = "Maestrano is the next generation marketplace for SME applications. See https://sme.maestrano.com for details."
16
- s.email = "developers@maestrano.com"
17
- s.executables = ["rails", "rake"]
11
+ s.required_rubygems_version = Gem::Requirement.new(">= 0".freeze) if s.respond_to? :required_rubygems_version=
12
+ s.require_paths = ["lib".freeze]
13
+ s.authors = ["Maestrano".freeze]
14
+ s.date = "2017-01-04"
15
+ s.description = "Maestrano is the next generation marketplace for SME applications. See https://sme.maestrano.com for details.".freeze
16
+ s.email = "developers@maestrano.com".freeze
17
+ s.executables = ["rails".freeze, "rake".freeze]
18
18
  s.extra_rdoc_files = [
19
19
  "LICENSE",
20
20
  "README.md"
@@ -217,99 +217,99 @@ Gem::Specification.new do |s|
217
217
  "template/sidekiq.yml",
218
218
  "template/spec_helper.rb"
219
219
  ]
220
- s.homepage = "http://github.com/maestrano/maestrano-connector-rails"
221
- s.licenses = ["MIT"]
222
- s.rubygems_version = "2.5.1"
223
- s.summary = "Rails framework to build connector with Maestrano"
220
+ s.homepage = "http://github.com/maestrano/maestrano-connector-rails".freeze
221
+ s.licenses = ["MIT".freeze]
222
+ s.rubygems_version = "2.6.8".freeze
223
+ s.summary = "Rails framework to build connector with Maestrano".freeze
224
224
 
225
225
  if s.respond_to? :specification_version then
226
226
  s.specification_version = 4
227
227
 
228
228
  if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
229
- s.add_runtime_dependency(%q<rails>, ["~> 4.2"])
230
- s.add_runtime_dependency(%q<maestrano-rails>, ["= 1.0.0"])
231
- s.add_runtime_dependency(%q<hash_mapper>, [">= 0.2.2"])
232
- s.add_runtime_dependency(%q<haml-rails>, [">= 0"])
233
- s.add_runtime_dependency(%q<bootstrap-sass>, [">= 0"])
234
- s.add_runtime_dependency(%q<autoprefixer-rails>, [">= 0"])
235
- s.add_runtime_dependency(%q<attr_encrypted>, ["~> 1.4.0"])
236
- s.add_runtime_dependency(%q<config>, [">= 0"])
237
- s.add_runtime_dependency(%q<figaro>, [">= 0"])
238
- s.add_runtime_dependency(%q<sidekiq>, [">= 0"])
239
- s.add_runtime_dependency(%q<sidekiq-unique-jobs>, [">= 0"])
240
- s.add_runtime_dependency(%q<sinatra>, [">= 0"])
241
- s.add_runtime_dependency(%q<sidekiq-cron>, [">= 0"])
242
- s.add_runtime_dependency(%q<slim>, [">= 0"])
243
- s.add_development_dependency(%q<shoulda>, [">= 0"])
244
- s.add_development_dependency(%q<rdoc>, [">= 0"])
245
- s.add_development_dependency(%q<bundler>, [">= 0"])
246
- s.add_development_dependency(%q<jeweler>, [">= 0"])
247
- s.add_development_dependency(%q<simplecov>, [">= 0"])
248
- s.add_development_dependency(%q<rspec-rails>, [">= 0"])
249
- s.add_development_dependency(%q<factory_girl_rails>, [">= 0"])
250
- s.add_development_dependency(%q<activerecord-jdbcsqlite3-adapter>, [">= 0"])
251
- s.add_development_dependency(%q<sqlite3>, [">= 0"])
252
- s.add_development_dependency(%q<shoulda-matchers>, [">= 0"])
253
- s.add_development_dependency(%q<rubocop>, ["~> 0.43"])
254
- s.add_development_dependency(%q<timecop>, [">= 0"])
255
- s.add_development_dependency(%q<github_changelog_generator>, [">= 0"])
229
+ s.add_runtime_dependency(%q<rails>.freeze, ["~> 4.2"])
230
+ s.add_runtime_dependency(%q<maestrano-rails>.freeze, ["~> 1.0.0"])
231
+ s.add_runtime_dependency(%q<attr_encrypted>.freeze, ["~> 1.4.0"])
232
+ s.add_runtime_dependency(%q<autoprefixer-rails>.freeze, [">= 0"])
233
+ s.add_runtime_dependency(%q<bootstrap-sass>.freeze, [">= 0"])
234
+ s.add_runtime_dependency(%q<config>.freeze, [">= 0"])
235
+ s.add_runtime_dependency(%q<figaro>.freeze, [">= 0"])
236
+ s.add_runtime_dependency(%q<haml-rails>.freeze, [">= 0"])
237
+ s.add_runtime_dependency(%q<hash_mapper>.freeze, [">= 0.2.2"])
238
+ s.add_runtime_dependency(%q<sidekiq>.freeze, [">= 0"])
239
+ s.add_runtime_dependency(%q<sidekiq-cron>.freeze, [">= 0"])
240
+ s.add_runtime_dependency(%q<sidekiq-unique-jobs>.freeze, [">= 0"])
241
+ s.add_runtime_dependency(%q<sinatra>.freeze, [">= 0"])
242
+ s.add_runtime_dependency(%q<slim>.freeze, [">= 0"])
243
+ s.add_development_dependency(%q<activerecord-jdbcsqlite3-adapter>.freeze, [">= 0"])
244
+ s.add_development_dependency(%q<bundler>.freeze, [">= 0"])
245
+ s.add_development_dependency(%q<factory_girl_rails>.freeze, [">= 0"])
246
+ s.add_development_dependency(%q<github_changelog_generator>.freeze, [">= 0"])
247
+ s.add_development_dependency(%q<jeweler>.freeze, [">= 0"])
248
+ s.add_development_dependency(%q<rdoc>.freeze, [">= 0"])
249
+ s.add_development_dependency(%q<rspec-rails>.freeze, [">= 0"])
250
+ s.add_development_dependency(%q<rubocop>.freeze, ["~> 0.43"])
251
+ s.add_development_dependency(%q<shoulda>.freeze, [">= 0"])
252
+ s.add_development_dependency(%q<shoulda-matchers>.freeze, [">= 0"])
253
+ s.add_development_dependency(%q<simplecov>.freeze, [">= 0"])
254
+ s.add_development_dependency(%q<sqlite3>.freeze, [">= 0"])
255
+ s.add_development_dependency(%q<timecop>.freeze, [">= 0"])
256
256
  else
257
- s.add_dependency(%q<rails>, ["~> 4.2"])
258
- s.add_dependency(%q<maestrano-rails>, ["= 1.0.0"])
259
- s.add_dependency(%q<hash_mapper>, [">= 0.2.2"])
260
- s.add_dependency(%q<haml-rails>, [">= 0"])
261
- s.add_dependency(%q<bootstrap-sass>, [">= 0"])
262
- s.add_dependency(%q<autoprefixer-rails>, [">= 0"])
263
- s.add_dependency(%q<attr_encrypted>, ["~> 1.4.0"])
264
- s.add_dependency(%q<config>, [">= 0"])
265
- s.add_dependency(%q<figaro>, [">= 0"])
266
- s.add_dependency(%q<sidekiq>, [">= 0"])
267
- s.add_dependency(%q<sidekiq-unique-jobs>, [">= 0"])
268
- s.add_dependency(%q<sinatra>, [">= 0"])
269
- s.add_dependency(%q<sidekiq-cron>, [">= 0"])
270
- s.add_dependency(%q<slim>, [">= 0"])
271
- s.add_dependency(%q<shoulda>, [">= 0"])
272
- s.add_dependency(%q<rdoc>, [">= 0"])
273
- s.add_dependency(%q<bundler>, [">= 0"])
274
- s.add_dependency(%q<jeweler>, [">= 0"])
275
- s.add_dependency(%q<simplecov>, [">= 0"])
276
- s.add_dependency(%q<rspec-rails>, [">= 0"])
277
- s.add_dependency(%q<factory_girl_rails>, [">= 0"])
278
- s.add_dependency(%q<activerecord-jdbcsqlite3-adapter>, [">= 0"])
279
- s.add_dependency(%q<sqlite3>, [">= 0"])
280
- s.add_dependency(%q<shoulda-matchers>, [">= 0"])
281
- s.add_dependency(%q<rubocop>, ["~> 0.43"])
282
- s.add_dependency(%q<timecop>, [">= 0"])
283
- s.add_dependency(%q<github_changelog_generator>, [">= 0"])
257
+ s.add_dependency(%q<rails>.freeze, ["~> 4.2"])
258
+ s.add_dependency(%q<maestrano-rails>.freeze, ["~> 1.0.0"])
259
+ s.add_dependency(%q<attr_encrypted>.freeze, ["~> 1.4.0"])
260
+ s.add_dependency(%q<autoprefixer-rails>.freeze, [">= 0"])
261
+ s.add_dependency(%q<bootstrap-sass>.freeze, [">= 0"])
262
+ s.add_dependency(%q<config>.freeze, [">= 0"])
263
+ s.add_dependency(%q<figaro>.freeze, [">= 0"])
264
+ s.add_dependency(%q<haml-rails>.freeze, [">= 0"])
265
+ s.add_dependency(%q<hash_mapper>.freeze, [">= 0.2.2"])
266
+ s.add_dependency(%q<sidekiq>.freeze, [">= 0"])
267
+ s.add_dependency(%q<sidekiq-cron>.freeze, [">= 0"])
268
+ s.add_dependency(%q<sidekiq-unique-jobs>.freeze, [">= 0"])
269
+ s.add_dependency(%q<sinatra>.freeze, [">= 0"])
270
+ s.add_dependency(%q<slim>.freeze, [">= 0"])
271
+ s.add_dependency(%q<activerecord-jdbcsqlite3-adapter>.freeze, [">= 0"])
272
+ s.add_dependency(%q<bundler>.freeze, [">= 0"])
273
+ s.add_dependency(%q<factory_girl_rails>.freeze, [">= 0"])
274
+ s.add_dependency(%q<github_changelog_generator>.freeze, [">= 0"])
275
+ s.add_dependency(%q<jeweler>.freeze, [">= 0"])
276
+ s.add_dependency(%q<rdoc>.freeze, [">= 0"])
277
+ s.add_dependency(%q<rspec-rails>.freeze, [">= 0"])
278
+ s.add_dependency(%q<rubocop>.freeze, ["~> 0.43"])
279
+ s.add_dependency(%q<shoulda>.freeze, [">= 0"])
280
+ s.add_dependency(%q<shoulda-matchers>.freeze, [">= 0"])
281
+ s.add_dependency(%q<simplecov>.freeze, [">= 0"])
282
+ s.add_dependency(%q<sqlite3>.freeze, [">= 0"])
283
+ s.add_dependency(%q<timecop>.freeze, [">= 0"])
284
284
  end
285
285
  else
286
- s.add_dependency(%q<rails>, ["~> 4.2"])
287
- s.add_dependency(%q<maestrano-rails>, ["= 1.0.0"])
288
- s.add_dependency(%q<hash_mapper>, [">= 0.2.2"])
289
- s.add_dependency(%q<haml-rails>, [">= 0"])
290
- s.add_dependency(%q<bootstrap-sass>, [">= 0"])
291
- s.add_dependency(%q<autoprefixer-rails>, [">= 0"])
292
- s.add_dependency(%q<attr_encrypted>, ["~> 1.4.0"])
293
- s.add_dependency(%q<config>, [">= 0"])
294
- s.add_dependency(%q<figaro>, [">= 0"])
295
- s.add_dependency(%q<sidekiq>, [">= 0"])
296
- s.add_dependency(%q<sidekiq-unique-jobs>, [">= 0"])
297
- s.add_dependency(%q<sinatra>, [">= 0"])
298
- s.add_dependency(%q<sidekiq-cron>, [">= 0"])
299
- s.add_dependency(%q<slim>, [">= 0"])
300
- s.add_dependency(%q<shoulda>, [">= 0"])
301
- s.add_dependency(%q<rdoc>, [">= 0"])
302
- s.add_dependency(%q<bundler>, [">= 0"])
303
- s.add_dependency(%q<jeweler>, [">= 0"])
304
- s.add_dependency(%q<simplecov>, [">= 0"])
305
- s.add_dependency(%q<rspec-rails>, [">= 0"])
306
- s.add_dependency(%q<factory_girl_rails>, [">= 0"])
307
- s.add_dependency(%q<activerecord-jdbcsqlite3-adapter>, [">= 0"])
308
- s.add_dependency(%q<sqlite3>, [">= 0"])
309
- s.add_dependency(%q<shoulda-matchers>, [">= 0"])
310
- s.add_dependency(%q<rubocop>, ["~> 0.43"])
311
- s.add_dependency(%q<timecop>, [">= 0"])
312
- s.add_dependency(%q<github_changelog_generator>, [">= 0"])
286
+ s.add_dependency(%q<rails>.freeze, ["~> 4.2"])
287
+ s.add_dependency(%q<maestrano-rails>.freeze, ["~> 1.0.0"])
288
+ s.add_dependency(%q<attr_encrypted>.freeze, ["~> 1.4.0"])
289
+ s.add_dependency(%q<autoprefixer-rails>.freeze, [">= 0"])
290
+ s.add_dependency(%q<bootstrap-sass>.freeze, [">= 0"])
291
+ s.add_dependency(%q<config>.freeze, [">= 0"])
292
+ s.add_dependency(%q<figaro>.freeze, [">= 0"])
293
+ s.add_dependency(%q<haml-rails>.freeze, [">= 0"])
294
+ s.add_dependency(%q<hash_mapper>.freeze, [">= 0.2.2"])
295
+ s.add_dependency(%q<sidekiq>.freeze, [">= 0"])
296
+ s.add_dependency(%q<sidekiq-cron>.freeze, [">= 0"])
297
+ s.add_dependency(%q<sidekiq-unique-jobs>.freeze, [">= 0"])
298
+ s.add_dependency(%q<sinatra>.freeze, [">= 0"])
299
+ s.add_dependency(%q<slim>.freeze, [">= 0"])
300
+ s.add_dependency(%q<activerecord-jdbcsqlite3-adapter>.freeze, [">= 0"])
301
+ s.add_dependency(%q<bundler>.freeze, [">= 0"])
302
+ s.add_dependency(%q<factory_girl_rails>.freeze, [">= 0"])
303
+ s.add_dependency(%q<github_changelog_generator>.freeze, [">= 0"])
304
+ s.add_dependency(%q<jeweler>.freeze, [">= 0"])
305
+ s.add_dependency(%q<rdoc>.freeze, [">= 0"])
306
+ s.add_dependency(%q<rspec-rails>.freeze, [">= 0"])
307
+ s.add_dependency(%q<rubocop>.freeze, ["~> 0.43"])
308
+ s.add_dependency(%q<shoulda>.freeze, [">= 0"])
309
+ s.add_dependency(%q<shoulda-matchers>.freeze, [">= 0"])
310
+ s.add_dependency(%q<simplecov>.freeze, [">= 0"])
311
+ s.add_dependency(%q<sqlite3>.freeze, [">= 0"])
312
+ s.add_dependency(%q<timecop>.freeze, [">= 0"])
313
313
  end
314
314
  end
315
315
 
@@ -1,6 +1,7 @@
1
1
  require 'spec_helper'
2
2
 
3
3
  describe Maestrano::SynchronizationsController, type: :controller do
4
+
4
5
  routes { Maestrano::Connector::Rails::Engine.routes }
5
6
 
6
7
  let(:uid) { 'cld-aaaa' }
@@ -11,7 +11,7 @@ describe VersionController, type: :controller do
11
11
 
12
12
  it 'returns a version hash' do
13
13
  subject
14
- expect(JSON.parse(response.body)).to eql('framework_version'=>'1.2', 'env' => 'test', 'ruby_version' => RUBY_VERSION, 'ruby_engine' => RUBY_ENGINE)
14
+ expect(JSON.parse(response.body)).to eql('framework_version'=>'1.2', 'ci_branch' => nil, 'ci_commit' => nil, 'env' => 'test', 'ruby_version' => RUBY_VERSION, 'ruby_engine' => RUBY_ENGINE)
15
15
  end
16
16
  end
17
17
  end
@@ -1,135 +1,2 @@
1
- Maestrano.configure do |config|
2
-
3
- # ==> Environment configuration
4
- # The environment to connect to.
5
- # If set to 'production' then all Single Sign-On (SSO) and API requests
6
- # will be made to maestrano.com
7
- # If set to 'test' then requests will be made to api-sandbox.maestrano.io
8
- # The api-sandbox allows you to easily test integration scenarios.
9
- # More details on http://api-sandbox.maestrano.io
10
- #
11
- config.environment = 'test' # or 'production'
12
-
13
- # ==> Application host
14
- # This is your application host (e.g: my-app.com) which is ultimately
15
- # used to redirect users to the right SAML url during SSO handshake.
16
- #
17
- config.app.host = (config.environment == 'production' ? 'https://my-app.com' : 'http://localhost:3000')
18
-
19
- # ==> App ID & API key
20
- # Your application App ID and API key which you can retrieve on http://maestrano.com
21
- # via your cloud partner dashboard.
22
- # For testing you can retrieve/generate an api.id and api.key from the API Sandbox directly
23
- # on http://api-sandbox.maestrano.io
24
- #
25
- config.api.id = (config.environment == 'production' ? 'prod_app_id' : 'sandbox_app_id')
26
- config.api.key = (config.environment == 'production' ? 'prod_api_key' : 'sandbox_api_key')
27
-
28
- # ==> Single Sign-On activation
29
- # Enable/Disable single sign-on. When troubleshooting authentication issues
30
- # you might want to disable SSO temporarily
31
- #
32
- # config.sso.enabled = true
33
-
34
- # ==> Single Sign-On Identity Manager
35
- # By default we consider that the domain managing user identification
36
- # is the same as your application host (see above config.app.host parameter)
37
- # If you have a dedicated domain managing user identification and therefore
38
- # responsible for the single sign-on handshake (e.g: https://idp.my-app.com)
39
- # then you can specify it below
40
- #
41
- # config.sso.idm = (config.environment == 'production' ? 'https://idp.my-app.com' : 'http://localhost:3000')
42
-
43
- # ==> SSO Initialization endpoint
44
- # This is your application path to the SAML endpoint that allows users to
45
- # initialize SSO authentication. Upon reaching this endpoint users your
46
- # application will automatically create a SAML request and redirect the user
47
- # to Maestrano. Maestrano will then authenticate and authorize the user. Upon
48
- # authorization the user gets redirected to your application consumer endpoint
49
- # (see below) for initial setup and/or login.
50
- #
51
- # The controller for this path is automatically
52
- # generated when you run 'rake maestrano:install' and is available at
53
- # <rails_root>/app/controllers/maestrano/auth/saml.rb
54
- #
55
- # config.sso.init_path = '/maestrano/auth/saml/init'
56
-
57
- # ==> SSO Consumer endpoint
58
- # This is your application path to the SAML endpoint that allows users to
59
- # finalize SSO authentication. During the 'consume' action your application
60
- # sets users (and associated group) up and/or log them in.
61
- #
62
- # The controller for this path is automatically
63
- # generated when you run 'rake maestrano:install' and is available at
64
- # <rails_root>/app/controllers/maestrano/auth/saml.rb
65
- #
66
- # config.sso.consume_path = '/maestrano/auth/saml/consume'
67
-
68
- # ==> Single Logout activation
69
- # Enable/Disable single logout. When troubleshooting authentication issues
70
- # you might want to disable SLO temporarily.
71
- # If set to false then Maestrano::SSO::Session#valid? - which should be
72
- # used in a controller before filter to check user session - always return true
73
- #
74
- # config.sso.slo_enabled = true
75
-
76
- # ==> SSO User creation mode
77
- # !IMPORTANT
78
- # On Maestrano users can take several "instances" of your service. You can consider
79
- # each "instance" as 1) a billing entity and 2) a collaboration group (this is
80
- # equivalent to a 'customer account' in a commercial world). When users login to
81
- # your application via single sign-on they actually login via a specific group which
82
- # is then supposed to determine which data they have access to inside your application.
83
- #
84
- # E.g: John and Jack are part of group 1. They should see the same data when they login to
85
- # your application (employee info, analytics, sales etc..). John is also part of group 2
86
- # but not Jack. Therefore only John should be able to see the data belonging to group 2.
87
- #
88
- # In most application this is done via collaboration/sharing/permission groups which is
89
- # why a group is required to be created when a new user logs in via a new group (and
90
- # also for billing purpose - you charge a group, not a user directly).
91
- #
92
- # == mode: 'real'
93
- # In an ideal world a user should be able to belong to several groups in your application.
94
- # In this case you would set the 'sso.creation_mode' to 'real' which means that the uid
95
- # and email we pass to you are the actual user email and maestrano universal id.
96
- #
97
- # == mode: 'virtual'
98
- # Now let's say that due to technical constraints your application cannot authorize a user
99
- # to belong to several groups. Well next time John logs in via a different group there will
100
- # be a problem: the user already exists (based on uid or email) and cannot be assigned
101
- # to a second group. To fix this you can set the 'sso.creation_mode' to 'virtual'. In this
102
- # mode users get assigned a truly unique uid and email across groups. So next time John logs
103
- # in a whole new user account can be created for him without any validation problem. In this
104
- # mode the email we assign to him looks like "usr-sdf54.cld-45aa2@mail.maestrano.com". But don't
105
- # worry we take care of forwarding any email you would send to this address
106
- #
107
- # config.sso.creation_mode = 'real' # or 'virtual'
108
-
109
- # ==> Account Webhooks
110
- # Single sign on has been setup into your app and Maestrano users are now able
111
- # to use your service. Great! Wait what happens when a business (group) decides to
112
- # stop using your service? Also what happens when a user gets removed from a business?
113
- # Well the endpoints below are for Maestrano to be able to notify you of such
114
- # events.
115
- #
116
- # Even if the routes look restful we issue only issue DELETE requests for the moment
117
- # to notify you of any service cancellation (group deletion) or any user being
118
- # removed from a group.
119
- #
120
- # The controllers for these hooks path are automatically generated when
121
- # you run 'rake maestrano:install' and is available under
122
- # <rails_root>/app/controllers/maestrano/account/
123
- #
124
- # config.webhook.account.groups_path = '/maestrano/account/groups/:id',
125
- # config.webhook.account.group_users_path = '/maestrano/account/groups/:group_id/users/:id',
126
- end
127
-
128
- # Example of multi-tenant configuration
129
- Maestrano['other-tenant'].configure do |config|
130
- config.environment = 'test'
131
- config.app.host = (config.environment == 'production' ? 'https://my-app.com' : 'http://localhost:3000')
132
-
133
- config.api.id = (config.environment == 'production' ? 'prod_app_id' : 'sandbox_app_id')
134
- config.api.key = (config.environment == 'production' ? 'prod_api_key' : 'sandbox_api_key')
135
- end
1
+ Maestrano.auto_configure unless Rails.env.test?
2
+ Maestrano.configure { |config| config.environment = 'production' } if Rails.env.test?
@@ -16,14 +16,14 @@ describe Maestrano::Connector::Rails::ConnecHelper do
16
16
  end
17
17
 
18
18
  describe 'connec_version' do
19
- let!(:organization) { create(:organization, tenant: 'default') }
20
- let!(:organization2) { create(:organization, tenant: 'default2') }
19
+ let!(:organization) { create(:organization, tenant: 'production') }
20
+ let!(:organization2) { create(:organization, tenant: 'uat') }
21
21
  before {
22
- allow(Maestrano::Connec::Client).to receive(:get).and_return(ActionDispatch::Response.new(200, {}, {ci_build_number: '111', ci_branch: 'v1.1', ci_commit: '111'}.to_json, {}), ActionDispatch::Response.new(200, {}, {ci_build_number: '112', ci_branch: 'v1.2', ci_commit: '112'}.to_json, {}))
22
+ allow(Maestrano::Connec::Client['production']).to receive(:get).and_return(ActionDispatch::Response.new(200, {}, {ci_build_number: '111', ci_branch: 'v1.1', ci_commit: '111'}.to_json, {}), ActionDispatch::Response.new(200, {}, {ci_build_number: '112', ci_branch: 'v1.2', ci_commit: '112'}.to_json, {}))
23
23
  }
24
24
 
25
25
  it 'returns the connec_version' do
26
- expect(Maestrano::Connec::Client).to receive(:get).twice
26
+ expect(Maestrano::Connec::Client['production']).to receive(:get).twice
27
27
  expect(subject.connec_version(organization)).to eql('1.1')
28
28
  expect(subject.connec_version(organization2)).to eql('1.2')
29
29
  expect(subject.connec_version(organization)).to eql('1.1')
@@ -207,7 +207,22 @@ describe Maestrano::Connector::Rails::Organization do
207
207
  it { expect(subject.last_synchronization_date).to eql(nil) }
208
208
  end
209
209
  end
210
- end
211
210
 
211
+ describe '#reset_synchronized_entities' do
212
+ let(:organization) { create(:organization, synchronized_entities: {entity1: true, entity2: false, tomatoes: true}) }
213
+ subject { organization.reset_synchronized_entities }
214
+
215
+ it 'keeps only the known entities' do
216
+ subject
217
+ expect(organization.synchronized_entities).to eql(entity1: true, entity2: false)
218
+ end
219
+
220
+ it 'adds missing entities' do
221
+ organization.update_attributes(synchronized_entities: {entity1: true, tomatoes: true})
212
222
 
223
+ subject
224
+ expect(organization.synchronized_entities).to eql(entity1: true, entity2: false)
225
+ end
226
+ end
227
+ end
213
228
  end
@@ -6,7 +6,7 @@ SIDEKIQ_PASSWORD: password
6
6
 
7
7
  REDIS_URL: redis://localhost:6379/0/connector-myapp
8
8
 
9
- MNO_DEVPL_HOST: https://dev-platform.maestrano.io
9
+ MNO_DEVPL_HOST: https://developer.maestrano.com
10
10
  MNO_DEVPL_API_PATH: /api/config/v1/marketplaces
11
11
  MNO_DEVPL_ENV_NAME: connector-myapp
12
12
  MNO_DEVPL_ENV_KEY:
@@ -1,2 +1,2 @@
1
1
  Maestrano.auto_configure unless Rails.env.test?
2
- Maestrano.configure { |config| config.environment = 'test' } if Rails.env.test?
2
+ Maestrano.configure { |config| config.environment = 'production' } if Rails.env.test?
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: 2.0.0
4
+ version: 2.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Maestrano
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-11-25 00:00:00.000000000 Z
11
+ date: 2017-01-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -28,32 +28,32 @@ dependencies:
28
28
  name: maestrano-rails
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - '='
31
+ - - "~>"
32
32
  - !ruby/object:Gem::Version
33
33
  version: 1.0.0
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - '='
38
+ - - "~>"
39
39
  - !ruby/object:Gem::Version
40
40
  version: 1.0.0
41
41
  - !ruby/object:Gem::Dependency
42
- name: hash_mapper
42
+ name: attr_encrypted
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - ">="
45
+ - - "~>"
46
46
  - !ruby/object:Gem::Version
47
- version: 0.2.2
47
+ version: 1.4.0
48
48
  type: :runtime
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - ">="
52
+ - - "~>"
53
53
  - !ruby/object:Gem::Version
54
- version: 0.2.2
54
+ version: 1.4.0
55
55
  - !ruby/object:Gem::Dependency
56
- name: haml-rails
56
+ name: autoprefixer-rails
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
59
  - - ">="
@@ -81,7 +81,7 @@ dependencies:
81
81
  - !ruby/object:Gem::Version
82
82
  version: '0'
83
83
  - !ruby/object:Gem::Dependency
84
- name: autoprefixer-rails
84
+ name: config
85
85
  requirement: !ruby/object:Gem::Requirement
86
86
  requirements:
87
87
  - - ">="
@@ -95,21 +95,21 @@ dependencies:
95
95
  - !ruby/object:Gem::Version
96
96
  version: '0'
97
97
  - !ruby/object:Gem::Dependency
98
- name: attr_encrypted
98
+ name: figaro
99
99
  requirement: !ruby/object:Gem::Requirement
100
100
  requirements:
101
- - - "~>"
101
+ - - ">="
102
102
  - !ruby/object:Gem::Version
103
- version: 1.4.0
103
+ version: '0'
104
104
  type: :runtime
105
105
  prerelease: false
106
106
  version_requirements: !ruby/object:Gem::Requirement
107
107
  requirements:
108
- - - "~>"
108
+ - - ">="
109
109
  - !ruby/object:Gem::Version
110
- version: 1.4.0
110
+ version: '0'
111
111
  - !ruby/object:Gem::Dependency
112
- name: config
112
+ name: haml-rails
113
113
  requirement: !ruby/object:Gem::Requirement
114
114
  requirements:
115
115
  - - ">="
@@ -123,19 +123,19 @@ dependencies:
123
123
  - !ruby/object:Gem::Version
124
124
  version: '0'
125
125
  - !ruby/object:Gem::Dependency
126
- name: figaro
126
+ name: hash_mapper
127
127
  requirement: !ruby/object:Gem::Requirement
128
128
  requirements:
129
129
  - - ">="
130
130
  - !ruby/object:Gem::Version
131
- version: '0'
131
+ version: 0.2.2
132
132
  type: :runtime
133
133
  prerelease: false
134
134
  version_requirements: !ruby/object:Gem::Requirement
135
135
  requirements:
136
136
  - - ">="
137
137
  - !ruby/object:Gem::Version
138
- version: '0'
138
+ version: 0.2.2
139
139
  - !ruby/object:Gem::Dependency
140
140
  name: sidekiq
141
141
  requirement: !ruby/object:Gem::Requirement
@@ -151,7 +151,7 @@ dependencies:
151
151
  - !ruby/object:Gem::Version
152
152
  version: '0'
153
153
  - !ruby/object:Gem::Dependency
154
- name: sidekiq-unique-jobs
154
+ name: sidekiq-cron
155
155
  requirement: !ruby/object:Gem::Requirement
156
156
  requirements:
157
157
  - - ">="
@@ -165,7 +165,7 @@ dependencies:
165
165
  - !ruby/object:Gem::Version
166
166
  version: '0'
167
167
  - !ruby/object:Gem::Dependency
168
- name: sinatra
168
+ name: sidekiq-unique-jobs
169
169
  requirement: !ruby/object:Gem::Requirement
170
170
  requirements:
171
171
  - - ">="
@@ -179,7 +179,7 @@ dependencies:
179
179
  - !ruby/object:Gem::Version
180
180
  version: '0'
181
181
  - !ruby/object:Gem::Dependency
182
- name: sidekiq-cron
182
+ name: sinatra
183
183
  requirement: !ruby/object:Gem::Requirement
184
184
  requirements:
185
185
  - - ">="
@@ -207,7 +207,7 @@ dependencies:
207
207
  - !ruby/object:Gem::Version
208
208
  version: '0'
209
209
  - !ruby/object:Gem::Dependency
210
- name: shoulda
210
+ name: activerecord-jdbcsqlite3-adapter
211
211
  requirement: !ruby/object:Gem::Requirement
212
212
  requirements:
213
213
  - - ">="
@@ -221,7 +221,7 @@ dependencies:
221
221
  - !ruby/object:Gem::Version
222
222
  version: '0'
223
223
  - !ruby/object:Gem::Dependency
224
- name: rdoc
224
+ name: bundler
225
225
  requirement: !ruby/object:Gem::Requirement
226
226
  requirements:
227
227
  - - ">="
@@ -235,7 +235,7 @@ dependencies:
235
235
  - !ruby/object:Gem::Version
236
236
  version: '0'
237
237
  - !ruby/object:Gem::Dependency
238
- name: bundler
238
+ name: factory_girl_rails
239
239
  requirement: !ruby/object:Gem::Requirement
240
240
  requirements:
241
241
  - - ">="
@@ -249,7 +249,7 @@ dependencies:
249
249
  - !ruby/object:Gem::Version
250
250
  version: '0'
251
251
  - !ruby/object:Gem::Dependency
252
- name: jeweler
252
+ name: github_changelog_generator
253
253
  requirement: !ruby/object:Gem::Requirement
254
254
  requirements:
255
255
  - - ">="
@@ -263,7 +263,7 @@ dependencies:
263
263
  - !ruby/object:Gem::Version
264
264
  version: '0'
265
265
  - !ruby/object:Gem::Dependency
266
- name: simplecov
266
+ name: jeweler
267
267
  requirement: !ruby/object:Gem::Requirement
268
268
  requirements:
269
269
  - - ">="
@@ -277,7 +277,7 @@ dependencies:
277
277
  - !ruby/object:Gem::Version
278
278
  version: '0'
279
279
  - !ruby/object:Gem::Dependency
280
- name: rspec-rails
280
+ name: rdoc
281
281
  requirement: !ruby/object:Gem::Requirement
282
282
  requirements:
283
283
  - - ">="
@@ -291,7 +291,7 @@ dependencies:
291
291
  - !ruby/object:Gem::Version
292
292
  version: '0'
293
293
  - !ruby/object:Gem::Dependency
294
- name: factory_girl_rails
294
+ name: rspec-rails
295
295
  requirement: !ruby/object:Gem::Requirement
296
296
  requirements:
297
297
  - - ">="
@@ -305,21 +305,21 @@ dependencies:
305
305
  - !ruby/object:Gem::Version
306
306
  version: '0'
307
307
  - !ruby/object:Gem::Dependency
308
- name: activerecord-jdbcsqlite3-adapter
308
+ name: rubocop
309
309
  requirement: !ruby/object:Gem::Requirement
310
310
  requirements:
311
- - - ">="
311
+ - - "~>"
312
312
  - !ruby/object:Gem::Version
313
- version: '0'
313
+ version: '0.43'
314
314
  type: :development
315
315
  prerelease: false
316
316
  version_requirements: !ruby/object:Gem::Requirement
317
317
  requirements:
318
- - - ">="
318
+ - - "~>"
319
319
  - !ruby/object:Gem::Version
320
- version: '0'
320
+ version: '0.43'
321
321
  - !ruby/object:Gem::Dependency
322
- name: sqlite3
322
+ name: shoulda
323
323
  requirement: !ruby/object:Gem::Requirement
324
324
  requirements:
325
325
  - - ">="
@@ -347,21 +347,21 @@ dependencies:
347
347
  - !ruby/object:Gem::Version
348
348
  version: '0'
349
349
  - !ruby/object:Gem::Dependency
350
- name: rubocop
350
+ name: simplecov
351
351
  requirement: !ruby/object:Gem::Requirement
352
352
  requirements:
353
- - - "~>"
353
+ - - ">="
354
354
  - !ruby/object:Gem::Version
355
- version: '0.43'
355
+ version: '0'
356
356
  type: :development
357
357
  prerelease: false
358
358
  version_requirements: !ruby/object:Gem::Requirement
359
359
  requirements:
360
- - - "~>"
360
+ - - ">="
361
361
  - !ruby/object:Gem::Version
362
- version: '0.43'
362
+ version: '0'
363
363
  - !ruby/object:Gem::Dependency
364
- name: timecop
364
+ name: sqlite3
365
365
  requirement: !ruby/object:Gem::Requirement
366
366
  requirements:
367
367
  - - ">="
@@ -375,7 +375,7 @@ dependencies:
375
375
  - !ruby/object:Gem::Version
376
376
  version: '0'
377
377
  - !ruby/object:Gem::Dependency
378
- name: github_changelog_generator
378
+ name: timecop
379
379
  requirement: !ruby/object:Gem::Requirement
380
380
  requirements:
381
381
  - - ">="
@@ -615,7 +615,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
615
615
  version: '0'
616
616
  requirements: []
617
617
  rubyforge_project:
618
- rubygems_version: 2.5.1
618
+ rubygems_version: 2.6.8
619
619
  signing_key:
620
620
  specification_version: 4
621
621
  summary: Rails framework to build connector with Maestrano