Skip to content

Commit

Permalink
Fix indent
Browse files Browse the repository at this point in the history
  • Loading branch information
filip-daca committed Sep 12, 2022
1 parent 1c382bb commit e75c98b
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 28 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<packaging>hpi</packaging>
<properties>
<revision>1.7.4</revision>
<changelist>-SUMO</changelist>
<changelist>-SNAPSHOT</changelist>
<gitHubRepo>jenkinsci/reverse-proxy-auth-plugin</gitHubRepo>
<jenkins.version>2.334</jenkins.version>
<java.level>8</java.level>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -613,35 +613,35 @@ public String getPostLogOutUrl(StaplerRequest req, Authentication auth) {
public SecurityComponents createSecurityComponents() throws DataAccessException {
if (getLDAPURL() == null) {
proxyTemplate = new ReverseProxySearchTemplate();
DefaultReverseProxyAuthenticator authenticator = new DefaultReverseProxyAuthenticator(retrievedUser, authorities);
ReverseProxyAuthoritiesPopulatorImpl authoritiesPopulator = new ReverseProxyAuthoritiesPopulatorImpl(authContext);
ProviderManager pm = new ProviderManager();
List<AuthenticationProvider> providers = new ArrayList<>();
// talk to Reverse Proxy Authentication
providers.add(new ReverseProxyAuthenticationProvider(authenticator, authoritiesPopulator));
// these providers apply everywhere
RememberMeAuthenticationProvider rmap = new RememberMeAuthenticationProvider();
rmap.setKey(Jenkins.getInstance().getSecretKey());
providers.add(rmap);
// this doesn't mean we allow anonymous access.
// we just authenticate anonymous users as such,
// so that later authorization can reject them if so configured
AnonymousAuthenticationProvider aap = new AnonymousAuthenticationProvider();
aap.setKey("anonymous");
providers.add(aap);
pm.setProviders(providers);
DefaultReverseProxyAuthenticator authenticator = new DefaultReverseProxyAuthenticator(retrievedUser, authorities);
ReverseProxyAuthoritiesPopulatorImpl authoritiesPopulator = new ReverseProxyAuthoritiesPopulatorImpl(authContext);
ProviderManager pm = new ProviderManager();
List<AuthenticationProvider> providers = new ArrayList<>();
// talk to Reverse Proxy Authentication
providers.add(new ReverseProxyAuthenticationProvider(authenticator, authoritiesPopulator));
// these providers apply everywhere
RememberMeAuthenticationProvider rmap = new RememberMeAuthenticationProvider();
rmap.setKey(Jenkins.getInstance().getSecretKey());
providers.add(rmap);
// this doesn't mean we allow anonymous access.
// we just authenticate anonymous users as such,
// so that later authorization can reject them if so configured
AnonymousAuthenticationProvider aap = new AnonymousAuthenticationProvider();
aap.setKey("anonymous");
providers.add(aap);
pm.setProviders(providers);
return new SecurityComponents(pm, new ReverseProxyUserDetailsService(authoritiesPopulator));
} else {
DefaultInitialDirContextFactory dirContextFactory = new DefaultInitialDirContextFactory(getLDAPURL());
if (managerDN != null) {
dirContextFactory.setManagerDn(managerDN);
dirContextFactory.setManagerPassword(getManagerPassword());
}
Map<String, Object> envVars = new HashMap<>();
envVars.put(Context.REFERRAL, "follow");
envVars.put("com.sun.jndi.ldap.connect.timeout", Integer.toString(CONNECT_TIMEOUT));
envVars.put("com.sun.jndi.ldap.read.timeout", Integer.toString(READ_TIMEOUT));
dirContextFactory.setExtraEnvVars(envVars);
DefaultInitialDirContextFactory dirContextFactory = new DefaultInitialDirContextFactory(getLDAPURL());
if (managerDN != null) {
dirContextFactory.setManagerDn(managerDN);
dirContextFactory.setManagerPassword(getManagerPassword());
}
Map<String, Object> envVars = new HashMap<>();
envVars.put(Context.REFERRAL, "follow");
envVars.put("com.sun.jndi.ldap.connect.timeout", Integer.toString(CONNECT_TIMEOUT));
envVars.put("com.sun.jndi.ldap.read.timeout", Integer.toString(READ_TIMEOUT));
dirContextFactory.setExtraEnvVars(envVars);
ldapTemplate = new LdapTemplate(dirContextFactory);
FilterBasedLdapUserSearch ldapUserSearch = new FilterBasedLdapUserSearch(userSearchBase, userSearch, dirContextFactory);
ldapUserSearch.setSearchSubtree(true);
Expand Down

0 comments on commit e75c98b

Please sign in to comment.