예제 #1
0
파일: roll.go 프로젝트: xtraclabs/roll
func MariaDBSecureConfig() *roll.CoreConfig {
	return &roll.CoreConfig{
		AdminRepo:       mdb.NewMBDAdminRepo(),
		DeveloperRepo:   mdb.NewMBDDevRepo(),
		ApplicationRepo: mdb.NewMBDAppRepo(),
		SecretsRepo:     secretsrepos.NewVaultSecretsRepo(),
		IdGenerator:     new(rolltoken.UUIDIdGenerator),
		Secure:          true,
	}
}
예제 #2
0
파일: roll.go 프로젝트: xtraclabs/roll
func DefaultUnsecureConfig() *roll.CoreConfig {
	return &roll.CoreConfig{
		DeveloperRepo:   repos.NewDynamoDevRepo(),
		ApplicationRepo: repos.NewDynamoAppRepo(),
		AdminRepo:       repos.NewDynamoAdminRepo(),
		SecretsRepo:     secretsrepos.NewVaultSecretsRepo(),
		IdGenerator:     new(rolltoken.UUIDIdGenerator),
		Secure:          false,
	}
}
예제 #3
0
func main() {
	var port = flag.Int("port", -1, "Port to listen on")
	flag.Parse()
	if *port == -1 {
		fmt.Println("Must specify a -port argument")
		return
	}

	var whitelisted = readWhitelistClientIDFromEnv()

	mux := http.NewServeMux()
	mux.Handle("/echoclient", echoClientHandler())
	mux.Handle("/oauth2_callback", oauthCallbackHandler())
	mux.Handle("/echosvc", az.Wrap(secretsrepo.NewVaultSecretsRepo(), repos.NewDynamoAdminRepo(), []string{whitelisted}, echoServiceHandler()))
	http.ListenAndServe(fmt.Sprintf(":%d", *port), mux)
}