Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions packages/api/secrets/models.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ type RetrieveSecretV3RawRequest struct {
SecretPath string `json:"secretPath,omitempty"`
Type string `json:"type,omitempty"`
IncludeImports bool `json:"include_imports"`
Version int `json:"version"`
}

type RetrieveSecretV3RawResponse struct {
Expand Down
6 changes: 6 additions & 0 deletions packages/api/secrets/retrieve_secret.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,11 @@ func CallRetrieveSecretV3(httpClient *resty.Client, request RetrieveSecretV3RawR
request.SecretPath = "/"
}

var version string
if request.Version > 0 {
version = fmt.Sprintf("%d", request.Version)
}

req := httpClient.R().
SetResult(&retrieveResponse).
SetQueryParams(map[string]string{
Expand All @@ -29,6 +34,7 @@ func CallRetrieveSecretV3(httpClient *resty.Client, request RetrieveSecretV3RawR
"secretPath": request.SecretPath,
"include_imports": fmt.Sprintf("%t", request.IncludeImports),
"type": request.Type,
"version": version,
})

res, err := req.Get(fmt.Sprintf("/v3/secrets/raw/%s", request.SecretKey))
Expand Down