allow user to choose whether to send base credentials at approval screen

This commit is contained in:
2024-01-10 16:31:16 -08:00
parent dd40eb379e
commit 46b8d810c5
10 changed files with 32 additions and 17 deletions

View File

@ -11,10 +11,11 @@
// Send response to backend, display error if applicable
let error, alert;
let base = $appState.currentRequest.base;
async function respond() {
let {id, approval} = $appState.currentRequest;
try {
await invoke('respond', {response: {id, approval}});
await invoke('respond', {response: {id, approval, base}});
navigate('ShowResponse');
}
catch (e) {
@ -83,7 +84,7 @@
<div>
<svg xmlns="http://www.w3.org/2000/svg" class="stroke-current flex-shrink-0 h-6 w-6" fill="none" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z" /></svg>
<span>
WARNING: This application is requesting your base (long-lived) AWS credentials.
WARNING: This application is requesting your long-lived AWS credentials.
These credentials are less secure than session credentials, since they don't expire automatically.
</span>
</div>
@ -116,5 +117,12 @@
</button>
</Link>
</div>
<div class="w-full">
<label class="label cursor-pointer justify-end gap-x-2">
<span class="label-text">Send long-lived credentials</span>
<input type="checkbox" class="checkbox checkbox-success" bind:checked={base}>
</label>
</div>
</div>
{/if}
{/if}

View File

@ -39,8 +39,8 @@
Launch Terminal
</button>
<label class="label cursor-pointer flex items-center space-x-2">
<span class="label-text">Launch with long-lived credentials</span>
<input type="checkbox" class="checkbox checkbox-sm" bind:checked={launchBase}>
<span class="label-text">Launch with base credentials</span>
</label>
{:else if status === 'empty'}