Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 14 additions & 1 deletion internal/api/v1beta1connect/session.go
Original file line number Diff line number Diff line change
Expand Up @@ -105,5 +105,18 @@ func (h ConnectHandler) ListUserSessions(ctx context.Context, request *connect.R

// Revoke a specific session for a specific user (admin only).
func (h ConnectHandler) RevokeUserSession(ctx context.Context, request *connect.Request[frontierv1beta1.RevokeUserSessionRequest]) (*connect.Response[frontierv1beta1.RevokeUserSessionResponse], error) {
return nil, nil
if err := request.Msg.Validate(); err != nil {
return nil, connect.NewError(connect.CodeInvalidArgument, err)
}

sessionID, err := uuid.Parse(request.Msg.GetSessionId())
if err != nil {
return nil, status.Error(codes.InvalidArgument, "invalid session_id")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
return nil, status.Error(codes.InvalidArgument, "invalid session_id")
return nil, status.Error(connect.CodeInvalidArgument, "invalid session_id")

}

if err := h.sessionService.SoftDelete(ctx, sessionID, time.Now()); err != nil {
return nil, status.Error(codes.Internal, err.Error())
Copy link
Contributor

@AmanGIT07 AmanGIT07 Sep 12, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
return nil, status.Error(codes.Internal, err.Error())
return nil, status.Error(connect.CodeInternal, err.Error())

}

return connect.NewResponse(&frontierv1beta1.RevokeUserSessionResponse{}), nil
}
3 changes: 3 additions & 0 deletions pkg/server/connect_interceptors/authorization.go
Original file line number Diff line number Diff line change
Expand Up @@ -1109,6 +1109,9 @@ var authorizationValidationMap = map[string]func(ctx context.Context, handler *v
"/raystack.frontier.v1beta1.AdminService/GetCurrentAdminUser": func(ctx context.Context, handler *v1beta1connect.ConnectHandler, req connect.AnyRequest) error {
return handler.IsSuperUser(ctx)
},
"/raystack.frontier.v1beta1.AdminService/RevokeUserSession": func(ctx context.Context, handler *v1beta1connect.ConnectHandler, req connect.AnyRequest) error {
return handler.IsSuperUser(ctx)
},
}

func ensureRoleBelongToOrg(ctx context.Context, handler *v1beta1connect.ConnectHandler, orgID, roleID string) error {
Expand Down