-
Notifications
You must be signed in to change notification settings - Fork 420
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
fix(edge-identities): prevent unauthorised identity access #5135
fix(edge-identities): prevent unauthorised identity access #5135
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎ 3 Skipped Deployments
|
Docker builds report
|
Uffizzi Preview |
self.kwargs["identity_uuid"] | ||
) | ||
edge_identity = EdgeIdentity.from_identity_document(identity_document) | ||
self.check_object_permissions(self.request, edge_identity) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This line is the main fix in this PR. There's a lot of other changes here too, mostly related to the refactor implemented to remove this TODO, but I wanted to highlight the actual fix.
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #5135 +/- ##
==========================================
+ Coverage 97.45% 97.46% +0.01%
==========================================
Files 1216 1224 +8
Lines 42368 42573 +205
==========================================
+ Hits 41289 41495 +206
+ Misses 1079 1078 -1 ☔ View full report in Codecov by Sentry. |
api/edge_api/identities/models.py
Outdated
self._reset_initial_state() # type: ignore[no-untyped-call] | ||
|
||
@classmethod | ||
def from_identity_document(cls, identity_document: dict) -> "EdgeIdentity": # type: ignore[type-arg] | ||
return EdgeIdentity(IdentityModel.model_validate(identity_document)) | ||
|
||
@property | ||
def django_id(self) -> int: | ||
return self._engine_identity_model.django_id # type: ignore[return-value] | ||
def django_id(self) -> int: # pragma: no cover |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this dead code? 🤔
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I think so. I removed it.
Changes
Fixes permissions on EdgeIdentityViewSet
How did you test this code?
Added / updated tests