By sebrem
One can secure their Functions via UI Settings -tab: the option Secure Web Function can be enabled. However, when re-deploying the function via doctl, the Secure Web Function (or any other) setting doesn’t persist.
The relating properties are available in the function metadata annotations which can be obtained via cmd doctl serverless functions get demo/test_auth for an already existing function:
{
"annotations": [
{
"key": "web-export",
"value": true
},
...,
{
"key": "raw-http",
"value": false
},
{
"key": "provide-api-key",
"value": false
},
{
"key": "require-whisk-auth",
"value": false
},
{
"key": "exec",
"value": "python:3.9"
}
],
...
How to configure the “Raw HTTP”, “Secure Web Function”, etc., settings in the project.yml, what are the correct field names? I’ve tried the snippet below as my project.yml, with no luck:
packages:
- name: demo
actions:
- name: test_auth
annotations:
require-whisk-auth: true
raw-http: true
runtime: 'python:default'
limits:
timeout: 12000
memory: 128
Thanks in advance!
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
I have the same question. I am also not able to find all config properties in the documentation.
@sebrem, did you ever solve this? I am in a similar position where I want to disable web access (and use scheduling instead), but each time I deploy my functions, it re-enables web access.
Here is my project.yml
parameters: {}
environment: {}
packages:
- name: orders
shared: false
environment: {}
parameters: {}
annotations: {}
functions:
- name: check
binary: false
main: ""
runtime: go:default
web: false
parameters: {}
environment: {}
annotations: {}
limits:
timeout: 5000
Thanks in advance.
The Nimbella docs is a great reference when it comes to the serverless configuration file. It’s a shame DigitalOcean doesn’t make it clear that this is the underlying service that powers DigitalOcean Functions. Just keep in mind that DigitalOcean has renamed the actions: section with functions:
This section specifically explains how the webSecure property can be used: https://docs.nimbella.com/wsk#project-configuration.
In its simplest form:
packages:
- name: payments
functions:
- name: pay
runtime: nodejs:14
webSecure: 'myVerySecretSecret'
Cheers, Malcolm
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.