pansophy_authenticator 0.4.2 → 0.4.3

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: 7658530d21072fe7bff79fb7bb2f28ad9271bf99
4
- data.tar.gz: 7d4412a8e98d00b7fb184dae943773e84f3f9af0
3
+ metadata.gz: 29ebf23c67f25a00a89055ab68ba6915c1e0b856
4
+ data.tar.gz: 9aff436c473c8330f468b46628b0686509f7ca13
5
5
  SHA512:
6
- metadata.gz: c3950bc78b57db426f5d9a29a1ff32421fc65f3024feeb8efd8928ac2f2969a1f7f5cac934026548500dc36529beedcf0cdd91391a62276fc6160b6c87c15b99
7
- data.tar.gz: 089113aa85445b596e10cd42c362ef7885525d1960bac59faba29d2dbf9e0e00ca4adb5c66a552211896ee8d66f488e2acd28005c082c0f539ccd296f5dea900
6
+ metadata.gz: 4c81c8b7374057a998df770760335dd7f1ae43abbda73aa797160611d385169b63ddba2ca72518acbc50f24aa314b46f74d1d6b869e071bf9eb853338b85d035
7
+ data.tar.gz: d1945149f67d4f5d1525fe96b614266535c582ce5d014696b6dfe8e6ad90cdfdf85a46aadd70c240526baa55dcd66c02ef77cf5a4e8e22ee8bfdce934052cefb
data/CHANGELOG.md CHANGED
@@ -1,33 +1,41 @@
1
- ## 0.4.2 (2016-04-06)
1
+ # Change Log
2
+ All notable changes to this project will be documented in this file.
3
+ This project adheres to [Semantic Versioning](http://semver.org/).
4
+ This changelog adheres to [Keep a CHANGELOG](http://keepachangelog.com/).
5
+
6
+ ## [0.4.3] - 2016-04-07
2
7
  ### Fixed
3
- - Updates pansophy gem dependency to >= 0.5.2
8
+ - Loading of remote YAML application keys file now parses correctly
9
+ - Replaces wrong dependency from memoize to memoizable
4
10
 
5
- ## 0.4.1 (2016-04-06)
11
+ ## [0.4.2] - 2016-04-06
6
12
  ### Fixed
7
- - Caches application keys as json to ensure compatibility with third party cache stores
13
+ - Updates pansophy gem dependency to version >= 0.5.2
8
14
 
9
- ### Changed
15
+ ## [0.4.1] - 2016-04-06
16
+ ### Fixed
17
+ - Caches application keys as json to ensure compatibility with third party cache stores
10
18
  - Updates pansophy gem dependency to version ~> 0.5, >= 0.5.1
11
19
 
12
- ## 0.4.0 (2016-02-16)
20
+ ## [0.4.0] - 2016-02-16
13
21
  ### Added
14
22
  - Implements 'application' and 'local?' helper methods
15
23
 
16
24
  ### Fixed
17
25
  - Tests could be influenced by system environment variables
18
26
 
19
- ## 0.3.0 (2016-02-12)
27
+ ## [0.3.0] - 2016-02-12
20
28
  ### Added
21
29
  - Configuration validation
22
30
 
23
- ## 0.2.1 (2016-02-05)
31
+ ## [0.2.1] - 2016-02-05
24
32
  ### Fixed
25
33
  - Security fix: be agnostic on cause of validation failure
26
34
  - Don't raise errors when checking validation via #valid?
27
35
 
28
- ## 0.2.0 (2016-02-02)
36
+ ## [0.2.0] - 2016-02-02
29
37
  ### Added
30
38
  - Caching via cache store
31
39
 
32
- ## 0.1.0 (2016-02-01)
40
+ ## [0.1.0] - 2016-02-01
33
41
  - Initial release
@@ -3,19 +3,38 @@ require 'pansophy'
3
3
  module PansophyAuthenticator
4
4
  module Remote
5
5
  class Fetcher
6
+ include Memoizable
7
+
6
8
  def keys
7
- @keys ||= fetch
9
+ fetch
8
10
  end
11
+ memoize :keys
9
12
 
10
13
  private
11
14
 
12
15
  def fetch
16
+ fail_for_invalid_format! unless parsed_content.is_a? Hash
17
+ parsed_content
18
+ end
19
+
20
+ def parsed_content
21
+ YAML.load remote_content
22
+ rescue Psych::SyntaxError
23
+ fail_for_invalid_format!
24
+ end
25
+ memoize :parsed_content
26
+
27
+ def remote_content
13
28
  Pansophy.read(configuration.bucket_name, configuration.file_path)
14
29
  end
15
30
 
16
31
  def configuration
17
32
  PansophyAuthenticator.configuration
18
33
  end
34
+
35
+ def fail_for_invalid_format!
36
+ fail Error, 'Remote application keys file is not in a valid format'
37
+ end
19
38
  end
20
39
  end
21
40
  end
@@ -1,4 +1,4 @@
1
1
  # frozen_string_literal: true
2
2
  module PansophyAuthenticator
3
- VERSION = '0.4.2'.freeze
3
+ VERSION = '0.4.3'.freeze
4
4
  end
@@ -26,7 +26,7 @@ Gem::Specification.new do |spec|
26
26
 
27
27
  spec.required_ruby_version = '>= 2.1'
28
28
 
29
- spec.add_dependency 'memoize', '~> 1.3'
29
+ spec.add_dependency 'memoizable', '~> 0.4'
30
30
  spec.add_dependency 'anima', '~> 0.3'
31
31
  spec.add_dependency 'adamantium', '~> 0.2'
32
32
  spec.add_dependency 'pansophy', '~> 0.5', '>= 0.5.2'
metadata CHANGED
@@ -1,29 +1,29 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pansophy_authenticator
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.2
4
+ version: 0.4.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alessandro Berardi
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-04-06 00:00:00.000000000 Z
11
+ date: 2016-04-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
- name: memoize
14
+ name: memoizable
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '1.3'
19
+ version: '0.4'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: '1.3'
26
+ version: '0.4'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: anima
29
29
  requirement: !ruby/object:Gem::Requirement