attestation-api

module
v0.0.17 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 6, 2025 License: Apache-2.0

README

attestation-api

GitHub license GoDoc Go Report Card

License

Apache 2.0

Run make help

Specify a subcommand:

  test                 run tests
  lint                 run linter
  docker               build docker image
  tools-golangci-lint  install golangci-lint
  tools-swagger        install swagger tool
  tools-mockgen        install mockgen tool
  generate             run all file generation for the project
  swagger              generate swagger documentation
  go-generate          run go generate

Devlopment

Running this locally requires the following services to be running:

VIN VC Eligibility Logic

1. Check if there is Currently a Valid VC for the NFT
  • Check Existing VCs for NFT:
    • Query to determine if there is already a valid VC for the requesting NFT.
    • If a valid VC exists return a success response with the VC query.
2. Get the Paired Device(s) for the NFT
  • Retrieve Device(s) from Identity API:
    • Call the identity-api to get the device(s) (aftermarket and/or synthetic) associated with the NFT.
    • Ensure the devices are correctly paired with the NFT.
4. Get the Latest Fingerprint Messages for the Paired Device(s)
  • Retrieve Fingerprint Messages:

    • Obtain the latest fingerprint messages for the paired device(s) of the NFT.
  • No Fingerprint Messages:

    • If there are no fingerprint messages for the paired device(s), return an error.
5. Validate VIN for Each Paired Device Matches
  • Ensure VIN Consistency:
    • Use Latest Message as Source of Truth:
      • If the VINs from the paired devices do not match, use the VIN from the latest fingerprint message as the source of truth.
6. Validate VIN Decodes Correctly
  • Decode and Validate VIN:
    • Decode the VIN from the latest fingerprint message.
    • Ensure the VIN decodes to the same manufacturer, model, and year as per vehicle record in identity-api.
7. Generate New VC
  • Generate a new VC for the tokenId and VIN
  • Store the VC in s3
8. Return VC Query
  • Return a query to be run on telemetry-api for VC retrieval

Directories

Path Synopsis
cmd
Package docs Code generated by swaggo/swag.
Package docs Code generated by swaggo/swag.
internal
app
attestation/apis/identity
Package identity provides functionality to interact with the identity GraphQL API.
Package identity provides functionality to interact with the identity GraphQL API.
attestation/vinvc
Package vinvc provides the controller for handling VIN VC-related requests.
Package vinvc provides the controller for handling VIN VC-related requests.
pkg
verifiable
Package verifiable provides functionality managing verifiable credentials.
Package verifiable provides functionality managing verifiable credentials.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL