-
-
Notifications
You must be signed in to change notification settings - Fork 159
Improved ID obfuscation #1775
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Improved ID obfuscation #1775
Conversation
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
@bkoelman
bkoelman
changed the title
(削除) Enhanced id obfuscation (削除ここまで)
(追記) Improved ID obfuscation (追記ここまで)
Aug 23, 2025
Codecov Report
✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 92.04%. Comparing base (23be010
) to head (c8d2ec2
).
Additional details and impacted files
@@ Coverage Diff @@ ## master #1775 +/- ## ========================================== - Coverage 92.06% 92.04% -0.02% ========================================== Files 475 475 Lines 14722 14736 +14 Branches 2331 2332 +1 ========================================== + Hits 13554 13564 +10 - Misses 766 770 +4 Partials 402 402
☔ 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.
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.
Uh oh!
There was an error while loading. Please reload this page.
This PR improves existing tests for ID obfuscation by:
long
instead ofint
as the internal ID typeResourceGraphBuilder
now has aRemove
method, which enables the removal of a resource type from the resource graph, after assembly scanning has run. This is used to exclude theObfuscatedIdentifiable
abstract base class, which is not supposed to be exposed externally.A new annotation
[HideResourceIdTypeInOpenApi]
is added to theJsonApiDotNetCore.OpenApi.Swashbuckle
package, which can be used to hide the underlying type of IDs. Before, the OpenAPI schema looked like:With the new annotation added to
ObfuscatedIdentifiable
(which implicitly applies to all derived types), it becomes:This is useful in the case of ID obfuscation because while the internal resource ID types are
long
, the publicly exposed obfuscated IDs are strings. We shouldn't make the internal ID type (which is an implementation detail) externally observable.Closes #1067, closes #1603.
QUALITY CHECKLIST