MCPcopy Create free account
hub / github.com/openfaas/faasd / makeBasicAuthFiles

Function makeBasicAuthFiles

cmd/up.go:137–158  ·  view source on GitHub ↗
(wd string)

Source from the content-addressed store, hash-verified

135}
136
137func makeBasicAuthFiles(wd string) error {
138
139 pwdFile := path.Join(wd, "basic-auth-password")
140 authPassword, err := password.Generate(63, 10, 0, false, true)
141
142 if err != nil {
143 return err
144 }
145
146 err = makeFile(pwdFile, authPassword)
147 if err != nil {
148 return err
149 }
150
151 userFile := path.Join(wd, "basic-auth-user")
152 err = makeFile(userFile, "admin")
153 if err != nil {
154 return err
155 }
156
157 return nil
158}
159
160// makeFile will create a file with the specified content if it does not exist yet.
161// if the file already exists, the method is a noop.

Callers 2

runUpFunction · 0.85
runInstallFunction · 0.85

Calls 1

makeFileFunction · 0.85

Tested by

no test coverage detected