[BAEL-455] Initial code
This commit is contained in:
+12
@@ -0,0 +1,12 @@
|
||||
package org.baeldung.spring.cloud.vaultsample;
|
||||
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
|
||||
@SpringBootApplication
|
||||
public class VaultSampleApplication {
|
||||
|
||||
public static void main(String[] args) {
|
||||
SpringApplication.run(VaultSampleApplication.class, args);
|
||||
}
|
||||
}
|
||||
+58
@@ -0,0 +1,58 @@
|
||||
package org.baeldung.spring.cloud.vaultsample.domain;
|
||||
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.Id;
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
||||
@Entity
|
||||
public class Account {
|
||||
|
||||
@Id
|
||||
private Long id;
|
||||
|
||||
@NotNull
|
||||
private String name;
|
||||
|
||||
@NotNull
|
||||
private Long branchId;
|
||||
|
||||
@NotNull
|
||||
private Long customerId;
|
||||
|
||||
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(Long id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public Long getBranchId() {
|
||||
return branchId;
|
||||
}
|
||||
|
||||
public void setBranchId(Long branchId) {
|
||||
this.branchId = branchId;
|
||||
}
|
||||
|
||||
public Long getCustomerId() {
|
||||
return customerId;
|
||||
}
|
||||
|
||||
public void setCustomerId(Long customerId) {
|
||||
this.customerId = customerId;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
+10
@@ -0,0 +1,10 @@
|
||||
package org.baeldung.spring.cloud.vaultsample.repository;
|
||||
|
||||
import org.baeldung.spring.cloud.vaultsample.domain.Account;
|
||||
import org.springframework.data.repository.PagingAndSortingRepository;
|
||||
import org.springframework.data.rest.core.annotation.RepositoryRestResource;
|
||||
|
||||
@RepositoryRestResource(collectionResourceRel="accounts", path="accounts")
|
||||
public interface AccountRepository extends PagingAndSortingRepository<Account, Long> {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
spring:
|
||||
application:
|
||||
name: fakebank
|
||||
|
||||
datasource:
|
||||
url: jdbc:mysql://localhost:3306/fakebank
|
||||
@@ -0,0 +1,37 @@
|
||||
spring:
|
||||
cloud:
|
||||
vault:
|
||||
uri: https://localhost:8200
|
||||
connection-timeout: 5000
|
||||
read-timeout: 15000
|
||||
config:
|
||||
order: -10
|
||||
|
||||
token: b93d1b0d-15b5-f69e-d311-352a65fa7bc8
|
||||
ssl:
|
||||
trust-store: classpath:/vault.jks
|
||||
trust-store-password: changeit
|
||||
|
||||
generic:
|
||||
enabled: true
|
||||
application-name: fakebank
|
||||
|
||||
kv:
|
||||
enabled: true
|
||||
backend: kv
|
||||
application-name: fakebank
|
||||
|
||||
database:
|
||||
enabled: true
|
||||
role: fakebank-accounts-rw
|
||||
# username-property: spring.datasource.username
|
||||
# password-property: spring.datasource.password
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Binary file not shown.
Reference in New Issue
Block a user