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

feat(core): KID in NanoTDF #324

Closed
wants to merge 11 commits into from
Closed

feat(core): KID in NanoTDF #324

wants to merge 11 commits into from

Conversation

pflynn-virtru
Copy link
Member

@pflynn-virtru pflynn-virtru commented Aug 15, 2024

NanoTDF will now have the KAS KID set in the KAS ResourceLocator

Introduces a new enum for identifier length and modifies the ResourceLocator class to include this identifier and its encoding/decoding logic. This enhances the resource locator functionality by supporting identifiers of varying lengths.

Resolves #311
Specification: opentdf/spec#40
ADR: opentdf/platform#900

Introduces a new enum for identifier length and modifies the ResourceLocator class to include this identifier and its encoding/decoding logic. This enhances the resource locator functionality by supporting identifiers of varying lengths.
Copy link

If these changes look good, signoff on them with:

git pull && git commit --amend --signoff && git push --force-with-lease origin

If they aren't any good, please remove them with:

git pull && git reset --hard HEAD~1 && git push --force-with-lease origin

Signed-off-by: Paul Flynn <pflynn@virtru.com>
pflynn-virtru and others added 3 commits August 15, 2024 14:01
Corrected the bitwise operation for identifier type nibble check to accurately detect the 'None' type. Also removed an outdated TODO comment related to padding in identifier decoding.
Initialize `identifierType` to `None` explicitly before evaluating the protocol nibble. This simplifies the conditional logic by setting a default value upfront and adjusting it only when specific conditions are met.
Copy link

If these changes look good, signoff on them with:

git pull && git commit --amend --signoff && git push --force-with-lease origin

If they aren't any good, please remove them with:

git pull && git reset --hard HEAD~1 && git push --force-with-lease origin

Initialized `identifierType` to `ResourceLocatorIdentifierEnum.None` by default in the `ResourceLocator` model. Removed redundant assignment in constructor and adjusted identifier length calculation accordingly.

Signed-off-by: Paul Flynn <pflynn@virtru.com>
Changed the allocation of the buffer to use identifierType.valueOf() instead of this.identifier.length. This ensures accurate buffer sizing based on the identifier type's value.
Changed the allocation of the buffer to use identifierType.valueOf() instead of this.identifier.length. This ensures accurate buffer sizing based on the identifier type's value.

Signed-off-by: Paul Flynn <pflynn@virtru.com>
Included new test cases to verify the parsing logic of the ResourceLocator identifiers in different byte formats such as two bytes, eight bytes, and thirty-two bytes. This ensures that the identifier type and value are correctly parsed and validated.
Copy link

If these changes look good, signoff on them with:

git pull && git commit --amend --signoff && git push --force-with-lease origin

If they aren't any good, please remove them with:

git pull && git reset --hard HEAD~1 && git push --force-with-lease origin

Signed-off-by: Paul Flynn <pflynn@virtru.com>
Streamline the identifier extraction by removing padding bytes before decoding. This change accounts for null byte padding that was previously being included in the identifier, ensuring cleaner and more accurate decoding.
Copy link

sonarcloud bot commented Aug 15, 2024

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

Successfully merging this pull request may close these issues.

feat: nanotdf key id support
1 participant