mirror of
https://github.com/hanzokms/go-sdk.git
synced 2026-10-30 19:44:54 +00:00
- Module path: github.com/infisical/go-sdk -> github.com/hanzokms/go-sdk - Package name: infisical -> kms - Types: InfisicalClient -> Client, NewInfisicalClient -> NewClient - Default URL: app.infisical.com -> kms.hanzo.ai - Env vars: INFISICAL_ prefix -> KMS_ prefix - User agent: infisical-go-sdk -> hanzo-kms-go-sdk - Copyright: Hanzo AI Inc. - go build ./... passes clean
34 lines
1023 B
Go
34 lines
1023 B
Go
package api
|
|
|
|
import (
|
|
"github.com/go-resty/resty/v2"
|
|
"github.com/hanzokms/go-sdk/packages/errors"
|
|
)
|
|
|
|
const callGetDynamicSecretLeaseByIdV1Operation = "CallGetDynamicSecretLeaseByIdV1"
|
|
|
|
func CallGetByDynamicSecretByIdLeaseV1(httpClient *resty.Client, request GetDynamicSecretLeaseByIdV1Request) (GetDynamicSecretLeaseByIdV1Response, error) {
|
|
|
|
getByIdResponse := GetDynamicSecretLeaseByIdV1Response{}
|
|
|
|
req := httpClient.R().
|
|
SetResult(&getByIdResponse).
|
|
SetQueryParams(map[string]string{
|
|
"projectSlug": request.ProjectSlug,
|
|
"environmentSlug": request.EnvironmentSlug,
|
|
"path": request.SecretPath,
|
|
})
|
|
|
|
res, err := req.Get("/v1/dynamic-secrets/leases/" + request.LeaseId)
|
|
|
|
if err != nil {
|
|
return GetDynamicSecretLeaseByIdV1Response{}, errors.NewRequestError(callGetDynamicSecretLeaseByIdV1Operation, err)
|
|
}
|
|
|
|
if res.IsError() {
|
|
return GetDynamicSecretLeaseByIdV1Response{}, errors.NewAPIErrorWithResponse(callGetDynamicSecretLeaseByIdV1Operation, res)
|
|
}
|
|
|
|
return getByIdResponse, nil
|
|
}
|