standard_id-apple 0.8.0 → 0.9.0

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: c5bb7427c0d928fdf21192e6a48c70431a51a2e3c05d3b96dd192eab760247f0
4
- data.tar.gz: ef547da4fd6b44facb4cafca70b80a98b65cec3859a6715b1c72160a51769aa1
3
+ metadata.gz: 34ac427042ac9a5d6ed32aeda4eeed8c2bb4c481778b646b39e1a030de03e988
4
+ data.tar.gz: 970ae234cf4ded4a91c416735f3561774e91474f3e393544297f5347970a4aeb
5
5
  SHA512:
6
- metadata.gz: f49035c18090743a5513da37b8eb3e66eef03a430a050aa8643492e668f8cff2cb26d7b0247a21b0854ea086023115b0b62a2fc85f613bb965f8dacecf8335ea
7
- data.tar.gz: 4e23288305fcf8b7dc59fd203ad62b40c3f85dd0983b931a0c948a4d1c75c3712905e46efa4f4c63ae2e37eec3bae7317e7ca09e92aa17564035c21dcb5a47d2
6
+ metadata.gz: 2ccc7df07a7e84a4582675847b6d8b88f6723c29e069fc69e4214feeaac818b92219639cc712aae6bd6f07359c8d3bf55b467c527f166a868ff567ebd64a3412
7
+ data.tar.gz: 7ec6bfda65dea50d178fbdcca251de5046a62cf14bc17c352f2c9f416be02ac0f5a80c4551ad7b20a4f368f3ccc4e59ba7af54c1ee32d020cb4f439ffc8fd4ab
data/CHANGELOG.md CHANGED
@@ -7,6 +7,19 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## [0.9.0] - 2026-11-23
11
+
12
+ ### Added
13
+
14
+ - **Every request names the provider to `StandardId::HttpClient`** (`provider: :apple`): the web
15
+ and native code exchanges, token revocation and the JWKS download. A standard_id that takes the
16
+ keyword (0.61.0 and later) hands it to the host's `config.network_wrapper`, so a circuit
17
+ breaker or tracing span can tell Apple's calls apart. Against older standard_id releases the
18
+ keyword is left out, detected from each method's parameters, so the `~> 0.42` requirement is
19
+ unchanged. An error the wrapper raises itself (an open circuit) is not one of the transport
20
+ errors `exchange_authorization_code` and `revoke` turn into `TokenRequestError`, so it reaches
21
+ the caller as is.
22
+
10
23
  ## [0.8.0] - 2026-10-08
11
24
 
12
25
  ### Added
@@ -149,7 +149,7 @@ module StandardId
149
149
  code: code,
150
150
  grant_type: "authorization_code",
151
151
  redirect_uri: redirect_uri
152
- })
152
+ }, **http_provider(:post_form))
153
153
 
154
154
  unless token_response.is_a?(Net::HTTPSuccess)
155
155
  raise StandardId::InvalidRequestError,
@@ -347,7 +347,7 @@ module StandardId
347
347
  # which hold the code/token and the client secret.
348
348
  def post_to_apple(endpoint, params, failure:)
349
349
  response = begin
350
- HttpClient.post_form(endpoint, params)
350
+ HttpClient.post_form(endpoint, params, **http_provider(:post_form))
351
351
  rescue Timeout::Error, IOError, SocketError, SystemCallError, OpenSSL::SSL::SSLError, HttpClient::SsrfError => e
352
352
  raise StandardId::Apple::TokenRequestError, "#{failure}: #{e.class.name}"
353
353
  end
@@ -431,7 +431,7 @@ module StandardId
431
431
  def download_jwks
432
432
  rescue_to_oauth_error("Failed to fetch Apple JWKS") do
433
433
  uri, resolved_ip = HttpClient.send(:validate_url!, JWKS_URI)
434
- response = HttpClient.send(:start_connection, uri, resolved_ip: resolved_ip) do |http|
434
+ response = HttpClient.send(:start_connection, uri, resolved_ip: resolved_ip, **http_provider(:start_connection)) do |http|
435
435
  http.request(Net::HTTP::Get.new(uri))
436
436
  end
437
437
  raise StandardId::OAuthError, "Failed to fetch Apple JWKS: HTTP #{response.code}" unless response.is_a?(Net::HTTPSuccess)
@@ -443,6 +443,18 @@ module StandardId
443
443
  end
444
444
  end
445
445
 
446
+ # `provider: :apple` for StandardId::HttpClient, which hands it to the
447
+ # host's `config.network_wrapper` (e.g. one circuit per provider). Only
448
+ # standard_id releases after 0.60.0 take the keyword, and this plugin
449
+ # still supports older ones, so it is passed only when the method
450
+ # declares it. Read on each call rather than cached: Method#parameters
451
+ # costs nothing next to the request itself.
452
+ def http_provider(method_name)
453
+ parameters = HttpClient.method(method_name).parameters
454
+ accepts = parameters.include?([:key, :provider]) || parameters.any? { |type, _| type == :keyrest }
455
+ accepts ? { provider: :apple } : {}
456
+ end
457
+
446
458
  def error_reason(response)
447
459
  apple_error_value(response) || "HTTP #{response.code}"
448
460
  end
@@ -2,6 +2,6 @@
2
2
 
3
3
  module StandardId
4
4
  module Apple
5
- VERSION = "0.8.0"
5
+ VERSION = "0.9.0"
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,10 +1,10 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: standard_id-apple
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.0
4
+ version: 0.9.0
5
5
  platform: ruby
6
6
  authors:
7
- - Jaryl Sim
7
+ - Rarebit One
8
8
  bindir: bin
9
9
  cert_chain: []
10
10
  date: 1980-01-02 00:00:00.000000000 Z
@@ -97,7 +97,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
97
97
  - !ruby/object:Gem::Version
98
98
  version: '0'
99
99
  requirements: []
100
- rubygems_version: 4.0.10
100
+ rubygems_version: 4.0.20
101
101
  specification_version: 4
102
102
  summary: Apple Sign In provider plugin for the StandardId engine.
103
103
  test_files: []