1
0
mirror of git://f0xx.org/ac/ac-ms-template synced 2026-07-29 03:39:28 +03:00
This commit is contained in:
Anton Afanasyeu
2026-06-23 12:29:30 +02:00
commit 1ca30210bd
31 changed files with 1446 additions and 0 deletions

View File

@@ -0,0 +1,26 @@
#!/usr/bin/env php
<?php
declare(strict_types=1);
require_once dirname(__DIR__) . '/src/bootstrap.php';
$label = 'cli-seed';
$canPermanent = false;
foreach (array_slice($argv, 1) as $arg) {
if ($arg === '--permanent') {
$canPermanent = true;
} elseif (str_starts_with($arg, '--label=')) {
$label = substr($arg, 8);
}
}
$created = BearerRepository::createTrusted($label, true, $canPermanent);
echo "Bearer token (store securely — shown once):\n";
echo $created['token'] . "\n";
echo "bearer_id=" . $created['id'] . " label=" . $label . "\n";
if ($canPermanent) {
$signer = SignerRepository::create($label . '-signer');
echo "Signer key (for ttl=0):\n";
echo $signer['key'] . "\n";
}