maitre_d 0.6.0 → 0.6.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 3384d15408a2e029d8419521510854402d0055a1
4
- data.tar.gz: 2bcb69e276cc0d4024eb15a9f0f7de061ae61d67
2
+ SHA256:
3
+ metadata.gz: 9eb99cbebe7410953efb631a11a6622f14f0fc7aff295916021c6737f8f263b8
4
+ data.tar.gz: 208609d75dbaf42bf79313cba27b3e1755f0823e60629ee7a1f68334c631907e
5
5
  SHA512:
6
- metadata.gz: 264cb01a7047ac115042b6c9b4de13c1571e737498aa76b1a20df878b834703304703da4da8a6c37e0e81ce85b83278549f45966dd018faa05e0c1fbb531c9ca
7
- data.tar.gz: 37046db0c44e4f92902023a11fff7ee6faeab9b673813beab5505d930f29b0bd584e0a1d0378e14e80df81eeedb4e001baa7d277e6d5d59495737c2fd6e2a724
6
+ metadata.gz: 1fd86a0cfc61d67b37d20d7be85eed36e58d0067df94aad8fcc7be8f13eada94077049f96044810122dd35a1a62089b1826c73a2fb15ce2a0e5181ae8f5de6ac
7
+ data.tar.gz: '09008f6dc9be814685295da03c416e39bcef6b4527947211deb58809bdfa2bceaef3aee1a78f8eca47be61960e55b695c52ca5f1a17eb43d766cf439abdf2c0a'
@@ -11,14 +11,15 @@ class MaitreD::API::AuthenticationGuard < Sliver::Hook
11
11
 
12
12
  private
13
13
 
14
- def valid_authorization?
15
- valid_authorization.strip == action.request.env['HTTP_AUTHORIZATION'].strip
14
+ def expected_credentials
15
+ "#{action.configuration.id}:#{action.configuration.password}"
16
+ end
17
+
18
+ def provided_credentials
19
+ Base64.decode64 action.request.env['HTTP_AUTHORIZATION'].gsub(/^Basic /, '')
16
20
  end
17
21
 
18
- def valid_authorization
19
- encoded_authorization = Base64.encode64(
20
- "#{action.configuration.id}:#{action.configuration.password}"
21
- )
22
- "Basic #{encoded_authorization}"
22
+ def valid_authorization?
23
+ provided_credentials == expected_credentials
23
24
  end
24
25
  end
@@ -3,7 +3,7 @@ $:.push File.expand_path('../lib', __FILE__)
3
3
 
4
4
  Gem::Specification.new do |s|
5
5
  s.name = 'maitre_d'
6
- s.version = '0.6.0'
6
+ s.version = '0.6.1'
7
7
  s.authors = ['Pat Allan']
8
8
  s.email = ['pat@freelancing-gods.com']
9
9
  s.homepage = 'http://github.com/flying-sphinx/maitre_d'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: maitre_d
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.0
4
+ version: 0.6.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Pat Allan
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-05-20 00:00:00.000000000 Z
11
+ date: 2018-09-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: sliver
@@ -153,7 +153,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
153
153
  version: '0'
154
154
  requirements: []
155
155
  rubyforge_project: maitre_d
156
- rubygems_version: 2.6.11
156
+ rubygems_version: 2.7.6
157
157
  signing_key:
158
158
  specification_version: 4
159
159
  summary: Rack APIs for Heroku add-ons