Edgewall Software
Modify

Opened 10 years ago

Closed 10 years ago

Last modified 12 months ago

#11594 closed defect (fixed)

Email obfuscation for owner field in csv download

Reported by: Jun Omae Owned by: Jun Omae
Priority: normal Milestone: 0.12.6
Component: ticket system Version: 0.12-stable
Severity: normal Keywords: obfuscation
Cc: Branch:
Release Notes:

Obfuscate emails in owner field on csv download from ticket and query pages.

API Changes:
Internal Changes:

Description

If owner field has email address, csv download of ticket and query page renders the email address without obfuscation.

Csv download of report page doesn't have the issue.

Attachments (0)

Change History (6)

comment:1 by Jun Omae, 10 years ago

Keywords: obfuscation added

comment:2 by Jun Omae, 10 years ago

Milestone: next-minor-0.12.x0.12.6
Owner: set to Jun Omae
Status: newassigned

Proposed changes in jomae.git@t11594.

comment:3 by Ryan J Ollos, 10 years ago

The patch looks good.

Do you think it would be a good idea to define in the TicketSystem class the list of fields that might contain an email address? I quickly implemented a possible change in log:rjollos.git:t11594.2 (it would need more careful study and testing before committing).

On the one hand it would be nice to define the fields in a single location, however I worry that the change would clutter up the API too much, so maybe there is a better way. Also, we might want to consider this in another ticket so that it doesn't hold up this fix.

comment:4 by Jun Omae, 10 years ago

Thanks for response.

Trac currently handles as different from owner, reporter and cc field, but adding properties for email fields sounds good. (The owner and reporter have only one of username or email address. The cc field has multiple entries.)

Also, I don't think that @cached decorator is needed because fields properties is cached. The reason @cached is used for fields and custom_fields is retrieving values from trac.ini via self.config.

  • trac/ticket/api.py

    diff --git a/trac/ticket/api.py b/trac/ticket/api.py
    index 9722435..ab1c9c0 100644
    a b class TicketSystem(Component):  
    389389    def get_email_fields(self):
    390390        return copy.deepcopy(self.email_fields)
    391391
    392     @cached
    393     def email_fields(self, db):
     392    @property
     393    def email_fields(self):
    394394        return [f for f in self.fields
    395                 if f['name'] in ('reporter', 'owner', 'cc')]
     395                  if f['name'] in ('reporter', 'owner', 'cc')]
    396396
    397397    def get_time_fields(self):
    398398        return copy.deepcopy(self.time_fields)
    399399
    400     @cached
    401     def time_fields(self, db):
     400    @property
     401    def time_fields(self):
    402402        return [f for f in self.fields if f['type'] == 'time']
    403403
    404404    def get_field_synonyms(self):

comment:5 by Jun Omae, 10 years ago

Release Notes: modified (diff)
Resolution: fixed
Status: assignedclosed

Committed to 0.12-stable in [12766] and merged to 1.0-stable in [12767] and to trunk in [12768].

in reply to:  3 comment:6 by Ryan J Ollos, 9 years ago

Replying to rjollos:

Do you think it would be a good idea to define in the TicketSystem class the list of fields that might contain an email address? I quickly implemented a possible change in log:rjollos.git:t11594.2 (it would need more careful study and testing before committing).

Created #11861 to investigate this further.

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Jun Omae.
The resolution will be deleted. Next status will be 'reopened'.
to The owner will be changed from Jun Omae to the specified user.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.