mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-07 19:28:09 +00:00
Fixed the TS error during signup
This commit is contained in:
@@ -1,3 +1,5 @@
|
|||||||
|
import { SecretDataProps } from 'public/data/frequentInterfaces';
|
||||||
|
|
||||||
import Aes256Gcm from '~/components/utilities/cryptography/aes-256-gcm';
|
import Aes256Gcm from '~/components/utilities/cryptography/aes-256-gcm';
|
||||||
import login1 from '~/pages/api/auth/Login1';
|
import login1 from '~/pages/api/auth/Login1';
|
||||||
import login2 from '~/pages/api/auth/Login2';
|
import login2 from '~/pages/api/auth/Login2';
|
||||||
@@ -13,14 +15,6 @@ import Telemetry from './telemetry/Telemetry';
|
|||||||
import { saveTokenToLocalStorage } from './saveTokenToLocalStorage';
|
import { saveTokenToLocalStorage } from './saveTokenToLocalStorage';
|
||||||
import SecurityClient from './SecurityClient';
|
import SecurityClient from './SecurityClient';
|
||||||
|
|
||||||
interface SecretDataProps {
|
|
||||||
type: 'personal' | 'shared';
|
|
||||||
pos: number;
|
|
||||||
key: string;
|
|
||||||
value: string;
|
|
||||||
id: string;
|
|
||||||
comment: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
const crypto = require("crypto");
|
const crypto = require("crypto");
|
||||||
const nacl = require('tweetnacl');
|
const nacl = require('tweetnacl');
|
||||||
@@ -145,53 +139,53 @@ const attemptLogin = async (
|
|||||||
);
|
);
|
||||||
|
|
||||||
const secretsToBeAdded: SecretDataProps[] = [{
|
const secretsToBeAdded: SecretDataProps[] = [{
|
||||||
type: "shared",
|
|
||||||
pos: 0,
|
pos: 0,
|
||||||
key: "DATABASE_URL",
|
key: "DATABASE_URL",
|
||||||
value: "mongodb+srv://${DB_USERNAME}:${DB_PASSWORD}@mongodb.net",
|
value: "mongodb+srv://${DB_USERNAME}:${DB_PASSWORD}@mongodb.net",
|
||||||
|
valueOverride: undefined,
|
||||||
comment: "This is an example of secret referencing.",
|
comment: "This is an example of secret referencing.",
|
||||||
id: ''
|
id: ''
|
||||||
}, {
|
}, {
|
||||||
type: "shared",
|
|
||||||
pos: 1,
|
pos: 1,
|
||||||
key: "DB_USERNAME",
|
key: "DB_USERNAME",
|
||||||
value: "OVERRIDE_THIS",
|
value: "OVERRIDE_THIS",
|
||||||
|
valueOverride: undefined,
|
||||||
comment: "This is an example of secret overriding. Your team can have a shared value of a secret, while you can override it to whatever value you need",
|
comment: "This is an example of secret overriding. Your team can have a shared value of a secret, while you can override it to whatever value you need",
|
||||||
id: ''
|
id: ''
|
||||||
}, {
|
}, {
|
||||||
type: "personal",
|
|
||||||
pos: 2,
|
pos: 2,
|
||||||
|
key: "DB_PASSWORD",
|
||||||
|
value: "OVERRIDE_THIS",
|
||||||
|
valueOverride: undefined,
|
||||||
|
comment: "This is an example of secret overriding. Your team can have a shared value of a secret, while you can override it to whatever value you need",
|
||||||
|
id: ''
|
||||||
|
}, {
|
||||||
|
pos: 3,
|
||||||
key: "DB_USERNAME",
|
key: "DB_USERNAME",
|
||||||
value: "user1234",
|
value: "user1234",
|
||||||
|
valueOverride: "user1234",
|
||||||
comment: "",
|
comment: "",
|
||||||
id: ''
|
id: ''
|
||||||
}, {
|
}, {
|
||||||
type: "shared",
|
|
||||||
pos: 3,
|
|
||||||
key: "DB_PASSWORD",
|
|
||||||
value: "OVERRIDE_THIS",
|
|
||||||
comment: "This is an example of secret overriding. Your team can have a shared value of a secret, while you can override it to whatever value you need",
|
|
||||||
id: ''
|
|
||||||
}, {
|
|
||||||
type: "personal",
|
|
||||||
pos: 4,
|
pos: 4,
|
||||||
key: "DB_PASSWORD",
|
key: "DB_PASSWORD",
|
||||||
value: "example_password",
|
value: "example_password",
|
||||||
|
valueOverride: "example_password",
|
||||||
comment: "",
|
comment: "",
|
||||||
id: ''
|
id: ''
|
||||||
}, {
|
}, {
|
||||||
type: "shared",
|
|
||||||
pos: 5,
|
pos: 5,
|
||||||
key: "TWILIO_AUTH_TOKEN",
|
key: "TWILIO_AUTH_TOKEN",
|
||||||
value: "example_twillio_token",
|
value: "example_twillio_token",
|
||||||
comment: "This is an example of secret overriding. Your team can have a shared value of a secret, while you can override it to whatever value you need",
|
valueOverride: undefined,
|
||||||
|
comment: "",
|
||||||
id: ''
|
id: ''
|
||||||
}, {
|
}, {
|
||||||
type: "shared",
|
|
||||||
pos: 6,
|
pos: 6,
|
||||||
key: "WEBSITE_URL",
|
key: "WEBSITE_URL",
|
||||||
value: "http://localhost:3000",
|
value: "http://localhost:3000",
|
||||||
comment: "This is an example of secret overriding. Your team can have a shared value of a secret, while you can override it to whatever value you need",
|
valueOverride: undefined,
|
||||||
|
comment: "",
|
||||||
id: ''
|
id: ''
|
||||||
}]
|
}]
|
||||||
const secrets = await encryptSecrets({ secretsToEncrypt: secretsToBeAdded, workspaceId: String(localStorage.getItem('projectData.id')), env: 'dev' })
|
const secrets = await encryptSecrets({ secretsToEncrypt: secretsToBeAdded, workspaceId: String(localStorage.getItem('projectData.id')), env: 'dev' })
|
||||||
|
|||||||
Reference in New Issue
Block a user