soar-authentication-identity_uuid_translator 1.0.4 → 2.0.0

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: 62918fb1409f0b7fd6a28ba4c0e5d7e06a84fd0f
4
- data.tar.gz: 154f26e6dba8e4841badb6219348beee137747b3
3
+ metadata.gz: a29b29bc17bf8cd91f45651374f92983feb9ecf9
4
+ data.tar.gz: 38cd2f73e28e093e3ce66ed23c4d54506fb0b498
5
5
  SHA512:
6
- metadata.gz: 5fe73df28bd768f251b1ba099fc92e7030c78f2e5b56ea6cf98f0e102451381d429feae83bf0336d0200ae8cd19237a5934873c6adec989af4224c5f7db3dc3e
7
- data.tar.gz: 8b06e5067c6d8026865fa03be6eaf3da9db932b07b08efb826a253638c3fc2aec4034607fada8f89e677c2c068007a07c0449a6a0550020b6f9851732402c0dc
6
+ metadata.gz: 16f88064bb51ab5e050165d5ff4dde7593a9c210f83bc22d53d4208a8a162b5787ee34f72634f012be261a081073fe333026e1b8a5a4387bb64ebb3db751aecd
7
+ data.tar.gz: fb47813a11ba89fa57639f81afbe3b12fd8cebed4c31e160d31f62021ca8df7c54cb11d4aabb0d8445ff41aa8752ad460ab069037e7b6b1492e91f0dd8087d85
data/.gemspec CHANGED
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |spec|
2
2
  spec.name = "soar-authentication-identity_uuid_translator"
3
- spec.version = "1.0.4"
3
+ spec.version = "2.0.0"
4
4
  spec.authors = ["Charles Mulder"]
5
5
  spec.email = ["charles.mulder@hetzner.co.za"]
6
6
 
@@ -10,7 +10,7 @@ Gem::Specification.new do |spec|
10
10
  spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
11
11
  spec.require_paths = ["lib"]
12
12
 
13
- spec.add_runtime_dependency 'soar-registry-identity', '~> 4.0', '>= 4.0.2'
14
- spec.add_runtime_dependency 'object_selector', '~> 1.0', '>= 1.0.1'
13
+ spec.add_runtime_dependency 'soar-registry-identity', '~> 5.0'
14
+ spec.add_runtime_dependency 'object_selector', '~> 1.0', '>= 1.0.2'
15
15
  spec.add_runtime_dependency 'uuidtools', '~> 2.1', '>= 2.1.5'
16
16
  end
data/Gemfile CHANGED
@@ -5,6 +5,5 @@ gemspec
5
5
  group :test do
6
6
  gem 'cucumber', '~> 2.4'
7
7
  gem 'rspec', '~> 3.5'
8
- gem 'hashie', '~> 3.5', '>= 3.5.5'
9
8
  gem 'faker', '~> 1.7', '>= 1.7.3'
10
9
  end
@@ -4,7 +4,6 @@ require 'soar/authentication/identity_uuid_translator/role_generator'
4
4
  require 'soar/registry/directory'
5
5
  require 'object_selector'
6
6
  require 'faker'
7
- require 'hashie'
8
7
 
9
8
  module Soar
10
9
  module Authentication
@@ -13,8 +12,8 @@ module Soar
13
12
  module OrchestrationProvider
14
13
  class Base
15
14
 
16
- SLEEP_SECONDS = 5
17
- CONNECTION_RETRIES = 10
15
+ SLEEP_SECONDS = 10
16
+ CONNECTION_RETRIES = 6
18
17
 
19
18
  def initialize
20
19
  @connection_retries = CONNECTION_RETRIES
@@ -24,10 +23,10 @@ module Soar
24
23
  begin
25
24
  roles_directory_configuration = YAML.load_file("config/#{ENV['ROLES_DIRECTORY_CONFIG_FILE']}")
26
25
  @roles_directory = Soar::Registry::Directory.new(
27
- Soar::Registry::Directory::Provider::DynamoDb.new(Hashie.symbolize_keys(roles_directory_configuration['config']))
26
+ Soar::Registry::Directory::Provider::DynamoDb.new(roles_directory_configuration['config'].map { |k, v| [k.to_sym, v]}.to_h )
28
27
  )
29
28
  @roles_directory.provider.recreate_table({
30
- name: roles_directory_configuration['config']['table'][:name],
29
+ name: roles_directory_configuration['config']['table']['name'],
31
30
  structure: JSON.parse(File.read("lib/soar/authentication/identity_uuid_translator/test/fixtures/roles_table.json"))
32
31
  })
33
32
  rescue Soar::Registry::Directory::Error::NetworkingError => e
@@ -32,8 +32,7 @@ module Soar
32
32
  "identity_role" => Soar::Authentication::IdentityUuidTranslator::Provider::Customer::ROLE
33
33
  }
34
34
  identity = @roles_directory.fetch(primary_key)
