Skip to content

Commit 5a9606c

Browse files
committed
work
1 parent 9e3c2bd commit 5a9606c

File tree

2 files changed

+6
-182
lines changed

2 files changed

+6
-182
lines changed

pom.xml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -59,12 +59,12 @@
5959
</site>
6060
<repository>
6161
<id>central</id>
62-
<name>tw-thinkpad-releases</name>
62+
<name>libs-release-local</name>
6363
<url>file://${user.home}/public_html/java/libs-release-local</url>
6464
</repository>
6565
<snapshotRepository>
6666
<id>snapshots</id>
67-
<name>tw-thinkpad-snapshots</name>
67+
<name>libs-snapshot-local</name>
6868
<url>file://${user.home}/public_html/java/libs-snapshot-local</url>
6969
</snapshotRepository>
7070
</distributionManagement>
@@ -74,7 +74,7 @@
7474
<version.maven>3.6.3</version.maven>
7575
<maven.compiler.source>${version.java}</maven.compiler.source>
7676
<maven.compiler.target>${version.java}</maven.compiler.target>
77-
<version.java>${java.version}</version.java>
77+
<java.version>${version.java}</java.version>
7878
<spring-boot.repackage.layout>JAR</spring-boot.repackage.layout>
7979
<version.spring-boot-maven-plugin>${project.parent.version}</version.spring-boot-maven-plugin>
8080
<version.thymeleaf-testing>3.1.0.M2</version.thymeleaf-testing>
@@ -119,7 +119,7 @@
119119

120120
<!-- UML -->
121121
<version.plantuml-maven-plugin>1.5.2</version.plantuml-maven-plugin>
122-
<version.plantuml-maven-plugin.plantuml>1.2022.6</version.plantuml-maven-plugin.plantuml>
122+
<version.plantuml-maven-plugin.plantuml>1.2022.14</version.plantuml-maven-plugin.plantuml>
123123

124124
<version.maven-invoker-plugin>3.3.0</version.maven-invoker-plugin>
125125
<version.maven-clean-plugin>3.2.0</version.maven-clean-plugin>
@@ -1530,7 +1530,7 @@
15301530
</profile>
15311531

15321532
<profile>
1533-
<id>site</id>
1533+
<id>build</id>
15341534
<activation>
15351535
<activeByDefault>false</activeByDefault>
15361536
</activation>

src/main/java/org/woehlke/java/simpleworklist/config/WebSecurityConfig.java

