You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This causes problems, as e.g. in our case, we want to put the PEM Private Key for a Kafka connection to the Secret Manager. The PEM contains newlines, which you could include in YAML without any problem. But when referring to a property from the Secret Manager, the PEM is invalid, as the newlines are removed (at least the newline after ---- BEGIN PRIVATE KEY --- must be included).
Steps to Reproduce
Create a Secret in Google Cloud with intentional newlines
Refer to this Secret in a property
Output the property value, e.g. to STDOUT.
Expected Behaviour
The property, including its line breaks, are written to STDOUT.
Actual Behaviour
The property is written to STDOUT, without its line breaks.
Well, it would be easy to just remove the replaceAll() from that line, but that might break some applications - I think this call is intentional there, as it happens easily to add a terminating newline when editing secrets via Google Cloud Console.
So most elegant solution would be to make this "newline removal" configurable - but that is a rather huge change I wouldn't be able to provide currently due to capacity restrictions on my side.
For now, we were able to solve this for us with a workaround, by "concatenating" the newlines with the "real" secret directly in the application.yml:
The implementation of the property source for Secret Manager secrets removes line breaks (\n) in the secrets:
https://github.com/micronaut-projects/micronaut-gcp/blob/master/gcp-secret-manager/src/main/java/io/micronaut/gcp/secretmanager/SecretManagerConfigurationClient.java#L92
This causes problems, as e.g. in our case, we want to put the PEM Private Key for a Kafka connection to the Secret Manager. The PEM contains newlines, which you could include in YAML without any problem. But when referring to a property from the Secret Manager, the PEM is invalid, as the newlines are removed (at least the newline after
---- BEGIN PRIVATE KEY ---
must be included).Steps to Reproduce
Expected Behaviour
The property, including its line breaks, are written to STDOUT.
Actual Behaviour
The property is written to STDOUT, without its line breaks.
Environment Information
Example Application
I think this is quite trivial to reproduce; more trivial than giving access to our Secret Manager to the world.
The text was updated successfully, but these errors were encountered: