MCPcopy Index your code
hub / github.com/simstudioai/sim / validateSharePointSiteId

Function validateSharePointSiteId

apps/sim/lib/core/security/input-validation.ts:570–600  ·  view source on GitHub ↗
(
  value: string | null | undefined,
  paramName = 'siteId'
)

Source from the content-addressed store, hash-verified

568 * @returns ValidationResult
569 */
570export function validateSharePointSiteId(
571 value: string | null | undefined,
572 paramName = 'siteId'
573): ValidationResult {
574 if (value === null || value === undefined || value === '') {
575 return {
576 isValid: false,
577 error: `${paramName} is required`,
578 }
579 }
580
581 if (value.length > 512) {
582 return {
583 isValid: false,
584 error: `${paramName} exceeds maximum length`,
585 }
586 }
587
588 if (!/^[a-zA-Z0-9.\-,]+$/.test(value)) {
589 logger.warn('Invalid characters in SharePoint site ID', {
590 paramName,
591 value: value.substring(0, 100),
592 })
593 return {
594 isValid: false,
595 error: `${paramName} contains invalid characters`,
596 }
597 }
598
599 return { isValid: true, sanitized: value }
600}
601
602/**
603 * Validates Jira Cloud IDs (typically UUID format)

Callers 2

route.tsFile · 0.90
route.tsFile · 0.90

Calls 2

testMethod · 0.80
warnMethod · 0.65

Tested by

no test coverage detected