Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Getting dynamic secret value for Google Kubernetes Engine Dynamic Secret Returns Error #6

Open
pputman-clabs opened this issue Nov 25, 2022 · 1 comment

Comments

@pputman-clabs
Copy link

pputman-clabs commented Nov 25, 2022

I have a working dynamic secret of type Google Kubernetes Engine Dynamic Secret, that works in the web interface and responds with the token in the gui.

This is what i'm doing to pull out all dynamic secrets:

listOut, _, err := client.ListItems(context.Background()).
        Body(akeyless.ListItems{
            Token: akeyless.PtrString(authToken),
        }).Execute()
    if err != nil {
        log.Fatalln(err)
    }

    var akeylessItems []akeyless.Item
    for _, item := range listOut.GetItems() {
        if item.GetItemType() == "DYNAMIC_SECRET" {
                akeylessItems = append(akeylessItems, item)

        }
    }

And then I'm iterating over them, and calling Get Dynamic Secret Value to check the errors so we can easily see if for some reason one of them isn't responding:

 for _, item := range akeylessItems {
        t.Run("Test Dynamic Producer Response", func(t *testing.T) {
            value, resp, err := client.GetDynamicSecretValue(context.Background()).
                Body(akeyless.GetDynamicSecretValue{
                    Name:  item.GetItemName(),
                    Token: akeyless.PtrString(authToken),
                }).Execute()


            if err != nil {
            log.Println("error", err)
            log.Println("resp", resp)
            log.Println("type", *item.GetItemGeneralInfo().DynamicSecretProducerDetails.ProducerType)
            log.Println("producer name", item.GetItemName())
            log.Println("producer value", value)
            }
        })
    }

The log prints I have above are printing out the following for the Google Kubernetes Engine Dynamic Secret


2022/11/24 18:10:39 error json: cannot unmarshal object into Go value of type string
2022/11/24 18:10:39 resp &{200 OK 200 HTTP/2.0 2 0 map[Access-Control-Allow-Origin:[*] Cache-Control:[no-cache, no-store, must-revalidate, private] Content-Type:[application/json] Date:[Fri, 25 Nov 2022 00:10:39 GMT] Expires:[0] Pragma:[no-cache] Strict-Transport-Security:[max-age=15724800; includeSubDomains] Vary:[Origin] X-Frame-Options:[SAMEORIGIN] X-Xss-Protection:[1; mode=block]] {0x1400017b200} -1 [] false false map[] 0x140002a6600 0x140001e80b0}
2022/11/24 18:10:39 type gke
2022/11/24 18:10:39 producer name /test/alvaro-gke/akeyless-dyn-secret-provision
2022/11/24 18:10:39 producer value map[apiVersion:client.authentication.k8s.io/v1beta1 clusterCACertificate:LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSURLakNDQWhLZ0F3SUJBZ0lRVHVsV2I1bUJteWJtb21QZVJrdHJrVEFOQmdrcWhraUc5dzBCQVFzRkFEQXYKTVMwd0t3WURWUVFERXlRMFlqQmtabVV4T0MwMFpXWTFMVFEwT1RBdE9XTTNaQzAwWXpjNE1HSXhPVFZsWlRNdwpIaGNOTWpFd09ERXdNRGN4TVRJNFdoY05Nall3T0RBNU1EZ3hNVEk0V2pBdk1TMHdLd1lEVlFRREVMzNxMC80ZGlzajFBVFBKN1EzQ1U1cmM3bnl3a3FBK2RZU2wrU2hERktWK2JsczEwcWxaNU5qYUlJeUVraHdycgpReVVYOElXeWNMbkl2SWJUSFJIemVDWDIveUJMNElRQkxoSUhVQkNER0FROHZJSmgzcVFPdnNUZWRiMWdyTFNPClE0cWw2dUNOVjlGOUxQSGZ4NnBuR21GUE05bXRlS0hPZXRkZkpNT01wSVJwOElORkU1bFkvcTJYQUR1a0luOG4KL3crVmFsYUlRVm5vaC9WNndNS0w4QUo0amhGNWtxT01ibnVRTmJSSVJWczZxNWhuOHBBMVc3ajMzR1RVWmc9PQotLS0tLUVORCBDRVJUSUZJQ0FURS0tLS0tCg== clusterEndpoint:https://34.82.179.218 clusterName:integration-tests clusterUsername:akeyless-secret-provision-test id:tmp.p-9a7ihbw62c3r.yqGBr kind:ExecCredential status: ttl_in_minutes:60]

And this is a screenshot showing it working properly in the webui:

image

I get no issue with all the other dynamic secret producers, they all print out everything properly with no errors, so far its been only this one, and it's the only one we have of this type, so I believe it's related to that.

@pputman-clabs
Copy link
Author

@akeyless-support

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant