mirror of
https://github.com/lukaszraczylo/traefikoidc.git
synced 2026-10-12 04:04:26 +00:00
Update dependencies.
This commit is contained in:
@@ -4,6 +4,10 @@ This middleware is supposed to replace the need for the forward-auth and oauth2-
|
|||||||
|
|
||||||
Middleware has been tested with Auth0 and Logto.
|
Middleware has been tested with Auth0 and Logto.
|
||||||
|
|
||||||
|
### Traefik version compatibility
|
||||||
|
|
||||||
|
Code follows closely the current traefik helm chart versions. If plugin fails to load - it's time to update to the latest version of the traefik helm chart.
|
||||||
|
|
||||||
### Configuration options
|
### Configuration options
|
||||||
|
|
||||||
Middleware currently supports following scenarios:
|
Middleware currently supports following scenarios:
|
||||||
|
|||||||
@@ -6,7 +6,6 @@ require (
|
|||||||
github.com/google/uuid v1.6.0
|
github.com/google/uuid v1.6.0
|
||||||
github.com/gorilla/sessions v1.3.0
|
github.com/gorilla/sessions v1.3.0
|
||||||
github.com/stretchr/testify v1.9.0
|
github.com/stretchr/testify v1.9.0
|
||||||
golang.org/x/sync v0.7.0
|
|
||||||
golang.org/x/time v0.5.0
|
golang.org/x/time v0.5.0
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
@@ -14,8 +14,6 @@ github.com/stretchr/objx v0.5.2 h1:xuMeJ0Sdp5ZMRXx/aWO6RZxdr3beISkG5/G/aIRr3pY=
|
|||||||
github.com/stretchr/objx v0.5.2/go.mod h1:FRsXN1f5AsAjCGJKqEizvkpNtU+EGNCLh3NxZ/8L+MA=
|
github.com/stretchr/objx v0.5.2/go.mod h1:FRsXN1f5AsAjCGJKqEizvkpNtU+EGNCLh3NxZ/8L+MA=
|
||||||
github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg=
|
github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg=
|
||||||
github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
|
github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
|
||||||
golang.org/x/sync v0.7.0 h1:YsImfSBoP9QPYL0xyKJPq0gcaJdG3rInoqxTWbfQu9M=
|
|
||||||
golang.org/x/sync v0.7.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
|
|
||||||
golang.org/x/time v0.5.0 h1:o7cqy6amK/52YcAKIPlM3a+Fpj35zvRj2TP+e1xFSfk=
|
golang.org/x/time v0.5.0 h1:o7cqy6amK/52YcAKIPlM3a+Fpj35zvRj2TP+e1xFSfk=
|
||||||
golang.org/x/time v0.5.0/go.mod h1:3BpzKBy/shNhVucY/MWOyx10tF3SFh9QdLuxbVysPQM=
|
golang.org/x/time v0.5.0/go.mod h1:3BpzKBy/shNhVucY/MWOyx10tF3SFh9QdLuxbVysPQM=
|
||||||
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM=
|
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM=
|
||||||
|
|||||||
-27
@@ -1,27 +0,0 @@
|
|||||||
Copyright (c) 2009 The Go Authors. All rights reserved.
|
|
||||||
|
|
||||||
Redistribution and use in source and binary forms, with or without
|
|
||||||
modification, are permitted provided that the following conditions are
|
|
||||||
met:
|
|
||||||
|
|
||||||
* Redistributions of source code must retain the above copyright
|
|
||||||
notice, this list of conditions and the following disclaimer.
|
|
||||||
* Redistributions in binary form must reproduce the above
|
|
||||||
copyright notice, this list of conditions and the following disclaimer
|
|
||||||
in the documentation and/or other materials provided with the
|
|
||||||
distribution.
|
|
||||||
* Neither the name of Google Inc. nor the names of its
|
|
||||||
contributors may be used to endorse or promote products derived from
|
|
||||||
this software without specific prior written permission.
|
|
||||||
|
|
||||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
||||||
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
|
||||||
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
|
||||||
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
|
||||||
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
|
||||||
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
|
||||||
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
|
||||||
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
|
||||||
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
||||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
||||||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
||||||
-22
@@ -1,22 +0,0 @@
|
|||||||
Additional IP Rights Grant (Patents)
|
|
||||||
|
|
||||||
"This implementation" means the copyrightable works distributed by
|
|
||||||
Google as part of the Go project.
|
|
||||||
|
|
||||||
Google hereby grants to You a perpetual, worldwide, non-exclusive,
|
|
||||||
no-charge, royalty-free, irrevocable (except as stated in this section)
|
|
||||||
patent license to make, have made, use, offer to sell, sell, import,
|
|
||||||
transfer and otherwise run, modify and propagate the contents of this
|
|
||||||
implementation of Go, where such license applies only to those patent
|
|
||||||
claims, both currently owned or controlled by Google and acquired in
|
|
||||||
the future, licensable by Google that are necessarily infringed by this
|
|
||||||
implementation of Go. This grant does not include claims that would be
|
|
||||||
infringed only as a consequence of further modification of this
|
|
||||||
implementation. If you or your agent or exclusive licensee institute or
|
|
||||||
order or agree to the institution of patent litigation against any
|
|
||||||
entity (including a cross-claim or counterclaim in a lawsuit) alleging
|
|
||||||
that this implementation of Go or any code incorporated within this
|
|
||||||
implementation of Go constitutes direct or contributory patent
|
|
||||||
infringement, or inducement of patent infringement, then any patent
|
|
||||||
rights granted to you under this License for this implementation of Go
|
|
||||||
shall terminate as of the date such litigation is filed.
|
|
||||||
-135
@@ -1,135 +0,0 @@
|
|||||||
// Copyright 2016 The Go Authors. All rights reserved.
|
|
||||||
// Use of this source code is governed by a BSD-style
|
|
||||||
// license that can be found in the LICENSE file.
|
|
||||||
|
|
||||||
// Package errgroup provides synchronization, error propagation, and Context
|
|
||||||
// cancelation for groups of goroutines working on subtasks of a common task.
|
|
||||||
//
|
|
||||||
// [errgroup.Group] is related to [sync.WaitGroup] but adds handling of tasks
|
|
||||||
// returning errors.
|
|
||||||
package errgroup
|
|
||||||
|
|
||||||
import (
|
|
||||||
"context"
|
|
||||||
"fmt"
|
|
||||||
"sync"
|
|
||||||
)
|
|
||||||
|
|
||||||
type token struct{}
|
|
||||||
|
|
||||||
// A Group is a collection of goroutines working on subtasks that are part of
|
|
||||||
// the same overall task.
|
|
||||||
//
|
|
||||||
// A zero Group is valid, has no limit on the number of active goroutines,
|
|
||||||
// and does not cancel on error.
|
|
||||||
type Group struct {
|
|
||||||
cancel func(error)
|
|
||||||
|
|
||||||
wg sync.WaitGroup
|
|
||||||
|
|
||||||
sem chan token
|
|
||||||
|
|
||||||
errOnce sync.Once
|
|
||||||
err error
|
|
||||||
}
|
|
||||||
|
|
||||||
func (g *Group) done() {
|
|
||||||
if g.sem != nil {
|
|
||||||
<-g.sem
|
|
||||||
}
|
|
||||||
g.wg.Done()
|
|
||||||
}
|
|
||||||
|
|
||||||
// WithContext returns a new Group and an associated Context derived from ctx.
|
|
||||||
//
|
|
||||||
// The derived Context is canceled the first time a function passed to Go
|
|
||||||
// returns a non-nil error or the first time Wait returns, whichever occurs
|
|
||||||
// first.
|
|
||||||
func WithContext(ctx context.Context) (*Group, context.Context) {
|
|
||||||
ctx, cancel := withCancelCause(ctx)
|
|
||||||
return &Group{cancel: cancel}, ctx
|
|
||||||
}
|
|
||||||
|
|
||||||
// Wait blocks until all function calls from the Go method have returned, then
|
|
||||||
// returns the first non-nil error (if any) from them.
|
|
||||||
func (g *Group) Wait() error {
|
|
||||||
g.wg.Wait()
|
|
||||||
if g.cancel != nil {
|
|
||||||
g.cancel(g.err)
|
|
||||||
}
|
|
||||||
return g.err
|
|
||||||
}
|
|
||||||
|
|
||||||
// Go calls the given function in a new goroutine.
|
|
||||||
// It blocks until the new goroutine can be added without the number of
|
|
||||||
// active goroutines in the group exceeding the configured limit.
|
|
||||||
//
|
|
||||||
// The first call to return a non-nil error cancels the group's context, if the
|
|
||||||
// group was created by calling WithContext. The error will be returned by Wait.
|
|
||||||
func (g *Group) Go(f func() error) {
|
|
||||||
if g.sem != nil {
|
|
||||||
g.sem <- token{}
|
|
||||||
}
|
|
||||||
|
|
||||||
g.wg.Add(1)
|
|
||||||
go func() {
|
|
||||||
defer g.done()
|
|
||||||
|
|
||||||
if err := f(); err != nil {
|
|
||||||
g.errOnce.Do(func() {
|
|
||||||
g.err = err
|
|
||||||
if g.cancel != nil {
|
|
||||||
g.cancel(g.err)
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}()
|
|
||||||
}
|
|
||||||
|
|
||||||
// TryGo calls the given function in a new goroutine only if the number of
|
|
||||||
// active goroutines in the group is currently below the configured limit.
|
|
||||||
//
|
|
||||||
// The return value reports whether the goroutine was started.
|
|
||||||
func (g *Group) TryGo(f func() error) bool {
|
|
||||||
if g.sem != nil {
|
|
||||||
select {
|
|
||||||
case g.sem <- token{}:
|
|
||||||
// Note: this allows barging iff channels in general allow barging.
|
|
||||||
default:
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
g.wg.Add(1)
|
|
||||||
go func() {
|
|
||||||
defer g.done()
|
|
||||||
|
|
||||||
if err := f(); err != nil {
|
|
||||||
g.errOnce.Do(func() {
|
|
||||||
g.err = err
|
|
||||||
if g.cancel != nil {
|
|
||||||
g.cancel(g.err)
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}()
|
|
||||||
return true
|
|
||||||
}
|
|
||||||
|
|
||||||
// SetLimit limits the number of active goroutines in this group to at most n.
|
|
||||||
// A negative value indicates no limit.
|
|
||||||
//
|
|
||||||
// Any subsequent call to the Go method will block until it can add an active
|
|
||||||
// goroutine without exceeding the configured limit.
|
|
||||||
//
|
|
||||||
// The limit must not be modified while any goroutines in the group are active.
|
|
||||||
func (g *Group) SetLimit(n int) {
|
|
||||||
if n < 0 {
|
|
||||||
g.sem = nil
|
|
||||||
return
|
|
||||||
}
|
|
||||||
if len(g.sem) != 0 {
|
|
||||||
panic(fmt.Errorf("errgroup: modify limit while %v goroutines in the group are still active", len(g.sem)))
|
|
||||||
}
|
|
||||||
g.sem = make(chan token, n)
|
|
||||||
}
|
|
||||||
-13
@@ -1,13 +0,0 @@
|
|||||||
// Copyright 2023 The Go Authors. All rights reserved.
|
|
||||||
// Use of this source code is governed by a BSD-style
|
|
||||||
// license that can be found in the LICENSE file.
|
|
||||||
|
|
||||||
//go:build go1.20
|
|
||||||
|
|
||||||
package errgroup
|
|
||||||
|
|
||||||
import "context"
|
|
||||||
|
|
||||||
func withCancelCause(parent context.Context) (context.Context, func(error)) {
|
|
||||||
return context.WithCancelCause(parent)
|
|
||||||
}
|
|
||||||
-14
@@ -1,14 +0,0 @@
|
|||||||
// Copyright 2023 The Go Authors. All rights reserved.
|
|
||||||
// Use of this source code is governed by a BSD-style
|
|
||||||
// license that can be found in the LICENSE file.
|
|
||||||
|
|
||||||
//go:build !go1.20
|
|
||||||
|
|
||||||
package errgroup
|
|
||||||
|
|
||||||
import "context"
|
|
||||||
|
|
||||||
func withCancelCause(parent context.Context) (context.Context, func(error)) {
|
|
||||||
ctx, cancel := context.WithCancel(parent)
|
|
||||||
return ctx, func(error) { cancel() }
|
|
||||||
}
|
|
||||||
Vendored
-3
@@ -22,9 +22,6 @@ github.com/stretchr/testify/assert
|
|||||||
github.com/stretchr/testify/mock
|
github.com/stretchr/testify/mock
|
||||||
github.com/stretchr/testify/require
|
github.com/stretchr/testify/require
|
||||||
github.com/stretchr/testify/suite
|
github.com/stretchr/testify/suite
|
||||||
# golang.org/x/sync v0.7.0
|
|
||||||
## explicit; go 1.18
|
|
||||||
golang.org/x/sync/errgroup
|
|
||||||
# golang.org/x/time v0.5.0
|
# golang.org/x/time v0.5.0
|
||||||
## explicit; go 1.18
|
## explicit; go 1.18
|
||||||
golang.org/x/time/rate
|
golang.org/x/time/rate
|
||||||
|
|||||||
Reference in New Issue
Block a user