Lines changed: 1 addition & 177 deletions
Original file line numberDiff line numberDiff line change
@@ -34,25 +34,16 @@
3434
})
3535
@EnableWebSecurity
3636
@EnableMethodSecurity(securedEnabled = true)
37-
public class WebSecurityConfig /* extends WebSecurityConfigurerAdapter implements WebSecurityConfigurer<WebSecurity> */ {
37+
public class WebSecurityConfig {
3838

39-
//private final AuthenticationManagerBuilder authenticationManagerBuilder;
40-
//private final AuthenticationSuccessHandler authenticationSuccessHandler;
41-
//private final AuthenticationManager authenticationManager;
4239
private final ApplicationUserDetailsService applicationUserDetailsService;
4340
private final SimpleworklistProperties simpleworklistProperties;
4441

4542
@Autowired
4643
public WebSecurityConfig(
47-
//AuthenticationManagerBuilder auth,
48-
//AuthenticationSuccessHandler authenticationSuccessHandler,
49-
//AuthenticationManager authenticationManager,
5044
ApplicationUserDetailsService applicationUserDetailsService,
5145
SimpleworklistProperties simpleworklistProperties
5246
) {
53-
//this.authenticationManagerBuilder = auth;
54-
//this.authenticationSuccessHandler = authenticationSuccessHandler;
55-
//this.authenticationManager = authenticationManager;
5647
this.applicationUserDetailsService = applicationUserDetailsService;
5748
this.simpleworklistProperties = simpleworklistProperties;
5849
}
@@ -72,173 +63,6 @@ public PasswordEncoder encoder(){
7263
return new BCryptPasswordEncoder(strength);
7364
}
7465

75-
/*
76-
@Bean
77-
public AuthenticationManager authenticationManager() throws Exception {
78-
return authenticationManagerBuilder
79-
.userDetailsService(userDetailsService())
80-
.passwordEncoder(encoder()).and().build();
81-
}
82-
*/
83-
84-
/*
85-
@Bean
86-
public AuthenticationManager authenticationManager(
87-
AuthenticationConfiguration authenticationConfiguration
88-
) throws Exception {
89-
return authenticationConfiguration.getAuthenticationManager();
90-
}
91-
92-
@Bean
93-
public UsernamePasswordAuthenticationFilter authenticationFilter() throws Exception {
94-
UsernamePasswordAuthenticationFilter filter = new UsernamePasswordAuthenticationFilter();
95-
filter.setAuthenticationManager(authenticationManager);
96-
filter.setFilterProcessesUrl(simpleworklistProperties.getWebSecurity().getLoginProcessingUrl());
97-
return filter;
98-
}
99-
100-
private AuthenticationManagerBuilder authenticationBuilder;
101-
102-
private AuthenticationManagerBuilder localConfigureAuthenticationBldr;
103-
104-
private ApplicationContext context;
105-
106-
private HttpSecurity http;
107-
108-
private boolean disableDefaults;
109-
110-
private AuthenticationTrustResolver trustResolver = new AuthenticationTrustResolverImpl();
111-
112-
private ContentNegotiationStrategy contentNegotiationStrategy = new HeaderContentNegotiationStrategy();
113-
114-
private ObjectPostProcessor<Object> objectPostProcessor = new ObjectPostProcessor<Object>() {
115-
@Override
116-
public <T> T postProcess(T object) {
117-
throw new IllegalStateException(ObjectPostProcessor.class.getName()
118-
+ " is a required bean. Ensure you have used @EnableWebSecurity and @Configuration");
119-
}
120-
};
121-
122-
private AuthenticationEventPublisher getAuthenticationEventPublisher() {
123-
if (this.context.getBeanNamesForType(AuthenticationEventPublisher.class).length > 0) {
124-
return this.context.getBean(AuthenticationEventPublisher.class);
125-
}
126-
return this.objectPostProcessor.postProcess(new DefaultAuthenticationEventPublisher());
127-
}
128-
*/
129-
130-
/**
131-
* Creates the shared objects
132-
* @return the shared Objects
133-
*/
134-
/*
135-
private Map<Class<?>, Object> createSharedObjects() {
136-
Map<Class<?>, Object> sharedObjects = new HashMap<>();
137-
sharedObjects.putAll(this.localConfigureAuthenticationBldr.getSharedObjects());
138-
sharedObjects.put(UserDetailsService.class, userDetailsService());
139-
sharedObjects.put(ApplicationContext.class, this.context);
140-
sharedObjects.put(ContentNegotiationStrategy.class, this.contentNegotiationStrategy);
141-
sharedObjects.put(AuthenticationTrustResolver.class, this.trustResolver);
142-
return sharedObjects;
143-
}
144-
145-
private void applyDefaultConfiguration(HttpSecurity http) throws Exception {
146-
http.csrf();
147-
http.addFilter(new WebAsyncManagerIntegrationFilter());
148-
http.exceptionHandling();
149-
http.headers();
150-
http.sessionManagement();
151-
http.securityContext();
152-
http.requestCache();
153-
http.anonymous();
154-
http.servletApi();
155-
http.apply(new DefaultLoginPageConfigurer<>());
156-
http.logout();
157-
}
158-
*/
159-
/**
160-
* Creates the {@link HttpSecurity} or returns the current instance
161-
* @return the {@link HttpSecurity}
162-
* @throws Exception
163-
*/
164-
@SuppressWarnings({ "rawtypes", "unchecked" })
165-
/*
166-
protected final HttpSecurity getHttp() throws Exception {
167-
if (this.http != null) {
168-
return this.http;
169-
}
170-
AuthenticationEventPublisher eventPublisher = getAuthenticationEventPublisher();
171-
this.localConfigureAuthenticationBldr.authenticationEventPublisher(eventPublisher);
172-
this.authenticationBuilder.parentAuthenticationManager(authenticationManager);
173-
Map<Class<?>, Object> sharedObjects = createSharedObjects();
174-
this.http = new HttpSecurity(this.objectPostProcessor, this.authenticationBuilder, sharedObjects);
175-
if (!this.disableDefaults) {
176-
applyDefaultConfiguration(this.http);
177-
ClassLoader classLoader = this.context.getClassLoader();
178-
List<AbstractHttpConfigurer> defaultHttpConfigurers = SpringFactoriesLoader
179-
.loadFactories(AbstractHttpConfigurer.class, classLoader);
180-
for (AbstractHttpConfigurer configurer : defaultHttpConfigurers) {
181-
this.http.apply(configurer);
182-
}
183-
}
184-
configure(this.http);
185-
return this.http;
186-
}
187-
188-
189-
///@Override
190-
public void init(WebSecurity web) throws Exception {
191-
HttpSecurity http = getHttp();
192-
web.addSecurityFilterChainBuilder(http).postBuildAction(() -> {
193-
FilterSecurityInterceptor securityInterceptor = http.getSharedObject(FilterSecurityInterceptor.class);
194-
web.securityInterceptor(securityInterceptor);
195-
});
196-
}
197-
198-
199-
//@Override
200-
public void configure(WebSecurity builder) throws Exception {
201-
202-
}
203-
*/
204-
205-
/*
206-
public void configure(HttpSecurity builder) throws Exception {
207-
208-
http
209-
.headers((headers) -> headers.disable() )
210-
.authorizeRequests((authorizeRequests) -> authorizeRequests
211-
.antMatchers(
212-
simpleworklistProperties.getWebSecurity().getAntPatternsPublic()
213-
)
214-
.permitAll()
215-
.anyRequest()
216-
.fullyAuthenticated()
217-
)
218-
.csrf()
219-
.and()
220-
.formLogin((formLogin) -> formLogin
221-
.loginPage(simpleworklistProperties.getWebSecurity().getLoginPage())
222-
.usernameParameter(simpleworklistProperties.getWebSecurity().getUsernameParameter())
223-
.passwordParameter(simpleworklistProperties.getWebSecurity().getPasswordParameter())
224-
.loginProcessingUrl(simpleworklistProperties.getWebSecurity().getLoginProcessingUrl())
225-
.failureForwardUrl(simpleworklistProperties.getWebSecurity().getFailureForwardUrl())
226-
.defaultSuccessUrl(simpleworklistProperties.getWebSecurity().getDefaultSuccessUrl())
227-
//.successHandler(authenticationSuccessHandler)
228-
.permitAll()
229-
)
230-
.csrf()
231-
.and()
232-
.logout((logout)-> logout
233-
.logoutUrl(simpleworklistProperties.getWebSecurity().getLogoutUrl())
234-
.deleteCookies(simpleworklistProperties.getWebSecurity().getCookieNamesToClear())
235-
.invalidateHttpSession(simpleworklistProperties.getWebSecurity().getInvalidateHttpSession())
236-
.permitAll()
237-
);
238-
239-
}
240-
*/
241-
24266
@Bean
24367
public AuthenticationProvider authenticationProvider(){
24468
DaoAuthenticationProvider d = new DaoAuthenticationProvider();

0 commit comments

Comments
 (0)