-
Notifications
You must be signed in to change notification settings - Fork 5
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
DT-1202: Add "inherit steward" support to snapshot creation #1902
base: develop
Are you sure you want to change the base?
Conversation
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.
Overall looks good, some minor suggestions:
src/main/java/bio/terra/service/auth/iam/IamProviderInterface.java
Outdated
Show resolved
Hide resolved
Boolean inheritEnabled = | ||
context | ||
.getInputParameters() | ||
.get(SnapshotWorkingMapKeys.SNAPSHOT_INHERIT_STEWARD_ENABLED, Boolean.class); | ||
if (inheritEnabled != null && inheritEnabled) { | ||
var datasetPolicyMap = | ||
iamService.retrievePolicyEmails(userReq, IamResourceType.DATASET, sourceDataset.getId()); | ||
emails.add(datasetPolicyMap.get(IamRole.CUSTODIAN)); | ||
} | ||
|
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.
Should we pull this into a common method somewhere?
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 code is temporary until https://broadworkbench.atlassian.net/browse/DT-1197 is done. That will replace this code, which reads from the flight input map, to read from a field in sourceDataset
. I'm expecting it would look something like
if (sourceDataset.inheritSteward()) {
var datasetPolicyMap =
iamService.retrievePolicyEmails(userReq, IamResourceType.DATASET, sourceDataset.getId());
emails.add(datasetPolicyMap.get(IamRole.CUSTODIAN));
}
So I think a lot of it will go away. If there's still a need to refactor common code it can be done then.
|
Jira ticket: https://broadworkbench.atlassian.net/browse/DT-1202
Addresses
Add support to snapshot creation so the dataset custodian is optionally granted steward permissions on the snapshot.
Summary of changes
In the snapshot creation flight, if the
inheritSteward
flag is set:Testing Strategy