diff --git a/app/controllers/api/account.php b/app/controllers/api/account.php index b9884c5ebf..94b40b0359 100644 --- a/app/controllers/api/account.php +++ b/app/controllers/api/account.php @@ -287,7 +287,6 @@ App::post('/v1/account') ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) ->label('sdk.response.model', Response::MODEL_USER) ->label('abuse-limit', 10) - ->label('sensitive', ['email', 'password', 'name']) ->param('userId', '', new CustomId(), 'User ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can\'t start with a special char. Max length is 36 chars.') ->param('email', '', new Email(), 'User email.') ->param('password', '', fn ($project, $passwordsDictionary) => new PasswordDictionary($passwordsDictionary, $project->getAttribute('auths', [])['passwordDictionary'] ?? false), 'New user password. Must be between 8 and 256 chars.', false, ['project', 'passwordsDictionary']) @@ -814,7 +813,6 @@ App::post('/v1/account/sessions/email') ->label('sdk.response.model', Response::MODEL_SESSION) ->label('abuse-limit', 10) ->label('abuse-key', 'url:{url},email:{param-email}') - ->label('sensitive', ['email', 'password']) ->param('email', '', new Email(), 'User email.') ->param('password', '', new Password(), 'User password. Must be at least 8 chars.') ->inject('request') diff --git a/app/controllers/api/messaging.php b/app/controllers/api/messaging.php index db0c473357..7da0348a8f 100644 --- a/app/controllers/api/messaging.php +++ b/app/controllers/api/messaging.php @@ -224,7 +224,6 @@ App::post('/v1/messaging/providers/smtp') ->label('sdk.response.code', Response::STATUS_CODE_CREATED) ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) ->label('sdk.response.model', Response::MODEL_PROVIDER) - ->label('sensitive', ['username', 'password', 'fromName', 'fromEmail', 'replyToName', 'replyToEmail']) ->param('providerId', '', new CustomId(), 'Provider ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can\'t start with a special char. Max length is 36 chars.') ->param('name', '', new Text(128), 'Provider name.') ->param('host', '', new Text(0), 'SMTP hosts. Either a single hostname or multiple semicolon-delimited hostnames. You can also specify a different port for each host such as `smtp1.example.com:25;smtp2.example.com`. You can also specify encryption type, for example: `tls://smtp1.example.com:587;ssl://smtp2.example.com:465"`. Hosts will be tried in order.') @@ -1206,7 +1205,6 @@ App::patch('/v1/messaging/providers/smtp/:providerId') ->label('sdk.response.code', Response::STATUS_CODE_OK) ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) ->label('sdk.response.model', Response::MODEL_PROVIDER) - ->label('sensitive', ['username', 'password', 'fromName', 'fromEmail', 'replyToName', 'replyToEmail']) ->param('providerId', '', new UID(), 'Provider ID.') ->param('name', '', new Text(128), 'Provider name.', true) ->param('host', '', new Text(0), 'SMTP hosts. Either a single hostname or multiple semicolon-delimited hostnames. You can also specify a different port for each host such as `smtp1.example.com:25;smtp2.example.com`. You can also specify encryption type, for example: `tls://smtp1.example.com:587;ssl://smtp2.example.com:465"`. Hosts will be tried in order.', true) diff --git a/app/controllers/api/migrations.php b/app/controllers/api/migrations.php index 8f5721d808..3bdd7a734a 100644 --- a/app/controllers/api/migrations.php +++ b/app/controllers/api/migrations.php @@ -263,7 +263,6 @@ App::post('/v1/migrations/supabase') ->label('sdk.response.code', Response::STATUS_CODE_ACCEPTED) ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) ->label('sdk.response.model', Response::MODEL_MIGRATION) - ->label('sensitive', ['username', 'password']) ->param('resources', [], new ArrayList(new WhiteList(Supabase::getSupportedResources(), true)), 'List of resources to migrate') ->param('endpoint', '', new URL(), 'Source\'s Supabase Endpoint') ->param('apiKey', '', new Text(512), 'Source\'s API Key') @@ -325,7 +324,6 @@ App::post('/v1/migrations/nhost') ->label('sdk.response.code', Response::STATUS_CODE_ACCEPTED) ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) ->label('sdk.response.model', Response::MODEL_MIGRATION) - ->label('sensitive', ['adminSecret', 'username', 'password']) ->param('resources', [], new ArrayList(new WhiteList(NHost::getSupportedResources())), 'List of resources to migrate') ->param('subdomain', '', new Text(512), 'Source\'s Subdomain') ->param('region', '', new Text(512), 'Source\'s Region') diff --git a/app/controllers/api/projects.php b/app/controllers/api/projects.php index 8bae4fde51..934793410b 100644 --- a/app/controllers/api/projects.php +++ b/app/controllers/api/projects.php @@ -1647,7 +1647,6 @@ App::patch('/v1/projects/:projectId/smtp') ->label('sdk.response.code', Response::STATUS_CODE_OK) ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) ->label('sdk.response.model', Response::MODEL_PROJECT) - ->label('sensitive', ['senderName', 'senderEmail', 'replyTo', 'host', 'port', 'username', 'password']) ->param('projectId', '', new UID(), 'Project unique ID.') ->param('enabled', false, new Boolean(), 'Enable custom SMTP service') ->param('senderName', '', new Text(255, 0), 'Name of the email sender', true) @@ -1737,7 +1736,6 @@ App::post('/v1/projects/:projectId/smtp/tests') ->label('sdk.method', 'createSmtpTest') ->label('sdk.response.code', Response::STATUS_CODE_NOCONTENT) ->label('sdk.response.model', Response::MODEL_NONE) - ->label('sensitive', ['senderName', 'senderEmail', 'replyTo', 'host', 'port', 'username', 'password']) ->param('projectId', '', new UID(), 'Project unique ID.') ->param('emails', [], new ArrayList(new Email(), 10), 'Array of emails to send test email to. Maximum of 10 emails are allowed.') ->param('senderName', System::getEnv('_APP_SYSTEM_EMAIL_NAME', APP_NAME . ' Server'), new Text(255, 0), 'Name of the email sender') diff --git a/app/controllers/api/users.php b/app/controllers/api/users.php index d813909f70..c05f1d922d 100644 --- a/app/controllers/api/users.php +++ b/app/controllers/api/users.php @@ -194,7 +194,6 @@ App::post('/v1/users') ->label('sdk.response.code', Response::STATUS_CODE_CREATED) ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) ->label('sdk.response.model', Response::MODEL_USER) - ->label('sensitive', ['email', 'phone', 'password', 'name']) ->param('userId', '', new CustomId(), 'User ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can\'t start with a special char. Max length is 36 chars.') ->param('email', null, new Email(), 'User email.', true) ->param('phone', null, new Phone(), 'Phone number. Format this number with a leading \'+\' and a country code, e.g., +16175551212.', true) @@ -226,7 +225,6 @@ App::post('/v1/users/bcrypt') ->label('sdk.response.code', Response::STATUS_CODE_CREATED) ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) ->label('sdk.response.model', Response::MODEL_USER) - ->label('sensitive', ['email', 'password', 'name']) ->param('userId', '', new CustomId(), 'User ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can\'t start with a special char. Max length is 36 chars.') ->param('email', '', new Email(), 'User email.') ->param('password', '', new Password(), 'User password hashed using Bcrypt.') diff --git a/app/http.php b/app/http.php index 84fbc8856f..bec772c770 100644 --- a/app/http.php +++ b/app/http.php @@ -268,7 +268,6 @@ $http->on('request', function (SwooleRequest $swooleRequest, SwooleResponse $swo $route = $app->getRoute(); $log = $app->getResource("log"); - $log->setMasked($route->getLabel('sensitive', [])); if (isset($user) && !$user->isEmpty()) { $log->setUser(new User($user->getId())); @@ -293,14 +292,6 @@ $http->on('request', function (SwooleRequest $swooleRequest, SwooleResponse $swo $log->addExtra('trace', $th->getTraceAsString()); $log->addExtra('roles', Authorization::getRoles()); - foreach ($route->getPathValues($request) as $key => $value) { - $log->addTag($key, $value); - } - - if (\in_array($route->getMethod(), ['POST', 'PUT', 'PATCH'])) { - $log->addExtra('params', $route->getParams()); - } - $action = $route->getLabel("sdk.namespace", "UNKNOWN_NAMESPACE") . '.' . $route->getLabel("sdk.method", "UNKNOWN_METHOD"); $log->setAction($action);