package jenkins.python.expoint; import javax.servlet.ServletRequest; import hudson.init.Initializer; import jenkins.model.Jenkins; import org.kohsuke.stapler.Stapler; import org.kohsuke.stapler.StaplerRequest; import org.kohsuke.stapler.WebApp; import org.kohsuke.stapler.export.Exported; import org.kohsuke.stapler.export.ExportedBean; import hudson.DescriptorExtensionList; import hudson.ExtensionPoint; import hudson.model.Api; import hudson.model.Describable; import hudson.model.Descriptor; import hudson.util.MultipartFormDataParser; import java.io.IOException; import java.io.OutputStream; import javax.servlet.ServletException; import org.kohsuke.accmod.Restricted; import org.kohsuke.accmod.restrictions.NoExternalUse; import org.kohsuke.stapler.QueryParameter; import org.kohsuke.stapler.StaplerResponse; import hudson.security.csrf.*; import hudson.security.csrf.CrumbIssuer.*; import jenkins.python.DataConvertor; import jenkins.python.PythonExecutor; /** * This class was automatically generated by the PWM tool on 2014/03/21. * @see hudson.security.csrf.CrumbIssuer */ public abstract class CrumbIssuerPW extends CrumbIssuer { private transient PythonExecutor pexec; private void initPython() { if (pexec == null) { pexec = new PythonExecutor(this); String[] jMethods = new String[2]; jMethods[0] = "issueCrumb"; jMethods[1] = "validateCrumb"; String[] pFuncs = new String[2]; pFuncs[0] = "issue_crumb"; pFuncs[1] = "validate_crumb"; Class[][] argTypes = new Class[2][]; argTypes[0] = new Class[2]; argTypes[0][0] = ServletRequest.class; argTypes[0][1] = String.class; argTypes[1] = new Class[3]; argTypes[1][0] = ServletRequest.class; argTypes[1][1] = String.class; argTypes[1][2] = String.class; pexec.checkAbstrMethods(jMethods, pFuncs, argTypes); String[] functions = new String[7]; functions[0] = "get_crumb_request_field"; functions[1] = "get_crumb"; functions[2] = "get_crumb"; functions[3] = "validate_crumb"; functions[4] = "validate_crumb"; functions[5] = "get_descriptor"; functions[6] = "get_api"; int[] argsCount = new int[7]; argsCount[0] = 0; argsCount[1] = 0; argsCount[2] = 1; argsCount[3] = 1; argsCount[4] = 2; argsCount[5] = 0; argsCount[6] = 0; pexec.registerFunctions(functions, argsCount); } } @Override public String issueCrumb(ServletRequest request, String salt) { initPython(); return (String) pexec.execPython("issue_crumb", request, salt); } @Override public boolean validateCrumb(ServletRequest request, String salt, String crumb) { initPython(); return pexec.execPythonBool("validate_crumb", request, salt, crumb); } @Override @Exported public String getCrumbRequestField() { initPython(); if (pexec.isImplemented(0)) { return (String) pexec.execPython("get_crumb_request_field"); } else { return super.getCrumbRequestField(); } } @Override @Exported public String getCrumb() { initPython(); if (pexec.isImplemented(1)) { return (String) pexec.execPython("get_crumb"); } else { return super.getCrumb(); } } @Override public String getCrumb(ServletRequest request) { initPython(); if (pexec.isImplemented(2)) { return (String) pexec.execPython("get_crumb", request); } else { return super.getCrumb(request); } } @Override public boolean validateCrumb(ServletRequest request) { initPython(); if (pexec.isImplemented(3)) { return pexec.execPythonBool("validate_crumb", request); } else { return super.validateCrumb(request); } } @Override public boolean validateCrumb(ServletRequest request, MultipartFormDataParser parser) { initPython(); if (pexec.isImplemented(4)) { return pexec.execPythonBool("validate_crumb", request, parser); } else { return super.validateCrumb(request, parser); } } @Override public CrumbIssuerDescriptor<CrumbIssuer> getDescriptor() { initPython(); if (pexec.isImplemented(5)) { return (CrumbIssuerDescriptor) pexec.execPython("get_descriptor"); } else { return super.getDescriptor(); } } @Override public Api getApi() { initPython(); if (pexec.isImplemented(6)) { return (Api) pexec.execPython("get_api"); } else { return super.getApi(); } } public String superGetCrumbRequestField() { return super.getCrumbRequestField(); } public String superGetCrumb() { return super.getCrumb(); } public String superGetCrumb(ServletRequest request) { return super.getCrumb(request); } public boolean superValidateCrumb(ServletRequest request) { return super.validateCrumb(request); } public boolean superValidateCrumb(ServletRequest request, MultipartFormDataParser parser) { return super.validateCrumb(request, parser); } public CrumbIssuerDescriptor<CrumbIssuer> superGetDescriptor() { return super.getDescriptor(); } public Api superGetApi() { return super.getApi(); } public Object execPython(String function, Object... params) { initPython(); return pexec.execPython(function, params); } public byte execPythonByte(String function, Object... params) { initPython(); return pexec.execPythonByte(function, params); } public short execPythonShort(String function, Object... params) { initPython(); return pexec.execPythonShort(function, params); } public char execPythonChar(String function, Object... params) { initPython(); return pexec.execPythonChar(function, params); } public int execPythonInt(String function, Object... params) { initPython(); return pexec.execPythonInt(function, params); } public long execPythonLong(String function, Object... params) { initPython(); return pexec.execPythonLong(function, params); } public float execPythonFloat(String function, Object... params) { initPython(); return pexec.execPythonFloat(function, params); } public double execPythonDouble(String function, Object... params) { initPython(); return pexec.execPythonDouble(function, params); } public boolean execPythonBool(String function, Object... params) { initPython(); return pexec.execPythonBool(function, params); } public void execPythonVoid(String function, Object... params) { initPython(); pexec.execPythonVoid(function, params); } }