@coffre/ui 0.1.2 → 0.1.4

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-CNxnZHje.js","_coffre/assets/page-BxW2MwaX.js","_coffre/assets/preload-helper-BHuP8_FL.js"])))=>i.map(i=>d[i]);
2
- import{T as e,t,w as n}from"./preload-helper-BHuP8_FL.js";import{i as r,o as i}from"./coffre-C7qL3HGR.js";var a=()=>t(()=>import(`./audit-CNxnZHje.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-h7CmJBTo.js","_coffre/assets/page-BxW2MwaX.js","_coffre/assets/preload-helper-BHuP8_FL.js"])))=>i.map(i=>d[i]);
2
+ import{T as e,t,w as n}from"./preload-helper-BHuP8_FL.js";import{i as r,o as i}from"./coffre-C7qL3HGR.js";var a=()=>t(()=>import(`./audit-h7CmJBTo.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{G as e,Ot as t,S as n,T as r,Tt as i,U as a,Z as o,c as s,ct as c,et as l,f as u,i as d,m as f,n as p,o as m}from"./page-BxW2MwaX.js";import{D as h,a as g,c as _,f as v,m as y,u as b}from"./preload-helper-BHuP8_FL.js";import{t as x}from"./audit-Dzj5DyKt.js";var S=t(i()),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=c();function Z(){let{entries:t,chain:n}=x.useLoaderData(),i=x.useSearch(),{decision:s,actorId:c}=i,u=i.detail===`1`,v=s===`deny`;if(!t.ok)return(0,X.jsx)(p,{icon:(0,X.jsx)(r,{size:18}),label:`Audit`,title:`The audit log is closed to you`,children:t.error});let y=n.integrity===`broken`?n:null,b=y?.failedAtSeq??null,S=q(t.entries),C=u?null:Y(t.hidden??[]),w={decision:s,actorId:c};return(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(d,{title:`Audit`,actions:(0,X.jsx)(se,{chain:n})}),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&&!t.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:i.detail},activeOptions:{exact:!0},children:`All events`}),(0,X.jsxs)(h,{to:`/audit`,search:{...w,decision:`deny`,detail:i.detail},activeOptions:{exact:!0},children:[(0,X.jsx)(e,{size:13}),`Denials only`]})]}),c!==void 0&&(0,X.jsxs)(h,{className:`filter-chip`,to:`/audit`,search:{...w,actorId:void 0,detail:i.detail},"aria-label":`Stop filtering by ${c}`,children:[`Actor `,(0,X.jsx)(`span`,{className:`mono`,children:c}),(0,X.jsx)(l,{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)(o,{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)(a,{size:14}),`Decided by`]})})]})}),(0,X.jsx)(`tbody`,{children:S.map(e=>(0,X.jsx)(ne,{batch:e,filters:w,detail:i.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:t,seq:n,parts:r,refused:i,decided:a,filters:o,detail:c,breaks:l,marked:u,toggle:d,child:f=!1,batch:p}){let m=U(p??[t]),g=[i&&`is-denied`,(l||u)&&`is-break`,f&&`is-child`,t.detail&&`is-detail`,t.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:n}),(0,X.jsx)(`td`,{className:`nowrap cell-mono`,"data-label":`When (UTC)`,children:(0,X.jsx)(b,{iso:t.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:{...o,actorId:t.actorId,detail:c},children:m}):(0,X.jsx)(h,{to:`/audit`,search:{...o,actorId:t.actorId,detail:c},children:$(m.member)})})}),(0,X.jsx)(`td`,{className:`cell-sentence`,"data-label":`What they did`,children:(0,X.jsxs)(`span`,{className:`sentence`,children:[d,t.action===`vault.tampered`&&(0,X.jsx)(s,{size:13}),(0,X.jsx)(re,{parts:r}),l&&(0,X.jsx)(oe,{})]})}),(0,X.jsx)(`td`,{className:`nowrap`,"data-label":`Decided by`,children:(0,X.jsxs)(`span`,{className:i?`decided decided-refused`:`decided`,children:[i&&(0,X.jsx)(e,{size:13}),a,i&&`, 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)(s,{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)(n,{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)(s,{size:14}),`Log not verified`]})}):e.integrity===`broken`?(0,X.jsxs)(`span`,{className:`chain-flag chain-flag-bad`,role:`status`,children:[(0,X.jsx)(s,{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)(a,{size:14}),e.through===null?`Verified`:`Verified through ${e.through}`]})})]})}export{Z as component};
@@ -1,5 +1,5 @@
1
1
  const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["_coffre/assets/unregistered-CTRMtBIy.js","_coffre/assets/page-BxW2MwaX.js"])))=>i.map(i=>d[i]);
2
- import{$ as e,A as t,C as n,Ct as r,Et as i,G as a,H as o,K as s,M as c,O as l,Ot as u,P as d,Q as f,R as p,St as m,T as h,Tt as g,V as _,W as v,_t as y,a as b,at as x,c as S,ct as C,dt as ee,et as te,ft as ne,gt as re,ht as ie,it as w,j as ae,k as oe,lt as se,mt as ce,n as E,ot as D,p as le,pt as ue,rt as de,st as fe,u as pe,ut as O,v as me,vt as he,w as ge,wt as _e,xt as ve,y as ye,yt as be}from"./page-BxW2MwaX.js";import{A as xe,B as Se,C as Ce,D as we,E as Te,F as Ee,G as De,H as Oe,I as ke,J as Ae,K as je,L as Me,M as Ne,N as Pe,O as Fe,P as Ie,Q as Le,R as Re,S as ze,T as Be,U as Ve,V as He,W as Ue,X as We,Y as Ge,Z as Ke,_ as qe,b as Je,d as Ye,g as k,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-BHuP8_FL.js";import{c as st,u as ct}from"./coffre-C7qL3HGR.js";import{n as lt,r as ut}from"./use-action-DgAf-tiX.js";import{a as dt,s as ft,t as pt}from"./affordances-DiuJIiR2.js";import{n as mt}from"./project-environments-CfIH5kFM.js";import{a as ht,i as gt,o as _t,r as vt,t as yt}from"./account-C4bNbeO7.js";import{t as bt}from"./audit-DIc_l6nV.js";import{t as xt}from"./login-CR9CBXlw.js";import{t as St}from"./settings-2BPsenNM.js";import{t as Ct}from"./auth.device-BfCfeBWe.js";import{t as wt}from"./projects.index-BNEC7Oz8.js";import{t as Tt}from"./tokens.index-BdKE2Jv8.js";import{t as Et}from"./tokens._token-B3-YwuKp.js";import{t as Dt}from"./users.index-D8hwzM6P.js";import{t as Ot}from"./users._user-BFPXcJ4y.js";import{t as kt}from"./projects._project.index-CCDEuE-z.js";import{t as At}from"./projects._project._environment-CrWjQmIA.js";var jt=i((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,ie());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?ie():S=!1}}}var ie;if(typeof y==`function`)ie=function(){y(re)};else if(typeof MessageChannel<`u`){var w=new MessageChannel,ae=w.port2;w.port1.onmessage=re,ie=function(){ae.postMessage(null)}}else ie=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,ie()))),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}}}})),Mt=i(((e,t)=>{t.exports=jt()})),Nt=i((e=>{var t=Mt(),n=g(),r=Le();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,p=Symbol.for(`react.element`),m=Symbol.for(`react.transitional.element`),h=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`),ie=Symbol.for(`react.memo_cache_sentinel`),w=Symbol.iterator;function ae(e){return typeof e!=`object`||!e?null:(e=w&&e[w]||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 h: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,C as n,Ct as r,Et as i,G as a,H as o,K as s,M as c,O as l,Ot as u,P as d,Q as f,R as p,St as m,T as h,Tt as g,V as _,W as v,_t as y,a as b,at as x,c as S,ct as C,dt as ee,et as te,ft as ne,gt as re,ht as ie,it as w,j as ae,k as oe,lt as se,mt as ce,n as E,ot as D,p as le,pt as ue,rt as de,st as fe,u as pe,ut as O,v as me,vt as he,w as ge,wt as _e,xt as ve,y as ye,yt as be}from"./page-BxW2MwaX.js";import{A as xe,B as Se,C as Ce,D as we,E as Te,F as Ee,G as De,H as Oe,I as ke,J as Ae,K as je,L as Me,M as Ne,N as Pe,O as Fe,P as Ie,Q as Le,R as Re,S as ze,T as Be,U as Ve,V as He,W as Ue,X as We,Y as Ge,Z as Ke,_ as qe,b as Je,d as Ye,g as k,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-BHuP8_FL.js";import{c as st,u as ct}from"./coffre-C7qL3HGR.js";import{n as lt,r as ut}from"./use-action-DgAf-tiX.js";import{a as dt,s as ft,t as pt}from"./affordances-DiuJIiR2.js";import{n as mt}from"./project-environments-CfIH5kFM.js";import{a as ht,i as gt,o as _t,r as vt,t as yt}from"./account-C4bNbeO7.js";import{t as bt}from"./audit-Dzj5DyKt.js";import{t as xt}from"./login-CR9CBXlw.js";import{t as St}from"./settings-2BPsenNM.js";import{t as Ct}from"./auth.device-BfCfeBWe.js";import{t as wt}from"./projects.index-BNEC7Oz8.js";import{t as Tt}from"./tokens.index-BdKE2Jv8.js";import{t as Et}from"./tokens._token-B3-YwuKp.js";import{t as Dt}from"./users.index-D8hwzM6P.js";import{t as Ot}from"./users._user-BFPXcJ4y.js";import{t as kt}from"./projects._project.index-CCDEuE-z.js";import{t as At}from"./projects._project._environment-CrWjQmIA.js";var jt=i((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,ie());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?ie():S=!1}}}var ie;if(typeof y==`function`)ie=function(){y(re)};else if(typeof MessageChannel<`u`){var w=new MessageChannel,ae=w.port2;w.port1.onmessage=re,ie=function(){ae.postMessage(null)}}else ie=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,ie()))),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}}}})),Mt=i(((e,t)=>{t.exports=jt()})),Nt=i((e=>{var t=Mt(),n=g(),r=Le();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,p=Symbol.for(`react.element`),m=Symbol.for(`react.transitional.element`),h=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`),ie=Symbol.for(`react.memo_cache_sentinel`),w=Symbol.iterator;function ae(e){return typeof e!=`object`||!e?null:(e=w&&e[w]||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 h: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-DmEOYI6p.js": {
99
- "file": "_coffre/assets/audit-DmEOYI6p.js",
98
+ "_audit-BsLd3asn.js": {
99
+ "file": "_coffre/assets/audit-BsLd3asn.js",
100
100
  "name": "audit",
101
101
  "imports": [
102
102
  "_ui-BNzhIAQP.js",
@@ -320,7 +320,7 @@
320
320
  "name": "validation"
321
321
  },
322
322
  "src/router.tsx": {
323
- "file": "_coffre/assets/router-DJitLcyq.js",
323
+ "file": "_coffre/assets/router-xk2rumMi.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-BoO6ZqMc.js",
338
- "_audit-DmEOYI6p.js",
338
+ "_audit-BsLd3asn.js",
339
339
  "_login-Bvc4gp0X.js",
340
340
  "_settings-CM9-h7in.js",
341
341
  "_auth.device-CJwZYYtn.js",
@@ -384,7 +384,7 @@
384
384
  ]
385
385
  },
386
386
  "src/routes/audit.tsx?tsr-split=component": {
387
- "file": "_coffre/assets/audit-BK8GgVJg.js",
387
+ "file": "_coffre/assets/audit-mGcuoCZV.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-BNzhIAQP.js",
394
394
  "_page-BjXk0Ehu.js",
395
- "_audit-DmEOYI6p.js"
395
+ "_audit-BsLd3asn.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-VXK4Nv8_.js",
550
+ "file": "_coffre/assets/_tanstack-start-manifest_v-CQrSBuAx.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-BC790UXT.js",
23
+ "/_coffre/assets/index-C1l9I4jg.js",
24
24
  "/_coffre/assets/page-BxW2MwaX.js",
25
25
  "/_coffre/assets/preload-helper-BHuP8_FL.js",
26
26
  "/_coffre/assets/coffre-C7qL3HGR.js",
@@ -28,7 +28,7 @@ var tsrStartManifest = () => ({ routes: {
28
28
  "/_coffre/assets/affordances-DiuJIiR2.js",
29
29
  "/_coffre/assets/project-environments-CfIH5kFM.js",
30
30
  "/_coffre/assets/account-C4bNbeO7.js",
31
- "/_coffre/assets/audit-DIc_l6nV.js",
31
+ "/_coffre/assets/audit-Dzj5DyKt.js",
32
32
  "/_coffre/assets/login-CR9CBXlw.js",
33
33
  "/_coffre/assets/settings-2BPsenNM.js",
34
34
  "/_coffre/assets/auth.device-BfCfeBWe.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-BC790UXT.js"
46
+ src: "/_coffre/assets/index-C1l9I4jg.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-CNxnZHje.js"]
61
+ preloads: ["/_coffre/assets/audit-h7CmJBTo.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 lazyRouteComponent, w as createFileRoute } from "./ui-BNzhIAQP.js";
2
2
  import { i as statusOf, o as uiResult } from "./coffre-1hxT2E_U.js";
3
3
  //#region src/routes/audit.tsx
4
- var $$splitComponentImporter = () => import("./audit-BK8GgVJg.js");
4
+ var $$splitComponentImporter = () => import("./audit-mGcuoCZV.js");
5
5
  var PAGE_SIZE = 200;
6
6
  var Route = createFileRoute("/audit")({
7
7
  validateSearch: (search) => ({
@@ -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-BNzhIAQP.js";
3
3
  import { G as SlashCircle, S as Info, T as Ledger, U as ShieldCheck, Z as User, c as AlertTriangle, et as X, f as ChevronRight, i as PageHeader, m as Clock, n as ClosedDoor, o as Activity } from "./page-BjXk0Ehu.js";
4
- import { t as Route } from "./audit-DmEOYI6p.js";
4
+ import { t as Route } from "./audit-BsLd3asn.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;
@@ -266,8 +266,8 @@ var TEMPLATES = {
266
266
  tried: "check",
267
267
  what: ({ entry }) => [[
268
268
  "the",
269
- text(entry.metadata.kekProvider),
270
- "KEK",
269
+ text(entry.metadata.kekProvider) === "local" ? null : text(entry.metadata.kekProvider),
270
+ "vault key",
271
271
  text(entry.metadata.kekId)
272
272
  ].filter((word) => word !== null).join(" ")]
273
273
  },
@@ -340,7 +340,7 @@ var REASONS = {
340
340
  duplicate_destination: "already synced from elsewhere",
341
341
  cannot_grant_sync: "cannot grant the sync its reads",
342
342
  kms_unavailable: "KMS did not answer",
343
- wrong_kek: "the vault's KEK is not the one that wrapped the data"
343
+ wrong_kek: "the vault's key is not the one that wrapped the data"
344
344
  };
345
345
  /** What a missing permission meant, from the app's `missing_<permission>`. */
346
346
  var MISSING = {
@@ -8,7 +8,7 @@ import { n as Toaster, r as toast } from "./use-action-BkJXC5JM.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-BoO6ZqMc.js";
11
- import { t as Route$5 } from "./audit-DmEOYI6p.js";
11
+ import { t as Route$5 } from "./audit-BsLd3asn.js";
12
12
  import { t as Route$6 } from "./login-Bvc4gp0X.js";
13
13
  import { t as Route$7 } from "./settings-CM9-h7in.js";
14
14
  import { t as Route$8 } from "./auth.device-CJwZYYtn.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-VXK4Nv8_.js");
12383
+ const { tsrStartManifest } = await import("./_coffre/assets/_tanstack-start-manifest_v-CQrSBuAx.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-DJitLcyq.js"),
13510
+ import("./_coffre/assets/router-xk2rumMi.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.2",
3
+ "version": "0.1.4",
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.2"
31
+ "@coffre/client": "0.1.4"
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.2"
54
+ "@coffre/core": "0.1.4"
55
55
  },
56
56
  "scripts": {
57
57
  "build": "vite build && rm dist/server/wrangler.json && tsdown && node ../../scripts/check-client-bundle.mjs",
@@ -260,7 +260,7 @@ const TEMPLATES: Record<string, Template> = {
260
260
  'key.check': {
261
261
  did: 'recorded the check value of',
262
262
  tried: 'check',
263
- what: ({ entry }) => [['the', text(entry.metadata.kekProvider), 'KEK', text(entry.metadata.kekId)].filter((word) => word !== null).join(' ')],
263
+ what: ({ entry }) => [['the', text(entry.metadata.kekProvider) === 'local' ? null : text(entry.metadata.kekProvider), 'vault key', text(entry.metadata.kekId)].filter((word) => word !== null).join(' ')],
264
264
  },
265
265
  'sync.run': {
266
266
  did: 'ran the sync of',
@@ -314,7 +314,7 @@ const REASONS: Record<string, string> = {
314
314
  duplicate_destination: 'already synced from elsewhere',
315
315
  cannot_grant_sync: 'cannot grant the sync its reads',
316
316
  kms_unavailable: 'KMS did not answer',
317
- wrong_kek: "the vault's KEK is not the one that wrapped the data",
317
+ wrong_kek: "the vault's key is not the one that wrapped the data",
318
318
  };
319
319
 
320
320
  /** What a missing permission meant, from the app's `missing_<permission>`. */
@@ -1 +0,0 @@
1
- import{G as e,Ot as t,S as n,T as r,Tt as i,U as a,Z as o,c as s,ct as c,et as l,f as u,i as d,m as f,n as p,o as m}from"./page-BxW2MwaX.js";import{D as h,a as g,c as _,f as v,m as y,u as b}from"./preload-helper-BHuP8_FL.js";import{t as x}from"./audit-DIc_l6nV.js";var S=t(i()),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),`KEK`,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 KEK 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=c();function Z(){let{entries:t,chain:n}=x.useLoaderData(),i=x.useSearch(),{decision:s,actorId:c}=i,u=i.detail===`1`,v=s===`deny`;if(!t.ok)return(0,X.jsx)(p,{icon:(0,X.jsx)(r,{size:18}),label:`Audit`,title:`The audit log is closed to you`,children:t.error});let y=n.integrity===`broken`?n:null,b=y?.failedAtSeq??null,S=q(t.entries),C=u?null:Y(t.hidden??[]),w={decision:s,actorId:c};return(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(d,{title:`Audit`,actions:(0,X.jsx)(se,{chain:n})}),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&&!t.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:i.detail},activeOptions:{exact:!0},children:`All events`}),(0,X.jsxs)(h,{to:`/audit`,search:{...w,decision:`deny`,detail:i.detail},activeOptions:{exact:!0},children:[(0,X.jsx)(e,{size:13}),`Denials only`]})]}),c!==void 0&&(0,X.jsxs)(h,{className:`filter-chip`,to:`/audit`,search:{...w,actorId:void 0,detail:i.detail},"aria-label":`Stop filtering by ${c}`,children:[`Actor `,(0,X.jsx)(`span`,{className:`mono`,children:c}),(0,X.jsx)(l,{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)(o,{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)(a,{size:14}),`Decided by`]})})]})}),(0,X.jsx)(`tbody`,{children:S.map(e=>(0,X.jsx)(ne,{batch:e,filters:w,detail:i.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:t,seq:n,parts:r,refused:i,decided:a,filters:o,detail:c,breaks:l,marked:u,toggle:d,child:f=!1,batch:p}){let m=U(p??[t]),g=[i&&`is-denied`,(l||u)&&`is-break`,f&&`is-child`,t.detail&&`is-detail`,t.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:n}),(0,X.jsx)(`td`,{className:`nowrap cell-mono`,"data-label":`When (UTC)`,children:(0,X.jsx)(b,{iso:t.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:{...o,actorId:t.actorId,detail:c},children:m}):(0,X.jsx)(h,{to:`/audit`,search:{...o,actorId:t.actorId,detail:c},children:$(m.member)})})}),(0,X.jsx)(`td`,{className:`cell-sentence`,"data-label":`What they did`,children:(0,X.jsxs)(`span`,{className:`sentence`,children:[d,t.action===`vault.tampered`&&(0,X.jsx)(s,{size:13}),(0,X.jsx)(re,{parts:r}),l&&(0,X.jsx)(oe,{})]})}),(0,X.jsx)(`td`,{className:`nowrap`,"data-label":`Decided by`,children:(0,X.jsxs)(`span`,{className:i?`decided decided-refused`:`decided`,children:[i&&(0,X.jsx)(e,{size:13}),a,i&&`, 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)(s,{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)(n,{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)(s,{size:14}),`Log not verified`]})}):e.integrity===`broken`?(0,X.jsxs)(`span`,{className:`chain-flag chain-flag-bad`,role:`status`,children:[(0,X.jsx)(s,{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)(a,{size:14}),e.through===null?`Verified`:`Verified through ${e.through}`]})})]})}export{Z as component};