Skip to content

Commit 485aaf0

Browse files
authored
Merge pull request #2 from Nasruddin/feature/add-config-server
Feature/add config server
2 parents d51269e + 86c3814 commit 485aaf0

File tree

56 files changed

+179
-308
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

56 files changed

+179
-308
lines changed

api-gateway-service/pom.xml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,14 @@
33
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
44
<modelVersion>4.0.0</modelVersion>
55

6-
<groupId>com.assignment</groupId>
6+
<parent>
7+
<groupId>org.springframework.boot</groupId>
8+
<artifactId>spring-boot-starter-parent</artifactId>
9+
<version>2.2.5.RELEASE</version>
10+
<relativePath/> <!-- lookup parent from repository -->
11+
</parent>
12+
13+
<groupId>com.javatab</groupId>
714
<artifactId>api-gateway-service</artifactId>
815
<version>0.0.1-SNAPSHOT</version>
916
<name>api-gateway-service</name>
@@ -14,13 +21,6 @@
1421
<spring-cloud.version>Hoxton.SR1</spring-cloud.version>
1522
</properties>
1623

17-
<parent>
18-
<groupId>org.springframework.boot</groupId>
19-
<artifactId>spring-boot-starter-parent</artifactId>
20-
<version>2.2.5.RELEASE</version>
21-
<relativePath/> <!-- lookup parent from repository -->
22-
</parent>
23-
2424
<dependencies>
2525
<dependency>
2626
<groupId>org.springframework.boot</groupId>
@@ -49,7 +49,7 @@
4949
<version>0.9.0</version>
5050
</dependency>
5151
<dependency>
52-
<groupId>com.assignment</groupId>
52+
<groupId>com.javatab</groupId>
5353
<artifactId>common-service</artifactId>
5454
<version>0.0.1-SNAPSHOT</version>
5555
</dependency>
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package com.assignment.apigatewayservice;
1+
package com.javatab.apigatewayservice;
22

33
import org.springframework.boot.SpringApplication;
44
import org.springframework.boot.autoconfigure.SpringBootApplication;
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package com.assignment.apigatewayservice.security;
1+
package com.javatab.apigatewayservice.security;
22

33
import org.springframework.security.core.AuthenticationException;
44
import org.springframework.security.web.AuthenticationEntryPoint;
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
package com.assignment.apigatewayservice.security;
1+
package com.javatab.apigatewayservice.security;
22

3-
import com.assignment.commonservice.JwtConfig;
3+
import com.javatab.commonservice.JwtConfig;
44
import io.jsonwebtoken.Claims;
55
import io.jsonwebtoken.Jwts;
66
import org.springframework.security.authentication.UsernamePasswordAuthenticationToken;
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
package com.assignment.apigatewayservice.security;
1+
package com.javatab.apigatewayservice.security;
22

3-
import com.assignment.commonservice.JwtConfig;
3+
import com.javatab.commonservice.JwtConfig;
44
import org.springframework.beans.factory.annotation.Autowired;
55
import org.springframework.context.annotation.Bean;
66
import org.springframework.http.HttpMethod;
Lines changed: 5 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,11 @@
11
spring:
22
application:
33
name: api-gateway-service
4-
4+
config:
5+
import: optional:config-server/
6+
cloud:
7+
bootstrap:
8+
enabled: true
59
server:
610
port: 8762
711

8-
eureka:
9-
client:
10-
server-url:
11-
default-zone: http://localhost:8761/eureka/
12-
13-
# Disable accessing services using service name (i.e. students-service).
14-
# They should be only accessed through the path defined below.
15-
zuul:
16-
ignored-services: '*'
17-
# Map paths to services
18-
routes:
19-
course-service:
20-
path: /course/**
21-
service-id: COURSE-SERVICE
22-
23-
#student-service:
24-
# path: /student/**
25-
#service-id: STUDENT-SERVICE
26-
# Map path to auth service
27-
auth-service:
28-
path: /auth/**
29-
service-id: AUTH-SERVICE
30-
31-
strip-prefix: false
32-
33-
# Exclude authorization from sensitive headers
34-
sensitive-headers: Cookie,Set-Cookie
35-
ignored-headers: Access-Control-Allow-Credentials, Access-Control-Allow-Origin
36-
37-
ribbon:
38-
ReadTimeout: 60000
39-
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package com.assignment.apigatewayservice;
1+
package com.javatab.apigatewayservice;
22

33
import org.junit.jupiter.api.Disabled;
44
import org.springframework.boot.test.context.SpringBootTest;

auth-service/pom.xml

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,23 +3,25 @@
33
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
44
<modelVersion>4.0.0</modelVersion>
55

6-
<groupId>com.assignment</groupId>
6+
<parent>
7+
<groupId>org.springframework.boot</groupId>
8+
<artifactId>spring-boot-starter-parent</artifactId>
9+
<version>2.5.4</version>
10+
<relativePath/> <!-- lookup parent from repository -->
11+
</parent>
12+
13+
<groupId>com.javatab</groupId>
714
<artifactId>auth-service</artifactId>
815
<version>0.0.1-SNAPSHOT</version>
916
<name>auth-service</name>
1017
<description>Demo project for Spring Boot</description>
1118

1219
<properties>
1320
<java.version>11</java.version>
14-
<spring-cloud.version>Hoxton.SR1</spring-cloud.version>
21+
<spring-cloud.version>2020.0.3</spring-cloud.version>
1522
</properties>
1623

17-
<parent>
18-
<groupId>org.springframework.boot</groupId>
19-
<artifactId>spring-boot-starter-parent</artifactId>
20-
<version>2.2.5.RELEASE</version>
21-
<relativePath/> <!-- lookup parent from repository -->
22-
</parent>
24+
2325

2426
<dependencies>
2527
<dependency>
@@ -69,6 +71,12 @@
6971
<artifactId>common-service</artifactId>
7072
<version>0.0.1-SNAPSHOT</version>
7173
</dependency>
74+
<dependency>
75+
<groupId>com.javatab</groupId>
76+
<artifactId>common-service</artifactId>
77+
<version>0.0.1-SNAPSHOT</version>
78+
<scope>compile</scope>
79+
</dependency>
7280
</dependencies>
7381

7482
<dependencyManagement>

auth-service/src/main/java/com/assignment/authservice/AuthServiceApplication.java renamed to auth-service/src/main/java/com/javatab/authservice/AuthServiceApplication.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package com.assignment.authservice;
1+
package com.javatab.authservice;
22

33
import org.springframework.boot.SpringApplication;
44
import org.springframework.boot.autoconfigure.SpringBootApplication;

auth-service/src/main/java/com/assignment/authservice/model/LoggedInUserDetails.java renamed to auth-service/src/main/java/com/javatab/authservice/model/LoggedInUserDetails.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package com.assignment.authservice.model;
1+
package com.javatab.authservice.model;
22

33
import lombok.Data;
44
import lombok.RequiredArgsConstructor;

0 commit comments

Comments
 (0)