feat(validation): adds support for org github verification

This commit is contained in:
Akshay Nair
2022-09-13 13:00:59 +05:30
parent acc15334ab
commit 779d258888
3 changed files with 7 additions and 2 deletions

View File

@@ -59,6 +59,7 @@ describe('validateDomainData', () => {
{ ...defaultDomain, name: 'ww2.baa' },
{ ...defaultDomain, name: 'help.baa' },
{ ...defaultDomain, name: '_github-pages-challenge-is-a-dev' },
{ ...defaultDomain, name: '_github-challenge-is-a-dev' },
];
const validCases = [
@@ -82,6 +83,9 @@ describe('validateDomainData', () => {
{ ...defaultDomain, name: '_github-pages-challenge-phenax.akshay' },
{ ...defaultDomain, name: '_github-pages-challenge-hello01-ga' },
{ ...defaultDomain, name: '_github-pages-challenge-hello01_ga' },
{ ...defaultDomain, name: '_github-challenge-phenax.akshay' },
{ ...defaultDomain, name: '_github-challenge-hello01-ga' },
{ ...defaultDomain, name: '_github-challenge-hello01_ga' },
];
it('should return false for invalid data', () => {

View File

@@ -12,5 +12,6 @@
"ww2",
"ww3",
"ww4",
"_github-pages-challenge-is-a-dev"
"_github-pages-challenge-is-a-dev",
"_github-challenge-is-a-dev"
]

View File

@@ -37,7 +37,7 @@ const validateDomainData = validate({
R.compose(
R.all(or([
and([
testRegex(/^_github-pages-challenge-[a-z0-9-_]+$/i), // Exception for github verification records
testRegex(/^_github(-pages)?-challenge-[a-z0-9-_]+$/i), // Exception for github verification records
checkRestrictedNames,
]),
and([