Skip to content

Commit 28dbd02

Browse files
authored
Merge pull request #3 from Bernardo-MG/release
Release
2 parents 65313d7 + 3db585d commit 28dbd02

14 files changed

Lines changed: 61 additions & 65 deletions

File tree

.github/workflows/doc_deployment.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ jobs:
1313
with:
1414
branch: develop
1515
host: docs.bernardomg.com
16+
jdk: 17
1617
secrets:
1718
url: ${{ secrets.DEPLOY_DOCS_DEVELOP_SITE }}
1819
username: ${{ secrets.DEPLOY_DOCS_DEVELOP_USER }}
@@ -24,6 +25,7 @@ jobs:
2425
with:
2526
branch: master
2627
host: docs.bernardomg.com
28+
jdk: 17
2729
secrets:
2830
url: ${{ secrets.DEPLOY_DOCS_SITE }}
2931
username: ${{ secrets.DEPLOY_DOCS_USER }}

.github/workflows/test.yml

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,6 @@ name: Tests
33
on: [push, pull_request]
44

55
jobs:
6-
tests_11:
7-
name: Tests with JDK 11
8-
uses: Bernardo-MG/github-workflow-maven/.github/workflows/testing.yml@v1
9-
with:
10-
jdk: 11
11-
126
tests_17:
137
name: Tests with JDK 17
148
uses: Bernardo-MG/github-workflow-maven/.github/workflows/testing.yml@v1

pom.xml

Lines changed: 23 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121

2222
<groupId>com.bernardomg.example</groupId>
2323
<artifactId>spring-ws-ldap-security-example</artifactId>
24-
<version>1.0.1</version>
24+
<version>1.0.2</version>
2525
<packaging>war</packaging>
2626

2727
<name>Spring WS LDAP Security Example</name>
@@ -123,12 +123,9 @@
123123
<!-- ============================================== -->
124124
<!-- =========== DEPENDENCIES VERSIONS ============ -->
125125
<!-- ============================================== -->
126-
<h2.version>1.4.200</h2.version>
127-
<hamcrest.version>2.2</hamcrest.version>
128-
<hibernate.validator.version>5.4.3.Final</hibernate.validator.version>
129-
<jackson.version>2.12.4</jackson.version>
130-
<spring.boot.version>2.7.4</spring.boot.version>
131-
<spring.version>5.3.23</spring.version>
126+
<spring.boot.version>3.0.5</spring.boot.version>
127+
<spring.version>6.0.8</spring.version>
128+
<micrometer.version>1.10.6</micrometer.version>
132129
<!-- ============================================== -->
133130
<!-- ============== PLUGINS VERSIONS ============== -->
134131
<!-- ============================================== -->
@@ -141,7 +138,7 @@
141138
<!-- ============================================== -->
142139
<!-- ================= MAVEN SITE ================= -->
143140
<!-- ============================================== -->
144-
<site.skin.version>2.3.0</site.skin.version>
141+
<site.skin.version>2.3.2</site.skin.version>
145142
</properties>
146143

147144
<!-- ********************************************** -->
@@ -166,14 +163,6 @@
166163
<type>pom</type>
167164
<scope>import</scope>
168165
</dependency>
169-
<dependency>
170-
<!-- Jackson BOM -->
171-
<groupId>com.fasterxml.jackson</groupId>
172-
<artifactId>jackson-bom</artifactId>
173-
<version>${jackson.version}</version>
174-
<type>pom</type>
175-
<scope>import</scope>
176-
</dependency>
177166
</dependencies>
178167
</dependencyManagement>
179168

