Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Token Verification Client Enhancements
This pull request enhances the client-side handling of token verification, making it more robust and integrated with the new token verification API.
Key Changes:
tokenverification
API/Command:/api/validate-token?token={tokenID}
& command./rubixgoplatform validatetoken -token {tokenID}
has been created to encapsulate the logic for interacting with the token verification API.TokenVerificationClient
:TokenVerificationClient
struct has been introduced to handle API calls and responses.Input/Output Interfaces:
TokenVerificationRequest
andTokenVerificationResponse
) define the expected format of the API request and response data, enhancing code readability and maintainability.VerifyTokens
Function:TokenVerificationClient
handles the core logic of sending the verification request and processing the response.Integration into
ValidateToken
:ValidateToken
function in thecore
package has been updated to use theTokenVerificationClient
to verify tokens.IPFS Integration:
ValidateToken
function now seamlessly handles reading token hashes from IPFS using anio.ReadCloser
and ensures proper newline trimming for correct JSON formatting.Benefits:
How to Test:
VerifyTokens
function or integrate it into your existing code (like in theValidateToken
example) to make verification requests.Remember: You might need to adjust the
ServerURL
in theVerifyTokens
function and ensure theensweb.Client
configuration is set up correctly in yourTokenVerificationClient
to match your actual API endpoint.