mirror of
https://github.com/openfaas/faas.git
synced 2025-06-17 12:46:59 +00:00
Initial support for secrets in gw:
- added SecretHandler type - added discussed system/secret endpoint with appropriate http verbs Signed-off-by: Andrew Cornies <acornies@gmail.com>
This commit is contained in:
parent
1261aadebe
commit
d2ef8b9207
@ -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
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user