dogtagpki / pki

The Dogtag Certificate System is an enterprise-class Certificate Authority (CA) which supports all aspects of certificate lifecycle management, including key archival, OCSP and smartcard management.
https://www.dogtagpki.org
GNU General Public License v2.0
374 stars 138 forks source link

Decouple core classes from Servlet classes. #2171

Open pki-bot opened 4 years ago

pki-bot commented 4 years ago

This issue was migrated from Pagure Issue #1612. Originally filed by ftweedal (@frasertweedale) on 2015-09-15 05:59:42:


From a discussion about the pattern of passing ServletRequests deep into the design of Dogtag:

I think the EnrollmentProcessor is getting the ID from "ca" parameter in HttpServletRequest directly instead of from the caUUID parameter. It should work fine since they will have the same value. However, I think in the long run the core classes should not rely on servlet classes. Ideally we should
be able to run an embedded CA without Tomcat (which will make it easier to write unit tests). So in this case it would be better to pass along the ID as method parameters to the EnrollmentProcessor.

You nailed it, Endi. I agree the current pattern (which I followed) is dubious. For my part, I will refactor to explicitly pass the CA ID rather than reading it from the ServletRequest, but it might not be in the very next patchset. Shall I file a ticket for the larger refactor to completely decouple the CA classes from Servlet?

Sure. If possible we should actually decouple all subsystems' core classes from Tomcat. This is going to take a while to complete. We probably will need to split it later into smaller tickets and spread them over several releases.

pki-bot commented 4 years ago

Comment from mharmsen (@mharmsen) at 2015-09-21 20:48:43

Per CS/DS meeting of 09/21/2015: 10.3

NOTE: This would help with Continuous Integration (CI) testing.

pki-bot commented 4 years ago

Comment from ftweedal (@frasertweedale) at 2017-02-27 14:05:34

Metadata Update from @frasertweedale: