Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WP-547: case insensitive email in GET tickets #944

Merged
merged 4 commits into from
Apr 12, 2024

Conversation

chandra-tacc
Copy link
Collaborator

@chandra-tacc chandra-tacc commented Apr 12, 2024

Overview

In cases, where email in RT Ticketing system is different case vs email address stored in Core Portal user list, a bug shows up where ticket list shows up, but viewing details of the ticket (get_ticket call) fails on access control in rtUtil.djangoRT module.

When searching for tickets, rtUtil.djangoRT uses Requestors__exact search. For this search, RT uses case insensitive. So, the user is able to see all the tickets.When opening a specific ticket, portal does case sensitive check for access to the ticket in requestors and cc fields.

RT search depends on the DB settings for case sensitivity. Search api __exact converts to = in sql.

Related

Changes

  • update djangoRT.hasAccess to do case insensitive look up for user.
  • Checked that no other code in djangoRT does a lookup on user.

Testing

  • Go to dashboard, check the following:
    • Ticket list shows up
    • Click on a ticket - pop up with all the details shows up.
    • reply to an existing ticket and it works.
  • Run unit tests with and without the fix.
  • Note: changing email case in django.contrib.auth.user_model is not setting request.user.email to upper case, request.user.email is always lower case in my tests.

UI

Notes

Copy link

codecov bot commented Apr 12, 2024

Codecov Report

Attention: Patch coverage is 77.77778% with 2 lines in your changes are missing coverage. Please review.

Project coverage is 64.81%. Comparing base (da11ca2) to head (da626bb).

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #944      +/-   ##
==========================================
+ Coverage   64.77%   64.81%   +0.03%     
==========================================
  Files         434      434              
  Lines       12474    12482       +8     
  Branches     2604     2603       -1     
==========================================
+ Hits         8080     8090      +10     
+ Misses       4165     4161       -4     
- Partials      229      231       +2     
Flag Coverage Δ
javascript 69.83% <ø> (ø)
unittests 59.73% <77.77%> (+0.08%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Coverage Δ
server/portal/apps/tickets/rtUtil.py 46.00% <77.77%> (+15.04%) ⬆️

@chandra-tacc chandra-tacc marked this pull request as ready for review April 12, 2024 13:36
Copy link
Contributor

@edmondsgarrett edmondsgarrett left a comment

Choose a reason for hiding this comment

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

tested, LGTM!

@chandra-tacc chandra-tacc merged commit 461e53c into main Apr 12, 2024
6 checks passed
@chandra-tacc chandra-tacc deleted the bug/WP-547-ticket-get branch April 12, 2024 17:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants