diff --git a/backend/src/controllers/v2/serviceTokenDataController.ts b/backend/src/controllers/v2/serviceTokenDataController.ts index 471ac1f3f..304311da7 100644 --- a/backend/src/controllers/v2/serviceTokenDataController.ts +++ b/backend/src/controllers/v2/serviceTokenDataController.ts @@ -53,7 +53,7 @@ export const getServiceTokenData = async (req: Request, res: Response) => { req.authData.authPayload._id ) .select("+encryptedKey +iv +tag") - .populate("user"); + .populate("user").lean(); return res.status(200).json(serviceTokenData); }; diff --git a/cli/packages/api/model.go b/cli/packages/api/model.go index 7de7a962b..954982dc9 100644 --- a/cli/packages/api/model.go +++ b/cli/packages/api/model.go @@ -188,7 +188,7 @@ type GetServiceTokenDetailsResponse struct { Tag string `json:"tag"` CreatedAt time.Time `json:"createdAt"` UpdatedAt time.Time `json:"updatedAt"` - V int `json:"__v"` + SecretPath string `json:"secretPath"` } type GetAccessibleEnvironmentsRequest struct { diff --git a/cli/packages/util/secrets.go b/cli/packages/util/secrets.go index eef691fdc..3f742372f 100644 --- a/cli/packages/util/secrets.go +++ b/cli/packages/util/secrets.go @@ -37,6 +37,7 @@ func GetPlainTextSecretsViaServiceToken(fullServiceToken string) ([]models.Singl encryptedSecrets, err := api.CallGetSecretsV3(httpClient, api.GetEncryptedSecretsV3Request{ WorkspaceId: serviceTokenDetails.Workspace, Environment: serviceTokenDetails.Environment, + SecretPath: serviceTokenDetails.SecretPath, }) if err != nil {