Skip to content

Commit f99ff4e

Browse files
authored
[JAVA-46869] Moved code from libraries-security to libraries-security-2, and added downloads folder (#18586)
1 parent 3a0f489 commit f99ff4e

34 files changed

+146
-154
lines changed

libraries-security-2/pom.xml

Lines changed: 71 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,10 @@
2323
<groupId>org.springframework.boot</groupId>
2424
<artifactId>spring-boot-starter-oauth2-resource-server</artifactId>
2525
</dependency>
26+
<dependency>
27+
<groupId>org.springframework.security</groupId>
28+
<artifactId>spring-security-oauth2-authorization-server</artifactId>
29+
</dependency>
2630
<dependency>
2731
<groupId>org.springframework</groupId>
2832
<artifactId>spring-web</artifactId>
@@ -33,9 +37,62 @@
3337
<version>${bouncycastle.version}</version>
3438
</dependency>
3539
<dependency>
36-
<groupId>org.springframework.security</groupId>
37-
<artifactId>spring-security-oauth2-authorization-server</artifactId>
38-
<version>1.2.1</version>
40+
<groupId>org.jasypt</groupId>
41+
<artifactId>jasypt</artifactId>
42+
<version>${jasypt.version}</version>
43+
</dependency>
44+
<dependency>
45+
<groupId>org.passay</groupId>
46+
<artifactId>passay</artifactId>
47+
<version>${passay.version}</version>
48+
</dependency>
49+
<dependency>
50+
<groupId>org.cryptacular</groupId>
51+
<artifactId>cryptacular</artifactId>
52+
<version>${cryptacular.version}</version>
53+
</dependency>
54+
<dependency>
55+
<groupId>com.google.crypto.tink</groupId>
56+
<artifactId>tink</artifactId>
57+
<version>${tink.version}</version>
58+
</dependency>
59+
<dependency>
60+
<groupId>com.hierynomus</groupId>
61+
<artifactId>sshj</artifactId>
62+
<version>${sshj.version}</version>
63+
</dependency>
64+
<dependency>
65+
<groupId>org.apache.sshd</groupId>
66+
<artifactId>sshd-scp</artifactId>
67+
<version>${apache-scp.version}</version>
68+
</dependency>
69+
<dependency>
70+
<groupId>org.apache.sshd</groupId>
71+
<artifactId>sshd-sftp</artifactId>
72+
<version>${apache-sftp.version}</version>
73+
</dependency>
74+
<dependency>
75+
<groupId>com.github.scribejava</groupId>
76+
<artifactId>scribejava-apis</artifactId>
77+
<version>${scribejava.version}</version>
78+
</dependency>
79+
<dependency>
80+
<groupId>com.sun.xml.bind</groupId>
81+
<artifactId>jaxb-core</artifactId>
82+
<version>${jaxb-core.version}</version>
83+
<scope>runtime</scope>
84+
</dependency>
85+
<dependency>
86+
<groupId>javax.xml.bind</groupId>
87+
<artifactId>jaxb-api</artifactId>
88+
<version>${jaxb-api.version}</version>
89+
<scope>runtime</scope>
90+
</dependency>
91+
<dependency>
92+
<groupId>com.sun.xml.bind</groupId>
93+
<artifactId>jaxb-impl</artifactId>
94+
<version>${jaxb-api.version}</version>
95+
<scope>runtime</scope>
3996
</dependency>
4097
</dependencies>
4198

@@ -54,16 +111,23 @@
54111
<plugin>
55112
<groupId>org.apache.maven.plugins</groupId>
56113
<artifactId>maven-compiler-plugin</artifactId>
57-
<configuration>
58-
<source>11</source>
59-
<target>11</target>
60-
</configuration>
61114
</plugin>
62115
</plugins>
63116
</build>
64117

65118
<properties>
119+
<spring-boot.repackage.skip>true</spring-boot.repackage.skip> <!--Skip repackaging for multiple main classes-->
66120
<bouncycastle.version>1.76</bouncycastle.version>
121+
<jasypt.version>1.9.2</jasypt.version>
122+
<passay.version>1.3.1</passay.version>
123+
<cryptacular.version>1.2.2</cryptacular.version>
124+
<tink.version>1.2.2</tink.version>
125+
<sshj.version>0.38.0</sshj.version>
126+
<apache-scp.version>2.12.1</apache-scp.version>
127+
<apache-sftp.version>2.12.1</apache-sftp.version>
128+
<scribejava.version>8.3.3</scribejava.version>
129+
<jaxb-core.version>2.3.0.1</jaxb-core.version>
130+
<jaxb-api.version>2.3.1</jaxb-api.version>
67131
</properties>
68132

69133
</project>

libraries-security/src/main/java/com/baeldung/scribejava/controller/GoogleController.java renamed to libraries-security-2/src/main/java/com/baeldung/scribejava/controller/GoogleController.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,12 @@
55
import com.github.scribejava.core.model.OAuthRequest;
66
import com.github.scribejava.core.model.Response;
77
import com.github.scribejava.core.model.Verb;
8+
import jakarta.servlet.http.HttpServletResponse;
89
import org.springframework.beans.factory.annotation.Autowired;
910
import org.springframework.web.bind.annotation.GetMapping;
1011
import org.springframework.web.bind.annotation.RequestParam;
1112
import org.springframework.web.bind.annotation.RestController;
1213

13-
import jakarta.servlet.http.HttpServletResponse;
14-
1514
@RestController
1615
public class GoogleController {
1716

libraries-security/src/main/java/com/baeldung/scribejava/controller/RBACController.java renamed to libraries-security-2/src/main/java/com/baeldung/scribejava/controller/RBACController.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
package com.baeldung.scribejava.controller;
22

3-
import java.io.IOException;
4-
53
import jakarta.annotation.security.DeclareRoles;
64
import jakarta.servlet.ServletException;
75
import jakarta.servlet.annotation.HttpConstraint;
@@ -11,6 +9,8 @@
119
import jakarta.servlet.http.HttpServletRequest;
1210
import jakarta.servlet.http.HttpServletResponse;
1311

12+
import java.io.IOException;
13+
1414
@WebServlet(name="rbac", urlPatterns = {"/protected"})
1515
@DeclareRoles("USER")
1616
@ServletSecurity(

libraries-security/src/main/java/com/baeldung/scribejava/controller/TwitterController.java renamed to libraries-security-2/src/main/java/com/baeldung/scribejava/controller/TwitterController.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
import java.util.Scanner;
1212
import java.util.concurrent.ExecutionException;
1313

14+
1415
@RestController
1516
public class TwitterController {
1617

libraries-security/src/main/java/com/baeldung/scribejava/controller/UserController.java renamed to libraries-security-2/src/main/java/com/baeldung/scribejava/controller/UserController.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,12 @@
55
import com.github.scribejava.core.model.OAuthRequest;
66
import com.github.scribejava.core.model.Response;
77
import com.github.scribejava.core.model.Verb;
8+
import jakarta.servlet.http.HttpServletResponse;
89
import org.springframework.beans.factory.annotation.Autowired;
910
import org.springframework.web.bind.annotation.GetMapping;
1011
import org.springframework.web.bind.annotation.RequestParam;
1112
import org.springframework.web.bind.annotation.RestController;
1213

13-
import jakarta.servlet.http.HttpServletResponse;
1414
import java.security.Principal;
1515

1616
@RestController(value = "/user")

libraries-security/src/main/java/com/baeldung/scribejava/oauth/AuthServiceConfig.java renamed to libraries-security-2/src/main/java/com/baeldung/scribejava/oauth/AuthServiceConfig.java

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,5 @@
11
package com.baeldung.scribejava.oauth;
22

3-
import java.util.UUID;
4-
5-
import org.springframework.beans.factory.annotation.Autowired;
6-
import org.springframework.beans.factory.annotation.Qualifier;
73
import org.springframework.context.annotation.Bean;
84
import org.springframework.context.annotation.Configuration;
95
import org.springframework.core.annotation.Order;
@@ -27,6 +23,8 @@
2723
import org.springframework.security.web.authentication.LoginUrlAuthenticationEntryPoint;
2824
import org.springframework.security.web.util.matcher.MediaTypeRequestMatcher;
2925

26+
import java.util.UUID;
27+
3028
@Configuration
3129
@EnableWebSecurity
3230
public class AuthServiceConfig {

libraries-security/src/main/java/com/baeldung/scribejava/service/GoogleService.java renamed to libraries-security-2/src/main/java/com/baeldung/scribejava/service/GoogleService.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,8 @@
33
import com.github.scribejava.apis.GoogleApi20;
44
import com.github.scribejava.core.builder.ServiceBuilder;
55
import com.github.scribejava.core.oauth.OAuth20Service;
6-
import org.springframework.stereotype.Component;
7-
86
import jakarta.annotation.PostConstruct;
7+
import org.springframework.stereotype.Component;
98
@Component
109
public class GoogleService {
1110

libraries-security/src/main/java/com/baeldung/scribejava/service/MyService.java renamed to libraries-security-2/src/main/java/com/baeldung/scribejava/service/MyService.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,8 @@
33
import com.baeldung.scribejava.api.MyApi;
44
import com.github.scribejava.core.builder.ServiceBuilder;
55
import com.github.scribejava.core.oauth.OAuth20Service;
6-
import org.springframework.stereotype.Component;
7-
86
import jakarta.annotation.PostConstruct;
7+
import org.springframework.stereotype.Component;
98

109
@Component
1110
public class MyService {

0 commit comments

Comments
 (0)