@@ -312,28 +301,17 @@
312301
<!-- ============================================== -->
313302
<dependency>
314303
<!-- JPA API -->
315-
<groupId>javax.persistence</groupId>
316-
<artifactId>javax.persistence-api</artifactId>
304+
<groupId>jakarta.persistence</groupId>
305+
<artifactId>jakarta.persistence-api</artifactId>
317306
</dependency>
318307
<!-- ============================================== -->
319308
<!-- ================ HIBERNATE =================== -->
320309
<!-- ============================================== -->
321310
<dependency>
322311
<!-- Hibernate Core -->
323-
<groupId>org.hibernate</groupId>
312+
<groupId>org.hibernate.orm</groupId>
324313
<artifactId>hibernate-core</artifactId>
325314
</dependency>
326-
<dependency>
327-
<!-- Hibernate Ehcache -->
328-
<groupId>org.hibernate</groupId>
329-
<artifactId>hibernate-ehcache</artifactId>
330-
</dependency>
331-
<dependency>
332-
<!-- Hibernate validator -->
333-
<groupId>org.hibernate</groupId>
334-
<artifactId>hibernate-validator</artifactId>
335-
<version>${hibernate.validator.version}</version>
336-
</dependency>
337315
<dependency>
338316
<!-- Hikari CP -->
339317
<groupId>com.zaxxer</groupId>
@@ -354,6 +332,21 @@
354332
<artifactId>h2</artifactId>
355333
</dependency>
356334
<!-- ============================================== -->
335+
<!-- ========== DEPENDENCY CONVERGENCE ============ -->
336+
<!-- ============================================== -->
337+
<dependency>
338+
<!-- Micrometer Commons -->
339+
<groupId>io.micrometer</groupId>
340+
<artifactId>micrometer-commons</artifactId>
341+
<version>${micrometer.version}</version>
342+
</dependency>
343+
<dependency>
344+
<!-- Micrometer Observation -->
345+
<groupId>io.micrometer</groupId>
346+
<artifactId>micrometer-observation</artifactId>
347+
<version>${micrometer.version}</version>
348+
</dependency>
349+
<!-- ============================================== -->
357350
<!-- ================ LIQUIBASE =================== -->
358351
<!-- ============================================== -->
359352
<dependency>

src/changes/changes.xml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,10 @@
1717
Cleaned up code to make all the security examples more similar.
1818
</action>
1919
</release>
20+
<release version="1.0.2" date="2023-04-19" description="Updated dependencies">
21+
<action dev="bmg" type="update">
22+
Updated dependencies.
23+
</action>
24+
</release>
2025
</body>
2126
</document>

src/main/java/com/bernardomg/example/spring/security/ws/ldap/config/SecurityConfig.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
import org.springframework.boot.context.properties.EnableConfigurationProperties;
2828
import org.springframework.context.annotation.Bean;
2929
import org.springframework.context.annotation.Configuration;
30-
import org.springframework.security.config.annotation.method.configuration.EnableGlobalMethodSecurity;
30+
import org.springframework.security.config.annotation.method.configuration.EnableMethodSecurity;
3131
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
3232
import org.springframework.security.crypto.password.PasswordEncoder;
3333

