vestauth 0.21.1 → 0.22.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +14 -2
- package/README.md +111 -28
- package/package.json +1 -1
- package/src/cli/actions/agent/curl.js +52 -1
- package/src/server/index.js +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,7 +2,19 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
|
|
4
4
|
|
|
5
|
-
[Unreleased](https://github.com/vestauth/vestauth/compare/v0.
|
|
5
|
+
[Unreleased](https://github.com/vestauth/vestauth/compare/v0.22.1...main)
|
|
6
|
+
|
|
7
|
+
## [0.22.1](https://github.com/vestauth/vestauth/compare/v0.22.0...v0.22.1) (2026-03-02)
|
|
8
|
+
|
|
9
|
+
### Changed
|
|
10
|
+
|
|
11
|
+
* `vestauth server start` should use `POST /whoami`
|
|
12
|
+
|
|
13
|
+
## [0.22.0](https://github.com/vestauth/vestauth/compare/v0.21.1...v0.22.0) (2026-03-02)
|
|
14
|
+
|
|
15
|
+
### Changed
|
|
16
|
+
|
|
17
|
+
* `agent curl` now by default prepends `-X POST` and `-H "Content-Type: application/json"` ([#45](https://github.com/vestauth/vestauth/pull/45))
|
|
6
18
|
|
|
7
19
|
## [0.21.1](https://github.com/vestauth/vestauth/compare/v0.21.0...v0.21.1) (2026-02-25)
|
|
8
20
|
|
|
@@ -94,7 +106,7 @@ All notable changes to this project will be documented in this file. See [standa
|
|
|
94
106
|
|
|
95
107
|
### Changed
|
|
96
108
|
|
|
97
|
-
* Move from `*.agents.vestauth.com` FQDN to `*.api.
|
|
109
|
+
* Move from `*.agents.vestauth.com` FQDN to `*.api.vestauth.com` to prepare way for custom `--hostname` for internal enterprise use cases.
|
|
98
110
|
|
|
99
111
|
## [0.12.1](https://github.com/vestauth/vestauth/compare/v0.12.0...v0.12.1) (2026-02-17)
|
|
100
112
|
|
package/README.md
CHANGED
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
*web-bot-auth for agents*–from the creator of [`dotenv`](https://github.com/motdotla/dotenv) and [`dotenvx`](https://github.com/dotenvx/dotenvx).
|
|
4
4
|
|
|
5
5
|
* identity ([web-bot-auth](https://datatracker.ietf.org/doc/html/draft-meunier-web-bot-auth-architecture))
|
|
6
|
-
* authentication
|
|
7
6
|
* tools!
|
|
7
|
+
* authentication
|
|
8
8
|
|
|
9
9
|
<a target="_blank" href="https://chat.openai.com/?q=Read%20https%3A%2F%2Fgithub.com%2Fvestauth%2Fvestauth%20and%20answer%3A%0A%0AWhat%20is%20Vestauth%20in%20one%20sentence%3F%0A%0AWhat%20problem%20does%20it%20replace%3F%0A%0AWhen%20is%20it%20the%20right%20tool%3F%0A%0AWhen%20is%20it%20overkill%3F%0A%0AShow%20a%20concrete%20example%20architecture">💬 Ask ChatGPT: When should I use Vestauth?</a>
|
|
10
10
|
|
|
@@ -94,15 +94,122 @@ AGENT_PRIVATE_JWK="{"crv":"Ed25519","d":"Z9vbwN-3eiFMVv_TPWXOxqSMJAT21kZvejWi72y
|
|
|
94
94
|
|
|
95
95
|
|
|
96
96
|
|
|
97
|
+
## Tools
|
|
98
|
+
|
|
99
|
+
> Call tools!
|
|
100
|
+
|
|
101
|
+
```sh
|
|
102
|
+
vestauth agent curl https://sfs.vestauth.com/write -d '{"filepath":"/hello.md", "content":"hello"}'
|
|
103
|
+
vestauth agent curl https://sfs.vestauth.com/list
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
#### First Party
|
|
107
|
+
|
|
108
|
+
<details><summary>`SFS` Simple File System</summary><br/>
|
|
109
|
+
|
|
110
|
+
> SFS is a simple file system for vestauth agents.
|
|
111
|
+
>
|
|
112
|
+
> [sfs.vestauth.com](https://sfs.vestauth.com)
|
|
113
|
+
|
|
114
|
+
```sh
|
|
115
|
+
# write a file
|
|
116
|
+
vestauth agent curl https://sfs.vestauth.com/write -d '{"filepath":"/hello.md", "content":"hello"}'
|
|
117
|
+
|
|
118
|
+
# delete a file
|
|
119
|
+
vestauth agent curl https://sfs.vestauth.com/delete -d '{"filepath":"/hello.md"}'
|
|
120
|
+
|
|
121
|
+
# list files
|
|
122
|
+
vestauth agent curl https://sfs.vestauth.com/list
|
|
123
|
+
|
|
124
|
+
# read a file
|
|
125
|
+
vestauth agent curl https://sfs.vestauth.com/read -d '{"filepath":"/hello.md"}'
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
|
|
129
|
+
|
|
130
|
+
</details>
|
|
131
|
+
<details><summary>`GEO` geo.vestauth.com</summary><br/>
|
|
132
|
+
|
|
133
|
+
> GEO returns the current geo-coordinates of a vestauth agent.
|
|
134
|
+
>
|
|
135
|
+
> [geo.vestauth.com](https://geo.vestauth.com)
|
|
136
|
+
|
|
137
|
+
```sh
|
|
138
|
+
# make a ping
|
|
139
|
+
vestauth agent curl https://ping.vestauth.com/ping
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
|
|
143
|
+
|
|
144
|
+
</details>
|
|
145
|
+
|
|
146
|
+
#### Third Party
|
|
147
|
+
|
|
148
|
+
<details><summary>`AS2` Agentic Secret Storage</summary><br/>
|
|
149
|
+
|
|
150
|
+
> AS2 is a simple, agent-friendly secret storage.
|
|
151
|
+
>
|
|
152
|
+
> [as2.dotenvx.com](https://as2.dotenvx.com)
|
|
153
|
+
|
|
154
|
+
```sh
|
|
155
|
+
# set a secret
|
|
156
|
+
vestauth agent curl https://as2.dotenvx.com/set -d '{"KEY":"value"}'
|
|
157
|
+
|
|
158
|
+
# get all secrets
|
|
159
|
+
vestauth agent curl "https://as2.dotenvx.com/get"
|
|
160
|
+
|
|
161
|
+
# get single secret
|
|
162
|
+
vestauth agent curl "https://as2.dotenvx.com/get?key=KEY"
|
|
163
|
+
|
|
164
|
+
# get multiple secrets
|
|
165
|
+
vestauth agent curl "https://as2.dotenvx.com/get?key=KEY,TWILIO"
|
|
166
|
+
```
|
|
167
|
+
|
|
168
|
+
|
|
169
|
+
|
|
170
|
+
</details>
|
|
171
|
+
<details><summary>`Docle` Check if email address is real</summary><br>
|
|
172
|
+
|
|
173
|
+
> Check if an email address is real before you hit send. Verifies syntax, DNS, MX records, SMTP mailbox existence, and cross-references multiple providers. All in real time, no signup required.
|
|
174
|
+
>
|
|
175
|
+
> [github.com/treadiehq/docle](https://github.com/treadiehq/docle)
|
|
176
|
+
|
|
177
|
+
```sh
|
|
178
|
+
# verify an email
|
|
179
|
+
vestauth agent curl https://docle.co/api/verify -d '{"emails":["test@example.com"]}'
|
|
180
|
+
|
|
181
|
+
# check your usage
|
|
182
|
+
vestauth agent curl https://docle.co/api/agent/usage
|
|
183
|
+
```
|
|
184
|
+
|
|
185
|
+
|
|
186
|
+
|
|
187
|
+
</details>
|
|
188
|
+
<details><summary>more coming soon</summary><br/>
|
|
189
|
+
|
|
190
|
+
* Geo IP - coming soon
|
|
191
|
+
* Send/Receive Email - coming
|
|
192
|
+
* Send/Receive SMS - coming
|
|
193
|
+
* Send/Receive Telegram - coming
|
|
194
|
+
* Send/Receive WhatsApp - coming
|
|
195
|
+
* Human-in-the-loop - coming
|
|
196
|
+
* Rotate NPM Tokens - coming
|
|
197
|
+
* Rotate GitHub Tokens - coming
|
|
198
|
+
* Working on a tool? Tell us and we'll list it.
|
|
199
|
+
|
|
200
|
+
</details>
|
|
201
|
+
|
|
202
|
+
|
|
203
|
+
|
|
97
204
|
## Authentication
|
|
98
205
|
|
|
99
|
-
> Authenticate
|
|
206
|
+
> Build your own tools. Authenticate them with a single line of code – `vestauth.tool.verify`…
|
|
100
207
|
|
|
101
208
|
```js
|
|
102
209
|
...
|
|
103
210
|
const vestauth = require('vestauth')
|
|
104
211
|
|
|
105
|
-
app.
|
|
212
|
+
app.post('/whoami', async (req, res) => {
|
|
106
213
|
try {
|
|
107
214
|
const url = `${req.protocol}://${req.get('host')}${req.originalUrl}`
|
|
108
215
|
const agent = await vestauth.tool.verify(req.method, url, req.headers)
|
|
@@ -138,31 +245,7 @@ $ vestauth primitives headers GET https://api.vestauth.com/whoami --pp
|
|
|
138
245
|
|
|
139
246
|
</details>
|
|
140
247
|
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
## Tools
|
|
144
|
-
|
|
145
|
-
> Call tools!
|
|
146
|
-
|
|
147
|
-
```sh
|
|
148
|
-
$ vestauth agent curl -X POST https://as2.dotenvx.com/set -d '{"KEY":"value"}'
|
|
149
|
-
$ vestauth agent curl https://as2.dotenvx.com/get
|
|
150
|
-
```
|
|
151
|
-
|
|
152
|
-
#### List of tools
|
|
153
|
-
|
|
154
|
-
* Ping - https://ping.vestauth.com
|
|
155
|
-
* Agentic Secret Storage - https://as2.dotenvx.com
|
|
156
|
-
* Geo IP - coming soon
|
|
157
|
-
* Filesystem - coming soon
|
|
158
|
-
* Send/Receive Email - coming
|
|
159
|
-
* Send/Receive SMS - coming
|
|
160
|
-
* Send/Receive Telegram - coming
|
|
161
|
-
* Send/Receive WhatsApp - coming
|
|
162
|
-
* Human-in-the-loop - coming
|
|
163
|
-
* Rotate NPM Tokens - coming
|
|
164
|
-
* Rotate GitHub Tokens - coming
|
|
165
|
-
* Working on a tool? Tell us and wel'll list it.
|
|
248
|
+
Vestauth handles usage, payments, and spam protection for your tool!
|
|
166
249
|
|
|
167
250
|
|
|
168
251
|
|
package/package.json
CHANGED
|
@@ -5,6 +5,53 @@ const Errors = require('./../../../lib/helpers/errors')
|
|
|
5
5
|
const findUrl = require('./../../../lib/helpers/findUrl')
|
|
6
6
|
const catchAndLog = require('./../../../lib/helpers/catchAndLog')
|
|
7
7
|
|
|
8
|
+
function requestMethodFromArgs (args) {
|
|
9
|
+
for (let i = 0; i < args.length; i++) {
|
|
10
|
+
const arg = args[i]
|
|
11
|
+
|
|
12
|
+
if (arg === '-X' || arg === '--request') {
|
|
13
|
+
const method = args[i + 1]
|
|
14
|
+
if (method) return method.toUpperCase()
|
|
15
|
+
continue
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
if (arg.startsWith('--request=')) {
|
|
19
|
+
return arg.slice('--request='.length).toUpperCase()
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
if (arg.startsWith('-X') && arg.length > 2) {
|
|
23
|
+
return arg.slice(2).toUpperCase()
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
return null
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
function hasContentTypeHeader (args) {
|
|
31
|
+
for (let i = 0; i < args.length; i++) {
|
|
32
|
+
const arg = args[i]
|
|
33
|
+
|
|
34
|
+
if (arg === '-H' || arg === '--header') {
|
|
35
|
+
const header = args[i + 1] || ''
|
|
36
|
+
if (header.toLowerCase().startsWith('content-type:')) return true
|
|
37
|
+
continue
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
if (arg.startsWith('--header=')) {
|
|
41
|
+
const header = arg.slice('--header='.length)
|
|
42
|
+
if (header.toLowerCase().startsWith('content-type:')) return true
|
|
43
|
+
continue
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
if (arg.startsWith('-H') && arg.length > 2) {
|
|
47
|
+
const header = arg.slice(2)
|
|
48
|
+
if (header.toLowerCase().startsWith('content-type:')) return true
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
return false
|
|
53
|
+
}
|
|
54
|
+
|
|
8
55
|
async function curl () {
|
|
9
56
|
try {
|
|
10
57
|
const commandArgs = this.args
|
|
@@ -13,14 +60,18 @@ async function curl () {
|
|
|
13
60
|
const options = this.opts()
|
|
14
61
|
logger.debug(`options: ${JSON.stringify(options)}`)
|
|
15
62
|
|
|
16
|
-
const httpMethod = '
|
|
63
|
+
const httpMethod = requestMethodFromArgs(commandArgs) || 'POST'
|
|
17
64
|
const url = findUrl(commandArgs)
|
|
18
65
|
const headers = await agent.headers(httpMethod, url)
|
|
66
|
+
const includeRequestMethod = requestMethodFromArgs(commandArgs) === null
|
|
67
|
+
const includeContentType = !hasContentTypeHeader(commandArgs)
|
|
19
68
|
const injected = [
|
|
20
69
|
'curl',
|
|
21
70
|
'-H', `Signature: ${headers.Signature}`,
|
|
22
71
|
'-H', `Signature-Input: ${headers['Signature-Input']}`,
|
|
23
72
|
'-H', `Signature-Agent: ${headers['Signature-Agent']}`,
|
|
73
|
+
...(includeRequestMethod ? ['-X', 'POST'] : []),
|
|
74
|
+
...(includeContentType ? ['-H', 'Content-Type: application/json'] : []),
|
|
24
75
|
...commandArgs
|
|
25
76
|
]
|
|
26
77
|
|
package/src/server/index.js
CHANGED
|
@@ -105,7 +105,7 @@ app.get('/.well-known/http-message-signatures-directory', async (req, res) => {
|
|
|
105
105
|
return res.json({ keys })
|
|
106
106
|
})
|
|
107
107
|
|
|
108
|
-
app.
|
|
108
|
+
app.post('/whoami', async (req, res) => {
|
|
109
109
|
try {
|
|
110
110
|
const url = `${req.protocol}://${req.get('host')}${req.originalUrl}`
|
|
111
111
|
const attrs = {
|