Make authentication more flexible
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 5/5
- Thời gian dự kiến
- Hơn một tuần
- Mức phù hợp với người mới
- 42/100
- Loại issue
- Tái cấu trúc
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Ít trao đổi
- Công nghệ
- typescript
- Lĩnh vực
- authentication, backend-api-design
Hướng nghiên cứu
Bắt đầu bằng cách đọc src/authn/SolidAuthnLogic.ts và các thay đổi được thảo luận trong pull request 171 để hiểu cách xử lý Inrupt và Uvdsl hiện tại. Xác định hành vi lựa chọn và mặc định mong muốn hướng đến người dùng trước khi đánh giá các triển khai authenticator riêng biệt và lazy loading. Công việc được xem là hoàn tất khi vẫn giữ nguyên API bên ngoài, đồng thời cho phép lựa chọn thư viện xác thực, với Uvdsl là mặc định.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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.
- Ngôn ngữ chính
- TypeScript
- Star
- 12
- Fork
- 13
- Merge trung bình
- 15 giờ 15 phút
- Pull request đã merge (30 ngày)
- 3
Hướng dẫn đóng góp
Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của SolidOS/solid-logic
-
Migrate to Vite Đang mở
SolidOS/solid-logic#314 · 1 người được giao ·
-
bug
SolidOS/solid-logic#290 · 1 người được giao ·
-
enhancement
SolidOS/solid-logic#274 · 4 bình luận · 2 người được giao ·
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 25/100
SolidOS/solid-logic#76 · 2 bình luận ·
-
enhancement
SolidOS/solid-logic#64 · 5 bình luận · 1 người được giao ·
Tất cả issue của SolidOS/solid-logic
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
mksglu/context-mode#1200 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
jaegertracing/jaeger-ui#4506 ·
-
area:desktop area:ui bug platform:macos
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
anthropics/claude-code#96687 ·
-
good first issue
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 95/100
AOSSIE-Org/DebateAI#582 · 2 bình luận ·