Skip to content

Commit

Permalink
Initial commit of secrets w/ housekeeping:
Browse files Browse the repository at this point in the history
- updated vagrant provisioning process
- added vault approle commands
- added vault info types
- WIP token/login on startup
- Secret handler stub created

Signed-off-by: Andrew Cornies <acornies@gmail.com>
  • Loading branch information
acornies committed Jan 25, 2019
1 parent 0b9e5bf commit 57bd520
Show file tree
Hide file tree
Showing 13 changed files with 200 additions and 146 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ consul.hcl
nomad.hcl

.vagrant
.vscode
provisioning/saltstack/formulas*
ubuntu*.log
debug
Expand Down
29 changes: 0 additions & 29 deletions .vscode/launch.json

This file was deleted.

68 changes: 30 additions & 38 deletions Gopkg.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 10 additions & 2 deletions Gopkg.toml
Original file line number Diff line number Diff line change
@@ -1,19 +1,27 @@
[[constraint]]
name = "github.com/openfaas/faas"
version = "0.8.12"
version = "0.10.1"

[[constraint]]
name = "github.com/openfaas/faas-provider"
version = "0.7.1"
version = "0.8.1"

[[constraint]]
name = "github.com/hashicorp/nomad"
version = "0.7.0"

[[constraint]]
name = "github.com/hashicorp/vault"
version = "v0.9.6"

[[constraint]]
name = "github.com/stretchr/testify"
version = "1.1.4"

[[constraint]]
name = "github.com/mitchellh/mapstructure"
version = "v1.1.2"

[prune]
go-tests = true
unused-packages = true
12 changes: 9 additions & 3 deletions Vagrantfile
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ Vagrant.configure("2") do |config|
salt.verbose = true
salt.salt_call_args = ["saltenv=dev", "pillarenv=dev"]
end
override.vm.provision "shell", path: "provisioning/scripts/nomad_run.sh"
# override.vm.provision "shell", path: "provisioning/scripts/nomad_run.sh"
end

# vmware fusion
Expand All @@ -81,6 +81,8 @@ Vagrant.configure("2") do |config|
salt.verbose = true
salt.salt_call_args = ["saltenv=dev", "pillarenv=dev"]
end
# override.vm.provision "shell", path: "provisioning/scripts/nomad_run.sh"
override.vm.provision "shell", path: "provisioning/scripts/vault_populate.sh"
override.vm.provision "shell", path: "provisioning/scripts/nomad_run.sh"
end

Expand All @@ -95,7 +97,12 @@ Vagrant.configure("2") do |config|
salt.verbose = true
salt.salt_call_args = ["saltenv=dev", "pillarenv=dev"]
end
override.vm.provision "shell", path: "provisioning/scripts/nomad_run.sh"
# override.vm.provision "shell", path: "provisioning/scripts/nomad_run.sh"
end

config.vm.provision :docker do |d|
d.run 'dev-vault', image: 'vault:0.9.6',
args: '-p 8200:8200 -e "VAULT_DEV_ROOT_TOKEN_ID=vagrant" -v /vagrant:/vagrant'
end
#
# View the documentation for the provider you are using for more
Expand All @@ -112,7 +119,6 @@ Vagrant.configure("2") do |config|
cd /vagrant/provisioning/saltstack/formulas
git clone https://github.com/tucows/nomad-formula.git
git clone https://github.com/tucows/consul-formula.git
git clone https://github.com/tucows/docker-formula.git
git clone https://github.com/tucows/vault-formula.git
SHELL

Expand Down
14 changes: 14 additions & 0 deletions handlers/secrets.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
package handlers

import (
"net/http"

"github.com/hashicorp/faas-nomad/types"
hclog "github.com/hashicorp/go-hclog"
vapi "github.com/hashicorp/vault/api"
)

func MakeSecretHandler(vaultClient *vapi.Client, logger hclog.Logger, providerConfig types.ProviderConfig) http.HandlerFunc {
return func(w http.ResponseWriter, r *http.Request) {
}
}
Loading

0 comments on commit 57bd520

Please sign in to comment.