diff --git a/notes/helloshop/jwt-bearer-authentication.md b/notes/helloshop/jwt-bearer-authentication.md index bf8d382..23ec109 100644 --- a/notes/helloshop/jwt-bearer-authentication.md +++ b/notes/helloshop/jwt-bearer-authentication.md @@ -64,4 +64,13 @@ builder.Services.AddAuthentication().AddJwtBearer().AddCustomJwtBearer(options = options.IssuerSigningKey = issuerSigningKey; options.SecurityAlgorithm = SecurityAlgorithms.HmacSha256; }); +``` + +## 在容器中运行 pgAdmin 管理工具 + +```shell + +docier pull dpage/pgadmin4 + +docker run --name pgadmin -e PGADMIN_DEFAULT_EMAIL=test@test.com -e PGADMIN_DEFAULT_PASSWORD=test -e TZ=Asia/Shanghai -d -p 5050:80 dpage/pgadmin4 ``` \ No newline at end of file diff --git a/notes/helloshop/permission-definition.md b/notes/helloshop/permission-definition.md new file mode 100644 index 0000000..dc87706 --- /dev/null +++ b/notes/helloshop/permission-definition.md @@ -0,0 +1,19 @@ +# 设计权限定义和权限提供者 + +## 权限定义 + +每个微服务是自治的,权限定义也是每个微服务的职责,各自定义自己的权限,权限管理器会自动合并权限定义,权限定义上下文是微服务内的权限定义和全局权限定义的合集,权限提供者会根据权限定义上下文提供权限数据,权限分组是为了方便权限定义的管理,权限分组是权限定义的一部分,权限提供者自动注入到容器,提供权限查询端点。 + + +## 架构设计 + +![权限定义](https://oss.xcode.me/notes/helloshop/permission-definition.svg) + + +## 权限扩展方法 + +```csharp +IServiceCollection AddPermissionDefinitions(this IServiceCollection services) + +EndpointRouteBuilder MapPermissionDefinitions(this IEndpointRouteBuilder endpoints, params string[] tags) +``` \ No newline at end of file