$ vestauth agent init
auth for agents
Install
$ curl -sSf https://vestauth.sh | sh
Usage
# Give agents cryptographic identities…
$ vestauth agent init
# …and sign their curl requests with cryptographic authentication.
$ vestauth agent curl https://ping.vestauth.com/ping
Provider 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.provider.verify(req.method, url, req.headers)
res.json(agent)
} catch (err) {
res.status(401).json({ code: 401, error: { message: err.message }})
}
})
app.listen(3000)