winglang / wing

A programming language for the cloud ☁️ A unified programming model, combining infrastructure and runtime code into one language ⚡
https://winglang.io
Other
5.05k stars 196 forks source link

`wing secrets` retain existing secrets values #6581

Open hasanaburayyan opened 5 months ago

hasanaburayyan commented 5 months ago

Use Case

Running wing secrets now does not require entering secret values that have already been provided

Given this code:

bring cloud;

let s = new cloud.Secret(name: "secret1") as "s1";
let s2 = new cloud.Secret(name: "secret2") as "s2";
let s3 = new cloud.Secret(name: "secret3") as "s3";

The first time wing secrets is ran the experience remained the same:

❯ wing secrets main.w 
3 secret(s) found

? Enter the secret value for secret1: [hidden]
? Enter the secret value for secret2: [hidden]
? Enter the secret value for secret3: [hidden]

On a subsequent run where existing values were found the experience is now:

❯ wing secrets main.w 
3 secret(s) found

? Enter the secret value for secret1 (existing value found press enter to keep): [hidden]
? Enter the secret value for secret2 (existing value found press enter to keep): [hidden]
? Enter the secret value for secret3 (existing value found press enter to keep): [hidden]

Proposed Solution

No response

Implementation Notes

This will be a little complicated for targets other than sim since it will require using the platform to lookup existing values

Component

No response

Community Notes

eladb commented 5 months ago

From a UX perspective maybe we can still show all the secrets but allow the user to simply press ENTER to keep the currently stored secret.

This way we don't need an additional option for the "update" use case.

Otherwise, we will need some way to ask to re-store a secret.

github-actions[bot] commented 2 months ago

Hi,

This issue hasn't seen activity in 90 days. Therefore, we are marking this issue as stale for now. It will be closed after 7 days. Feel free to re-open this issue when there's an update or relevant information to be added. Thanks!