Skip to content

Commit

Permalink
Add secrets warning to CLI output (#205)
Browse files Browse the repository at this point in the history
  • Loading branch information
joedixon authored Nov 23, 2022
1 parent 8c987f5 commit 6e91cde
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/BuildProcess/CollectSecrets.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@ public function __invoke()
return [$secret['name'] => $secret['version']];
})->toArray();

if (! empty($secrets)) {
Helpers::warn('Using secrets may result in unexpected increased AWS billing charges. Instead, we recommend you utilize environment variables and / or encrypted environment files.');
}

$this->files->put(
$this->appPath.'/vaporSecrets.php',
'<?php return '.var_export($secrets, true).';'
Expand Down
2 changes: 2 additions & 0 deletions src/Commands/SecretCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ public function handle()
{
Helpers::ensure_api_token_is_available();

Helpers::warn('Using secrets may result in unexpected increased AWS billing charges. Instead, we recommend you utilize environment variables and / or encrypted environment files.');

$this->vapor->storeSecret(
Manifest::id(),
$this->argument('environment'),
Expand Down
2 changes: 2 additions & 0 deletions src/Commands/SecretListCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ public function handle()
{
Helpers::ensure_api_token_is_available();

Helpers::warn('Using secrets may result in unexpected increased AWS billing charges. Instead, we recommend you utilize environment variables and / or encrypted environment files.');

$secrets = $this->vapor->secrets(
Manifest::id(),
$this->argument('environment')
Expand Down
2 changes: 2 additions & 0 deletions src/Commands/SecretPassportCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ public function handle()
{
Helpers::ensure_api_token_is_available();

Helpers::warn('Using secrets may result in unexpected increased AWS billing charges. Instead, we recommend you utilize environment variables and / or encrypted environment files.');

if (! file_exists(getcwd().'/storage/oauth-private.key') ||
! file_exists(getcwd().'/storage/oauth-public.key')) {
Helpers::abort('Unable to find Passport keys in [storage] directory.');
Expand Down

0 comments on commit 6e91cde

Please sign in to comment.