1
0
Fork 0
mirror of https://github.com/Luzifer/nginx-sso.git synced 2024-10-18 15:44:21 +00:00
nginx-sso/vendor/github.com/jda/go-crowd/base_test.go
Knut Ahlers 6fa934880e
Implement Crowd authentication (#2)
* Re-add example configuration for Crowd
* Implement Crowd authentication
* Fix: Some errors just mean there is no user
* Document crowd provider
* Vendor new dependencies
* Reduce error messages: Check for config details
2018-02-04 14:51:08 +01:00

40 lines
704 B
Go

package crowd
import (
"os"
"testing"
)
type TestVars struct {
AppUsername string
AppPassword string
AppURL string
}
// Make sure we have the env vars to run, handle bailing if we don't
func PrepVars(t *testing.T) TestVars {
var tv TestVars
appU := os.Getenv("APP_USERNAME")
if appU == "" {
t.Skip("Can't run test because APP_USERNAME undefined")
} else {
tv.AppUsername = appU
}
appP := os.Getenv("APP_PASSWORD")
if appP == "" {
t.Skip("Can't run test because APP_PASSWORD undefined")
} else {
tv.AppPassword = appP
}
appURL := os.Getenv("APP_URL")
if appURL == "" {
t.Skip("Can't run test because APP_URL undefined")
} else {
tv.AppURL = appURL
}
return tv
}