Feat/update entity adapt persisted grant db context#758
Merged
Qinyouzeng merged 12 commits intomainfrom Mar 5, 2026
Merged
Conversation
将DeviceFlowCodes和PersistedGrant中的SessionId与Description属性由非空字符串改为可空字符串(string?),并移除默认空字符串赋值,以更准确表达属性可为null的业务场景。
将DeviceFlowCodes和PersistedGrant类从继承FullAggregateRoot<Guid, Guid>改为普通类,去除了聚合根相关功能,简化了实体结构或为领域模型调整做准备。
移除了 DeviceFlowCodes.cs 和 PersistedGrant.cs 文件中的命名空间声明,使这两个类不再属于原有的命名空间。此更改可能用于调整类的作用域或为后续的命名空间重构做准备。
修正版权声明并增加MIT License说明。将命名空间从Oracle专用调整为通用版本。简化SubjectId、SessionId、Description字段配置,移除IsRequired(false),仅保留最大长度设置,默认可空。移除了CreationTime的IsRequired()配置,使配置更简洁且符合EF Core默认行为。
完善MIT License声明,统一命名空间为通用EntityConfigurations。优化字段配置,移除部分IsRequired(false)和CreationTime配置,简化字段声明,提升代码规范性与可维护性。
This reverts commit cfd79bc.
This reverts commit 7db3fc9.
在DeviceFlowCodes和PersistedGrant类中新增了CreationTime属性,用于记录对象的创建时间,提升了数据追踪和审计能力。
在DeviceFlowCodesEntityTypeConfiguration和PersistedGrantEntityTypeConfiguration中,新增了对CreationTime属性的IsRequired()配置,确保该字段在数据库中不能为空,以提升数据完整性和一致性。
There was a problem hiding this comment.
Pull request overview
This PR restores CreationTime support for persisted grants and device flow codes by adding the property to the domain entities and marking it as required in EF Core entity configurations across providers.
Changes:
- Add
CreationTimetoPersistedGrantandDeviceFlowCodesentities. - Configure
CreationTimeas required in EF Core mappings for default, PostgreSQL, and Oracle providers.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EFCore/EntityConfigurations/PersistedGrantEntityTypeConfiguration.cs | Marks CreationTime as required for persisted grant mapping. |
| src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EFCore/EntityConfigurations/DeviceFlowCodesEntityTypeConfiguration.cs | Marks CreationTime as required for device flow codes mapping. |
| src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EFCore.PostgreSql/EntityConfigurations/PersistedGrantEntityTypeConfiguration.cs | Mirrors required CreationTime mapping for PostgreSQL. |
| src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EFCore.PostgreSql/EntityConfigurations/DeviceFlowCodesEntityTypeConfiguration.cs | Mirrors required CreationTime mapping for PostgreSQL. |
| src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EFCore.Oracle/EntityConfigurations/PersistedGrantEntityTypeConfiguration.cs | Mirrors required CreationTime mapping for Oracle. |
| src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EFCore.Oracle/EntityConfigurations/DeviceFlowCodesEntityTypeConfiguration.cs | Mirrors required CreationTime mapping for Oracle. |
| src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.OpenIdConnect.Domain/Entities/PersistedGrant.cs | Adds CreationTime property to the persisted grant entity. |
| src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.OpenIdConnect.Domain/Entities/DeviceFlowCodes.cs | Adds CreationTime property (with XML docs) to the device flow entity. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
...IdConnect/Masa.BuildingBlocks.Authentication.OpenIdConnect.Domain/Entities/PersistedGrant.cs
Outdated
Show resolved
Hide resolved
...dConnect/Masa.BuildingBlocks.Authentication.OpenIdConnect.Domain/Entities/DeviceFlowCodes.cs
Show resolved
Hide resolved
将DeviceFlowCodes和PersistedGrant类中的CreationTime属性的setter从public改为private,防止外部直接修改创建时间,增强了数据的封装性和安全性。
|
Qinyouzeng
approved these changes
Mar 5, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



恢复错误的修改