mirror of
https://github.com/openfaas/faas.git
synced 2025-06-20 23:46:36 +00:00
Read secrets from variable path
This change enables secrets to be read from any mount on disk rather than hard-coding a certain location which suits Swarm or K8s. The default value if not specified will look in the Swarm location of /run/secrets/ README.md (docs) updated and set to off by default. Signed-off-by: Alex Ellis (VMware) <alexellis2@gmail.com>
This commit is contained in:
committed by
Alex Ellis
parent
a38931ce69
commit
8133414183
@ -5,6 +5,8 @@ import (
|
||||
"net/http"
|
||||
"net/http/httptest"
|
||||
"testing"
|
||||
|
||||
"github.com/openfaas/faas/gateway/types"
|
||||
)
|
||||
|
||||
func Test_AuthWithValidPassword_Gives200(t *testing.T) {
|
||||
@ -18,7 +20,7 @@ func Test_AuthWithValidPassword_Gives200(t *testing.T) {
|
||||
wantPassword := "password"
|
||||
r := httptest.NewRequest(http.MethodGet, "http://localhost:8080", nil)
|
||||
r.SetBasicAuth(wantUser, wantPassword)
|
||||
wantCredentials := &BasicAuthCredentials{
|
||||
wantCredentials := &types.BasicAuthCredentials{
|
||||
User: wantUser,
|
||||
Password: wantPassword,
|
||||
}
|
||||
@ -47,7 +49,7 @@ func Test_AuthWithInvalidPassword_Gives403(t *testing.T) {
|
||||
r := httptest.NewRequest(http.MethodGet, "http://localhost:8080", nil)
|
||||
r.SetBasicAuth(wantUser, wantPassword)
|
||||
|
||||
wantCredentials := &BasicAuthCredentials{
|
||||
wantCredentials := &types.BasicAuthCredentials{
|
||||
User: wantUser,
|
||||
Password: "",
|
||||
}
|
||||
|
Reference in New Issue
Block a user