Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public function GenerateJwt()
return $jwt;
}

function base64UrlEncode($data)
private function base64UrlEncode($data)
{
return \str_replace('=', '', \strtr(\base64_encode($data), '+/', '-_'));
}
Expand Down
12 changes: 8 additions & 4 deletions scripts/githooks/scan-secrets.sh
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ function main() {
function get-cmd-to-run() {

check=${check:-staged-changes}
case $check in
case "$check" in
"whole-history")
cmd="detect --source $dir --verbose --redact"
;;
Expand All @@ -52,9 +52,13 @@ function get-cmd-to-run() {
"staged-changes")
cmd="protect --source $dir --verbose --staged"
;;
*)
echo "ERROR: Invalid check value: '$check'" >&2
exit 1
;;
esac
# Include base line file if it exists
if [ -f "$dir/scripts/config/.gitleaks-baseline.json" ]; then
if [[ -f "$dir/scripts/config/.gitleaks-baseline.json" ]]; then
cmd="$cmd --baseline-path $dir/scripts/config/.gitleaks-baseline.json"
fi
# Include the config file
Expand Down Expand Up @@ -94,8 +98,8 @@ function run-gitleaks-in-docker() {
# ==============================================================================

function is-arg-true() {

if [[ "$1" =~ ^(true|yes|y|on|1|TRUE|YES|Y|ON)$ ]]; then
local value="$1"
if [[ "$value" =~ ^(true|yes|y|on|1|TRUE|YES|Y|ON)$ ]]; then
return 0
else
return 1
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?php

if (file_exists(dirname(__DIR__).'/var/cache/prod/App_KernelProdContainer.preload.php')) {
require dirname(__DIR__).'/var/cache/prod/App_KernelProdContainer.preload.php';
require_once dirname(__DIR__).'/var/cache/prod/App_KernelProdContainer.preload.php';
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@

use Symfony\Component\Dotenv\Dotenv;

require dirname(__DIR__).'/vendor/autoload.php';
require_once dirname(__DIR__).'/vendor/autoload.php';

if (file_exists(dirname(__DIR__).'/config/bootstrap.php')) {
require dirname(__DIR__).'/config/bootstrap.php';
require_once dirname(__DIR__).'/config/bootstrap.php';
} elseif (method_exists(Dotenv::class, 'bootEnv')) {
(new Dotenv())->bootEnv(dirname(__DIR__).'/.env');
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?php

if (file_exists(dirname(__DIR__).'/var/cache/prod/App_KernelProdContainer.preload.php')) {
require dirname(__DIR__).'/var/cache/prod/App_KernelProdContainer.preload.php';
require_once dirname(__DIR__).'/var/cache/prod/App_KernelProdContainer.preload.php';
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@

use Symfony\Component\Dotenv\Dotenv;

require dirname(__DIR__).'/vendor/autoload.php';
require_once dirname(__DIR__).'/vendor/autoload.php';

if (file_exists(dirname(__DIR__).'/config/bootstrap.php')) {
require dirname(__DIR__).'/config/bootstrap.php';
require_once dirname(__DIR__).'/config/bootstrap.php';
} elseif (method_exists(Dotenv::class, 'bootEnv')) {
(new Dotenv())->bootEnv(dirname(__DIR__).'/.env');
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?php

if (file_exists(dirname(__DIR__).'/var/cache/prod/App_KernelProdContainer.preload.php')) {
require dirname(__DIR__).'/var/cache/prod/App_KernelProdContainer.preload.php';
require_once dirname(__DIR__).'/var/cache/prod/App_KernelProdContainer.preload.php';
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ class ISTokenExchange {
private $subject_token;
private $client_assertion;

function __construct($subject_token, $client_assertion)
public function __construct($subject_token, $client_assertion)
{
$this->subject_token = $subject_token;
$this->client_assertion = $client_assertion;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ class JwtHandler
private $privateKeyFile;
private $alg;

function __construct($privateKeyFile, $audience, $client_id, $kid, $alg, $alg_encrypt)
public function __construct($privateKeyFile, $audience, $client_id, $kid, $alg, $alg_encrypt)
{
$this->audience = $audience;
$this->client_id = $client_id;
Expand Down Expand Up @@ -47,7 +47,7 @@ public function GenerateJwt()
return $jwt;
}

function base64UrlEncode($data)
private function base64UrlEncode($data)
{
return \str_replace('=', '', \strtr(\base64_encode($data), '+/', '-_'));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ class SeparateAuthHttpClient {
private $jwt;
private $tokenUrl;

function __construct($code, $jwt, $tokenUrl)
public function __construct($code, $jwt, $tokenUrl)
{
$this->code = $code;
$this->jwt = $jwt;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?php

if (file_exists(dirname(__DIR__).'/var/cache/prod/App_KernelProdContainer.preload.php')) {
require dirname(__DIR__).'/var/cache/prod/App_KernelProdContainer.preload.php';
require_once dirname(__DIR__).'/var/cache/prod/App_KernelProdContainer.preload.php';
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ class ISTokenExchange {
private $subject_token;
private $client_assertion;

function __construct($subject_token, $client_assertion)
public function __construct($subject_token, $client_assertion)
{
$this->subject_token = $subject_token;
$this->client_assertion = $client_assertion;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public function GenerateJwt()
return $jwt;
}

function base64UrlEncode($data)
private function base64UrlEncode($data)
{
return \str_replace('=', '', \strtr(\base64_encode($data), '+/', '-_'));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ class SeparateAuthHttpClient {
private $jwt;
private $tokenUrl;

function __construct($code, $jwt, $tokenUrl)
public function __construct($code, $jwt, $tokenUrl)
{
$this->code = $code;
$this->jwt = $jwt;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@

use Symfony\Component\Dotenv\Dotenv;

require dirname(__DIR__).'/vendor/autoload.php';
require_once dirname(__DIR__).'/vendor/autoload.php';

if (file_exists(dirname(__DIR__).'/config/bootstrap.php')) {
require dirname(__DIR__).'/config/bootstrap.php';
require_once dirname(__DIR__).'/config/bootstrap.php';
} elseif (method_exists(Dotenv::class, 'bootEnv')) {
(new Dotenv())->bootEnv(dirname(__DIR__).'/.env');
}