Skip to content
This repository has been archived by the owner on Jan 8, 2024. It is now read-only.

Commit

Permalink
Fixed the import paths to match the original.
Browse files Browse the repository at this point in the history
  • Loading branch information
Kevin Stedman committed Oct 30, 2018
1 parent 76b6e2a commit 494e099
Show file tree
Hide file tree
Showing 22 changed files with 54 additions and 54 deletions.
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
FROM golang:1.10
ARG DEP_VERSION=v0.4.1
RUN curl -fsSL -o /usr/local/bin/dep https://github.com/golang/dep/releases/download/${DEP_VERSION}/dep-linux-amd64 && chmod +x /usr/local/bin/dep
WORKDIR /go/src/vault-gatekeeper/
WORKDIR /go/src/github.com/nemosupremo/vault-gatekeeper/
COPY ./ ./
RUN mkdir -p $GOPATH/pkg && dep ensure -v -vendor-only && \
CGO_ENABLED=0 go build -ldflags "-X main.BuildTime=`date -u '+%Y-%m-%d_%I:%M:%S%p'` -X main.Version=`git -C ./ describe --abbrev=0 --tags HEAD`" -a -installsuffix cgo -o dist/gatekeeper ./cmd/gatekeeper

FROM scratch
COPY --from=0 /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
COPY --from=0 /go/src/vault-gatekeeper/dist/gatekeeper /
COPY --from=0 /go/src/github.com/nemosupremo/vault-gatekeeper/dist/gatekeeper /
# Create the /tmp directory
WORKDIR /tmp
WORKDIR /
Expand Down
8 changes: 4 additions & 4 deletions cmd/gatekeeper/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ import (
"runtime"

// import schedulers before cmd
_ "vault-gatekeeper/scheduler/dcosee_mesos"
_ "vault-gatekeeper/scheduler/ecs"
_ "vault-gatekeeper/scheduler/mesos"
_ "github.com/nemosupremo/vault-gatekeeper/scheduler/dcosee_mesos"
_ "github.com/nemosupremo/vault-gatekeeper/scheduler/ecs"
_ "github.com/nemosupremo/vault-gatekeeper/scheduler/mesos"

"vault-gatekeeper/cmd"
"github.com/nemosupremo/vault-gatekeeper/cmd"
)

