Closed ewilde closed 2 years ago
Hi Ed,
Thanks for the instructions
Does your example need to have a namespace configurable?
resp, err := http.Get("http://gateway:8080/certificates/callback")
This address on Kubernetes will be: gateway.openfaas
(was it tested on Kubernetes?)
I'd like a CLI command to run to deploy the functions too for easy testing i.e.
git clone https://
faas-cli deploy --filter fn-x
Alex
@alexellis test instructions updated to include faas deploy
etc... Please see section above With signing keys configured (new way) on k8s
Resolves #48
PRs that should be merged first:
Testing
With signing keys configured (new way) on docker swarm
curl http://localhost:8080/async-function/echo -d 'hello' -H "X-Callback-Url: http://gateway:8080/function/verify-go"
Tail the logs of nats-queue-worker
☝️ notice the Posted result is 200
Tail the logs of the verifier function
2019/03/15 22:27:58 Verified OK
Http signatures disabled. Warning callback messages will not be signed missing private key: /run/secrets/http-signing-private-key Loading basic authentication credentials Connect: nats://nats:4222 Subscribing to: faas-request at nats://nats:4222 Wait for 5m5s Listening on [faas-request], clientID=[faas-worker-94731c9f0ecc], qgroup=[faas] durable=[]
[#2] Received on [faas-request]: 'sequence:2 subject:"faas-request" data:"{\"Header\":{\"Accept\":[\"/\"],\"Content-Length\":[\"5\"],\"Content-Type\":[\"application/x-www-form-urlencoded\"],\"User-Agent\":[\"curl/7.54.0\"],\"X-Call-Id\":[\"5a7e70e2-8aa5-4da0-b44c-6b2f68218bff\"],\"X-Callback-Url\":[\"http://gateway:8080/function/verify-go\"],\"X-Start-Time\":[\"1552689418027066400\"]},\"Host\":\"localhost:8080\",\"Body\":\"aGVsbG8=\",\"Method\":\"POST\",\"Path\":\"\",\"QueryString\":\"\",\"Function\":\"echo\",\"CallbackUrl\":{\"Scheme\":\"http\",\"Opaque\":\"\",\"User\":null,\"Host\":\"gateway:8080\",\"Path\":\"/function/verify-go\",\"RawPath\":\"\",\"ForceQuery\":false,\"RawQuery\":\"\",\"Fragment\":\"\"}}" timestamp:1552689418027743800 ' Wrote 6 Bytes 200 OK Callback to: http://gateway:8080/function/verify-go Posted result: 200 Posting report - 202
!/usr/bin/env bash
cd tmp git clone git@github.com:ewilde/faas-netes.git cd faas-netes git checkout http-signatures
helm upgrade openfaas --install ./chart/openfaas --namespace openfaas --set functionNamespace=openfaas-fn --set http_signatures=true --set gateway.image=ewilde/gateway:http-signatures --set queueWorker.image=ewilde/http-signatures`
faas deploy -f https://raw.githubusercontent.com/ewilde/of-cloud-examples/k8s/verify-go.yml faas deploy -f https://raw.githubusercontent.com/ewilde/of-cloud-examples/k8s/echo.yml
[verify-go-67854bfb-d9kzk] (request-target): post /function/verify-go [verify-go-67854bfb-d9kzk] host: gateway.openfaas:8080 [verify-go-67854bfb-d9kzk] date: Sun, 07 Apr 2019 21:25:22 GMT [verify-go-67854bfb-d9kzk] content-type: application/x-www-form-urlencoded [verify-go-67854bfb-d9kzk] digest: SHA-256=WJG1tSLV3whtD/CxEPvZ0hu0/HFjrzTQgoai6Eb2vgM= [verify-go-67854bfb-d9kzk] content-length: 6 [verify-go-67854bfb-d9kzk] 2019/04/07 21:25:22 Public key: [verify-go-67854bfb-d9kzk] -----BEGIN PUBLIC KEY----- [verify-go-67854bfb-d9kzk] MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAuLzV66O5hAT2NJzwFJML [verify-go-67854bfb-d9kzk] ssOSdlKtErBrsWqzv1GTcy++TJ4/fBD3QuWf54vJYrVFTV7HEFtOE/Hcear2gVRo [verify-go-67854bfb-d9kzk] qgqL3oDA06rYnauHsxYewWyO0G2Z65L4grjNzdpd3aFRGKI6oBbS8UZ6baVvxO9w [verify-go-67854bfb-d9kzk] KEzCOf8/do4co3PjQ5JHh27bNgn8nxQ5sQRK2t4xBJcRFXhzPSVy3mWsdbsjsp12 [verify-go-67854bfb-d9kzk] Oc1RgT96+dmAfu11l06JE2a84E+E0d0rxLyRZYwCeLNRdt3FhFj4/KMrux+kNcQa [verify-go-67854bfb-d9kzk] KdUfI8oM6nGSVDNd54psx2sQJcufBE4y+KBOfI1Sm/oGUl6y0ujNUIbwSN4AXM8K [verify-go-67854bfb-d9kzk] aQIDAQAB [verify-go-67854bfb-d9kzk] -----END PUBLIC KEY----- [verify-go-67854bfb-d9kzk] [verify-go-67854bfb-d9kzk] 2019/04/07 21:25:22 Verified OK