Skip to content

Commit

Permalink
Add index on publicKeyCredentialId in Doctrine mapping (#670)
Browse files Browse the repository at this point in the history
* Set publicKeyCredentialId as unique in ORM mapping

Marked the publicKeyCredentialId field as unique in the PublicKeyCredentialSource mapping configuration. This ensures database-level enforcement of uniqueness for this field, preventing duplicate entries.

* Set publicKeyCredentialId as unique in ORM mapping

Marked the publicKeyCredentialId field as unique in the PublicKeyCredentialSource mapping configuration. This ensures database-level enforcement of uniqueness for this field, preventing duplicate entries.
  • Loading branch information
Spomky authored Jan 18, 2025
1 parent 3cc89ba commit 281025e
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 7 deletions.
6 changes: 0 additions & 6 deletions phpstan-baseline.neon
Original file line number Diff line number Diff line change
Expand Up @@ -2100,12 +2100,6 @@ parameters:
count: 1
path: src/webauthn/src/MetadataService/Statement/MetadataStatement.php

-
message: '#^Since web\-auth/webauthn\-lib 5\.1\.0\: The parameter "\$icon" is deprecated since 5\.1\.0 and will be removed in 6\.0\.0\. This value has no effect\. Please set "null" instead\.\.$#'
identifier: todoBy.sfDeprecation
count: 1
path: src/webauthn/src/PublicKeyCredentialEntity.php

-
message: '#^Parameter \#1 \$extensions of static method Webauthn\\AuthenticationExtensions\\AuthenticationExtensions\:\:create\(\) expects array\<Webauthn\\AuthenticationExtensions\\AuthenticationExtension\>, array\<Webauthn\\AuthenticationExtensions\\AuthenticationExtensions\> given\.$#'
identifier: argument.type
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
xsi:schemaLocation="http://doctrine-project.org/schemas/orm/doctrine-mapping https://raw.github.com/doctrine/doctrine2/master/doctrine-mapping.xsd"
>
<mapped-superclass name="Webauthn\PublicKeyCredentialSource">
<field name="publicKeyCredentialId" type="base64"/>
<field name="publicKeyCredentialId" type="base64" unique="true"/>
<field name="type"/>
<field name="transports" type="json"/>
<field name="attestationType"/>
Expand Down

0 comments on commit 281025e

Please sign in to comment.