Refactor generateEnvValue function to use base64 encoding for certain cases

This commit is contained in:
Andras Bacsai 2024-03-04 12:46:37 +01:00
parent 53cd3091f7
commit d106d4bd4e

View File

@ -1598,13 +1598,14 @@ function generateEnvValue(string $command, ?Service $service = null)
$generatedValue = Str::password(length: 64, symbols: false); $generatedValue = Str::password(length: 64, symbols: false);
break; break;
case 'BASE64_64': case 'BASE64_64':
$generatedValue = Str::random(64); $generatedValue = base64_encode(Str::random(64));
break; break;
case 'BASE64_128': case 'BASE64_128':
$generatedValue = Str::random(128); $generatedValue = base64_encode(Str::random(128));
break; break;
case 'BASE64': case 'BASE64':
$generatedValue = Str::random(32); case 'BASE64_32':
$generatedValue = base64_encode(Str::random(32));
break; break;
case 'USER': case 'USER':
$generatedValue = Str::random(16); $generatedValue = Str::random(16);