From 798ed267e052a09fddab705cf91f5bc2f1a2dccf Mon Sep 17 00:00:00 2001 From: Oskar Eichler <62393985+OskarEichler@users.noreply.github.com> Date: Sun, 30 Aug 2026 04:38:18 +0200 Subject: [PATCH 1/2] Reset cached encoder when encoding changes --- lib/webauthn/relying_party.rb | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/lib/webauthn/relying_party.rb b/lib/webauthn/relying_party.rb index 2b6db690..31fa853b 100644 --- a/lib/webauthn/relying_party.rb +++ b/lib/webauthn/relying_party.rb @@ -48,7 +48,6 @@ def initialize( end attr_accessor :algorithms, - :encoding, :allowed_origins, :allowed_top_origins, :id, @@ -60,6 +59,8 @@ def initialize( :acceptable_attestation_types, :legacy_u2f_appid + attr_reader :encoding + attr_reader :attestation_root_certificates_finders # This is the user-data encoder. @@ -68,6 +69,13 @@ def encoder @encoder ||= WebAuthn::Encoder.new(encoding) end + attr_writer :encoder + + def encoding=(encoding) + @encoding = encoding + @encoder = nil + end + def attestation_root_certificates_finders=(finders) if !finders.respond_to?(:each) finders = [finders] From e301da935a0b341ab85469b224f7e456113d7af8 Mon Sep 17 00:00:00 2001 From: Oskar Eichler <62393985+OskarEichler@users.noreply.github.com> Date: Fri, 4 Sep 2026 22:55:50 +0700 Subject: [PATCH 2/2] Apply attr reader review feedback --- lib/webauthn/relying_party.rb | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/lib/webauthn/relying_party.rb b/lib/webauthn/relying_party.rb index 31fa853b..a9ec0900 100644 --- a/lib/webauthn/relying_party.rb +++ b/lib/webauthn/relying_party.rb @@ -59,9 +59,7 @@ def initialize( :acceptable_attestation_types, :legacy_u2f_appid - attr_reader :encoding - - attr_reader :attestation_root_certificates_finders + attr_reader :encoding, :attestation_root_certificates_finders # This is the user-data encoder. # Used to decode user input and to encode data provided to the user.