Return workspaceId in response for service token key copy

This commit is contained in:
Tuan Dang
2023-09-29 11:16:12 +01:00
parent c65a53f1f7
commit 8a576196a3
2 changed files with 4 additions and 3 deletions
@@ -213,7 +213,7 @@ export const getSecretByNameRaw = async (req: Request, res: Response) => {
workspaceId: new Types.ObjectId(workspaceId), workspaceId: new Types.ObjectId(workspaceId),
environment, environment,
secretPath, secretPath,
acceptedPermissions: [Permission.READ] acceptedPermissions: [Permission.READ, Permission.READ_WRITE]
}); });
break; break;
} }
@@ -633,7 +633,7 @@ export const getSecretByName = async (req: Request, res: Response) => {
workspaceId: new Types.ObjectId(workspaceId), workspaceId: new Types.ObjectId(workspaceId),
environment, environment,
secretPath, secretPath,
acceptedPermissions: [Permission.READ] acceptedPermissions: [Permission.READ, Permission.READ_WRITE]
}); });
break; break;
} }
@@ -40,11 +40,12 @@ export const getServiceTokenDataKey = async (req: Request, res: Response) => {
message: "Failed to find project key for service token" message: "Failed to find project key for service token"
}); });
const { _id, encryptedKey, nonce, sender: { publicKey } } = key; const { _id, workspace, encryptedKey, nonce, sender: { publicKey } } = key;
return res.status(200).send({ return res.status(200).send({
key: { key: {
_id, _id,
workspace,
encryptedKey, encryptedKey,
publicKey, publicKey,
nonce nonce