35
- identity['identity_role'] == Soar::Authentication::IdentityUuidTranslator::Provider::Customer::ROLE
36
- return identity['identity_role_attributes']['profiles'].include?(@identity[:Client_Number])
35
+ (identity['identity_role'] == Soar::Authentication::IdentityUuidTranslator::Provider::Customer::ROLE) && (identity['identity_role_attributes']['profiles'].include?(@identity[:Client_Number]))
37
36
  rescue Soar::Registry::Directory::Error::NoEntriesFoundError => e
38
37
  return false
39
38
  end
@@ -13,7 +13,7 @@ module Soar
13
13
 
14
14
  directory_configuration = YAML.load_file("config/#{ENV['IDENTITY_DIRECTORY_CONFIG_FILE']}")
15
15
 
16
- provider = Soar::Registry::Directory::Provider::Mysql.new(Hashie.symbolize_keys(directory_configuration['config']))
16
+ provider = Soar::Registry::Directory::Provider::Mysql.new(directory_configuration['config'].map { |k, v| [k.to_sym, v]}.to_h)
17
17
  provider.client.query("DROP TABLE IF EXISTS `Client`")
18
18
  provider.client.query("CREATE TABLE Client ( ID int(11) NOT NULL AUTO_INCREMENT, Client_Number varchar(15) NOT NULL DEFAULT '', First_Name varchar(70) DEFAULT NULL, Surname varchar(70) DEFAULT NULL, Notifyemail_Invoice text, PRIMARY KEY (ID), KEY Notifyemail_Invoice (Notifyemail_Invoice(20)), KEY Client_Number (Client_Number))")
19
19
 
@@ -12,8 +12,7 @@ module Soar
12
12
  begin
13
13
  directory_configuration = YAML.load_file("config/#{ENV['IDENTITY_DIRECTORY_CONFIG_FILE']}")
14
14
 
15
- provider = Soar::Registry::Directory::Provider::Mysql.new(Hashie.symbolize_keys(directory_configuration['config']))
16
-
15
+ provider = Soar::Registry::Directory::Provider::Mysql.new(directory_configuration['config'].map { |k, v| [k.to_sym, v] }.to_h)
17
16
  provider.client.query("DROP TABLE IF EXISTS `Client`")
18
17
  provider.client.query("CREATE TABLE Client ( ID int(11) NOT NULL AUTO_INCREMENT, Client_Number varchar(15) NOT NULL DEFAULT '', First_Name varchar(70) DEFAULT NULL, Surname varchar(70) DEFAULT NULL, Notifyemail_Invoice text, PRIMARY KEY (ID), KEY Notifyemail_Invoice (Notifyemail_Invoice(20)), KEY Client_Number (Client_Number))")
19
18
 
@@ -54,7 +54,7 @@ module Soar
54
54
  @identity_directory_configuration = YAML.load_file("config/#{ENV['IDENTITY_DIRECTORY_CONFIG_FILE']}")
55
55
 
56
56
  @identity_directory = Soar::Registry::Directory.new(
57
- Soar::Registry::Directory::Provider::Ldap.new(Hashie.symbolize_keys(@identity_directory_configuration['config']))
57
+ Soar::Registry::Directory::Provider::Ldap.new(@identity_directory_configuration['config'].map { |k, v| [k.to_sym, v]}.to_h)
58
58
  )
59
59
 
60
60
  @identity_registry = Soar::Registry::Identity.new(
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: soar-authentication-identity_uuid_translator
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.4
4
+ version: 2.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Charles Mulder
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-03-15 00:00:00.000000000 Z
11
+ date: 2017-03-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: soar-registry-identity
@@ -16,20 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '4.0'
20
- - - ">="
21
- - !ruby/object:Gem::Version
22
- version: 4.0.2
19
+ version: '5.0'
23
20
  type: :runtime
24
21
  prerelease: false
25
22
  version_requirements: !ruby/object:Gem::Requirement
26
23
  requirements:
27
24
  - - "~>"
28
25
  - !ruby/object:Gem::Version
29
- version: '4.0'
30
- - - ">="
31
- - !ruby/object:Gem::Version
32
- version: 4.0.2
26
+ version: '5.0'
33
27
  - !ruby/object:Gem::Dependency
34
28
  name: object_selector
35
29
  requirement: !ruby/object:Gem::Requirement
@@ -39,7 +33,7 @@ dependencies:
39
33
  version: '1.0'
40
34
  - - ">="
41
35
  - !ruby/object:Gem::Version
42
- version: 1.0.1
36
+ version: 1.0.2
43
37
  type: :runtime
44
38
  prerelease: false
45
39
  version_requirements: !ruby/object:Gem::Requirement
@@ -49,7 +43,7 @@ dependencies:
49
43
  version: '1.0'
50
44
  - - ">="
51
45
  - !ruby/object:Gem::Version
52
- version: 1.0.1
46
+ version: 1.0.2
53
47
  - !ruby/object:Gem::Dependency
54
48
  name: uuidtools
55
49
  requirement: !ruby/object:Gem::Requirement