feat: some stuff

This commit is contained in:
Vincent
2024-08-26 14:02:12 +02:00
parent 3e3ea66848
commit 7861eaf5db
8 changed files with 30 additions and 8 deletions

View File

@@ -132,6 +132,22 @@ export function ConnectorForm({form, onCreate}: { form: FormInstance, onCreate:
</Form.Item>
</>
}
{
provider === ConnectorProvider.NAMECHEAP && <>
<Form.Item
label={t`Username`}
name={['authData', 'ApiUser']}
>
<Input autoComplete='off'></Input>
</Form.Item>
<Form.Item
label={t`API key`}
name={['authData', 'ApiKey']}
>
<Input autoComplete='off'></Input>
</Form.Item>
</>
}
{
provider !== undefined && <>

View File

@@ -16,7 +16,7 @@ export const helpGetTokenLink = (provider?: string) => {
{t`Retrieve a Personal Access Token from your customer account on the Provider's website`}
</Typography.Link>
case ConnectorProvider.NAMECHEAP:
return <Typography.Link target='_blank' href="">
return <Typography.Link target='_blank' href="https://ap.www.namecheap.com/settings/tools/apiaccess/">
{t`Retreive an API key and whitelist this instance's IP address on Namecheap's website`}
</Typography.Link>
default:

View File

@@ -13,6 +13,8 @@ parameters:
limit_max_watchlist: '%env(int:LIMIT_MAX_WATCHLIST)%'
limit_max_watchlist_domains: '%env(int:LIMIT_MAX_WATCHLIST_DOMAINS)%'
outgoing_ip: '%env(string:OUTGOING_IP)%'
services:
# default configuration for services in *this* file
_defaults:
@@ -21,7 +23,7 @@ services:
bind:
$mailerSenderEmail: '%mailer_sender_email%'
$mailerSenderName: '%mailer_sender_name%'
$outgoingIp: '%env(string:OUTGOING_IP)%'
$outgoingIp: '%outgoing_ip%'
# makes classes in src/ available to be used as services
# this creates a service per class whose id is the fully-qualified class name

View File

@@ -60,5 +60,6 @@
},
"dependencies": {
"remove": "^0.1.5"
}
},
"packageManager": "yarn@1.22.22+sha512.a6b2f7906b721bba3d67d4aff083df04dad64c399707841b7acf00f6b133b7ac24255f2652fa22ae3534329dc6180534e98d17432037ff6fd140556e2bb3137e"
}

View File

@@ -73,9 +73,10 @@ final readonly class ProcessDomainTriggerHandler
$connectorProvider->orderDomain($domain, $this->kernel->isDebug());
$this->sendEmailDomainOrdered($domain, $connector, $watchList->getUser());
} catch (\Throwable) {
$this->logger->warning('Unable to complete purchase. An error message is sent to user {username}.', [
} catch (\Throwable $t) {
$this->logger->error('Unable to complete purchase. An error message is sent to user {username}.', [
'username' => $watchList->getUser()->getUserIdentifier(),
'error' => $t,
]);
$this->sendEmailDomainOrderError($domain, $watchList->getUser());
}

View File

@@ -46,7 +46,7 @@ class JWTAuthenticator implements AuthenticationSuccessHandlerInterface
time() + 7200, // expiration
'/',
null,
true,
false,
true,
false,
'strict'

View File

@@ -11,7 +11,7 @@ class NamecheapConnector extends AbstractConnector
public const SANDBOX_BASE_URL = 'http://api.sandbox.namecheap.com/xml.response';
public function __construct(private HttpClientInterface $client, private string $outgoingIp)
public function __construct(private HttpClientInterface $client, private readonly string $outgoingIp)
{
}
@@ -44,7 +44,7 @@ class NamecheapConnector extends AbstractConnector
private static function mergePrefixKeys(string $prefix, array|object $src, array &$dest)
{
foreach ($src as $key => $value) {
$dest[$prefix . $key] = $value;
$dest[$prefix.$key] = $value;
}
}
@@ -72,5 +72,6 @@ class NamecheapConnector extends AbstractConnector
public static function verifyAuthData(array $authData, HttpClientInterface $client): array
{
return $authData;
}
}

View File

@@ -152,6 +152,7 @@ readonly class RDAPService
/** @var ?Domain $domain */
$domain = $this->domainRepository->findOneBy(['ldhName' => $idnDomain]);
return $domain;
$rdapServerUrl = $rdapServer->getUrl();