Skip to content

Commit eb82d0d

Browse files
Merge pull request #730 from prayas17/fix-key-encryption-in-collection
fix: llm encryption
2 parents bd589f0 + 2e377d8 commit eb82d0d

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/modules/workspace/services/collection-request.service.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1842,6 +1842,16 @@ export class CollectionRequestService {
18421842
const collectionData = await this.collectionReposistory.getCollection(
18431843
aiRequest.collectionId,
18441844
);
1845+
1846+
console.log("Collection: ", collection)
1847+
// Decrypt authValue in flat structure
1848+
if (collection?.aiRequest?.auth?.apiKey?.authValue) {
1849+
collection.aiRequest.auth.apiKey.authValue = this.encryptionService.decrypt(
1850+
String(collection.aiRequest.auth.apiKey.authValue),
1851+
);
1852+
}
1853+
1854+
18451855
const currentWorkspaceObject = new ObjectId(aiRequest.workspaceId);
18461856
const updateWorkspaceData: Partial<Workspace> = {
18471857
updatedAt: new Date(),

0 commit comments

Comments
 (0)