auth getContext output omits nearAccountId (plugins re-declare it locally)

オープン 初心者向け
#678 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

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

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

評価

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

調査の方向性

auth 契約の getContext 出力スキーマ,找到して nearAccountId を追加します。AuthRequestContext から派生するプラグインのコンテキストスキーマを確認し、plugins/connectors/src/lib/context.ts と api プラグインのコンテキストスキーマを含めて、ローカルの拡張を削除できるようにします。完了の基準は、nearAccountId がすべてのプラグインで型として可視化され、重複した宣言なしで型チェックが成功することです。

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

説明

The host injects the session's primary NEAR account into the request context as nearAccountId, but the auth contract's getContext output schema doesn't declare it — so plugin ContextSchemas derived from AuthRequestContext (e.g. plugins/connectors in open-crosspost.com) can't see it without a local widening:

export const ContextSchema = z.custom<AuthContext & { nearAccountId?: string }>();

The api plugin declares the same extension locally in its own context schema.

Ask: add nearAccountId to the getContext output contract so host-injected context fields are type-visible to all plugins and the local widenings can retire. (Found in platform 2.0.0-rc.27; edit made in opencrosspost.com/plugins/connectors/src/lib/context.ts per the framework-owned edit protocol.)

主要言語
TypeScript
スター
5
フォーク
3
平均マージ
9時間 20分
マージ済み PR(30日)
159

環境構築

はじめの一歩

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

NEARBuilders/everything-dev のほかの issue

NEARBuilders/everything-dev の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

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

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