From 0c1ccdd6d3f6458bf1d72229b8bb12a2ec61d580 Mon Sep 17 00:00:00 2001 From: Guilhem Lemouel Date: Fri, 30 Oct 2026 09:55:44 -0700 Subject: [PATCH] fixup! feat: create a service account from the run-as picker at deploy Co-Authored-By: Claude Opus 5.5 --- .../lib/components/OnBehalfOfSelector.svelte | 18 +- .../lib/components/access/ItemReads.svelte | 210 +++++++++--------- .../access/NewServiceAccountForm.svelte | 31 ++- .../lib/components/access/RunAsNotes.svelte | 57 ++--- .../apps/editor/AppEditorHeaderDeploy.svelte | 18 +- 5 files changed, 183 insertions(+), 151 deletions(-) diff --git a/frontend/src/lib/components/OnBehalfOfSelector.svelte b/frontend/src/lib/components/OnBehalfOfSelector.svelte index f4cbcee400..abd6b032c8 100644 --- a/frontend/src/lib/components/OnBehalfOfSelector.svelte +++ b/frontend/src/lib/components/OnBehalfOfSelector.svelte @@ -30,7 +30,7 @@ + + confirming && grantRead(confirming)} + onCanceled={() => (confirming = undefined)} +> + {#if confirming} +

+ {account} gets read access to the {confirming.kind} + {confirming.path}. The grant applies now, before you deploy. +

+ {/if} +
+ {#if items.length} - open, (o) => key && (toggled = { key, open: o })} - > -
-
+
+ This {kind} needs read access to: + + + + Path + Kind + {#if readable} + {account} + + {/if} + + + {#each items as item (item.kind + ':' + item.path)} {@const itemKey = `${item.kind}:${item.path}`} {@const ok = readable?.(item)} - {#if readable} - {#if ok} - - {:else} - + + {item.path} + {item.kind} + {#if readable} + + {#if grantErrors[itemKey]} + {grantErrors[itemKey]} + {:else if ok} + + + Can read + + {:else} + + + {mode === 'pending' ? "Won't be able to read" : "Can't read"} + + {/if} + + + {#if !ok && mode === 'checked' && isAdmin} + + {/if} + {/if} - {/if} - {item.path} - {item.kind} - {#if readable} - {#if grantErrors[itemKey]} - - {grantErrors[itemKey]} - - {:else if !ok} - - {account} - {mode === 'pending' ? "won't be able to read it" : "can't read it"} - - {:else} - - {/if} - {/if} + {/each} -
- {#if missing.length && mode === 'checked' && isAdmin} -
- -
- {/if} - {#if shown?.accessError} - Couldn't check {account}'s access: {shown.accessError} - {/if} - {#if mode === 'caller'} - - It runs as whoever runs it, so each of them needs read access to these. - - {/if} - {#if shown?.needs.others.length} - - Also uses {shown.needs.others.map((o) => `${o.kind} ${o.path}`).join(', ')}; access to - these is set on the storage or data table itself. - - {/if} - {#if shown?.needs.errors.length} - - Some of it could not be read, so this list may be incomplete: {shown.needs.errors.join( - '; ' - )}. - - {/if} + + + {#if shown?.accessError} + Couldn't check {account}'s access: {shown.accessError} + {/if} + {#if mode === 'caller'} - Only paths written out in the code are found; a path the code builds while it runs isn't. + It runs as whoever runs it, so each of them needs read access to these. -
- + {/if} + {#if shown?.needs.others.length} + + Also uses {shown.needs.others.map((o) => `${o.kind} ${o.path}`).join(', ')}; access to these + is set on the storage or data table itself. + + {/if} + {#if shown?.needs.errors.length} + + Some of it could not be read, so this list may be incomplete: {shown.needs.errors.join( + '; ' + )}. + + {/if} + + Only paths written out in the code are found; a path the code builds while it runs isn't. + +
{/if} diff --git a/frontend/src/lib/components/access/NewServiceAccountForm.svelte b/frontend/src/lib/components/access/NewServiceAccountForm.svelte index 0d5504bc93..8e09d7969b 100644 --- a/frontend/src/lib/components/access/NewServiceAccountForm.svelte +++ b/frontend/src/lib/components/access/NewServiceAccountForm.svelte @@ -1,5 +1,5 @@ @@ -217,13 +220,7 @@ {/if} -
- Counts as half a seat. -
- - -
-
+ + Created when you deploy, with the access above. Counts as half a seat. + diff --git a/frontend/src/lib/components/access/RunAsNotes.svelte b/frontend/src/lib/components/access/RunAsNotes.svelte index 83321cfaac..66e38cf5e9 100644 --- a/frontend/src/lib/components/access/RunAsNotes.svelte +++ b/frontend/src/lib/components/access/RunAsNotes.svelte @@ -1,14 +1,12 @@