Verify tokens with one shared verifier in every service

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

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

まだ誰も着手していません。

評価

難易度
5/5
見積もり時間
1週間以上
初心者へのやさしさ
35/100
issue の種類
リファクタリング
明瞭さ
おおむね明確
活発さ
活発
技術スタック
scala, typescript

調査の方向性

Start by reading the shared filter in common/auth and the agent service token handling described alongside #9043; then trace which services still register local filters, including the notebook migration service and the Dropwizard 1.3 services. The issue is done when all services use the shared verifier and the agent rejects bad signatures; key-pair signing depends on the discussion decision.

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

説明

Task Summary

Every service checks the same session token, but not with the same code. Five Dropwizard 4 services register the shared filter from common/auth, notebook-migration-service registers its own copy (#5982), the Dashboard Service and the computing unit use another filter on Dropwizard 1.3 (#5428), and the agent service decodes the token without checking its signature until #9043 lands. All of them rely on one HS256 secret, which both signs and verifies, so every service that checks a token could also issue one. As the agent service, and later an MCP endpoint, start checking tokens too, the rules should be written once, and signing should stay with the issuer.

This task makes token verification one set of rules, implemented once per language and used everywhere a request arrives.

Before
flowchart LR
  req["A request<br/>with a session token"]
  v1["Five Dropwizard 4 services<br/>shared filter in common/auth"]
  v2["Notebook migration service<br/>its own copy of the filter"]
  v3["Dashboard Service, computing unit<br/>another filter, Dropwizard 1.3"]
  v4["Agent service<br/>decodes, no signature check"]
  req --> v1
  req --> v2
  req --> v3
  req --> v4
After

With the key pair of discussion point 1:

flowchart TB
  iss["Issuer<br/>signs with the private key"]
  cl["Browser, agent, MCP client"]
  jvm["Every JVM service<br/>one filter in common/auth"]
  ts["Agent service, MCP endpoint<br/>one TypeScript module, same rules"]
  iss -- "token" --> cl
  cl -- "bearer token" --> jvm
  cl -- "bearer token" --> ts
  iss -. "public key" .-> jvm
  iss -. "public key" .-> ts
Scope
  1. One verifier on the JVM. Every Dropwizard service registers the filter in common/auth. This finishes #5428, after the Dropwizard 4 upgrade in #5423, and #5982.
  2. The same rules in TypeScript. The agent service, and later the MCP endpoint, check tokens with one module that applies the same algorithm, claims, expiry and clock skew as the JVM filter. #9043 adds the first check.
  3. One scheme in the contract. The bearer scheme is declared once in the contract of #9485, so every generated client sends the token the same way.
  4. A key pair, if agreed. The issuer signs with a private key, and every verifier checks with the public key.

This task does not decide who may do what, which is #9488. It adds no identity provider or sign-in method (#7513), and the agent's own access rules stay in #5268 and #5561.

Discussion Points
  1. A key pair now or later. RS256 or ES256 now, with a window in which both old and new tokens are accepted so that no one is signed out; or HS256 until an identity provider is discussed. An identity provider would need the same verifiers, so the key pair is not wasted work.
  2. How verifiers get the public key. A JWKS endpoint on the issuer, which allows keys to be rotated, or the key in each service's configuration.
  3. Which places sign. Four places sign tokens today: the Dashboard Service at sign-in, the Computing Unit Managing Service for a unit, the Access Control Service for a mount, and the computing unit when it exports a result to a dataset. Each either keeps the private key or asks the issuer for a token.

Done when every service verifies tokens through the shared code, the agent service rejects a token with a bad signature, and, if a key pair is agreed, only the issuer holds the signing key.

Task Type
  • Refactor / Cleanup
  • DevOps / Deployment / CI
  • Testing / QA
  • Documentation
  • Performance
  • Other
主要言語
Scala
スター
333
フォーク
202
平均マージ
3日 11時間
マージ済み PR(30日)
185

環境構築

はじめの一歩

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

apache/texera のほかの issue

apache/texera の issue をすべて見る

似ている issue

Scala の issue をもっと見る

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

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