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
33 lines
999 B
Go
33 lines
999 B
Go
package api
|
|
|
|
import (
|
|
"github.com/go-resty/resty/v2"
|
|
"github.com/hanzokms/go-sdk/packages/errors"
|
|
)
|
|
|
|
const callGetDynamicSecretByNameV1Operation = "CallGetDynamicSecretSecretByNameV1"
|
|
|
|
func CallGetDynamicSecretByNameV1(httpClient *resty.Client, request GetDynamicSecretByNameV1Request) (GetDynamicSecretByNameV1Response, error) {
|
|
|
|
getByNameResponse := GetDynamicSecretByNameV1Response{}
|
|
|
|
req := httpClient.R().
|
|
SetResult(&getByNameResponse).SetQueryParams(map[string]string{
|
|
"projectSlug": request.ProjectSlug,
|
|
"environmentSlug": request.EnvironmentSlug,
|
|
"path": request.SecretPath,
|
|
})
|
|
|
|
res, err := req.Get("/v1/dynamic-secrets/" + request.DynamicSecretName)
|
|
|
|
if err != nil {
|
|
return GetDynamicSecretByNameV1Response{}, errors.NewRequestError(callGetDynamicSecretByNameV1Operation, err)
|
|
}
|
|
|
|
if res.IsError() {
|
|
return GetDynamicSecretByNameV1Response{}, errors.NewAPIErrorWithResponse(callGetDynamicSecretByNameV1Operation, res)
|
|
}
|
|
|
|
return getByNameResponse, nil
|
|
}
|