diff --git a/CHANGELOG.md b/CHANGELOG.md index ca5c1d89..d4832613 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,7 @@ **Fixes and enhancements:** +- Redact private JWK material from inspection [#754](https://github.com/jwt/ruby-jwt/pull/754) - [@OskarEichler](https://github.com/OskarEichler) - Fix rejection of unknown algorithms from JWKs for RFC compliance and pquip [#728](https://github.com/jwt/ruby-jwt/pull/728) - Fix the `Style/DirectiveScope` RuboCop offense failing the build [#752](https://github.com/jwt/ruby-jwt/pull/752) diff --git a/lib/jwt/jwk/key_base.rb b/lib/jwt/jwk/key_base.rb index ac9d9b91..74282443 100644 --- a/lib/jwt/jwk/key_base.rb +++ b/lib/jwt/jwk/key_base.rb @@ -50,6 +50,14 @@ def sign(**kwargs) jwa.sign(**kwargs, signing_key: signing_key) end + def inspect + "#<#{self.class} @parameters=#{export.inspect}>" + end + + def pretty_print(pp) + pp.text(inspect) + end + alias eql? == def <=>(other)