Fixing format for v7.5.0
This commit is contained in:
parent
ad81d2f8fb
commit
e645994bbe
|
|
@ -50,7 +50,7 @@ var _ = Describe("Load", func() {
|
|||
Options: Options{
|
||||
ProxyPrefix: "/oauth2",
|
||||
PingPath: "/ping",
|
||||
ReadyPath: "/ready",
|
||||
ReadyPath: "/ready",
|
||||
RealClientIPHeader: "X-Real-IP",
|
||||
ForceHTTPS: false,
|
||||
Cookie: cookieDefaults(),
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@ type Options struct {
|
|||
ProxyPrefix string `flag:"proxy-prefix" cfg:"proxy_prefix"`
|
||||
PingPath string `flag:"ping-path" cfg:"ping_path"`
|
||||
PingUserAgent string `flag:"ping-user-agent" cfg:"ping_user_agent"`
|
||||
ReadyPath string `flag:"ready-path" cfg:"ready_path"`
|
||||
ReadyPath string `flag:"ready-path" cfg:"ready_path"`
|
||||
ReverseProxy bool `flag:"reverse-proxy" cfg:"reverse_proxy"`
|
||||
RealClientIPHeader string `flag:"real-client-ip-header" cfg:"real_client_ip_header"`
|
||||
TrustedIPs []string `flag:"trusted-ip" cfg:"trusted_ips"`
|
||||
|
|
@ -105,7 +105,7 @@ func NewOptions() *Options {
|
|||
ProxyPrefix: "/oauth2",
|
||||
Providers: providerDefaults(),
|
||||
PingPath: "/ping",
|
||||
ReadyPath: "/ready",
|
||||
ReadyPath: "/ready",
|
||||
RealClientIPHeader: "X-Real-IP",
|
||||
ForceHTTPS: false,
|
||||
Cookie: cookieDefaults(),
|
||||
|
|
@ -143,7 +143,7 @@ func NewFlagSet() *pflag.FlagSet {
|
|||
flagSet.String("proxy-prefix", "/oauth2", "the url root path that this proxy should be nested under (e.g. /<oauth2>/sign_in)")
|
||||
flagSet.String("ping-path", "/ping", "the ping endpoint that can be used for basic health checks")
|
||||
flagSet.String("ping-user-agent", "", "special User-Agent that will be used for basic health checks")
|
||||
flagSet.String("ready-path", "/ready", "the ready endpoint that can be used for deep health checks")
|
||||
flagSet.String("ready-path", "/ready", "the ready endpoint that can be used for deep health checks")
|
||||
flagSet.String("session-store-type", "cookie", "the session storage provider to use")
|
||||
flagSet.Bool("session-cookie-minimal", false, "strip OAuth tokens from cookie session stores if they aren't needed (cookie session store only)")
|
||||
flagSet.String("redis-connection-url", "", "URL of redis server for redis session storage (eg: redis://HOST[:PORT])")
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ type SessionStore interface {
|
|||
Save(rw http.ResponseWriter, req *http.Request, s *SessionState) error
|
||||
Load(req *http.Request) (*SessionState, error)
|
||||
Clear(rw http.ResponseWriter, req *http.Request) error
|
||||
VerifyConnection(ctx context.Context) error
|
||||
VerifyConnection(ctx context.Context) error
|
||||
}
|
||||
|
||||
var ErrLockNotObtained = errors.New("lock: not obtained")
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
package cookie
|
||||
|
||||
import (
|
||||
"context"
|
||||
"context"
|
||||
"errors"
|
||||
"fmt"
|
||||
"net/http"
|
||||
|
|
|
|||
|
|
@ -15,5 +15,5 @@ type Store interface {
|
|||
Load(context.Context, string) ([]byte, error)
|
||||
Clear(context.Context, string) error
|
||||
Lock(key string) sessions.Lock
|
||||
VerifyConnection(context.Context) error
|
||||
VerifyConnection(context.Context) error
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
package persistence
|
||||
|
||||
import (
|
||||
"context"
|
||||
"context"
|
||||
"fmt"
|
||||
"net/http"
|
||||
"time"
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ type Client interface {
|
|||
Lock(key string) sessions.Lock
|
||||
Set(ctx context.Context, key string, value []byte, expiration time.Duration) error
|
||||
Del(ctx context.Context, key string) error
|
||||
Ping(ctx context.Context) error
|
||||
Ping(ctx context.Context) error
|
||||
}
|
||||
|
||||
var _ Client = (*client)(nil)
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ import (
|
|||
|
||||
"github.com/bsm/redislock"
|
||||
"github.com/oauth2-proxy/oauth2-proxy/v7/pkg/apis/sessions"
|
||||
"github.com/redis/go-redis/v9"
|
||||
"github.com/redis/go-redis/v9"
|
||||
)
|
||||
|
||||
const LockSuffix = "lock"
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ import (
|
|||
"github.com/oauth2-proxy/oauth2-proxy/v7/pkg/apis/sessions"
|
||||
"github.com/oauth2-proxy/oauth2-proxy/v7/pkg/logger"
|
||||
"github.com/oauth2-proxy/oauth2-proxy/v7/pkg/sessions/persistence"
|
||||
"github.com/redis/go-redis/v9"
|
||||
"github.com/redis/go-redis/v9"
|
||||
)
|
||||
|
||||
// SessionStore is an implementation of the persistence.Store
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ import (
|
|||
"github.com/oauth2-proxy/oauth2-proxy/v7/pkg/logger"
|
||||
. "github.com/onsi/ginkgo"
|
||||
. "github.com/onsi/gomega"
|
||||
"github.com/redis/go-redis/v9"
|
||||
"github.com/redis/go-redis/v9"
|
||||
)
|
||||
|
||||
// wrappedRedisLogger wraps a logger so that we can coerce the logger to
|
||||
|
|
|
|||
|
|
@ -486,7 +486,7 @@ func SessionStoreInterfaceTests(in *testInput) {
|
|||
})
|
||||
})
|
||||
|
||||
Context("when VerifyConnection is called", func() {
|
||||
Context("when VerifyConnection is called", func() {
|
||||
It("should return without an error", func() {
|
||||
Expect(in.ss().VerifyConnection(in.request.Context())).ToNot(HaveOccurred())
|
||||
})
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@ var _ Provider = (*GitLabProvider)(nil)
|
|||
|
||||
// NewGitLabProvider initiates a new GitLabProvider
|
||||
func NewGitLabProvider(p *ProviderData, opts options.GitLabOptions) (*GitLabProvider, error) {
|
||||
p.setProviderDefaults(providerDefaults{
|
||||
p.setProviderDefaults(providerDefaults{
|
||||
name: gitlabProviderName,
|
||||
})
|
||||
if p.Scope == "" {
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@ type KeycloakOIDCProvider struct {
|
|||
|
||||
// NewKeycloakOIDCProvider makes a KeycloakOIDCProvider using the ProviderData
|
||||
func NewKeycloakOIDCProvider(p *ProviderData, opts options.KeycloakOptions) *KeycloakOIDCProvider {
|
||||
p.setProviderDefaults(providerDefaults{
|
||||
p.setProviderDefaults(providerDefaults{
|
||||
name: keycloakOIDCProviderName,
|
||||
})
|
||||
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@ const nextCloudProviderName = "Nextcloud"
|
|||
|
||||
// NewNextcloudProvider initiates a new NextcloudProvider
|
||||
func NewNextcloudProvider(p *ProviderData) *NextcloudProvider {
|
||||
p.setProviderDefaults(providerDefaults{
|
||||
p.setProviderDefaults(providerDefaults{
|
||||
name: nextCloudProviderName,
|
||||
})
|
||||
p.getAuthorizationHeaderFunc = makeOIDCHeader
|
||||
|
|
|
|||
|
|
@ -147,7 +147,7 @@ func newProviderDataFromConfig(providerConfig options.Provider) (*ProviderData,
|
|||
logger.Printf("Warning: Your provider supports PKCE methods %+q, but you have not enabled one with --code-challenge-method", p.SupportedCodeChallengeMethods)
|
||||
}
|
||||
|
||||
if providerConfig.OIDCConfig.UserIDClaim == "" {
|
||||
if providerConfig.OIDCConfig.UserIDClaim == "" {
|
||||
providerConfig.OIDCConfig.UserIDClaim = "email"
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -125,7 +125,7 @@ func TestScope(t *testing.T) {
|
|||
|
||||
testCases := []struct {
|
||||
name string
|
||||
configuredType options.ProviderType
|
||||
configuredType options.ProviderType
|
||||
configuredScope string
|
||||
expectedScope string
|
||||
allowedGroups []string
|
||||
|
|
@ -133,23 +133,23 @@ func TestScope(t *testing.T) {
|
|||
{
|
||||
name: "oidc: with no scope provided",
|
||||
configuredScope: "",
|
||||
configuredType: "oidc",
|
||||
configuredType: "oidc",
|
||||
expectedScope: "openid email profile",
|
||||
},
|
||||
{
|
||||
name: "oidc: with no scope provided and groups",
|
||||
configuredType: "oidc",
|
||||
configuredType: "oidc",
|
||||
configuredScope: "",
|
||||
expectedScope: "openid email profile groups",
|
||||
allowedGroups: []string{"foo"},
|
||||
},
|
||||
{
|
||||
name: "oidc: with a configured scope provided",
|
||||
configuredType: "oidc",
|
||||
configuredType: "oidc",
|
||||
configuredScope: "openid",
|
||||
expectedScope: "openid",
|
||||
},
|
||||
{
|
||||
{
|
||||
name: "github: with no scope provided",
|
||||
configuredType: "github",
|
||||
configuredScope: "",
|
||||
|
|
@ -269,3 +269,4 @@ func TestEmailClaimCorrectlySet(t *testing.T) {
|
|||
g.Expect(pd.EmailClaim).To(Equal(tc.expectedEmailClaim))
|
||||
})
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue