#2296 Incorrect token status search filter
Closed: Fixed None Opened 8 years ago by edewata.

Currently searching tokens with TEMP_LOST, PERM_LOST, or DAMAGED status will always produce no results:

$ pki <admin auth> tps-token-find --status <status>

This is because when a token is stored into the database, the token status is split into two attributes (status and reason):

  • UNINITIALIZED -> status=uninitialized
  • ACTIVE -> status=active
  • TEMP_LOST -> status=lost and reason=onHold
  • PERM_LOST -> status=lost and reason=keyCompromise
  • DAMAGED -> status=lost and reason=destroyed
  • TERMINATED -> status=terminated

Notice that the TEMP_LOST, PERM_LOST, and DAMAGED are mapped into the same "lost" status, so searching with filter (status=<value>) will not match any entries in the database.

One option is to change the REST service to generate different filters depending on the status. So for UNINITIALIZED, ACTIVE, and TERMINATED it will use (status=<value>), but for the others it will use (&(status=<status>)(reason=<reason>)).

However, if a 3rd-party application wants to accessing the database directly, it will need to know how to generate the correct search filter.

A better option would be to store the actual token status in the status attribute. That way the search can always be done simply with (status=<value>).

To avoid database migration, this change should be done before general release.


Per CS/DS meeting of 04/25/2016: 10.3.0

  • Endi to check with Jack and Christina about fixing db structures

Jack and Christina agreed with the proposal assuming a migration strategy from older TPS will be devised later.

Fixed in master:

  • de1b8c44d442cac9d2d2209c28c2ef326f923baf

Metadata Update from @edewata:
- Issue assigned to edewata
- Issue set to the milestone: 10.3.1

7 years ago

Dogtag PKI is moving from Pagure issues to GitHub issues. This means that existing or new
issues will be reported and tracked through Dogtag PKI's GitHub Issue tracker.

This issue has been cloned to GitHub and is available here:
https://github.com/dogtagpki/pki/issues/2416

If you want to receive further updates on the issue, please navigate to the
GitHub issue and click on Subscribe button.

Thank you for understanding, and we apologize for any inconvenience.

Login to comment on this ticket.

Metadata