Commit Graph

57 Commits

Author SHA1 Message Date
Daniel Mikusa
cf11b5e886 Merge pull request #55 from cborealis/feature/activemq-artemis
Adding support for ActiveMQ Artemis
2021-08-26 21:12:40 -04:00
Daniel Mikusa
526db0d6b2 Polishing.
- Removes unnecessary log line
- Clarifies order for jdbc url vs library composed url

Signed-off-by: Daniel Mikusa <dmikusa@vmware.com>
2021-08-21 15:28:57 -04:00
Emily Casey
0debab1b2c Allow users to explicitly specify jdbc or r2dbc URLs
Previously Spring Cloud Bindings always composed spring.datasource.url from the host port and database properties. This is limiting in that it does not provide a mechanism for users to specify jdbc properties (e.g. sslMode). The PR retains the original behavior but also respects jdbc-url and r2dbc-url keys in all RDBS bindings. The explicit jdbc-url and r2dbc-url keys take precedence over the composed value.

Signed-off-by: Emily Casey <ecasey@vmware.com>
2021-08-20 17:10:20 -04:00
Alexander Schwab
cee2609022 Adding support for ActiveMQ Artemis 2021-04-16 12:41:15 +02:00
Emily Casey
cf74ff2bde Fix postgres test
Updates test to include correct connection string. See #53

Signed-off-by: Emily Casey <ecasey@vmware.com>
2021-03-30 12:55:23 -04:00
Harish Yayi
bb864990f2 Fixes postgresql jdbc url 2021-02-08 10:10:26 -05:00
Scott Frederick
f3b36422c0 Fixes Spring Boot property mapping for MongoDB
Spring Boot properties for MongoDB auto-configuration should have the
prefix `spring.data.mongodb` instead of `spring.mongodb`.

Signed-off-by: Scott Frederick <sfrederick@vmware.com>
2020-11-17 17:03:00 -08:00
Ben Hale
dd3f97ea00 Spring Boot 2.0 Compatibility
Previously, the library utilized an API from Spring Boot that arrived in
2.1.0.  Support for Spring Boot 2.0 compatibility was requested and we can
trivially add that support even though Boot 2.0 is EOL.  This change updates
the use of the API to be Boot 2.0 compatible.

Signed-off-by: Ben Hale <bhale@vmware.com>
2020-08-27 12:05:08 -07:00
Ben Hale
c167d98dc2 Revert "SERVICE_BINDINGS_ROOT"
This reverts commit 54c2687d58.
2020-08-17 16:22:00 -07:00
Ben Hale
54c2687d58 SERVICE_BINDINGS_ROOT
Previously the code looked for SERVICE_BINDING_ROOT.  Given that the
specification states it should be SERVICE_BINDINGS_ROOT, this was wrong.  This
change fixes it.

Signed-off-by: Ben Hale <bhale@vmware.com>
2020-07-17 15:09:58 -07:00
Ben Hale
60c9bcbe7e 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>
2020-07-15 17:21:05 -07:00
Ben Hale
fe843860f7 Support Kubernetes Service Bindings
This change updates the library to support the new Kubernetes Service
Bindings[1].

[1]: https://github.com/k8s-service-bindings/spec#application-projection

Signed-off-by: Ben Hale <bhale@vmware.com>
2020-07-14 10:52:49 -07:00
Emily Casey
df4abb7b21 Warn when oath2 binding is missing provider
Signed-off-by: Emily Casey <ecasey@vmware.com>
2020-06-25 16:55:23 -04:00
Emily Casey
e4ed9a3a76 Adds more context to ambiguous secret key names
When key names are potentially ambiguous (does this server-id refer to the vault server?) prefer longer more explicit key names. When there is no ambiguity stick with the existing shorter names.

Signed-off-by: Emily Casey <ecasey@vmware.com>
2020-06-25 16:06:24 -04:00
Emily Casey
10ace42f07 vault: secret/method -> secret/authentication-method
Signed-off-by: Emily Casey <ecasey@vmware.com>
2020-06-23 19:10:55 -04:00
Emily Casey
663c8095c2 Warns when vault binding has missing or unrecognized method
Signed-off-by: Emily Casey <ecasey@vmware.com>
2020-06-23 19:04:43 -04:00
Emily Casey
99574f3653 pass-through exact vault authentication method case instead of standardizing case
Signed-off-by: Emily Casey <ecasey@vmware.com>
2020-06-23 17:55:06 -04:00
Emily Casey
b3b1b06aea Adds more Spring Cloud Vault authentication methods
* AWS_EC2
* AWS_IAM
* AZURE_MSI
* GCP_GCE
* GCP_IAM
* KUBERNETS

Signed-off-by: Emily Casey <ecasey@vmware.com>
2020-06-23 17:51:45 -04:00
Emily Casey
5be10f2702 Reads authentication method from secret/method
Previously we used provider

Signed-off-by: Emily Casey <ecasey@vmware.com>
2020-06-23 10:44:29 -04:00
Emily Casey
02c0c59d4b Supports Spring Cloud Vault
Adds support for the following authentication types
* APPROLE
* CERT
* CUBBYHOLE
* TOKEN

See
https://cloud.spring.io/spring-cloud-vault/reference/html/#vault.config.authentication
for more details about these authentication methods.

Signed-off-by: Emily Casey <ecasey@pivotal.io>
2020-06-19 18:11:40 -04:00
Emily Casey
c2a550e916 Adds support for Spring Security OAuth2
Autoconfigures spring.security.oauth2.* application properties. The name of the binding will become the name of the client. The name of the provider will be taken from metadata/provider.

Resolves #35

Signed-off-by: Emily Casey <ecasey@pivotal.io>
2020-06-19 12:33:37 -04:00
Emily Casey
2b45fffefd Adds support for spring-ldap
Resolves #12

Signed-off-by: Emily Casey <ecasey@pivotal.io>
2020-06-02 19:06:12 -04:00
Emily Casey
e6fbccfc31 Alphabetize factories
Signed-off-by: Emily Casey <ecasey@pivotal.io>
2020-06-02 14:23:16 -04:00
Emily Casey
bbda2549f1 Adds support for SCS config server
Adds support for Spring Cloud Services Config Server. Bindings must have kind config.

Signed-off-by: Emily Casey <ecasey@pivotal.io>
2020-06-02 14:20:12 -04:00
Emily Casey
704a9d38a6 Handles k8s style bindings
When a binding is provided as a mounted ConfigMap/Secret pair (containing
metadata and secret values respectively) the files within the metadata and
secret directories will be symlinks to files in a colocated hidden directory
that contains the content. In order to handle bindings presented in this
format a Binding object will ignore hidden files and directories when it is
contructed using a path. This prevents errors that previously occured
when the Binding assumed all metadata and secret entries were regular files, and
attempted to read the content of those directories directly.

Resolves #40

Signed-off-by: Emily Casey <ecasey@pivotal.io>
2020-05-29 11:47:36 -04:00
Emily Casey
8595e847a3 Support r2dbc
Adds r2dbc properties for mysql, postgres, sqlserver, oracle, and db2
bindings. This allow bindings to be used with reactive drivers.

Signed-off-by: Emily Casey <ecasey@pivotal.io>
2020-05-28 18:25:29 -04:00
Emily Casey
44cb4a1f19 Eureka Support
[resolves #27]

Adds initial eureka client support.

Signed-off-by: Emily Casey <ecasey@pivotal.io>
2020-05-18 09:49:55 -04:00
Ben Hale
6163be2aa7 ApplicationEventListeners
Previously, the implementations of the EnvironmentPostProcessors added
ApplicationEventListener to their interface as well.  These implementations
tested fine, but of course since there was no full integration test to ensure
that they were registered I forgot to add them to spring.factories.

This change adds their declarations as ApplicationEventListeners to the
spring.factories file and ensures that the logs are replayed when the
application is finished preparing.

Signed-off-by: Ben Hale <bhale@vmware.com>
2020-05-15 17:27:58 -07:00
E Casey
ade8797e09 Merge pull request #38 from spring-cloud/37-wavefront
Wavefront Support
2020-05-15 16:53:20 -04:00
Emily Casey
f68c71cab1 fix kafka kind
Signed-off-by: Emily Casey <ecasey@pivotal.io>
2020-05-15 16:50:39 -04:00
Emily Casey
3193bd9acf Wavefront Support
[resolves #37]

Also fixes failure when there is no provider in the binding metadata.

Signed-off-by: Emily Casey <ecasey@pivotal.io>
2020-05-15 16:32:39 -04:00
Ben Hale
815d7de222 Deferred Logging
Previously the logging put out by the library happened synchronously with the
code executing.  Because this library typically runs so early in the Spring
Boot lifecycle that logging isn't yet configured, it needs to defer that
logging until later.

This change converts the library to use Boot's DeferredLogger and listen for
an ApplicationPrepared event before logging out its messages.

Signed-off-by: Ben Hale <bhale@vmware.com>
2020-05-15 12:47:35 -07:00
Ben Hale
0c6035082d Unused Class
This change removes an extraneous unused class

[resolves #36]

Signed-off-by: Ben Hale <bhale@vmware.com>
2020-05-12 08:08:01 -07:00
Ben Hale
6885bcbd24 Kafka Support
[resolves #22]

Signed-off-by: Ben Hale <bhale@vmware.com>
2020-05-12 08:06:28 -07:00
Ben Hale
4e47c3f59b RabbitMQ Support
[resolves #21]

Signed-off-by: Ben Hale <bhale@vmware.com>
2020-05-12 06:25:37 -07:00
Ben Hale
e15d0a1b61 Neo4J
This change contributes Neo4J support.

[resolves #20]

Signed-off-by: Ben Hale <bhale@vmware.com>
2020-05-11 16:57:02 -07:00
Ben Hale
9f99fbc8fb Elasticsearch
This change adds support for Elasticsearch bindings.

[resolves #18]

Signed-off-by: Ben Hale <bhale@vmware.com>
2020-05-11 16:42:14 -07:00
Ben Hale
05f5e5a34f Couchbase Support
This change adds support for auto-configuring Couchbase.

[resolves #17]

Signed-off-by: Ben Hale <bhale@vmware.com>
2020-05-11 16:20:29 -07:00
Ben Hale
2b4b1da636 Redis Binding
This change expands the Redis bindings to handle more properties.

[resolves #7]

Signed-off-by: Ben Hale <bhale@vmware.com>
2020-05-11 16:06:18 -07:00
Ben Hale
0416df43f7 MongoDB Binding
This change expands the MongoDB bindings to handle more properties.

[resolves #6]

Signed-off-by: Ben Hale <bhale@vmware.com>
2020-05-11 15:46:18 -07:00
Ben Hale
c864bbaaed Improve Property Mapping API
Previously the PutIfPresent API was a clunky way of only setting a property in
the PropertySource if the corresponding entry from the binding existed.  It
was pointed out in #31 that there are better APIs for doing this same thing.
Unfortunately the suggestion in that issue wasn't suitable (it was built for
beans not maps), but it did inspire a better API that was suited to maps.
This change implements that new API.

Signed-off-by: Ben Hale <bhale@vmware.com>
2020-05-11 15:33:47 -07:00
Ben Hale
a33dcf034b Guards Should Use Environment
Previously all of the guard behavior was triggered by the contents of
environment variables.  In a Spring Boot application, looking at the
environment isn't the only way to get configuration.  This change updates the
guards to use the Environment for configuration retrieval.

[resolves #30]

Signed-off-by: Ben Hale <bhale@vmware.com>
2020-05-11 14:24:41 -07:00
Ben Hale
ebdec5dcc3 Add BindingFlattenedEnvironmentPostProcessor to Spring Factories
This was missed during the implementation.  The broader integration test that
should have caught this will come in #33.

[resolves #32]

Signed-off-by: Ben Hale <bhale@vmware.com>
2020-05-11 13:43:58 -07:00
Ben Hale
c9091503ef Expand Cassandra Bindings
This change expands the Cassandra bindings to handle more properties.

[resolves #5]

Signed-off-by: Ben Hale <bhale@vmware.com>
2020-05-11 11:55:54 -07:00
Ben Hale
c4721e9510 Flattened Bindings
Another common way to use bindings, even without auto-configuration is to
refer to them in a flattened form within other properties. An example would be
`spring.datasource.password=cnb.bindings.my-db.secret.password`.  This change
adds an EnvironmentPostProcessor that contributes these flattened bindings in
a PropertySource.

[resolves #24]

Signed-off-by: Ben Hale <bhale@vmware.com>
2020-05-11 11:26:16 -07:00
Ben Hale
aa6f50e5c3 Global Guard
Previously, whenever the library was included on a classpath it would attempt
to auto-configure Spring Boot.  Since part of the API can be used as a
straight library, and in that usage, auto-configuration would not be
desirable, the auto-configuration needed a global off switch.  This change
adds a global guard, disabled by default, in the
org.springframework.cloud.bindings.boot.enable System Property.

[resolves #25]

Signed-off-by: Ben Hale <bhale@vmware.com>
2020-05-11 10:42:47 -07:00
Ben Hale
de2422fdf5 Per-kind Disabling
Previously, auto-configuration of all kinds of bindings were either enabled or
disabled en-mass.  This level of granularity wasn't really appropriate in
practice as it many use-cases could be served with some bindings but not
others.  This change updates each auto-configuration to watch for a particular
key to be disabled.

[resolves #29]

Signed-off-by: Ben Hale <bhale@vmware.com>
2020-05-11 09:36:54 -07:00
Ben Hale
6c51ac5712 SQLServer JDBC Format
[resolves #11]

Signed-off-by: Ben Hale <bhale@vmware.com>
2020-05-11 08:55:29 -07:00
Ben Hale
81f30595c1 PostgreSQL JDBC Format
[resolves #10]

Signed-off-by: Ben Hale <bhale@vmware.com>
2020-05-11 08:52:28 -07:00
Ben Hale
efcb054ec0 Oracle JDBC Format
[resolves #9]

Signed-off-by: Ben Hale <bhale@vmware.com>
2020-05-11 08:49:55 -07:00