feat(validation): gitlab verification

This commit is contained in:
William Harrison
2024-01-17 09:36:55 +08:00
parent b8d6a53b74
commit f76dda07f0
3 changed files with 4 additions and 0 deletions
+2
View File
@@ -64,6 +64,7 @@ describe('validateDomainData', () => {
{ ...defaultDomain, record: { AAAA: '182.22.222.22' } },
{ ...defaultDomain, record: { A: '::1' } },
{ ...defaultDomain, name: '_discord' },
{ ...defaultDomain, name: '_gitlab-pages-verification-code' },
];
const validCases = [
@@ -94,6 +95,7 @@ describe('validateDomainData', () => {
{ ...defaultDomain, record: { AAAA: ['::1', '2001:db8:3333:4444:5555:6666:7777:8888'] } },
{ ...defaultDomain, record: { A: ['122.222.222.222'] } },
{ ...defaultDomain, name: '_discord.subdomain' },
{ ...defaultDomain, name: '_gitlab-pages-verification-code.subdomain' },
];
it('should return false for invalid data', () => {
+1
View File
@@ -2,6 +2,7 @@
"_acme-challenge",
"_github-challenge-is-a-dev",
"_github-pages-challenge-is-a-dev",
"_gitlab-pages-verification-code",
"help",
"no-reply",
"noreply",
+1
View File
@@ -39,6 +39,7 @@ const checkRestrictedNames = R.complement(R.includes(R.__, INVALID_NAMES))
const extraSupportedNames = [
testRegex(/^_github(-pages)?-challenge-[a-z0-9-_]+$/i), // Exception for github verification records
R.equals('_discord'),
R.equals('_gitlab-pages-verification-code'),
]
const validateDomainData = validate({