standard_singpass 0.4.0 → 0.5.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: b337f846e33125912e93e3819ad6ab9858dea86f6f2976f821650cd41eda5f2d
4
- data.tar.gz: d655d89457c6a8120223dec9c266945ef03601dc79d82268e9ea5149fe7de75b
3
+ metadata.gz: 6a27b57ad2ae40ae92c93b8328f2fe0849d22bc95ecc1812bb1f6899f2eb36e1
4
+ data.tar.gz: 3d8c189d90e1cd51db83b73f7bee5fe78d4f856b90721707a12befd8af8c37e6
5
5
  SHA512:
6
- metadata.gz: 0ccefce8b78a9ad7ef3213738a6266b544241c18e99ce645aa0de0bb1f6067f5bda79f793ee048757c4763cd1f990779649bc86c3d506849c5e3d7cfc19a0290
7
- data.tar.gz: 6fb74b23e6fdf75e2191d7eecc76a45969aac95f6d5dd8383572b563299c15b1013dd2199c2816189248713452f0043c861c74cf9e14d33504357226a3b1f1e7
6
+ metadata.gz: eeca8fd0904977618487859b6aa207f4cd3394aa016943f1f6e177ee71404f9e95bdef1b68fb2a68b47d9463f5779871f5b0d8257f834fd403d954c81537816b
7
+ data.tar.gz: a321882ef3e389555bb2427262f863961c38dd30e2a265959cbc383bcad05de9f63b243b248115f40ca5adc5fd267f3f6a2a860a36a6d8e8cbe92c5bd6369b1f
data/CHANGELOG.md CHANGED
@@ -7,6 +7,25 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## [0.5.0] - 2026-09-24
11
+
12
+ **Breaking.** Removes everything 0.4.0 deprecated. No other behaviour changes.
13
+
14
+ ### Removed
15
+
16
+ - **`StandardSingpass::Myinfo::Security::DecryptionError` / `Security::ValidationError`.** These were aliases of `StandardSingpass::Myinfo::DecryptionError` / `SignatureError`, which `Security` has raised directly since 0.4.0. Referencing the old names now raises `NameError`. Rescue `DecryptionError` / `SignatureError`, or the `StandardSingpass::Myinfo::Error` base.
17
+ - **`StandardSingpass::Myinfo::EcdhJwe.encrypt`**, the forwarder. Use `require "standard_singpass/testing"` and `StandardSingpass::Testing::EcdhJwe.encrypt` (same signature). `EcdhJwe.decrypt` is unchanged.
18
+ - **`StandardSingpass::Myinfo::TestPersonas.reload!`**. Personas are read once per process. Restart, or point `personas_path` at a different file.
19
+
20
+ ### Changed
21
+
22
+ - `StandardSingpass.deprecator`'s horizon is now `0.6`.
23
+
24
+ ### Upgrade notes
25
+
26
+ - **No code change required in the one consumer, fundbright-web.** Grepped `origin/main` on 2026-09-24: no reference to `Security::DecryptionError`, `Security::ValidationError`, `EcdhJwe.encrypt` or `TestPersonas.reload!`.
27
+ - Regenerate the gem RBI when bumping (`bin/tapioca gem standard_singpass`). `sorbet/rbi/gems/standard_singpass@0.4.0.rbi` still declares the removed constants and methods.
28
+
10
29
  ## [0.4.0] - 2026-09-24
11
30
 
12
31
  ### Upgrading from 0.3.x
data/README.md CHANGED
@@ -215,7 +215,7 @@ All errors descend from `StandardSingpass::Myinfo::Error`, which in turn descend
215
215
  - `RateLimitError` — Singpass returned HTTP 429
216
216
  - `ConfigurationError` — gem is misconfigured (e.g. invalid ACR URN)
217
217
 
218
- `Security` raises `DecryptionError` / `SignatureError` directly. The pre-0.4.0 `Security::DecryptionError` / `Security::ValidationError` constants are deprecated aliases of those two classes.
218
+ `Security` raises `DecryptionError` / `SignatureError` directly. The pre-0.4.0 `Security::DecryptionError` / `Security::ValidationError` aliases were removed in 0.5.0; rescue `DecryptionError` / `SignatureError` (or `StandardSingpass::Myinfo::Error`).
219
219
 
220
220
  `DecryptionError` and `SignatureError` usually indicate a key/cert misconfiguration rather than an upstream outage. **Usually, not always:** verifying a signature requires fetching Singpass's JWKS, so a JWKS host that is down surfaces as a `SignatureError` (or an `AuthenticationError` on the ID-token leg) too. Those carry the JWKS response's `status` / `transport?`, so ask `FailureClassifier` rather than deciding by class — including when choosing what to feed a circuit breaker.
221
221
 
@@ -301,7 +301,7 @@ bundle exec srb tc # Sorbet typecheck — keep it green
301
301
  )
