1import { a as __toESM } from "./rolldown-runtime-Cql5ZV07.js"; 2import { p as require_react } from "./vendor-charts-D81iZKCV.js"; 3import { g as require_compiler_runtime, t as require_jsx_runtime } from "./vendor-react-HZz3WA9p.js"; 4import "./vendor-dnd-D_JGdZnv.js"; 5import "./vendor-mixpanel-Dh8wsiZW.js"; 6import "./device-CBwMusKw.js"; 7import "./vendor-redux-CLEI5hTp.js"; 8import "./vendor-pdf-DksyQ9Qr.js"; 9import "./vendor-utils-DiM3BD4o.js"; 10import "./vendor-ui-G6aSO5L-.js"; 11import { n as toast } from "./dist-Bh07-69G.js"; 12import { V as RefreshCw, Xt as EyeOff, Yt as Eye, in as Copy, jn as Check } from "./vendor-lucide-EY3Z5fcy.js"; 13import { t as Button } from "./button-BWyXpawe.js"; 14import "./vendor-twilio-BWAG7uEQ.js"; 15import "./ping-one-CpLVEVLd.js"; 16import "./app-storage-slice-mFVFfzPf.js"; 17import "./spin-Bjb5hq6_.js"; 18import { x as useFormContext } from "./vendor-form-DCqShb_y.js"; 19import "./label-BU8XDazs.js"; 20import { a as AlertDialogDescription, c as AlertDialogTitle, i as AlertDialogContent, n as AlertDialogAction, o as AlertDialogFooter, r as AlertDialogCancel, s as AlertDialogHeader, t as AlertDialog } from "./alert-dialog-DqgZ-9QP.js"; 21import { $ as TextareaField, Yn as trackMethodCall, m as InputField } from "./main-DDHJZG-i.js"; 22import "./breadcrumb-DaQ4spt4.js"; 23import "./upload-field.utils-D6MOo_v7.js"; 24import "./app-breadcrumb-C_0-hj4G.js"; 25import { a as CERT_MAX_LENGTH, b as useRegenerateScimTokenMutation, o as INPUT_MAX_LENGTH, s as URL_MAX_LENGTH, t as COPY_TIMEOUT, v as useGetSSOProvidersPreConfigQuery } from "./settings-sso.constants-Wi3LENBC.js"; 26import { t as SetupFormLayout } from "./setup-form-layout--TVmI94p.js"; 27var import_react = /* @__PURE__ */ __toESM(require_react()); 28var import_compiler_runtime$3 = /* @__PURE__ */ __toESM(require_compiler_runtime()); 29var import_jsx_runtime = /* @__PURE__ */ __toESM(require_jsx_runtime()); 30const RegenerateTokenDialog = (t0) => { 31 const $ = (0, import_compiler_runtime$3.c)(13); 32 const { open, onOpenChange, onConfirm, loading: t1 } = t0; 33 const loading = t1 === void 0 ? false : t1; 34 let t2; 35 if ($[0] === Symbol.for("react.memo_cache_sentinel")) { 36 t2 = /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(AlertDialogHeader, { children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)(AlertDialogTitle, { children: "Regenerate Bearer Token?" }), /* @__PURE__ */ (0, import_jsx_runtime.jsx)(AlertDialogDescription, { children: "Regenerating immediately invalidates the current token. CyberArk will start receiving 401 errors on SCIM push until you copy the new token into CyberArk â Provisioning â Authorization Header â Bearer Token. Continue?" })] }); 37 $[0] = t2; 38 } else t2 = $[0]; 39 let t3; 40 if ($[1] !== loading) { 41 t3 = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(AlertDialogCancel, { 42 disabled: loading, 43 children: "Cancel" 44 }); 45 $[1] = loading; 46 $[2] = t3; 47 } else t3 = $[2]; 48 let t4; 49 if ($[3] !== loading || $[4] !== onConfirm) { 50 t4 = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(AlertDialogAction, { 51 onClick: onConfirm, 52 disabled: loading, 53 children: "Regenerate" 54 }); 55 $[3] = loading; 56 $[4] = onConfirm; 57 $[5] = t4; 58 } else t4 = $[5]; 59 let t5; 60 if ($[6] !== t3 || $[7] !== t4) { 61 t5 = /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(AlertDialogContent, { 62 className: "max-w-128", 63 children: [t2, /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(AlertDialogFooter, { children: [t3, t4] })] 64 }); 65 $[6] = t3; 66 $[7] = t4; 67 $[8] = t5; 68 } else t5 = $[8]; 69 let t6; 70 if ($[9] !== onOpenChange || $[10] !== open || $[11] !== t5) { 71 t6 = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(AlertDialog, { 72 open, 73 onOpenChange, 74 children: t5 75 }); 76 $[9] = onOpenChange; 77 $[10] = open; 78 $[11] = t5; 79 $[12] = t6; 80 } else t6 = $[12]; 81 return t6; 82}; 83const BearerTokenSection = () => { 84 const form = useFormContext(); 85 const { data } = useGetSSOProvidersPreConfigQuery(); 86 const preConfigToken = data?.data?.find((item) => { 87 return item.type === "CYBER_ARK_SAML"; 88 })?.scim2Token ?? ""; 89 const formToken = form.watch("syncConfig.scimToken") ?? ""; 90 const token = preConfigToken || formToken; 91 (0, import_react.useEffect)(() => { 92 if (preConfigToken && preConfigToken !== formToken) form.setValue("syncConfig.scimToken", preConfigToken, { 93 shouldDirty: false, 94 shouldValidate: false 95 }); 96 }, [ 97 preConfigToken, 98 formToken, 99 form 100 ]); 101 const [visible, setVisible] = (0, import_react.useState)(false); 102 const [copied, setCopied] = (0, import_react.useState)(false); 103 const [dialogOpen, setDialogOpen] = (0, import_react.useState)(false); 104 const [regenerate, { isLoading }] = useRegenerateScimTokenMutation(); 105 const VisibilityIcon = visible ? Eye : EyeOff; 106 const displayValue = token ? visible ? token : "â¢".repeat(Math.min(token.length, 32)) : ""; 107 const handleCopy = async () => { 108 trackMethodCall("handleCopy", []); 109 if (!token) return; 110 try { 111 await navigator.clipboard.writeText(token); 112 setCopied(true); 113 setTimeout(() => { 114 return setCopied(false); 115 }, COPY_TIMEOUT); 116 } catch { 117 toast.error("Failed to copy", { description: "Please try again" }); 118 } 119 }; 120 const handleConfirmRegenerate = async () => { 121 trackMethodCall("handleConfirmRegenerate", []); 122 try { 123 const res = await regenerate({ type: "CYBER_ARK_SAML" }).unwrap(); 124 if (res.code === 200 && res.data) { 125 form.setValue("syncConfig.scimToken", res.data, { 126 shouldDirty: false, 127 shouldValidate: false 128 }); 129 setDialogOpen(false); 130 setVisible(true); 131 toast.success("Bearer token regenerated", { description: "Don't forget to copy it into CyberArk â Provisioning â Authorization Header" }); 132 } else toast.error("Failed to regenerate", { description: res.message || "Please try again" }); 133 } catch (err) { 134 toast.error("Failed to regenerate", { description: err instanceof Error ? err.message : "Please try again" }); 135 } 136 }; 137 return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { 138 className: "flex flex-col gap-3", 139 children: [
140 /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { 141 className: "flex items-center justify-between", 142 children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { 143 className: "text-sm leading-none font-medium text-foreground", 144 children: "Bearer Token" 145 }), /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Button, { 146 type: "button", 147 variant: "link", 148 className: "h-auto gap-2 px-0 py-0 text-sm font-medium", 149 onClick: () => { 150 return setDialogOpen(true); 151 }, 152 disabled: isLoading, 153 children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)(RefreshCw, { className: "size-4" }), "Regenerate"] 154 })] 155 }), 156 /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { 157 className: "flex max-w-full items-center gap-4 rounded-lg bg-muted px-3 py-2", 158 children: [ 159 /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { 160 className: "flex-1 overflow-hidden font-mono text-sm leading-5 text-ellipsis whitespace-nowrap text-foreground", 161 children: displayValue || "â" 162 }), 163 /* @__PURE__ */ (0, import_jsx_runtime.jsx)("button", { 164 type: "button", 165 "aria-label": visible ? "Hide token" : "Show token", 166 onClick: () => { 167 return setVisible((v) => { 168 return !v; 169 }); 170 }, 171 disabled: !token, 172 className: "text-muted-foreground hover:text-foreground disabled:opacity-50", 173 children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(VisibilityIcon, { className: "size-4" }) 174 }), 175 copied ? /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Button, { 176 type: "button", 177 variant: "ghost", 178 className: "h-8 gap-2 px-4 py-2", 179 onClick: handleCopy, 180 disabled: !token, 181 children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Check, { className: "size-4 text-success-foreground" }), /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { 182 className: "text-sm leading-5 font-medium text-success-foreground", 183 children: "Copied" 184 })] 185 }) : /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Button, { 186 type: "button", 187 variant: "outline", 188 className: "h-8 gap-2 px-4 py-2 shadow-xs", 189 onClick: handleCopy, 190 disabled: !token, 191 children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Copy, { className: "size-4" }), /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { 192 className: "text-sm leading-5 font-medium", 193 children: "Copy" 194 })] 195 }) 196 ] 197 }), 198 /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { 199 className: "text-sm leading-5 text-muted-foreground", 200 children: "System-generated token. Copy this into CyberArk â Provisioning â Authorization Header â Bearer Token. CyberArk will send this token in every SCIM request." 201 }) 202 ] 203 }
203), /* @__PURE__ */ (0, import_jsx_runtime.jsx)(RegenerateTokenDialog, { 204 open: dialogOpen, 205 onOpenChange: setDialogOpen, 206 onConfirm: handleConfirmRegenerate, 207 loading: isLoading 208 })] }); 209}; 210var import_compiler_runtime$2 = /* @__PURE__ */ __toESM(require_compiler_runtime()); 211const CopyReadonlyField = (t0) => { 212 const $ = (0, import_compiler_runtime$2.c)(19); 213 const { label, value, description } = t0; 214 const [copied, setCopied] = (0, import_react.useState)(false); 215 let t1; 216 if ($[0] !== value) { 217 t1 = async () => { 218 trackMethodCall("handleCopy", []); 219 if (!value) return; 220 try { 221 await navigator.clipboard.writeText(value); 222 setCopied(true); 223 setTimeout(() => setCopied(false), COPY_TIMEOUT); 224 } catch { 225 toast.error("Failed to copy", { description: "Please try again" }); 226 } 227 }; 228 $[0] = value; 229 $[1] = t1; 230 } else t1 = $[1]; 231 const handleCopy = t1; 232 let t2; 233 if ($[2] !== label) { 234 t2 = /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { 235 className: "text-sm leading-none font-medium text-foreground", 236 children: label 237 }); 238 $[2] = label; 239 $[3] = t2; 240 } else t2 = $[3]; 241 const t3 = value || "â"; 242 let t4; 243 if ($[4] !== t3) { 244 t4 = /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { 245 className: "flex-1 overflow-hidden text-sm leading-5 font-medium text-ellipsis whitespace-nowrap text-foreground", 246 children: t3 247 }); 248 $[4] = t3; 249 $[5] = t4; 250 } else t4 = $[5]; 251 let t5; 252 if ($[6] !== copied || $[7] !== handleCopy || $[8] !== value) { 253 t5 = copied ? /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Button, { 254 type: "button", 255 variant: "ghost", 256 className: "h-8 gap-2 px-4 py-2", 257 onClick: handleCopy, 258 disabled: !value, 259 children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Check, { className: "size-4 text-success-foreground" }), /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { 260 className: "text-sm leading-5 font-medium text-success-foreground", 261 children: "Copied" 262 })] 263 }) : /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Button, { 264 type: "button", 265 variant: "outline", 266 className: "h-8 gap-2 px-4 py-2 shadow-xs", 267 onClick: handleCopy, 268 disabled: !value, 269 children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Copy, { className: "size-4" }), /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { 270 className: "text-sm leading-5 font-medium", 271 children: "Copy" 272 })] 273 }); 274 $[6] = copied; 275 $[7] = handleCopy; 276 $[8] = value; 277 $[9] = t5; 278 } else t5 = $[9]; 279 let t6; 280 if ($[10] !== t4 || $[11] !== t5) { 281 t6 = /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
282 className: "flex max-w-full items-center gap-4 rounded-lg bg-muted px-3 py-2", 283 children: [t4, t5] 284 }); 285 $[10] = t4; 286 $[11] = t5; 287 $[12] = t6; 288 } else t6 = $[12]; 289 let t7; 290 if ($[13] !== description) { 291 t7 = /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { 292 className: "text-sm leading-5 text-muted-foreground", 293 children: description 294 }); 295 $[13] = description; 296 $[14] = t7; 297 } else t7 = $[14]; 298 let t8; 299 if ($[15] !== t2 || $[16] !== t6 || $[17] !== t7) { 300 t8 = /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { 301 className: "flex flex-col gap-3", 302 children: [ 303 t2, 304 t6, 305 t7 306 ] 307 }); 308 $[15] = t2; 309 $[16] = t6; 310 $[17] = t7; 311 $[18] = t8; 312 } else t8 = $[18]; 313 return t8; 314}; 315var import_compiler_runtime$1 = /* @__PURE__ */ __toESM(require_compiler_runtime()); 316var SectionTitle = (t0) => { 317 const $ = (0, import_compiler_runtime$1.c)(2); 318 const { children } = t0; 319 let t1; 320 if ($[0] !== children) { 321 t1 = /* @__PURE__ */ (0, import_jsx_runtime.jsx)("h2", { 322 className: "text-lg leading-7 font-semibold text-foreground", 323 children 324 }); 325 $[0] = children; 326 $[1] = t1; 327 } else t1 = $[1]; 328 return t1; 329}; 330const FormFields = () => { 331 const $ = (0, import_compiler_runtime$1.c)(15); 332 const { data } = useGetSSOProvidersPreConfigQuery(); 333 let t0; 334 if ($[0] !== data?.data) { 335 t0 = data?.data?.find(_temp); 336 $[0] = data?.data; 337 $[1] = t0; 338 } else t0 = $[1]; 339 const preConfig = t0; 340 const acsUrl = preConfig?.replyUrl ?? null; 341 const scimServiceUrl = preConfig?.scim2Url ?? null; 342 let t1; 343 if ($[2] === Symbol.for("react.memo_cache_sentinel")) { 344 t1 = /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("section", { 345 className: "flex flex-col gap-6", 346 children: [
347 /* @__PURE__ */ (0, import_jsx_runtime.jsx)(SectionTitle, { children: "Identity Provider (IdP) Configuration" }), 348 /* @__PURE__ */ (0, import_jsx_runtime.jsx)(InputField, { 349 name: "adminEmail", 350 title: "Admin Email", 351 placeholder: "[email protected]", 352 maxLength: 150, 353 required: true 354 }), 355 /* @__PURE__ */ (0, import_jsx_runtime.jsx)(InputField, { 356 name: "idpInfo.ssoUrl", 357 title: "IdP SSO URL", 358 placeholder: "SSO URL", 359 maxLength: 500, 360 required: true, 361 description: "Found in CyberArk â Trust â Identity Provider Configuration â Single Sign On URL." 362 }), 363 /* @__PURE__ */ (0, import_jsx_runtime.jsx)(InputField, { 364 name: "idpInfo.entityId", 365 title: "IdP Entity ID / Issuer", 366 placeholder: "Entity ID", 367 maxLength: 500, 368 required: true, 369 description: "Found in CyberArk â Trust â Identity Provider Configuration â IdP Entity ID / Issuer. Used to verify the Issuer in the SAML response â prevents assertion forgery from other IdPs." 370 }),
371 /* @__PURE__ */ (0, import_jsx_runtime.jsx)(TextareaField, { 372 name: "idpInfo.signingCertificate", 373 title: "Signing Certificate", 374 placeholder: "MIIDkzCCAn2g... (paste PEM or base64 content)", 375 maxLength: CERT_MAX_LENGTH, 376 required: true, 377 rows: 6, 378 className: "font-mono", 379 description: "Found in CyberArk â Trust â Identity Provider Configuration â Signing Certificate â Download. Paste the full PEM content or just the base64 body â PEM headers are stripped automatically on save." 380 }) 381 ] 382 }); 383 $[2] = t1; 384 } else t1 = $[2]; 385 let t2; 386 if ($[3] === Symbol.for("react.memo_cache_sentinel")) { 387 t2 = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(SectionTitle, { children: "Service Provider (SP) Configuration" }); 388 $[3] = t2; 389 } else t2 = $[3]; 390 let t3; 391 if ($[4] !== acsUrl) { 392 t3 = /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("section", { 393 className: "flex flex-col gap-6", 394 children: [t2, /* @__PURE__ */ (0, import_jsx_runtime.jsx)(CopyReadonlyField, { 395 label: "Assertion Consumer Service (ACS) URL", 396 value: acsUrl, 397 description: "Copy this value into CyberArk â Trust â Assertion Consumer Service (ACS) URL and SP Entity ID / Issuer / Audience." 398 })] 399 }); 400 $[4] = acsUrl; 401 $[5] = t3; 402 } else t3 = $[5]; 403 let t4; 404 if ($[6] === Symbol.for("react.memo_cache_sentinel")) { 405 t4 = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(SectionTitle, { children: "SCIM Endpoint" }); 406 $[6] = t4; 407 } else t4 = $[6]; 408 let t5; 409 if ($[7] !== scimServiceUrl) { 410 t5 = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(CopyReadonlyField, { 411 label: "SCIM Service URL", 412 value: scimServiceUrl, 413 description: "Copy this into CyberArk â Provisioning â SCIM Service URL." 414 }); 415 $[7] = scimServiceUrl; 416 $[8] = t5; 417 } else t5 = $[8]; 418 let t6; 419 if ($[9] === Symbol.for("react.memo_cache_sentinel")) { 420 t6 = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(BearerTokenSection, {}); 421 $[9] = t6; 422 } else t6 = $[9]; 423 let t7; 424 if ($[10] !== t5) { 425 t7 = /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("section", { 426 className: "flex flex-col gap-6", 427 children: [ 428 t4, 429 t5, 430 t6 431 ] 432 }); 433 $[10] = t5; 434 $[11] = t7; 435 } else t7 = $[11]; 436 let t8; 437 if ($[12] !== t3 || $[13] !== t7) { 438 t8 = /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [ 439 t1, 440 t3, 441 t7 442 ] }); 443 $[12] = t3; 444 $[13] = t7; 445 $[14] = t8; 446 } else t8 = $[14]; 447 return t8; 448}; 449function _temp(item) { 450 return item.type === "CYBER_ARK_SAML"; 451} 452var import_compiler_runtime = /* @__PURE__ */ __toESM(require_compiler_runtime()); 453var SettingsSSOCyberArk = () => { 454 const $ = (0, import_compiler_runtime.c)(1); 455 let t0; 456 if ($[0] === Symbol.for("react.memo_cache_sentinel")) { 457 t0 = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(SetupFormLayout, { 458 providerType: "CYBER_ARK_SAML", 459 hideReplyLink: true, 460 children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(FormFields, {}) 461 }); 462 $[0] = t0; 463 } else t0 = $[0]; 464 return t0; 465}; 466var settings_sso_cyber_ark_default = SettingsSSOCyberArk; 467export { settings_sso_cyber_ark_default as default };
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.