Skip to content

Feat/update entity adapt persisted grant db context#758

Merged
Qinyouzeng merged 12 commits intomainfrom
feat/update_entity_adapt_PersistedGrantDbContext
Mar 5, 2026
Merged

Feat/update entity adapt persisted grant db context#758
Qinyouzeng merged 12 commits intomainfrom
feat/update_entity_adapt_PersistedGrantDbContext

Conversation

@MayueCif
Copy link
Copy Markdown
Contributor

@MayueCif MayueCif commented Mar 5, 2026

恢复错误的修改

MayueCif added 11 commits March 4, 2026 09:04
将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配置,简化字段声明,提升代码规范性与可维护性。
在DeviceFlowCodes和PersistedGrant类中新增了CreationTime属性,用于记录对象的创建时间,提升了数据追踪和审计能力。
在DeviceFlowCodesEntityTypeConfiguration和PersistedGrantEntityTypeConfiguration中,新增了对CreationTime属性的IsRequired()配置,确保该字段在数据库中不能为空,以提升数据完整性和一致性。
Copilot AI review requested due to automatic review settings March 5, 2026 05:30
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 CreationTime to PersistedGrant and DeviceFlowCodes entities.
  • Configure CreationTime as 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.

将DeviceFlowCodes和PersistedGrant类中的CreationTime属性的setter从public改为private,防止外部直接修改创建时间,增强了数据的封装性和安全性。
@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud bot commented Mar 5, 2026

@Qinyouzeng Qinyouzeng merged commit 2e5b92d into main Mar 5, 2026
3 of 4 checks passed
@Qinyouzeng Qinyouzeng deleted the feat/update_entity_adapt_PersistedGrantDbContext branch March 5, 2026 06:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants