apache / apache/openwhisk-client-go

How can I specify "--insecure" using this library?

Open
#131 3 comments 0 reactions 0 assignees View on GitHub
Dominant language
Go
Stars
37
Forks
44
PR merge metrics
No merged PRs in 30d

Description

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!

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.