kifaru 1.0.197 → 1.0.198
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dashboard/_astro/login-form.BeDWrpLi.js +1 -0
- package/dashboard/_astro/{platform-route.B_bNjvKE.js → platform-route.CGqQh9Zl.js} +22 -22
- package/dashboard/administration/index.html +3 -3
- package/dashboard/agent/index.html +3 -3
- package/dashboard/assessments/index.html +3 -3
- package/dashboard/assurance.html +5 -24
- package/dashboard/audits/index.html +3 -3
- package/dashboard/billing/index.html +3 -3
- package/dashboard/console/index.html +3 -3
- package/dashboard/findings/index.html +3 -3
- package/dashboard/index.html +3 -3
- package/dashboard/lifecycle/index.html +3 -3
- package/dashboard/login/index.html +2 -2
- package/dashboard/reports/index.html +3 -3
- package/dashboard/reviews/index.html +3 -3
- package/dashboard/runs/index.html +3 -3
- package/dashboard/scheduled/index.html +3 -3
- package/dashboard/settings/index.html +3 -3
- package/dashboard/team/index.html +3 -3
- package/dashboard/workflows/index.html +3 -3
- package/kifaru-gateway.js +457 -235
- package/kifaru-pi.js +22 -1
- package/package.json +2 -2
- package/dashboard/_astro/login-form.BQO50avm.js +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{n as e,o as t}from"./react-dom.B--7n7g5.js";import{_ as n,a as r,c as i,g as a,i as o,n as s,o as c,r as l,s as u,t as d,v as f}from"./label.CkBP_RCn.js";var p=t(e(),1),m=a(),h=f(`relative grid w-full grid-cols-[0_1fr] items-start gap-y-0.5 rounded-lg border px-4 py-3 text-sm has-[>svg]:grid-cols-[calc(var(--spacing)*4)_1fr] has-[>svg]:gap-x-3 [&>svg]:size-4 [&>svg]:translate-y-0.5 [&>svg]:text-current`,{variants:{variant:{default:`bg-card text-card-foreground`,destructive:`bg-card text-destructive *:data-[slot=alert-description]:text-destructive/90 [&>svg]:text-current`}},defaultVariants:{variant:`default`}});function g({className:e,variant:t,...r}){return(0,m.jsx)(`div`,{"data-slot":`alert`,role:`alert`,className:n(h({variant:t}),e),...r})}function _({className:e,...t}){return(0,m.jsx)(`div`,{"data-slot":`alert-description`,className:n(`col-start-2 grid justify-items-start gap-1 text-sm text-muted-foreground [&_p]:leading-relaxed`,e),...t})}function v(e){return(0,m.jsx)(`svg`,{viewBox:`0 0 100 100`,role:`img`,"aria-label":`Kifaru`,xmlns:`http://www.w3.org/2000/svg`,...e,children:(0,m.jsx)(`path`,{d:`M57.53 0.31Q63.81 0.63 68.41 1.88Q73.01 3.14 77.3 5.23Q81.59 7.32 85.36 10.25L89.12 13.18L86.51 14.12Q83.89 15.06 79.5 15.9Q75.1 16.74 73.54 17.47Q71.97 18.2 70.29 19.98Q68.62 21.76 67.15 25Q65.69 28.24 64.85 29.29L64.02 30.33L63.18 27.41Q62.34 24.48 61.09 23.12Q59.83 21.76 59.1 21.55L58.37 21.34L58.16 22.18Q57.95 23.01 56.8 24.69Q55.65 26.36 55.33 27.72Q55.02 29.08 55.23 31.07Q55.44 33.05 56.8 34.94L58.16 36.82L57.22 38.39Q56.28 39.96 55.02 43.41Q53.77 46.86 52.51 48.95Q51.26 51.05 50.1 51.67Q48.95 52.3 47.59 52.09Q46.23 51.88 41.53 49.27L36.82 46.65L39.85 52.72Q42.89 58.79 42.99 59.83Q43.1 60.88 42.36 61.82Q41.63 62.76 40.27 62.97Q38.91 63.18 36.61 62.76Q34.31 62.34 31.8 61.3Q29.29 60.25 27.51 59.1Q25.73 57.95 24.06 56.38Q22.38 54.81 21.03 52.93Q19.67 51.05 17.99 47.07L16.32 43.1L16.42 46.86Q16.53 50.63 18.31 55.23Q20.08 59.83 23.54 64.02Q26.99 68.2 30.02 70.5Q33.05 72.8 35.77 74.27L38.49 75.73L38.39 78.14Q38.28 80.54 38.6 81.59Q38.91 82.64 39.75 83.68Q40.59 84.73 41.53 85.15Q42.47 85.56 45.19 85.46Q47.91 85.36 49.48 84.73Q51.05 84.1 51.99 83.26L52.93 82.43L52.3 83.37Q51.67 84.31 50.52 84.83L49.37 85.36L51.15 85.46Q52.93 85.56 56.17 84.21Q59.41 82.85 62.34 80.65Q65.27 78.45 67.78 75.63Q70.29 72.8 73.01 70.4Q75.73 67.99 76.15 67.99Q76.57 67.99 77.3 69.04Q78.03 70.08 78.87 70.08Q79.71 70.08 80.75 69.35Q81.8 68.62 82.32 68.62Q82.85 68.62 83.79 69.35Q84.73 70.08 85.67 70.08Q86.61 70.08 88.08 69.46L89.54 68.83L90.69 71.76Q91.84 74.69 93.83 76.99L95.82 79.29L95.19 80.44Q94.56 81.59 92.05 84.21Q89.54 86.82 84.52 90.38Q79.5 93.93 74.37 96.03Q69.25 98.12 63.81 99.06Q58.37 100 53.87 99.9Q49.37 99.79 44.67 98.85Q39.96 97.91 35.36 96.03Q30.75 94.14 26.26 91.11Q21.76 88.08 18.31 84.52Q14.85 80.96 12.24 76.99Q9.62 73.01 7.85 68.62Q6.07 64.23 5.13 59.31Q4.18 54.39 4.29 49.06Q4.39 43.72 5.33 39.44Q6.28 35.15 8.26 30.54Q10.25 25.94 13.18 21.76Q16.11 17.57 19.35 14.44Q22.59 11.3 26.88 8.47Q31.17 5.65 35.88 3.77Q40.59 1.88 45.92 0.94Q51.26 0 57.53 0.31Z`,fill:`currentColor`,fillRule:`evenodd`})})}function y(){let[e,t]=(0,p.useState)(),[n,a]=(0,p.useState)(!1),[f,h]=(0,p.useState)(),[y,b]=(0,p.useState)(``),[x,S]=(0,p.useState)({});(0,p.useEffect)(()=>{fetch(`/api/v1/auth/setup/status`).then(e=>e.ok?e.json():void 0).then(e=>{e&&typeof e.required==`boolean`&&h(e)}).catch(()=>{});let e=new URLSearchParams(window.location.search),t=new URLSearchParams(window.location.hash.replace(/^#/,``)).get(`invite`);t&&b(t);let n=e.get(`client_id`),r=e.get(`redirect_uri`),i=e.get(`code_challenge`),a=e.get(`state`),o=e.get(`code_challenge_method`);(n||r)&&S({clientId:n||void 0,redirectUri:r||void 0,codeChallenge:i||void 0,state:a||void 0,codeChallengeMethod:o||void 0})},[]);async function C(e){e.preventDefault(),a(!0),t(void 0);let n=new FormData(e.currentTarget),r=String(n.get(`email`)||``).trim(),i=String(n.get(`password`)||``),o=String(n.get(`name`)||``).trim(),s=String(n.get(`setupToken`)||``);try{if(y){if(!(await fetch(`/api/v1/auth/invitations/accept`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({token:y,email:r,name:o,password:i})})).ok){a(!1),t(`Invitation could not be accepted. Check the email, token, and password.`);return}window.history.replaceState(null,``,window.location.pathname+window.location.search),b(``)}if(f?.required&&f.tokenClaimEnabled){let e=await fetch(`/auth/setup`,{method:`POST`,headers:{"content-type":`application/json`,accept:`application/json`},body:JSON.stringify({email:r,password:i,name:o,setupToken:s})});if(!e.ok){a(!1),t(e.status===409?`Setup is already complete. Sign in.`:`Setup failed. Check the setup token and account details.`);return}h({required:!1,tokenClaimEnabled:!1})}let e=await fetch(`/api/v1/auth/login`,{method:`POST`,credentials:`same-origin`,headers:{"content-type":`application/json`},body:JSON.stringify({email:r,password:i,client_id:x.clientId,redirect_uri:x.redirectUri,code_challenge:x.codeChallenge,state:x.state,code_challenge_method:x.codeChallengeMethod})}),n=await e.json().catch(()=>void 0);if(!e.ok||!n?.csrfToken){a(!1),t(n?.detail??`Sign-in failed. Check your email and password.`);return}if(sessionStorage.setItem(`kifaru-csrf`,n.csrfToken),n.redirectUri){window.location.assign(n.redirectUri);return}let c=new URLSearchParams(window.location.search).get(`redirect`);window.location.assign(c&&c.startsWith(`/`)?c:`/`)}catch(e){a(!1),t(e instanceof Error?e.message:`Connection failed.`)}}let w=!!x.clientId,T=!!f?.required;return(0,m.jsxs)(l,{className:`w-full max-w-sm gap-5 p-6`,children:[(0,m.jsxs)(c,{children:[(0,m.jsxs)(`div`,{className:`mb-4 flex items-center gap-3`,children:[(0,m.jsx)(v,{className:`size-9 shrink-0 text-[var(--brand)]`}),(0,m.jsxs)(`div`,{className:`leading-tight`,children:[(0,m.jsx)(`strong`,{className:`block text-sm font-semibold tracking-wide`,children:`KIFARU`}),(0,m.jsx)(`small`,{className:`text-muted-foreground text-xs`,children:`Security Platform`})]})]}),(0,m.jsx)(`p`,{className:`text-muted-foreground text-2xs font-semibold tracking-[0.12em] uppercase`,children:`Unified platform access`}),(0,m.jsx)(u,{className:`text-lg`,children:y?`Accept invitation`:T?`Set up Kifaru`:w?`Authorize CLI`:`Sign in`}),(0,m.jsx)(r,{children:y?`Create your account for the workspace invitation. Your password stays private to you.`:T?f?.tokenClaimEnabled?`Create the first owner using the setup token supplied by your operator.`:f?.mode===`hosted`?`Run bun run --cwd packages/session-gateway db:bootstrap on the server with PLATFORM_OWNER_EMAIL and PLATFORM_OWNER_NAME set, then sign in.`:`Run kifaru auth provision --email you@example.com on the server, then sign in.`:w?`Sign in with your platform account to authorize the Kifaru CLI.`:`Sign in to access your security workspace.`})]}),(0,m.jsx)(o,{children:(0,m.jsxs)(`form`,{className:`grid gap-5`,onSubmit:C,"aria-describedby":e?`login-error`:void 0,children:[e?(0,m.jsx)(g,{variant:`destructive`,id:`login-error`,role:`alert`,children:(0,m.jsx)(_,{children:e})}):null,y||T&&f?.tokenClaimEnabled?(0,m.jsxs)(m.Fragment,{children:[(0,m.jsxs)(`div`,{className:`grid gap-2`,children:[(0,m.jsx)(d,{htmlFor:`login-name`,children:`Name`}),(0,m.jsx)(s,{id:`login-name`,name:`name`,autoComplete:`name`,required:!0})]}),y?null:(0,m.jsxs)(`div`,{className:`grid gap-2`,children:[(0,m.jsx)(d,{htmlFor:`login-setup-token`,children:`Setup token`}),(0,m.jsx)(s,{id:`login-setup-token`,name:`setupToken`,type:`password`,autoComplete:`one-time-code`,required:!0})]})]}):null,(0,m.jsxs)(`div`,{className:`grid gap-2`,children:[(0,m.jsx)(d,{htmlFor:`login-email`,children:`Email`}),(0,m.jsx)(s,{id:`login-email`,name:`email`,type:`email`,autoComplete:`email`,required:!0,autoFocus:!0,placeholder:`you@example.com`})]}),(0,m.jsxs)(`div`,{className:`grid gap-2`,children:[(0,m.jsx)(d,{htmlFor:`login-password`,children:`Password`}),(0,m.jsx)(s,{id:`login-password`,name:`password`,type:`password`,minLength:8,autoComplete:T||y?`new-password`:`current-password`,required:!0})]}),(0,m.jsx)(i,{type:`submit`,disabled:n||T&&!f?.tokenClaimEnabled&&!y,children:n?w?`Authorizing CLI…`:`Signing in…`:y?`Join workspace`:T?`Create owner`:w?`Authorize CLI`:`Sign in`})]})})]})}export{y as LoginForm};
|