302
302
  ```
303
303
 
304
- `standard_singpass/testing` is not loaded by `require "standard_singpass"`. The old `StandardSingpass::Myinfo::EcdhJwe.encrypt` still works but is deprecated.
304
+ `standard_singpass/testing` is not loaded by `require "standard_singpass"`. The old `StandardSingpass::Myinfo::EcdhJwe.encrypt` forwarder was removed in 0.5.0.
305
305
  - **Specs that mutate configuration** should call `StandardSingpass::Myinfo.reset_configuration!` afterwards.
306
306
 
307
307
  ## License
@@ -41,31 +41,6 @@ module StandardSingpass
41
41
  "A256GCM" => 32
42
42
  }.freeze, T::Hash[String, Integer])
43
43
 
44
- # Deprecated (0.4.0): encryption is only ever needed to build fixtures
45
- # in tests — Singpass encrypts, we decrypt. It lives in
46
- # `StandardSingpass::Testing::EcdhJwe` now (`require
47
- # "standard_singpass/testing"`); this forwarder will be removed in a
48
- # future minor release.
49
- sig do
50
- params(
51
- payload: String,
52
- public_key: OpenSSL::PKey::EC,
53
- alg: String,
54
- enc: String,
55
- kid: T.nilable(String),
56
- apu: T.nilable(String),
57
- apv: T.nilable(String)
58
- ).returns(String)
59
- end
60
- def self.encrypt(payload, public_key:, alg:, enc:, kid: nil, apu: nil, apv: nil)
61
- StandardSingpass.deprecator.warn(
62
- "StandardSingpass::Myinfo::EcdhJwe.encrypt is deprecated and will be removed; " \
63
- "require \"standard_singpass/testing\" and use StandardSingpass::Testing::EcdhJwe.encrypt instead."
64
- )
65
- require "standard_singpass/testing"
66
- StandardSingpass::Testing::EcdhJwe.encrypt(payload, public_key:, alg:, enc:, kid:, apu:, apv:)
67
- end
68
-
69
44
  # Decrypts a compact-serialized JWE string.
70
45
  sig { params(jwe_string: String, private_key: OpenSSL::PKey::EC).returns(String) }
71
46
  def self.decrypt(jwe_string, private_key:)
@@ -5,21 +5,6 @@ module StandardSingpass
5
5
  class Security
6
6
  extend T::Sig
7
7
 
8
- # Deprecated aliases (0.4.0). Security used to raise its own
9
- # DecryptionError / ValidationError, which the client then translated
10
- # into the public Myinfo errors. It now raises the public errors
11
- # directly: JWE failures raise `Myinfo::DecryptionError`, JWS / JWKS
12
- # failures raise `Myinfo::SignatureError` (carrying the JWKS response's
13
- # `status`, or `transport?` when the JWKS host was unreachable, so an
14
- # outage stays distinguishable from a genuinely bad signature).
15
- #
16
- # The old names still resolve — to the same classes, so an existing
17
- # `rescue Security::ValidationError` keeps catching — and will be
18
- # removed in a future minor release.
19
- DecryptionError = Myinfo::DecryptionError
20
- ValidationError = Myinfo::SignatureError
21
- deprecate_constant :DecryptionError, :ValidationError
22
-
23
8
  JWKS_CACHE_TTL = T.let(1.hour, ActiveSupport::Duration)
24
9
 
25
10
  # Generates a PKCE code verifier and code challenge pair (S256).
@@ -31,18 +31,6 @@ module StandardSingpass
31
31
  @data ||= JSON.parse(fixture_path.read).freeze
32
32
  end
33
33
 
34
- # Deprecated (0.4.0) — unused by any consumer, and will be removed in a
35
- # future minor release. Personas are read once per process; restart the
36
- # process (or point `personas_path` at a different file) to pick up
37
- # edits.
38
- def self.reload!
39
- StandardSingpass.deprecator.warn(
40
- "StandardSingpass::Myinfo::TestPersonas.reload! is deprecated and will be removed."
41
- )
42
- @data = nil
43
- data
44
- end
45
-
46
34
  def self.fixture_path
47
35
  configured = StandardSingpass::Myinfo.configuration.personas_path
48
36
  configured ? Pathname.new(configured) : GEM_FIXTURE_PATH
@@ -1,3 +1,3 @@
1
1
  module StandardSingpass
2
- VERSION = "0.4.0"
2
+ VERSION = "0.5.0"
3
3
  end
@@ -25,7 +25,7 @@ module StandardSingpass
25
25
  # with the host's `Rails.application.deprecators` by the engine, so the
26
26
  # host's deprecation behaviour (log / raise / silence) applies.
27
27
  def deprecator
28
- @deprecator ||= ActiveSupport::Deprecation.new("0.5", "StandardSingpass")
28
+ @deprecator ||= ActiveSupport::Deprecation.new("0.6", "StandardSingpass")
29
29
  end
30
30
  end
31
31
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: standard_singpass
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 0.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jaryl Sim