Skip to content

Web: BearerToken取得対象の拡張#2088

Merged
xsekiguchi merged 7 commits into
masterfrom
feature/extends-support-bearer-token
Jun 11, 2026
Merged

Web: BearerToken取得対象の拡張#2088
xsekiguchi merged 7 commits into
masterfrom
feature/extends-support-bearer-token

Conversation

@xsekiguchi

Copy link
Copy Markdown
Contributor

closes #2087

対応内容

  • BearerToken を取得できる処理を BearerTokenSupplier を実装している RequestContext に拡張
  • TokenCredential を追加し、トークン認証クラスに実装

動作確認・スクリーンショット(任意)

  • WebAPIの実行確認
    • 個人アクセストークンを利用した実行確認(SAT パターン)
    • OAuth アクセストークンを利用した実行確認(OAT パターン)

レビュー観点・補足情報(任意)

  • 追加で BearerToken 取得後の成功処理時にキャストする型をインターフェースに変更しました。

- BearerToken を取得できる処理を BearerTokenSupplier を実装している RequestContext に拡張
- TokenCredential を追加し、トークン認証クラスに実装

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

本PRは、BearerToken を取得できる対象を REST リクエスト(RestRequestContext)固定から、BearerTokenSupplier を実装する RequestContext へ拡張し、あわせてトークン認証系 Credential の共通インターフェース(TokenCredential)を導入することで、トークン種別(SAT/OAT等)に依存しない処理へ寄せる変更です(closes #2087)。

Changes:

  • BearerTokenSupplier を新設し、BearerToken 取得のための情報(Authorizationヘッダー/Method/Content-Type)を RequestContext 側から供給可能に変更
  • RestRequestContextBearerTokenSupplier 実装に拡張し、BearerToken 取得情報を提供
  • TokenCredential を新設し、既存のトークン系 Credential(SimpleAuthToken/OAuth AccessToken)を実装へ変更、成功時処理のキャスト先を置き換え

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
iplass-web/src/main/java/org/iplass/mtp/impl/webapi/rest/RestRequestContext.java BearerTokenSupplier 実装を追加し、ヘッダー/Content-Type 取得を提供
iplass-web/src/main/java/org/iplass/mtp/impl/auth/oauth/AccessTokenCredential.java TokenCredential を実装し、トークン取得の共通化に対応
iplass-web/src/main/java/org/iplass/mtp/impl/auth/authenticate/token/web/BearerTokenSupplier.java BearerToken 取得元を抽象化する供給インターフェースを新設
iplass-web/src/main/java/org/iplass/mtp/impl/auth/authenticate/token/web/BearerTokenAutoLoginHandler.java BearerToken 取得対象を BearerTokenSupplier に一般化、成功時のキャスト先を TokenCredential
iplass-core/src/main/java/org/iplass/mtp/auth/login/TokenCredential.java トークンベース Credential の共通インターフェースを新設
iplass-core/src/main/java/org/iplass/mtp/auth/login/token/SimpleAuthTokenCredential.java TokenCredential を実装し、トークン取得の共通化に対応

- フォームリクエスト判定時に、メソッドタイプが null の場合を考慮
- 認証インスタンス作成時にインスタンスが TokenCredential を実装していない場合、警告メッセージを表示
- 認証成功時に認証インスタンスの型検査を実施

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 6 out of 6 changed files in this pull request and generated 3 comments.

- 固定値を実装
- ログメッセージの追加
- fixtypo

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 6 out of 6 changed files in this pull request and generated no new comments.

@xsekiguchi xsekiguchi merged commit e92fc2b into master Jun 11, 2026
5 checks passed
@xsekiguchi xsekiguchi deleted the feature/extends-support-bearer-token branch June 11, 2026 10:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Web: BearerToken取得対象の拡張

3 participants