jwt / ruby-jwt

A ruby implementation of the RFC 7519 OAuth JSON Web Token (JWT) standard.
https://jwt.github.io/ruby-jwt/
MIT License
3.57k stars 374 forks source link

RBS signatures #455

Open HoneyryderChuck opened 2 years ago

HoneyryderChuck commented 2 years ago

I've noticed that jwt doesn't ship with rbs signatures yet. Is this something the project would like to have going forward?

anakinj commented 2 years ago

Could you describe the issue a little bit more. What are these "RBS" signatures?

HoneyryderChuck commented 2 years ago

https://www.ruby-lang.org/en/news/2020/12/25/ruby-3-0-0-released/

Ctrl+F "RBS"

excpt commented 2 years ago

This looks interesting. Maybe in the future. This isn't going to be a priority at the moment.

I am putting this on my watch list of the new things to learn.

HoneyryderChuck commented 2 years ago

Nice. The intent of the question was to know whether you'd be interested in me contributing the sigs and perhaps dialing it in CI.

anakinj commented 2 years ago

Ah, lol. I thought it was a cryptographic signature algorithm I've never heard of. Now it makes sense :)

anakinj commented 2 years ago

I think that it could bring value to describe the public methods of the gem like this. The challenge maybe is to figure out what the signature actually is :). There is a lot of history.

Would appreciate a little something related to this. Maybe starting with the JWT module and decode and encode methods.

Have not bumped into this for any gems I'm familiar with. Are there some examples out there how existing gems have adapted/implemented something like this?

autopp commented 1 year ago

I added RBS for jwt to gem_rbs_collection. https://github.com/ruby/gem_rbs_collection/pull/243

Currently, this doesn't cover all signature and some parts are untyped. (Of course, it would be preferable if the gem itself includes RBS)