Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
I
IDPServer
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Josh Ji
IDPServer
Commits
5b3c96c0
Commit
5b3c96c0
authored
Jan 30, 2024
by
Josh Ji
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
zipkin
parent
6f7c0ce9
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
60 additions
and
13 deletions
+60
-13
Dockerfile
Dockerfile
+1
-1
Dockerfile_IDPServer
Dockerfile_IDPServer
+1
-1
docker-compose.yml
docker-compose.yml
+4
-0
pom.xml
pom.xml
+21
-2
src/main/java/com/prlab/idpserver/WebSecurityConfig.java
src/main/java/com/prlab/idpserver/WebSecurityConfig.java
+8
-2
src/main/java/com/prlab/idpserver/controller/askIdentityV2.java
...in/java/com/prlab/idpserver/controller/askIdentityV2.java
+5
-0
src/main/resources/application.properties
src/main/resources/application.properties
+0
-7
src/main/resources/application.yml
src/main/resources/application.yml
+20
-0
No files found.
Dockerfile
View file @
5b3c96c0
...
...
@@ -3,7 +3,7 @@
#WORKDIR /tmp
#RUN mvn clean package -DskipTests
FROM
openjdk:
11-jre-slim
FROM
openjdk:
23-slim-bullseye
#COPY --from=build /tmp/target/*.jar app.jar
COPY
target/*.jar app.jar
EXPOSE
8086
...
...
Dockerfile_IDPServer
View file @
5b3c96c0
FROM
openjdk:
11
FROM
openjdk:
23-slim-bullseye
COPY
target/*.jar app.jar
EXPOSE
8086
ENV
SPRING_DATASOURCE_USERNAME=root
...
...
docker-compose.yml
View file @
5b3c96c0
...
...
@@ -24,6 +24,10 @@ services:
SPRING_DATASOURCE_URL
:
jdbc:mysql://mysql/idp
ports
:
-
8086:8086
zipkin
:
image
:
openzipkin/zipkin
ports
:
-
9411:9411
networks
:
overlay
:
driver
:
overlay
\ No newline at end of file
pom.xml
View file @
5b3c96c0
...
...
@@ -5,7 +5,7 @@
<parent>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter-parent
</artifactId>
<version>
2.7.0
</version>
<version>
3.1.2
</version>
<relativePath/>
<!-- lookup parent from repository -->
</parent>
<groupId>
com.prlab
</groupId>
...
...
@@ -15,7 +15,7 @@
<name>
IDPServer
</name>
<description>
IDPServer
</description>
<properties>
<java.version>
1
.8
</java.version>
<java.version>
1
7
</java.version>
</properties>
<dependencies>
<dependency>
...
...
@@ -34,6 +34,7 @@
<groupId>
mysql
</groupId>
<artifactId>
mysql-connector-java
</artifactId>
<scope>
runtime
</scope>
<version>
8.0.33
</version>
</dependency>
<dependency>
<groupId>
org.springframework.boot
</groupId>
...
...
@@ -42,6 +43,7 @@
<dependency>
<groupId>
org.thymeleaf.extras
</groupId>
<artifactId>
thymeleaf-extras-springsecurity5
</artifactId>
<version>
3.1.1.RELEASE
</version>
</dependency>
<dependency>
...
...
@@ -74,6 +76,23 @@
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter-jdbc
</artifactId>
</dependency>
<dependency>
<groupId>
io.micrometer
</groupId>
<artifactId>
micrometer-tracing-bridge-brave
</artifactId>
</dependency>
<dependency>
<groupId>
io.zipkin.reporter2
</groupId>
<artifactId>
zipkin-reporter-brave
</artifactId>
</dependency>
<dependency>
<groupId>
net.ttddyy.observation
</groupId>
<artifactId>
datasource-micrometer-spring-boot
</artifactId>
<version>
1.0.2
</version>
</dependency>
<dependency>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter-actuator
</artifactId>
</dependency>
</dependencies>
<build>
...
...
src/main/java/com/prlab/idpserver/WebSecurityConfig.java
View file @
5b3c96c0
package
com.prlab.idpserver
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.Configuration
;
import
org.springframework.security.config.annotation.web.builders.HttpSecurity
;
import
org.springframework.security.config.annotation.web.configuration.EnableWebSecurity
;
import
org.springframework.security.config.annotation.web.configurers.AbstractHttpConfigurer
;
...
...
@@ -8,12 +9,17 @@ import org.springframework.security.web.SecurityFilterChain;
import
org.springframework.security.web.csrf.CookieCsrfTokenRepository
;
@EnableWebSecurity
@Configuration
public
class
WebSecurityConfig
{
@Bean
public
SecurityFilterChain
filterChain
(
HttpSecurity
http
)
throws
Exception
{
http
.
csrf
(
AbstractHttpConfigurer:
:
disable
);
http
.
authorizeRequests
().
anyRequest
().
permitAll
();
http
.
csrf
(
AbstractHttpConfigurer:
:
disable
)
.
formLogin
(
AbstractHttpConfigurer:
:
disable
)
.
authorizeHttpRequests
(
auth
->{
auth
.
anyRequest
().
permitAll
();
})
.
httpBasic
(
AbstractHttpConfigurer:
:
disable
);
return
http
.
build
();
}
}
\ No newline at end of file
src/main/java/com/prlab/idpserver/controller/askIdentityV2.java
View file @
5b3c96c0
...
...
@@ -38,6 +38,8 @@ public class askIdentityV2 {
@PostMapping
(
"/idp/askIdentityV2"
)
public
String
queryIdentity
(
@RequestBody
IdentityRequestV2
r
){
logger
.
info
(
"timestamp askIdentityV2 {}"
,
System
.
currentTimeMillis
());
logger
.
info
(
"r : {}, {}, {}, {}"
,
r
.
nonce_base64
,
r
.
idHash_base64
,
r
.
cE_base64
,
r
.
HMAC_base64
);
byte
[]
nonce
=
Base64Utils
.
decodeFromString
(
r
.
nonce_base64
);
byte
[]
idHash
=
Base64Utils
.
decodeFromString
(
r
.
idHash_base64
);
...
...
@@ -65,6 +67,8 @@ public class askIdentityV2 {
Base64Utils
.
decodeFromString
(
r
.
nonce_base64
)},
new
int
[]{
Types
.
VARBINARY
,
Types
.
VARBINARY
});
long
t2
=
System
.
currentTimeMillis
();
logger
.
info
(
"timestamp dbt1 {}"
,
t1
);
logger
.
info
(
"timestamp dbt2 {}"
,
t2
);
logger
.
info
(
"time consumed: {} ms"
,
t2
-
t1
);
...
...
@@ -107,6 +111,7 @@ public class askIdentityV2 {
throw
new
RuntimeException
(
e
);
}
});
logger
.
info
(
"timestamp askIdentityV2return {}"
,
System
.
currentTimeMillis
());
if
(
list
.
size
()>
0
)
// return (String)list.get(0).get("id");
return
msg
.
get
();
...
...
src/main/resources/application.properties
deleted
100644 → 0
View file @
6f7c0ce9
server.port
=
8086
logging.level.com.prlab.idpserver
=
DEBUG
spring.datasource.url
=
jdbc:mysql://localhost:3306/idp
spring.datasource.username
=
IDP
spring.datasource.password
=
idppasswd
spring.datasource.driver-class-name
=
com.mysql.cj.jdbc.Driver
src/main/resources/application.yml
0 → 100644
View file @
5b3c96c0
server
:
port
:
8086
spring
:
datasource
:
url
:
jdbc:mysql://localhost:3306/idp
username
:
IDP
password
:
idppasswd
driver-class-name
:
com.mysql.cj.jdbc.Driver
application
:
name
:
idpserver
logging
:
level
:
com.prlab.idpserver
:
DEBUG
management
:
tracing
:
sampling
:
probability
:
1
zipkin
:
tracing
:
endpoint
:
http://zipkin:9411/api/v2/spans
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment