openbaton / openbaton-client

The openbaton external client, such as sdk and cli
Apache License 2.0
4 stars 2 forks source link

Fix: Trim whitespaces and new line characters from the service token #16

Closed ThomasBri closed 6 years ago

ThomasBri commented 6 years ago

Copying the key may result in additional new line characters or white spaces due to which the service registration can fail.

lorenzotomasini commented 6 years ago

@ThomasBri @marcellom what if the servicetoken contains a space? is it possible?

ThomasBri commented 6 years ago

@lorenzotomasini No, it should not be possible. The key is created like this: RandomStringGenerator generator = new RandomStringGenerator.Builder().withinRange('A', 'z').build(); return generator.generate(16);

I tested it for a few thousand keys and they never contained a whitespace.