mirror of
https://github.com/tiennm99/coolify.git
synced 2026-09-04 16:17:03 +00:00
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:
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user