Support meta-annotations for the wicket-auth-roles annotations

オープン
#1,958 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

@Jennydou517 がすでに取り組んでいます。

2026年11月21日 から。

  • #1976 @Jennydou517 による — オープン

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
72/100
issue の種類
機能追加
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
java
領域
backend

調査の方向性

Read AnnotationsRoleAuthorizationStrategy.java and its tests in AnnotationsRoleAuthorizationStrategyTest.java; first check the state of WICKET-7200, which may affect annotation resolution. Decide and test how meta-annotations interact with direct annotations, including whether lookup is recursive. Done means auth-roles annotations carried by a page or component class are honored and the tests cover the chosen behavior.

索引モデルが issue の本文から書いたものです。

説明

good first issue

Applications that protect many pages with the same roles repeat the same annotation everywhere:

@AuthorizeInstantiation({"roleA", "roleB", "roleC"})

Java lets you put that on your own annotation and use it instead:

@Target(ElementType.TYPE)
@Retention(RetentionPolicy.RUNTIME)
@AuthorizeInstantiation({"roleA", "roleB", "roleC"})
public @interface SomeFeatureAuthorization {}

but Wicket only looks for the annotation directly on the class, so the meta-annotation is ignored.

Where

wicket-auth-roles/src/main/java/org/apache/wicket/authroles/authorization/strategies/role/annotations/AnnotationsRoleAuthorizationStrategy.java, the element.getAnnotation(…) calls for AuthorizeInstantiation(s), AuthorizeAction(s) and AuthorizeResource.

Done when

  • An annotation that carries one of the auth-roles annotations is honoured on a page or component class. Decide whether one level of meta-annotation is enough, and what happens when the direct and the meta-annotation are both present.
  • Tests in wicket-auth-roles/src/test/java/org/apache/wicket/authroles/authorization/strategies/role/annotations/AnnotationsRoleAuthorizationStrategyTest.java.
  • WICKET-7200 is changing how the same class resolves these annotations. Check its state before starting, to avoid conflicting changes.

Background

Originally requested as WICKET-6691. A committer supported the proposal.


Part of #1945. This issue is meant for a first contribution to Wicket. To work on it, leave a comment so others know; a claim without a pull request lapses after two weeks. Questions are welcome, here on the issue or on [email protected]. Start your branch from master, and see Send a pull request to Wicket for building and testing.

主要言語
Java
スター
800
フォーク
437
平均マージ
21時間 36分
マージ済み PR(30日)
167

環境構築

このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

apache/wicket のほかの issue

apache/wicket の issue をすべて見る

似ている issue

Java の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。