Skip to content

Commit

Permalink
Bypass authorization (#36)
Browse files Browse the repository at this point in the history
* Bypass authorization for non-write operations for non-logged in users

* Disable authorization middleware & jwt wrapper middleware
  • Loading branch information
james03160927 authored Jun 15, 2024
1 parent 7dc4782 commit 70189ff
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions server/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -93,9 +93,10 @@ func (s *Server) Start() error {
// Attach implementation of generated oapi strict server.
impl := implementation.NewStrictServerImplementation(s.Client, s.Config, storageService, slackService)

middlewares := []generated.StrictMiddlewareFunc{
drip_middleware.AuthorizationMiddleware(s.Client),
}
var middlewares []generated.StrictMiddlewareFunc
//middlewares := []generated.StrictMiddlewareFunc{
// drip_middleware.AuthorizationMiddleware(s.Client),
//}
wrapped := generated.NewStrictHandler(impl, middlewares)

generated.RegisterHandlers(e, wrapped)
Expand All @@ -107,9 +108,10 @@ func (s *Server) Start() error {

// Global Middlewares
e.Use(drip_middleware.MetricsMiddleware(mon, s.Config))
e.Use(
drip_middleware.JWTWrapperMiddleware(s.Client, s.Config.JWTSecret,
drip_middleware.FirebaseMiddleware(s.Client)))
//e.Use(
// drip_middleware.JWTWrapperMiddleware(s.Client, s.Config.JWTSecret,
// drip_middleware.FirebaseMiddleware(s.Client)))
e.Use(drip_middleware.FirebaseMiddleware(s.Client))
e.Use(drip_middleware.ServiceAccountAuthMiddleware())
e.Use(drip_middleware.ErrorLoggingMiddleware())

Expand Down

0 comments on commit 70189ff

Please sign in to comment.