Class DynamicVariablesServlet
java.lang.Object
javax.servlet.GenericServlet
javax.servlet.http.HttpServlet
com.netscape.cms.servlet.base.CMSServlet
com.netscape.cms.servlet.base.DynamicVariablesServlet
- All Implemented Interfaces:
Serializable, javax.servlet.Servlet, javax.servlet.ServletConfig
Return some javascript to the request which contains the list of
dynamic data in the CMS system.
This allows the requestor (browser) to make decisions about what to present in the UI, depending on how CMS is configured
- Version:
- $Revision$, $Date$
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final StringFields inherited from class CMSServlet
ADMIN_GROUP, AUTH_FAILURE, AUTHMGR_PARAM, AUTHZ_MGR_BASIC, AUTHZ_MGR_LDAP, AUTHZ_SRC_LDAP, AUTHZ_SRC_TYPE, AUTHZ_SRC_XML, CA_AGENT_GROUP, CERT_ATTR, certAuthority, engine, ERROR_MSG_TOKEN, ERROR_TEMPLATE, EXCEPTION_TEMPLATE, FAILURE, FINAL_ERROR_MSG, FULL_ENROLLMENT_REQUEST, FULL_ENROLLMENT_RESPONSE, FULL_RESPONSE, KRA_AGENT_GROUP, logger, mAclMethod, mAuthority, mAuthz, mAuthzResourceName, mConfig, mDontSaveHttpParams, mFinalErrorMsg, mId, mLogCategory, mOutputTemplatePath, mRenderResult, mRequestQueue, mSaveHttpHeaders, mServletConfig, mServletContext, mTemplates, OCSP_AGENT_GROUP, PENDING_TEMPLATE, PFX_AUTH_TOKEN, PFX_HTTP_HEADER, PFX_HTTP_PARAM, PROP_ACL, PROP_AUTHORITYID, PROP_AUTHZ_MGR, PROP_ERROR_TEMPLATE, PROP_EXCEPTION_TEMPLATE, PROP_FINAL_ERROR_MSG, PROP_ID, PROP_PENDING_TEMPLATE, PROP_REJECTED_TEMPLATE, PROP_RESOURCEID, PROP_SUCCESS_TEMPLATE, PROP_SUCCESS_TEMPLATE_FILLER, PROP_SVC_PENDING_TEMPLATE, PROP_UNAUTHORIZED_TEMPLATE, RA_AGENT_GROUP, REJECTED_TEMPLATE, requestRepository, servletConfig, signedAuditLogger, SIMPLE_ENROLLMENT_REQUEST, SIMPLE_ENROLLMENT_RESPONSE, SUCCESS, SUCCESS_TEMPLATE, SVC_PENDING_TEMPLATE, TEMPLATE_NAME, TRUSTED_RA_GROUP, UNAUTHORIZED_TEMPLATEModifier and TypeFieldDescriptionprotected static final Stringstatic final Stringprotected static final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringprotected static final Stringstatic final Stringprotected ICertificateAuthorityprotected CMSEnginestatic final Stringprotected static final Stringprotected static final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic Stringhandy routine to check if client want full enrollment responseprotected static final Stringstatic org.slf4j.Loggerprotected Stringprotected IAuthorityprotected AuthzSubsystemprotected Stringprotected IConfigStoreprotected Stringprotected Stringprotected LogSourceprotected Stringprotected booleanprotected ARequestQueueprotected javax.servlet.ServletConfigprotected javax.servlet.ServletContextprotected Hashtable<Integer, CMSLoadTemplate> protected static final Stringprotected static final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringprotected static final Stringprotected static final Stringstatic final Stringstatic final Stringprotected static final Stringprotected static final Stringstatic final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected RequestRepositoryprotected javax.servlet.ServletConfigprotected static Loggerstatic final Stringstatic final Stringstatic final Stringprotected static final Stringprotected static final Stringstatic final Stringprotected static final Stringprotected static final String -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns serlvet information.voidinit(javax.servlet.ServletConfig sc) Reads the following variables from the servlet config: AuthMgr - the authentication manager to use to authenticate the request GetClientCert - whether to request client auth for this request authority - the authority (ca, ra, drm) to return to the client dynamicVariables - a string of the form: serverdate=serverdate(),subsystemname=subsystemname(), http=http(),authmgrs=authmgrs(),clacrlurl=clacrlurl() The dynamicVariables string is parsed by splitting on commas.voidservice(javax.servlet.http.HttpServletRequest httpReq, javax.servlet.http.HttpServletResponse httpResp) Methods inherited from class CMSServlet
areCertsFromCA, audit, audit, auditGroupID, auditSubjectID, authenticate, authenticate, authenticate, authenticate, authorize, authorize, certIsRevoked, checkImportCertToNav, clientIsMSIE, clientIsNav, connectionIsSSL, doCMMFResponse, doFullResponse, formCRLEntry, generateSalt, getAuthCreds, getAuthMgr, getAuthToken, getCertRecord, getDontSaveHttpParams, getId, getLangFile, getLocale, getLocale, getRelPath, getSaveHttpHeaders, getSSLClientCertificate, getSSLClientCertificate, getTemplate, getX509Certificate, hashPassword, importCertToNav, invalidateSSLSession, isCertFromCA, isClientCertRequired, isSystemCertificate, newCMSRequest, newFillerObject, outputArgBlockAsXML, outputError, outputError, outputError, outputHttpParameters, outputResult, outputXML, process, renderException, renderFinalError, renderResult, renderTemplate, saveAuthToken, saveHttpHeaders, saveHttpParams, setDefaultTemplates, toHashtableModifier and TypeMethodDescriptionprotected booleanareCertsFromCA(X509Certificate[] certs) handy routine for checking if a list of certs is from this CA.protected voidprotected voidSigned Audit Log This method is inherited by all extended "CMSServlet"s, and is called to store messages to the signed audit log.protected StringSigned Audit Log Group ID This method is inherited by all extended "CMSServlet"s, and is called to obtain the "gid" for a signed audit log message.protected StringSigned Audit Log Subject ID This method is inherited by all extended "CMSServlet"s, and is called to obtain the "SubjectID" for a signed audit log message.authenticate(CMSRequest req) authenticate(CMSRequest req, String authMgrName) authenticate(javax.servlet.http.HttpServletRequest httpReq) authenticate(javax.servlet.http.HttpServletRequest httpReq, String authMgrName) Authenticationauthorize(String authzMgrName, IAuthToken authToken, String resource, String operation) Authorize must occur after Authenticateauthorize(String authzMgrName, String resource, IAuthToken authToken, String exp) protected booleancertIsRevoked(BigInteger serialNum) check if a certificate (serial number) is revoked on a CA.protected booleancheckImportCertToNav(javax.servlet.http.HttpServletResponse httpResp, IArgBlock httpParams, org.mozilla.jss.netscape.security.x509.X509CertImpl cert) static booleanclientIsMSIE(javax.servlet.http.HttpServletRequest httpReq) handy routine to check if client is msie based on user-agent.static booleanclientIsNav(javax.servlet.http.HttpServletRequest httpReq) handy routine to check if client is navigator based on user-agent.protected static booleanconnectionIsSSL(javax.servlet.http.HttpServletRequest httpReq) static booleandoCMMFResponse(IArgBlock httpParams) static booleandoFullResponse(IArgBlock httpParams) protected org.mozilla.jss.netscape.security.x509.RevokedCertImplformCRLEntry(BigInteger serialNo, org.mozilla.jss.netscape.security.x509.RevocationReason reason) make a CRL entry from a serial number and revocation reason.static Stringstatic AuthCredentialsgetAuthCreds(AuthManager authMgr, IArgBlock argBlock, X509Certificate clientCert) construct a authentication credentials to pass into authentication manager.protected IAuthTokengetAuthToken(IRequest req) protected CertRecordgetCertRecord(BigInteger serialNo) handy routine for getting a cert record given a serial number.protected voidgetDontSaveHttpParams(javax.servlet.ServletConfig sc) get http parameters not to save from configuration.getId()static FilegetLangFile(javax.servlet.http.HttpServletRequest req, File realpathFile, Locale[] locale) static Localeprotected LocalegetLocale(javax.servlet.http.HttpServletRequest req) Retrieves locale based on the request.protected StringgetRelPath(IAuthority authority) handy routine for getting agent's relative pathprotected voidgetSaveHttpHeaders(javax.servlet.ServletConfig sc) get http headers to save from configuration.protected X509CertificategetSSLClientCertificate(javax.servlet.http.HttpServletRequest httpReq) get ssl client authenticated certificateprotected X509CertificategetSSLClientCertificate(javax.servlet.http.HttpServletRequest httpReq, boolean clientCertRequired) protected CMSTemplategetTemplate(String templateName, javax.servlet.http.HttpServletRequest httpReq, Locale[] locale) get a template based on result status.protected X509CertificategetX509Certificate(BigInteger serialNo) handy routine for getting a certificate from the certificate repository.protected StringhashPassword(String pwd) voidimportCertToNav(javax.servlet.http.HttpServletResponse httpResp, org.mozilla.jss.netscape.security.x509.X509CertImpl cert, String contentType, boolean importCAChain) handy routine to import cert to old navigator in nav mime type.protected static voidinvalidateSSLSession(javax.servlet.http.HttpServletRequest httpReq) Invalidates a SSL Session.protected booleanisCertFromCA(X509Certificate cert) handy routine for validating if a cert is from this CA.booleanprotected booleanisSystemCertificate(BigInteger serialNo) A system certificate such as the CA signing certificate should not be allowed to delete.protected CMSRequestCreate a new CMSRequest object.protected ICMSTemplateFillernewFillerObject(String fillerClass) instantiate a new filler from a class name,protected voidoutputArgBlockAsXML(XMLObject xmlObj, Node parent, String argBlockName, IArgBlock argBlock) protected voidoutputError(javax.servlet.http.HttpServletResponse httpResp, String errorString) protected voidoutputError(javax.servlet.http.HttpServletResponse httpResp, String errorString, String requestId) protected voidoutputError(javax.servlet.http.HttpServletResponse httpResp, String status, String errorString, String requestId) voidoutputHttpParameters(javax.servlet.http.HttpServletRequest httpReq) protected voidoutputResult(javax.servlet.http.HttpServletResponse httpResp, String contentType, byte[] content) protected voidoutputXML(javax.servlet.http.HttpServletResponse httpResp, CMSTemplateParams params) protected voidprocess(CMSRequest cmsRequest) process an HTTP request.protected voidrenderException(CMSRequest cmsReq, EBaseException e) Output exception (unexpected error) template This is different from other templates in that if an exception occurs while rendering the exception a message is printed out directly.voidrenderFinalError(CMSRequest cmsReq, Exception ex) protected voidrenderResult(CMSRequest cmsReq) Output a template.protected voidrenderTemplate(CMSRequest cmsReq, String templateName, ICMSTemplateFiller filler) protected static voidsaveAuthToken(IAuthToken token, IRequest req) protected voidsaveHttpHeaders(javax.servlet.http.HttpServletRequest httpReq, IRequest req) save http headers in a IRequest.protected voidsaveHttpParams(IArgBlock httpParams, IRequest req) save http headers in a IRequest.protected voidsetDefaultTemplates(javax.servlet.ServletConfig sc) set default templates.toHashtable(javax.servlet.http.HttpServletRequest req) Methods inherited from class javax.servlet.http.HttpServlet
doDelete, doGet, doHead, doOptions, doPost, doPut, doTrace, getLastModified, serviceMethods inherited from class javax.servlet.GenericServlet
destroy, getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletName, init, log, log
-
Field Details
-
PROP_ACCESS
- See Also:
-
PROP_AUTHMGR
- See Also:
-
PROP_CLIENTAUTH
- See Also:
-
PROP_AUTHORITY
- See Also:
-
PROP_CLONING
- See Also:
-
-
Constructor Details
-
DynamicVariablesServlet
public DynamicVariablesServlet()
-
-
Method Details
-
getServletInfo
Returns serlvet information.- Specified by:
getServletInfoin interfacejavax.servlet.Servlet- Overrides:
getServletInfoin classjavax.servlet.GenericServlet
-
init
public void init(javax.servlet.ServletConfig sc) throws javax.servlet.ServletException Reads the following variables from the servlet config:- AuthMgr - the authentication manager to use to authenticate the request
- GetClientCert - whether to request client auth for this request
- authority - the authority (ca, ra, drm) to return to the client
- dynamicVariables - a string of the form: serverdate=serverdate(),subsystemname=subsystemname(), http=http(),authmgrs=authmgrs(),clacrlurl=clacrlurl()
Each sub expression "lhs=rhs()" forms a javascript statement of the form lhs=xxx; Where lhs is xxx is the result of 'evaluating' the rhs. The possible values for the rhs() function are:
- serverdate() - the timestamp of the server (used to ensure that the client clock is set correctly)
- subsystemname()
- http() - "true" or "false" - is this an http connection (as opposed to https)
- authmgrs() - a comma separated list of authentication managers
- clacrlurl() - the URL to get the CRL from, in the case of a Clone CA. This is defined in the CMS configuration parameter 'cloning.cloneMasterCrlUrl'
- Specified by:
initin interfacejavax.servlet.Servlet- Overrides:
initin classCMSServlet- Throws:
javax.servlet.ServletException- See Also:
-
service
public void service(javax.servlet.http.HttpServletRequest httpReq, javax.servlet.http.HttpServletResponse httpResp) throws javax.servlet.ServletException, IOException - Overrides:
servicein classCMSServlet- Throws:
javax.servlet.ServletExceptionIOException
-