mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-07 04:27:29 +00:00
Remove storage of protected key
This commit is contained in:
@@ -166,9 +166,6 @@ export default function UserInfoStep({
|
|||||||
SecurityClient.setToken(response.token);
|
SecurityClient.setToken(response.token);
|
||||||
|
|
||||||
saveTokenToLocalStorage({
|
saveTokenToLocalStorage({
|
||||||
protectedKey,
|
|
||||||
protectedKeyIV,
|
|
||||||
protectedKeyTag,
|
|
||||||
publicKey,
|
publicKey,
|
||||||
encryptedPrivateKey,
|
encryptedPrivateKey,
|
||||||
iv: encryptedPrivateKeyIV,
|
iv: encryptedPrivateKeyIV,
|
||||||
|
|||||||
@@ -97,9 +97,6 @@ const attemptLogin = async (
|
|||||||
});
|
});
|
||||||
|
|
||||||
saveTokenToLocalStorage({
|
saveTokenToLocalStorage({
|
||||||
protectedKey,
|
|
||||||
protectedKeyIV,
|
|
||||||
protectedKeyTag,
|
|
||||||
publicKey,
|
publicKey,
|
||||||
encryptedPrivateKey,
|
encryptedPrivateKey,
|
||||||
iv,
|
iv,
|
||||||
|
|||||||
@@ -70,9 +70,6 @@ const attemptLoginMfa = async ({
|
|||||||
});
|
});
|
||||||
|
|
||||||
saveTokenToLocalStorage({
|
saveTokenToLocalStorage({
|
||||||
protectedKey,
|
|
||||||
protectedKeyIV,
|
|
||||||
protectedKeyTag,
|
|
||||||
publicKey,
|
publicKey,
|
||||||
encryptedPrivateKey,
|
encryptedPrivateKey,
|
||||||
iv,
|
iv,
|
||||||
|
|||||||
@@ -117,9 +117,6 @@ const changePassword = async (
|
|||||||
});
|
});
|
||||||
|
|
||||||
saveTokenToLocalStorage({
|
saveTokenToLocalStorage({
|
||||||
protectedKey,
|
|
||||||
protectedKeyIV,
|
|
||||||
protectedKeyTag,
|
|
||||||
encryptedPrivateKey,
|
encryptedPrivateKey,
|
||||||
iv: encryptedPrivateKeyIV,
|
iv: encryptedPrivateKeyIV,
|
||||||
tag: encryptedPrivateKeyTag
|
tag: encryptedPrivateKeyTag
|
||||||
|
|||||||
@@ -1,6 +1,8 @@
|
|||||||
import Aes256Gcm from '@app/components/utilities/cryptography/aes-256-gcm';
|
import Aes256Gcm from '@app/components/utilities/cryptography/aes-256-gcm';
|
||||||
import { deriveArgonKey } from '@app/components/utilities/cryptography/crypto';
|
import { deriveArgonKey } from '@app/components/utilities/cryptography/crypto';
|
||||||
|
|
||||||
|
import { KeyService } from '../services';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Object} obj
|
* @param {Object} obj
|
||||||
* @param {Number} obj.encryptionVersion
|
* @param {Number} obj.encryptionVersion
|
||||||
@@ -79,6 +81,7 @@ let privateKey;
|
|||||||
throw new Error('Failed to decrypt private key');
|
throw new Error('Failed to decrypt private key');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
KeyService.setPrivateKey(privateKey);
|
||||||
return privateKey;
|
return privateKey;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -152,9 +152,6 @@ export default function SignupInvite() {
|
|||||||
SecurityClient.setToken(jwtToken);
|
SecurityClient.setToken(jwtToken);
|
||||||
|
|
||||||
saveTokenToLocalStorage({
|
saveTokenToLocalStorage({
|
||||||
protectedKey,
|
|
||||||
protectedKeyIV,
|
|
||||||
protectedKeyTag,
|
|
||||||
publicKey,
|
publicKey,
|
||||||
encryptedPrivateKey,
|
encryptedPrivateKey,
|
||||||
iv: encryptedPrivateKeyIV,
|
iv: encryptedPrivateKeyIV,
|
||||||
|
|||||||
@@ -13,6 +13,10 @@ import {
|
|||||||
class KeyService {
|
class KeyService {
|
||||||
private static privateKey: string = '';
|
private static privateKey: string = '';
|
||||||
|
|
||||||
|
static setPrivateKey(privateKey: string) {
|
||||||
|
KeyService.privateKey = privateKey;
|
||||||
|
}
|
||||||
|
|
||||||
/** Return the user's decrypted private key
|
/** Return the user's decrypted private key
|
||||||
* @param {Object} obj
|
* @param {Object} obj
|
||||||
* @param {Number} obj.encryptionVersion
|
* @param {Number} obj.encryptionVersion
|
||||||
|
|||||||
@@ -0,0 +1,7 @@
|
|||||||
|
import KeyService from './KeyService';
|
||||||
|
import ProjectService from './ProjectService';
|
||||||
|
|
||||||
|
export {
|
||||||
|
KeyService,
|
||||||
|
ProjectService
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user