diff --git a/app/web/package.json b/app/web/package.json index 0eb07d6ed1..f5cfef9c36 100644 --- a/app/web/package.json +++ b/app/web/package.json @@ -56,11 +56,13 @@ "fontfaceobserver": "^2.3.0", "is-promise": "^4.0.0", "javascript-time-ago": "^2.5.7", + "js-base64": "^3.7.5", "js-beautify": "^1.14.9", "js-confetti": "^0.11.0", "jwt-decode": "^3.1.2", "konva": "^8.3.13", "less": "^4.1.3", + "libsodium-wrappers": "^0.7.13", "local-storage-fallback": "^4.1.2", "lodash-es": "^4.17.21", "pinia": "^2.1.3", @@ -84,6 +86,7 @@ "@types/fontfaceobserver": "^2.1.0", "@types/javascript-time-ago": "^2.0.3", "@types/js-beautify": "^1.14.1", + "@types/libsodium-wrappers": "^0.7.11", "@types/lodash-es": "^4.17.7", "@types/node": "^18.15.11", "@types/tinycolor2": "^1.4.3", diff --git a/app/web/src/api/sdf/dal/key_pair.ts b/app/web/src/api/sdf/dal/key_pair.ts index 7e609ae0f5..2c0a8b4f90 100644 --- a/app/web/src/api/sdf/dal/key_pair.ts +++ b/app/web/src/api/sdf/dal/key_pair.ts @@ -1,3 +1,5 @@ +// TODO(fnichol): delete this! + import { StandardModel } from "@/api/sdf/dal/standard_model"; /** diff --git a/app/web/src/api/sdf/dal/secret.ts b/app/web/src/api/sdf/dal/secret.ts deleted file mode 100644 index a95abd1fe9..0000000000 --- a/app/web/src/api/sdf/dal/secret.ts +++ /dev/null @@ -1,32 +0,0 @@ -import { StandardModel } from "@/api/sdf/dal/standard_model"; - -export interface Secret extends StandardModel { - name: string; - objectType: SecretObjectType; - kind: SecretKind; -} - -export enum SecretObjectType { - Credential = "credential", -} - -export enum SecretKind { - DockerHub = "dockerHub", - AwsAccessKey = "awsAccessKey", - HelmRepo = "helmRepo", - AzureServicePrincipal = "azureServicePrincipal", -} - -export enum SecretVersion { - V1 = "v1", -} - -export enum SecretAlgorithm { - Sealedbox = "sealedbox", -} - -export interface SecretKindFields { - secretKind: SecretKind; - displayName: string; - fields: { keyName: string; displayName: string; password: boolean }[]; -} diff --git a/app/web/src/components/AddSecretForm.vue b/app/web/src/components/AddSecretForm.vue index dd7d3b8e40..d7464bf763 100644 --- a/app/web/src/components/AddSecretForm.vue +++ b/app/web/src/components/AddSecretForm.vue @@ -32,7 +32,7 @@ - - + , - expiration: "", }; -const secretFormData = reactive(_.clone(secretFormEmpty)); +const secretFormData = ref(_.cloneDeep(secretFormEmpty)); const saveSecret = async () => { if (validationMethods.hasError()) return; const res = await secretsStore.SAVE_SECRET( props.definitionId, - secretFormData.name, - secretFormData.value, - secretFormData.description, - secretFormData.expiration, + secretFormData.value.name, + secretFormData.value.value, + secretFormData.value.description, ); if (res.result.success) { @@ -145,7 +143,7 @@ const saveSecret = async () => { setTimeout(() => { secretsStore.clearRequestStatus("SAVE_SECRET"); - _.assign(secretFormData, secretFormEmpty); + secretFormData.value = _.cloneDeep(secretFormEmpty); validationMethods.resetAll(); diff --git a/app/web/src/components/Workspace/WorkspaceCustomizeSecrets.vue b/app/web/src/components/Workspace/WorkspaceCustomizeSecrets.vue index bb3f6e773e..545f84e7ad 100644 --- a/app/web/src/components/Workspace/WorkspaceCustomizeSecrets.vue +++ b/app/web/src/components/Workspace/WorkspaceCustomizeSecrets.vue @@ -4,34 +4,55 @@ - - - - {{ definition }} - - - {{ secret.name }} - - by {{ secret.createdInfo.actor.label }} - - - - - - + + + + Please select a secret definition above + + + {{ definition }} + + + {{ secret.name }} + + by {{ secret.createdInfo?.actor?.label || "UNDEF" }} + + + + + + + + + + You need to create secret defining schema before using this page + + @@ -50,8 +71,9 @@
Please select a secret definition above
+ You need to create secret defining schema before using this page +