diff options
author | Vincent Petry <vincent@nextcloud.com> | 2022-08-05 14:09:55 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-08-05 14:09:55 +0200 |
commit | cbd5cef2cccded7806067cb22549a1d50d35cd59 (patch) | |
tree | ed58169e35606e49a72e211e3b997c31337f4f51 /lib/private/AppFramework | |
parent | 5f40bd106ed81d681167e747f0d62dede8bf3672 (diff) | |
parent | 6941c91531b78a6898abe85ab74225b892bf8b06 (diff) | |
download | nextcloud-server-cbd5cef2cccded7806067cb22549a1d50d35cd59.tar.gz nextcloud-server-cbd5cef2cccded7806067cb22549a1d50d35cd59.zip |
Merge pull request #33398 from nextcloud/enh/noid/sensitive-methods-apps
allow apps to specify methods carrying sensitive parameters
Diffstat (limited to 'lib/private/AppFramework')
-rw-r--r-- | lib/private/AppFramework/Bootstrap/RegistrationContext.php | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/lib/private/AppFramework/Bootstrap/RegistrationContext.php b/lib/private/AppFramework/Bootstrap/RegistrationContext.php index 8f6aff228e1..c98f968c999 100644 --- a/lib/private/AppFramework/Bootstrap/RegistrationContext.php +++ b/lib/private/AppFramework/Bootstrap/RegistrationContext.php @@ -121,6 +121,9 @@ class RegistrationContext { /** @var ServiceRegistration<ICalendarProvider>[] */ private $calendarProviders = []; + /** @var ParameterRegistration[] */ + private $sensitiveMethods = []; + /** @var LoggerInterface */ private $logger; @@ -304,6 +307,14 @@ class RegistrationContext { $migratorClass ); } + + public function registerSensitiveMethods(string $class, array $methods): void { + $this->context->registerSensitiveMethods( + $this->appId, + $class, + $methods + ); + } }; } @@ -430,6 +441,11 @@ class RegistrationContext { $this->userMigrators[] = new ServiceRegistration($appId, $migratorClass); } + public function registerSensitiveMethods(string $appId, string $class, array $methods): void { + $methods = array_filter($methods, 'is_string'); + $this->sensitiveMethods[] = new ParameterRegistration($appId, $class, $methods); + } + /** * @param App[] $apps */ @@ -712,4 +728,11 @@ class RegistrationContext { public function getUserMigrators(): array { return $this->userMigrators; } + + /** + * @return ParameterRegistration[] + */ + public function getSensitiveMethods(): array { + return $this->sensitiveMethods; + } } |