Skip to content
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

Update TKS servlets to use @WebServlet #4564

Merged
merged 17 commits into from
Sep 14, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
314 changes: 0 additions & 314 deletions base/tks/shared/webapps/tks/WEB-INF/web.xml

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,17 @@
// --- END COPYRIGHT BLOCK ---
package com.netscape.cms.servlet.admin;

import javax.servlet.annotation.WebInitParam;
import javax.servlet.annotation.WebServlet;

@WebServlet(
name = "tksacl",
urlPatterns = "/acl",
initParams = {
@WebInitParam(name="ID", value="tksacl"),
@WebInitParam(name="AuthzMgr", value="BasicAclAuthz")
}
)
public class TKSACLAdminServlet extends ACLAdminServlet {
private static final long serialVersionUID = 1L;
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,17 @@
// --- END COPYRIGHT BLOCK ---
package com.netscape.cms.servlet.admin;

import javax.servlet.annotation.WebInitParam;
import javax.servlet.annotation.WebServlet;

@WebServlet(
name = "tksauths",
urlPatterns = "/auths",
initParams = {
@WebInitParam(name="ID", value="tksauths"),
@WebInitParam(name="AuthzMgr", value="BasicAclAuthz")
}
)
public class TKSAuthAdminServlet extends AuthAdminServlet {
private static final long serialVersionUID = 1L;
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@
// --- END COPYRIGHT BLOCK ---


import javax.servlet.annotation.WebInitParam;
import javax.servlet.annotation.WebServlet;

import org.dogtagpki.server.tks.TKSEngine;

import com.netscape.certsrv.common.Constants;
Expand All @@ -30,8 +33,18 @@
* level administrative operations such as configuration
* parameter updates.
*/
@WebServlet(
name = "tksserver",
urlPatterns = "/server",
initParams = {
@WebInitParam(name="ID", value="tksserver"),
@WebInitParam(name="AuthzMgr", value="BasicAclAuthz")
}
)
public class TKSCMSAdminServlet extends CMSAdminServlet {

private static final long serialVersionUID = 1L;

@Override
void readSubsystem(NameValuePairs params) {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,14 @@
// --- END COPYRIGHT BLOCK ---
package com.netscape.cms.servlet.admin;

// @WebServlet(
// name = "tksjobsScheduler",
// urlPatterns = "/jobsScheduler",
// initParams = {
// @WebInitParam(name="ID", value="tksjobsScheduler"),
// @WebInitParam(name="AuthzMgr", value="BasicAclAuthz")
// }
// )
public class TKSJobsAdminServlet extends JobsAdminServlet {
private static final long serialVersionUID = 1L;
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,17 @@
// --- END COPYRIGHT BLOCK ---
package com.netscape.cms.servlet.admin;

import javax.servlet.annotation.WebInitParam;
import javax.servlet.annotation.WebServlet;

@WebServlet(
name = "tkslog",
urlPatterns = "/log",
initParams = {
@WebInitParam(name="ID", value="tkslog"),
@WebInitParam(name="AuthzMgr", value="BasicAclAuthz")
}
)
public class TKSLogAdminServlet extends LogAdminServlet {
private static final long serialVersionUID = 1L;
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,17 @@
// --- END COPYRIGHT BLOCK ---
package com.netscape.cms.servlet.admin;

import javax.servlet.annotation.WebInitParam;
import javax.servlet.annotation.WebServlet;

@WebServlet(
name = "tksug",
urlPatterns = "/ug",
initParams = {
@WebInitParam(name="ID", value="tksug"),
@WebInitParam(name="AuthzMgr", value="BasicAclAuthz")
}
)
public class TKSUsrGrpAdminServlet extends UsrGrpAdminServlet {
private static final long serialVersionUID = 1L;
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,18 @@
// --- END COPYRIGHT BLOCK ---
package com.netscape.cms.servlet.base;

import javax.servlet.annotation.WebInitParam;
import javax.servlet.annotation.WebServlet;

@WebServlet(
name = "tksports",
urlPatterns = "/ee/tks/ports",
initParams = {
@WebInitParam(name="ID", value="tksports"),
@WebInitParam(name="GetClientCert", value="false"),
@WebInitParam(name="interface", value="ee")
}
)
public class TKSPortsServlet extends PortsServlet {
private static final long serialVersionUID = 1L;
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@

import javax.servlet.ServletConfig;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebInitParam;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

Expand All @@ -45,6 +47,18 @@
/**
* This servlet imports DRM's transport certificate into TKS.
*/
@WebServlet(
name = "tksImportTransportCert",
urlPatterns = "/admin/tks/importTransportCert",
initParams = {
@WebInitParam(name="GetClientCert", value="false"),
@WebInitParam(name="authority", value="tks"),
@WebInitParam(name="ID", value="tksImportTransportCert"),
@WebInitParam(name="AuthMgr", value="TokenAuth"),
@WebInitParam(name="AuthzMgr", value="BasicAclAuthz"),
@WebInitParam(name="resourceID", value="certServer.tks.importTransportCert")
}
)
public class ImportTransportCert extends CMSServlet {

public static org.slf4j.Logger logger = org.slf4j.LoggerFactory.getLogger(ImportTransportCert.class);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,22 @@
// --- END COPYRIGHT BLOCK ---
package com.netscape.cms.servlet.csadmin;

import javax.servlet.annotation.WebInitParam;
import javax.servlet.annotation.WebServlet;

@WebServlet(
name = "tksDownloadPKCS12",
urlPatterns = "/admin/console/config/savepkcs12",
initParams = {
@WebInitParam(name="GetClientCert", value="false"),
@WebInitParam(name="authority", value="tks"),
@WebInitParam(name="ID", value="tksDownloadPKCS12"),
@WebInitParam(name="interface", value="ee"),
@WebInitParam(name="AuthMgr", value="TokenAuth"),
@WebInitParam(name="AuthzMgr", value="BasicAclAuthz"),
@WebInitParam(name="resourceID", value="certServer.clone.configuration")
}
)
public class TKSDownloadPKCS12 extends DownloadPKCS12 {
private static final long serialVersionUID = 1L;
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,18 @@
// --- END COPYRIGHT BLOCK ---
package com.netscape.cms.servlet.csadmin;

import javax.servlet.annotation.WebInitParam;
import javax.servlet.annotation.WebServlet;

@WebServlet(
name = "tksGetStatus",
urlPatterns = "/admin/tks/getStatus",
initParams = {
@WebInitParam(name="GetClientCert", value="false"),
@WebInitParam(name="authority", value="tks"),
@WebInitParam(name="ID", value="tksGetStatus")
}
)
public class TKSGetStatus extends GetStatus {
private static final long serialVersionUID = 1L;
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,19 @@
// --- END COPYRIGHT BLOCK ---
package com.netscape.cms.servlet.csadmin;

import javax.servlet.annotation.WebInitParam;
import javax.servlet.annotation.WebServlet;

@WebServlet(
name = "services",
urlPatterns = "/services",
initParams = {
@WebInitParam(name="GetClientCert", value="false"),
@WebInitParam(name="authorityId", value="tks"),
@WebInitParam(name="ID", value="services"),
@WebInitParam(name="templatePath", value="/services.template")
}
)
public class TKSMainPageServlet extends MainPageServlet {
private static final long serialVersionUID = 1L;
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,22 @@
// --- END COPYRIGHT BLOCK ---
package com.netscape.cms.servlet.csadmin;

import javax.servlet.annotation.WebInitParam;
import javax.servlet.annotation.WebServlet;

@WebServlet(
name = "tksRegisterUser",
urlPatterns = "/admin/tks/registerUser",
initParams = {
@WebInitParam(name="GetClientCert", value="false"),
@WebInitParam(name="authority", value="tks"),
@WebInitParam(name="ID", value="tksRegisterUser"),
@WebInitParam(name="GroupName", value="Token Key Service Manager Agents"),
@WebInitParam(name="AuthMgr", value="TokenAuth"),
@WebInitParam(name="AuthzMgr", value="BasicAclAuthz"),
@WebInitParam(name="resourceID", value="certServer.tks.registerUser")
}
)
public class TKSRegisterUser extends RegisterUser {
private static final long serialVersionUID = 1L;
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,21 @@
// --- END COPYRIGHT BLOCK ---
package com.netscape.cms.servlet.csadmin;

import javax.servlet.annotation.WebInitParam;
import javax.servlet.annotation.WebServlet;

@WebServlet(
name = "tksGetConfigEntries",
urlPatterns = "/admin/tks/getConfigEntries",
initParams = {
@WebInitParam(name="GetClientCert", value="false"),
@WebInitParam(name="authority", value="tks"),
@WebInitParam(name="ID", value="tksGetConfigEntries"),
@WebInitParam(name="AuthzMgr", value="BasicAclAuthz"),
@WebInitParam(name="AuthMgr", value="TokenAuth"),
@WebInitParam(name="resourceID", value="certServer.clone.configuration.GetConfigEntries")
}
)
public class TPSGetConfigEntries extends GetConfigEntries {
private static final long serialVersionUID = 1L;
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,21 @@
// --- END COPYRIGHT BLOCK ---
package org.dogtagpki.server.tks.servlet;

import javax.servlet.annotation.WebInitParam;
import javax.servlet.annotation.WebServlet;

@WebServlet(
name = "tksCreateKeySetData",
urlPatterns = "/agent/tks/createKeySetData",
initParams = {
@WebInitParam(name="GetClientCert", value="true"),
@WebInitParam(name="AuthzMgr", value="BasicAclAuthz"),
@WebInitParam(name="ID", value="tksCreateKeySetData"),
@WebInitParam(name="template", value="index.template"),
@WebInitParam(name="resourceID", value="certServer.tks.keysetdata"),
@WebInitParam(name="AuthMgr", value="certUserDBAuthMgr")
}
)
public class TKSCreateKeySetData extends TokenServlet {
private static final long serialVersionUID = 1L;
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,21 @@
// --- END COPYRIGHT BLOCK ---
package org.dogtagpki.server.tks.servlet;

import javax.servlet.annotation.WebInitParam;
import javax.servlet.annotation.WebServlet;

@WebServlet(
name = "tksEncryptData",
urlPatterns = "/agent/tks/encryptData",
initParams = {
@WebInitParam(name="GetClientCert", value="true"),
@WebInitParam(name="AuthzMgr", value="BasicAclAuthz"),
@WebInitParam(name="ID", value="tksEncryptData"),
@WebInitParam(name="template", value="index.template"),
@WebInitParam(name="resourceID", value="certServer.tks.encrypteddata"),
@WebInitParam(name="AuthMgr", value="certUserDBAuthMgr")
}
)
public class TKSEncryptData extends TokenServlet {
private static final long serialVersionUID = 1L;
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,21 @@
// --- END COPYRIGHT BLOCK ---
package org.dogtagpki.server.tks.servlet;

import javax.servlet.annotation.WebInitParam;
import javax.servlet.annotation.WebServlet;

@WebServlet(
name = "tksRandomData",
urlPatterns = "/agent/tks/computeRandomData",
initParams = {
@WebInitParam(name="GetClientCert", value="true"),
@WebInitParam(name="AuthzMgr", value="BasicAclAuthz"),
@WebInitParam(name="ID", value="tksRandomData"),
@WebInitParam(name="template", value="index.template"),
@WebInitParam(name="resourceID", value="certServer.tks.randomdata"),
@WebInitParam(name="AuthMgr", value="certUserDBAuthMgr")
}
)
public class TKSRandomData extends TokenServlet {
private static final long serialVersionUID = 1L;
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,21 @@
// --- END COPYRIGHT BLOCK ---
package org.dogtagpki.server.tks.servlet;

import javax.servlet.annotation.WebInitParam;
import javax.servlet.annotation.WebServlet;

@WebServlet(
name = "tksSessionKey",
urlPatterns = "/agent/tks/computeSessionKey",
initParams = {
@WebInitParam(name="GetClientCert", value="true"),
@WebInitParam(name="AuthzMgr", value="BasicAclAuthz"),
@WebInitParam(name="ID", value="tksSessionKey"),
@WebInitParam(name="template", value="index.template"),
@WebInitParam(name="resourceID", value="certServer.tks.sessionkey"),
@WebInitParam(name="AuthMgr", value="certUserDBAuthMgr")
}
)
public class TKSSessionKey extends TokenServlet {
private static final long serialVersionUID = 1L;
}
Loading