feat: 接入腾讯云与阿里云实人认证
This commit is contained in:
@@ -46,6 +46,7 @@ class Settings {
|
||||
'aksrt_friend_links',
|
||||
'aksrt_banners',
|
||||
'aksrt_category_recommend',
|
||||
'aksrt_identity_secrets',
|
||||
];
|
||||
|
||||
/**
|
||||
@@ -54,6 +55,7 @@ class Settings {
|
||||
public const SECRET_OPTION_KEYS = [
|
||||
'aksrt_mail_smtp',
|
||||
'aksrt_oauth',
|
||||
'aksrt_identity_secrets',
|
||||
];
|
||||
|
||||
private function __construct() {}
|
||||
@@ -582,6 +584,54 @@ class Settings {
|
||||
return UserRuntime::get_user_identity_settings();
|
||||
}
|
||||
|
||||
/** @return array<string,mixed> */
|
||||
public static function get_identity_verification_settings(): array {
|
||||
return \AKSRT\Identity\SettingsRuntime::get();
|
||||
}
|
||||
|
||||
/** @return array<string,string> */
|
||||
public static function get_identity_provider_secrets(string $provider): array {
|
||||
return \AKSRT\Identity\SecretStore::get($provider);
|
||||
}
|
||||
|
||||
/** @param array<string,string|null> $changes */
|
||||
public static function update_identity_provider_secrets(string $provider, array $changes): bool {
|
||||
return \AKSRT\Identity\SecretStore::update($provider, $changes);
|
||||
}
|
||||
|
||||
/** @return array<string,array{configured:bool,fingerprint:string}> */
|
||||
public static function get_identity_provider_secret_status(string $provider): array {
|
||||
return \AKSRT\Identity\SecretStore::status($provider);
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove secrets from settings export and backup payloads.
|
||||
*
|
||||
* @param array<string,mixed> $payload
|
||||
* @return array<string,mixed>
|
||||
*/
|
||||
public static function redact_sensitive_settings(array $payload): array {
|
||||
if (isset($payload['standalone']) && is_array($payload['standalone'])) {
|
||||
foreach (self::SECRET_OPTION_KEYS as $option_key) {
|
||||
unset($payload['standalone'][$option_key]);
|
||||
}
|
||||
}
|
||||
return $payload;
|
||||
}
|
||||
|
||||
/**
|
||||
* Ignore secret options and redacted placeholders during import.
|
||||
*
|
||||
* @param array<string,mixed> $standalone
|
||||
* @return array<string,mixed>
|
||||
*/
|
||||
public static function filter_sensitive_import(array $standalone): array {
|
||||
foreach (self::SECRET_OPTION_KEYS as $option_key) {
|
||||
unset($standalone[$option_key]);
|
||||
}
|
||||
return $standalone;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user