minipower-backend-authentication-dotnet-basic
Đăng ký Jarvis HTTP Basic AddCoreBasic trong callback AddJarvisAuthentication — mặc định ConfigBasicCredentialProvider đọc config Users, hoặc custom IBasicCredentialProvider cho DB. Dùng khi client gửi Authorization Basic.
- License 许可
- MIT
- 最近更新
- 2026-11-09
- Stars
- ★ 7
- Forks
- 0
01 前言 Front Matter
- name
- minipower-backend-authentication-dotnet-basic
- description
- Đăng ký Jarvis HTTP Basic AddCoreBasic trong callback AddJarvisAuthentication — mặc định ConfigBasicCredentialProvider đọc config Users, hoặc custom IBasicCredentialProvider cho DB. Dùng khi client gửi Authorization Basic.
- dependencies
- [ "Jarvis.Authentications.Basic" ]
03 SKILL.md 正文
HTTP Basic
Package
<PackageReference Include="Jarvis.Authentications.Basic" Version="1.0.1" />
Program.cs
Đăng ký trong callback AddJarvisAuthentication. Provider truyền qua generic — mặc định ConfigBasicCredentialProvider (đọc config):
using Jarvis.Authentication; // AddJarvisAuthentication
using Jarvis.Authentication.Basic; // AddCoreBasic, ConfigBasicCredentialProvider
builder.Services.AddJarvisAuthentication(builder.Configuration, auth =>
{
auth.AddCoreBasic<ConfigBasicCredentialProvider>(builder.Configuration);
});
Scheme mặc định "Basic". Handler JarvisBasicAuthenticationHandler giải mã Authorization: Basic base64(user:pass) rồi ủy xác thực cho provider. Challenge trả WWW-Authenticate: Basic realm="...".
Custom provider (DB có password hash)
auth.AddCoreBasic<MyDbBasicCredentialProvider>(builder.Configuration);
- Implement
IBasicCredentialProvider.AuthenticateAsync(scheme, user, password, ct)→BasicValidationResult?(null = fail). - Đăng ký Singleton (tự động) — tra DB →
IDbContextFactory/IServiceScopeFactory.
appsettings.json
Section Authentication:Basic:{realm} — Realm (header challenge) + Users (dict user → Password, Roles):
{
"Authentication": {
"Basic": {
"Default": {
"Realm": "Jarvis API",
"Users": {
"demo": { "Password": "", "Roles": [ "User" ] }
}
}
}
}
}
⚠️ Password plain-text trong config — chỉ dev/test hoặc service-to-service nội bộ.
Production dùng custom IBasicCredentialProvider với password đã hash. Password — env / secret store.
Validate
- Thiếu / sai credential → 401 (+ header
WWW-Authenticate: Basic) Authorization: Basic base64(demo:pass)hợp lệ → 200, claims gồm Name + Roles
04 同仓库更多 Skills
minipower-vcs-gitlab
Tra GitLab (search, issue, pipeline, MR), soạn MR/comment, tạo MR và commit/push sau L2. Dùng khi merge request, GitLab MCP, code_provider gitlab — không scaffold .NET, không force-push.
minipower-toolbox-skill-author
Viết và soát skill lá-rời Minipower (minipower-{module}-{capability}) — chọn module bằng 3 câu hỏi ADR-022, dựng cây SKILL.md/README.md/workflows/providers, đặt description kích hoạt được, cập nhật hub và test canh. Hỏi người xác nhận trước mọi quyết định, không tự chốt. Dùng khi tạo skill mới, thêm provider/pattern/workflow, mở module mới, hoặc soát skill có sẵn lệch chuẩn.
minipower-tasks-lark
Đọc, lọc, tìm, soạn nháp và ghi task Lark (tasklist / task) theo L1–L3. Dùng khi việc trên Lark, sprint, tasklist, "tìm task", "tạo task", tasks_provider lark — không dùng cho tin nhắn nhóm hay wiki.
minipower-support-registry
Rà registry DOC theo project_mode, nhắc owner thiếu ID hoặc chỗ lưu sai. Dùng khi doc-registry, thiếu DOC, rà soát tiêu chuẩn — không tự sửa FR, không init.
minipower-support-publish
暂无简介
minipower-router
Phân loại intent Minipower rồi gợi ý đúng một pack nghề hoặc kênh. Dùng khi làm gì tiếp, chọn skill, dispatcher, không biết mở pack nào — không tự gọi MCP L3, không spawn agent.