mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-10 14:28:35 +00:00
feat: some name changes for better understanding on testing
This commit is contained in:
@@ -68,8 +68,8 @@ describe("Identity token secret ops", async () => {
|
|||||||
method: "POST",
|
method: "POST",
|
||||||
url: "/api/v1/auth/universal-auth/login",
|
url: "/api/v1/auth/universal-auth/login",
|
||||||
body: {
|
body: {
|
||||||
clientSecret: seedData1.machineIdentity.clientCred.secret,
|
clientSecret: seedData1.machineIdentity.clientCredentials.secret,
|
||||||
clientId: seedData1.machineIdentity.clientCred.id
|
clientId: seedData1.machineIdentity.clientCredentials.id
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
expect(identityLogin.statusCode).toBe(200);
|
expect(identityLogin.statusCode).toBe(200);
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ describe("Secret V3 Router", async () => {
|
|||||||
authorization: `Bearer ${jwtAuthToken}`
|
authorization: `Bearer ${jwtAuthToken}`
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
const projectKeyEnc = JSON.parse(projectKeyRes.payload);
|
const projectKeyEncryptionDetails = JSON.parse(projectKeyRes.payload);
|
||||||
|
|
||||||
const userInfoRes = await testServer.inject({
|
const userInfoRes = await testServer.inject({
|
||||||
method: "GET",
|
method: "GET",
|
||||||
@@ -43,9 +43,9 @@ describe("Secret V3 Router", async () => {
|
|||||||
const { user: userInfo } = JSON.parse(userInfoRes.payload);
|
const { user: userInfo } = JSON.parse(userInfoRes.payload);
|
||||||
const privateKey = await getUserPrivateKey(seedData1.password, userInfo);
|
const privateKey = await getUserPrivateKey(seedData1.password, userInfo);
|
||||||
projectKey = decryptAsymmetric({
|
projectKey = decryptAsymmetric({
|
||||||
ciphertext: projectKeyEnc.encryptedKey,
|
ciphertext: projectKeyEncryptionDetails.encryptedKey,
|
||||||
nonce: projectKeyEnc.nonce,
|
nonce: projectKeyEncryptionDetails.nonce,
|
||||||
publicKey: projectKeyEnc.sender.publicKey,
|
publicKey: projectKeyEncryptionDetails.sender.publicKey,
|
||||||
privateKey
|
privateKey
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -35,7 +35,7 @@ export const seedData1 = {
|
|||||||
machineIdentity: {
|
machineIdentity: {
|
||||||
id: "88fa7aed-9288-401e-a4c9-fa9430be62a0",
|
id: "88fa7aed-9288-401e-a4c9-fa9430be62a0",
|
||||||
name: "mac1",
|
name: "mac1",
|
||||||
clientCred: {
|
clientCredentials: {
|
||||||
id: "3f6135db-f237-421d-af66-a8f4e80d443b",
|
id: "3f6135db-f237-421d-af66-a8f4e80d443b",
|
||||||
secret: "da35a5a5a7b57f977a9a73394506e878a7175d06606df43dc93e1472b10cf339"
|
secret: "da35a5a5a7b57f977a9a73394506e878a7175d06606df43dc93e1472b10cf339"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ export async function seed(knex: Knex): Promise<void> {
|
|||||||
.insert([
|
.insert([
|
||||||
{
|
{
|
||||||
identityId: seedData1.machineIdentity.id,
|
identityId: seedData1.machineIdentity.id,
|
||||||
clientId: seedData1.machineIdentity.clientCred.id,
|
clientId: seedData1.machineIdentity.clientCredentials.id,
|
||||||
clientSecretTrustedIps: JSON.stringify([
|
clientSecretTrustedIps: JSON.stringify([
|
||||||
{
|
{
|
||||||
type: "ipv4",
|
type: "ipv4",
|
||||||
@@ -54,7 +54,7 @@ export async function seed(knex: Knex): Promise<void> {
|
|||||||
}
|
}
|
||||||
])
|
])
|
||||||
.returning("*");
|
.returning("*");
|
||||||
const clientSecretHash = await bcrypt.hash(seedData1.machineIdentity.clientCred.secret, 10);
|
const clientSecretHash = await bcrypt.hash(seedData1.machineIdentity.clientCredentials.secret, 10);
|
||||||
await knex(TableName.IdentityUaClientSecret).insert([
|
await knex(TableName.IdentityUaClientSecret).insert([
|
||||||
{
|
{
|
||||||
identityUAId: identityUa[0].id,
|
identityUAId: identityUa[0].id,
|
||||||
@@ -62,7 +62,7 @@ export async function seed(knex: Knex): Promise<void> {
|
|||||||
clientSecretTTL: 0,
|
clientSecretTTL: 0,
|
||||||
clientSecretNumUses: 0,
|
clientSecretNumUses: 0,
|
||||||
clientSecretNumUsesLimit: 0,
|
clientSecretNumUsesLimit: 0,
|
||||||
clientSecretPrefix: seedData1.machineIdentity.clientCred.secret.slice(0, 4),
|
clientSecretPrefix: seedData1.machineIdentity.clientCredentials.secret.slice(0, 4),
|
||||||
clientSecretHash,
|
clientSecretHash,
|
||||||
isClientSecretRevoked: false
|
isClientSecretRevoked: false
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user