Comments (8)
@brunowego I'm not sure if your error is the same. In general the OpenWhisk API key is not available to action unless you ask for it. You do this by adding the appropriate annotation on the action. See https://github.com/apache/openwhisk/blob/master/docs/annotations.md#annotations-for-all-actions
If your function is performing OpenWhisk API calls, it will need the API key and so you'll need the annotation or provide your key explicitly.
from openwhisk-catalog.
Thanks @rabbah.
After add provide-api-key
works. Thanks again.
wsk action update contact/submit ./contact/submit.js \
-a provide-api-key true \
--web true \
-i
from openwhisk-catalog.
Hi @Reylak. Thanks for the bug report.
I guess the annotation provide-api-key should read true?
Yes. This value should be set by the installation script but I don't see it. Hmm.
EDIT: it looks like we don't run countdown
in the test suite. The annotation must be added here:
openwhisk-catalog/packages/samples/manifest.yaml
Lines 51 to 62 in 8a54065
from openwhisk-catalog.
I don't know where does this value of false comes from though.
This is added by default for all newly created actions (by the backend controller).
from openwhisk-catalog.
@rabbah I'm get same issue here. Any tip? Thanks.
$ wsk action get contact/submit -i
ok: got action contact/submit
{
"namespace": "guest/contact",
"name": "submit",
"version": "0.0.1",
"exec": {
"kind": "nodejs:10",
"binary": false
},
"annotations": [
{
"key": "web-export",
"value": true
},
{
"key": "raw-http",
"value": false
},
{
"key": "final",
"value": true
},
{
"key": "provide-api-key",
"value": false
},
{
"key": "exec",
"value": "nodejs:10"
}
],
"limits": {
"timeout": 60000,
"memory": 256,
"logs": 10,
"concurrency": 1
},
"publish": false
}
$ wsk action invoke contact/submit \
-p name 'Bruno Wego' \
-p email '[email protected]' \
-p phone '1234567890' \
-r \
-i \
-v
REQUEST:
[POST] https://openwhisk.192.168.64.2.nip.io:443/api/v1/namespaces/_/actions/contact/submit?blocking=true&result=true
Req Headers
{
"Authorization": [
"Basic MjNiYzQ2YjEtNzFmNi00ZWQ1LThjNTQtODE2YWE0ZjhjNTAyOjEyM3pPM3haQ0xyTU42djJCS0sxZFhZRnBYbFBrY2NPRnFtMTJDZEFzTWdSVTRWck5aOWx5R1ZDR3VNREdJd1A="
],
"Content-Type": [
"application/json"
],
"User-Agent": [
"OpenWhisk-CLI/1.0 (not set) darwin amd64"
]
}
Req Body
{"email":"[email protected]","name":"Bruno Wego","phone":1234567890}
RESPONSE:Got response with code 502
Resp Headers
{
"Access-Control-Allow-Headers": [
"Authorization, Origin, X-Requested-With, Content-Type, Accept, User-Agent"
],
"Access-Control-Allow-Methods": [
"GET, DELETE, POST, PUT, HEAD"
],
"Access-Control-Allow-Origin": [
"*"
],
"Connection": [
"keep-alive"
],
"Content-Length": [
"113"
],
"Content-Type": [
"application/json"
],
"Date": [
"Tue, 01 Oct 2019 01:36:30 GMT"
],
"Server": [
"openresty/1.15.8.1"
],
"X-Openwhisk-Activation-Id": [
"0989abe2a71b404a89abe2a71bb04a94"
],
"X-Request-Id": [
"10bbbb0a0b9da5daf33902a1b4e9d11e"
]
}
Response body size is 113 bytes
Response body received:
{"error":"An error has occurred: Error: Invalid constructor options. Missing api_key parameter or token plugin."}
{
"error": "An error has occurred: Error: Invalid constructor options. Missing api_key parameter or token plugin."
}
from openwhisk-catalog.
This [
provide-api-key: false
] is added by default for all newly created actions (by the backend controller).
This makes sense, and is indeed reflected in this doc about Annotations. Cited below:
provide-api-key
: This annotation may be attached to actions which require an API key [...]. The absence of this annotation, or its presence with a value that is not falsy ([...]) will cause an API key to be present in the action execution context. This annotation is added to newly created actions, if not already specified, with a default false value.
(emphasis mine)
I misunderstood this paragraph at first because I stopped at the bold part. Maybe this could be rephrased?
from openwhisk-catalog.
Want to suggest alternate wording or open a PR?
from openwhisk-catalog.
Fixed in #310
from openwhisk-catalog.
Related Issues (20)
- fix doc for textToSpeech HOT 1
- update weather package docs to show how to package refresh
- Github triggers is hardcoded to use whisk api on host openwhisk.ng.bluemix.net HOT 2
- catalog actions are installed with 256MB memory limit HOT 2
- Catalog tests do not compile against master.
- slack post action have channel parameter as required it should be optional
- Description not clear for combinator eca iff HOT 3
- The weather action forecast hard codes the host value HOT 1
- Could not determine the dependencies of task ':whisktests:test'. HOT 1
- create new wskdeploy system action and package HOT 1
- Replace the binary Wsk with REST interface WskRest HOT 2
- run websocket test locally in Travis
- Github is failing to clean up webhooks during DELETE lifecycle HOT 1
- Feature Request: Consistency across sample parameter names for actions HOT 1
- A list of source files missing Apache license headers HOT 1
- Install catalog with wskdeploy HOT 2
- Slack package: Posted attachments do not show up in Slack HOT 2
- catalog installation is dependent on nodejs:6 for node actions
- Add a new parameter to GitHub webhook feed in order to allow usage with GitHub Enterprise HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from openwhisk-catalog.