Skip to content

Commit

Permalink
Update dependencies (#6)
Browse files Browse the repository at this point in the history
* Update dependencies

* Stop testing with ancient Go versions
  • Loading branch information
jordemort authored Nov 5, 2022
1 parent e8ab996 commit f3d1473
Show file tree
Hide file tree
Showing 8 changed files with 221 additions and 562 deletions.
20 changes: 1 addition & 19 deletions .github/workflows/push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ jobs:

strategy:
matrix:
go: ['1.12', '1.13', '1.14']
go: ['1.19']

steps:
- uses: actions/checkout@v1
Expand All @@ -19,21 +19,3 @@ jobs:

- name: Run Tests
run: go test ./...

publish:
name: Publish Docker image
needs: test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
with:
fetch-depth: '0'
- name: Publish to Docker Registry
uses: docker/build-push-action@v1
with:
repository: ${{ github.repository }}
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
tag_with_ref: true
tag_with_sha: true

2 changes: 1 addition & 1 deletion cmd/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"fmt"
"net/http"

internal "github.com/thomseddon/traefik-forward-auth/internal"
internal "github.com/jordemort/traefik-forward-auth/internal"
)

// Main
Expand Down
54 changes: 37 additions & 17 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,27 +1,47 @@
module github.com/thomseddon/traefik-forward-auth
module github.com/jordemort/traefik-forward-auth

go 1.13
go 1.19

require (
github.com/Jeffail/gabs/v2 v2.5.1
github.com/containous/traefik/v2 v2.1.2
github.com/coreos/go-oidc v2.1.0+incompatible
github.com/pquerna/cachecontrol v0.0.0-20180517163645-1555304b9b35 // indirect
github.com/sirupsen/logrus v1.4.2
github.com/stretchr/testify v1.4.0
github.com/Jeffail/gabs/v2 v2.6.1
github.com/coreos/go-oidc v2.2.1+incompatible
github.com/sirupsen/logrus v1.9.0
github.com/stretchr/testify v1.8.0
github.com/thomseddon/go-flags v1.4.1-0.20190507184247-a3629c504486
golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45
gopkg.in/square/go-jose.v2 v2.3.1
github.com/traefik/traefik/v2 v2.9.4
golang.org/x/oauth2 v0.1.0
gopkg.in/square/go-jose.v2 v2.6.0
)

// From traefik
require (
github.com/containous/alice v0.0.0-20181107144136-d83ebdd94cbd // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/golang/protobuf v1.5.2 // indirect
github.com/gorilla/mux v1.8.0 // indirect
github.com/gravitational/trace v1.1.19 // indirect
github.com/jonboulle/clockwork v0.3.0 // indirect
github.com/miekg/dns v1.1.50 // indirect
github.com/patrickmn/go-cache v2.1.0+incompatible // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/pquerna/cachecontrol v0.1.0 // indirect
github.com/traefik/paerser v0.1.9 // indirect
github.com/vulcand/predicate v1.2.0 // indirect
golang.org/x/crypto v0.1.0 // indirect
golang.org/x/mod v0.6.0 // indirect
golang.org/x/net v0.1.0 // indirect
golang.org/x/sys v0.1.0 // indirect
golang.org/x/term v0.1.0 // indirect
golang.org/x/text v0.4.0 // indirect
golang.org/x/tools v0.2.0 // indirect
google.golang.org/appengine v1.6.7 // indirect
google.golang.org/protobuf v1.28.1 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)

