fix(api): expose cloud tokens with sensitive read access

Show cloud provider token values only when the API request has sensitive
read permission, and cover read, read:sensitive, and root token behavior.
This commit is contained in:
Andras Bacsai committed 2026-05-13 11:29:48 +02:00
1 parent db23ee76fd
commit fb13a6cdc0
2 files changed
+66 -1

No files matched your search

@@ -16,9 +16,14 @@ class CloudProviderTokensController extends Controller
{
$token->makeHidden([
'id',
'token',
]);
if (request()->attributes->get('can_read_sensitive', false) === true) {
$token->makeVisible([
'token',
]);
}
return serializeApiResponse($token);
}