diff options
author | Niall Sheridan <nsheridan@gmail.com> | 2016-10-04 14:37:01 -0700 |
---|---|---|
committer | Niall Sheridan <nsheridan@gmail.com> | 2016-10-06 22:02:39 -0500 |
commit | 17cd70cea546e287713a3d4c086528a85abefa2e (patch) | |
tree | f52ffa10f2065c47445bd6c37f07a57f68074100 /cmd/cashierd | |
parent | 294020406c257ad4eb1867a1e7fb8b694aefddd2 (diff) |
Add support for Hashicorp Vault
Vault is supported for the following:
As a well-known filesystem for TLS cert, TLS key and SSH signing key.
For configuration secrets for cookie_secret, csrf_secret, oauth_client_id and oauth_client_secret options.
Diffstat (limited to 'cmd/cashierd')
-rw-r--r-- | cmd/cashierd/main.go | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/cmd/cashierd/main.go b/cmd/cashierd/main.go index 563f4fd..de8b45f 100644 --- a/cmd/cashierd/main.go +++ b/cmd/cashierd/main.go @@ -28,13 +28,14 @@ import ( "github.com/nsheridan/cashier/server/auth" "github.com/nsheridan/cashier/server/auth/github" "github.com/nsheridan/cashier/server/auth/google" - "github.com/nsheridan/cashier/server/certutil" "github.com/nsheridan/cashier/server/config" - "github.com/nsheridan/cashier/server/fs" "github.com/nsheridan/cashier/server/signer" "github.com/nsheridan/cashier/server/static" "github.com/nsheridan/cashier/server/store" "github.com/nsheridan/cashier/server/templates" + "github.com/nsheridan/cashier/server/util" + "github.com/nsheridan/cashier/server/wkfs/s3fs" + "github.com/nsheridan/cashier/server/wkfs/vaultfs" "github.com/sid77/drop" ) @@ -167,7 +168,7 @@ func signHandler(a *appContext, w http.ResponseWriter, r *http.Request) (int, er } json.NewEncoder(w).Encode(&lib.SignResponse{ Status: "ok", - Response: certutil.GetPublicKey(cert), + Response: util.GetPublicKey(cert), }) return http.StatusOK, nil } @@ -333,7 +334,10 @@ func main() { log.Fatal(err) } - fs.Register(config.AWS) + // Register well-known filesystems. + s3fs.Register(config.AWS) + vaultfs.Register(config.Vault) + signer, err := signer.New(config.SSH) if err != nil { log.Fatal(err) @@ -378,7 +382,7 @@ func main() { case "github": authprovider, err = github.New(config.Auth) default: - log.Fatalln("Unknown provider %s", config.Auth.Provider) + log.Fatalf("Unknown provider %s\n", config.Auth.Provider) } if err != nil { log.Fatal(err) |