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

View File

@@ -213,7 +213,7 @@ export const getSecretByNameRaw = async (req: Request, res: Response) => {
workspaceId: new Types.ObjectId(workspaceId),
environment,
secretPath,
acceptedPermissions: [Permission.READ]
acceptedPermissions: [Permission.READ, Permission.READ_WRITE]
});
break;
}
@@ -633,7 +633,7 @@ export const getSecretByName = async (req: Request, res: Response) => {
workspaceId: new Types.ObjectId(workspaceId),
environment,
secretPath,
acceptedPermissions: [Permission.READ]
acceptedPermissions: [Permission.READ, Permission.READ_WRITE]
});
break;
}

View File

@@ -40,11 +40,12 @@ export const getServiceTokenDataKey = async (req: Request, res: Response) => {
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({
key: {
_id,
workspace,
encryptedKey,
publicKey,
nonce