-
Notifications
You must be signed in to change notification settings - Fork 40.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PulsarPropertiesMapper.getAuthenticationParamsJson #40492
Comments
Thanks for the report. Can you please provide a sample yml that contains the |
There is a custom authentication plugin that requires a JWK spring:
application:
name: pulsar-authentication
pulsar:
client:
service-url: pulsar://localhost:6650
authentication:
plugin-class-name: aig.pulsar.AuthenticationPlugin
param:
client-id: pulsar-admin
private-key: |
{
"kty" : "RSA",
"kid" : "cc34c0a0-bd5a-4a3c-a50d-a2a7db7643df",
"use" : "sig",
"n" : "valueN",
"e" : "AQAB",
"d" : "valueD",
"p" : "valueP",
"q" : "valueQ",
"dp" : "valueDP",
"dq" : "valudDQ",
"qi" : "valueQI"
} the encodedAuthParamString looks like this: {"client-id":"pulsar-admin","private-key":"{
"kty" : "RSA",
"kid" : "cc34c0a0-bd5a-4a3c-a50d-a2a7db7643df",
"use" : "sig",
"n" : "valueN",
"e" : "AQAB",
"d" : "valueD",
"p" : "valueP",
"q" : "valueQ",
"dp" : "valueDP",
"dq" : "valudDQ",
"qi" : "valueQI"
}
"} not a proper encoded JSON |
@adrianiacobghiula |
@philwebb the missing opening quote is not a problem. I updated the example to include the quote and re-executed the test. It still fails as the value is obviously not json encoded |
The values in the `spring.pulsar.client.authentication.param` config props map are not currently JSON encoded. For simple values this is fine. However, some custom auth modules may require more complex parameter values that may contain special characters that results in invalid JSON. This commmit encodes the parameter values using a very simple hand-rolled escape function. Fixes spring-projects#40492
Closing in favor of PR #40493 |
@onobc
PulsarPropertiesMapper.getAuthenticationParamsJson does not return a proper Json encoded in String
after this change 41ed4d6 because values are not properly encoded.
The text was updated successfully, but these errors were encountered: