diff options
author | Niall Sheridan <nsheridan@gmail.com> | 2016-10-16 16:47:09 +0100 |
---|---|---|
committer | Niall Sheridan <nsheridan@gmail.com> | 2016-10-17 12:39:09 +0100 |
commit | a427038700c0f1c080090a8158c1a793923aa03c (patch) | |
tree | 1309e201063f16e75266e571ea1733ce5eb49ce5 /server/config/testdata | |
parent | d6d54ed0bcf3b583fe681db790740cef137401d3 (diff) |
Unmarshal the config using mapstructure directly.
Avoid unmarshalling into an intermediate struct.
Better tests.
Diffstat (limited to 'server/config/testdata')
-rw-r--r-- | server/config/testdata/config.go | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/server/config/testdata/config.go b/server/config/testdata/config.go new file mode 100644 index 0000000..27cffcc --- /dev/null +++ b/server/config/testdata/config.go @@ -0,0 +1,48 @@ +package testdata + +var Config = []byte(` + server { + use_tls = true + tls_key = "server.key" + tls_cert = "server.crt" + address = "127.0.0.1" + port = 443 + user = "nobody" + cookie_secret = "supersecret" + csrf_secret = "supersecret" + http_logfile = "cashierd.log" + datastore = "mysql:user:passwd:localhost:3306" + database { + type = "mysql" + username = "user" + password = "passwd" + address = "localhost:3306" + } + datastore = "mysql:user:passwd:localhost:3306" + } + auth { + provider = "google" + oauth_client_id = "client_id" + oauth_client_secret = "secret" + oauth_callback_url = "https://sshca.example.com/auth/callback" + provider_opts { + domain = "example.com" + } + users_whitelist = ["a_user"] + } + ssh { + signing_key = "signing_key" + additional_principals = ["ec2-user", "ubuntu"] + max_age = "720h" + permissions = ["permit-pty", "permit-X11-forwarding", "permit-port-forwarding", "permit-user-rc"] + } + aws { + region = "us-east-1" + access_key = "abcdef" + secret_key = "omg123" + } + vault { + address = "https://vault:8200" + token = "abc-def-456-789" + } +`) |