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 KAS ResourceLocator #1190

Draft
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

pflynn-virtru
Copy link
Member

@pflynn-virtru pflynn-virtru commented Jul 22, 2024

Proposed format for KAS URL

https://kas.example.com?kid=e0

The 'getURL' method has been updated to 'GetURL' in the ResourceLocator struct. Also, a 'GetKasUrl' method has been added to the NanoTDFHeader struct. These updates ensure KID is effectively fetched and used within the code. A Query parameter handling function 'addQueryParamToURL' has also been added to help in adding "kid" parameter to the URL.

#900
#717
#1203

The 'getURL' method has been updated to 'GetURL' in the ResourceLocator struct. Also, a 'GetKasUrl' method has been added to the NanoTDFHeader struct. These updates ensure KID is effectively fetched and used within the code. A Query parameter handling function 'addQueryParamToURL' has also been added to help in adding "kid" parameter to the URL.
Added a debug log to display the kasPublicKey fingerprint. Also, the 'kid' parameter in 'addQueryParamToURL' method is now hardcoded to "e0" instead of using the result of the calculated 'kidHex'.
The error message that is returned when there's an issue with extracting the policy in rewrap.go has been updated to start with a capital letter, ensuring consistency in error message formatting across the codebase.
@pflynn-virtru pflynn-virtru changed the title feat(core): Update methods to use KID in NanoTDF and ResourceLocator feat(core): Update methods to use KID in NanoTDF KAS ResourceLocator Jul 22, 2024
@pflynn-virtru pflynn-virtru changed the title feat(core): Update methods to use KID in NanoTDF KAS ResourceLocator feat(core): KID in NanoTDF KAS ResourceLocator Jul 22, 2024
The update modifies the function to omit the 'kid' query parameter from all URLs. This parameter was deleted from the queries and then re-encoded. The change prevents potential issues that might arise from passing 'kid' in our requests.
The commit modifies the function to directly retrieve the key identifier (kid) from the KAS public key endpoint instead of computing it inline. This simplifies the process, reduces code redundancy, and makes debugging easier, since now the 'kid' is being fetched directly along with the public key.
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.

1 participant