fix fetching secrets via service token

This commit is contained in:
Maidul Islam
2023-06-27 15:00:03 -04:00
parent f9d0e0d971
commit 798f091ff2
3 changed files with 3 additions and 2 deletions

View File

@ -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);
};

View File

@ -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 {

View File

@ -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 {