vestauth 0.12.0 → 0.13.0

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 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.12.0...main)
5
+ [Unreleased](https://github.com/vestauth/vestauth/compare/v0.13.0...main)
6
+
7
+ ## [0.13.0](https://github.com/vestauth/vestauth/compare/v0.12.1...v0.13.0) (2026-02-18)
8
+
9
+ ### Changed
10
+
11
+ * Move from `*.agents.vestauth.com` FQDN to `*.api.vestaut.com` to prepare way for custom `--hostname` for internal enterprise use cases.
12
+
13
+ ## [0.12.1](https://github.com/vestauth/vestauth/compare/v0.12.0...v0.12.1) (2026-02-17)
14
+
15
+ ### Changed
16
+
17
+ * Change usage message to `vestauth agent init`
6
18
 
7
19
  ## [0.12.0](https://github.com/vestauth/vestauth/compare/v0.11.2...v0.12.0) (2026-02-17)
8
20
 
package/README.md CHANGED
@@ -113,7 +113,7 @@ $ vestauth primitives headers GET https://api.vestauth.com/whoami --pp
113
113
  {
114
114
  "Signature": "sig1=:d4Id5SXhUExsf1XyruD8eBmlDtWzt/vezoCS+SKf0M8CxSkhKBtdHH7KkYyMN6E0hmxmNHsYus11u32nhvpWBQ==:",
115
115
  "Signature-Input": "sig1=(\"@authority\");created=1770247189;keyid=\"B0u80Gw28W9U2Jl5t_EBiWeBajO2104kOYZ9Ikucl5I\";alg=\"ed25519\";expires=1770247489;nonce=\"NURxn28X7zyKJ9k5bHxuOyO5qdvF9L5s2qHmhTrGUzbwGSIoUCHmwSlwiiCRgTDGuum83yyWMHJU4jmrVI_XPg\";tag=\"web-bot-auth\"",
116
- "Signature-Agent": "sig1=agent-4b94ccd425e939fac5016b6b.agents.vestauth.com"
116
+ "Signature-Agent": "sig1=agent-4b94ccd425e939fac5016b6b.api.vestauth.com"
117
117
  }
118
118
  ```
119
119
 
@@ -242,7 +242,7 @@ $ vestauth agent curl https://api.vestauth.com/whoami --pp
242
242
  "public_jwk": {
243
243
  ...
244
244
  },
245
- "well_known_url": "https://agent-609a4fd2ebf4e6347108c517.agents.vestauth.com/.well-known/http-message-signatures-directory"
245
+ "well_known_url": "https://agent-609a4fd2ebf4e6347108c517.api.vestauth.com/.well-known/http-message-signatures-directory"
246
246
  }
247
247
  ```
248
248
 
@@ -257,7 +257,7 @@ $ vestauth agent headers GET https://api.vestauth.com/whoami --pp
257
257
  {
258
258
  "Signature": "sig1=:UW6A7j8jo+gQxd+EeVgDddY51ZOc9plrSaupW/N53hQnQFvP9BuwQHgL7SVPLQIu4cnRzLgvwm7Yu9YMO+HUDQ==:",
259
259
  "Signature-Input": "sig1=(\"@authority\");created=1770396357;keyid=\"FGzgs758DBGnI1S0BejChDsK0IKZm3qPpOOXdRnnBkM\";alg=\"ed25519\";expires=1770396657;nonce=\"PrE7A6I_5fWnxBsBigNvxjp3-YangXl71V1uM3hPZavh918JqzjMSRcjHv_n5XIb3N8WivZEeigCBH6QGDSqgA\";tag=\"web-bot-auth\"",
260
- "Signature-Agent": "sig1=agent-609a4fd2ebf4e6347108c517.agents.vestauth.com"
260
+ "Signature-Agent": "sig1=agent-609a4fd2ebf4e6347108c517.api.vestauth.com"
261
261
  }
262
262
  ```
263
263
 
@@ -272,7 +272,7 @@ $ vestauth agent headers GET https://api.vestauth.com/whoami --uid agent-1234 --
272
272
  {
273
273
  "Signature": "sig1=:UW6A7j8jo+gQxd+EeVgDddY51ZOc9plrSaupW/N53hQnQFvP9BuwQHgL7SVPLQIu4cnRzLgvwm7Yu9YMO+HUDQ==:",
274
274
  "Signature-Input": "sig1=(\"@authority\");created=1770396357;keyid=\"FGzgs758DBGnI1S0BejChDsK0IKZm3qPpOOXdRnnBkM\";alg=\"ed25519\";expires=1770396657;nonce=\"PrE7A6I_5fWnxBsBigNvxjp3-YangXl71V1uM3hPZavh918JqzjMSRcjHv_n5XIb3N8WivZEeigCBH6QGDSqgA\";tag=\"web-bot-auth\"",
275
- "Signature-Agent": "sig1=agent-1234.agents.vestauth.com"
275
+ "Signature-Agent": "sig1=agent-1234.api.vestauth.com"
276
276
  }
277
277
  ```
278
278
 
@@ -287,7 +287,7 @@ $ vestauth agent headers GET https://api.vestauth.com/whoami --private-jwk '{"cr
287
287
  {
288
288
  "Signature": "sig1=:PZUVVjqiECYuk8Hg1GZKKeJmwhLrcRdRA7nm1R595UFK9cx0q9atNFBzKP5wBEmszMIgvpYdMrIQbPEeKz4tCQ==:",
289
289
  "Signature-Input": "sig1=(\"@authority\");created=1770396546;keyid=\"UfHTArlyLsqM8cB8sNfH2z6XOwc0RmJIq2CAPGfvMjk\";alg=\"ed25519\";expires=1770396846;nonce=\"BSIugautfZvN3u5QUgl1mMuyxgmeRsRy9XxX7GXxjJxq1mI0kJl4F-C1nITtOfSeEt6xR1YBfyxsffNKy_wKSA\";tag=\"web-bot-auth\"",
290
- "Signature-Agent": "sig1=agent-609a4fd2ebf4e6347108c517.agents.vestauth.com"
290
+ "Signature-Agent": "sig1=agent-609a4fd2ebf4e6347108c517.api.vestauth.com"
291
291
  }
292
292
  ```
293
293
 
@@ -308,7 +308,7 @@ $ vestauth agent rotate
308
308
  Verify agent.
309
309
 
310
310
  ```sh
311
- $ vestauth provider verify GET https://api.vestauth.com/whoami --signature "sig1=:H1kxwSRWFbIzKbHaUy4hQFp/JrmVTX//72JPHcW4W7cPt9q6LytRJgx5pUgWrrr7DCcMWgx/jpTPc8Ht8SZ3CQ==:" --signature-input "sig1=(\"@authority\");created=1770396709;keyid=\"FGzgs758DBGnI1S0BejChDsK0IKZm3qPpOOXdRnnBkM\";alg=\"ed25519\";expires=1770397009;nonce=\"BZSDVktdkjO6XH5jafAdPDttsB6eytXO7u8KXJN1tMtd5bprE3rp08HiaTRo7H6gZGtYb4_qtL7RiGi8P2Gq7w\";tag=\"web-bot-auth\"" --signature-agent "sig1=agent-609a4fd2ebf4e6347108c517.agents.vestauth.com"
311
+ $ vestauth provider verify GET https://api.vestauth.com/whoami --signature "sig1=:H1kxwSRWFbIzKbHaUy4hQFp/JrmVTX//72JPHcW4W7cPt9q6LytRJgx5pUgWrrr7DCcMWgx/jpTPc8Ht8SZ3CQ==:" --signature-input "sig1=(\"@authority\");created=1770396709;keyid=\"FGzgs758DBGnI1S0BejChDsK0IKZm3qPpOOXdRnnBkM\";alg=\"ed25519\";expires=1770397009;nonce=\"BZSDVktdkjO6XH5jafAdPDttsB6eytXO7u8KXJN1tMtd5bprE3rp08HiaTRo7H6gZGtYb4_qtL7RiGi8P2Gq7w\";tag=\"web-bot-auth\"" --signature-agent "sig1=agent-609a4fd2ebf4e6347108c517.api.vestauth.com"
312
312
  {"uid":"agent-609a4fd2ebf4e6347108c517",...}
313
313
  ```
314
314
 
@@ -347,7 +347,7 @@ $ vestauth primitives headers GET http://example.com --pp
347
347
  {
348
348
  "Signature": "sig1=:K7z3Nozcq1z5zfJhrd540DWYbjyQ1kR/S7ZDcMXE5gVhxezvG6Rn9BxEvfteiAnBuQhOkvbpGtF83WpQQerGBw==:",
349
349
  "Signature-Input": "sig1=(\"@authority\");created=1770263541;keyid=\"_4GFBGmXKinLBoh3-GJZCiLBt-84GP9Fb0iBzmYncUg\";alg=\"ed25519\";expires=1770263841;nonce=\"0eu7hVMVFm61lQvIryKNmZXIbzkkgpVocoKvN0de5QO8Eu5slTxklJAcVLQs0L_UTVtx4f8qJcqYZ21JTeOQww\";tag=\"web-bot-auth\"",
350
- "Signature-Agent": "sig1=agent-35e4a794a904d227ee2373b6.agents.vestauth.com"
350
+ "Signature-Agent": "sig1=agent-35e4a794a904d227ee2373b6.api.vestauth.com"
351
351
  }
352
352
  ```
353
353
 
@@ -357,7 +357,7 @@ $ vestauth primitives headers GET http://example.com --pp
357
357
  Verify signed headers.
358
358
 
359
359
  ```sh
360
- $ vestauth primitives verify GET https://api.vestauth.com/whoami --signature "sig1=:UHqXQbWZmyYW40JRcdCl+NLccLgPmcoirUKwLtdcpEcIgxG2+i+Q2U3yIYeMquseON3fKm29WSL2ntHeRefHBQ==:" --signature-input "sig1=(\"@authority\");created=1770395703;keyid=\"FGzgs758DBGnI1S0BejChDsK0IKZm3qPpOOXdRnnBkM\";alg=\"ed25519\";expires=1770396003;nonce=\"O8JOC1reBofwbpPcdD-MRRCdrtAf4khvJTuhpRI_RiaH_hpU93okLkmPZVFFcUEdYtYfcduaB8Sca54GTd2GXA\";tag=\"web-bot-auth\"" --signature-agent "sig1=agent-609a4fd2ebf4e6347108c517.agents.vestauth.com"
360
+ $ vestauth primitives verify GET https://api.vestauth.com/whoami --signature "sig1=:UHqXQbWZmyYW40JRcdCl+NLccLgPmcoirUKwLtdcpEcIgxG2+i+Q2U3yIYeMquseON3fKm29WSL2ntHeRefHBQ==:" --signature-input "sig1=(\"@authority\");created=1770395703;keyid=\"FGzgs758DBGnI1S0BejChDsK0IKZm3qPpOOXdRnnBkM\";alg=\"ed25519\";expires=1770396003;nonce=\"O8JOC1reBofwbpPcdD-MRRCdrtAf4khvJTuhpRI_RiaH_hpU93okLkmPZVFFcUEdYtYfcduaB8Sca54GTd2GXA\";tag=\"web-bot-auth\"" --signature-agent "sig1=agent-609a4fd2ebf4e6347108c517.api.vestauth.com"
361
361
  {"uid":"agent-609a4fd2ebf4e6347108c517", ...}
362
362
  ```
363
363
 
@@ -588,7 +588,7 @@ Vestauth follows these specifications to ensure interoperability between agents
588
588
  > By default, Vestauth only resolves agent discovery endpoints inside the controlled namespace:
589
589
  >
590
590
  > ```ini
591
- > *.agents.vestauth.com
591
+ > *.api.vestauth.com
592
592
  > ```
593
593
  >
594
594
  > When a provider verifies a request, Vestauth converts the agent identity into a fixed .well-known endpoint within this trusted domain. Because this domain is controlled by Vestauth, providers never fetch attacker-supplied URLs or internal network addresses.
@@ -670,7 +670,3 @@ You can fork this repo and create [pull requests](https://github.com/vestauth/ve
670
670
 
671
671
  * [github.com/vestauth/vestauth](https://github.com/vestauth/vestauth/issues) - bugs and discussions
672
672
  * [@vestauth 𝕏](https://x.com/vestauthx) (DMs are open)
673
-
674
- ## Roadmap
675
-
676
- * Feb 15: Add first vestauth provider `dotenvx as2`
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vestauth",
3
- "version": "0.12.0",
3
+ "version": "0.13.0",
4
4
  "description": "auth for agents–from the creator of dotenvx",
5
5
  "keywords": [
6
6
  "vestauth",
@@ -11,7 +11,7 @@ agent
11
11
  const initAction = require('./../actions/agent/init')
12
12
  agent.command('init')
13
13
  .description('create agent')
14
- .option('--hostname <hostname>', 'agent API hostname')
14
+ .option('--hostname <hostname>', 'agent API hostname', env('AGENT_HOSTNAME'))
15
15
  .action(initAction)
16
16
 
17
17
  // vestauth agent curl
@@ -20,7 +20,7 @@ if (commanderVersion && parseInt(commanderVersion.split('.')[0], 10) >= 12) {
20
20
 
21
21
  // global log levels
22
22
  program
23
- .usage('vestauth')
23
+ .usage('agent init')
24
24
  .option('--log-level <level>', 'set log level', 'info')
25
25
  .option('--quiet', 'sets log level to error')
26
26
  .option('--verbose', 'sets log level to verbose')
@@ -3,17 +3,19 @@ const buildApiError = require('../helpers/buildApiError')
3
3
  const agentHeaders = require('../helpers/agentHeaders')
4
4
 
5
5
  class PostRegister {
6
- constructor (hostname, publicJwk) {
6
+ constructor (hostname, publicJwk, privateJwk) {
7
7
  this.hostname = hostname || 'https://api.vestauth.com'
8
8
  this.publicJwk = publicJwk
9
+ this.privateJwk = privateJwk
9
10
  }
10
11
 
11
12
  async run () {
12
13
  const url = `${this.hostname}/register`
13
14
  const publicJwk = this.publicJwk
15
+ const privateJwk = this.privateJwk
14
16
 
15
17
  const httpMethod = 'POST'
16
- const headers = await agentHeaders(httpMethod, url, 'REGISTERING')
18
+ const headers = await agentHeaders(httpMethod, url, 'REGISTERING', JSON.stringify(privateJwk))
17
19
  headers['Content-Type'] = 'application/json'
18
20
 
19
21
  const resp = await http(url, {
@@ -8,7 +8,7 @@ const PostRegister = require('../api/postRegister')
8
8
  async function agentInit (hostname = null) {
9
9
  const envPath = '.env'
10
10
  const normalizedHostname = normalizeAgentHostname(hostname)
11
- const shouldPersistHostname = Boolean(hostname && String(hostname).trim())
11
+ const shouldPersistHostname = normalizedHostname !== 'https://api.vestauth.com'
12
12
 
13
13
  // keypair
14
14
  const currentPrivateJwk = identity(false).privateJwk
@@ -16,17 +16,15 @@ async function agentInit (hostname = null) {
16
16
 
17
17
  touch(envPath)
18
18
 
19
- // must come before registration so that registration can send headers
19
+ // register agent
20
+ const agent = await new PostRegister(normalizedHostname, kp.publicJwk, kp.privateJwk).run()
21
+ dotenvx.set('AGENT_UID', agent.uid, { path: envPath, plain: true, quiet: true })
20
22
  dotenvx.set('AGENT_PUBLIC_JWK', JSON.stringify(kp.publicJwk), { path: envPath, plain: true, quiet: true })
21
23
  dotenvx.set('AGENT_PRIVATE_JWK', JSON.stringify(kp.privateJwk), { path: envPath, plain: true, quiet: true })
22
24
  if (shouldPersistHostname) {
23
25
  dotenvx.set('AGENT_HOSTNAME', new URL(normalizedHostname).host, { path: envPath, plain: true, quiet: true })
24
26
  }
25
27
 
26
- // register agent
27
- const agent = await new PostRegister(normalizedHostname, kp.publicJwk).run()
28
- dotenvx.set('AGENT_UID', agent.uid, { path: envPath, plain: true, quiet: true })
29
-
30
28
  return {
31
29
  AGENT_PUBLIC_JWK: kp.publicJwk,
32
30
  AGENT_UID: agent.uid,
@@ -2,6 +2,12 @@ const Errors = require('./errors')
2
2
  const thumbprint = require('./thumbprint')
3
3
  const signatureParams = require('./signatureParams')
4
4
  const webBotAuthSignature = require('./webBotAuthSignature')
5
+ const env = require('./env')
6
+
7
+ function getAgentDiscoveryDomain () {
8
+ const hostname = (env('AGENT_HOSTNAME') || process.env.AGENT_HOSTNAME || 'api.vestauth.com').trim().toLowerCase()
9
+ return hostname.replace(/^https?:\/\//, '').split('/')[0]
10
+ }
5
11
 
6
12
  async function headers (httpMethod, uri, uid, privateJwk, tag = 'web-bot-auth', nonce = null) {
7
13
  if (!uid) throw new Errors().missingUid()
@@ -21,7 +27,7 @@ async function headers (httpMethod, uri, uid, privateJwk, tag = 'web-bot-auth',
21
27
 
22
28
  const signatureInput = signatureParams(privateJwk.kid, tag, nonce)
23
29
  const signature = webBotAuthSignature(httpMethod, uri, signatureInput, privateJwk)
24
- const signatureAgent = `${uid}.agents.vestauth.com` // agent-1234.agents.vestauth.com (no scheme) /.well-known/http-message-signatures-directory
30
+ const signatureAgent = `${uid}.${getAgentDiscoveryDomain()}` // no scheme; fqdn only
25
31
 
26
32
  return {
27
33
  Signature: `sig1=:${signature}:`,
@@ -1,5 +1,8 @@
1
+ const env = require('./env')
2
+
1
3
  function normalizeAgentHostname (hostname = null) {
2
- const value = (hostname || process.env.AGENT_HOSTNAME || 'api.vestauth.com').trim()
4
+ const envHostname = env('AGENT_HOSTNAME')
5
+ const value = (hostname || envHostname || 'api.vestauth.com').trim()
3
6
  const candidate = /^https?:\/\//i.test(value) ? value : `https://${value}`
4
7
  const url = new URL(candidate)
5
8
 
@@ -1,7 +1,7 @@
1
1
  const { parseDictionary } = require('structured-headers')
2
2
  const Errors = require('./errors')
3
3
 
4
- // example: sig1=agent-9aa52a556ca85ee195866c0b.agents.vestauth.com
4
+ // example: sig1=agent-9aa52a556ca85ee195866c0b.api.vestauth.com
5
5
  function parseSignatureAgentHeader (signatureAgentHeader) {
6
6
  if (Array.isArray(signatureAgentHeader)) {
7
7
  signatureAgentHeader = signatureAgentHeader[0]
@@ -1,4 +1,4 @@
1
- const DEFAULT_PROVIDER_FQDN_REGEX = /^[A-Za-z0-9-]+\.agents\.vestauth\.com$/
1
+ const DEFAULT_PROVIDER_FQDN_REGEX = /^[A-Za-z0-9-]+\.(?:agents|api)\.vestauth\.com$/
2
2
  const Errors = require('./errors')
3
3
 
4
4
  function getProviderFqdnRegex () {