Make authentication more flexible
まだ誰も着手していません。
評価
- 難易度
- 5/5
- 見積もり時間
- 1週間以上
- 初心者へのやさしさ
- 42/100
- issue の種類
- リファクタリング
- 明瞭さ
- おおむね明確
- 活発さ
- 静か
- 技術スタック
- typescript
調査の方向性
まず src/authn/SolidAuthnLogic.ts と pull request 171 で議論された変更を読み、現在の Inrupt と Uvdsl の処理を理解します。個別の authenticator 実装と遅延読み込みを評価する前に、コンシューマー向けの望ましい選択およびデフォルト動作を定義します。外部 API を維持しつつ認証ライブラリを選択でき、デフォルトで Uvdsl が使用されれば完了です。
索引モデルが issue の本文から書いたものです。
説明
When we switched out the auth lib there was an improvement suggestion from Noel:
Following up from my comments in this week's meeting, looking at the current PR it seems like src/authn/SolidAuthnLogic.ts is attempting to handle both Inrupt and Uvdsl libraries? If so, that's is good, here's a couple of comments:
I see that the Inrupt library was removed from the dependencies, but it's still used in some places using the "sessionAny". I'd strongly suggest to keep the dependency installed, and cast the variable to its actual type, rather than using any. Any should be avoided as much as possible.
The current implementation seems to rely on if/else logic inside of the same file. That is ok for now, specially if we can keep the external API for consumers the same. But ideally, we would have two different implementations of an interface, one for Inrupt and one for Uvdsl, and resolve the proper instance to use at runtime. This would also allow to add more adapters in the future. Even if that's not a goal right, it's also good for code organization. As Aad mentioned in the call, this is called the Adapter pattern. Though if that confuses you more than it helps, just take a look at how I've done it for my apps (each authentication library has its own class).
Another additional improvement is to make sure to lazy-load the authentication libraries. Basically, if someone is logging in with uvdsl, they don't need to download all the javascript of Inrupt's library. I also do that in my apps, in particular using dynamic imports (see the .lazy files).
I haven't looked at all the code in the PR, but it's not immediately clear to me how consumers of this library choose which authentication library to use. Ideally, we could have a login() function that takes an "authenticationLibrary" parameter (or "authenticator", as I call them in my code, etc.). That could default to uvdsl, but should be easy to replace with Inrupt.
- 主要言語
- TypeScript
- スター
- 12
- フォーク
- 13
- 平均マージ
- 15時間 15分
- マージ済み PR(30日)
- 3
コントリビューションガイド
このリポジトリのコントリビューションガイドは索引されていません
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
SolidOS/solid-logic のほかの issue
-
Migrate to Vite オープン
SolidOS/solid-logic#314 · 担当者 1 名 ·
-
bug
SolidOS/solid-logic#290 · 担当者 1 名 ·
-
enhancement
SolidOS/solid-logic#274 · コメント 4 件 · 担当者 2 名 ·
-
難易度 4/5 3〜5日 初心者へのやさしさ 25/100
SolidOS/solid-logic#76 · コメント 2 件 ·
-
enhancement
SolidOS/solid-logic#64 · コメント 5 件 · 担当者 1 名 ·
SolidOS/solid-logic の issue をすべて見る
似ている issue
-
blocklist removal
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
MetaMask/eth-phishing-detect#296544 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
pastelsky/bundlephobia#1122 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
-
category/development priority/P2 scope/file-operations scope/testing type/enhancement
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
-
Enatega Customer and Rider app: Add-ons price is not visible to customer after order is placed. オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100