Skip to content
Snippets Groups Projects
Commit d2ef8b92 authored by Andrew Cornies's avatar Andrew Cornies Committed by Alex Ellis
Browse files

Initial support for secrets in gw:

- added SecretHandler type
- added discussed system/secret endpoint with appropriate http verbs

Signed-off-by: default avatarAndrew Cornies <acornies@gmail.com>
parent 1261aade
No related branches found
No related tags found
No related merge requests found
......@@ -89,6 +89,7 @@ func main() {
faasHandlers.UpdateFunction = handlers.MakeForwardingProxyHandler(reverseProxy, forwardingNotifiers, urlResolver, nilURLTransformer)
faasHandlers.QueryFunction = handlers.MakeForwardingProxyHandler(reverseProxy, forwardingNotifiers, urlResolver, nilURLTransformer)
faasHandlers.InfoHandler = handlers.MakeInfoHandler(handlers.MakeForwardingProxyHandler(reverseProxy, forwardingNotifiers, urlResolver, nilURLTransformer))
faasHandlers.SecretHandler = handlers.MakeForwardingProxyHandler(reverseProxy, forwardingNotifiers, urlResolver, nilURLTransformer)
alertHandler := plugin.NewExternalServiceQuery(*config.FunctionsProviderURL, credentials)
faasHandlers.Alert = handlers.MakeAlertHandler(alertHandler)
......@@ -127,6 +128,8 @@ func main() {
auth.DecorateWithBasicAuth(faasHandlers.InfoHandler, credentials)
faasHandlers.AsyncReport =
auth.DecorateWithBasicAuth(faasHandlers.AsyncReport, credentials)
faasHandlers.SecretHandler =
auth.DecorateWithBasicAuth(faasHandlers.SecretHandler, credentials)
}
r := mux.NewRouter()
......@@ -160,6 +163,8 @@ func main() {
r.HandleFunc("/system/functions", faasHandlers.UpdateFunction).Methods(http.MethodPut)
r.HandleFunc("/system/scale-function/{name:[-a-zA-Z_0-9]+}", faasHandlers.ScaleFunction).Methods(http.MethodPost)
r.HandleFunc("/system/secrets", faasHandlers.SecretHandler).Methods(http.MethodGet, http.MethodPut, http.MethodPost)
if faasHandlers.QueuedProxy != nil {
r.HandleFunc("/async-function/{name:[-a-zA-Z_0-9]+}/", faasHandlers.QueuedProxy).Methods(http.MethodPost)
r.HandleFunc("/async-function/{name:[-a-zA-Z_0-9]+}", faasHandlers.QueuedProxy).Methods(http.MethodPost)
......
......@@ -26,4 +26,7 @@ type HandlerSet struct {
// InfoHandler provides version and build info
InfoHandler http.HandlerFunc
// SecretHandler allows secrets to be managed
SecretHandler http.HandlerFunc
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment