package jenkins.python.expoint; import groovy.lang.Binding; import hudson.ExtensionPoint; import hudson.DescriptorExtensionList; import hudson.Extension; import hudson.cli.CLICommand; import hudson.model.AbstractDescribableImpl; import hudson.model.Descriptor; import jenkins.model.Jenkins; import hudson.security.FederatedLoginService.FederatedIdentity; import hudson.security.captcha.CaptchaSupport; import hudson.util.DescriptorList; import hudson.util.PluginServletFilter; import hudson.util.spring.BeanBuilder; import org.acegisecurity.Authentication; import org.acegisecurity.AuthenticationManager; import org.acegisecurity.GrantedAuthorityImpl; import org.acegisecurity.GrantedAuthority; import org.acegisecurity.context.SecurityContext; import org.acegisecurity.context.SecurityContextHolder; import org.acegisecurity.ui.rememberme.RememberMeServices; import org.acegisecurity.userdetails.UserDetailsService; import org.acegisecurity.userdetails.UserDetails; import org.acegisecurity.userdetails.UsernameNotFoundException; import org.kohsuke.stapler.HttpResponse; import org.kohsuke.stapler.Stapler; import org.kohsuke.stapler.StaplerRequest; import org.kohsuke.stapler.StaplerResponse; import org.springframework.context.ApplicationContext; import org.springframework.web.context.WebApplicationContext; import org.springframework.dao.DataAccessException; import javax.servlet.Filter; import javax.servlet.FilterConfig; import javax.servlet.ServletException; import javax.servlet.http.HttpSession; import javax.servlet.http.Cookie; import java.io.IOException; import java.util.List; import java.util.Map; import java.util.logging.Level; import java.util.logging.Logger; import hudson.security.*; import hudson.security.SecurityRealm.*; import hudson.model.*; import hudson.model.AbstractDescribableImpl.*; import jenkins.python.DataConvertor; import jenkins.python.PythonExecutor; /** * This class was automatically generated by the PWM tool on 2014/03/21. * @see hudson.security.SecurityRealm */ public abstract class SecurityRealmPW extends SecurityRealm { private transient PythonExecutor pexec; private void initPython() { if (pexec == null) { pexec = new PythonExecutor(this); String[] jMethods = new String[1]; jMethods[0] = "createSecurityComponents"; String[] pFuncs = new String[1]; pFuncs[0] = "create_security_components"; Class[][] argTypes = new Class[1][]; argTypes[0] = new Class[0]; pexec.checkAbstrMethods(jMethods, pFuncs, argTypes); String[] functions = new String[16]; functions[0] = "create_cli_authenticator"; functions[1] = "get_descriptor"; functions[2] = "get_authentication_gateway_url"; functions[3] = "get_login_url"; functions[4] = "can_log_out"; functions[5] = "get_post_log_out_url"; functions[6] = "get_captcha_support"; functions[7] = "set_captcha_support"; functions[8] = "get_captcha_support_descriptors"; functions[9] = "do_logout"; functions[10] = "allows_signup"; functions[11] = "load_user_by_username"; functions[12] = "load_group_by_groupname"; functions[13] = "commence_signup"; functions[14] = "get_security_components"; functions[15] = "create_filter"; int[] argsCount = new int[16]; argsCount[0] = 1; argsCount[1] = 0; argsCount[2] = 0; argsCount[3] = 0; argsCount[4] = 0; argsCount[5] = 2; argsCount[6] = 0; argsCount[7] = 1; argsCount[8] = 0; argsCount[9] = 2; argsCount[10] = 0; argsCount[11] = 1; argsCount[12] = 1; argsCount[13] = 1; argsCount[14] = 0; argsCount[15] = 1; pexec.registerFunctions(functions, argsCount); } } @Override public SecurityComponents createSecurityComponents() { initPython(); return (SecurityComponents) pexec.execPython("create_security_components"); } @Override public CliAuthenticator createCliAuthenticator(final CLICommand command) { initPython(); if (pexec.isImplemented(0)) { return (CliAuthenticator) pexec.execPython("create_cli_authenticator", command); } else { return super.createCliAuthenticator(command); } } @Override public Descriptor<SecurityRealm> getDescriptor() { initPython(); if (pexec.isImplemented(1)) { return (Descriptor) pexec.execPython("get_descriptor"); } else { return super.getDescriptor(); } } @Override public String getAuthenticationGatewayUrl() { initPython(); if (pexec.isImplemented(2)) { return (String) pexec.execPython("get_authentication_gateway_url"); } else { return super.getAuthenticationGatewayUrl(); } } @Override public String getLoginUrl() { initPython(); if (pexec.isImplemented(3)) { return (String) pexec.execPython("get_login_url"); } else { return super.getLoginUrl(); } } @Override public boolean canLogOut() { initPython(); if (pexec.isImplemented(4)) { return pexec.execPythonBool("can_log_out"); } else { return super.canLogOut(); } } @Override public String getPostLogOutUrl(StaplerRequest req, Authentication auth) { initPython(); if (pexec.isImplemented(5)) { return (String) pexec.execPython("get_post_log_out_url", req, auth); } else { return super.getPostLogOutUrl(req, auth); } } @Override public CaptchaSupport getCaptchaSupport() { initPython(); if (pexec.isImplemented(6)) { return (CaptchaSupport) pexec.execPython("get_captcha_support"); } else { return super.getCaptchaSupport(); } } @Override public void setCaptchaSupport(CaptchaSupport captchaSupport) { initPython(); if (pexec.isImplemented(7)) { pexec.execPythonVoid("set_captcha_support", captchaSupport); } else { super.setCaptchaSupport(captchaSupport); } } @Override public List<Descriptor<CaptchaSupport>> getCaptchaSupportDescriptors() { initPython(); if (pexec.isImplemented(8)) { return (List) pexec.execPython("get_captcha_support_descriptors"); } else { return super.getCaptchaSupportDescriptors(); } } @Override public void doLogout(StaplerRequest req, StaplerResponse rsp) throws IOException, ServletException { initPython(); if (pexec.isImplemented(9)) { pexec.execPythonVoid("do_logout", req, rsp); } else { super.doLogout(req, rsp); } } @Override public boolean allowsSignup() { initPython(); if (pexec.isImplemented(10)) { return pexec.execPythonBool("allows_signup"); } else { return super.allowsSignup(); } } @Override public UserDetails loadUserByUsername(String username) throws UsernameNotFoundException, DataAccessException { initPython(); if (pexec.isImplemented(11)) { return (UserDetails) pexec.execPython("load_user_by_username", username); } else { return super.loadUserByUsername(username); } } @Override public GroupDetails loadGroupByGroupname(String groupname) throws UsernameNotFoundException, DataAccessException { initPython(); if (pexec.isImplemented(12)) { return (GroupDetails) pexec.execPython("load_group_by_groupname", groupname); } else { return super.loadGroupByGroupname(groupname); } } @Override public HttpResponse commenceSignup(FederatedIdentity identity) { initPython(); if (pexec.isImplemented(13)) { return (HttpResponse) pexec.execPython("commence_signup", identity); } else { return super.commenceSignup(identity); } } @Override public synchronized SecurityComponents getSecurityComponents() { initPython(); if (pexec.isImplemented(14)) { return (SecurityComponents) pexec.execPython("get_security_components"); } else { return super.getSecurityComponents(); } } @Override public Filter createFilter(FilterConfig filterConfig) { initPython(); if (pexec.isImplemented(15)) { return (Filter) pexec.execPython("create_filter", filterConfig); } else { return super.createFilter(filterConfig); } } public CliAuthenticator superCreateCliAuthenticator(final CLICommand command) { return super.createCliAuthenticator(command); } public Descriptor<SecurityRealm> superGetDescriptor() { return super.getDescriptor(); } public String superGetAuthenticationGatewayUrl() { return super.getAuthenticationGatewayUrl(); } public String superGetLoginUrl() { return super.getLoginUrl(); } public boolean superCanLogOut() { return super.canLogOut(); } public String superGetPostLogOutUrl(StaplerRequest req, Authentication auth) { return super.getPostLogOutUrl(req, auth); } public CaptchaSupport superGetCaptchaSupport() { return super.getCaptchaSupport(); } public void superSetCaptchaSupport(CaptchaSupport captchaSupport) { super.setCaptchaSupport(captchaSupport); } public List<Descriptor<CaptchaSupport>> superGetCaptchaSupportDescriptors() { return super.getCaptchaSupportDescriptors(); } public void superDoLogout(StaplerRequest req, StaplerResponse rsp) throws IOException, ServletException { super.doLogout(req, rsp); } public boolean superAllowsSignup() { return super.allowsSignup(); } public UserDetails superLoadUserByUsername(String username) throws UsernameNotFoundException, DataAccessException { return super.loadUserByUsername(username); } public GroupDetails superLoadGroupByGroupname(String groupname) throws UsernameNotFoundException, DataAccessException { return super.loadGroupByGroupname(groupname); } public HttpResponse superCommenceSignup(FederatedIdentity identity) { return super.commenceSignup(identity); } public synchronized SecurityComponents superGetSecurityComponents() { return super.getSecurityComponents(); } public Filter superCreateFilter(FilterConfig filterConfig) { return super.createFilter(filterConfig); } 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); } }