-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #355 from peter-szrnka/354-gms-178-demo-for-spring…
…-boot-client GMS-178 demo for spring boot client
- Loading branch information
Showing
9 changed files
with
143 additions
and
1 deletion.
There are no files selected for viewing
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
38 changes: 38 additions & 0 deletions
38
client-samples/gms-client-sample-spring-client-lib/.gitignore
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
target/ | ||
!.mvn/wrapper/maven-wrapper.jar | ||
!**/src/main/**/target/ | ||
!**/src/test/**/target/ | ||
|
||
### IntelliJ IDEA ### | ||
.idea/modules.xml | ||
.idea/jarRepositories.xml | ||
.idea/compiler.xml | ||
.idea/libraries/ | ||
*.iws | ||
*.iml | ||
*.ipr | ||
|
||
### Eclipse ### | ||
.apt_generated | ||
.classpath | ||
.factorypath | ||
.project | ||
.settings | ||
.springBeans | ||
.sts4-cache | ||
|
||
### NetBeans ### | ||
/nbproject/private/ | ||
/nbbuild/ | ||
/dist/ | ||
/nbdist/ | ||
/.nb-gradle/ | ||
build/ | ||
!**/src/main/**/build/ | ||
!**/src/test/**/build/ | ||
|
||
### VS Code ### | ||
.vscode/ | ||
|
||
### Mac OS ### | ||
.DS_Store |
42 changes: 42 additions & 0 deletions
42
client-samples/gms-client-sample-spring-client-lib/pom.xml
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<project xmlns="http://maven.apache.org/POM/4.0.0" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
<modelVersion>4.0.0</modelVersion> | ||
|
||
<groupId>hu.peterszrnka.gms</groupId> | ||
<artifactId>gms-client-sample-spring-client-lib</artifactId> | ||
<version>1.0-SNAPSHOT</version> | ||
|
||
<properties> | ||
<maven.compiler.source>21</maven.compiler.source> | ||
<maven.compiler.target>21</maven.compiler.target> | ||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> | ||
</properties> | ||
|
||
<dependencyManagement> | ||
<dependencies> | ||
<!-- Spring Boot --> | ||
<dependency> | ||
<groupId>org.springframework.boot</groupId> | ||
<artifactId>spring-boot-dependencies</artifactId> | ||
<version>3.3.5</version> | ||
<type>pom</type> | ||
<scope>import</scope> | ||
</dependency> | ||
</dependencies> | ||
</dependencyManagement> | ||
|
||
<dependencies> | ||
<dependency> | ||
<groupId>org.springframework.boot</groupId> | ||
<artifactId>spring-boot-starter-web</artifactId> | ||
</dependency> | ||
<dependency> | ||
<groupId>io.github.peter-szrnka</groupId> | ||
<artifactId>give-my-secret-client-spring</artifactId> | ||
<version>1.0.0-SNAPSHOT</version> | ||
</dependency> | ||
</dependencies> | ||
|
||
</project> |
12 changes: 12 additions & 0 deletions
12
...s/gms-client-sample-spring-client-lib/src/main/java/io/github/gms/sample/Application.java
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
package io.github.gms.sample; | ||
|
||
import org.springframework.boot.SpringApplication; | ||
import org.springframework.boot.autoconfigure.SpringBootApplication; | ||
|
||
@SpringBootApplication | ||
public class Application { | ||
|
||
public static void main(String[] args) { | ||
SpringApplication.run(Application.class, args); | ||
} | ||
} |
30 changes: 30 additions & 0 deletions
30
...ms-client-sample-spring-client-lib/src/main/java/io/github/gms/sample/TestController.java
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
package io.github.gms.sample; | ||
|
||
import org.springframework.beans.factory.annotation.Value; | ||
import org.springframework.web.bind.annotation.GetMapping; | ||
import org.springframework.web.bind.annotation.RequestMapping; | ||
import org.springframework.web.bind.annotation.RestController; | ||
|
||
@RestController | ||
@RequestMapping("/test") | ||
public class TestController { | ||
|
||
@Value("${config.test}") | ||
private String test; | ||
|
||
@Value("${config.username}") | ||
private String test1; | ||
@Value("${config.password}") | ||
private String test2; | ||
|
||
@Value("${config.other1}") | ||
private String test3; | ||
|
||
@Value("${config.other2}") | ||
private String test4; | ||
|
||
@GetMapping | ||
public String test() { | ||
return "Test value: " + test + "; Username: " + test1 + "; Password: " + test2 + ";" + test3 + ";" + test4; | ||
} | ||
} |
8 changes: 8 additions & 0 deletions
8
client-samples/gms-client-sample-spring-client-lib/src/main/resources/application.properties
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
server.port=8081 | ||
|
||
# Examples of how to consume GMS API | ||
config.test=giveMySecret(gms-config1.properties:value) | ||
config.username=giveMySecret(src/main/resources/gms-config2.properties:username) | ||
config.password=giveMySecret(src/main/resources/gms-config2.properties:password) | ||
config.other1=giveMySecret(src/main/resources/gms-config2.properties:other1) | ||
config.other2=giveMySecret(src/main/resources/gms-config2.properties:other2) |
4 changes: 4 additions & 0 deletions
4
client-samples/gms-client-sample-spring-client-lib/src/main/resources/gms-config1.properties
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
giveMySecret.baseUrl=http://localhost:8080 | ||
giveMySecret.apiKey=tb14kogUFKD9FHDepKzkJXSNcV2b1jYu | ||
giveMySecret.secretId=secret1 | ||
giveMySecret.decrypt=false |
8 changes: 8 additions & 0 deletions
8
client-samples/gms-client-sample-spring-client-lib/src/main/resources/gms-config2.properties
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
giveMySecret.baseUrl=http://localhost:8080 | ||
giveMySecret.apiKey=VNcsBIi6w0Oku3L2Q0JlJydn5LWw2I4p | ||
giveMySecret.secretId=secret2 | ||
giveMySecret.keystore.file=src/main/resources/test.p12 | ||
giveMySecret.keystore.type=PKCS12 | ||
giveMySecret.keystore.credential=test | ||
giveMySecret.keystore.alias=test | ||
giveMySecret.keystore.aliasCredential=test |
Binary file added
BIN
+2.52 KB
client-samples/gms-client-sample-spring-client-lib/src/main/resources/test.p12
Binary file not shown.