feat: update custom_rdap_servers.example.yaml

This commit is contained in:
Maël Gangloff
2024-11-02 16:11:41 +01:00
parent c7a50eed65
commit 79a5a1d35a
6 changed files with 48 additions and 44 deletions

View File

@@ -133,34 +133,30 @@ class OvhProvider extends AbstractProvider
*/
public function verifySpecificAuthData(array $authData): array
{
$appKey = $authData['appKey'];
$appSecret = $authData['appSecret'];
$apiEndpoint = $authData['apiEndpoint'];
$consumerKey = $authData['consumerKey'];
$ovhSubsidiary = $authData['ovhSubsidiary'];
$pricingMode = $authData['pricingMode'];
if (!is_string($appKey) || empty($appKey)
|| !is_string($appSecret) || empty($appSecret)
|| !is_string($consumerKey) || empty($consumerKey)
|| !is_string($apiEndpoint) || empty($apiEndpoint)
|| !is_string($ovhSubsidiary) || empty($ovhSubsidiary)
|| !is_string($pricingMode) || empty($pricingMode)
) {
throw new BadRequestHttpException('Bad authData schema');
foreach ([
'appKey',
'appSecret',
'apiEndpoint',
'consumerKey',
'ovhSubsidiary',
'pricingMode',
] as $key) {
if (empty($authData[$key]) || !is_string($authData[$key])) {
throw new BadRequestHttpException("Bad authData schema: missing or invalid '$key'");
}
}
return [
'appKey' => $appKey,
'appSecret' => $appSecret,
'apiEndpoint' => $apiEndpoint,
'consumerKey' => $consumerKey,
'ovhSubsidiary' => $ovhSubsidiary,
'pricingMode' => $pricingMode,
'appKey' => $authData['appKey'],
'appSecret' => $authData['appSecret'],
'apiEndpoint' => $authData['apiEndpoint'],
'consumerKey' => $authData['consumerKey'],
'ovhSubsidiary' => $authData['ovhSubsidiary'],
'pricingMode' => $authData['pricingMode'],
];
}
public function assertAuthentication(): void
protected function assertAuthentication(): void
{
$conn = new Api(
$this->authData['appKey'],