@@ -40,7 +40,7 @@
4040
*
4141
*/
4242
@Configuration
43-
@EnableGlobalMethodSecurity(prePostEnabled = true, securedEnabled = true, jsr250Enabled = true)
43+
@EnableMethodSecurity(prePostEnabled = true, securedEnabled = true, jsr250Enabled = true)
4444
@EnableConfigurationProperties(LdapProperties.class)
4545
public class SecurityConfig {
4646

src/main/java/com/bernardomg/example/spring/security/ws/ldap/config/WebSecurityConfig.java

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder;
3232
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
3333
import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;
34-
import org.springframework.security.config.annotation.web.configurers.ExpressionUrlAuthorizationConfigurer;
34+
import org.springframework.security.config.annotation.web.configurers.AuthorizeHttpRequestsConfigurer;
3535
import org.springframework.security.config.annotation.web.configurers.FormLoginConfigurer;
3636
import org.springframework.security.config.annotation.web.configurers.LogoutConfigurer;
3737
import org.springframework.security.config.http.SessionCreationPolicy;
@@ -83,9 +83,9 @@ public void configure(final AuthenticationManagerBuilder auth) throws Exception
8383

8484
@Bean
8585
public SecurityFilterChain filterChain(final HttpSecurity http) throws Exception {
86-
final Customizer<ExpressionUrlAuthorizationConfigurer<HttpSecurity>.ExpressionInterceptUrlRegistry> authorizeRequestsCustomizer;
87-
final Customizer<FormLoginConfigurer<HttpSecurity>> formLoginCustomizer;
88-
final Customizer<LogoutConfigurer<HttpSecurity>> logoutCustomizer;
86+
final Customizer<AuthorizeHttpRequestsConfigurer<HttpSecurity>.AuthorizationManagerRequestMatcherRegistry> authorizeRequestsCustomizer;
87+
final Customizer<FormLoginConfigurer<HttpSecurity>> formLoginCustomizer;
88+
final Customizer<LogoutConfigurer<HttpSecurity>> logoutCustomizer;
8989

9090
// Authorization
9191
authorizeRequestsCustomizer = getAuthorizeRequestsCustomizer();
@@ -98,7 +98,7 @@ public SecurityFilterChain filterChain(final HttpSecurity http) throws Exception
9898
.disable()
9999
.cors()
100100
.and()
101-
.authorizeRequests(authorizeRequestsCustomizer)
101+
.authorizeHttpRequests(authorizeRequestsCustomizer)
102102
.formLogin(formLoginCustomizer)
103103
.logout(logoutCustomizer)
104104
.httpBasic();
@@ -111,11 +111,11 @@ public SecurityFilterChain filterChain(final HttpSecurity http) throws Exception
111111
*
112112
* @return the request authorisation configuration
113113
*/
114-
private final Customizer<ExpressionUrlAuthorizationConfigurer<HttpSecurity>.ExpressionInterceptUrlRegistry>
114+
private final Customizer<AuthorizeHttpRequestsConfigurer<HttpSecurity>.AuthorizationManagerRequestMatcherRegistry>
115115
getAuthorizeRequestsCustomizer() {
116116
return c -> {
117117
try {
118-
c.antMatchers("/actuator/**")
118+
c.requestMatchers("/actuator/**")
119119
.permitAll()
120120
.anyRequest()
121121
.authenticated()

src/main/java/com/bernardomg/example/spring/security/ws/ldap/domain/entity/model/PersistentExampleEntity.java

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,13 @@
2424

2525
package com.bernardomg.example.spring.security.ws.ldap.domain.entity.model;
2626

27-
import javax.persistence.Column;
28-
import javax.persistence.Entity;
29-
import javax.persistence.GeneratedValue;
30-
import javax.persistence.GenerationType;
31-
import javax.persistence.Id;
32-
import javax.persistence.Table;
33-
import javax.persistence.Transient;
34-
27+
import jakarta.persistence.Column;
28+
import jakarta.persistence.Entity;
29+
import jakarta.persistence.GeneratedValue;
30+
import jakarta.persistence.GenerationType;
31+
import jakarta.persistence.Id;
32+
import jakarta.persistence.Table;
33+
import jakarta.persistence.Transient;
3534
import lombok.Data;
3635

3736
/**

src/main/java/com/bernardomg/example/spring/security/ws/ldap/mvc/error/handler/GlobalExceptionHandler.java

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,9 @@
2626

2727
import org.springframework.http.HttpHeaders;
2828
import org.springframework.http.HttpStatus;
29+
import org.springframework.http.HttpStatusCode;
2930
import org.springframework.http.ResponseEntity;
31+
import org.springframework.lang.Nullable;
3032
import org.springframework.security.access.AccessDeniedException;
3133
import org.springframework.security.core.AuthenticationException;
3234
import org.springframework.web.bind.annotation.ControllerAdvice;
@@ -89,8 +91,8 @@ public final ResponseEntity<Object> handleExceptionDefault(final Exception ex, f
8991
}
9092

9193
@Override
92-
protected ResponseEntity<Object> handleExceptionInternal(final Exception ex, final Object body,
93-
final HttpHeaders headers, final HttpStatus status, final WebRequest request) {
94+
protected ResponseEntity<Object> handleExceptionInternal(final Exception ex, @Nullable final Object body,
95+
final HttpHeaders headers, final HttpStatusCode statusCode, final WebRequest request) {
9496
final ErrorResponse response;
9597
final String message;
9698
final Error failure;
@@ -106,7 +108,7 @@ protected ResponseEntity<Object> handleExceptionInternal(final Exception ex, fin
106108
failure = Error.of(message);
107109
response = Response.error(failure);
108110

109-
return super.handleExceptionInternal(ex, response, headers, status, request);
111+
return super.handleExceptionInternal(ex, response, headers, statusCode, request);
110112
}
111113

112114
}

src/main/java/com/bernardomg/example/spring/security/ws/ldap/mvc/response/model/ErrorResponse.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,6 @@ public interface ErrorResponse {
4040
*
4141
* @return request errors
4242
*/
43-
public Collection<? extends Error> getErrors();
43+
public Collection<Error> getErrors();
4444

4545
}

src/main/java/com/bernardomg/example/spring/security/ws/ldap/mvc/response/model/ImmutableErrorResponse.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,15 +43,15 @@ public class ImmutableErrorResponse implements ErrorResponse {
4343
/**
4444
* Response errors.
4545
*/
46-
private final Collection<? extends Error> errors;
46+
private final Collection<Error> errors;
4747

4848
/**
4949
* Constructs a response with the specified errors.
5050
*
5151
* @param errs
5252
* errors
5353
*/
54-
public ImmutableErrorResponse(@NonNull final Collection<? extends Error> errs) {
54+
public ImmutableErrorResponse(@NonNull final Collection<Error> errs) {
5555
super();
5656

5757
errors = Collections.unmodifiableCollection(errs);

0 commit comments

Comments
 (0)