// Containous forks
replace (
github.com/Azure/go-autorest => github.com/Azure/go-autorest v12.4.1+incompatible
github.com/abbot/go-http-auth => github.com/containous/go-http-auth v0.4.1-0.20180112153951-65b0cdae8d7f
github.com/docker/docker => github.com/docker/engine v1.4.2-0.20191113042239-ea84732a7725
github.com/abbot/go-http-auth => github.com/containous/go-http-auth v0.4.1-0.20200324110947-a37a7636d23e
github.com/go-check/check => github.com/containous/check v0.0.0-20170915194414-ca0bf163426a
github.com/gorilla/mux => github.com/containous/mux v0.0.0-20181024131434-c33f32e26898
github.com/gorilla/mux => github.com/containous/mux v0.0.0-20220627093034-b2dd784e613f
github.com/mailgun/minheap => github.com/containous/minheap v0.0.0-20190809180810-6e71eb837595
github.com/mailgun/multibuf => github.com/containous/multibuf v0.0.0-20190809014333-8b6c9a7e6bba
github.com/rancher/go-rancher-metadata => github.com/containous/go-rancher-metadata v0.0.0-20190402144056-c6a65f8b7a28
)
679 changes: 168 additions & 511 deletions go.sum

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion internal/auth.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (
"strings"
"time"

"github.com/thomseddon/traefik-forward-auth/internal/provider"
"github.com/jordemort/traefik-forward-auth/internal/provider"
)

// Request Validation
Expand Down
2 changes: 1 addition & 1 deletion internal/auth_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ import (
"testing"
"time"

"github.com/jordemort/traefik-forward-auth/internal/provider"
"github.com/stretchr/testify/assert"
"github.com/thomseddon/traefik-forward-auth/internal/provider"
)

/**
Expand Down
2 changes: 1 addition & 1 deletion internal/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ import (
"strings"
"time"

"github.com/jordemort/traefik-forward-auth/internal/provider"
"github.com/thomseddon/go-flags"
"github.com/thomseddon/traefik-forward-auth/internal/provider"
)

var config *Config
Expand Down
22 changes: 11 additions & 11 deletions internal/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@ import (
"net/url"
"strings"

"github.com/containous/traefik/v2/pkg/rules"
"github.com/jordemort/traefik-forward-auth/internal/provider"
"github.com/sirupsen/logrus"
"github.com/thomseddon/traefik-forward-auth/internal/provider"
mux "github.com/traefik/traefik/v2/pkg/muxer/http"
)

// Server contains router and handler methods
type Server struct {
router *rules.Router
muxer *mux.Muxer
}

// NewServer creates a new server object and builds router
Expand All @@ -25,7 +25,7 @@ func NewServer() *Server {

func (s *Server) buildRoutes() {
var err error
s.router, err = rules.NewRouter()
s.muxer, err = mux.NewMuxer()
if err != nil {
log.Fatal(err)
}
Expand All @@ -34,23 +34,23 @@ func (s *Server) buildRoutes() {
for name, rule := range config.Rules {
matchRule := rule.formattedRule()
if rule.Action == "allow" {
s.router.AddRoute(matchRule, 1, s.AllowHandler(name))
s.muxer.AddRoute(matchRule, 1, s.AllowHandler(name))
} else {
s.router.AddRoute(matchRule, 1, s.AuthHandler(rule.Provider, name))
s.muxer.AddRoute(matchRule, 1, s.AuthHandler(rule.Provider, name))
}
}

// Add callback handler
s.router.Handle(config.Path, s.AuthCallbackHandler())
s.muxer.Handle(config.Path, s.AuthCallbackHandler())

// Add logout handler
s.router.Handle(config.Path+"/logout", s.LogoutHandler())
s.muxer.Handle(config.Path+"/logout", s.LogoutHandler())

// Add a default handler
if config.DefaultAction == "allow" {
s.router.NewRoute().Handler(s.AllowHandler("default"))
s.muxer.NewRoute().Handler(s.AllowHandler("default"))
} else {
s.router.NewRoute().Handler(s.AuthHandler(config.DefaultProvider, "default"))
s.muxer.NewRoute().Handler(s.AuthHandler(config.DefaultProvider, "default"))
}
}

Expand All @@ -67,7 +67,7 @@ func (s *Server) RootHandler(w http.ResponseWriter, r *http.Request) {
}

// Pass to mux
s.router.ServeHTTP(w, r)
s.muxer.ServeHTTP(w, r)
}

// AllowHandler Allows requests
Expand Down

0 comments on commit f3d1473

Please sign in to comment.