-
Notifications
You must be signed in to change notification settings - Fork 137
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
Add TPS TPSCertService to v2 APIs #4827
Conversation
cb48bdc
to
f00e48f
Compare
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.
Please see my comments, the rest looks fine.
base/common/pom.xml
Outdated
<dependency> | ||
<groupId>org.apache.tomcat</groupId> | ||
<artifactId>tomcat-servlet-api</artifactId> | ||
<version>9.0.62</version> | ||
</dependency> | ||
|
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 common library (which is used by the client) should not depend on Servlet API. I'm not sure which code requires Servlet API, but it probably should be moved into the server library.
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.
OK, I think the problem is with the error codes I have introduced in a previous PR. I'll remove this change and handle it in a separate PR.
if (filter != null && filter.length() < PKIServlet.MIN_FILTER_LENGTH) { | ||
throw new BadRequestException("Filter is too short. Must be at least " + PKIServlet.MIN_FILTER_LENGTH + " characters."); | ||
} | ||
|
||
if(tokenID == null) { | ||
return findAllCerts(authorizedProfiles, filter, start, size); | ||
} | ||
|
||
Map<String, String> attributes = new HashMap<>(); | ||
if (tokenID != null) { | ||
attributes.put("tokenID", tokenID); | ||
} |
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.
IIRC the problem is that the Certs page in TPS Web UI will pull all cert records in order to count the total number of entries so the UI can display the paging links such as Page 1, Page 2, ... Page N. If there are a lot of certs, this page will take a long time to open since by default there's no filter to narrow down the search, so that's why the minimum filter length was added, or if the token ID is available it can also be used to narrow down the search.
I think ideally we should change the UI to no longer require knowing the total entries, so the paging link we need to provide is just Next Page as long as there are more certs to display, then we don't have to require a minimum filter anymore.
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.
OK, I have update the code to match current implementation and added a TODO to fix this behaviour when the UI will be fixed
f00e48f
to
2c17a5b
Compare
2c17a5b
to
4af29a0
Compare
Quality Gate passedIssues Measures |
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.
Thanks for the update! LGTM.
@edewata Thanks! |
@edewata The current implementation requires to specify the filter (see here). In the wiki page for the CLI this is not needed. If I try the same command with the current implementation I get
Additionally, the check on the filter is different to all the other cases.
For the v2 I have modified the filter to make it not mandatory and works like in the wiki page. Is this OK?