Skip to content

refactor(api): introduce type aliases and enhance request context interfaces#710

Merged
Ahoo-Wang merged 2 commits into3.xfrom
feat-SpaceId-3
Feb 4, 2026
Merged

refactor(api): introduce type aliases and enhance request context interfaces#710
Ahoo-Wang merged 2 commits into3.xfrom
feat-SpaceId-3

Conversation

@Ahoo-Wang
Copy link
Owner

  • Introduce AppId, DeviceId, RequestId, PermissionId, PolicyId, RoleId type aliases
  • Add SpaceIdCapable interface with default implementation and constants
  • Update AppPermission interface to use AppId and PermissionId types
  • Enhance AppRolePermission interface to use RoleId for rolePermissionIndexer
  • Modify AppRolePermissionRepository to include spaceId parameter and use typed IDs
  • Update cache interfaces to use typed key converters (AppId, SpacedRoleId)
  • Add spaceId field to Request interface with header/query parsing logic
  • Include spaceId in condition schema and PartExtractor for policy conditions
  • Add SpacedRoleId data class with conversion utilities for role-space mapping
  • Create OrderedCorsWebFilter with configurable order for CORS handling
  • Update filter ordering constants and remove magic numbers in webflux module
  • Refactor role-based permission caching to use spaced role identifiers
  • Update authorization logic to pass spaceId when fetching app role permissions
  • Add comprehensive test coverage for new space-aware functionality

…erfaces

- Introduce AppId, DeviceId, RequestId, PermissionId, PolicyId, RoleId type aliases
- Add SpaceIdCapable interface with default implementation and constants
- Update AppPermission interface to use AppId and PermissionId types
- Enhance AppRolePermission interface to use RoleId for rolePermissionIndexer
- Modify AppRolePermissionRepository to include spaceId parameter and use typed IDs
- Update cache interfaces to use typed key converters (AppId, SpacedRoleId)
- Add spaceId field to Request interface with header/query parsing logic
- Include spaceId in condition schema and PartExtractor for policy conditions
- Add SpacedRoleId data class with conversion utilities for role-space mapping
- Create OrderedCorsWebFilter with configurable order for CORS handling
- Update filter ordering constants and remove magic numbers in webflux module
- Refactor role-based permission caching to use spaced role identifiers
- Update authorization logic to pass spaceId when fetching app role permissions
- Add comprehensive test coverage for new space-aware functionality

Signed-off-by: Ahoo Wang <ahoowang@qq.com>
@Ahoo-Wang Ahoo-Wang added the enhancement New feature or request label Feb 4, 2026
… in JSON deserializers

- Updated JsonActionMatcherSerializer to use properties().first() instead of fields().next()
- Updated JsonConditionMatcherSerializer to use properties().first() instead of fields().next()
- Ensures consistent property access behavior across JSON deserialization logic
- Improves compatibility with different JSON node implementations

Signed-off-by: Ahoo Wang <ahoowang@qq.com>
@codecov
Copy link

codecov bot commented Feb 4, 2026

Codecov Report

❌ Patch coverage is 91.30435% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 91.62%. Comparing base (88a1c3c) to head (c476a6a).
⚠️ Report is 2 commits behind head on 3.x.

Files with missing lines Patch % Lines
...oo/cosec/cache/RedisAppRolePermissionRepository.kt 75.00% 0 Missing and 1 partial ⚠️
.../ahoo/cosec/policy/condition/part/PartExtractor.kt 80.00% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##                3.x     #710      +/-   ##
============================================
- Coverage     91.69%   91.62%   -0.08%     
- Complexity      606      608       +2     
============================================
  Files           148      149       +1     
  Lines          1819     1827       +8     
  Branches        157      157              
============================================
+ Hits           1668     1674       +6     
- Misses           73       74       +1     
- Partials         78       79       +1     
Flag Coverage Δ
unittests 91.62% <91.30%> (-0.08%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@Ahoo-Wang Ahoo-Wang merged commit 8eb97bd into 3.x Feb 4, 2026
13 checks passed
@Ahoo-Wang Ahoo-Wang deleted the feat-SpaceId-3 branch February 4, 2026 05:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant