ConfirmationTokenStore
Stores pending confirmation tokens for destructive operations.
ConfirmationTokenStore::create()
public function create(string $tool, array $args, string $actionSummary): Milpa\ToolRuntime\Confirmation\ConfirmationTokenGenerate and store a confirmation token.
Parameters
| Name | Type | Description |
|---|---|---|
| $tool | string | |
| $args | array<string, mixed> | |
| $actionSummary | string |
ConfirmationTokenStore::consume()
public function consume(string $token, string $tool): ?arrayValidate and consume a confirmation token. Returns the original args if valid, null if invalid/expired.
Parameters
| Name | Type | Description |
|---|---|---|
| $token | string | |
| $tool | string |
ConfirmationTokenStore::isValid()
public function isValid(string $token, string $tool): boolCheck if a token is valid (without consuming).
Parameters
| Name | Type | Description |
|---|---|---|
| $token | string | |
| $tool | string |
ConfirmationTokenStore::setTtl()
public function setTtl(int $seconds): voidSet TTL for new tokens.
Parameters
| Name | Type | Description |
|---|---|---|
| $seconds | int |