mauth-client 6.4.1 → 6.4.2

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
2
  SHA256:
3
- metadata.gz: b9219adefc5bedb36c4994be6309d39c8cb2b2e67a91d8a12f2119caf288df26
4
- data.tar.gz: aff48af8ae57b3a4cd12f094abe3ac5c002379177465f1870e739e180e4f37cc
3
+ metadata.gz: 9c7571bca95de6f3bf3c4d83d071b87dde1d5ae431e232d47060850cee0c8245
4
+ data.tar.gz: 10e3f28b2eabf7faac7f76d3e3c19a5d406ac029f7d322cd7a335a84efb08600
5
5
  SHA512:
6
- metadata.gz: 5c2dac6db5f67e885d634c428b0dbe0eaeee6a3a74a5dffa64f267e8dd7f3666e7d129ac4dda66fc02d41503c5245cdd546e17d6bd88d217a80ecacbfcae11c3
7
- data.tar.gz: 1fdbb74b94544f25b3827638f0ffb853beb19e6e40bcbb1b4b31b547934c9266903fb9e7386e54a251dee2fecc629fb0c6b16cfcb1cdf44a678369ed67b0f32d
6
+ metadata.gz: 126ddea6b0fc80822b36ad652ba292117ccc0439b845b90e2a3cdccfdcf89d934ec4d8188e17ab655124e7ee4337067b6a31daefa183017d1038027a4fc6a3fb
7
+ data.tar.gz: 45de4bcbcf9a58a400905826db273ae77b48a6dbaf15dbb2b875982fb72d767f00f55b9f85172b4754bc7e8056f7c582c86097aed01658c39e43a6049cf48c03
data/.rubocop.yml CHANGED
@@ -5,6 +5,7 @@ require:
5
5
  - rubocop-performance
6
6
 
7
7
  AllCops:
8
+ TargetRubyVersion: 2.6
8
9
  Exclude:
9
10
  - gemfiles/**/*
10
11
 
data/.ruby-version CHANGED
@@ -1 +1 @@
1
- 2.6.9
1
+ 2.7.6
data/CHANGELOG.md CHANGED
@@ -1,3 +1,6 @@
1
+ ## v6.4.2
2
+ - Add MAuth::ServerHelper module with convenience methods for servers to access requester app uuid.
3
+
1
4
  ## v6.4.1
2
5
  - Fix MAuth::Rack::Response to not raise FrozenError.
3
6
 
data/lib/mauth/client.rb CHANGED
@@ -29,6 +29,7 @@ module MAuth
29
29
  MWS_TOKEN = 'MWS'
30
30
  MWSV2_TOKEN = 'MWSV2'
31
31
  AUTH_HEADER_DELIMITER = ';'
32
+ RACK_ENV_APP_UUID_KEY = 'mauth.app_uuid'
32
33
 
33
34
  include AuthenticatorBase
34
35
  include Signer
@@ -31,7 +31,7 @@ module MAuth
31
31
  env['mauth.protocol_version'] = mauth_request.protocol_version
32
32
 
33
33
  if self.class.is_authentic?
34
- @app.call(env.merge!('mauth.app_uuid' => mauth_request.signature_app_uuid,
34
+ @app.call(env.merge!(MAuth::Client::RACK_ENV_APP_UUID_KEY => mauth_request.signature_app_uuid,
35
35
  'mauth.authentic' => true))
36
36
  else
37
37
  response_for_inauthentic_request(env)
data/lib/mauth/faraday.rb CHANGED
@@ -22,7 +22,7 @@ module MAuth
22
22
  @app.call(request_env).on_complete do |response_env|
23
23
  mauth_response = MAuth::Faraday::Response.new(response_env)
24
24
  mauth_client.authenticate!(mauth_response) # raises MAuth::InauthenticError when inauthentic
25
- response_env['mauth.app_uuid'] = mauth_response.signature_app_uuid
25
+ response_env[MAuth::Client::RACK_ENV_APP_UUID_KEY] = mauth_response.signature_app_uuid
26
26
  response_env['mauth.authentic'] = true
27
27
  response_env
28
28
  end
data/lib/mauth/rack.rb CHANGED
@@ -29,7 +29,7 @@ module MAuth
29
29
  begin
30
30
  if mauth_client.authentic?(mauth_request)
31
31
  @app.call(env.merge!(
32
- 'mauth.app_uuid' => mauth_request.signature_app_uuid,
32
+ MAuth::Client::RACK_ENV_APP_UUID_KEY => mauth_request.signature_app_uuid,
33
33
  'mauth.authentic' => true
34
34
  ))
35
35
  else
@@ -0,0 +1,13 @@
1
+ # frozen_string_literal: true
2
+
3
+ module MAuth
4
+ module ServerHelper
5
+ def app_uuid(request)
6
+ request.env[MAuth::Client::RACK_ENV_APP_UUID_KEY]
7
+ end
8
+
9
+ def app_uuid_from_env(env)
10
+ env[MAuth::Client::RACK_ENV_APP_UUID_KEY]
11
+ end
12
+ end
13
+ end
data/lib/mauth/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module MAuth
4
- VERSION = '6.4.1'
4
+ VERSION = '6.4.2'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mauth-client
3
3
  version: !ruby/object:Gem::Version
4
- version: 6.4.1
4
+ version: 6.4.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Matthew Szenher
@@ -11,7 +11,7 @@ authors:
11
11
  autorequire:
12
12
  bindir: exe
13
13
  cert_chain: []
14
- date: 2022-02-28 00:00:00.000000000 Z
14
+ date: 2022-09-22 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: addressable
@@ -372,6 +372,7 @@ files:
372
372
  - lib/mauth/proxy.rb
373
373
  - lib/mauth/rack.rb
374
374
  - lib/mauth/request_and_response.rb
375
+ - lib/mauth/server_helper.rb
375
376
  - lib/mauth/version.rb
376
377
  - lib/rack/mauth.rb
377
378
  - mauth-client.gemspec
@@ -394,7 +395,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
394
395
  - !ruby/object:Gem::Version
395
396
  version: '0'
396
397
  requirements: []
397
- rubygems_version: 3.1.2
398
+ rubygems_version: 3.1.6
398
399
  signing_key:
399
400
  specification_version: 4
400
401
  summary: Sign and authenticate requests and responses with mAuth authentication.