This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Configuration | |
public class DevProfileEnvironmentPostProcessor implements EnvironmentPostProcessor { | |
@Override | |
public void postProcessEnvironment(ConfigurableEnvironment environment, SpringApplication application) { | |
if (environment.acceptsProfiles("dev")) { | |
Map<String, Object> devProperties = new HashMap<>(); | |
devProperties.put("server.port", 8080); | |
devProperties.put("logging.level.org.springframework.web", "DEBUG"); | |
devProperties.put("logging.level.com.example.application", "TRACE"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
log4j.appender.file.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss} %-5p %c{1}:%L - %X{ip} %X{userId} - %m%n |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Aspect | |
@Component | |
public class LoggingAspect { | |
@Before("execution(* com.example.controller.*.*(..))") | |
public void before(JoinPoint joinPoint) { | |
HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest(); | |
MDC.put("ip", request.getRemoteAddr()); | |
MDC.put("userId", request.getHeader("userId")); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<dependency> | |
<groupId>org.springframework.boot</groupId> | |
<artifactId>spring-boot-starter</artifactId> | |
</dependency> | |
<dependency> | |
<groupId>org.kie</groupId> | |
<artifactId>kie-ci</artifactId> | |
<version>7.38.0.Final</version> | |
</dependency> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@SpringBootApplication | |
public class SpringCloudVaultIntegrationApplication implements CommandLineRunner { | |
// Reading through yml file | |
@Value("${app.security.key}") | |
private String appSecurityKey; | |
// Accessing same key what we added in vault and accessing that directly in @Value() | |
@Value("${appSecurityKey}") | |
private String secretKeyVaultDirectAccess; | |
public static void main(String[] args) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
spring: | |
application: | |
name: spring-cloud-vault | |
cloud: | |
vault: | |
token: s.lL1wRFK79QQQRflLyIS3WyYm | |
scheme: http | |
host: http://127.0.0.1 | |
port: 8200 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
spring: | |
application: | |
name: spring-cloud-vault | |
cloud: | |
vault: | |
token: s.lL1wRFK79QQQRflLyIS3WyYm | |
scheme: http | |
host: http://127.0.0.1 | |
port: 8200 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
spring: | |
application: | |
name: spring-cloud-vault | |
cloud: | |
vault: | |
token: s.lL1wRFK79QQQRflLyIS3WyYm | |
scheme: http | |
host: http://127.0.0.1 | |
port: 8200 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<properties> | |
<java.version>1.8</java.version> | |
<spring-cloud.version>Hoxton.SR6</spring-cloud.version> | |
</properties> | |
<dependencies> | |
<dependency> | |
<groupId>org.springframework.cloud</groupId> | |
<artifactId>spring-cloud-starter-vault-config</artifactId> | |
</dependency> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
root@rajeev-Latitude-5480:/home/rajeev# vault operator unseal waqRq56mn1YAdf6wvjZ6Dz1TwqkC4ZGegAqM/lp4e9TN | |
Key Value | |
- - - - - | |
Seal Type shamir | |
Initialized true | |
Sealed true | |
Total Shares 5 | |
Threshold 3 | |
Unseal Progress 2/3 | |
Unseal Nonce 181be784–7c72-a040–48a5–105eb398f026 |
NewerOlder