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

Move state validation back into the value objects #581

Closed
TimWolla opened this issue Mar 26, 2024 · 4 comments
Closed

Move state validation back into the value objects #581

TimWolla opened this issue Mar 26, 2024 · 4 comments
Assignees
Labels
DX Developer Experience enhancement New feature or request
Milestone

Comments

@TimWolla
Copy link
Contributor

Description

This request is somewhat similar to #464: I've noticed that the PublicKeyCredentialDenormalizer verifies that the id and rawId match, but the PublicKeyCredential does not, possibly allowing the developer to create a PublicKeyCredential that is internally inconsistent.

In fact, if both IDs need to match up, why is it necessary to explicitly pass both of them. Should PublicKeyCredential perhaps just have the id as a parameter and calculate the rawId by itself?

Example

No response

@Spomky Spomky self-assigned this Apr 2, 2024
@Spomky Spomky added enhancement New feature or request DX Developer Experience labels Apr 2, 2024
@Spomky Spomky modified the milestones: 4.8.4, 4.9.0 Apr 2, 2024
@Spomky
Copy link
Contributor

Spomky commented Apr 2, 2024

Hi @TimWolla,

Indeed id and rawId are redondant. One of the values can be removed.
I will deprecate it and remove in 5.0.0.

@Spomky
Copy link
Contributor

Spomky commented Apr 9, 2024

Hi @TimWolla,

This will be deprecated by #589.
Not an easy task and it needs to be done in 2 steps:

  1. Deprecation of $id in favor of $rawId. $rawId is used almost everywhere so I prefer to deprecate the base 64 encoded value $id. Developers are now asked to use the binary version.
  2. With 5.0.0 only rawId will exist. However I prefer the property name $id. In 5.x the property $rawId will be deprecated in favor of $id, which will have the same value.

It is strange at first sight, but I don't know how to swith from a base64 encoded to a binary value for $id without causing BC breaks.

WDYT?

@Spomky
Copy link
Contributor

Spomky commented Jun 29, 2024

Thie first step is done. #590 is foreseen in 5.1.x
Closing as followed up using the other issue

@Spomky Spomky closed this as completed Jun 29, 2024
Copy link
Contributor

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 31, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
DX Developer Experience enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants