{"record":{"id":"3dd2853273bfb456","repo":"santifer/career-ops","slug":"flowxtra-url-must-use-https-url","errorCode":null,"errorMessage":"flowxtra: URL must use HTTPS: ${url}","messagePattern":"flowxtra: URL must use HTTPS: (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"warning","filePath":"providers/flowxtra.mjs","lineNumber":33,"sourceCode":"//\n// Wire in via a `job_boards:` entry with `provider: flowxtra`.\n\nconst JOBS_ENDPOINT = 'https://app.flowxtra.com/api/central/jobs';\nconst TRUSTED_ENDPOINT_HOST = 'app.flowxtra.com';\nconst TRUSTED_APPLY_HOST = 'flowxtra.com';\nconst PER_PAGE = 100;\nconst DEFAULT_MAX_PAGES = 3;\nconst MAX_PAGES_CAP = 50;\n\n/** @param {string} url */\nfunction assertFlowxtraEndpointUrl(url) {\n  let parsed;\n  try {\n    parsed = new URL(url);\n  } catch {\n    throw new Error(`flowxtra: invalid URL: ${url}`);\n  }\n  if (parsed.protocol !== 'https:') throw new Error(`flowxtra: URL must use HTTPS: ${url}`);\n  if (parsed.hostname !== TRUSTED_ENDPOINT_HOST) {\n    throw new Error(`flowxtra: untrusted hostname \"${parsed.hostname}\" — must be ${TRUSTED_ENDPOINT_HOST}`);\n  }\n  return url;\n}\n\n/** Resolve the page cap: a positive integer `max_pages` on the entry, capped. */\nfunction resolveMaxPages(entry) {\n  const v = entry?.max_pages;\n  if (Number.isInteger(v) && v > 0) return Math.min(v, MAX_PAGES_CAP);\n  return DEFAULT_MAX_PAGES;\n}\n\n// NaN-safe Date.parse — `|| undefined` would also coerce a valid epoch 0.\nfunction toEpochMs(value) {\n  if (!value) return undefined;\n  const parsed = Date.parse(value);\n  return Number.isNaN(parsed) ? undefined : parsed;","sourceCodeStart":15,"sourceCodeEnd":51,"githubUrl":"https://github.com/santifer/career-ops/blob/9b17a8ac97b398a496b38e423ae24e433b43254f/providers/flowxtra.mjs#L15-L51","documentation":"Thrown by flowxtra's assertFlowxtraEndpointUrl when the URL parses but is not https. Defense-in-depth: fetch() builds the URL from JOBS_ENDPOINT ('https://...'), so the protocol is always https and this branch is unreachable through normal use. Reachable only via a direct assertFlowxtraEndpointUrl call on an http URL.","triggerScenarios":"assertFlowxtraEndpointUrl is called directly with a well-formed http:// URL. No entry config or fetch() path produces this.","commonSituations":"A direct integration or test passing an http URL to the guard. Production scans cannot reach this branch.","solutions":["For direct callers, pass only https URLs.","For normal fetch() use, no action — JOBS_ENDPOINT is https.","Investigate if seen in production: JOBS_ENDPOINT was changed."],"exampleFix":"// before\nassertFlowxtraEndpointUrl('http://app.flowxtra.com/api/central/jobs?page=1');\n\n// after\nassertFlowxtraEndpointUrl('https://app.flowxtra.com/api/central/jobs?page=1');","handlingStrategy":"validation","validationCode":"function isHttpsUrl(u) { try { return new URL(u).protocol === 'https:'; } catch { return false; } }","typeGuard":"function isHttpsUrl(u) {\n  if (typeof u !== 'string' || !u) return false;\n  try { return new URL(u).protocol === 'https:'; } catch { return false; }\n}","tryCatchPattern":"try { assertFlowxtraEndpointUrl(url); }\ncatch (e) {\n  if (/^flowxtra: URL must use HTTPS/.test(e.message)) { /* upgrade to https or skip */ }\n  else throw e;\n}","preventionTips":["No action for normal scans — JOBS_ENDPOINT is https.","For direct calls, normalise to https.","Reject http at config time."],"tags":["url-validation","flowxtra","ssrf","tls","defense-in-depth"],"backgroundTag":null,"analyzedSha":"9b17a8ac97b398a496b38e423ae24e433b43254f","analyzedAt":"2026-08-13T00:48:39.135Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}