var (
Expand Down
8 changes: 4 additions & 4 deletions cmd/policy.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ import (
"net/url"
"os"

"vault-gatekeeper"
"vault-gatekeeper/policy"
"vault-gatekeeper/scheduler"
"vault-gatekeeper/vault"
"github.com/nemosupremo/vault-gatekeeper"
"github.com/nemosupremo/vault-gatekeeper/policy"
"github.com/nemosupremo/vault-gatekeeper/scheduler"
"github.com/nemosupremo/vault-gatekeeper/vault"

"github.com/franela/goreq"
log "github.com/sirupsen/logrus"
Expand Down
2 changes: 1 addition & 1 deletion cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"strings"
"time"

"vault-gatekeeper/scheduler"
"github.com/nemosupremo/vault-gatekeeper/scheduler"

"github.com/sirupsen/logrus"
"github.com/spf13/cobra"
Expand Down
6 changes: 3 additions & 3 deletions cmd/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ import (
"strings"
"time"

"vault-gatekeeper"
"vault-gatekeeper/scheduler"
"vault-gatekeeper/vault/unsealer"
"github.com/nemosupremo/vault-gatekeeper"
"github.com/nemosupremo/vault-gatekeeper/scheduler"
"github.com/nemosupremo/vault-gatekeeper/vault/unsealer"

"github.com/sirupsen/logrus"
"github.com/spf13/cobra"
Expand Down
2 changes: 1 addition & 1 deletion cmd/unseal.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package cmd
import (
"net/url"

"vault-gatekeeper/scheduler"
"github.com/nemosupremo/vault-gatekeeper/scheduler"

"github.com/franela/goreq"
log "github.com/sirupsen/logrus"
Expand Down
12 changes: 6 additions & 6 deletions gatekeeper.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@ import (
"sync/atomic"
"time"

gkClient "vault-gatekeeper/gatekeeper"
"vault-gatekeeper/policy"
"vault-gatekeeper/scheduler"
"vault-gatekeeper/usagestore"
"vault-gatekeeper/vault"
"vault-gatekeeper/vault/unsealer"
gkClient "github.com/nemosupremo/vault-gatekeeper/gatekeeper"
"github.com/nemosupremo/vault-gatekeeper/policy"
"github.com/nemosupremo/vault-gatekeeper/scheduler"
"github.com/nemosupremo/vault-gatekeeper/usagestore"
"github.com/nemosupremo/vault-gatekeeper/vault"
"github.com/nemosupremo/vault-gatekeeper/vault/unsealer"

"github.com/cenkalti/backoff"
"github.com/franela/goreq"
Expand Down
10 changes: 5 additions & 5 deletions gatekeeper_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ import (
"testing"
"time"

"vault-gatekeeper/policy"
"vault-gatekeeper/scheduler"
"vault-gatekeeper/scheduler/mock"
"vault-gatekeeper/vault"
"vault-gatekeeper/vault/unsealer"
"github.com/nemosupremo/vault-gatekeeper/policy"
"github.com/nemosupremo/vault-gatekeeper/scheduler"
"github.com/nemosupremo/vault-gatekeeper/scheduler/mock"
"github.com/nemosupremo/vault-gatekeeper/vault"
"github.com/nemosupremo/vault-gatekeeper/vault/unsealer"

"github.com/franela/goreq"
"github.com/segmentio/ksuid"
Expand Down
28 changes: 14 additions & 14 deletions policy.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ import (

log "github.com/sirupsen/logrus"

"vault-gatekeeper/policy"
"vault-gatekeeper/vault"
"github.com/nemosupremo/vault-gatekeeper/policy"
"github.com/nemosupremo/vault-gatekeeper/vault"

"github.com/franela/goreq"
)
Expand All @@ -35,28 +35,28 @@ func (g *Gatekeeper) loadPolicies() (*policy.Policies, error) {
func (g *Gatekeeper) GetPolicyConfig() ([]byte, error) {
initialPolicyDir := g.config.PolicyPath
policies := make(map[string]policy.Policy)
fmt.Printf("Policy Dir: %s\n", initialPolicyDir)
log.Debugf("Policy Dir: %s\n", initialPolicyDir)
if policyDirectories, err := g.getNestedPolicyDirs(initialPolicyDir, g.Token); err == nil {
for _, dir := range policyDirectories {
fmt.Printf("Dir: %s\n", dir)
log.Debugf("Dir: %s\n", dir)
if policy, err := getPolicy(dir, g.Token); err == nil {
fmt.Printf("Policies: %+v\n", policy)
log.Debugf("Policies: %+v\n", policy)
for k, v := range policy {
policies[k] = v
}
} else if err == policyNotFound {
fmt.Printf("%v\n", policyNotFound)
log.Warnf("%v\n", policyNotFound)
continue
} else {
return nil, err
}
}
} else {
fmt.Printf("Failed to find direcotries in %s\n", initialPolicyDir)
log.Errorf("Failed to find direcotries in %s\n", initialPolicyDir)
return nil, err
}

fmt.Printf("Policies: %+v\n", policies)
log.Debugf("Policies: %+v\n", policies)
if len(policies) == 0 {
return nil, policyNotFound
}
Expand All @@ -73,7 +73,7 @@ func (g *Gatekeeper) getNestedPolicyDirs(initialPolicyDir string, authToken stri

err := g.getDirList(initialPolicyDir, authToken, &nestedPolicyDirs, &subDirs)
if err != nil {
fmt.Printf("Error getting dir list: %v\n", err)
log.Errorf("Error getting dir list: %v\n", err)
return nestedPolicyDirs, err
}

Expand All @@ -95,7 +95,7 @@ func (g *Gatekeeper) getNestedPolicyDirs(initialPolicyDir string, authToken stri
}
}

fmt.Printf("Nested Policy Dirs: %+v\n", nestedPolicyDirs)
log.Debugf("Nested Policy Dirs: %+v\n", nestedPolicyDirs)

return nestedPolicyDirs, err
}
Expand Down Expand Up @@ -124,7 +124,7 @@ func (g *Gatekeeper) getDirList(path string, authToken string, nestedPolicies *[
Renewable bool `json:"renewable"`
}
if err := r.Body.FromJsonTo(&scrts); err == nil {
fmt.Printf("Secrets List Data: %+v\n", scrts)
log.Debugf("Secrets List Data: %+v\n", scrts)
for i := range scrts.Data.Keys {
//add to sub dir list when "/" suffix
if strings.HasSuffix(scrts.Data.Keys[i], "/") {
Expand All @@ -135,12 +135,12 @@ func (g *Gatekeeper) getDirList(path string, authToken string, nestedPolicies *[
}
return nil
} else {
fmt.Printf("Get Dir List: %+v\n", err)
log.Errorf("Get Dir List: %+v\n", err)
return err
}
case 404:
/* A 404 is returned when no sub directories exist below the current directory which is ok. */
fmt.Printf("Get Dir List: received 404\n", err)
log.Infof("Get Dir List is empty\n")
return nil

case 403:
Expand Down Expand Up @@ -176,7 +176,7 @@ func getPolicy(path string, authToken string) (map[string]policy.Policy, error)
} `json:"data"`
}
if err := r.Body.FromJsonTo(&resp); err == nil {
fmt.Printf("Response Body: %+v\n", resp)
log.Debugf("Response Body: %+v\n", resp)
return resp.Data.Data, nil
} else {
return nil, policyLoadError{fmt.Errorf("There was an error decoding policy from vault. This can occur " +
Expand Down
4 changes: 2 additions & 2 deletions routes.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import (
"strconv"
"time"

"vault-gatekeeper/scheduler"
"vault-gatekeeper/vault/unsealer"
"github.com/nemosupremo/vault-gatekeeper/scheduler"
"github.com/nemosupremo/vault-gatekeeper/vault/unsealer"

"github.com/franela/goreq"
"github.com/go-chi/chi"
Expand Down
2 changes: 1 addition & 1 deletion scheduler/dcosee_mesos/args.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package dcosee_mesos
import (
"os"

"vault-gatekeeper/scheduler"
"github.com/nemosupremo/vault-gatekeeper/scheduler"

"github.com/spf13/viper"
)
Expand Down
2 changes: 1 addition & 1 deletion scheduler/dcosee_mesos/mesos.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import (

"github.com/spf13/viper"

"vault-gatekeeper/scheduler"
"github.com/nemosupremo/vault-gatekeeper/scheduler"

jwt "github.com/dgrijalva/jwt-go"
"github.com/mesos/mesos-go/api/v0/upid"
Expand Down
2 changes: 1 addition & 1 deletion scheduler/ecs/args.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package ecs

import (
"vault-gatekeeper/scheduler"
"github.com/nemosupremo/vault-gatekeeper/scheduler"
)

func init() {
Expand Down
2 changes: 1 addition & 1 deletion scheduler/ecs/ecs.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"strings"
"time"

"vault-gatekeeper/scheduler"
"github.com/nemosupremo/vault-gatekeeper/scheduler"

"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/aws/ec2metadata"
Expand Down
2 changes: 1 addition & 1 deletion scheduler/mesos/args.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package mesos

import (
"vault-gatekeeper/scheduler"
"github.com/nemosupremo/vault-gatekeeper/scheduler"

"github.com/spf13/viper"
)
Expand Down
2 changes: 1 addition & 1 deletion scheduler/mesos/mesos.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
"strings"
"time"

"vault-gatekeeper/scheduler"
"github.com/nemosupremo/vault-gatekeeper/scheduler"

"github.com/mesos/mesos-go/api/v0/upid"
"github.com/samuel/go-zookeeper/zk"
Expand Down
2 changes: 1 addition & 1 deletion scheduler/mock/args.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package mock

import (
"vault-gatekeeper/scheduler"
"github.com/nemosupremo/vault-gatekeeper/scheduler"
)

func init() {
Expand Down
2 changes: 1 addition & 1 deletion scheduler/mock/mock.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"net"
"time"

"vault-gatekeeper/scheduler"
"github.com/nemosupremo/vault-gatekeeper/scheduler"
)

var ValidTaskId = ""
Expand Down
2 changes: 1 addition & 1 deletion usagestore/vault.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"path"
"time"

"vault-gatekeeper/vault"
"github.com/nemosupremo/vault-gatekeeper/vault"

"github.com/franela/goreq"
log "github.com/sirupsen/logrus"
Expand Down
2 changes: 1 addition & 1 deletion usagestore/vault_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
"testing"
"time"

"vault-gatekeeper/vault"
"github.com/nemosupremo/vault-gatekeeper/vault"

"github.com/franela/goreq"
"github.com/segmentio/ksuid"
Expand Down
2 changes: 1 addition & 1 deletion vault/unsealer/unsealer.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
"github.com/aws/aws-sdk-go/aws/session"
"github.com/franela/goreq"

"vault-gatekeeper/vault"
"github.com/nemosupremo/vault-gatekeeper/vault"
)

// The Unsealer interface represets a type that can retrieve a valid token
Expand Down
2 changes: 1 addition & 1 deletion vault/unsealer/unsealer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"os"
"testing"

"vault-gatekeeper/vault"
"github.com/nemosupremo/vault-gatekeeper/vault"

"github.com/franela/goreq"
"github.com/segmentio/ksuid"
Expand Down

0 comments on commit 494e099

Please sign in to comment.