Skip to content

Commit fbb25d2

Browse files
committed
Redact private JWK material from inspection
1 parent bedd65a commit fbb25d2

2 files changed

Lines changed: 9 additions & 0 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010

1111
**Fixes and enhancements:**
1212

13+
- Redact private JWK material from inspection [#754](https://github.com/jwt/ruby-jwt/pull/754) - [@OskarEichler](https://github.com/OskarEichler)
1314
- Fix rejection of unknown algorithms from JWKs for RFC compliance and pquip [#728](https://github.com/jwt/ruby-jwt/pull/728)
1415
- Fix the `Style/DirectiveScope` RuboCop offense failing the build [#752](https://github.com/jwt/ruby-jwt/pull/752)
1516

lib/jwt/jwk/key_base.rb

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,14 @@ def sign(**kwargs)
5050
jwa.sign(**kwargs, signing_key: signing_key)
5151
end
5252

53+
def inspect
54+
"#<#{self.class} @parameters=#{export.inspect}>"
55+
end
56+
57+
def pretty_print(pp)
58+
pp.text(inspect)
59+
end
60+
5361
alias eql? ==
5462

5563
def <=>(other)

0 commit comments

Comments
 (0)