You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@openwhisk.apache.org by GitBox <gi...@apache.org> on 2019/10/29 09:44:40 UTC

[GitHub] [openwhisk-client-go] ukulililixl opened a new issue #131: How can I specify "--insecure" using this library?

ukulililixl opened a new issue #131: How can I specify "--insecure" using this library?
URL: https://github.com/apache/openwhisk-client-go/issues/131
 
 
   I install openwhisk in ubuntu in my own computer and I can access it using `wsk -i ......`. However, I have problems using this library to access openwhisk.
   
   For example:
   I can run the following command to list all the actions I have created in openwhisk.
   `wsk -i action list`
   The output is 
   ```
   actions
   /guest/test                                                          private blackbox
   ```
   However, when I try to do the same thing in a GO program using this library, something wrong happens. Here are my codes:
   ```
   config := &whisk.Config{
                   Host: "http://172.17.0.1",
   		Version: "v1",
   		Verbose: true,
   		Namespace: "_",
   		AuthToken: "23bc46b1-71f6-4ed5-8c54-816aa4f8c502:123zO3xZCLrMN6v2BKK1dXYFpXlPkccOFqm12CdAsMgRU4VrNZ9lyGVCGuMDGIwP",
   		Debug: true,
   		Insecure: true,
   	}
   client, err := whisk.NewClient(http.DefaultClient, config)
   
   if err != nil {
   	fmt.Println(err)
   	os.Exit(-1)
   }
   
   options := &whisk.ActionListOptions{
           Limit: 30,
     	Skip: 0,
   }
   
   actions, resp, err := client.Actions.List("",options)
   if err != nil {
           fmt.Println(err)
           os.Exit(-1)
   }
   fmt.Println("Returned with status: ", resp.Status)
   fmt.Println("Returned actions: \n%+v", actions)
   ```
   The error message is:
   ```
   The resource requires authentication, which was not supplied with the request (code df76048ef1abc23514e2a73aa26c910b)
   ```
   
   I wonder if I did something wrong in the GO program. Thanks!

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services