Documentation Improvements
This changes makes a bunch documentation improvements, case normalizations, and general improvements left over from the previous addition of the Kubernetes Service Binding support. Signed-off-by: Ben Hale <bhale@vmware.com>
This commit is contained in:
346
README.md
346
README.md
@@ -26,26 +26,28 @@ if (bindings.size() > 0) {
|
||||
## Spring Boot Configuration
|
||||
The more common usage of the library is opt-in automatic Spring Boot configuration. Setting the `org.springframework.cloud.bindings.boot.enable=true` System Property results in the following:
|
||||
|
||||
* Adds a `PropertySource` with a flattened representation (`cnb.bindings.{name}.{metadata,secret}.*`) of the bindings.
|
||||
* Adds a `PropertySource` with a flattened representation (`k8s.bindings.{name}.*`) of the bindings.
|
||||
* Adds a `PropertySource` with binding-specific Spring Boot configuration properties.
|
||||
|
||||
## Auto-Configurations
|
||||
Each auto-configuration is triggered by the type of binding. Each auto-configuration can be disabled using a System Property specific to that type and defaults to enable. Auto-configuration is disabled by default and can be enabled by setting the `org.springframework.cloud.bindings.boot.enable` System Property to `true`.
|
||||
|
||||
`{<key>}` indicates that the value is the contents of the secret with the given key.
|
||||
|
||||
### Cassandra
|
||||
Type: `cassandra`
|
||||
Disable Property: `org.springframework.cloud.bindings.boot.cassandra.enable`
|
||||
|
||||
| Property | Value
|
||||
| -------- | ------------------
|
||||
| `spring.data.cassandra.cluster-name` | `{secret/cluster-name}`
|
||||
| `spring.data.cassandra.compression` | `{secret/compression}`
|
||||
| `spring.data.cassandra.contact-points` | `{secret/contact-points}`
|
||||
| `spring.data.cassandra.keyspace-name` | `{secret/keyspace-name}`
|
||||
| `spring.data.cassandra.password` | `{secret/password}`
|
||||
| `spring.data.cassandra.port` | `{secret/port}`
|
||||
| `spring.data.cassandra.ssl` | `{secret/ssl}`
|
||||
| `spring.data.cassandra.username` | `{secret/username}`
|
||||
| `spring.data.cassandra.cluster-name` | `{cluster-name}`
|
||||
| `spring.data.cassandra.compression` | `{compression}`
|
||||
| `spring.data.cassandra.contact-points` | `{contact-points}`
|
||||
| `spring.data.cassandra.keyspace-name` | `{keyspace-name}`
|
||||
| `spring.data.cassandra.password` | `{password}`
|
||||
| `spring.data.cassandra.port` | `{port}`
|
||||
| `spring.data.cassandra.ssl` | `{ssl}`
|
||||
| `spring.data.cassandra.username` | `{username}`
|
||||
|
||||
### Couchbase
|
||||
Type: `couchbase`
|
||||
@@ -53,46 +55,46 @@ Disable Property: `org.springframework.cloud.bindings.boot.couchbase.enable`
|
||||
|
||||
| Property | Value
|
||||
| -------- | ------------------
|
||||
| `spring.couchbase.bootstrap-hosts` | `{secret/bootstrap-hosts}`
|
||||
| `spring.couchbase.bucket.name` | `{secret/bucket.name}`
|
||||
| `spring.couchbase.bucket.password` | `{secret/bucket.passsword}`
|
||||
| `spring.couchbase.env.bootstrap.http-direct-port` | `{secret/env.bootstrap.http-direct-port}`
|
||||
| `spring.couchbase.env.bootstrap.http-ssl-port` | `{secret/env.bootstrap.http-ssl-port}`
|
||||
| `spring.couchbase.password` | `{secret/password}`
|
||||
| `spring.couchbase.username` | `{secret/username}`
|
||||
| `spring.couchbase.bootstrap-hosts` | `{bootstrap-hosts}`
|
||||
| `spring.couchbase.bucket.name` | `{bucket.name}`
|
||||
| `spring.couchbase.bucket.password` | `{bucket.passsword}`
|
||||
| `spring.couchbase.env.bootstrap.http-direct-port` | `{env.bootstrap.http-direct-port}`
|
||||
| `spring.couchbase.env.bootstrap.http-ssl-port` | `{env.bootstrap.http-ssl-port}`
|
||||
| `spring.couchbase.password` | `{password}`
|
||||
| `spring.couchbase.username` | `{username}`
|
||||
|
||||
### DB2 RDBMS
|
||||
Type: `DB2`
|
||||
Type: `db2`
|
||||
Disable Property: `org.springframework.cloud.bindings.boot.db2.enable`
|
||||
|
||||
| Property | Value
|
||||
| -------- | ------------------
|
||||
| `spring.datasource.driver-class-name` | `com.ibm.db2.jcc.DB2Driver`
|
||||
| `spring.datasource.password` | `{secret/password}`
|
||||
| `spring.datasource.url` | `jdbc:db2://{secret/host}:{secret/port}/{secret/database}`
|
||||
| `spring.datasource.username` | `{secret/username}`
|
||||
| `spring.r2dbc.url` | `r2dbc:db2://{secret/host}:{secret/port}/{secret/database}`
|
||||
| `spring.r2dbc.password` | `{secret/password}`
|
||||
| `spring.r2dbc.username` | `{secret/username}`
|
||||
| `spring.datasource.password` | `{password}`
|
||||
| `spring.datasource.url` | `jdbc:db2://{host}:{port}/{database}`
|
||||
| `spring.datasource.username` | `{username}`
|
||||
| `spring.r2dbc.url` | `r2dbc:db2://{host}:{port}/{database}`
|
||||
| `spring.r2dbc.password` | `{password}`
|
||||
| `spring.r2dbc.username` | `{username}`
|
||||
|
||||
|
||||
### Elasticsearch
|
||||
Type: `Elasticsearch`
|
||||
Type: `elasticsearch`
|
||||
Disable Property: `org.springframework.cloud.bindings.boot.elasticsearch.enable`
|
||||
|
||||
| Property | Value
|
||||
| -------- | ------------------
|
||||
| `spring.data.elasticsearch.client.reactive.endpoints` | `{secret/endpoints}`
|
||||
| `spring.data.elasticsearch.client.reactive.password` | `{secret/password}`
|
||||
| `spring.data.elasticsearch.client.reactive.use-ssl` | `{secret/use-ssl}`
|
||||
| `spring.data.elasticsearch.client.reactive.username` | `{secret/username}`
|
||||
| `spring.elasticsearch.jest.password` | `{secret/password}`
|
||||
| `spring.elasticsearch.jest.proxy.host` | `{secret/proxy.host}`
|
||||
| `spring.elasticsearch.jest.proxy.port` | `{secret/proxy.port}`
|
||||
| `spring.elasticsearch.jest.username` | `{secret/username}`
|
||||
| `spring.elasticsearch.rest.password` | `{secret/password}`
|
||||
| `spring.elasticsearch.rest.uris` | `{secret/uris}`
|
||||
| `spring.elasticsearch.rest.username` | `{secret/username}`
|
||||
| `spring.data.elasticsearch.client.reactive.endpoints` | `{endpoints}`
|
||||
| `spring.data.elasticsearch.client.reactive.password` | `{password}`
|
||||
| `spring.data.elasticsearch.client.reactive.use-ssl` | `{use-ssl}`
|
||||
| `spring.data.elasticsearch.client.reactive.username` | `{username}`
|
||||
| `spring.elasticsearch.jest.password` | `{password}`
|
||||
| `spring.elasticsearch.jest.proxy.host` | `{proxy.host}`
|
||||
| `spring.elasticsearch.jest.proxy.port` | `{proxy.port}`
|
||||
| `spring.elasticsearch.jest.username` | `{username}`
|
||||
| `spring.elasticsearch.rest.password` | `{password}`
|
||||
| `spring.elasticsearch.rest.uris` | `{uris}`
|
||||
| `spring.elasticsearch.rest.username` | `{username}`
|
||||
|
||||
### Kafka
|
||||
Type: `kafka`
|
||||
@@ -100,267 +102,267 @@ Disable Property: `org.springframework.cloud.bindings.boot.kafka.enable`
|
||||
|
||||
| Property | Value
|
||||
| -------- | ------------------
|
||||
| `spring.kafka.bootstrap-servers` | `{secret/bootstrap-servers}`
|
||||
| `spring.kafka.consumer.bootstrap-servers` | `{secret/consumer.bootstrap-servers}`
|
||||
| `spring.kafka.producer.bootstrap-servers` | `{secret/producer.bootstrap-servers}`
|
||||
| `spring.kafka.streams.bootstrap-servers` | `{secret/streams.bootstrap-servers}`
|
||||
| `spring.kafka.bootstrap-servers` | `{bootstrap-servers}`
|
||||
| `spring.kafka.consumer.bootstrap-servers` | `{consumer.bootstrap-servers}`
|
||||
| `spring.kafka.producer.bootstrap-servers` | `{producer.bootstrap-servers}`
|
||||
| `spring.kafka.streams.bootstrap-servers` | `{streams.bootstrap-servers}`
|
||||
|
||||
### LDAP
|
||||
Type: `LDAP`
|
||||
Type: `ldap`
|
||||
Disable Property: `org.springframework.cloud.bindings.boot.ldap.enable`
|
||||
|
||||
| Property | Value
|
||||
| -------- | ------------------
|
||||
| `spring.ldap.base` | `{secret/base}`
|
||||
| `spring.ldap.password` | `{secret/password}`
|
||||
| `spring.ldap.urls` | `{secret/urls}`
|
||||
| `spring.ldap.username` | `{secret/username}`
|
||||
| `spring.ldap.base` | `{base}`
|
||||
| `spring.ldap.password` | `{password}`
|
||||
| `spring.ldap.urls` | `{urls}`
|
||||
| `spring.ldap.username` | `{username}`
|
||||
|
||||
### MongoDB
|
||||
Type: `MongoDB`
|
||||
Type: `mongodb`
|
||||
Disable Property: `org.springframework.cloud.bindings.boot.mongodb.enable`
|
||||
|
||||
| Property | Value
|
||||
| -------- | ------------------
|
||||
| `spring.mongodb.authentication-database` | `{secret/authentication-database}`
|
||||
| `spring.mongodb.database` | `{secret/database}`
|
||||
| `spring.mongodb.grid-fs-database` | `{secret/grid-fs-database}`
|
||||
| `spring.mongodb.host` | `{secret/host}`
|
||||
| `spring.mongodb.password` | `{secret/password}`
|
||||
| `spring.mongodb.port` | `{secret/port}`
|
||||
| `spring.mongodb.uri` | `{secret/uri}`
|
||||
| `spring.mongodb.username` | `{secret/username}`
|
||||
| `spring.mongodb.authentication-database` | `{authentication-database}`
|
||||
| `spring.mongodb.database` | `{database}`
|
||||
| `spring.mongodb.grid-fs-database` | `{grid-fs-database}`
|
||||
| `spring.mongodb.host` | `{host}`
|
||||
| `spring.mongodb.password` | `{password}`
|
||||
| `spring.mongodb.port` | `{port}`
|
||||
| `spring.mongodb.uri` | `{uri}`
|
||||
| `spring.mongodb.username` | `{username}`
|
||||
|
||||
### MySQL RDBMS
|
||||
Type: `MySQL`
|
||||
Type: `mysql`
|
||||
Disable Property: `org.springframework.cloud.bindings.boot.mysql.enable`
|
||||
|
||||
| Property | Value
|
||||
| -------- | ------------------
|
||||
| `spring.datasource.driver-class-name` | `org.mariadb.jdbc.Driver` or `com.mysql.cj.jdbc.Driver` depending on classpath
|
||||
| `spring.datasource.password` | `{secret/password}`
|
||||
| `spring.datasource.url` | `jdbc:mysql://{secret/host}:{secret/port}/{secret/database}`
|
||||
| `spring.datasource.username` | `{secret/username}`
|
||||
| `spring.r2dbc.url` | `r2dbc:mysql://{secret/host}:{secret/port}/{secret/database}`
|
||||
| `spring.r2dbc.password` | `{secret/password}`
|
||||
| `spring.r2dbc.username` | `{secret/username}`
|
||||
| `spring.datasource.password` | `{password}`
|
||||
| `spring.datasource.url` | `jdbc:mysql://{host}:{port}/{database}`
|
||||
| `spring.datasource.username` | `{username}`
|
||||
| `spring.r2dbc.url` | `r2dbc:mysql://{host}:{port}/{database}`
|
||||
| `spring.r2dbc.password` | `{password}`
|
||||
| `spring.r2dbc.username` | `{username}`
|
||||
|
||||
### Neo4J
|
||||
Type: `Neo4J`
|
||||
Type: `neo4j`
|
||||
Disable Property: `org.springframework.cloud.bindings.boot.neo4j.enable`
|
||||
|
||||
| Property | Value
|
||||
| -------- | ------------------
|
||||
| `spring.data.neo4j.password` | `{secret/password}`
|
||||
| `spring.data.neo4j.uri` | `{secret/uri}`
|
||||
| `spring.data.neo4j.username` | `{secret/username}`
|
||||
| `spring.data.neo4j.password` | `{password}`
|
||||
| `spring.data.neo4j.uri` | `{uri}`
|
||||
| `spring.data.neo4j.username` | `{username}`
|
||||
|
||||
### Oracle RDBMS
|
||||
Type: `Oracle`
|
||||
Type: `oracle`
|
||||
Disable Property: `org.springframework.cloud.bindings.boot.oracle.enable`
|
||||
|
||||
| Property | Value
|
||||
| -------- | ------------------
|
||||
| `spring.datasource.driver-class-name` | `oracle.jdbc.OracleDriver`
|
||||
| `spring.datasource.password` | `{secret/password}`
|
||||
| `spring.datasource.url` | `jdbc:oracle://{secret/host}:{secret/port}/{secret/database}`
|
||||
| `spring.datasource.username` | `{secret/username}`
|
||||
| `spring.r2dbc.url` | `r2dbc:oracle://{secret/host}:{secret/port}/{secret/database}`
|
||||
| `spring.r2dbc.password` | `{secret/password}`
|
||||
| `spring.r2dbc.username` | `{secret/username}`
|
||||
| `spring.datasource.password` | `{password}`
|
||||
| `spring.datasource.url` | `jdbc:oracle://{host}:{port}/{database}`
|
||||
| `spring.datasource.username` | `{username}`
|
||||
| `spring.r2dbc.url` | `r2dbc:oracle://{host}:{port}/{database}`
|
||||
| `spring.r2dbc.password` | `{password}`
|
||||
| `spring.r2dbc.username` | `{username}`
|
||||
|
||||
### PostgreSQL RDBMS
|
||||
Type: `PostgreSQL`
|
||||
Type: `postgresql`
|
||||
Disable Property: `org.springframework.cloud.bindings.boot.postgresql.enable`
|
||||
|
||||
| Property | Value
|
||||
| -------- | ------------------
|
||||
| `spring.datasource.driver-class-name` | `org.postgresql.Driver`
|
||||
| `spring.datasource.password` | `{secret/password}`
|
||||
| `spring.datasource.url` | `jdbc:postgres://{secret/host}:{secret/port}/{secret/database}`
|
||||
| `spring.datasource.username` | `{secret/username}`
|
||||
| `spring.r2dbc.url` | `r2dbc:postgres://{secret/host}:{secret/port}/{secret/database}`
|
||||
| `spring.r2dbc.password` | `{secret/password}`
|
||||
| `spring.r2dbc.username` | `{secret/username}`
|
||||
| `spring.datasource.password` | `{password}`
|
||||
| `spring.datasource.url` | `jdbc:postgres://{host}:{port}/{database}`
|
||||
| `spring.datasource.username` | `{username}`
|
||||
| `spring.r2dbc.url` | `r2dbc:postgres://{host}:{port}/{database}`
|
||||
| `spring.r2dbc.password` | `{password}`
|
||||
| `spring.r2dbc.username` | `{username}`
|
||||
|
||||
### RabbitMQ RDBMS
|
||||
Type: `RabbitMQ`
|
||||
Type: `rabbitmq`
|
||||
Disable Property: `org.springframework.cloud.bindings.boot.rabbitmq.enable`
|
||||
|
||||
| Property | Value
|
||||
| -------- | ------------------
|
||||
| `spring.rabbitmq.addresses` | `{secret/addresses}`
|
||||
| `spring.rabbitmq.host` | `{secret/host}`
|
||||
| `spring.rabbitmq.password` | `{secret/password}`
|
||||
| `spring.rabbitmq.port` | `{secret/port}`
|
||||
| `spring.rabbitmq.username` | `{secret/username}`
|
||||
| `spring.rabbitmq.virtual-host` | `{secret/virtual-host}`
|
||||
| `spring.rabbitmq.addresses` | `{addresses}`
|
||||
| `spring.rabbitmq.host` | `{host}`
|
||||
| `spring.rabbitmq.password` | `{password}`
|
||||
| `spring.rabbitmq.port` | `{port}`
|
||||
| `spring.rabbitmq.username` | `{username}`
|
||||
| `spring.rabbitmq.virtual-host` | `{virtual-host}`
|
||||
|
||||
### Redis RDBMS
|
||||
Type: `Redis`
|
||||
Type: `redis`
|
||||
Disable Property: `org.springframework.cloud.bindings.boot.redis.enable`
|
||||
|
||||
| Property | Value
|
||||
| -------- | ------------------
|
||||
| `spring.redis.client-name` | `{secret/client-name}`
|
||||
| `spring.redis.cluster.max-redirects` | `{secret/cluster.max-redirects}`
|
||||
| `spring.redis.cluster.nodes` | `{secret/cluster-nodes}`
|
||||
| `spring.redis.database` | `{secret/database}`
|
||||
| `spring.redis.host` | `{secret/host}`
|
||||
| `spring.redis.password` | `{secret/password}`
|
||||
| `spring.redis.port` | `{secret/port}`
|
||||
| `spring.redis.sentinel.master` | `{secret/sentinel.master}`
|
||||
| `spring.redis.sentinel.nodes` | `{secret/sentinel.nodes}`
|
||||
| `spring.redis.ssl` | `{secret/ssl}`
|
||||
| `spring.redis.url` | `{secret/url}`
|
||||
| `spring.redis.client-name` | `{client-name}`
|
||||
| `spring.redis.cluster.max-redirects` | `{cluster.max-redirects}`
|
||||
| `spring.redis.cluster.nodes` | `{cluster-nodes}`
|
||||
| `spring.redis.database` | `{database}`
|
||||
| `spring.redis.host` | `{host}`
|
||||
| `spring.redis.password` | `{password}`
|
||||
| `spring.redis.port` | `{port}`
|
||||
| `spring.redis.sentinel.master` | `{sentinel.master}`
|
||||
| `spring.redis.sentinel.nodes` | `{sentinel.nodes}`
|
||||
| `spring.redis.ssl` | `{ssl}`
|
||||
| `spring.redis.url` | `{url}`
|
||||
|
||||
## SCS Config Server
|
||||
Type: `Config`
|
||||
Type: `config`
|
||||
Disable Property: `org.springframework.cloud.bindings.boot.config.enable`
|
||||
|
||||
| Property | Value
|
||||
| -------- | ------------------
|
||||
| `spring.cloud.config.uri` | `{secret/uri}`
|
||||
| `spring.cloud.config.client.oauth2.clientId` | `{secret/client-id}`
|
||||
| `spring.cloud.config.client.oauth2.clientSecret` | `{secret/client-secret}`
|
||||
| `spring.cloud.config.client.oauth2.accessTokenUri` | `{secret/access-token-uri}`
|
||||
| `spring.cloud.config.uri` | `{uri}`
|
||||
| `spring.cloud.config.client.oauth2.clientId` | `{client-id}`
|
||||
| `spring.cloud.config.client.oauth2.clientSecret` | `{client-secret}`
|
||||
| `spring.cloud.config.client.oauth2.accessTokenUri` | `{access-token-uri}`
|
||||
|
||||
### SCS Eureka
|
||||
Type: `Eureka`
|
||||
Type: `eureka`
|
||||
Disable Property: `org.springframework.cloud.bindings.boot.eureka.enable`
|
||||
|
||||
| Property | Value
|
||||
| -------- | ------------------
|
||||
| `eureka.client.oauth2.client-id` | `{secret/client-id}`
|
||||
| `eureka.client.oauth2.access-token-uri` | `{secret/access-token-uri}`
|
||||
| `eureka.client.oauth2.client-id` | `{client-id}`
|
||||
| `eureka.client.oauth2.access-token-uri` | `{access-token-uri}`
|
||||
| `eureka.client.region` | `default`
|
||||
| `eureka.client.serviceUrl.defaultZone` | `{secret/uri}/eureka/`
|
||||
| `eureka.client.serviceUrl.defaultZone` | `{uri}/eureka/`
|
||||
|
||||
## Spring Security OAuth2
|
||||
Type: `OAuth2`
|
||||
Type: `oauth2`
|
||||
Disable Property: `org.springframework.cloud.bindings.boot.oauth2.enable`
|
||||
|
||||
| Property | Value
|
||||
| -------- | ------------------
|
||||
| `spring.security.oauth2.client.registration.{name}.client-id` | `{secret/client-id}`
|
||||
| `spring.security.oauth2.client.registration.{name}.client-secret` | `{secret/client-secret}`
|
||||
| `spring.security.oauth2.client.registration.{name}.provider` | `{metadata/provider}`
|
||||
| `spring.security.oauth2.client.provider.{metadata/provider}.issuer-uri` | `{secret/issuer-uri}`
|
||||
| `spring.security.oauth2.client.provider.{metadata/provider}.authorization-uri` | `{secret/authorization-uri}`
|
||||
| `spring.security.oauth2.client.provider.{metadata/provider}.token-uri` | `{secret/token-uri}`
|
||||
| `spring.security.oauth2.client.provider.{metadata/provider}.user-info-uri` | `{secret/user-info-uri}`
|
||||
| `spring.security.oauth2.client.provider.{metadata/provider}.user-info-authentication-method` | `{secret/user-info-authentication-method}`
|
||||
| `spring.security.oauth2.client.provider.{metadata/provider}.jwk-set-uri` | `{secret/jwk-set-uri}`
|
||||
| `spring.security.oauth2.client.provider.{metadata/provider}.user-name-attribute` | `{secret/user-name-attribute}`
|
||||
| `spring.security.oauth2.client.registration.{name}.client-id` | `{client-id}`
|
||||
| `spring.security.oauth2.client.registration.{name}.client-secret` | `{client-secret}`
|
||||
| `spring.security.oauth2.client.registration.{name}.provider` | `{provider}`
|
||||
| `spring.security.oauth2.client.provider.{provider}.issuer-uri` | `{issuer-uri}`
|
||||
| `spring.security.oauth2.client.provider.{provider}.authorization-uri` | `{authorization-uri}`
|
||||
| `spring.security.oauth2.client.provider.{provider}.token-uri` | `{token-uri}`
|
||||
| `spring.security.oauth2.client.provider.{provider}.user-info-uri` | `{user-info-uri}`
|
||||
| `spring.security.oauth2.client.provider.{provider}.user-info-authentication-method` | `{user-info-authentication-method}`
|
||||
| `spring.security.oauth2.client.provider.{provider}.jwk-set-uri` | `{jwk-set-uri}`
|
||||
| `spring.security.oauth2.client.provider.{provider}.user-name-attribute` | `{user-name-attribute}`
|
||||
|
||||
### SQLServer RDBMS
|
||||
Type: `SQLServer`
|
||||
Type: `sqlserver`
|
||||
Disable Property: `org.springframework.cloud.bindings.boot.sqlserver.enable`
|
||||
|
||||
| Property | Value
|
||||
| -------- | ------------------
|
||||
| `spring.datasource.driver-class-name` | `com.microsoft.sqlserver.jdbc.SQLServerDriver`
|
||||
| `spring.datasource.password` | `{secret/password}`
|
||||
| `spring.datasource.url` | `jdbc:sqlserver://{secret/host}:{secret/port}/{secret/database}`
|
||||
| `spring.datasource.username` | `{secret/username}`
|
||||
| `spring.r2dbc.url` | `r2dbc:sqlserver://{secret/host}:{secret/port}/{secret/database}`
|
||||
| `spring.r2dbc.password` | `{secret/password}`
|
||||
| `spring.r2dbc.username` | `{secret/username}`
|
||||
| `spring.datasource.password` | `{password}`
|
||||
| `spring.datasource.url` | `jdbc:sqlserver://{host}:{port}/{database}`
|
||||
| `spring.datasource.username` | `{username}`
|
||||
| `spring.r2dbc.url` | `r2dbc:sqlserver://{host}:{port}/{database}`
|
||||
| `spring.r2dbc.password` | `{password}`
|
||||
| `spring.r2dbc.username` | `{username}`
|
||||
|
||||
|
||||
### Vault
|
||||
Type: `Vault`
|
||||
Type: `vault`
|
||||
Disable Property: `org.springframework.cloud.bindings.boot.vault.enable`
|
||||
|
||||
Any Provider:
|
||||
| Property | Value
|
||||
| -------- | ------------------
|
||||
| `spring.cloud.vault.authentication` | `{secret/authentication-method}`
|
||||
| `spring.cloud.vault.namespace` | `{secret/namespace}`
|
||||
| `spring.cloud.vault.uri` | `{secret/uri}`
|
||||
| `spring.cloud.vault.authentication` | `{authentication-method}`
|
||||
| `spring.cloud.vault.namespace` | `{namespace}`
|
||||
| `spring.cloud.vault.uri` | `{uri}`
|
||||
|
||||
If `{secret/authentication-method}` is equal to `approle`:
|
||||
If `{authentication-method}` is equal to `approle`:
|
||||
| Property | Value
|
||||
| -------- | ------------------
|
||||
| `spring.cloud.vault.app-role.app-role-path` | `{secret/app-role-path}`
|
||||
| `spring.cloud.vault.app-role.role-id` | `{secret/role-id}`
|
||||
| `spring.cloud.vault.app-role.role` | `{secret/role}`
|
||||
| `spring.cloud.vault.app-role.secret-id` | `{secret/secret-id}`
|
||||
| `spring.cloud.vault.app-role.app-role-path` | `{app-role-path}`
|
||||
| `spring.cloud.vault.app-role.role-id` | `{role-id}`
|
||||
| `spring.cloud.vault.app-role.role` | `{role}`
|
||||
| `spring.cloud.vault.app-role.secret-id` | `{secret-id}`
|
||||
|
||||
If `{secret/authentication-method}` is equal to `aws_ec2`:
|
||||
If `{authentication-method}` is equal to `aws_ec2`:
|
||||
| Property | Value
|
||||
| -------- | ------------------
|
||||
| `spring.cloud.vault.aws-ec2.aws-ec2-path` | `{secret/aws-ec2-path}`
|
||||
| `spring.cloud.vault.aws-ec2.identity-document` | `{secret/aws-ec2-instance-identity-document}`
|
||||
| `spring.cloud.vault.aws-ec2.nonce` | `{secret/nonce}`
|
||||
| `spring.cloud.vault.aws-ec2.role` | `{secret/role}`
|
||||
| `spring.cloud.vault.aws-ec2.aws-ec2-path` | `{aws-ec2-path}`
|
||||
| `spring.cloud.vault.aws-ec2.identity-document` | `{aws-ec2-instance-identity-document}`
|
||||
| `spring.cloud.vault.aws-ec2.nonce` | `{nonce}`
|
||||
| `spring.cloud.vault.aws-ec2.role` | `{role}`
|
||||
|
||||
If `{secret/authentication-method}` is equal to `aws_iam`:
|
||||
If `{authentication-method}` is equal to `aws_iam`:
|
||||
| Property | Value
|
||||
| -------- | ------------------
|
||||
| `spring.cloud.vault.aws-iam.aws-path` | `{secret/aws-path}`
|
||||
| `spring.cloud.vault.aws-iam.endpoint-uri` | `{secret/aws-sts-endpoint-uri}`
|
||||
| `spring.cloud.vault.aws-iam.role` | `{secret/role}`
|
||||
| `spring.cloud.vault.aws-iam.server-id` | `{secret/aws-iam-server-id}`
|
||||
| `spring.cloud.vault.aws-iam.aws-path` | `{aws-path}`
|
||||
| `spring.cloud.vault.aws-iam.endpoint-uri` | `{aws-sts-endpoint-uri}`
|
||||
| `spring.cloud.vault.aws-iam.role` | `{role}`
|
||||
| `spring.cloud.vault.aws-iam.server-id` | `{aws-iam-server-id}`
|
||||
|
||||
If `{secret/authentication-method}` is equal to `azure_msi`:
|
||||
If `{authentication-method}` is equal to `azure_msi`:
|
||||
| Property | Value
|
||||
| -------- | ------------------
|
||||
| `spring.cloud.vault.azure-msi.azure-path` | `{secret/azure-path}`
|
||||
| `spring.cloud.vault.azure-msi.role` | `{secret/role}`
|
||||
| `spring.cloud.vault.azure-msi.azure-path` | `{azure-path}`
|
||||
| `spring.cloud.vault.azure-msi.role` | `{role}`
|
||||
|
||||
If `{secret/authentication-method}` is equal to `cert`:
|
||||
If `{authentication-method}` is equal to `cert`:
|
||||
| Property | Value
|
||||
| -------- | ------------------
|
||||
| `spring.cloud.vault.ssl.cert-auth-path` | `{secret/cert-auth-path}`
|
||||
| `spring.cloud.vault.ssl.key-store-password` | `{secret/key-store-password}`
|
||||
| `spring.cloud.vault.ssl.key-store` | `${CNB_BINDINGS}/{name}/secret/keystore.jks`
|
||||
| `spring.cloud.vault.ssl.cert-auth-path` | `{cert-auth-path}`
|
||||
| `spring.cloud.vault.ssl.key-store-password` | `{key-store-password}`
|
||||
| `spring.cloud.vault.ssl.key-store` | `${SERVICE_BINDINGS_ROOT}/{name}/keystore.jks`
|
||||
|
||||
If `{secret/authentication-method}` is equal to `cubbyhole`:
|
||||
If `{authentication-method}` is equal to `cubbyhole`:
|
||||
| Property | Value
|
||||
| -------- | ------------------
|
||||
| `spring.cloud.vault.token` | `{secret/token}`
|
||||
| `spring.cloud.vault.token` | `{token}`
|
||||
|
||||
If `{secret/authentication-method}` is equal to `gcp_gce`:
|
||||
If `{authentication-method}` is equal to `gcp_gce`:
|
||||
| Property | Value
|
||||
| -------- | ------------------
|
||||
| `spring.cloud.vault.gcp-gce.gcp-path` | `{secret/gcp-path}`
|
||||
| `spring.cloud.vault.gcp-gce.role` | `{secret/role}`
|
||||
| `spring.cloud.vault.gcp-gce.service-account` | `{secret/gcp-service-account}`
|
||||
| `spring.cloud.vault.gcp-gce.gcp-path` | `{gcp-path}`
|
||||
| `spring.cloud.vault.gcp-gce.role` | `{role}`
|
||||
| `spring.cloud.vault.gcp-gce.service-account` | `{gcp-service-account}`
|
||||
|
||||
|
||||
If `{secret/authentication-method}` is equal to `gcp_iam`:
|
||||
If `{authentication-method}` is equal to `gcp_iam`:
|
||||
| Property | Value
|
||||
| -------- | ------------------
|
||||
| `spring.cloud.vault.gcp-iam.credentials.encoded-key` | `{secret/encoded-key}`
|
||||
| `spring.cloud.vault.gcp-iam.credentials.location` | `${CNB_BINDINGS}/{name}/secret/credentials.json`
|
||||
| `spring.cloud.vault.gcp-iam.gcp-path` | `{secret/gcp-path}`
|
||||
| `spring.cloud.vault.gcp-iam.jwt-validity` | `{secret/jwt-validity}`
|
||||
| `spring.cloud.vault.gcp-iam.project-id` | `{secret/gcp-project-id}`
|
||||
| `spring.cloud.vault.gcp-iam.role` | `{secret/role}`
|
||||
| `spring.cloud.vault.gcp-iam.service-account` | `{secret/gcp-service-account}`
|
||||
| `spring.cloud.vault.gcp-iam.credentials.encoded-key` | `{encoded-key}`
|
||||
| `spring.cloud.vault.gcp-iam.credentials.location` | `${SERVICE_BINDINGS_ROOT}/{name}/credentials.json`
|
||||
| `spring.cloud.vault.gcp-iam.gcp-path` | `{gcp-path}`
|
||||
| `spring.cloud.vault.gcp-iam.jwt-validity` | `{jwt-validity}`
|
||||
| `spring.cloud.vault.gcp-iam.project-id` | `{gcp-project-id}`
|
||||
| `spring.cloud.vault.gcp-iam.role` | `{role}`
|
||||
| `spring.cloud.vault.gcp-iam.service-account` | `{gcp-service-account}`
|
||||
|
||||
If `{secret/authentication-method}` is equal to `kubernetes`:
|
||||
If `{authentication-method}` is equal to `kubernetes`:
|
||||
| Property | Value
|
||||
| -------- | ------------------
|
||||
| `spring.cloud.vault.kubernetes.kubernetes-path` | `{secret/kubernetes-path}`
|
||||
| `spring.cloud.vault.kubernetes.role` | `{secret/role}`
|
||||
| `spring.cloud.vault.kubernetes.kubernetes-path` | `{kubernetes-path}`
|
||||
| `spring.cloud.vault.kubernetes.role` | `{role}`
|
||||
|
||||
If `{secret/authentication-method}` is equal to `token`:
|
||||
If `{authentication-method}` is equal to `token`:
|
||||
| Property | Value
|
||||
| -------- | ------------------
|
||||
| `spring.cloud.vault.token` | `{secret/token}`
|
||||
| `spring.cloud.vault.token` | `{token}`
|
||||
|
||||
|
||||
### Wavefront
|
||||
|
||||
Type: `Wavefront`
|
||||
Type: `wavefront`
|
||||
Disable Property: `org.springframework.cloud.bindings.boot.wavefront.enable`
|
||||
|
||||
| Property | Value
|
||||
| -------- | ------------------
|
||||
| `management.metrics.export.wavefront.api-token` | `{secret/api-token}`
|
||||
| `management.metrics.export.wavefront.uri` | `{secret/uri}`
|
||||
| `management.metrics.export.wavefront.api-token` | `{api-token}`
|
||||
| `management.metrics.export.wavefront.uri` | `{uri}`
|
||||
|
||||
|
||||
## Extending Spring Boot Configuration
|
||||
|
||||
@@ -15,6 +15,8 @@
|
||||
*/
|
||||
package org.springframework.cloud.bindings;
|
||||
|
||||
import org.springframework.lang.Nullable;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.nio.file.Files;
|
||||
@@ -72,8 +74,8 @@ public final class Binding {
|
||||
this.path = path;
|
||||
this.secret = new HashMap<>();
|
||||
|
||||
String provider = null;
|
||||
String type = null;
|
||||
String provider = null;
|
||||
for (Map.Entry<String, String> entry : secret.entrySet()) {
|
||||
switch (entry.getKey()) {
|
||||
case TYPE:
|
||||
@@ -88,8 +90,12 @@ public final class Binding {
|
||||
}
|
||||
}
|
||||
|
||||
this.provider = provider;
|
||||
if (type == null) {
|
||||
throw new IllegalArgumentException(String.format("%s has no type and is not a valid binding", path));
|
||||
}
|
||||
|
||||
this.type = type;
|
||||
this.provider = provider;
|
||||
}
|
||||
|
||||
private static Map<String, String> createSecretMap(Path path) {
|
||||
@@ -163,6 +169,7 @@ public final class Binding {
|
||||
/**
|
||||
* Returns the provider of the binding.
|
||||
*/
|
||||
@Nullable
|
||||
public String getProvider() {
|
||||
return provider;
|
||||
}
|
||||
|
||||
@@ -49,9 +49,10 @@ public final class Bindings {
|
||||
private final List<Binding> bindings;
|
||||
|
||||
/**
|
||||
* Creates a new {@code Bindings} instance, using the {@code $CNB_BINDINGS} environment variable to determine the
|
||||
* file system root. If the {@code $CNB_BINDINGS} environment variable is not set, an empty {@code Bindings} is
|
||||
* returned. If the directory does not exist, an empty {@code Bindings} is returned.
|
||||
* Creates a new {@code Bindings} instance, using the {@code $SERVICE_BINDING_ROOT} environment variable or the
|
||||
* {@code $CNB_BINDINGS} environment variable if it does not exist to determine the file system root. If neither
|
||||
* the {@code $SERVICE_BINDING_ROOT} nor {@code $CNB_BINDINGS} environment variables are set, an empty
|
||||
* {@code Bindings} is returned. If the directory does not exist, an empty {@code Bindings} is returned.
|
||||
*/
|
||||
public Bindings() {
|
||||
this(getBindingRoot());
|
||||
@@ -150,9 +151,8 @@ public final class Bindings {
|
||||
*/
|
||||
public List<Binding> filterBindings(@Nullable String type, @Nullable String provider) {
|
||||
return bindings.stream()
|
||||
.filter(binding ->
|
||||
(type == null || binding.getType().equalsIgnoreCase(type)) &&
|
||||
(provider == null || binding.getProvider().equalsIgnoreCase(provider)))
|
||||
.filter(b -> type == null || b.getType().equalsIgnoreCase(type))
|
||||
.filter(b -> provider == null || b.getProvider() != null && b.getProvider().equalsIgnoreCase(provider))
|
||||
.collect(Collectors.toList());
|
||||
}
|
||||
|
||||
|
||||
@@ -33,12 +33,12 @@ import static org.springframework.cloud.bindings.boot.PropertySourceContributor.
|
||||
|
||||
/**
|
||||
* An implementation of {@link EnvironmentPostProcessor} that generates properties from {@link Bindings} with a
|
||||
* flattened format: {@code cnb.bindings.{name}.{metadata,secret}.*}.
|
||||
* flattened format: {@code k8s.bindings.{name}.*}.
|
||||
*/
|
||||
public final class BindingFlattenedEnvironmentPostProcessor implements ApplicationListener<ApplicationPreparedEvent>,
|
||||
EnvironmentPostProcessor, Ordered {
|
||||
|
||||
public static final String BINDING_FLATTENED_PROPERTY_SOURCE_NAME = "cnbBindingFlattened";
|
||||
public static final String BINDING_FLATTENED_PROPERTY_SOURCE_NAME = "kubernetesServiceBindingFlattened";
|
||||
|
||||
private final DeferredLog log = new DeferredLog();
|
||||
|
||||
@@ -72,16 +72,16 @@ public final class BindingFlattenedEnvironmentPostProcessor implements Applicati
|
||||
Map<String, Object> properties = new HashMap<>();
|
||||
bindings.getBindings().forEach(binding -> {
|
||||
binding.getSecret().forEach((key, value) -> {
|
||||
properties.put(String.format("cnb.bindings.%s.%s", binding.getName(), key), value);
|
||||
properties.put(String.format("k8s.bindings.%s.%s", binding.getName(), key), value);
|
||||
});
|
||||
});
|
||||
|
||||
if (properties.isEmpty()) {
|
||||
log.debug("No properties set from CNB Bindings. Skipping PropertySource creation.");
|
||||
log.debug("No properties set from Kubernetes Service Bindings. Skipping PropertySource creation.");
|
||||
return;
|
||||
}
|
||||
|
||||
log.info("Creating flattened PropertySource from CNB Bindings");
|
||||
log.info("Creating flattened PropertySource from Kubernetes Service Bindings");
|
||||
contributePropertySource(BINDING_FLATTENED_PROPERTY_SOURCE_NAME, properties, environment);
|
||||
}
|
||||
|
||||
|
||||
@@ -51,7 +51,7 @@ public final class BindingSpecificEnvironmentPostProcessor implements Applicatio
|
||||
/**
|
||||
* The name of the {@link PropertySource} created by the {@code BindingsEnvironmentPostProcessor}: {@value}.
|
||||
*/
|
||||
public static final String BINDING_SPECIFIC_PROPERTY_SOURCE_NAME = "cnbBindingSpecific";
|
||||
public static final String BINDING_SPECIFIC_PROPERTY_SOURCE_NAME = "kubernetesServiceBindingSpecific";
|
||||
|
||||
private static final DeferredLog LOG = new DeferredLog();
|
||||
|
||||
@@ -92,18 +92,18 @@ public final class BindingSpecificEnvironmentPostProcessor implements Applicatio
|
||||
}
|
||||
|
||||
if (bindings.getBindings().isEmpty()) {
|
||||
LOG.debug("No CNB Bindings found. Skipping Environment post-processing.");
|
||||
LOG.debug("No Kubernetes Service Bindings found. Skipping Environment post-processing.");
|
||||
return;
|
||||
}
|
||||
|
||||
Map<String, Object> properties = new HashMap<>();
|
||||
processors.forEach(processor -> processor.process(environment, bindings, properties));
|
||||
if (properties.isEmpty()) {
|
||||
LOG.debug("No properties set from CNB Bindings. Skipping PropertySource creation.");
|
||||
LOG.debug("No properties set from Kubernetes Service Bindings. Skipping PropertySource creation.");
|
||||
return;
|
||||
}
|
||||
|
||||
LOG.info("Creating binding-specific PropertySource from CNB Bindings");
|
||||
LOG.info("Creating binding-specific PropertySource from Kubernetes Service Bindings");
|
||||
contributePropertySource(BINDING_SPECIFIC_PROPERTY_SOURCE_NAME, properties, environment);
|
||||
}
|
||||
|
||||
|
||||
@@ -32,7 +32,7 @@ public final class CassandraBindingsPropertiesProcessor implements BindingsPrope
|
||||
/**
|
||||
* The {@link Binding} type that this processor is interested in: {@value}.
|
||||
**/
|
||||
public static final String TYPE = "Cassandra";
|
||||
public static final String TYPE = "cassandra";
|
||||
|
||||
@Override
|
||||
public void process(Environment environment, Bindings bindings, Map<String, Object> properties) {
|
||||
|
||||
@@ -31,7 +31,7 @@ final class ConfigServerBindingsPropertiesProcessor implements BindingsPropertie
|
||||
/**
|
||||
* The {@link Binding} type that this processor is interested in: {@value}.
|
||||
**/
|
||||
public static final String TYPE = "Config";
|
||||
public static final String TYPE = "config";
|
||||
|
||||
@Override
|
||||
public void process(Environment environment, Bindings bindings, Map<String, Object> properties) {
|
||||
|
||||
@@ -32,7 +32,7 @@ final class CouchbaseBindingsPropertiesProcessor implements BindingsPropertiesPr
|
||||
/**
|
||||
* The {@link Binding} type that this processor is interested in: {@value}.
|
||||
**/
|
||||
public static final String TYPE = "Couchbase";
|
||||
public static final String TYPE = "couchbase";
|
||||
|
||||
@Override
|
||||
public void process(Environment environment, Bindings bindings, Map<String, Object> properties) {
|
||||
|
||||
@@ -34,7 +34,7 @@ public final class Db2BindingsPropertiesProcessor implements BindingsPropertiesP
|
||||
/**
|
||||
* The {@link Binding} type that this processor is interested in: {@value}.
|
||||
**/
|
||||
public static final String TYPE = "DB2";
|
||||
public static final String TYPE = "db2";
|
||||
|
||||
@Override
|
||||
public void process(Environment environment, Bindings bindings, Map<String, Object> properties) {
|
||||
|
||||
@@ -32,7 +32,7 @@ final class ElasticsearchBindingsPropertiesProcessor implements BindingsProperti
|
||||
/**
|
||||
* The {@link Binding} type that this processor is interested in: {@value}.
|
||||
**/
|
||||
public static final String TYPE = "Elasticsearch";
|
||||
public static final String TYPE = "elasticsearch";
|
||||
|
||||
|
||||
@Override
|
||||
|
||||
@@ -31,7 +31,7 @@ final class EurekaBindingsPropertiesProcessor implements BindingsPropertiesProce
|
||||
/**
|
||||
* The {@link Binding} type that this processor is interested in: {@value}.
|
||||
**/
|
||||
public static final String TYPE = "Eureka";
|
||||
public static final String TYPE = "eureka";
|
||||
|
||||
@Override
|
||||
public void process(Environment environment, Bindings bindings, Map<String, Object> properties) {
|
||||
|
||||
@@ -26,7 +26,7 @@ final class Guards {
|
||||
|
||||
static boolean isTypeEnabled(Environment environment, String type) {
|
||||
return environment.getProperty(
|
||||
String.format("org.springframework.cloud.bindings.boot.%s.enable", type.toLowerCase()),
|
||||
String.format("org.springframework.cloud.bindings.boot.%s.enable", type),
|
||||
Boolean.class, true);
|
||||
}
|
||||
|
||||
|
||||
@@ -31,7 +31,7 @@ final class KafkaBindingsPropertiesProcessor implements BindingsPropertiesProces
|
||||
/**
|
||||
* The {@link Binding} type that this processor is interested in: {@value}.
|
||||
**/
|
||||
public static final String TYPE = "Kafka";
|
||||
public static final String TYPE = "kafka";
|
||||
|
||||
@Override
|
||||
public void process(Environment environment, Bindings bindings, Map<String, Object> properties) {
|
||||
|
||||
@@ -31,7 +31,7 @@ public final class LDAPBindingsPropertiesProcessor implements BindingsProperties
|
||||
/**
|
||||
* The {@link Binding} type that this processor is interested in: {@value}.
|
||||
**/
|
||||
public static final String TYPE = "LDAP";
|
||||
public static final String TYPE = "ldap";
|
||||
|
||||
@Override
|
||||
public void process(Environment environment, Bindings bindings, Map<String, Object> properties) {
|
||||
|
||||
@@ -32,7 +32,7 @@ public final class MongoDbBindingsPropertiesProcessor implements BindingsPropert
|
||||
/**
|
||||
* The {@link Binding} type that this processor is interested in: {@value}.
|
||||
**/
|
||||
public static final String TYPE = "MongoDB";
|
||||
public static final String TYPE = "mongodb";
|
||||
|
||||
@Override
|
||||
public void process(Environment environment, Bindings bindings, Map<String, Object> properties) {
|
||||
|
||||
@@ -34,7 +34,7 @@ public final class MySqlBindingsPropertiesProcessor implements BindingsPropertie
|
||||
/**
|
||||
* The {@link Binding} type that this processor is interested in: {@value}.
|
||||
**/
|
||||
public static final String TYPE = "MySQL";
|
||||
public static final String TYPE = "mysql";
|
||||
|
||||
@Override
|
||||
public void process(Environment environment, Bindings bindings, Map<String, Object> properties) {
|
||||
|
||||
@@ -31,7 +31,7 @@ final class Neo4JBindingsPropertiesProcessor implements BindingsPropertiesProces
|
||||
/**
|
||||
* The {@link Binding} type that this processor is interested in: {@value}.
|
||||
**/
|
||||
public static final String TYPE = "Neo4J";
|
||||
public static final String TYPE = "neo4j";
|
||||
|
||||
@Override
|
||||
public void process(Environment environment, Bindings bindings, Map<String, Object> properties) {
|
||||
|
||||
@@ -34,7 +34,7 @@ public final class OracleBindingsPropertiesProcessor implements BindingsProperti
|
||||
/**
|
||||
* The {@link Binding} type that this processor is interested in: {@value}.
|
||||
**/
|
||||
public static final String TYPE = "Oracle";
|
||||
public static final String TYPE = "oracle";
|
||||
|
||||
@Override
|
||||
public void process(Environment environment, Bindings bindings, Map<String, Object> properties) {
|
||||
|
||||
@@ -34,7 +34,7 @@ public final class PostgreSqlBindingsPropertiesProcessor implements BindingsProp
|
||||
/**
|
||||
* The {@link Binding} type that this processor is interested in: {@value}.
|
||||
**/
|
||||
public static final String TYPE = "PostgreSQL";
|
||||
public static final String TYPE = "postgresql";
|
||||
|
||||
@Override
|
||||
public void process(Environment environment, Bindings bindings, Map<String, Object> properties) {
|
||||
|
||||
@@ -32,7 +32,7 @@ final class RabbitMqBindingsPropertiesProcessor implements BindingsPropertiesPro
|
||||
/**
|
||||
* The {@link Binding} type that this processor is interested in: {@value}.
|
||||
**/
|
||||
public static final String TYPE = "RabbitMQ";
|
||||
public static final String TYPE = "rabbitmq";
|
||||
|
||||
@Override
|
||||
public void process(Environment environment, Bindings bindings, Map<String, Object> properties) {
|
||||
|
||||
@@ -32,7 +32,7 @@ public final class RedisBindingsPropertiesProcessor implements BindingsPropertie
|
||||
/**
|
||||
* The {@link Binding} type that this processor is interested in: {@value}.
|
||||
**/
|
||||
public static final String TYPE = "Redis";
|
||||
public static final String TYPE = "redis";
|
||||
|
||||
@Override
|
||||
public void process(Environment environment, Bindings bindings, Map<String, Object> properties) {
|
||||
|
||||
@@ -35,7 +35,7 @@ public final class SpringSecurityOAuth2BindingsPropertiesProcessor implements Bi
|
||||
/**
|
||||
* The {@link Binding} type that this processor is interested in: {@value}.
|
||||
**/
|
||||
public static final String TYPE = "OAuth2";
|
||||
public static final String TYPE = "oauth2";
|
||||
|
||||
private static final DeferredLog LOG = new DeferredLog();
|
||||
|
||||
|
||||
@@ -34,7 +34,7 @@ public final class SqlServerBindingsPropertiesProcessor implements BindingsPrope
|
||||
/**
|
||||
* The {@link Binding} type that this processor is interested in: {@value}.
|
||||
**/
|
||||
public static final String TYPE = "SQLServer";
|
||||
public static final String TYPE = "sqlserver";
|
||||
|
||||
@Override
|
||||
public void process(Environment environment, Bindings bindings, Map<String, Object> properties) {
|
||||
|
||||
@@ -35,7 +35,7 @@ public final class VaultBindingsPropertiesProcessor implements BindingsPropertie
|
||||
/**
|
||||
* The {@link Binding} type that this processor is interested in: {@value}.
|
||||
**/
|
||||
public static final String TYPE = "Vault";
|
||||
public static final String TYPE = "vault";
|
||||
|
||||
private static final DeferredLog LOG = new DeferredLog();
|
||||
|
||||
|
||||
@@ -32,7 +32,7 @@ public final class WavefrontBindingsPropertiesProcessor implements BindingsPrope
|
||||
/**
|
||||
* The {@link Binding} type that this processor is interested in: {@value}.
|
||||
**/
|
||||
public static final String TYPE = "Wavefront";
|
||||
public static final String TYPE = "wavefront";
|
||||
|
||||
@Override
|
||||
public void process(Environment environment, Bindings bindings, Map<String, Object> properties) {
|
||||
|
||||
@@ -20,14 +20,25 @@ import org.junit.jupiter.api.DisplayName;
|
||||
import org.junit.jupiter.api.Nested;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Path;
|
||||
import java.nio.file.Paths;
|
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
import static org.assertj.core.api.Assertions.assertThatIllegalArgumentException;
|
||||
|
||||
@DisplayName("Binding")
|
||||
final class BindingTest {
|
||||
|
||||
@Test
|
||||
@DisplayName("fails to create invalid binding")
|
||||
void testInvalid() throws IOException {
|
||||
Path path = Files.createTempDirectory("invalid-binding");
|
||||
|
||||
assertThatIllegalArgumentException().isThrownBy(() -> new Binding(path));
|
||||
}
|
||||
|
||||
@Nested
|
||||
@DisplayName("CNB Bindings")
|
||||
final class CNBBindings {
|
||||
@@ -60,7 +71,6 @@ final class BindingTest {
|
||||
assertThat(binding.getSecretFilePath("test-secret-key"))
|
||||
.isEqualTo(root.resolve("test-k8s/secret/test-secret-key"));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Nested
|
||||
|
||||
@@ -88,13 +88,17 @@ final class BindingsTest {
|
||||
new FluentMap()
|
||||
.withEntry("kind", "test-kind-2")
|
||||
.withEntry("provider", "test-provider-2")
|
||||
),
|
||||
new Binding("test-name-3", root.resolve("test-name-3"),
|
||||
new FluentMap()
|
||||
.withEntry("kind", "test-kind-2")
|
||||
)
|
||||
);
|
||||
|
||||
@Test
|
||||
@DisplayName("returns content")
|
||||
void getBindings() {
|
||||
assertThat(bindings.getBindings()).hasSize(2);
|
||||
assertThat(bindings.getBindings()).hasSize(3);
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -171,13 +175,17 @@ final class BindingsTest {
|
||||
new FluentMap()
|
||||
.withEntry("type", "test-type-2")
|
||||
.withEntry("provider", "test-provider-2")
|
||||
),
|
||||
new Binding("test-name-3", root.resolve("test-name-3"),
|
||||
new FluentMap()
|
||||
.withEntry("type", "test-type-3")
|
||||
)
|
||||
);
|
||||
|
||||
@Test
|
||||
@DisplayName("returns content")
|
||||
void getBindings() {
|
||||
assertThat(bindings.getBindings()).hasSize(2);
|
||||
assertThat(bindings.getBindings()).hasSize(3);
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
@@ -22,10 +22,10 @@ import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.context.config.ConfigFileApplicationListener;
|
||||
import org.springframework.cloud.bindings.Binding;
|
||||
import org.springframework.cloud.bindings.Bindings;
|
||||
import org.springframework.cloud.bindings.FluentMap;
|
||||
import org.springframework.mock.env.MockEnvironment;
|
||||
|
||||
import java.nio.file.Paths;
|
||||
import java.util.Collections;
|
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
|
||||
@@ -43,7 +43,8 @@ final class BindingFlattenedEnvironmentPostProcessorTest {
|
||||
new BindingFlattenedEnvironmentPostProcessor(
|
||||
new Bindings(
|
||||
new Binding("test-name", Paths.get("test-path"),
|
||||
Collections.emptyMap()
|
||||
new FluentMap()
|
||||
.withEntry(Binding.TYPE, "test-type")
|
||||
)
|
||||
)
|
||||
).postProcessEnvironment(new MockEnvironment(), application);
|
||||
@@ -66,13 +67,15 @@ final class BindingFlattenedEnvironmentPostProcessorTest {
|
||||
new BindingFlattenedEnvironmentPostProcessor(
|
||||
new Bindings(
|
||||
new Binding("test-name", Paths.get("test-path"),
|
||||
Collections.singletonMap("test-secret-key", "test-secret-value")
|
||||
new FluentMap()
|
||||
.withEntry(Binding.TYPE, "test-type")
|
||||
.withEntry("test-secret-key", "test-secret-value")
|
||||
)
|
||||
)
|
||||
).postProcessEnvironment(environment, application);
|
||||
|
||||
assertThat(environment.getPropertySources()).hasSize(2);
|
||||
assertThat(environment.getProperty("cnb.bindings.test-name.test-secret-key")).isEqualTo("test-secret-value");
|
||||
assertThat(environment.getProperty("k8s.bindings.test-name.test-secret-key")).isEqualTo("test-secret-value");
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
@@ -22,10 +22,10 @@ import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.context.config.ConfigFileApplicationListener;
|
||||
import org.springframework.cloud.bindings.Binding;
|
||||
import org.springframework.cloud.bindings.Bindings;
|
||||
import org.springframework.cloud.bindings.FluentMap;
|
||||
import org.springframework.mock.env.MockEnvironment;
|
||||
|
||||
import java.nio.file.Paths;
|
||||
import java.util.Collections;
|
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
|
||||
@@ -43,7 +43,8 @@ final class BindingSpecificEnvironmentPostProcessorTest {
|
||||
new BindingSpecificEnvironmentPostProcessor(
|
||||
new Bindings(
|
||||
new Binding("test-name", Paths.get("test-path"),
|
||||
Collections.emptyMap()
|
||||
new FluentMap()
|
||||
.withEntry(Binding.TYPE, "test-type")
|
||||
)
|
||||
),
|
||||
(environment, bindings, properties) -> properties.put("test-key", "test-value")
|
||||
@@ -67,7 +68,8 @@ final class BindingSpecificEnvironmentPostProcessorTest {
|
||||
new BindingSpecificEnvironmentPostProcessor(
|
||||
new Bindings(
|
||||
new Binding("test-name", Paths.get("test-path"),
|
||||
Collections.emptyMap()
|
||||
new FluentMap()
|
||||
.withEntry(Binding.TYPE, "test-type")
|
||||
)
|
||||
)
|
||||
).postProcessEnvironment(environment, application);
|
||||
@@ -81,7 +83,8 @@ final class BindingSpecificEnvironmentPostProcessorTest {
|
||||
new BindingSpecificEnvironmentPostProcessor(
|
||||
new Bindings(
|
||||
new Binding("test-name", Paths.get("test-path"),
|
||||
Collections.emptyMap()
|
||||
new FluentMap()
|
||||
.withEntry(Binding.TYPE, "test-type")
|
||||
)
|
||||
),
|
||||
(environment, bindings, properties) -> properties.put("test-key", "test-value")
|
||||
|
||||
@@ -79,7 +79,7 @@ final class GuardsTest {
|
||||
@DisplayName("returns the set value of false")
|
||||
void setFalse() {
|
||||
environment.setProperty("org.springframework.cloud.bindings.boot.test.enable", "false");
|
||||
assertThat(isTypeEnabled(environment, "Test")).isFalse();
|
||||
assertThat(isTypeEnabled(environment, "test")).isFalse();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user