-
Notifications
You must be signed in to change notification settings - Fork 139
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
Key repository free vlv #4755
Key repository free vlv #4755
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have one question, but if it works properly feel free to merge.
|
||
if (serial_low_bound == null | ||
|| serial_upper_bound == null || serial_low_bound.compareTo(serial_upper_bound) >= 0) { | ||
return null; | ||
} | ||
|
||
String ldapfilter = "(" + "serialno" + "=*" + ")"; | ||
String ldapfilter = "(&(" + "serialno" + "=*" + ")(" + KeyRecord.ATTR_ID + "<="+serial_upper_bound+"))"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the (serialno=*)
is no longer needed since all key records have serialno
(it was probably added since the filter can't be empty), but it's fine to leave it there.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we use serialno
or keySerialNumber
in this filter? I'm not too familiar with this area, but sometimes the filter needs to be defined using the record attributes (e.g keySerialNumber
) and sometimes it needs to be defined using the actual LDAP attributes (.e.g serialno
). The mapping is defined here:
https://github.com/dogtagpki/pki/blob/master/base/kra/src/main/java/com/netscape/cmscore/dbs/KeyRepository.java#L101-L103
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In this case it is OK to use serialno
because it is the name of the attribute stored in the DS entry and it has to collect everything. The keySerialNumber
is derived from serialno
and contain the real serial number to use (the value stored in the DS has a special format which allow to order by serialno
even it is a string).
Nevertheless, I totally agree that we can remove this condition since it is always valid. I have done some test without and it is OK.
Methods to find keys using VLV indexes have been deprecated. All their usage inside the KeyRepository have been replaced with paged search based query.
The filter can be simplified removing the first condition in the and ('&') since it always true for all the records. Additionally, some tidyup fixing log format, array designators and other minor improvements.
8930207
to
58a2dc4
Compare
|
@edewata Python test is failing: https://github.com/dogtagpki/pki/actions/runs/9284603772/job/25547705011?pr=4755 |
@edewata Thanks! I have updated as for the above comment |
No description provided.