Skip to content

Commit

Permalink
feat: some name changes for better understanding on testing
Browse files Browse the repository at this point in the history
  • Loading branch information
akhilmhdh committed Feb 18, 2024
1 parent 8864c81 commit 678306b
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions backend/e2e-test/routes/v1/identity.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,8 @@ describe("Identity token secret ops", async () => {
method: "POST",
url: "/api/v1/auth/universal-auth/login",
body: {
clientSecret: seedData1.machineIdentity.clientCred.secret,
clientId: seedData1.machineIdentity.clientCred.id
clientSecret: seedData1.machineIdentity.clientCredentials.secret,
clientId: seedData1.machineIdentity.clientCredentials.id
}
});
expect(identityLogin.statusCode).toBe(200);
Expand Down
8 changes: 4 additions & 4 deletions backend/e2e-test/routes/v3/secrets.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ describe("Secret V3 Router", async () => {
authorization: `Bearer ${jwtAuthToken}`
}
});
const projectKeyEnc = JSON.parse(projectKeyRes.payload);
const projectKeyEncryptionDetails = JSON.parse(projectKeyRes.payload);

const userInfoRes = await testServer.inject({
method: "GET",
Expand All @@ -43,9 +43,9 @@ describe("Secret V3 Router", async () => {
const { user: userInfo } = JSON.parse(userInfoRes.payload);
const privateKey = await getUserPrivateKey(seedData1.password, userInfo);
projectKey = decryptAsymmetric({
ciphertext: projectKeyEnc.encryptedKey,
nonce: projectKeyEnc.nonce,
publicKey: projectKeyEnc.sender.publicKey,
ciphertext: projectKeyEncryptionDetails.encryptedKey,
nonce: projectKeyEncryptionDetails.nonce,
publicKey: projectKeyEncryptionDetails.sender.publicKey,
privateKey
});

Expand Down
2 changes: 1 addition & 1 deletion backend/src/db/seed-data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ export const seedData1 = {
machineIdentity: {
id: "88fa7aed-9288-401e-a4c9-fa9430be62a0",
name: "mac1",
clientCred: {
clientCredentials: {
id: "3f6135db-f237-421d-af66-a8f4e80d443b",
secret: "da35a5a5a7b57f977a9a73394506e878a7175d06606df43dc93e1472b10cf339"
}
Expand Down
6 changes: 3 additions & 3 deletions backend/src/db/seeds/4-machine-identity.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export async function seed(knex: Knex): Promise<void> {
.insert([
{
identityId: seedData1.machineIdentity.id,
clientId: seedData1.machineIdentity.clientCred.id,
clientId: seedData1.machineIdentity.clientCredentials.id,
clientSecretTrustedIps: JSON.stringify([
{
type: "ipv4",
Expand Down Expand Up @@ -54,15 +54,15 @@ export async function seed(knex: Knex): Promise<void> {
}
])
.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([
{
identityUAId: identityUa[0].id,
description: "",
clientSecretTTL: 0,
clientSecretNumUses: 0,
clientSecretNumUsesLimit: 0,
clientSecretPrefix: seedData1.machineIdentity.clientCred.secret.slice(0, 4),
clientSecretPrefix: seedData1.machineIdentity.clientCredentials.secret.slice(0, 4),
clientSecretHash,
isClientSecretRevoked: false
}
Expand Down

0 comments on commit 678306b

Please sign in to comment.