Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Squashed commit of the following: commit e4d19e2 Author: Paul Flynn <pflynn@virtru.com> Date: Thu Aug 15 16:38:37 2024 -0400 Refactor ResourceLocator identifier handling 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. commit 0b587f6 Author: pflynn-virtru <pflynn-virtru@users.noreply.github.com> Date: Thu Aug 15 19:46:19 2024 +0000 🤖 🎨 Autoformat Signed-off-by: Paul Flynn <pflynn@virtru.com> commit 47fcaba Author: Paul Flynn <pflynn@virtru.com> Date: Thu Aug 15 15:44:39 2024 -0400 Add tests for ResourceLocator identifier parsing 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. commit aa8a011 Author: Paul Flynn <pflynn@virtru.com> Date: Thu Aug 15 14:25:26 2024 -0400 Update buffer allocation in toBuffer method 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> commit b216fbd Author: Paul Flynn <pflynn@virtru.com> Date: Thu Aug 15 14:19:47 2024 -0400 Update buffer allocation in toBuffer method 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. commit bcef48d Author: Paul Flynn <pflynn@virtru.com> Date: Thu Aug 15 14:11:32 2024 -0400 Set default identifierType to None in ResourceLocator 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> commit 3ef7670 Author: pflynn-virtru <pflynn-virtru@users.noreply.github.com> Date: Thu Aug 15 18:08:15 2024 +0000 🤖 🎨 Autoformat commit a5958c4 Author: Paul Flynn <pflynn@virtru.com> Date: Thu Aug 15 14:06:17 2024 -0400 Refactor identifier type initialization in ResourceLocator 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. commit a83e22d Author: Paul Flynn <pflynn@virtru.com> Date: Thu Aug 15 14:01:19 2024 -0400 Fix identifier type detection in ResourceLocator.ts 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. commit 8262fbd Author: pflynn-virtru <pflynn-virtru@users.noreply.github.com> Date: Thu Aug 15 17:23:36 2024 +0000 🤖 🎨 Autoformat Signed-off-by: Paul Flynn <pflynn@virtru.com> commit d4b53d0 Author: Paul Flynn <pflynn@virtru.com> Date: Thu Aug 15 13:19:22 2024 -0400 Add identifier handling to 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. * Update kasUrl to accept ResourceLocator type Modified the `encrypt` function to allow `kasUrl` parameter to accept either a string or a `ResourceLocator` type, enhancing flexibility. Added type checks and adjusted usage of `ResourceLocator` accordingly.
- Loading branch information