Skip to content

Commit

Permalink
feat(rector): add sensitive parameter attribute rector
Browse files Browse the repository at this point in the history
- Add AddSensitiveParameterAttributeRector to handle sensitive parameters.
- Configure sensitive parameters: accessToken, key, password, token, webHook.
- Enhances security by marking sensitive parameters appropriately.
  • Loading branch information
guanguans committed Oct 1, 2024
1 parent c1adf79 commit d4c0dfc
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions rector.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
use Rector\EarlyReturn\Rector\Return_\ReturnBinaryOrToEarlyReturnRector;
use Rector\Naming\Rector\ClassMethod\RenameParamToMatchTypeRector;
use Rector\Php73\Rector\String_\SensitiveHereNowDocRector;
use Rector\Php82\Rector\Param\AddSensitiveParameterAttributeRector;
use Rector\PHPUnit\CodeQuality\Rector\Class_\AddSeeTestAnnotationRector;
use Rector\PHPUnit\Set\PHPUnitSetList;
use Rector\Removing\Rector\Class_\RemoveTraitUseRector;
Expand Down Expand Up @@ -207,6 +208,16 @@
new ClassMethodReference(Response::class, 'offsetGet'),
]);

$rectorConfig->ruleWithConfiguration(AddSensitiveParameterAttributeRector::class, [
AddSensitiveParameterAttributeRector::SENSITIVE_PARAMETERS => [
'accessToken',
'key',
'password',
'token',
'webHook,',
],
]);

$rectorConfig->ruleWithConfiguration(ChangeMethodVisibilityRector::class, [
new ChangeMethodVisibility(HasOptions::class, 'preConfigureOptionsResolver', Visibility::PROTECTED),
]);
Expand Down

0 comments on commit d4c0dfc

Please sign in to comment.