Skip to content

Commit

Permalink
Fixing format for v7.5.0
Browse files Browse the repository at this point in the history
  • Loading branch information
l-lafin committed Jul 11, 2024
1 parent ad81d2f commit e645994
Show file tree
Hide file tree
Showing 16 changed files with 23 additions and 22 deletions.
2 changes: 1 addition & 1 deletion pkg/apis/options/load_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
Expand Down
6 changes: 3 additions & 3 deletions pkg/apis/options/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"`
Expand Down Expand Up @@ -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(),
Expand Down Expand Up @@ -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])")
Expand Down
2 changes: 1 addition & 1 deletion pkg/apis/sessions/interfaces.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
2 changes: 1 addition & 1 deletion pkg/sessions/cookie/session_store.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package cookie

import (
"context"
"context"
"errors"
"fmt"
"net/http"
Expand Down
2 changes: 1 addition & 1 deletion pkg/sessions/persistence/interfaces.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
2 changes: 1 addition & 1 deletion pkg/sessions/persistence/manager.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package persistence

import (
"context"
"context"
"fmt"
"net/http"
"time"
Expand Down
2 changes: 1 addition & 1 deletion pkg/sessions/redis/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion pkg/sessions/redis/lock.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion pkg/sessions/redis/redis_store.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion pkg/sessions/redis/redis_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion pkg/sessions/tests/session_store_tests.go
Original file line number Diff line number Diff line change
Expand Up @@ -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())
})
Expand Down
2 changes: 1 addition & 1 deletion providers/gitlab.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 == "" {
Expand Down
2 changes: 1 addition & 1 deletion providers/keycloak_oidc.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
})

Expand Down
2 changes: 1 addition & 1 deletion providers/nextcloud.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion providers/providers.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}

Expand Down
11 changes: 6 additions & 5 deletions providers/providers_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -125,31 +125,31 @@ func TestScope(t *testing.T) {

testCases := []struct {
name string
configuredType options.ProviderType
configuredType options.ProviderType
configuredScope string
expectedScope string
allowedGroups []string
}{
{
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: "",
Expand Down Expand Up @@ -269,3 +269,4 @@ func TestEmailClaimCorrectlySet(t *testing.T) {
g.Expect(pd.EmailClaim).To(Equal(tc.expectedEmailClaim))
})
}
}

0 comments on commit e645994

Please sign in to comment.