-
Notifications
You must be signed in to change notification settings - Fork 3k
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
feat(api): authorization extended for soft-delete and suspend #12158
feat(api): authorization extended for soft-delete and suspend #12158
Conversation
8b74c9d
to
45f00d5
Compare
45f00d5
to
6d03e03
Compare
* fix AspectRetriever behavior with respect to key aspects always returned * Deprecated active boolean in corpUserInfo not supported
6d03e03
to
441003b
Compare
@@ -22,7 +22,7 @@ | |||
|
|||
@Getter | |||
@Builder | |||
public class EntityServiceAspectRetriever implements CachingAspectRetriever { | |||
public class EntityServiceAspectRetriever implements AspectRetriever { |
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 impl is not caching, corrected interface.
* @param aspectRetriever aspect retriever - ideally the SystemEntityClient backed one for caching | ||
* @return active status | ||
*/ | ||
public boolean isActive(AspectRetriever aspectRetriever) { |
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.
Primary logic for evaluation of the actor's state.
@@ -177,7 +209,7 @@ public static OperationContext asSystem( | |||
@Nonnull private final EntityRegistryContext entityRegistryContext; | |||
@Nullable private final ServicesRegistryContext servicesRegistryContext; | |||
@Nullable private final RequestContext requestContext; | |||
@Nullable private final RetrieverContext retrieverContext; | |||
@Nonnull private final RetrieverContext retrieverContext; |
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.
Due to the importance of this context for actor state validation, it is no longer optional.
@@ -90,7 +91,7 @@ public Task<EntityResponse> get( | |||
? opContext.getEntityAspectNames(entityName) | |||
: new HashSet<>(Arrays.asList(aspectNames)); | |||
try { | |||
return _entityService.getEntityV2(opContext, entityName, urn, projectedAspects); | |||
return _entityService.getEntityV2(opContext, entityName, urn, projectedAspects, alwaysIncludeKeyAspect == null || alwaysIncludeKeyAspect); |
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.
Rest.li does have default values, but this works too 😄
@@ -522,12 +522,12 @@ cache: | |||
entityAspectTTLSeconds: | |||
# cache user aspects for 20s | |||
corpuser: |
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.
Effects the CachingAspectRetriever
@@ -1,9 +1,11 @@ | |||
package io.datahubproject.openapi; | |||
package io.datahubproject.openapi.config; |
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.
Important relocation here, previously it was not being picked up.
@@ -0,0 +1,54 @@ | |||
package io.datahubproject.openapi.operations.test; |
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.
Added this for smoke-test
@@ -490,45 +492,3 @@ def getAccessTokenMetadata(session, token): | |||
response.raise_for_status() | |||
|
|||
return response.json() | |||
|
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.
Move to common util
@@ -0,0 +1,173 @@ | |||
import os |
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.
Primary test case for the feat.
8c724db
into
datahub-project:master
feat(api): authorization extended for soft-delete and suspended
active
boolean flag incorpUserInfo
not supportedcorpUserKey
,status
,corpUserStatus
)Checklist