unmagic-passkeys 0.3.0 → 0.4.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: 9d45bf4f51fee5d670d79d59a70518f2052417f00ecf549a263f1c23fa7d8aa3
4
- data.tar.gz: a97fb1cf155def235ff658328850b0bafd5cf99b18c579501e8360839084e224
3
+ metadata.gz: 5a2048cd8a99c3acaa162b95dc0aa5367bdc64e93636ada521decb76b7674786
4
+ data.tar.gz: d98723a062aac400749e3a4e2867276bc8c5ac9978d74f5daee0ae47e344933e
5
5
  SHA512:
6
- metadata.gz: d00972cba516c64383dd7ab92c2301f276db4dbba1da08b7e9e6d35e878ab73df1ec47bfbfcedd51c92e58386f168317af1a1c8e131977310b2d2adc570a83aa
7
- data.tar.gz: 74ecb8ef46d774e0f4ccf81ba0a33240d37bcf9b8fc4ccd0ea7fe5dbba76889f3c5b80864c4861ac196306f5c857ba253b29a9dd76345e514584a653593f531a
6
+ metadata.gz: 6260a130e9f0dc99f4ee2130012d3e5d7af8f6121980ef8f7307506dd7316dbe98ec21c71d1b80ad5a0fabb6c4649b94d4fc40dabb0b87336a9d2cf6733c747f
7
+ data.tar.gz: 8a3e09b0ed871180f32f63e0189152ff598f812626052bdf0b2ebd0fd4c241026106d730a54825d6f309620db4da98eb5b498261cc08a4df554b77c0a61e9803
@@ -37,6 +37,12 @@ module Unmagic
37
37
  # +Rails.application.name+ respectively.
38
38
  attr_accessor :relying_party_id, :relying_party_name
39
39
 
40
+ # Origins allowed to use passkeys registered against this relying party,
41
+ # from a different registrable domain (WebAuthn Related Origin Requests).
42
+ # Each entry is a full origin, e.g. "https://app.example.com".
43
+ # The RP ID's own domain needs no entry here.
44
+ attr_accessor :related_origins
45
+
40
46
  def initialize
41
47
  @parent_class_name = "ApplicationRecord"
42
48
  @routes_prefix = "/auth/passkeys"
@@ -48,6 +54,7 @@ module Unmagic
48
54
  @request_challenge_expiration = 5.minutes
49
55
  @relying_party_id = nil
50
56
  @relying_party_name = nil
57
+ @related_origins = []
51
58
  end
52
59
  end
53
60
  end
@@ -1,5 +1,5 @@
1
1
  module Unmagic
2
2
  module Passkeys
3
- VERSION = "0.3.0"
3
+ VERSION = "0.4.0"
4
4
  end
5
5
  end
@@ -108,7 +108,10 @@ class Unmagic::Passkeys::WebAuthn::Authenticator::Response
108
108
 
109
109
  def must_not_be_cross_origin
110
110
  if client_data["crossOrigin"] == true
111
- errors.add(:base, "Cross-origin requests are not supported")
111
+ related = Unmagic::Passkeys.configuration.related_origins
112
+ unless related.include?(client_data["origin"])
113
+ errors.add(:base, "Cross-origin requests are not supported")
114
+ end
112
115
  end
113
116
  end
114
117
 
metadata CHANGED
@@ -1,14 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: unmagic-passkeys
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Keith Pitt
8
- autorequire:
9
8
  bindir: bin
10
9
  cert_chain: []
11
- date: 2026-07-13 00:00:00.000000000 Z
10
+ date: 1980-01-02 00:00:00.000000000 Z
12
11
  dependencies:
13
12
  - !ruby/object:Gem::Dependency
14
13
  name: activerecord
@@ -132,7 +131,6 @@ metadata:
132
131
  homepage_uri: https://github.com/unreasonable-magic/unmagic-passkeys
133
132
  source_code_uri: https://github.com/unreasonable-magic/unmagic-passkeys
134
133
  changelog_uri: https://github.com/unreasonable-magic/unmagic-passkeys/blob/main/CHANGELOG.md
135
- post_install_message:
136
134
  rdoc_options: []
137
135
  require_paths:
138
136
  - lib
@@ -147,8 +145,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
147
145
  - !ruby/object:Gem::Version
148
146
  version: '0'
149
147
  requirements: []
150
- rubygems_version: 3.5.22
151
- signing_key:
148
+ rubygems_version: 4.0.20
152
149
  specification_version: 4
153
150
  summary: Passkey (WebAuthn) authentication for Rails, with no external dependencies
154
151
  test_files: []