Skip to content

Commit

Permalink
server: purge redundant bool oidc bool flag check
Browse files Browse the repository at this point in the history
  • Loading branch information
joelrebel committed Mar 27, 2024
1 parent da806d8 commit 7dee9ed
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions internal/server/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ var (
// Server type holds attributes of the condition orc server
type Server struct {
// Logger is the app logger
authRequired bool
authMWConfigs []ginjwt.AuthConfig
logger *logrus.Logger
streamBroker events.Stream
Expand Down Expand Up @@ -90,7 +89,6 @@ func WithConditionDefinitions(defs rctypes.Definitions) Option {
// WithAuthMiddlewareConfig sets the auth middleware configuration.
func WithAuthMiddlewareConfig(authMWConfigs []ginjwt.AuthConfig) Option {
return func(s *Server) {
s.authRequired = true
s.authMWConfigs = authMWConfigs
}
}
Expand All @@ -116,7 +114,7 @@ func New(opts ...Option) *http.Server {
}

// add auth middleware
if s.authRequired {
if s.authMWConfigs != nil {
authMW, err := ginjwt.NewMultiTokenMiddlewareFromConfigs(s.authMWConfigs...)
if err != nil {
s.logger.Fatal("failed to initialize auth middleware: ", err)
Expand Down

0 comments on commit 7dee9ed

Please sign in to comment.