新增 SPIFFE OpenBao 与 Nexus Actions

This commit is contained in:
2026-09-21 03:28:20 +00:00
parent 6192a52a6a
commit b95289d5b0
6 changed files with 158 additions and 1 deletions
+12
View File
@@ -0,0 +1,12 @@
'use strict';
async function post() {
const address = (process.env.STATE_bao_address || '').replace(/\/$/, '');
const token = process.env.STATE_bao_token || '';
if (!address || !token) return process.stdout.write('No OpenBao token state found; nothing to revoke\n');
const response = await fetch(`${address}/v1/auth/token/revoke-self`, {
method: 'POST', headers: { 'x-vault-token': token }, signal: AbortSignal.timeout(15000),
});
if (!response.ok) throw new Error(`OpenBao revoke-self failed (${response.status})`);
process.stdout.write('OpenBao token revoked\n');
}
post().catch((error) => { process.stderr.write(`spiffe-openbao-login post: ${error.message}\n`); process.exitCode = 1; });