Skip to content

Obfuscated IDs do not work in atomic operations #1089

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

Closed
bart-degreed opened this issue Sep 23, 2021 · 0 comments · Fixed by #1091
Closed

Obfuscated IDs do not work in atomic operations #1089

bart-degreed opened this issue Sep 23, 2021 · 0 comments · Fixed by #1091
Labels

Comments

@bart-degreed
Copy link
Contributor

Obfuscated IDs cannot be used with an atomic:operations request, because the deserializer attempts to convert the incoming id JSON element value to TId, bypassing any custom obfuscation logic. Instead, it should assign IIdentifiable.StringId, without performing this validation upfront.

See usages of:

private void AssertCompatibleId(IResourceIdentity resourceIdentity, Type idType)
{
if (resourceIdentity.Id != null)
{
try
{
RuntimeTypeConverter.ConvertType(resourceIdentity.Id, idType);
}
catch (FormatException exception)
{
throw new JsonApiSerializationException(null, exception.Message, null, AtomicOperationIndex);
}
}
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

Successfully merging a pull request may close this issue.

1 participant