It's unclear what purpose Key#signed_token serves. It does not produce a valid JWT token, and the only apparent uses of this method are in tests for slosilo and cyberark/conjur.
This is potentially a good candidate for removal to simply the code and reduce the opportunity for mistakes using this library.
|
# create a new timestamped and signed token carrying data |
|
def signed_token data |
|
token = { "data" => data, "timestamp" => Time.new.utc.to_s } |
|
token["signature"] = Base64::urlsafe_encode64(sign token) |
|
token["key"] = fingerprint |
|
token |
|
end |
It's unclear what purpose
Key#signed_tokenserves. It does not produce a valid JWT token, and the only apparent uses of this method are in tests forslosiloandcyberark/conjur.This is potentially a good candidate for removal to simply the code and reduce the opportunity for mistakes using this library.
slosilo/lib/slosilo/key.rb
Lines 73 to 79 in c2bb674