$ vestauth agent init
auth for agents
Install
$ curl -sSf https://vestauth.sh | shUsage
# Give agents cryptographic identities…
$ vestauth agent init# …and sign their curl requests with cryptographic authentication.
$ vestauth agent curl https://ping.vestauth.com/pingTool Usage
# Verify requests and safely trust agent identity using cryptographic proof.
// index.js
const express = require('express')
const vestauth = require('vestauth')
const app = express()
// vestauth agent curl https://ping.vestauth.com/ping
app.get('/whoami', async (req, res) => {
try {
const url = `${req.protocol}://${req.get('host')}${req.originalUrl}`
const agent = await vestauth.tool.verify(req.method, url, req.headers)
res.json(agent)
} catch (err) {
res.status(401).json({ code: 401, error: { message: err.message }})
}
})
app.listen(3000)