Skip to content
This repository was archived by the owner on Jun 11, 2025. It is now read-only.
14 changes: 1 addition & 13 deletions apps/websocket-server/internal/app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,23 +59,11 @@ var Module = fx.Module("app",

// Web socket route
a.Use("/ws", setUpgradable)
a.Use("/logs", setUpgradable)

a.Use("/logs", func(c *fiber.Ctx) error {
ctx := c.Context()

return websocket.New(func(sockConn *websocket.Conn) {
if err := d.HandleWebSocketForLogs(ctx, sockConn); err != nil {
logr.Errorf(err, "while handling websocket for logs")
}
})(c)
})

a.Use("/ws", func(c *fiber.Ctx) error {
ctx := c.Context()

return websocket.New(func(sockConn *websocket.Conn) {
if err := d.HandleWebSocketForRUpdate(ctx, sockConn); err != nil {
if err := d.HandleWebSocket(ctx, sockConn); err != nil {
logr.Errorf(err, "while handling websocket for resource update")
}
})(c)
Expand Down
4 changes: 0 additions & 4 deletions apps/websocket-server/internal/domain/commons.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,6 @@ func (d *domain) checkAccountAccess(ctx context.Context, accountName string, use
Action: string(action),
})

// if err != nil {
// return err
// }

if err != nil {
d.logger.Errorf(err, "iam.can check for action: ", action)
return errors.Newf("unauthorized to perform action: %s", action)
Expand Down
3 changes: 1 addition & 2 deletions apps/websocket-server/internal/domain/domain.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@ import (
)

type SocketService interface {
HandleWebSocketForRUpdate(ctx context.Context, c *websocket.Conn) error
HandleWebSocketForLogs(ctx context.Context, c *websocket.Conn) error
HandleWebSocket(ctx context.Context, c *websocket.Conn) error
}

type Domain interface {
Expand Down
Loading