feat: Keycloak: Move camera authentication to Keycloak
メンテナーはふだん 3 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 5/5
- 見積もり時間
- 1週間以上
- 初心者へのやさしさ
- 35/100
- issue の種類
- 機能追加
- 明瞭さ
- おおむね明確
- 活発さ
- 活発
- 領域
- api, authentication, backend
調査の方向性
Start with the dependent Keycloak authentication work in #698, then trace the API's POST /cameras/{id}/token and get_jwt paths. Review pyroclient's current static-token handling and the Keycloak test realm in pyro-envdev#45. Done means Keycloak is the sole issuer after migration, clients can refresh credentials reliably, and legacy support is removed only after rollout.
索引モデルが issue の本文から書いたものです。
説明
Part of the epic pyronear/roadmap#23 (Keycloak).
Context & objective
Depends on #698 (Keycloak user authentication). Once users are on Keycloak, cameras are the last clients using API-issued JWTs.
Goal: Keycloak becomes the only token issuer. The API only verifies tokens and no longer issues any.
What is done currently
- An admin creates a camera token via
POST /cameras/{id}/token: API-signed JWT (JWT_SECRET),camerascope, valid 1 year. pyro-enginestores one static token per camera and passes it topyroclient. There is no login and no refresh.- No way to revoke a single camera token.
What has to be done
- Keycloak: one confidential client per camera (client credentials flow), with a
camerarole and claimscamera_id+organization_id. - API: remove
create_access_token,JWT_SECRET/JWT_*settings,POST /cameras/{id}/tokenand the API-issuer path inget_jwt. Keycloak token verification is the only path left. - pyroclient: authenticate with
client_id/client_secret, cache the token and refresh it before expiry (and on 401). - pyro-engine: switch the credentials from a token to
client_id/client_secret(companion issue in pyro-engine). - Throwaway script to create the Keycloak clients for existing cameras.
Technical considerations
- Field connectivity is intermittent (4G): use a reasonably long token lifetime, and make sure a failed refresh doesn't block local detection (retry, keep queueing).
- Rollout: optin to discuss : devices are updated progressively, so the API has to accept both issuers until the whole fleet is migrated. Only then remove the legacy path.
- Provisioning a new camera = creating the camera in the API + its client in Keycloak. Manual for now, to be automated later.
- Dev & e2e: pyro-envdev Keycloak (pyronear/pyro-envdev#45), with a realm containing test camera clients.
- 主要言語
- Python
- スター
- 30
- フォーク
- 15
- 平均マージ
- 4日 15時間
- マージ済み PR(30日)
- 16
環境構築
- Dockerfile または Docker Compose ファイルあり
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
pyronear/pyro-api のほかの issue
-
Replacing a camera or pose image can delete an image that is still in use対応中かも @Adelagric が 2 日前に担当しました。 オープン
難易度 4/5 3〜5日 初心者へのやさしさ 42/100
メンテナーはふだん 3 日以内に返信
-
Share an alert with a temporary public link対応中かも @Acruve15 が 3 日前に担当しました。 オープンtype: feat
難易度 5/5 1週間以上 初心者へのやさしさ 45/100
メンテナーはふだん 3 日以内に返信
-
Return the number of alerts per day over a period対応中かも @Majyles が 10 日前に担当しました。 オープンtype: feat
難易度 4/5 3〜5日 初心者へのやさしさ 45/100
pyronear/pyro-api#719 · コメント 2 件 · 担当者 1 名 ·
メンテナーはふだん 3 日以内に返信
-
type: feat
難易度 5/5 1週間以上 初心者へのやさしさ 35/100
メンテナーはふだん 3 日以内に返信
-
type: feat
難易度 4/5 3〜5日 初心者へのやさしさ 45/100
メンテナーはふだん 3 日以内に返信
pyronear/pyro-api の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
earthtojake/text-to-cad#758 ·
メンテナーはふだん 1 日以内に返信
-
domain:upgrades enhancement needs-triage
難易度 2/5 1〜3時間 初心者へのやさしさ 66/100
gke-labs/kube-agents#4634 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
agardnerIT/opamp-server-py#116 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
メンテナーはふだん 1 日以内に返信
-
enhancement good first issue
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
elviskahoro/sdk-python-attio#144 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信