mauth-client 6.4.0 → 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: fc8cbe23e9d1c4aed81b5c3879945892303f21ce8617060f97d59bf4504bf266
4
- data.tar.gz: eef092f242b51ca385b1aec1e10c57aed8195483da3a29f94e693cd2488473c3
3
+ metadata.gz: 9c7571bca95de6f3bf3c4d83d071b87dde1d5ae431e232d47060850cee0c8245
4
+ data.tar.gz: 10e3f28b2eabf7faac7f76d3e3c19a5d406ac029f7d322cd7a335a84efb08600
5
5
  SHA512:
6
- metadata.gz: 00d23785893fece78afcebbb52ca56f955e0f1018e050882fe7991b02cd7f118a27cde158c126018006fe93559806ac6268e8469b56cabfbb227c7210da60761
7
- data.tar.gz: 7fc815dec75cdcf5663e03dec6896a155b1818504aa7f8716654ffbacfe27c2ba46be57906c3acefc093fb3a6c5f2449e9f2693c7bcb36b8e25a7ae4bfe69eae
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,9 @@
1
+ ## v6.4.2
2
+ - Add MAuth::ServerHelper module with convenience methods for servers to access requester app uuid.
3
+
4
+ ## v6.4.1
5
+ - Fix MAuth::Rack::Response to not raise FrozenError.
6
+
1
7
  ## v6.4.0
2
8
  - Support Ruby 3.1.
3
9
  - Drop support for Ruby < 2.6.0.
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
@@ -170,7 +170,7 @@ module MAuth
170
170
 
171
171
  def attributes_for_signing
172
172
  @attributes_for_signing ||= begin
173
- body = ''
173
+ body = +''
174
174
  # NOTE: rack only requires #each be defined on the body, so not using map or inject
175
175
  @body.each do |part|
176
176
  body << part
@@ -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.0'
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.0
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-25 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.