Jesús Pérez d9ef2f0d5b
Some checks failed
Build and Test / Validate Setup (push) Has been cancelled
Build and Test / Build (darwin-amd64) (push) Has been cancelled
Build and Test / Build (darwin-arm64) (push) Has been cancelled
Build and Test / Build (linux-amd64) (push) Has been cancelled
Build and Test / Build (windows-amd64) (push) Has been cancelled
Build and Test / Build (linux-arm64) (push) Has been cancelled
Build and Test / Security Audit (push) Has been cancelled
Build and Test / Package Results (push) Has been cancelled
Build and Test / Quality Gate (push) Has been cancelled
Nightly Build / Check for Changes (push) Has been cancelled
Nightly Build / Validate Setup (push) Has been cancelled
Nightly Build / Nightly Build (darwin-amd64) (push) Has been cancelled
Nightly Build / Nightly Build (darwin-arm64) (push) Has been cancelled
Nightly Build / Nightly Build (linux-amd64) (push) Has been cancelled
Nightly Build / Nightly Build (windows-amd64) (push) Has been cancelled
Nightly Build / Nightly Build (linux-arm64) (push) Has been cancelled
Nightly Build / Create Nightly Pre-release (push) Has been cancelled
Nightly Build / Notify Build Status (push) Has been cancelled
Nightly Build / Nightly Maintenance (push) Has been cancelled
chore: update all plugins to Nushell 0.111.0
- Bump all 18 plugins from 0.110.0 to 0.111.0
  - Update rust-toolchain.toml channel to 1.93.1 (nu 0.111.0 requires ≥1.91.1)

  Fixes:
  - interprocess pin =2.2.x → ^2.3.1 in nu_plugin_mcp, nu_plugin_nats, nu_plugin_typedialog
    (required by nu-plugin-core 0.111.0)
  - nu_plugin_typedialog: BackendType::Web initializer — add open_browser: false field
  - nu_plugin_auth: implement missing user_info_to_value helper referenced in tests

  Scripts:
  - update_all_plugins.nu: fix [package].version update on minor bumps; add [dev-dependencies]
    pass; add nu-plugin-test-support to managed crates
  - download_nushell.nu: rustup override unset before rm -rf on nushell dir replace;
    fix unclosed ) in string interpolation
2026-03-11 03:22:42 +00:00

83 lines
3.0 KiB
Plaintext
Executable File

#!/usr/bin/env nu
# SecretumVault Plugin Quick Demo
print ""
print "═════════════════════════════════════════════════════════════════════════════════"
print "SecretumVault PQC Plugin Demo"
print "═════════════════════════════════════════════════════════════════════════════════"
print ""
# Test 1: Health Check
print "Test 1: Health Check"
try {
let health = (curl -s -H "X-Vault-Token: mytoken" "http://localhost:8200/v1/sys/health" | from json)
print " Status: OK"
print $" Sealed: ($health.data.sealed)"
} catch {
print " ERROR: Cannot connect to vault"
exit 1
}
print ""
print "Test 2: Generate ML-KEM-768 Key"
with-env {SECRETUMVAULT_TOKEN: "mytoken"} {
let key_id = "demo-" + (date now | format date "%s")
let generated = ("" | secretumvault generate-pqc-key --key-id $key_id)
let pub_key_size = ($generated.public_key | decode base64 | bytes length)
print $" Key ID: ($generated.key_id)"
print $" Algorithm: ($generated.algorithm)"
print $" Public key size: ($pub_key_size) bytes"
$key_id | save -f /tmp/pqc-key.txt
}
print ""
print "Test 3: Retrieve Key via API"
with-env {SECRETUMVAULT_TOKEN: "mytoken"} {
let key_id = (open /tmp/pqc-key.txt)
let url = "http://localhost:8200/v1/transit/keys/" + $key_id
let api_resp = (curl -s -H "X-Vault-Token: mytoken" $url | from json)
if ($api_resp.status == "success") {
let pub_key_size = ($api_resp.data.public_key | decode base64 | bytes length)
print $" Algorithm: ($api_resp.data.algorithm)"
print $" Public key size: ($pub_key_size) bytes"
}
}
print ""
print "Test 4: KEM Encapsulation"
with-env {SECRETUMVAULT_TOKEN: "mytoken"} {
let key_id = (open /tmp/pqc-key.txt)
let kem = ("" | secretumvault kem-encapsulate --pqc-key-id $key_id)
print $" Algorithm: ($kem.algorithm)"
print " Status: Encapsulation OK"
}
print ""
print "Test 5: Plugin Version"
with-env {SECRETUMVAULT_TOKEN: "mytoken"} {
let version = ("" | secretumvault version)
print $" Version: ($version)"
}
print ""
print "═════════════════════════════════════════════════════════════════════════════════"
print ""
print "SUCCESS: All tests passed!"
print ""
print "PQC Commands:"
print " • generate-pqc-key"
print " • hybrid-encrypt, hybrid-decrypt"
print " • hybrid-sign, hybrid-verify"
print " • kem-encapsulate, kem-decapsulate"
print ""
print "Classical Commands:"
print " • encrypt, decrypt"
print " • generate-key, generate-data-key"
print " • rotate-key"
print ""
print "Environment: SECRETUMVAULT_TOKEN required"
print ""