Skip to content
Snippets Groups Projects
Commit fdd2bbda authored by Rohith's avatar Rohith
Browse files

- removed the references to godep

- ensured we no longer commit vendor directory
- updated the travis build to use glide
- updated the Makefile to use glide
parent b507cb64
Branches
Tags
No related merge requests found
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
*.swp *.swp
.idea/ .idea/
bin/ bin/
vendor/
release/ release/
cover.html cover.html
cover.out cover.out
......
...@@ -12,7 +12,7 @@ language: go ...@@ -12,7 +12,7 @@ language: go
go: go:
- 1.8 - 1.8
install: install:
- go get github.com/tools/godep - go get github.com/Masterminds/glide
- go get github.com/mattn/goveralls - go get github.com/mattn/goveralls
script: script:
- make test - make test
......
...@@ -13,7 +13,7 @@ PACKAGES=$(shell go list ./...) ...@@ -13,7 +13,7 @@ PACKAGES=$(shell go list ./...)
LFLAGS ?= -X main.gitsha=${GIT_SHA} -X main.compiled=${BUILD_TIME} LFLAGS ?= -X main.gitsha=${GIT_SHA} -X main.compiled=${BUILD_TIME}
VETARGS ?= -asmdecl -atomic -bool -buildtags -copylocks -methods -nilfunc -printf -rangeloops -shift -structtags -unsafeptr VETARGS ?= -asmdecl -atomic -bool -buildtags -copylocks -methods -nilfunc -printf -rangeloops -shift -structtags -unsafeptr
.PHONY: test authors changelog build docker static release lint cover vet .PHONY: test authors changelog build docker static release lint cover vet glide-install
default: build default: build
...@@ -21,18 +21,15 @@ golang: ...@@ -21,18 +21,15 @@ golang:
@echo "--> Go Version" @echo "--> Go Version"
@go version @go version
version: build: golang deps
@sed -i "s/const gitSHA =.*/const gitSHA = \"${GIT_SHA}\"/" doc.go
build:
@echo "--> Compiling the project" @echo "--> Compiling the project"
@mkdir -p bin @mkdir -p bin
godep go build -ldflags "${LFLAGS}" -o bin/${NAME} go build -ldflags "${LFLAGS}" -o bin/${NAME}
static: golang deps static: golang deps
@echo "--> Compiling the static binary" @echo "--> Compiling the static binary"
@mkdir -p bin @mkdir -p bin
CGO_ENABLED=0 GOOS=linux godep go build -a -tags netgo -ldflags "-w ${LFLAGS}" -o bin/${NAME} CGO_ENABLED=0 GOOS=linux go build -a -tags netgo -ldflags "-w ${LFLAGS}" -o bin/${NAME}
docker-build: docker-build:
@echo "--> Compiling the project" @echo "--> Compiling the project"
...@@ -83,9 +80,14 @@ authors: ...@@ -83,9 +80,14 @@ authors:
@echo "--> Updating the AUTHORS" @echo "--> Updating the AUTHORS"
git log --format='%aN <%aE>' | sort -u > AUTHORS git log --format='%aN <%aE>' | sort -u > AUTHORS
glide-install:
@echo "--> Installing dependencies"
@glide install
deps: deps:
@echo "--> Installing build dependencies" @echo "--> Installing build dependencies"
@go get github.com/tools/godep @go get github.com/Masterminds/glide
@$(MAKE) glide-install
vet: vet:
@echo "--> Running go vet $(VETARGS) ." @echo "--> Running go vet $(VETARGS) ."
...@@ -120,20 +122,23 @@ format: ...@@ -120,20 +122,23 @@ format:
bench: bench:
@echo "--> Running go bench" @echo "--> Running go bench"
@godep go test -bench=. @go test -bench=.
coverage: coverage:
@echo "--> Running go coverage" @echo "--> Running go coverage"
@godep go test -coverprofile cover.out @go test -coverprofile cover.out
@godep go tool cover -html=cover.out -o cover.html @go tool cover -html=cover.out -o cover.html
cover: cover:
@echo "--> Running go cover" @echo "--> Running go cover"
@godep go test --cover @go test --cover
test: deps test:
@echo "--> Running the tests" @echo "--> Running the tests"
@godep go test -v @if [ ! -d "vendor" ]; then \
make glide-install; \
fi
@go test -v
@$(MAKE) golang @$(MAKE) golang
@$(MAKE) gofmt @$(MAKE) gofmt
@$(MAKE) vet @$(MAKE) vet
......
...@@ -200,10 +200,8 @@ func (r *oauthProxy) forwardProxyHandler() func(*http.Request, *http.Response) { ...@@ -200,10 +200,8 @@ func (r *oauthProxy) forwardProxyHandler() func(*http.Request, *http.Response) {
return func(req *http.Request, resp *http.Response) { return func(req *http.Request, resp *http.Response) {
hostname := req.Host hostname := req.Host
req.URL.Host = hostname req.URL.Host = hostname
// does the host being signed?
// step: does the host being signed?
if len(r.config.ForwardingDomains) == 0 || containsSubString(hostname, r.config.ForwardingDomains) { if len(r.config.ForwardingDomains) == 0 || containsSubString(hostname, r.config.ForwardingDomains) {
// step: sign the outbound request with the access token
req.Header.Set("X-Forwarded-Agent", prog) req.Header.Set("X-Forwarded-Agent", prog)
req.Header.Set("Authorization", fmt.Sprintf("Bearer %s", state.token.Encode())) req.Header.Set("Authorization", fmt.Sprintf("Bearer %s", state.token.Encode()))
} }
......
hash: b61fcd2b523ddfcacf31c69e7f46b2fd9286d0c6555029efe8a45de3552d25b2
updated: 2017-06-12T14:55:48.532550213+01:00
imports:
- name: github.com/armon/go-proxyproto
version: 609d6338d3a76ec26ac3fe7045a164d9a58436e7
- name: github.com/beorn7/perks
version: 3ac7bf7a47d159a033b107610db8a1b6575507a4
subpackages:
- quantile
- name: github.com/boltdb/bolt
version: 144418e1475d8bf7abbdc48583500f1a20c62ea7
- name: github.com/coreos/pkg
version: 447b7ec906e523386d9c53be15b55a8ae86ea944
subpackages:
- health
- httputil
- timeutil
- name: github.com/davecgh/go-spew
version: 5215b55f46b2b919f50a1df0eaa5886afe4e3b3d
subpackages:
- spew
- name: github.com/dgrijalva/jwt-go
version: 2268707a8f0843315e2004ee4f1d021dc08baedf
- name: github.com/fsnotify/fsnotify
version: fd9ec7deca8bf46ecd2a795baaacf2b3a9be1197
- name: github.com/gambol99/go-oidc
version: 2111f98a1397a35f1800f4c3c354a7abebbef75c
subpackages:
- http
- jose
- key
- oauth2
- oidc
- name: github.com/gambol99/goproxy
version: e713e5909438245be49ef559e74dd904833ebe90
- name: github.com/go-resty/resty
version: 39c3db9c7bb4f9718ac143a83a924441521caf73
- name: github.com/golang/protobuf
version: 0c1f6d65b5a189c2250d10e71a5506f06f9fa0a0
subpackages:
- proto
- name: github.com/jonboulle/clockwork
version: ed104f61ea4877bea08af6f759805674861e968d
- name: github.com/labstack/echo
version: eac431df0dbad8ba6cc313fba37f1d4275c317e8
subpackages:
- middleware
- name: github.com/labstack/gommon
version: e8995fb26e646187d33cff439b18609cfba23088
subpackages:
- bytes
- color
- log
- random
- name: github.com/mattn/go-colorable
version: 9cbef7c35391cca05f15f8181dc0b18bc9736dbb
- name: github.com/mattn/go-isatty
version: 56b76bdf51f7708750eac80fa38b952bb9f32639
- name: github.com/matttproud/golang_protobuf_extensions
version: c12348ce28de40eed0136aa2b644d0ee0650e56c
subpackages:
- pbutil
- name: github.com/pmezard/go-difflib
version: 792786c7400a136282c1664665ae0a8db921c6c2
subpackages:
- difflib
- name: github.com/prometheus/client_golang
version: 488edd04dc224ba64c401747cd0a4b5f05dfb234
subpackages:
- prometheus
- name: github.com/prometheus/client_model
version: fa8ad6fec33561be4280a8f0514318c79d7f6cb6
subpackages:
- go
- name: github.com/prometheus/common
version: 3a184ff7dfd46b9091030bf2e56c71112b0ddb0e
subpackages:
- expfmt
- internal/bitbucket.org/ww/goautoneg
- model
- name: github.com/prometheus/procfs
version: abf152e5f3e97f2fafac028d2cc06c1feb87ffa5
- name: github.com/PuerkitoBio/purell
version: 0bcb03f4b4d0a9428594752bd2a3b9aa0a9d4bd4
- name: github.com/PuerkitoBio/urlesc
version: 5bd2802263f21d8788851d5305584c82a5c75d7e
- name: github.com/stretchr/testify
version: f6abca593680b2315d2075e0f5e2a9751e3f431a
subpackages:
- assert
- require
- vendor/github.com/davecgh/go-spew/spew
- vendor/github.com/pmezard/go-difflib/difflib
- name: github.com/unrolled/secure
version: 4b41e52ab568cbfd31eda3612d98192da1575c77
- name: github.com/urfave/cli
version: 0bdeddeeb0f650497d603c4ad7b20cfe685682f6
- name: github.com/valyala/bytebufferpool
version: e746df99fe4a3986f4d4f79e13c1e0117ce9c2f7
- name: github.com/valyala/fasttemplate
version: dcecefd839c4193db0d35b88ec65b4c12d360ab0
- name: go.uber.org/atomic
version: 0506d69f5564c56e25797bf7183c28921d4c6360
- name: go.uber.org/zap
version: 54371c67da1bc746325e5582e48521a5db5d64ca
subpackages:
- buffer
- internal/bufferpool
- internal/color
- internal/exit
- internal/multierror
- zapcore
- name: golang.org/x/crypto
version: 453249f01cfeb54c3d549ddb75ff152ca243f9d8
subpackages:
- acme
- acme/autocert
- name: golang.org/x/net
version: bc3663df0ac92f928d419e31e0d2af22e683a5a2
subpackages:
- context
- context/ctxhttp
- idna
- publicsuffix
- name: golang.org/x/sys
version: 833a04a10549a95dc34458c195cbad61bbb6cb4d
subpackages:
- unix
- name: golang.org/x/text
version: f28f36722d5ef2f9655ad3de1f248e3e52ad5ebd
subpackages:
- transform
- unicode/norm
- width
- name: gopkg.in/bsm/ratelimit.v1
version: db14e161995a5177acef654cb0dd785e8ee8bc22
- name: gopkg.in/redis.v4
version: 889409de38315d22b114fb5980f705e6fa48c6a2
subpackages:
- internal
- internal/consistenthash
- internal/hashtag
- internal/pool
- name: gopkg.in/yaml.v2
version: 49c95bdc21843256fb6c4e0d370a05f24a0bf213
testImports: []
...@@ -35,7 +35,7 @@ import: ...@@ -35,7 +35,7 @@ import:
- oauth2 - oauth2
- oidc - oidc
- package: github.com/gambol99/goproxy - package: github.com/gambol99/goproxy
version: c3b6ff1178d68ec9e93f7c996f41a3df89931d9f version: e713e5909438245be49ef559e74dd904833ebe90
- package: github.com/go-resty/resty - package: github.com/go-resty/resty
version: 39c3db9c7bb4f9718ac143a83a924441521caf73 version: 39c3db9c7bb4f9718ac143a83a924441521caf73
- package: github.com/golang/protobuf - package: github.com/golang/protobuf
......
...@@ -231,18 +231,18 @@ func (r *oauthProxy) createForwardingProxy() error { ...@@ -231,18 +231,18 @@ func (r *oauthProxy) createForwardingProxy() error {
} }
forwardingHandler := r.forwardProxyHandler() forwardingHandler := r.forwardProxyHandler()
// step: set the http handler // set the http handler
proxy := r.upstream.(*goproxy.ProxyHttpServer) proxy := r.upstream.(*goproxy.ProxyHttpServer)
r.router = proxy r.router = proxy
// step: setup the tls configuration // setup the tls configuration
if r.config.TLSCaCertificate != "" && r.config.TLSCaPrivateKey != "" { if r.config.TLSCaCertificate != "" && r.config.TLSCaPrivateKey != "" {
ca, err := loadCA(r.config.TLSCaCertificate, r.config.TLSCaPrivateKey) ca, err := loadCA(r.config.TLSCaCertificate, r.config.TLSCaPrivateKey)
if err != nil { if err != nil {
return fmt.Errorf("unable to load certificate authority, error: %s", err) return fmt.Errorf("unable to load certificate authority, error: %s", err)
} }
// step: implement the goproxy connect method // implement the goproxy connect method
proxy.OnRequest().HandleConnectFunc( proxy.OnRequest().HandleConnectFunc(
func(host string, ctx *goproxy.ProxyCtx) (*goproxy.ConnectAction, string) { func(host string, ctx *goproxy.ProxyCtx) (*goproxy.ConnectAction, string) {
return &goproxy.ConnectAction{ return &goproxy.ConnectAction{
...@@ -252,7 +252,7 @@ func (r *oauthProxy) createForwardingProxy() error { ...@@ -252,7 +252,7 @@ func (r *oauthProxy) createForwardingProxy() error {
}, },
) )
} else { } else {
// step: use the default certificate provided by goproxy // use the default certificate provided by goproxy
proxy.OnRequest().HandleConnect(goproxy.AlwaysMitm) proxy.OnRequest().HandleConnect(goproxy.AlwaysMitm)
} }
...@@ -275,7 +275,6 @@ func (r *oauthProxy) createForwardingProxy() error { ...@@ -275,7 +275,6 @@ func (r *oauthProxy) createForwardingProxy() error {
}) })
proxy.OnRequest().DoFunc(func(req *http.Request, ctx *goproxy.ProxyCtx) (*http.Request, *http.Response) { proxy.OnRequest().DoFunc(func(req *http.Request, ctx *goproxy.ProxyCtx) (*http.Request, *http.Response) {
ctx.UserData = time.Now() ctx.UserData = time.Now()
// step: forward into the handler
forwardingHandler(req, ctx.Resp) forwardingHandler(req, ctx.Resp)
return req, ctx.Resp return req, ctx.Resp
}) })
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment