Skip to content
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

Consider deprecating #signed_token #20

Open
micahlee opened this issue Jul 20, 2020 · 2 comments
Open

Consider deprecating #signed_token #20

micahlee opened this issue Jul 20, 2020 · 2 comments

Comments

@micahlee
Copy link
Contributor

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

@micahlee micahlee changed the title Consider deprecated #signed_token Consider deprecating #signed_token Jul 20, 2020
@dividedmind
Copy link
Contributor

FWIW it's a legacy token format I invented before JWT was a thing and AFAIR it was kept for compatibility. IMHO it can go.

@micahlee
Copy link
Contributor Author

micahlee commented Jul 24, 2020

@dividedmind

FWIW it's a legacy token format I invented before JWT was a thing and AFAIR it was kept for compatibility. IMHO it can go.

Ah, that's really helpful to know. Thanks so much! 🙂

P.S. I hope you're doing well!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

2 participants