File tree Expand file tree Collapse file tree 2 files changed +16
-0
lines changed
Expand file tree Collapse file tree 2 files changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -3,6 +3,7 @@ import { ConfluenceClient } from "./api/index.ts";
33import { getMessageFromAPIError } from "./confluence-helper.ts" ;
44import { withSpinner } from "../../core/console.ts" ;
55import { ConfluenceParent } from "./api/types.ts" ;
6+ import { VALID_DOMAINS } from "./constants.ts" ;
67
78const verifyWithSpinner = async (
89 verifyCommand : ( ) => Promise < void > ,
@@ -53,6 +54,16 @@ export const verifyConfluenceParent = async (
5354 parentUrl : string ,
5455 parent : ConfluenceParent
5556) => {
57+ const validURL = VALID_DOMAINS . find ( ( validURL ) =>
58+ parentUrl . startsWith ( validURL )
59+ ) ;
60+
61+ if ( ! validURL ) {
62+ throw new Error (
63+ `Invalid Testing URL: ${ parentUrl } . Valid URLs for testing include: ${ VALID_DOMAINS } . After testing is complete, this check will be removed.`
64+ ) ;
65+ }
66+
5667 if ( parent . space . length === 0 ) {
5768 throw new Error ( "Invalid Confluence parent URL: " + parentUrl ) ;
5869 }
Original file line number Diff line number Diff line change @@ -13,3 +13,8 @@ export const V2EDITOR_METADATA = {
1313} ;
1414
1515export const DELETE_SLEEP_MILLIS = 1000 ; //TODO replace with polling
16+
17+ export const VALID_DOMAINS = [
18+ "https://rstudiopbc-sandbox-249.atlassian.net/" ,
19+ "https://allenmanning.atlassian.net/" ,
20+ ] ;
You can’t perform that action at this time.
0 commit comments