Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PublicKeyCredentialSource entity misalignment #151

Open
phavekes opened this issue Nov 30, 2024 · 0 comments
Open

PublicKeyCredentialSource entity misalignment #151

phavekes opened this issue Nov 30, 2024 · 0 comments

Comments

@phavekes
Copy link
Member

This issue is imported from pivotal - Originaly created at Apr 15, 2024 by Michiel Kodde

The Webauthn\PublicKeyCredentialSource maps the publicKeyCredentialId to the id field. We however have a more traditional auto increment numeric id field.

When the parent app tries to access our PublicKeyCredentialSource::id it is presented with a numeric ID which makes no sense to it. As it expects an UUID.

To work around this, we currently utilize a __get magic getter for the id field. Previously the vendor code would access the id via the getId method.

To fix this we should refactor our entity to let it use the publicKeyCredentialId for the id field, this would result in a schema change with some data transfer.

See:

/**
* Warning: the id field is accessed directly in :\Webauthn\CeremonyStep\CheckAllowedCredentialList::process
* The entity tracks a numeric auto increment id value, but the CheckAllowedCredentialList expects the
* publicKeyCredentialId.
*/
public function __get(string $name): mixed
{
if ($name === 'id') {
return $this->publicKeyCredentialId;
}
throw new RuntimeException(sprintf('Not allowed to access "%s" via the magic __get function', $name));
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: New
Development

No branches or pull requests

1 participant