Sauron
Introduction
Sauron is the GraphQL API your application’s server will call to request the data you seek using the data key.
Sauron Helper Packages
We provide packages that makes it super easy to interact with the Sauron API. They completely abstract away the complexity of authentication and interacting with the GraphQL APIs.
Installation
This will generate an eyeofsauron
folder in your project root directory.
Usage
Import the package
Get Activity
Get Traits
Read more on Github.
Roll Your Own
Every request to the Sauron API needs to be authenticated using your privateKey
. This is required to validate that the data request is truly coming from your application.
Prepare the signature
Start by creating a digital signature of your request’s body. You’ll need to hash the body of your request using
SHA-256 and then sign the hash with ECDSA using your privateKey
.
Encode the signature
After signing, encode the digital signature using Base64.
Add signature header
Add the Base64-encoded signature to the request’s headers with the key X-Gandalf-Signature
.
privateKey
is extremely important. All requests to Sauron should be made server-side.See example code snippets: