merlimat commented on a change in pull request #2888: PIP-25: Token based
authentication
URL: https://github.com/apache/pulsar/pull/2888#discussion_r237014812
##########
File path:
pulsar-broker-common/src/main/java/org/apache/pulsar/broker/authentication/utils/AuthTokenUtils.java
##########
@@ -90,39 +92,18 @@ public static String createToken(Key signingKey, String
subject, Optional<Date>
}
public static byte[] readKeyFromUrl(String keyConfUrl) throws IOException {
- if (keyConfUrl.startsWith("data:")) {
- return readDataUrl(keyConfUrl);
+ if (keyConfUrl.startsWith("data:") || keyConfUrl.startsWith("file:")) {
+ try {
+ return ByteStreams.toByteArray((InputStream) new
URL(keyConfUrl).getContent());
+ } catch (Exception e) {
+ throw new IOException(e);
+ }
} else if (keyConfUrl.startsWith("env:")) {
Review comment:
I have removed the `env:` schema as it was not working properly. Java seems
to be mangling long var values. We can add later when we can make it work.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services