@coffre/ui 0.1.8 → 0.1.9

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.
@@ -1,2 +1,2 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["_coffre/assets/audit-EWPPhR7U.js","_coffre/assets/page-DbSS7pYH.js","_coffre/assets/preload-helper-DduCCcmc.js"])))=>i.map(i=>d[i]);
2
- import{T as e,t,w as n}from"./preload-helper-DduCCcmc.js";import{i as r,o as i}from"./coffre-CXkp3Efg.js";var a=()=>t(()=>import(`./audit-EWPPhR7U.js`),__vite__mapDeps([0,1,2])),o=200,s=e(`/audit`)({validateSearch:e=>({decision:e.decision===`deny`?`deny`:void 0,actorId:typeof e.actorId==`string`&&e.actorId!==``?e.actorId:void 0,detail:e.detail===`1`||e.detail===1?`1`:void 0}),loaderDeps:({search:e})=>e,loader:async({context:{client:e},deps:t})=>{let[n,r]=await Promise.all([c(e,t),l(e)]);return{entries:n,chain:r}},component:n(a,`component`)});function c(e,t){return i(async()=>e.audit.list({limit:o,decision:t.decision,actor:t.actorId,detail:t.detail}))}async function l(e){try{let t=await e.audit.verify();return t.ok?{integrity:`intact`,through:t.through,entries:t.entries,checkpoint:t.checkpoint,pending:t.pending??0}:{integrity:`broken`,through:t.through,failedAtSeq:t.failedAtSeq,author:t.author,reason:t.reason}}catch(e){let t=r(e);return t===403?{integrity:`owners-only`}:{integrity:`unknown`,problem:t===void 0?`the request never got an answer`:`the request failed with HTTP ${t}`}}}export{s as t};
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["_coffre/assets/audit-jURfT8Km.js","_coffre/assets/page-DbSS7pYH.js","_coffre/assets/preload-helper-DduCCcmc.js"])))=>i.map(i=>d[i]);
2
+ import{T as e,t,w as n}from"./preload-helper-DduCCcmc.js";import{i as r,o as i}from"./coffre-CXkp3Efg.js";var a=()=>t(()=>import(`./audit-jURfT8Km.js`),__vite__mapDeps([0,1,2])),o=200,s=e(`/audit`)({validateSearch:e=>({decision:e.decision===`deny`?`deny`:void 0,actorId:typeof e.actorId==`string`&&e.actorId!==``?e.actorId:void 0,detail:e.detail===`1`||e.detail===1?`1`:void 0}),loaderDeps:({search:e})=>e,loader:async({context:{client:e},deps:t})=>{let[n,r]=await Promise.all([c(e,t),l(e)]);return{entries:n,chain:r}},component:n(a,`component`)});function c(e,t){return i(async()=>e.audit.list({limit:o,decision:t.decision,actor:t.actorId,detail:t.detail}))}async function l(e){try{let t=await e.audit.verify();return t.ok?{integrity:`intact`,through:t.through,entries:t.entries,checkpoint:t.checkpoint,pending:t.pending??0}:{integrity:`broken`,through:t.through,failedAtSeq:t.failedAtSeq,author:t.author,reason:t.reason}}catch(e){let t=r(e);return t===403?{integrity:`owners-only`}:{integrity:`unknown`,problem:t===void 0?`the request never got an answer`:`the request failed with HTTP ${t}`}}}export{s as t};
@@ -0,0 +1 @@
1
+ import{$ as e,H as t,Ot as n,S as r,T as i,Tt as a,W as o,X as s,c,ct as l,f as u,i as d,m as f,n as p,o as m}from"./page-DbSS7pYH.js";import{D as h,a as g,c as _,f as v,m as y,u as b}from"./preload-helper-DduCCcmc.js";import{t as x}from"./audit-BtI9em7Q.js";var S=n(a()),C=e=>typeof e==`string`&&e!==``?e:null,w=e=>typeof e==`number`?e:null;function T({project:e,environment:t,key:n}){let r=[e,t,n].filter(e=>e!==null);return r.length===0?[`coffre`]:[{place:r.join(`/`)}]}function E({project:e,environment:t}){return T({project:e,environment:t,key:null})}function D(e){if(e.subject!==null)return[{member:e.subject}];let t=C(e.metadata.principalId);return t===null?[`someone`]:[{member:`${e.metadata.principalType===`service`?`token`:`user`}:${t}`}]}function O(e,t,n=`${t}s`){return`${e} ${e===1?t:n}`}function k(e){return e.batch.length===1?T(e.entry):[...E(e.entry),e.refused?`, `:`: `,O(e.count,`secret`)]}function A(e){let t=C(e.metadata.destination);return t===null?``:` to ${t}`}function j(e){return C(e.metadata.destination)??`its destination`}var M={reveal:[`revealed`,`reveal`],run:[`ran`,`run`],compare:[`compared`,`compare`],sync:[`read`,`read`]};function N({entry:e}){return M[C(e.metadata.purpose)??`reveal`]??M.reveal}var P=e=>{let t=t=>[`${e} `,...e===`project`?T({...t.entry,environment:null,key:null}):E(t.entry)];return{[`${e}.create`]:{did:`created`,tried:`create`,what:t},[`${e}.update`]:{did:`changed`,tried:`change`,what:t},[`${e}.archive`]:{did:`archived`,tried:`archive`,what:t},[`${e}.restore`]:{did:`restored`,tried:`restore`,what:t}}},F={"secret.read":{did:e=>N(e)[0],tried:e=>N(e)[1],what:k},"secret.write":{did:({batch:e})=>{let t=e.filter(e=>e.version===1).length;return t===e.length?`added`:t===0?`changed`:`wrote`},tried:`change`,what:k,then:({entry:e,batch:t})=>t.length>1||e.version===null||e.version===1?[]:[`, now version ${e.version}`]},"secret.restore":{did:`restored`,tried:`restore`,what:({entry:e})=>[...T(e),...w(e.metadata.from)===null?[]:[` to version ${w(e.metadata.from)}`]],then:({entry:e})=>e.version===null?[]:[`, now ${e.version}`]},"secret.rename":{did:`renamed`,tried:`rename`,what:({entry:e})=>[...T(e),...C(e.metadata.nextKey)===null?[]:[` to ${C(e.metadata.nextKey)}`]]},"secret.archive":{did:`archived`,tried:`archive`,what:e=>T(e.entry)},"secret.unarchive":{did:`brought back`,tried:`bring back`,what:e=>T(e.entry)},...P(`project`),...P(`environment`),"access.grant":{did:`gave`,tried:`give`,what:({entry:e})=>[...D(e),` ${C(e.metadata.role)??`a role`} on `,...I(e)],then:({entry:e})=>[...C(e.metadata.previousRole)===null?[]:[`, was ${C(e.metadata.previousRole)}`],...C(e.metadata.expiresAt)===null?[]:[`, until ${C(e.metadata.expiresAt).slice(0,10)}`]]},"access.revoke":{did:`took`,tried:`take`,what:({entry:e})=>[...C(e.metadata.previousRole??e.metadata.role)===null?[`access to `]:[`${C(e.metadata.previousRole??e.metadata.role)} on `],...I(e),` from `,...D(e)]},"member.add":{did:`added`,tried:`add`,what:({entry:e})=>[...D(e),...e.metadata.rootAdmin===!0?[` as a root admin`]:e.metadata.owner===!0?[` as an owner`]:[]]},"member.remove":{did:`removed`,tried:`remove`,what:e=>D(e.entry),then:({entry:e})=>w(e.metadata.revoked)===null?[]:[`, who held ${O(w(e.metadata.revoked),`grant`)}`]},"member.restore":{did:`brought back`,tried:`bring back`,what:e=>D(e.entry)},"member.owner":{did:({entry:e})=>e.metadata.owner===!1?`took owner from`:`made`,tried:({entry:e})=>e.metadata.owner===!1?`take owner from`:`make`,what:({entry:e})=>[...D(e),...e.metadata.owner===!1?[]:[` an owner`]]},"sync.create":{did:`set up a sync of`,tried:`set up a sync of`,what:({entry:e})=>[...E(e),A(e)]},"sync.update":{did:({entry:e})=>e.metadata.paused===!0?`paused the sync of`:e.metadata.paused===!1?`resumed the sync of`:`changed the sync of`,tried:`change the sync of`,what:({entry:e})=>[...E(e),A(e)]},"sync.delete":{did:`removed the sync of`,tried:`remove the sync of`,what:({entry:e})=>[...E(e),A(e)]},"sync.push":{did:`pushed`,tried:`push`,what:e=>e.batch.length===1?[...T(e.entry),` to ${j(e.entry)}`]:[...E(e.entry),` to ${j(e.entry)}: ${O(e.count,`secret`)}`]},"sync.remove":{did:`removed`,tried:`remove`,what:e=>e.batch.length===1?[...T(e.entry),` from ${j(e.entry)}`]:[O(e.count,`secret`),` of `,...E(e.entry),` from ${j(e.entry)}`]},"vault.tampered":{did:`found`,tried:`check`,what:({entry:e})=>[...e.subject===null?[`an entry`]:[...D(e),`'s record`],` tampered with: ${R[e.reason??``]??`it fails its seal`}`]},"key.rotate":{did:`rotated its key`,tried:`rotate its key`,what:()=>[]},sign_in:{did:({entry:e})=>e.metadata.kind===`cli`?`signed in to the CLI`:`signed in`,tried:`sign in`,what:({entry:e})=>C(e.metadata.provider)===null?[]:[`with ${C(e.metadata.provider)}`]},sign_out:{did:`signed out`,tried:`sign out`,what:()=>[]},"token.create":{did:`issued a token to`,tried:`issue a token to`,what:e=>D(e.entry)},"token.revoke":{did:`revoked a token of`,tried:`revoke a token of`,what:e=>D(e.entry)},"device.approve":{did:`approved a CLI sign-in`,tried:`approve a CLI sign-in`,what:()=>[]},"device.deny":{did:`turned down a CLI sign-in`,tried:`turn down a CLI sign-in`,what:()=>[]},"account.link":{did:`linked`,tried:`link`,what:({entry:e})=>[`a ${C(e.metadata.provider)??`sign-in`} account`]},"account.unlink":{did:`unlinked`,tried:`unlink`,what:({entry:e})=>[`a ${C(e.metadata.provider)??`sign-in`} account`]},"key.wrap":{did:`sealed the key of`,tried:`seal the key of`,what:e=>L(e.entry)},"key.rewrap":{did:`resealed the key of`,tried:`reseal the key of`,what:e=>L(e.entry)},"key.intent":{did:`asked KMS about`,tried:`ask KMS about`,what:e=>k(e)},"key.check":{did:`recorded the check value of`,tried:`check`,what:({entry:e})=>[[`the`,C(e.metadata.kekProvider)===`local`?null:C(e.metadata.kekProvider),`vault key`,C(e.metadata.kekId)].filter(e=>e!==null).join(` `)]},"sync.run":{did:`ran the sync of`,tried:`run the sync of`,what:({entry:e})=>[...E(e),A(e)]},"audit.heartbeat":{did:`checked in`,tried:`check in`,what:()=>[]},"audit.checkpoint":{did:`signed the log`,tried:`sign the log`,what:({entry:e})=>w(e.metadata.seq)===null?[]:[`through entry ${w(e.metadata.seq)}`]},"secret.list":{did:`listed`,tried:`list`,what:({entry:e})=>E(e)},"secret.history":{did:`read the history of`,tried:`read the history of`,what:e=>T(e.entry)},"secret.update":{did:`changed`,tried:`change`,what:e=>T(e.entry)},"sync.list":{did:`listed the syncs of`,tried:`list the syncs of`,what:({entry:e})=>E(e)}};function I(e){return T({...e,key:null})}function L(e){return[...T(e),...e.version===null?[]:[`, version ${e.version}`]]}var R={mac:`it does not carry the vault's seal`,stale:`an older copy was put back`,forged_entry:`the vault did not write it`},z={no_grant:`no grant`,bulk_limit:`bulk limit`,expired:`grant expired`,removed:`removed from coffre`,not_a_member:`not a member`,not_registered:`not invited`,tampered:`their record was tampered with`,bad_claim:`the key did not match the secret`,not_allowed:`not allowed`,root_admin:`root admins are set by the deployment`,unknown_environment:`no such environment`,unknown_secret:`no such secret`,unknown_project:`no such project`,unusable_credential:`its token is not a secret they can read`,duplicate_destination:`already synced from elsewhere`,cannot_grant_sync:`cannot grant the sync its reads`,kms_unavailable:`KMS did not answer`,wrong_kek:`the vault's key is not the one that wrapped the data`},B={secret_read:`no grant to read it`,secret_write:`no grant to write`,secret_archive:`no grant to archive`,audit_read:`no grant to read the audit log`,environment_manage:`no grant to manage environments`,grant_manage:`no grant to manage access`,project_manage:`no grant to manage the project`};function V(e){return e===null?`refused`:e.startsWith(`missing_`)?B[e.slice(8)]??`no grant`:z[e]??e.replace(/_/g,` `)}var H=[`sync.push`,`sync.remove`,`secret.write`,`secret.read`];function ee(e){for(let t of H){let n=e.find(e=>e.action===t);if(n!==void 0)return n}return e[0]}function U(e){let t=ee(e),n=e.filter(e=>e.action===t.action),r=n.filter(e=>e.decision===`deny`),i=r.length===n.length,a={entry:t,batch:n,count:new Set(n.map(e=>`${e.project}/${e.environment}/${e.key}`)).size,refused:i},o=F[t.action];if(o===void 0)return{parts:[t.action,` `,...T(t)],refused:i};let s=e=>typeof e==`string`?e:e(a),c=o.what(a),l=c.length===0?[]:[` `];if(i){let e=V((r[0]??t).reason);return{parts:[`tried to `,s(o.tried),...l,...c,`: ${e}`],refused:i}}let u=r.length===0?[]:[`, ${r.length} refused: ${V(r[0].reason)}`];return{parts:[s(o.did),...l,...c,...o.then?.(a)??[],...u],refused:i}}function W(e){let t=e[0];if(t.actorType===`user`)return{member:`user:${t.actorId}`};if(t.actorType===`service`)return{member:`token:${t.actorId}`};if(t.actorId.startsWith(`sync:`)){let t=e.map(e=>C(e.metadata.provider)).find(e=>e!==null),n=t===void 0?void 0:G[t]??t;return n===void 0?`a sync`:`sync to ${n}`}return K[t.actorId]??t.actorId}var G={"github-actions":`GitHub`,vercel:`Vercel`,railway:`Railway`,"cloudflare-workers":`Cloudflare`},K={scheduler:`the scheduler`,cron:`the scheduler`,vault:`the vault`,app:`coffre`};function q(e){return[`vault`,`app`].filter(t=>e.some(e=>e.author===t)).join(`, `)}function J(e){let t=[],n=new Map;for(let r of e){let e=r.operationId===null?void 0:n.get(r.operationId);if(e!==void 0){e.push(r);continue}let i=[r];r.operationId!==null&&n.set(r.operationId,i),t.push(i)}return t}var Y=l();function X(){let{entries:n,chain:r}=x.useLoaderData(),a=x.useSearch(),{decision:c,actorId:l}=a,u=a.detail===`1`,v=c===`deny`;if(!n.ok)return(0,Y.jsx)(p,{icon:(0,Y.jsx)(i,{size:18}),label:`Audit`,title:`The audit log is closed to you`,children:n.error});let y=r.integrity===`broken`?r:null,b=y?.failedAtSeq??null,S=J(n.entries),C={decision:c,actorId:l};return(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(d,{title:`Audit`,actions:(0,Y.jsx)(ae,{chain:r})}),y!==null&&(0,Y.jsx)(`div`,{style:{marginBottom:`1.25rem`},children:(0,Y.jsxs)(_,{tone:`bad`,children:[(0,Y.jsx)(`strong`,{children:`Treat this as an incident.`}),` `,y.failedAtSeq===null?`The log does not verify, found by the ${y.author}'s check: ${y.reason}.`:`The log breaks at entry ${y.failedAtSeq}, found by the ${y.author}'s check: ${y.reason}.`,` `,y.through!==null&&`Every entry through ${y.through} holds. `,`Something with direct access to the database has changed what it records`,y.failedAtSeq===null?``:`, and nothing from entry ${y.failedAtSeq} on can be relied on`,` until that is explained.`,b!==null&&!n.entries.some(e=>e.seq===b)&&(0,Y.jsxs)(Y.Fragment,{children:[` `,`Entry `,b,` is not among the entries below`,u?(0,Y.jsxs)(Y.Fragment,{children:[`; `,(0,Y.jsx)(`code`,{children:`coffre audit`}),` lists them all.`]}):`: it may be detail, which Show detail lists.`]})]})}),(0,Y.jsxs)(`div`,{className:`toolbar`,children:[(0,Y.jsxs)(`nav`,{className:`segmented`,"aria-label":`Filter by decision`,children:[(0,Y.jsx)(h,{to:`/audit`,search:{...C,decision:void 0,detail:a.detail},activeOptions:{exact:!0},children:`All events`}),(0,Y.jsxs)(h,{to:`/audit`,search:{...C,decision:`deny`,detail:a.detail},activeOptions:{exact:!0},children:[(0,Y.jsx)(o,{size:13}),`Denials only`]})]}),l!==void 0&&(0,Y.jsxs)(h,{className:`filter-chip`,to:`/audit`,search:{...C,actorId:void 0,detail:a.detail},"aria-label":`Stop filtering by ${l}`,children:[`Actor `,(0,Y.jsx)(`span`,{className:`mono`,children:l}),(0,Y.jsx)(e,{size:13})]}),(0,Y.jsxs)(h,{className:`detail-toggle`,to:`/audit`,search:{...C,detail:u?void 0:`1`},"aria-pressed":u,children:[(0,Y.jsx)(`span`,{className:`switch`,"aria-hidden":`true`}),`Show detail`]})]}),(0,Y.jsx)(`section`,{className:`card`,"aria-label":`Audit entries`,children:S.length===0?(0,Y.jsx)(g,{title:v?`No denials recorded`:`Nothing recorded yet`,children:v?`Every decision reaches this log, refusals included. An empty page means nobody has been turned away.`:`The log fills as people read and write secrets and change who has access.`}):(0,Y.jsx)(`div`,{className:`dt-wrap`,children:(0,Y.jsxs)(`table`,{className:`dt audit events stacks`,children:[(0,Y.jsx)(`thead`,{children:(0,Y.jsxs)(`tr`,{children:[(0,Y.jsx)(`th`,{className:`n`,title:`Sequence number in the log`,children:`#`}),(0,Y.jsx)(`th`,{className:`col-shrink`,children:(0,Y.jsxs)(`span`,{className:`th`,children:[(0,Y.jsx)(f,{size:14}),`When (UTC)`]})}),(0,Y.jsx)(`th`,{className:`col-shrink`,children:(0,Y.jsxs)(`span`,{className:`th`,children:[(0,Y.jsx)(s,{size:14}),`Who`]})}),(0,Y.jsx)(`th`,{children:(0,Y.jsxs)(`span`,{className:`th`,children:[(0,Y.jsx)(m,{size:14}),`What they did`]})}),(0,Y.jsx)(`th`,{className:`col-shrink`,children:(0,Y.jsxs)(`span`,{className:`th`,children:[(0,Y.jsx)(t,{size:14}),`Decided by`]})})]})}),(0,Y.jsx)(`tbody`,{children:S.map(e=>(0,Y.jsx)(Z,{batch:e,filters:C,detail:a.detail,breakAt:b},e[0].seq))})]})})})]})}function Z({batch:e,filters:t,detail:n,breakAt:r}){let i=r!==null&&e.some(e=>e.seq===r),[a,o]=(0,S.useState)(i),s=e[0],c=U(e),l=e.map(e=>e.seq),d=e.length>1;return(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(Q,{entry:s,seq:d?`${Math.min(...l)}–${Math.max(...l)}`:String(s.seq),parts:c.parts,refused:c.refused,decided:q(e),filters:t,detail:n,breaks:i&&!d,marked:i,batch:e,toggle:d?(0,Y.jsx)(`button`,{type:`button`,className:`batch-toggle`,"aria-expanded":a,"aria-label":a?`Hide each entry`:`Show each of ${e.length} entries`,onClick:()=>o(!a),children:(0,Y.jsx)(u,{size:14})}):void 0}),d&&a&&e.map(e=>{let i=U([e]);return(0,Y.jsx)(Q,{entry:e,seq:String(e.seq),parts:i.parts,refused:i.refused,decided:q([e]),filters:t,detail:n,breaks:e.seq===r,marked:!1,child:!0},e.seq)})]})}function Q({entry:e,seq:t,parts:n,refused:r,decided:i,filters:a,detail:s,breaks:l,marked:u,toggle:d,child:f=!1,batch:p}){let m=W(p??[e]),g=[r&&`is-denied`,(l||u)&&`is-break`,f&&`is-child`,e.detail&&`is-detail`,e.action===`vault.tampered`&&`is-tampered`].filter(Boolean);return(0,Y.jsxs)(`tr`,{className:g.length===0?void 0:g.join(` `),children:[(0,Y.jsx)(`td`,{className:`n`,"data-label":`Sequence`,children:t}),(0,Y.jsx)(`td`,{className:`nowrap cell-mono`,"data-label":`When (UTC)`,children:(0,Y.jsx)(b,{iso:e.occurredAt,precise:!0})}),(0,Y.jsx)(`td`,{"data-label":`Who`,children:(0,Y.jsx)(`span`,{className:`actor`,children:typeof m==`string`?(0,Y.jsx)(h,{to:`/audit`,search:{...a,actorId:e.actorId,detail:s},children:m}):(0,Y.jsx)(h,{to:`/audit`,search:{...a,actorId:e.actorId,detail:s},children:$(m.member)})})}),(0,Y.jsx)(`td`,{className:`cell-sentence`,"data-label":`What they did`,children:(0,Y.jsxs)(`span`,{className:`sentence`,children:[d,e.action===`vault.tampered`&&(0,Y.jsx)(c,{size:13}),(0,Y.jsx)(te,{parts:n}),l&&(0,Y.jsx)(ie,{})]})}),(0,Y.jsx)(`td`,{className:`nowrap`,"data-label":`Decided by`,children:(0,Y.jsxs)(`span`,{className:r?`decided decided-refused`:`decided`,children:[r&&(0,Y.jsx)(o,{size:13}),i,r&&`, refused`]})})]})}function te({parts:e}){return(0,Y.jsx)(Y.Fragment,{children:e.map((e,t)=>(0,Y.jsx)(S.Fragment,{children:typeof e==`string`?e:`place`in e?(0,Y.jsx)(ne,{path:e.place}):(0,Y.jsx)(re,{member:e.member})},t))})}function ne({path:e}){let[t,n]=e.split(`/`),r=(0,Y.jsx)(`span`,{className:`mono`,children:y(e)});return n===void 0?(0,Y.jsx)(h,{to:`/projects/$project`,params:{project:t},children:r}):(0,Y.jsx)(h,{to:`/projects/$project/$environment`,params:{project:t,environment:n},children:r})}function re({member:e}){return e.startsWith(`token:`)?(0,Y.jsx)(h,{to:`/tokens/$token`,params:{token:e.slice(6)},children:e}):(0,Y.jsx)(h,{to:`/users/$user`,params:{user:$(e)},children:$(e)})}function $(e){return e.startsWith(`user:`)?e.slice(5):e}function ie(){return(0,Y.jsxs)(`span`,{className:`break-mark`,children:[(0,Y.jsx)(c,{size:11}),`breaks here`]})}function ae({chain:e}){return e.integrity===`owners-only`?(0,Y.jsx)(v,{align:`end`,label:`Owners and root admins see whether the log is intact. Checking it means recomputing every entry, and you read only your projects' part of it.`,children:(0,Y.jsxs)(`button`,{type:`button`,className:`chain-note`,children:[(0,Y.jsx)(r,{size:14}),`Verified by owners`]})}):e.integrity===`unknown`?(0,Y.jsx)(v,{align:`end`,label:`coffre could not check the log: ${e.problem}. The entries below loaded, but whether they are intact is unknown until it can. Reload to try again.`,children:(0,Y.jsxs)(`button`,{type:`button`,className:`chain-flag chain-flag-warn`,children:[(0,Y.jsx)(c,{size:14}),`Log not verified`]})}):e.integrity===`broken`?(0,Y.jsxs)(`span`,{className:`chain-flag chain-flag-bad`,role:`status`,children:[(0,Y.jsx)(c,{size:14}),e.failedAtSeq===null?`Log does not verify`:`Log broken at ${e.failedAtSeq}`]}):(0,Y.jsxs)(`div`,{className:`chain`,children:[e.pending>0&&(0,Y.jsx)(v,{align:`end`,label:`Keys released through KMS whose outcome the vault has not logged yet. Each settles within seconds, or is logged as failed.`,children:(0,Y.jsxs)(`button`,{type:`button`,className:`chain-note`,role:`status`,children:[e.pending,` key operation`,e.pending===1?``:`s`,` in flight`]})}),(0,Y.jsx)(v,{align:`end`,label:`Every entry through ${e.through??0} holds, under the app's key and the vault's.`+(e.checkpoint===null?` The vault has not signed the log yet.`:` The vault last signed it through entry ${e.checkpoint.seq}, at ${e.checkpoint.signedAt}.`),children:(0,Y.jsxs)(`button`,{type:`button`,className:`chain-seal`,children:[(0,Y.jsx)(t,{size:14}),`Verified`]})})]})}export{X as component};
@@ -1,5 +1,5 @@
1
1
  const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["_coffre/assets/unregistered-D5go1AfR.js","_coffre/assets/page-DbSS7pYH.js"])))=>i.map(i=>d[i]);
2
- import{$ as e,A as t,B as n,C as r,Ct as i,Et as a,G as o,N as s,O as c,Ot as l,Q as u,St as d,T as f,Tt as p,U as m,V as h,W as g,Z as _,_t as v,a as y,at as b,c as x,ct as S,dt as C,et as ee,ft as te,gt as ne,ht as re,it as w,j as ie,k as ae,lt as oe,mt as se,n as ce,ot as E,p as D,pt as le,rt as ue,st as de,u as fe,ut as pe,v as O,vt as me,w as he,wt as ge,xt as _e,y as ve,yt as ye}from"./page-DbSS7pYH.js";import{A as be,B as xe,C as Se,D as Ce,E as we,F as Te,G as Ee,H as De,I as Oe,J as ke,K as Ae,L as je,M as Me,N as Ne,O as Pe,P as Fe,Q as Ie,R as Le,S as Re,T as ze,U as Be,V as Ve,W as He,X as Ue,Y as We,Z as Ge,_ as Ke,b as qe,d as Je,g as Ye,h as Xe,j as Ze,k as Qe,p as $e,q as et,t as tt,v as nt,w as rt,x as it,y as at,z as ot}from"./preload-helper-DduCCcmc.js";import{c as st,u as ct}from"./coffre-CXkp3Efg.js";import{n as lt}from"./use-action-CUvWPRTx.js";import{a as ut,s as dt,t as ft}from"./affordances-CmoY-8Xf.js";import{n as pt}from"./project-environments-CfIH5kFM.js";import{a as mt,i as ht,o as gt,r as _t,t as vt}from"./account-C3rBPdu6.js";import{t as yt}from"./audit-CdCJ1U8E.js";import{t as bt}from"./login-C-wTm_t1.js";import{t as xt}from"./settings-EimGqlQL.js";import{t as St}from"./auth.device-viDUwZRT.js";import{t as Ct}from"./projects.index-BG8W91BX.js";import{t as wt}from"./tokens.index-CSf5Mlz8.js";import{t as Tt}from"./tokens._token-Df2R8TF_.js";import{t as Et}from"./users.index-BoFWF3mF.js";import{t as Dt}from"./users._user-D0JK911L.js";import{t as Ot}from"./projects._project.index-CWXRo307.js";import{t as kt}from"./projects._project._environment-CLUpTvi-.js";var At=a((e=>{function t(e,t){var n=e.length;e.push(t);a:for(;0<n;){var r=n-1>>>1,a=e[r];if(0<i(a,t))e[r]=t,e[n]=a,n=r;else break a}}function n(e){return e.length===0?null:e[0]}function r(e){if(e.length===0)return null;var t=e[0],n=e.pop();if(n!==t){e[0]=n;a:for(var r=0,a=e.length,o=a>>>1;r<o;){var s=2*(r+1)-1,c=e[s],l=s+1,u=e[l];if(0>i(c,n))l<a&&0>i(u,c)?(e[r]=u,e[l]=n,r=l):(e[r]=c,e[s]=n,r=s);else if(l<a&&0>i(u,n))e[r]=u,e[l]=n,r=l;else break a}}return t}function i(e,t){var n=e.sortIndex-t.sortIndex;return n===0?e.id-t.id:n}if(e.unstable_now=void 0,typeof performance==`object`&&typeof performance.now==`function`){var a=performance;e.unstable_now=function(){return a.now()}}else{var o=Date,s=o.now();e.unstable_now=function(){return o.now()-s}}var c=[],l=[],u=1,d=null,f=3,p=!1,m=!1,h=!1,g=!1,_=typeof setTimeout==`function`?setTimeout:null,v=typeof clearTimeout==`function`?clearTimeout:null,y=typeof setImmediate<`u`?setImmediate:null;function b(e){for(var i=n(l);i!==null;){if(i.callback===null)r(l);else if(i.startTime<=e)r(l),i.sortIndex=i.expirationTime,t(c,i);else break;i=n(l)}}function x(e){if(h=!1,b(e),!m)if(n(c)!==null)m=!0,S||(S=!0,w());else{var t=n(l);t!==null&&oe(x,t.startTime-e)}}var S=!1,C=-1,ee=5,te=-1;function ne(){return g?!0:!(e.unstable_now()-te<ee)}function re(){if(g=!1,S){var t=e.unstable_now();te=t;var i=!0;try{a:{m=!1,h&&(h=!1,v(C),C=-1),p=!0;var a=f;try{b:{for(b(t),d=n(c);d!==null&&!(d.expirationTime>t&&ne());){var o=d.callback;if(typeof o==`function`){d.callback=null,f=d.priorityLevel;var s=o(d.expirationTime<=t);if(t=e.unstable_now(),typeof s==`function`){d.callback=s,b(t),i=!0;break b}d===n(c)&&r(c),b(t)}else r(c);d=n(c)}if(d!==null)i=!0;else{var u=n(l);u!==null&&oe(x,u.startTime-t),i=!1}}break a}finally{d=null,f=a,p=!1}i=void 0}}finally{i?w():S=!1}}}var w;if(typeof y==`function`)w=function(){y(re)};else if(typeof MessageChannel<`u`){var ie=new MessageChannel,ae=ie.port2;ie.port1.onmessage=re,w=function(){ae.postMessage(null)}}else w=function(){_(re,0)};function oe(t,n){C=_(function(){t(e.unstable_now())},n)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(e){e.callback=null},e.unstable_forceFrameRate=function(e){0>e||125<e?console.error(`forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported`):ee=0<e?Math.floor(1e3/e):5},e.unstable_getCurrentPriorityLevel=function(){return f},e.unstable_next=function(e){switch(f){case 1:case 2:case 3:var t=3;break;default:t=f}var n=f;f=t;try{return e()}finally{f=n}},e.unstable_requestPaint=function(){g=!0},e.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=f;f=e;try{return t()}finally{f=n}},e.unstable_scheduleCallback=function(r,i,a){var o=e.unstable_now();switch(typeof a==`object`&&a?(a=a.delay,a=typeof a==`number`&&0<a?o+a:o):a=o,r){case 1:var s=-1;break;case 2:s=250;break;case 5:s=1073741823;break;case 4:s=1e4;break;default:s=5e3}return s=a+s,r={id:u++,callback:i,priorityLevel:r,startTime:a,expirationTime:s,sortIndex:-1},a>o?(r.sortIndex=a,t(l,r),n(c)===null&&r===n(l)&&(h?(v(C),C=-1):h=!0,oe(x,a-o))):(r.sortIndex=s,t(c,r),m||p||(m=!0,S||(S=!0,w()))),r},e.unstable_shouldYield=ne,e.unstable_wrapCallback=function(e){var t=f;return function(){var n=f;f=t;try{return e.apply(this,arguments)}finally{f=n}}}})),jt=a(((e,t)=>{t.exports=At()})),Mt=a((e=>{var t=jt(),n=p(),r=Ie();function i(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n])}return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}function a(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function o(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function s(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function c(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function l(e){if(o(e)!==e)throw Error(i(188))}function u(e){var t=e.alternate;if(!t){if(t=o(e),t===null)throw Error(i(188));return t===e?e:null}for(var n=e,r=t;;){var a=n.return;if(a===null)break;var s=a.alternate;if(s===null){if(r=a.return,r!==null){n=r;continue}break}if(a.child===s.child){for(s=a.child;s;){if(s===n)return l(a),e;if(s===r)return l(a),t;s=s.sibling}throw Error(i(188))}if(n.return!==r.return)n=a,r=s;else{for(var c=!1,u=a.child;u;){if(u===n){c=!0,n=a,r=s;break}if(u===r){c=!0,r=a,n=s;break}u=u.sibling}if(!c){for(u=s.child;u;){if(u===n){c=!0,n=s,r=a;break}if(u===r){c=!0,r=s,n=a;break}u=u.sibling}if(!c)throw Error(i(189))}}if(n.alternate!==r)throw Error(i(190))}if(n.tag!==3)throw Error(i(188));return n.stateNode.current===n?e:t}function d(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=d(e),t!==null)return t;e=e.sibling}return null}var f=Object.assign,m=Symbol.for(`react.element`),h=Symbol.for(`react.transitional.element`),g=Symbol.for(`react.portal`),_=Symbol.for(`react.fragment`),v=Symbol.for(`react.strict_mode`),y=Symbol.for(`react.profiler`),b=Symbol.for(`react.consumer`),x=Symbol.for(`react.context`),S=Symbol.for(`react.forward_ref`),C=Symbol.for(`react.suspense`),ee=Symbol.for(`react.suspense_list`),te=Symbol.for(`react.memo`),ne=Symbol.for(`react.lazy`),re=Symbol.for(`react.activity`),w=Symbol.for(`react.memo_cache_sentinel`),ie=Symbol.iterator;function ae(e){return typeof e!=`object`||!e?null:(e=ie&&e[ie]||e[`@@iterator`],typeof e==`function`?e:null)}var oe=Symbol.for(`react.client.reference`);function se(e){if(e==null)return null;if(typeof e==`function`)return e.$$typeof===oe?null:e.displayName||e.name||null;if(typeof e==`string`)return e;switch(e){case _:return`Fragment`;case y:return`Profiler`;case v:return`StrictMode`;case C:return`Suspense`;case ee:return`SuspenseList`;case re:return`Activity`}if(typeof e==`object`)switch(e.$$typeof){case g:return`Portal`;case x:return e.displayName||`Context`;case b:return(e._context.displayName||`Context`)+`.Consumer`;case S:var t=e.render;return e=e.displayName,e||=(e=t.displayName||t.name||``,e===``?`ForwardRef`:`ForwardRef(`+e+`)`),e;case te:return t=e.displayName||null,t===null?se(e.type)||`Memo`:t;case ne:t=e._payload,e=e._init;try{return se(e(t))}catch{}}return null}var ce=Array.isArray,E=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,D=r.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,le={pending:!1,data:null,method:null,action:null},ue=[],de=-1;function fe(e){return{current:e}}function pe(e){0>de||(e.current=ue[de],ue[de]=null,de--)}function O(e,t){de++,ue[de]=e.current,e.current=t}var me=fe(null),he=fe(null),ge=fe(null),_e=fe(null);function ve(e,t){switch(O(ge,t),O(he,e),O(me,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?Hd(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=Hd(t),e=Ud(t,e);else switch(e){case`svg`:e=1;break;case`math`:e=2;break;default:e=0}}pe(me),O(me,e)}function ye(){pe(me),pe(he),pe(ge)}function be(e){e.memoizedState!==null&&O(_e,e);var t=me.current,n=Ud(t,e.type);t!==n&&(O(he,e),O(me,n))}function xe(e){he.current===e&&(pe(me),pe(he)),_e.current===e&&(pe(_e),$f._currentValue=le)}var Se,Ce;function we(e){if(Se===void 0)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);Se=t&&t[1]||``,Ce=-1<e.stack.indexOf(`
2
+ import{$ as e,A as t,B as n,C as r,Ct as i,Et as a,G as o,N as s,O as c,Ot as l,Q as u,St as d,T as f,Tt as p,U as m,V as h,W as g,Z as _,_t as v,a as y,at as b,c as x,ct as S,dt as C,et as ee,ft as te,gt as ne,ht as re,it as w,j as ie,k as ae,lt as oe,mt as se,n as ce,ot as E,p as D,pt as le,rt as ue,st as de,u as fe,ut as pe,v as O,vt as me,w as he,wt as ge,xt as _e,y as ve,yt as ye}from"./page-DbSS7pYH.js";import{A as be,B as xe,C as Se,D as Ce,E as we,F as Te,G as Ee,H as De,I as Oe,J as ke,K as Ae,L as je,M as Me,N as Ne,O as Pe,P as Fe,Q as Ie,R as Le,S as Re,T as ze,U as Be,V as Ve,W as He,X as Ue,Y as We,Z as Ge,_ as Ke,b as qe,d as Je,g as Ye,h as Xe,j as Ze,k as Qe,p as $e,q as et,t as tt,v as nt,w as rt,x as it,y as at,z as ot}from"./preload-helper-DduCCcmc.js";import{c as st,u as ct}from"./coffre-CXkp3Efg.js";import{n as lt}from"./use-action-CUvWPRTx.js";import{a as ut,s as dt,t as ft}from"./affordances-CmoY-8Xf.js";import{n as pt}from"./project-environments-CfIH5kFM.js";import{a as mt,i as ht,o as gt,r as _t,t as vt}from"./account-C3rBPdu6.js";import{t as yt}from"./audit-BtI9em7Q.js";import{t as bt}from"./login-C-wTm_t1.js";import{t as xt}from"./settings-EimGqlQL.js";import{t as St}from"./auth.device-viDUwZRT.js";import{t as Ct}from"./projects.index-BG8W91BX.js";import{t as wt}from"./tokens.index-CSf5Mlz8.js";import{t as Tt}from"./tokens._token-Df2R8TF_.js";import{t as Et}from"./users.index-BoFWF3mF.js";import{t as Dt}from"./users._user-D0JK911L.js";import{t as Ot}from"./projects._project.index-CWXRo307.js";import{t as kt}from"./projects._project._environment-CLUpTvi-.js";var At=a((e=>{function t(e,t){var n=e.length;e.push(t);a:for(;0<n;){var r=n-1>>>1,a=e[r];if(0<i(a,t))e[r]=t,e[n]=a,n=r;else break a}}function n(e){return e.length===0?null:e[0]}function r(e){if(e.length===0)return null;var t=e[0],n=e.pop();if(n!==t){e[0]=n;a:for(var r=0,a=e.length,o=a>>>1;r<o;){var s=2*(r+1)-1,c=e[s],l=s+1,u=e[l];if(0>i(c,n))l<a&&0>i(u,c)?(e[r]=u,e[l]=n,r=l):(e[r]=c,e[s]=n,r=s);else if(l<a&&0>i(u,n))e[r]=u,e[l]=n,r=l;else break a}}return t}function i(e,t){var n=e.sortIndex-t.sortIndex;return n===0?e.id-t.id:n}if(e.unstable_now=void 0,typeof performance==`object`&&typeof performance.now==`function`){var a=performance;e.unstable_now=function(){return a.now()}}else{var o=Date,s=o.now();e.unstable_now=function(){return o.now()-s}}var c=[],l=[],u=1,d=null,f=3,p=!1,m=!1,h=!1,g=!1,_=typeof setTimeout==`function`?setTimeout:null,v=typeof clearTimeout==`function`?clearTimeout:null,y=typeof setImmediate<`u`?setImmediate:null;function b(e){for(var i=n(l);i!==null;){if(i.callback===null)r(l);else if(i.startTime<=e)r(l),i.sortIndex=i.expirationTime,t(c,i);else break;i=n(l)}}function x(e){if(h=!1,b(e),!m)if(n(c)!==null)m=!0,S||(S=!0,w());else{var t=n(l);t!==null&&oe(x,t.startTime-e)}}var S=!1,C=-1,ee=5,te=-1;function ne(){return g?!0:!(e.unstable_now()-te<ee)}function re(){if(g=!1,S){var t=e.unstable_now();te=t;var i=!0;try{a:{m=!1,h&&(h=!1,v(C),C=-1),p=!0;var a=f;try{b:{for(b(t),d=n(c);d!==null&&!(d.expirationTime>t&&ne());){var o=d.callback;if(typeof o==`function`){d.callback=null,f=d.priorityLevel;var s=o(d.expirationTime<=t);if(t=e.unstable_now(),typeof s==`function`){d.callback=s,b(t),i=!0;break b}d===n(c)&&r(c),b(t)}else r(c);d=n(c)}if(d!==null)i=!0;else{var u=n(l);u!==null&&oe(x,u.startTime-t),i=!1}}break a}finally{d=null,f=a,p=!1}i=void 0}}finally{i?w():S=!1}}}var w;if(typeof y==`function`)w=function(){y(re)};else if(typeof MessageChannel<`u`){var ie=new MessageChannel,ae=ie.port2;ie.port1.onmessage=re,w=function(){ae.postMessage(null)}}else w=function(){_(re,0)};function oe(t,n){C=_(function(){t(e.unstable_now())},n)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(e){e.callback=null},e.unstable_forceFrameRate=function(e){0>e||125<e?console.error(`forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported`):ee=0<e?Math.floor(1e3/e):5},e.unstable_getCurrentPriorityLevel=function(){return f},e.unstable_next=function(e){switch(f){case 1:case 2:case 3:var t=3;break;default:t=f}var n=f;f=t;try{return e()}finally{f=n}},e.unstable_requestPaint=function(){g=!0},e.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=f;f=e;try{return t()}finally{f=n}},e.unstable_scheduleCallback=function(r,i,a){var o=e.unstable_now();switch(typeof a==`object`&&a?(a=a.delay,a=typeof a==`number`&&0<a?o+a:o):a=o,r){case 1:var s=-1;break;case 2:s=250;break;case 5:s=1073741823;break;case 4:s=1e4;break;default:s=5e3}return s=a+s,r={id:u++,callback:i,priorityLevel:r,startTime:a,expirationTime:s,sortIndex:-1},a>o?(r.sortIndex=a,t(l,r),n(c)===null&&r===n(l)&&(h?(v(C),C=-1):h=!0,oe(x,a-o))):(r.sortIndex=s,t(c,r),m||p||(m=!0,S||(S=!0,w()))),r},e.unstable_shouldYield=ne,e.unstable_wrapCallback=function(e){var t=f;return function(){var n=f;f=t;try{return e.apply(this,arguments)}finally{f=n}}}})),jt=a(((e,t)=>{t.exports=At()})),Mt=a((e=>{var t=jt(),n=p(),r=Ie();function i(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n])}return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}function a(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function o(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function s(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function c(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function l(e){if(o(e)!==e)throw Error(i(188))}function u(e){var t=e.alternate;if(!t){if(t=o(e),t===null)throw Error(i(188));return t===e?e:null}for(var n=e,r=t;;){var a=n.return;if(a===null)break;var s=a.alternate;if(s===null){if(r=a.return,r!==null){n=r;continue}break}if(a.child===s.child){for(s=a.child;s;){if(s===n)return l(a),e;if(s===r)return l(a),t;s=s.sibling}throw Error(i(188))}if(n.return!==r.return)n=a,r=s;else{for(var c=!1,u=a.child;u;){if(u===n){c=!0,n=a,r=s;break}if(u===r){c=!0,r=a,n=s;break}u=u.sibling}if(!c){for(u=s.child;u;){if(u===n){c=!0,n=s,r=a;break}if(u===r){c=!0,r=s,n=a;break}u=u.sibling}if(!c)throw Error(i(189))}}if(n.alternate!==r)throw Error(i(190))}if(n.tag!==3)throw Error(i(188));return n.stateNode.current===n?e:t}function d(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=d(e),t!==null)return t;e=e.sibling}return null}var f=Object.assign,m=Symbol.for(`react.element`),h=Symbol.for(`react.transitional.element`),g=Symbol.for(`react.portal`),_=Symbol.for(`react.fragment`),v=Symbol.for(`react.strict_mode`),y=Symbol.for(`react.profiler`),b=Symbol.for(`react.consumer`),x=Symbol.for(`react.context`),S=Symbol.for(`react.forward_ref`),C=Symbol.for(`react.suspense`),ee=Symbol.for(`react.suspense_list`),te=Symbol.for(`react.memo`),ne=Symbol.for(`react.lazy`),re=Symbol.for(`react.activity`),w=Symbol.for(`react.memo_cache_sentinel`),ie=Symbol.iterator;function ae(e){return typeof e!=`object`||!e?null:(e=ie&&e[ie]||e[`@@iterator`],typeof e==`function`?e:null)}var oe=Symbol.for(`react.client.reference`);function se(e){if(e==null)return null;if(typeof e==`function`)return e.$$typeof===oe?null:e.displayName||e.name||null;if(typeof e==`string`)return e;switch(e){case _:return`Fragment`;case y:return`Profiler`;case v:return`StrictMode`;case C:return`Suspense`;case ee:return`SuspenseList`;case re:return`Activity`}if(typeof e==`object`)switch(e.$$typeof){case g:return`Portal`;case x:return e.displayName||`Context`;case b:return(e._context.displayName||`Context`)+`.Consumer`;case S:var t=e.render;return e=e.displayName,e||=(e=t.displayName||t.name||``,e===``?`ForwardRef`:`ForwardRef(`+e+`)`),e;case te:return t=e.displayName||null,t===null?se(e.type)||`Memo`:t;case ne:t=e._payload,e=e._init;try{return se(e(t))}catch{}}return null}var ce=Array.isArray,E=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,D=r.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,le={pending:!1,data:null,method:null,action:null},ue=[],de=-1;function fe(e){return{current:e}}function pe(e){0>de||(e.current=ue[de],ue[de]=null,de--)}function O(e,t){de++,ue[de]=e.current,e.current=t}var me=fe(null),he=fe(null),ge=fe(null),_e=fe(null);function ve(e,t){switch(O(ge,t),O(he,e),O(me,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?Hd(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=Hd(t),e=Ud(t,e);else switch(e){case`svg`:e=1;break;case`math`:e=2;break;default:e=0}}pe(me),O(me,e)}function ye(){pe(me),pe(he),pe(ge)}function be(e){e.memoizedState!==null&&O(_e,e);var t=me.current,n=Ud(t,e.type);t!==n&&(O(he,e),O(me,n))}function xe(e){he.current===e&&(pe(me),pe(he)),_e.current===e&&(pe(_e),$f._currentValue=le)}var Se,Ce;function we(e){if(Se===void 0)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);Se=t&&t[1]||``,Ce=-1<e.stack.indexOf(`
3
3
  at`)?` (<anonymous>)`:-1<e.stack.indexOf(`@`)?`@unknown:0:0`:``}return`
4
4
  `+Se+e+Ce}var Te=!1;function Ee(e,t){if(!e||Te)return``;Te=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var r={DetermineComponentFrameRoot:function(){try{if(t){var n=function(){throw Error()};if(Object.defineProperty(n.prototype,"props",{set:function(){throw Error()}}),typeof Reflect==`object`&&Reflect.construct){try{Reflect.construct(n,[])}catch(e){var r=e}Reflect.construct(e,[],n)}else{try{n.call()}catch(e){r=e}e.call(n.prototype)}}else{try{throw Error()}catch(e){r=e}(n=e())&&typeof n.catch==`function`&&n.catch(function(){})}}catch(e){if(e&&r&&typeof e.stack==`string`)return[e.stack,r.stack]}return[null,null]}};r.DetermineComponentFrameRoot.displayName=`DetermineComponentFrameRoot`;var i=Object.getOwnPropertyDescriptor(r.DetermineComponentFrameRoot,`name`);i&&i.configurable&&Object.defineProperty(r.DetermineComponentFrameRoot,"name",{value:`DetermineComponentFrameRoot`});var a=r.DetermineComponentFrameRoot(),o=a[0],s=a[1];if(o&&s){var c=o.split(`
5
5
  `),l=s.split(`
@@ -95,8 +95,8 @@
95
95
  "_react-dom-qCTiwGGR.js"
96
96
  ]
97
97
  },
98
- "_audit-Bb9Er3nm.js": {
99
- "file": "_coffre/assets/audit-Bb9Er3nm.js",
98
+ "_audit-wjpo1BWg.js": {
99
+ "file": "_coffre/assets/audit-wjpo1BWg.js",
100
100
  "name": "audit",
101
101
  "imports": [
102
102
  "_ui-D_slKpSF.js",
@@ -320,7 +320,7 @@
320
320
  "name": "validation"
321
321
  },
322
322
  "src/router.tsx": {
323
- "file": "_coffre/assets/router-BimLwejs.js",
323
+ "file": "_coffre/assets/router-BUwZOXEH.js",
324
324
  "name": "router",
325
325
  "src": "src/router.tsx",
326
326
  "isDynamicEntry": true,
@@ -335,7 +335,7 @@
335
335
  "_affordances-BNaXjMOb.js",
336
336
  "_project-environments-lEzFHUt4.js",
337
337
  "_account-D7-ZAE2T.js",
338
- "_audit-Bb9Er3nm.js",
338
+ "_audit-wjpo1BWg.js",
339
339
  "_login-B2njIq_o.js",
340
340
  "_settings-Cy__khNA.js",
341
341
  "_auth.device-CMR3csAI.js",
@@ -384,7 +384,7 @@
384
384
  ]
385
385
  },
386
386
  "src/routes/audit.tsx?tsr-split=component": {
387
- "file": "_coffre/assets/audit-CnfDYD-u.js",
387
+ "file": "_coffre/assets/audit-BEbhtsEp.js",
388
388
  "name": "audit",
389
389
  "src": "src/routes/audit.tsx?tsr-split=component",
390
390
  "isDynamicEntry": true,
@@ -392,7 +392,7 @@
392
392
  "_useStore-DWGPqzXR.js",
393
393
  "_ui-D_slKpSF.js",
394
394
  "_page-BdnhpwvH.js",
395
- "_audit-Bb9Er3nm.js"
395
+ "_audit-wjpo1BWg.js"
396
396
  ]
397
397
  },
398
398
  "src/routes/auth.device.tsx?tsr-split=component": {
@@ -547,7 +547,7 @@
547
547
  ]
548
548
  },
549
549
  "tanstack-start-manifest:v": {
550
- "file": "_coffre/assets/_tanstack-start-manifest_v-C2PEUeJL.js",
550
+ "file": "_coffre/assets/_tanstack-start-manifest_v-CrnrBINO.js",
551
551
  "name": "_tanstack-start-manifest_v",
552
552
  "src": "tanstack-start-manifest:v",
553
553
  "isDynamicEntry": true
@@ -20,7 +20,7 @@ var tsrStartManifest = () => ({ routes: {
20
20
  "/projects/$project/"
21
21
  ],
22
22
  preloads: [
23
- "/_coffre/assets/index-DoJkcH-T.js",
23
+ "/_coffre/assets/index-CD7bvUCb.js",
24
24
  "/_coffre/assets/page-DbSS7pYH.js",
25
25
  "/_coffre/assets/preload-helper-DduCCcmc.js",
26
26
  "/_coffre/assets/coffre-CXkp3Efg.js",
@@ -28,7 +28,7 @@ var tsrStartManifest = () => ({ routes: {
28
28
  "/_coffre/assets/affordances-CmoY-8Xf.js",
29
29
  "/_coffre/assets/project-environments-CfIH5kFM.js",
30
30
  "/_coffre/assets/account-C3rBPdu6.js",
31
- "/_coffre/assets/audit-CdCJ1U8E.js",
31
+ "/_coffre/assets/audit-BtI9em7Q.js",
32
32
  "/_coffre/assets/login-C-wTm_t1.js",
33
33
  "/_coffre/assets/settings-EimGqlQL.js",
34
34
  "/_coffre/assets/auth.device-viDUwZRT.js",
@@ -43,7 +43,7 @@ var tsrStartManifest = () => ({ routes: {
43
43
  scripts: [{ attrs: {
44
44
  type: "module",
45
45
  async: !0,
46
- src: "/_coffre/assets/index-DoJkcH-T.js"
46
+ src: "/_coffre/assets/index-CD7bvUCb.js"
47
47
  } }]
48
48
  },
49
49
  "/account": {
@@ -58,7 +58,7 @@ var tsrStartManifest = () => ({ routes: {
58
58
  "/audit": {
59
59
  filePath: "/home/runner/work/coffre/coffre/packages/ui/src/routes/audit.tsx",
60
60
  children: void 0,
61
- preloads: ["/_coffre/assets/audit-EWPPhR7U.js"]
61
+ preloads: ["/_coffre/assets/audit-jURfT8Km.js"]
62
62
  },
63
63
  "/login": {
64
64
  filePath: "/home/runner/work/coffre/coffre/packages/ui/src/routes/login.tsx",
@@ -1,7 +1,7 @@
1
1
  import { C as require_react, E as __toESM, o as require_jsx_runtime } from "./useStore-DWGPqzXR.js";
2
2
  import { E as Link, d as Toggletip, i as EmptyState, l as Timestamp, p as breakAfterUnderscores, s as Notice } from "./ui-D_slKpSF.js";
3
3
  import { $ as X, H as ShieldCheck, S as Info, T as Ledger, W as SlashCircle, X as User, c as AlertTriangle, f as ChevronRight, i as PageHeader, m as Clock, n as ClosedDoor, o as Activity } from "./page-BdnhpwvH.js";
4
- import { t as Route } from "./audit-Bb9Er3nm.js";
4
+ import { t as Route } from "./audit-wjpo1BWg.js";
5
5
  //#region src/lib/audit-sentences.ts
6
6
  var import_react = /* @__PURE__ */ __toESM(require_react());
7
7
  var text = (value) => typeof value === "string" && value !== "" ? value : null;
@@ -471,79 +471,6 @@ function lines(entries) {
471
471
  }
472
472
  return shown;
473
473
  }
474
- /** What a kind of hidden entry is called, by action or its prefix. */
475
- var HIDDEN_KINDS = [
476
- [
477
- "key.",
478
- "key operation",
479
- "key operations"
480
- ],
481
- [
482
- "sign_in",
483
- "sign-in",
484
- "sign-ins"
485
- ],
486
- [
487
- "sign_out",
488
- "sign-out",
489
- "sign-outs"
490
- ],
491
- [
492
- "token.",
493
- "token change",
494
- "token changes"
495
- ],
496
- [
497
- "device.",
498
- "CLI sign-in approval",
499
- "CLI sign-in approvals"
500
- ],
501
- [
502
- "account.",
503
- "account link",
504
- "account links"
505
- ],
506
- [
507
- "sync.run",
508
- "sync run",
509
- "sync runs"
510
- ],
511
- [
512
- "audit.heartbeat",
513
- "heartbeat",
514
- "heartbeats"
515
- ],
516
- [
517
- "audit.checkpoint",
518
- "checkpoint",
519
- "checkpoints"
520
- ]
521
- ];
522
- /**
523
- * "2 key operations, 3 sign-ins and 12 heartbeats": the detail the server
524
- * left out of the page, as it counts it, by action.
525
- */
526
- function hiddenInWords(hidden) {
527
- const counts = /* @__PURE__ */ new Map();
528
- for (const { action, count } of hidden) {
529
- if (count === 0) continue;
530
- const [, one, many] = HIDDEN_KINDS.find(([prefix]) => action.startsWith(prefix)) ?? [
531
- action,
532
- action,
533
- action
534
- ];
535
- const kind = counts.get(one) ?? {
536
- one,
537
- many,
538
- count: 0
539
- };
540
- kind.count += count;
541
- counts.set(one, kind);
542
- }
543
- const phrases = [...counts.values()].map(({ one, many, count }) => `${count} ${count === 1 ? one : many}`);
544
- if (phrases.length === 0) return null;
545
- return phrases.length === 1 ? phrases[0] : `${phrases.slice(0, -1).join(", ")} and ${phrases.at(-1)}`;
546
- }
547
474
  //#endregion
548
475
  //#region src/routes/audit.tsx?tsr-split=component
549
476
  var import_jsx_runtime = require_jsx_runtime();
@@ -562,7 +489,6 @@ function AuditPage() {
562
489
  const broken = chain.integrity === "broken" ? chain : null;
563
490
  const breakAt = broken?.failedAtSeq ?? null;
564
491
  const shown = lines(result.entries);
565
- const hiddenText = detail ? null : hiddenInWords(result.hidden ?? []);
566
492
  const filters = {
567
493
  decision,
568
494
  actorId
@@ -594,27 +520,11 @@ function AuditPage() {
594
520
  "; ",
595
521
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)("code", { children: "coffre audit" }),
596
522
  " lists them all."
597
- ] }) : /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
598
- ": it may be detail,",
599
- " ",
600
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Link, {
601
- to: "/audit",
602
- search: {
603
- ...filters,
604
- detail: "1"
605
- },
606
- children: "shown on request"
607
- }),
608
- "."
609
- ] })
523
+ ] }) : ": it may be detail, which Show detail lists."
610
524
  ] })
611
525
  ]
612
526
  })
613
527
  }),
614
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", {
615
- className: "section-desc",
616
- children: "Everything done in coffre, one line per action, refusals included, and who decided it: the app, or the vault, which holds the keys and the access."
617
- }),
618
528
  /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
619
529
  className: "toolbar",
620
530
  children: [
@@ -723,23 +633,6 @@ function AuditPage() {
723
633
  }, batch[0].seq)) })]
724
634
  })
725
635
  })
726
- }),
727
- hiddenText !== null && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("p", {
728
- className: "hint section-foot",
729
- children: [
730
- "Hidden: ",
731
- hiddenText,
732
- ".",
733
- " ",
734
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Link, {
735
- to: "/audit",
736
- search: {
737
- ...filters,
738
- detail: "1"
739
- },
740
- children: "Show detail"
741
- })
742
- ]
743
636
  })
744
637
  ] });
745
638
  }
@@ -960,7 +853,7 @@ function ChainStatus({ chain }) {
960
853
  children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("button", {
961
854
  type: "button",
962
855
  className: "chain-seal",
963
- children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)(ShieldCheck, { size: 14 }), chain.through === null ? "Verified" : `Verified through ${chain.through}`]
856
+ children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)(ShieldCheck, { size: 14 }), "Verified"]
964
857
  })
965
858
  })]
966
859
  });
@@ -1,7 +1,7 @@
1
1
  import { C as lazyRouteComponent, w as createFileRoute } from "./ui-D_slKpSF.js";
2
2
  import { i as statusOf, o as uiResult } from "./coffre-DMs96kfX.js";
3
3
  //#region src/routes/audit.tsx
4
- var $$splitComponentImporter = () => import("./audit-CnfDYD-u.js");
4
+ var $$splitComponentImporter = () => import("./audit-BEbhtsEp.js");
5
5
  var PAGE_SIZE = 200;
6
6
  var Route = createFileRoute("/audit")({
7
7
  validateSearch: (search) => ({
@@ -8,7 +8,7 @@ import { n as Toaster } from "./use-action-DQUmeH-5.js";
8
8
  import { a as hasAdministrationItems, s as deriveUiCapabilities, t as AdministrationItems } from "./affordances-BNaXjMOb.js";
9
9
  import { n as isActiveAccessibleEnvironment } from "./project-environments-lEzFHUt4.js";
10
10
  import { a as setTheme, i as ThemeToggle, o as themeBootScript, r as ThemeMenuItems, t as Route$4 } from "./account-D7-ZAE2T.js";
11
- import { t as Route$5 } from "./audit-Bb9Er3nm.js";
11
+ import { t as Route$5 } from "./audit-wjpo1BWg.js";
12
12
  import { t as Route$6 } from "./login-B2njIq_o.js";
13
13
  import { t as Route$7 } from "./settings-Cy__khNA.js";
14
14
  import { t as Route$8 } from "./auth.device-CMR3csAI.js";
@@ -12380,7 +12380,7 @@ var HEADERS = { TSS_SHELL: "X-TSS_SHELL" };
12380
12380
  * the dev styles URL for route-scoped CSS collection.
12381
12381
  */
12382
12382
  async function getStartManifest(matchedRoutes) {
12383
- const { tsrStartManifest } = await import("./_coffre/assets/_tanstack-start-manifest_v-C2PEUeJL.js");
12383
+ const { tsrStartManifest } = await import("./_coffre/assets/_tanstack-start-manifest_v-CrnrBINO.js");
12384
12384
  const startManifest = tsrStartManifest();
12385
12385
  let routes = startManifest.routes;
12386
12386
  routes[rootRouteId];
@@ -13507,7 +13507,7 @@ var getBaseManifest = getProdBaseManifest;
13507
13507
  var createEarlyHintsForRequest = createEarlyHintsCollector;
13508
13508
  async function loadEntries() {
13509
13509
  const [routerEntry, startEntry, pluginAdapters] = await Promise.all([
13510
- import("./_coffre/assets/router-BimLwejs.js"),
13510
+ import("./_coffre/assets/router-BUwZOXEH.js"),
13511
13511
  import("./_coffre/assets/start-DR3rN0St.js"),
13512
13512
  import("./_coffre/assets/empty-plugin-adapters-Cq4--YW-.js")
13513
13513
  ]);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@coffre/ui",
3
- "version": "0.1.8",
3
+ "version": "0.1.9",
4
4
  "description": "coffre's pages: a prebuilt TanStack Start handler and its static files.",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -28,7 +28,7 @@
28
28
  "./package.json": "./package.json"
29
29
  },
30
30
  "dependencies": {
31
- "@coffre/client": "0.1.8"
31
+ "@coffre/client": "0.1.9"
32
32
  },
33
33
  "devDependencies": {
34
34
  "@cloudflare/vite-plugin": "1.50.0",
@@ -51,7 +51,7 @@
51
51
  "typescript": "5.9.3",
52
52
  "vite": "8.1.5",
53
53
  "wrangler": "4.118.0",
54
- "@coffre/core": "0.1.8"
54
+ "@coffre/core": "0.1.9"
55
55
  },
56
56
  "scripts": {
57
57
  "build": "vite build && rm dist/server/wrangler.json && tsdown && node ../../scripts/check-client-bundle.mjs",
@@ -428,37 +428,6 @@ export function lines<T extends AuditEntry>(entries: T[]): T[][] {
428
428
  return shown;
429
429
  }
430
430
 
431
- /** What a kind of hidden entry is called, by action or its prefix. */
432
- const HIDDEN_KINDS: [prefix: string, one: string, many: string][] = [
433
- ['key.', 'key operation', 'key operations'],
434
- ['sign_in', 'sign-in', 'sign-ins'],
435
- ['sign_out', 'sign-out', 'sign-outs'],
436
- ['token.', 'token change', 'token changes'],
437
- ['device.', 'CLI sign-in approval', 'CLI sign-in approvals'],
438
- ['account.', 'account link', 'account links'],
439
- ['sync.run', 'sync run', 'sync runs'],
440
- ['audit.heartbeat', 'heartbeat', 'heartbeats'],
441
- ['audit.checkpoint', 'checkpoint', 'checkpoints'],
442
- ];
443
-
444
- /**
445
- * "2 key operations, 3 sign-ins and 12 heartbeats": the detail the server
446
- * left out of the page, as it counts it, by action.
447
- */
448
- export function hiddenInWords(hidden: { action: string; count: number }[]): string | null {
449
- const counts = new Map<string, { one: string; many: string; count: number }>();
450
- for (const { action, count } of hidden) {
451
- if (count === 0) continue;
452
- const [, one, many] = HIDDEN_KINDS.find(([prefix]) => action.startsWith(prefix)) ?? [action, action, action];
453
- const kind = counts.get(one) ?? { one, many, count: 0 };
454
- kind.count += count;
455
- counts.set(one, kind);
456
- }
457
- const phrases = [...counts.values()].map(({ one, many, count }) => `${count} ${count === 1 ? one : many}`);
458
- if (phrases.length === 0) return null;
459
- return phrases.length === 1 ? phrases[0]! : `${phrases.slice(0, -1).join(', ')} and ${phrases.at(-1)}`;
460
- }
461
-
462
431
  /** A sentence as text. */
463
432
  export function plain(parts: Part[]): string {
464
433
  return parts
@@ -5,7 +5,6 @@ import { statusOf, uiResult } from '../lib/coffre';
5
5
  import {
6
6
  decidedBy,
7
7
  describe,
8
- hiddenInWords,
9
8
  lines,
10
9
  who,
11
10
  type Part,
@@ -111,7 +110,6 @@ function AuditPage() {
111
110
  const broken = chain.integrity === 'broken' ? chain : null;
112
111
  const breakAt = broken?.failedAtSeq ?? null;
113
112
  const shown = lines(result.entries);
114
- const hiddenText = detail ? null : hiddenInWords(result.hidden ?? []);
115
113
  const filters = { decision, actorId };
116
114
 
117
115
  return (
@@ -137,13 +135,7 @@ function AuditPage() {
137
135
  ; <code>coffre audit</code> lists them all.
138
136
  </>
139
137
  ) : (
140
- <>
141
- : it may be detail,{' '}
142
- <Link to="/audit" search={{ ...filters, detail: '1' }}>
143
- shown on request
144
- </Link>
145
- .
146
- </>
138
+ ': it may be detail, which Show detail lists.'
147
139
  )}
148
140
  </>
149
141
  )}
@@ -151,11 +143,6 @@ function AuditPage() {
151
143
  </div>
152
144
  )}
153
145
 
154
- <p className="section-desc">
155
- Everything done in coffre, one line per action, refusals included, and who decided it: the
156
- app, or the vault, which holds the keys and the access.
157
- </p>
158
-
159
146
  <div className="toolbar">
160
147
  <nav className="segmented" aria-label="Filter by decision">
161
148
  {/* `exact` compares the whole search, not a subset of it: otherwise
@@ -244,14 +231,6 @@ function AuditPage() {
244
231
  )}
245
232
  </section>
246
233
 
247
- {hiddenText !== null && (
248
- <p className="hint section-foot">
249
- Hidden: {hiddenText}.{' '}
250
- <Link to="/audit" search={{ ...filters, detail: '1' }}>
251
- Show detail
252
- </Link>
253
- </p>
254
- )}
255
234
  </>
256
235
  );
257
236
  }
@@ -537,7 +516,7 @@ function ChainStatus({ chain }: { chain: ChainResult }) {
537
516
  >
538
517
  <button type="button" className="chain-seal">
539
518
  <ShieldCheck size={14} />
540
- {chain.through === null ? 'Verified' : `Verified through ${chain.through}`}
519
+ Verified
541
520
  </button>
542
521
  </Toggletip>
543
522
  </div>
@@ -1 +0,0 @@
1
- import{$ as e,H as t,Ot as n,S as r,T as i,Tt as a,W as o,X as s,c,ct as l,f as u,i as d,m as f,n as p,o as m}from"./page-DbSS7pYH.js";import{D as h,a as g,c as _,f as v,m as y,u as b}from"./preload-helper-DduCCcmc.js";import{t as x}from"./audit-CdCJ1U8E.js";var S=n(a()),C=e=>typeof e==`string`&&e!==``?e:null,w=e=>typeof e==`number`?e:null;function T({project:e,environment:t,key:n}){let r=[e,t,n].filter(e=>e!==null);return r.length===0?[`coffre`]:[{place:r.join(`/`)}]}function E({project:e,environment:t}){return T({project:e,environment:t,key:null})}function D(e){if(e.subject!==null)return[{member:e.subject}];let t=C(e.metadata.principalId);return t===null?[`someone`]:[{member:`${e.metadata.principalType===`service`?`token`:`user`}:${t}`}]}function O(e,t,n=`${t}s`){return`${e} ${e===1?t:n}`}function k(e){return e.batch.length===1?T(e.entry):[...E(e.entry),e.refused?`, `:`: `,O(e.count,`secret`)]}function A(e){let t=C(e.metadata.destination);return t===null?``:` to ${t}`}function j(e){return C(e.metadata.destination)??`its destination`}var M={reveal:[`revealed`,`reveal`],run:[`ran`,`run`],compare:[`compared`,`compare`],sync:[`read`,`read`]};function N({entry:e}){return M[C(e.metadata.purpose)??`reveal`]??M.reveal}var P=e=>{let t=t=>[`${e} `,...e===`project`?T({...t.entry,environment:null,key:null}):E(t.entry)];return{[`${e}.create`]:{did:`created`,tried:`create`,what:t},[`${e}.update`]:{did:`changed`,tried:`change`,what:t},[`${e}.archive`]:{did:`archived`,tried:`archive`,what:t},[`${e}.restore`]:{did:`restored`,tried:`restore`,what:t}}},F={"secret.read":{did:e=>N(e)[0],tried:e=>N(e)[1],what:k},"secret.write":{did:({batch:e})=>{let t=e.filter(e=>e.version===1).length;return t===e.length?`added`:t===0?`changed`:`wrote`},tried:`change`,what:k,then:({entry:e,batch:t})=>t.length>1||e.version===null||e.version===1?[]:[`, now version ${e.version}`]},"secret.restore":{did:`restored`,tried:`restore`,what:({entry:e})=>[...T(e),...w(e.metadata.from)===null?[]:[` to version ${w(e.metadata.from)}`]],then:({entry:e})=>e.version===null?[]:[`, now ${e.version}`]},"secret.rename":{did:`renamed`,tried:`rename`,what:({entry:e})=>[...T(e),...C(e.metadata.nextKey)===null?[]:[` to ${C(e.metadata.nextKey)}`]]},"secret.archive":{did:`archived`,tried:`archive`,what:e=>T(e.entry)},"secret.unarchive":{did:`brought back`,tried:`bring back`,what:e=>T(e.entry)},...P(`project`),...P(`environment`),"access.grant":{did:`gave`,tried:`give`,what:({entry:e})=>[...D(e),` ${C(e.metadata.role)??`a role`} on `,...I(e)],then:({entry:e})=>[...C(e.metadata.previousRole)===null?[]:[`, was ${C(e.metadata.previousRole)}`],...C(e.metadata.expiresAt)===null?[]:[`, until ${C(e.metadata.expiresAt).slice(0,10)}`]]},"access.revoke":{did:`took`,tried:`take`,what:({entry:e})=>[...C(e.metadata.previousRole??e.metadata.role)===null?[`access to `]:[`${C(e.metadata.previousRole??e.metadata.role)} on `],...I(e),` from `,...D(e)]},"member.add":{did:`added`,tried:`add`,what:({entry:e})=>[...D(e),...e.metadata.rootAdmin===!0?[` as a root admin`]:e.metadata.owner===!0?[` as an owner`]:[]]},"member.remove":{did:`removed`,tried:`remove`,what:e=>D(e.entry),then:({entry:e})=>w(e.metadata.revoked)===null?[]:[`, who held ${O(w(e.metadata.revoked),`grant`)}`]},"member.restore":{did:`brought back`,tried:`bring back`,what:e=>D(e.entry)},"member.owner":{did:({entry:e})=>e.metadata.owner===!1?`took owner from`:`made`,tried:({entry:e})=>e.metadata.owner===!1?`take owner from`:`make`,what:({entry:e})=>[...D(e),...e.metadata.owner===!1?[]:[` an owner`]]},"sync.create":{did:`set up a sync of`,tried:`set up a sync of`,what:({entry:e})=>[...E(e),A(e)]},"sync.update":{did:({entry:e})=>e.metadata.paused===!0?`paused the sync of`:e.metadata.paused===!1?`resumed the sync of`:`changed the sync of`,tried:`change the sync of`,what:({entry:e})=>[...E(e),A(e)]},"sync.delete":{did:`removed the sync of`,tried:`remove the sync of`,what:({entry:e})=>[...E(e),A(e)]},"sync.push":{did:`pushed`,tried:`push`,what:e=>e.batch.length===1?[...T(e.entry),` to ${j(e.entry)}`]:[...E(e.entry),` to ${j(e.entry)}: ${O(e.count,`secret`)}`]},"sync.remove":{did:`removed`,tried:`remove`,what:e=>e.batch.length===1?[...T(e.entry),` from ${j(e.entry)}`]:[O(e.count,`secret`),` of `,...E(e.entry),` from ${j(e.entry)}`]},"vault.tampered":{did:`found`,tried:`check`,what:({entry:e})=>[...e.subject===null?[`an entry`]:[...D(e),`'s record`],` tampered with: ${R[e.reason??``]??`it fails its seal`}`]},"key.rotate":{did:`rotated its key`,tried:`rotate its key`,what:()=>[]},sign_in:{did:({entry:e})=>e.metadata.kind===`cli`?`signed in to the CLI`:`signed in`,tried:`sign in`,what:({entry:e})=>C(e.metadata.provider)===null?[]:[`with ${C(e.metadata.provider)}`]},sign_out:{did:`signed out`,tried:`sign out`,what:()=>[]},"token.create":{did:`issued a token to`,tried:`issue a token to`,what:e=>D(e.entry)},"token.revoke":{did:`revoked a token of`,tried:`revoke a token of`,what:e=>D(e.entry)},"device.approve":{did:`approved a CLI sign-in`,tried:`approve a CLI sign-in`,what:()=>[]},"device.deny":{did:`turned down a CLI sign-in`,tried:`turn down a CLI sign-in`,what:()=>[]},"account.link":{did:`linked`,tried:`link`,what:({entry:e})=>[`a ${C(e.metadata.provider)??`sign-in`} account`]},"account.unlink":{did:`unlinked`,tried:`unlink`,what:({entry:e})=>[`a ${C(e.metadata.provider)??`sign-in`} account`]},"key.wrap":{did:`sealed the key of`,tried:`seal the key of`,what:e=>L(e.entry)},"key.rewrap":{did:`resealed the key of`,tried:`reseal the key of`,what:e=>L(e.entry)},"key.intent":{did:`asked KMS about`,tried:`ask KMS about`,what:e=>k(e)},"key.check":{did:`recorded the check value of`,tried:`check`,what:({entry:e})=>[[`the`,C(e.metadata.kekProvider)===`local`?null:C(e.metadata.kekProvider),`vault key`,C(e.metadata.kekId)].filter(e=>e!==null).join(` `)]},"sync.run":{did:`ran the sync of`,tried:`run the sync of`,what:({entry:e})=>[...E(e),A(e)]},"audit.heartbeat":{did:`checked in`,tried:`check in`,what:()=>[]},"audit.checkpoint":{did:`signed the log`,tried:`sign the log`,what:({entry:e})=>w(e.metadata.seq)===null?[]:[`through entry ${w(e.metadata.seq)}`]},"secret.list":{did:`listed`,tried:`list`,what:({entry:e})=>E(e)},"secret.history":{did:`read the history of`,tried:`read the history of`,what:e=>T(e.entry)},"secret.update":{did:`changed`,tried:`change`,what:e=>T(e.entry)},"sync.list":{did:`listed the syncs of`,tried:`list the syncs of`,what:({entry:e})=>E(e)}};function I(e){return T({...e,key:null})}function L(e){return[...T(e),...e.version===null?[]:[`, version ${e.version}`]]}var R={mac:`it does not carry the vault's seal`,stale:`an older copy was put back`,forged_entry:`the vault did not write it`},z={no_grant:`no grant`,bulk_limit:`bulk limit`,expired:`grant expired`,removed:`removed from coffre`,not_a_member:`not a member`,not_registered:`not invited`,tampered:`their record was tampered with`,bad_claim:`the key did not match the secret`,not_allowed:`not allowed`,root_admin:`root admins are set by the deployment`,unknown_environment:`no such environment`,unknown_secret:`no such secret`,unknown_project:`no such project`,unusable_credential:`its token is not a secret they can read`,duplicate_destination:`already synced from elsewhere`,cannot_grant_sync:`cannot grant the sync its reads`,kms_unavailable:`KMS did not answer`,wrong_kek:`the vault's key is not the one that wrapped the data`},B={secret_read:`no grant to read it`,secret_write:`no grant to write`,secret_archive:`no grant to archive`,audit_read:`no grant to read the audit log`,environment_manage:`no grant to manage environments`,grant_manage:`no grant to manage access`,project_manage:`no grant to manage the project`};function V(e){return e===null?`refused`:e.startsWith(`missing_`)?B[e.slice(8)]??`no grant`:z[e]??e.replace(/_/g,` `)}var ee=[`sync.push`,`sync.remove`,`secret.write`,`secret.read`];function te(e){for(let t of ee){let n=e.find(e=>e.action===t);if(n!==void 0)return n}return e[0]}function H(e){let t=te(e),n=e.filter(e=>e.action===t.action),r=n.filter(e=>e.decision===`deny`),i=r.length===n.length,a={entry:t,batch:n,count:new Set(n.map(e=>`${e.project}/${e.environment}/${e.key}`)).size,refused:i},o=F[t.action];if(o===void 0)return{parts:[t.action,` `,...T(t)],refused:i};let s=e=>typeof e==`string`?e:e(a),c=o.what(a),l=c.length===0?[]:[` `];if(i){let e=V((r[0]??t).reason);return{parts:[`tried to `,s(o.tried),...l,...c,`: ${e}`],refused:i}}let u=r.length===0?[]:[`, ${r.length} refused: ${V(r[0].reason)}`];return{parts:[s(o.did),...l,...c,...o.then?.(a)??[],...u],refused:i}}function U(e){let t=e[0];if(t.actorType===`user`)return{member:`user:${t.actorId}`};if(t.actorType===`service`)return{member:`token:${t.actorId}`};if(t.actorId.startsWith(`sync:`)){let t=e.map(e=>C(e.metadata.provider)).find(e=>e!==null),n=t===void 0?void 0:W[t]??t;return n===void 0?`a sync`:`sync to ${n}`}return G[t.actorId]??t.actorId}var W={"github-actions":`GitHub`,vercel:`Vercel`,railway:`Railway`,"cloudflare-workers":`Cloudflare`},G={scheduler:`the scheduler`,cron:`the scheduler`,vault:`the vault`,app:`coffre`};function K(e){return[`vault`,`app`].filter(t=>e.some(e=>e.author===t)).join(`, `)}function q(e){let t=[],n=new Map;for(let r of e){let e=r.operationId===null?void 0:n.get(r.operationId);if(e!==void 0){e.push(r);continue}let i=[r];r.operationId!==null&&n.set(r.operationId,i),t.push(i)}return t}var J=[[`key.`,`key operation`,`key operations`],[`sign_in`,`sign-in`,`sign-ins`],[`sign_out`,`sign-out`,`sign-outs`],[`token.`,`token change`,`token changes`],[`device.`,`CLI sign-in approval`,`CLI sign-in approvals`],[`account.`,`account link`,`account links`],[`sync.run`,`sync run`,`sync runs`],[`audit.heartbeat`,`heartbeat`,`heartbeats`],[`audit.checkpoint`,`checkpoint`,`checkpoints`]];function Y(e){let t=new Map;for(let{action:n,count:r}of e){if(r===0)continue;let[,e,i]=J.find(([e])=>n.startsWith(e))??[n,n,n],a=t.get(e)??{one:e,many:i,count:0};a.count+=r,t.set(e,a)}let n=[...t.values()].map(({one:e,many:t,count:n})=>`${n} ${n===1?e:t}`);return n.length===0?null:n.length===1?n[0]:`${n.slice(0,-1).join(`, `)} and ${n.at(-1)}`}var X=l();function Z(){let{entries:n,chain:r}=x.useLoaderData(),a=x.useSearch(),{decision:c,actorId:l}=a,u=a.detail===`1`,v=c===`deny`;if(!n.ok)return(0,X.jsx)(p,{icon:(0,X.jsx)(i,{size:18}),label:`Audit`,title:`The audit log is closed to you`,children:n.error});let y=r.integrity===`broken`?r:null,b=y?.failedAtSeq??null,S=q(n.entries),C=u?null:Y(n.hidden??[]),w={decision:c,actorId:l};return(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(d,{title:`Audit`,actions:(0,X.jsx)(se,{chain:r})}),y!==null&&(0,X.jsx)(`div`,{style:{marginBottom:`1.25rem`},children:(0,X.jsxs)(_,{tone:`bad`,children:[(0,X.jsx)(`strong`,{children:`Treat this as an incident.`}),` `,y.failedAtSeq===null?`The log does not verify, found by the ${y.author}'s check: ${y.reason}.`:`The log breaks at entry ${y.failedAtSeq}, found by the ${y.author}'s check: ${y.reason}.`,` `,y.through!==null&&`Every entry through ${y.through} holds. `,`Something with direct access to the database has changed what it records`,y.failedAtSeq===null?``:`, and nothing from entry ${y.failedAtSeq} on can be relied on`,` until that is explained.`,b!==null&&!n.entries.some(e=>e.seq===b)&&(0,X.jsxs)(X.Fragment,{children:[` `,`Entry `,b,` is not among the entries below`,u?(0,X.jsxs)(X.Fragment,{children:[`; `,(0,X.jsx)(`code`,{children:`coffre audit`}),` lists them all.`]}):(0,X.jsxs)(X.Fragment,{children:[`: it may be detail,`,` `,(0,X.jsx)(h,{to:`/audit`,search:{...w,detail:`1`},children:`shown on request`}),`.`]})]})]})}),(0,X.jsx)(`p`,{className:`section-desc`,children:`Everything done in coffre, one line per action, refusals included, and who decided it: the app, or the vault, which holds the keys and the access.`}),(0,X.jsxs)(`div`,{className:`toolbar`,children:[(0,X.jsxs)(`nav`,{className:`segmented`,"aria-label":`Filter by decision`,children:[(0,X.jsx)(h,{to:`/audit`,search:{...w,decision:void 0,detail:a.detail},activeOptions:{exact:!0},children:`All events`}),(0,X.jsxs)(h,{to:`/audit`,search:{...w,decision:`deny`,detail:a.detail},activeOptions:{exact:!0},children:[(0,X.jsx)(o,{size:13}),`Denials only`]})]}),l!==void 0&&(0,X.jsxs)(h,{className:`filter-chip`,to:`/audit`,search:{...w,actorId:void 0,detail:a.detail},"aria-label":`Stop filtering by ${l}`,children:[`Actor `,(0,X.jsx)(`span`,{className:`mono`,children:l}),(0,X.jsx)(e,{size:13})]}),(0,X.jsxs)(h,{className:`detail-toggle`,to:`/audit`,search:{...w,detail:u?void 0:`1`},"aria-pressed":u,children:[(0,X.jsx)(`span`,{className:`switch`,"aria-hidden":`true`}),`Show detail`]})]}),(0,X.jsx)(`section`,{className:`card`,"aria-label":`Audit entries`,children:S.length===0?(0,X.jsx)(g,{title:v?`No denials recorded`:`Nothing recorded yet`,children:v?`Every decision reaches this log, refusals included. An empty page means nobody has been turned away.`:`The log fills as people read and write secrets and change who has access.`}):(0,X.jsx)(`div`,{className:`dt-wrap`,children:(0,X.jsxs)(`table`,{className:`dt audit events stacks`,children:[(0,X.jsx)(`thead`,{children:(0,X.jsxs)(`tr`,{children:[(0,X.jsx)(`th`,{className:`n`,title:`Sequence number in the log`,children:`#`}),(0,X.jsx)(`th`,{className:`col-shrink`,children:(0,X.jsxs)(`span`,{className:`th`,children:[(0,X.jsx)(f,{size:14}),`When (UTC)`]})}),(0,X.jsx)(`th`,{className:`col-shrink`,children:(0,X.jsxs)(`span`,{className:`th`,children:[(0,X.jsx)(s,{size:14}),`Who`]})}),(0,X.jsx)(`th`,{children:(0,X.jsxs)(`span`,{className:`th`,children:[(0,X.jsx)(m,{size:14}),`What they did`]})}),(0,X.jsx)(`th`,{className:`col-shrink`,children:(0,X.jsxs)(`span`,{className:`th`,children:[(0,X.jsx)(t,{size:14}),`Decided by`]})})]})}),(0,X.jsx)(`tbody`,{children:S.map(e=>(0,X.jsx)(ne,{batch:e,filters:w,detail:a.detail,breakAt:b},e[0].seq))})]})})}),C!==null&&(0,X.jsxs)(`p`,{className:`hint section-foot`,children:[`Hidden: `,C,`.`,` `,(0,X.jsx)(h,{to:`/audit`,search:{...w,detail:`1`},children:`Show detail`})]})]})}function ne({batch:e,filters:t,detail:n,breakAt:r}){let i=r!==null&&e.some(e=>e.seq===r),[a,o]=(0,S.useState)(i),s=e[0],c=H(e),l=e.map(e=>e.seq),d=e.length>1;return(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(Q,{entry:s,seq:d?`${Math.min(...l)}–${Math.max(...l)}`:String(s.seq),parts:c.parts,refused:c.refused,decided:K(e),filters:t,detail:n,breaks:i&&!d,marked:i,batch:e,toggle:d?(0,X.jsx)(`button`,{type:`button`,className:`batch-toggle`,"aria-expanded":a,"aria-label":a?`Hide each entry`:`Show each of ${e.length} entries`,onClick:()=>o(!a),children:(0,X.jsx)(u,{size:14})}):void 0}),d&&a&&e.map(e=>{let i=H([e]);return(0,X.jsx)(Q,{entry:e,seq:String(e.seq),parts:i.parts,refused:i.refused,decided:K([e]),filters:t,detail:n,breaks:e.seq===r,marked:!1,child:!0},e.seq)})]})}function Q({entry:e,seq:t,parts:n,refused:r,decided:i,filters:a,detail:s,breaks:l,marked:u,toggle:d,child:f=!1,batch:p}){let m=U(p??[e]),g=[r&&`is-denied`,(l||u)&&`is-break`,f&&`is-child`,e.detail&&`is-detail`,e.action===`vault.tampered`&&`is-tampered`].filter(Boolean);return(0,X.jsxs)(`tr`,{className:g.length===0?void 0:g.join(` `),children:[(0,X.jsx)(`td`,{className:`n`,"data-label":`Sequence`,children:t}),(0,X.jsx)(`td`,{className:`nowrap cell-mono`,"data-label":`When (UTC)`,children:(0,X.jsx)(b,{iso:e.occurredAt,precise:!0})}),(0,X.jsx)(`td`,{"data-label":`Who`,children:(0,X.jsx)(`span`,{className:`actor`,children:typeof m==`string`?(0,X.jsx)(h,{to:`/audit`,search:{...a,actorId:e.actorId,detail:s},children:m}):(0,X.jsx)(h,{to:`/audit`,search:{...a,actorId:e.actorId,detail:s},children:$(m.member)})})}),(0,X.jsx)(`td`,{className:`cell-sentence`,"data-label":`What they did`,children:(0,X.jsxs)(`span`,{className:`sentence`,children:[d,e.action===`vault.tampered`&&(0,X.jsx)(c,{size:13}),(0,X.jsx)(re,{parts:n}),l&&(0,X.jsx)(oe,{})]})}),(0,X.jsx)(`td`,{className:`nowrap`,"data-label":`Decided by`,children:(0,X.jsxs)(`span`,{className:r?`decided decided-refused`:`decided`,children:[r&&(0,X.jsx)(o,{size:13}),i,r&&`, refused`]})})]})}function re({parts:e}){return(0,X.jsx)(X.Fragment,{children:e.map((e,t)=>(0,X.jsx)(S.Fragment,{children:typeof e==`string`?e:`place`in e?(0,X.jsx)(ie,{path:e.place}):(0,X.jsx)(ae,{member:e.member})},t))})}function ie({path:e}){let[t,n]=e.split(`/`),r=(0,X.jsx)(`span`,{className:`mono`,children:y(e)});return n===void 0?(0,X.jsx)(h,{to:`/projects/$project`,params:{project:t},children:r}):(0,X.jsx)(h,{to:`/projects/$project/$environment`,params:{project:t,environment:n},children:r})}function ae({member:e}){return e.startsWith(`token:`)?(0,X.jsx)(h,{to:`/tokens/$token`,params:{token:e.slice(6)},children:e}):(0,X.jsx)(h,{to:`/users/$user`,params:{user:$(e)},children:$(e)})}function $(e){return e.startsWith(`user:`)?e.slice(5):e}function oe(){return(0,X.jsxs)(`span`,{className:`break-mark`,children:[(0,X.jsx)(c,{size:11}),`breaks here`]})}function se({chain:e}){return e.integrity===`owners-only`?(0,X.jsx)(v,{align:`end`,label:`Owners and root admins see whether the log is intact. Checking it means recomputing every entry, and you read only your projects' part of it.`,children:(0,X.jsxs)(`button`,{type:`button`,className:`chain-note`,children:[(0,X.jsx)(r,{size:14}),`Verified by owners`]})}):e.integrity===`unknown`?(0,X.jsx)(v,{align:`end`,label:`coffre could not check the log: ${e.problem}. The entries below loaded, but whether they are intact is unknown until it can. Reload to try again.`,children:(0,X.jsxs)(`button`,{type:`button`,className:`chain-flag chain-flag-warn`,children:[(0,X.jsx)(c,{size:14}),`Log not verified`]})}):e.integrity===`broken`?(0,X.jsxs)(`span`,{className:`chain-flag chain-flag-bad`,role:`status`,children:[(0,X.jsx)(c,{size:14}),e.failedAtSeq===null?`Log does not verify`:`Log broken at ${e.failedAtSeq}`]}):(0,X.jsxs)(`div`,{className:`chain`,children:[e.pending>0&&(0,X.jsx)(v,{align:`end`,label:`Keys released through KMS whose outcome the vault has not logged yet. Each settles within seconds, or is logged as failed.`,children:(0,X.jsxs)(`button`,{type:`button`,className:`chain-note`,role:`status`,children:[e.pending,` key operation`,e.pending===1?``:`s`,` in flight`]})}),(0,X.jsx)(v,{align:`end`,label:`Every entry through ${e.through??0} holds, under the app's key and the vault's.`+(e.checkpoint===null?` The vault has not signed the log yet.`:` The vault last signed it through entry ${e.checkpoint.seq}, at ${e.checkpoint.signedAt}.`),children:(0,X.jsxs)(`button`,{type:`button`,className:`chain-seal`,children:[(0,X.jsx)(t,{size:14}),e.through===null?`Verified`:`Verified through ${e.through}`]})})]})}export{Z as component};