mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-18 00:51:15 +00:00
Add eslint rule and fix as many issues as possible
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import SecurityClient from '@app/components/utilities/SecurityClient';
|
||||
import SecurityClient from "@app/components/utilities/SecurityClient";
|
||||
|
||||
interface EncryptedSecretProps {
|
||||
id: string;
|
||||
@@ -13,7 +13,7 @@ interface EncryptedSecretProps {
|
||||
secretValueCiphertext: string;
|
||||
secretValueIV: string;
|
||||
secretValueTag: string;
|
||||
type: 'personal' | 'shared';
|
||||
type: "personal" | "shared";
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -33,10 +33,10 @@ const addSecrets = async ({
|
||||
env: string;
|
||||
workspaceId: string;
|
||||
}) =>
|
||||
SecurityClient.fetchCall('/api/v2/secrets', {
|
||||
method: 'POST',
|
||||
SecurityClient.fetchCall("/api/v2/secrets", {
|
||||
method: "POST",
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
"Content-Type": "application/json"
|
||||
},
|
||||
body: JSON.stringify({
|
||||
environment: env,
|
||||
@@ -47,7 +47,7 @@ const addSecrets = async ({
|
||||
if (res && res.status === 200) {
|
||||
return res.json();
|
||||
}
|
||||
console.log('Failed to add certain project secrets');
|
||||
console.log("Failed to add certain project secrets");
|
||||
return undefined;
|
||||
});
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import SecurityClient from '@app/components/utilities/SecurityClient';
|
||||
import SecurityClient from "@app/components/utilities/SecurityClient";
|
||||
|
||||
/**
|
||||
* This function deletes certain secrets from a certain project
|
||||
@@ -6,10 +6,10 @@ import SecurityClient from '@app/components/utilities/SecurityClient';
|
||||
* @returns
|
||||
*/
|
||||
const deleteSecrets = async ({ secretIds }: { secretIds: string[] }) =>
|
||||
SecurityClient.fetchCall('/api/v2/secrets', {
|
||||
method: 'DELETE',
|
||||
SecurityClient.fetchCall("/api/v2/secrets", {
|
||||
method: "DELETE",
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
"Content-Type": "application/json"
|
||||
},
|
||||
body: JSON.stringify({
|
||||
secretIds
|
||||
@@ -18,7 +18,7 @@ const deleteSecrets = async ({ secretIds }: { secretIds: string[] }) =>
|
||||
if (res && res.status === 200) {
|
||||
return res.json();
|
||||
}
|
||||
console.log('Failed to delete certain project secrets');
|
||||
console.log("Failed to delete certain project secrets");
|
||||
return undefined;
|
||||
});
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import SecurityClient from '@app/components/utilities/SecurityClient';
|
||||
import SecurityClient from "@app/components/utilities/SecurityClient";
|
||||
|
||||
/**
|
||||
* This function fetches the encrypted secrets for a certain project
|
||||
@@ -13,16 +13,16 @@ const getSecrets = async (workspaceId: string, env: string) =>
|
||||
workspaceId
|
||||
})}`,
|
||||
{
|
||||
method: 'GET',
|
||||
method: "GET",
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
"Content-Type": "application/json"
|
||||
}
|
||||
}
|
||||
).then(async (res) => {
|
||||
if (res && res.status === 200) {
|
||||
return (await res.json()).secrets;
|
||||
}
|
||||
console.log('Failed to get project secrets');
|
||||
console.log("Failed to get project secrets");
|
||||
return undefined;
|
||||
});
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import SecurityClient from '@app/components/utilities/SecurityClient';
|
||||
import SecurityClient from "@app/components/utilities/SecurityClient";
|
||||
|
||||
interface EncryptedSecretProps {
|
||||
id: string;
|
||||
@@ -13,7 +13,7 @@ interface EncryptedSecretProps {
|
||||
secretValueCiphertext: string;
|
||||
secretValueIV: string;
|
||||
secretValueTag: string;
|
||||
type: 'personal' | 'shared';
|
||||
type: "personal" | "shared";
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -23,10 +23,10 @@ interface EncryptedSecretProps {
|
||||
* @returns
|
||||
*/
|
||||
const updateSecrets = async ({ secrets }: { secrets: EncryptedSecretProps[] }) =>
|
||||
SecurityClient.fetchCall('/api/v2/secrets', {
|
||||
method: 'PATCH',
|
||||
SecurityClient.fetchCall("/api/v2/secrets", {
|
||||
method: "PATCH",
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
"Content-Type": "application/json"
|
||||
},
|
||||
body: JSON.stringify({
|
||||
secrets
|
||||
@@ -35,7 +35,7 @@ const updateSecrets = async ({ secrets }: { secrets: EncryptedSecretProps[] }) =
|
||||
if (res && res.status === 200) {
|
||||
return res.json();
|
||||
}
|
||||
console.log('Failed to update certain project secrets');
|
||||
console.log("Failed to update certain project secrets");
|
||||
return undefined;
|
||||
});
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import SecurityClient from '@app/components/utilities/SecurityClient';
|
||||
import SecurityClient from "@app/components/utilities/SecurityClient";
|
||||
|
||||
interface Props {
|
||||
workspaceId: string;
|
||||
@@ -18,21 +18,21 @@ interface Props {
|
||||
*/
|
||||
const uploadSecrets = async ({ workspaceId, secrets, keys, environment }: Props) =>
|
||||
SecurityClient.fetchCall(`/api/v2/workspace/${workspaceId}/secrets`, {
|
||||
method: 'POST',
|
||||
method: "POST",
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
"Content-Type": "application/json"
|
||||
},
|
||||
body: JSON.stringify({
|
||||
secrets,
|
||||
keys,
|
||||
environment,
|
||||
channel: 'web'
|
||||
channel: "web"
|
||||
})
|
||||
}).then(async (res) => {
|
||||
if (res && res.status === 200) {
|
||||
return res;
|
||||
}
|
||||
console.log('Failed to push secrets');
|
||||
console.log("Failed to push secrets");
|
||||
return undefined;
|
||||
});
|
||||
|
||||
|
||||
@@ -26,7 +26,7 @@ const batchSecrets = async ({
|
||||
environment: string;
|
||||
requests: RequestType[];
|
||||
}) => {
|
||||
const { data } = await apiRequest.post('/api/v2/secrets/batch', {
|
||||
const { data } = await apiRequest.post("/api/v2/secrets/batch", {
|
||||
workspaceId,
|
||||
environment,
|
||||
requests
|
||||
|
||||
Reference in New Issue
Block a user