Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion cadastral/src/main/resources/application-dev.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
## SONAR LOCAL: mvn clean verify sonar:sonar -Dsonar.projectKey=Imovato -Dsonar.host.url=http://localhost:9000 -Dsonar.login=sqp_8065f01e13e240636a05812095cc3af86e62507c
server:
port: 8585
port: 5757

spring:
application:
Expand Down
5 changes: 2 additions & 3 deletions cadastral/src/main/resources/application.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,10 @@
spring:
application:
name: cadastral
profiles:
active: dev
config:
import: "optional:configserver:" # caso o config-server nao responder, use o profile dev.
import: "configserver:"
cloud:
config:
discovery:
enabled: true
service-id: config-server
4 changes: 4 additions & 0 deletions gateway/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,10 @@
<artifactId>reactor-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-config</artifactId>
</dependency>
</dependencies>
<dependencyManagement>
<dependencies>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;

@EnableDiscoveryClient
@SpringBootApplication
public class GatewayApplication {

Expand Down
26 changes: 26 additions & 0 deletions gateway/src/main/resources/application-dev.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
spring:
application:
name: gateway
cloud:
gateway:
discovery:
locator:
enabled: true
lower-case-service-id: true

server:
port: 5959

ead:
serviceRegistry:
username: un_user
password: 'un_user'

eureka:
client:
registerWithEureka: true
fetchRegistry: true
service-url:
defaultZone: 'http://${ead.serviceRegistry.username}:${ead.serviceRegistry.password}@localhost:8761/eureka'


25 changes: 4 additions & 21 deletions gateway/src/main/resources/application.yml
Original file line number Diff line number Diff line change
@@ -1,26 +1,9 @@
spring:
application:
name: gateway
config:
import: "configserver:"
cloud:
gateway:
config:
discovery:
locator:
enabled: true
lower-case-service-id: true

server:
port: 8989

ead:
serviceRegistry:
username: admin
password: '123456'

eureka:
client:
registerWithEureka: true
fetchRegistry: true
service-url:
defaultZone: 'http://${ead.serviceRegistry.username}:${ead.serviceRegistry.password}@localhost:8761/eureka'


service-id: config-server
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
package com.example.rent.config.security;

import jakarta.ws.rs.HttpMethod;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.security.authentication.AuthenticationManager;
import org.springframework.security.config.Customizer;
import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder;
import org.springframework.security.config.annotation.method.configuration.EnableMethodSecurity;
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
import org.springframework.security.config.annotation.web.configurers.AbstractHttpConfigurer;
Expand All @@ -27,8 +24,6 @@ public SecurityFilterChain securityFilterChain(HttpSecurity http) throws Excepti
http
.csrf(AbstractHttpConfigurer::disable)
.authorizeHttpRequests(auth -> auth
.requestMatchers(HttpMethod.POST, "/users/**", "/auth/**").permitAll()
.requestMatchers(HttpMethod.GET, "/accommodations", "/accommodations/**", "/images/**").permitAll()
.anyRequest().authenticated()
)
.addFilterBefore(jwtAuthenticationFilter, UsernamePasswordAuthenticationFilter.class)
Expand Down
2 changes: 1 addition & 1 deletion transacional/src/main/resources/application-dev.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
server:
port: 8689
port: 5858

spring:
application:
Expand Down
4 changes: 1 addition & 3 deletions transacional/src/main/resources/application.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
spring:
application:
name: transacional
profiles:
active: dev
config:
import: "optional:configserver:" # caso o config-server nao responder, use o profile dev.
import: "configserver:"
cloud:
config:
discovery:
Expand Down