`CoreJackson2Module` has no mixin for `OneTimeTokenAuthentication`
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 2/5
- 見積もり時間
- 1〜3時間
- 初心者へのやさしさ
- 77/100
- issue の種類
- バグ
- 明瞭さ
- 明確に書かれている
- 活発さ
- 活発
調査の方向性
CoreJackson2ModuleをCoreJacksonModuleと併せて読み、mixinの登録を比較してから、OneTimeTokenAuthenticationTestsとJackson 2モジュールのテストを調べてください。SecurityJackson2Modulesを介したOneTimeTokenAuthenticationのシリアライズとデシリアライズをテストに追加してください。Jackson 2の往復処理がallowlistのチェックを含めて成功すれば完了です。
索引モデルが issue の本文から書いたものです。
説明
Describe the bug
gh-18096 added Jackson support for one-time-token authentication for 7.1, but only the Jackson 3 CoreJacksonModule registers a mixin for OneTimeTokenAuthentication; the Jackson 2 CoreJackson2Module registers one for the deprecated OneTimeTokenAuthenticationToken only. Since 7.0, OneTimeTokenAuthenticationProvider and OneTimeTokenReactiveAuthenticationManager produce OneTimeTokenAuthentication, so a SecurityContext from a one-time-token login cannot be serialized with SecurityJackson2Modules, which is still the setup of applications that keep Jackson 2 for session serialization in 7.x.
To Reproduce
ObjectMapper mapper = new ObjectMapper();
mapper.registerModules(SecurityJackson2Modules.getModules(getClass().getClassLoader()));
OneTimeTokenAuthentication authentication = new OneTimeTokenAuthentication("principal",
AuthorityUtils.createAuthorityList("ROLE_USER"));
byte[] serialized = mapper.writeValueAsBytes(authentication);
mapper.readValue(serialized, OneTimeTokenAuthentication.class);
Deserialization fails: OneTimeTokenAuthentication is not in the allowlist and has no mixin. The same round trip with SecurityJacksonModules and a Jackson 3 JsonMapper passes (OneTimeTokenAuthenticationTests).
Expected behavior
CoreJackson2Module registers a mixin for OneTimeTokenAuthentication, like CoreJacksonModule does, so that both Jackson generations can serialize what the one-time-token login produces.
Sample
Branch with the mixin (a copy of the Jackson 3 one, deprecated for removal like the rest of jackson2) and a Jackson 2 round-trip test next to the existing Jackson 3 one: https://github.com/spring-projects/spring-security/compare/main...sharanggupta:spring-security:gh-ott-authentication-jackson2-mixin. Happy to open the PR.
- 主要言語
- Java
- スター
- 9.7k
- フォーク
- 6.4k
- 平均マージ
- 1日 4時間
- マージ済み PR(30日)
- 31
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
spring-projects/spring-security のほかの issue
-
type: dependency-upgrade
難易度 1/5 1時間未満 初心者へのやさしさ 76/100
spring-projects/spring-security#20057 ·
メンテナーはふだん 1 日以内に返信
-
type: dependency-upgrade
難易度 1/5 1時間未満 初心者へのやさしさ 72/100
spring-projects/spring-security#20056 ·
メンテナーはふだん 1 日以内に返信
-
type: dependency-upgrade
難易度 1/5 1時間未満 初心者へのやさしさ 72/100
spring-projects/spring-security#20055 ·
メンテナーはふだん 1 日以内に返信
-
type: dependency-upgrade
難易度 1/5 1時間未満 初心者へのやさしさ 65/100
spring-projects/spring-security#20054 ·
メンテナーはふだん 1 日以内に返信
-
type: dependency-upgrade
難易度 1/5 1時間未満 初心者へのやさしさ 70/100
spring-projects/spring-security#20053 ·
メンテナーはふだん 1 日以内に返信
spring-projects/spring-security の issue をすべて見る
似ている issue
-
hermes-queue
難易度 1/5 1時間未満 初心者へのやさしさ 85/100
chrisalunlloyd2-sudo/mindpalace#337 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
ucsb-cs156/proj-frontiers#844 ·
-
Spark benchmarks crash with `[INVALID_DRIVER_MEMORY]` on JVMs whose default heap is below Spark's ~450 MB minimum対応中かも @sendaoYan が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 79/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
moquette-io/moquette#980 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
Dans-Plugins/Medieval-Roleplay-Engine#400 ·
メンテナーはふだん 1 日以内に返信