attestation-api

module
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Jul 5, 2024 License: Apache-2.0

README

attestation-api

GitHub license GoDoc Go Report Card

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
  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:

License

Apache 2.0

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 it and end the process.
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:
    • Verify that the VIN in the latest fingerprint messages from the paired device(s) matches each other.
    • 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 records.
7. Generate New VC
  • Create VIN VC:
    • Generate a new VC for the NFT, including:
      • VIN: The Vehicle Identification Number.
      • Issuance Date: The timestamp of credential issuance.
      • Expiration Date: The timestamp indicating when the credential will expire.
      • Issuer: The entity issuing the VC.
      • Proof: Digital signature or cryptographic proof.
    • Sign and Store VC:
      • Ensure the VC is digitally signed to maintain integrity and authenticity.
      • Store the VC securely in the system.
8. Issue VC
  • Return a query to be run on telemetry-api for VC retrieval

Directories

Path Synopsis
cmd
attestation-api command
Package docs Code generated by swaggo/swag.
Package docs Code generated by swaggo/swag.
internal
controllers/vc
Package vc provides the controller for handling VIN VC-related requests.
Package vc provides the controller for handling VIN VC-related requests.
services/identity
Package identity provides functionality to interact with the identity GraphQL API.
Package identity provides functionality to interact with the identity GraphQL API.
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