-
Notifications
You must be signed in to change notification settings - Fork 104
Open
Labels
Description
This issue comes from Max's feedback on the initial multi-tenancy docs update:
I think we also need a guide on how to sign requests to the Admin API, basically doing the inverse of the signature verification:
const timestamp = Date.now()
const version = process.env.SIGNATURE_VERSION
const { query, variables, operationName } = request
const formattedRequest = {
variables,
operationName,
query: print(query)
}
const payload = `${timestamp}.${canonicalize(formattedRequest)}`
const hmac = createHmac(
'sha256',
process.env.API_SECRET
)
hmac.update(payload)
const digest = hmac.digest('hex')
headers['signature'] = `t=${timestamp}, v${version}=${digest}`
headers['tenant-id'] = process.env.OPERATOR_TENANT_ID
Metadata
Metadata
Assignees
Labels
Type
Projects
Status
Backlog
Status
In Progress