Conversation
|
@dependabot show ignore conditions |
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
# Conflicts: # src/main/java/org/broadinstitute/consent/http/ConsentApplication.java
This comment was marked as outdated.
This comment was marked as outdated.
# Conflicts: # src/main/java/org/broadinstitute/consent/http/ConsentApplication.java
# Conflicts: # src/main/resources/assets/api-docs.yaml
Copilot feedback Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 19 out of 19 changed files in this pull request and generated 6 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
| .map(LibraryCard::getCreateDate) | ||
| .orElse(user.getCreateDate()); | ||
| // GA4GH requires Unix timestamps in seconds; Date#getTime() returns milliseconds. | ||
| return assertedDate.getTime() / 1000L; |
There was a problem hiding this comment.
What's the tolerance for being off by a second? Technically speaking we could be rounding up. If it's inconsequential, I'm not concerned. If it is, we might want to convert these Date objects to something like Instant and use the built in functions to convert to epoch seconds.
There was a problem hiding this comment.
We don't have a hard requirement for that level of precision. I would be amenable to a more centralized function to ensure we're always following the same pattern.
| } | ||
|
|
||
| @Override | ||
| public Long asserted() { |
There was a problem hiding this comment.
What does this date represent? How will a consumer use it?
There was a problem hiding this comment.
This represents the seconds since the visa assertion is made: https://ga4gh.github.io/data-security/ga4gh-passport#visa-object-claims
|
|
||
| protected List<Visa> buildControlledAccessGrants( | ||
| String userSubjectId, List<ApprovedDataset> approvedDatasets) { | ||
| return approvedDatasets.stream() |
There was a problem hiding this comment.
Do we need to be more selective about the filter here? Don't we want the ApprovedDataset with the longest runway?
There was a problem hiding this comment.
That's a good point. I should sort them by the expiration and then filter out duplicates so we get the ones that extend the furthest into the future.
There was a problem hiding this comment.
After digging into this some more, it doesn't matter which of the ApprovedDataset entities we return, only that we return one of them. IOW, if the user has access to two ApprovedDataset objects, one that expires tomorrow, one that expires next year, they have the same underlying dataset identifier.
There was a problem hiding this comment.
It's true that they'll have the same identifier, but I'm thinking about how we communicate when access to that dataset is no longer authorized. I haven't gotten through enough of the spec yet to see how that unwinds (or if it's even supported). What is clear to me is that the expiration (exp) of the Visa shouldn't be past when the we would remove access (when access is planned to expire or the user's LC is revoked). Fun stuff we'll be able to work through in future PRs. :-)
There was a problem hiding this comment.
What is clear to me is that the expiration (exp) of the Visa shouldn't be past when the we would remove access (when access is planned to expire or the user's LC is revoked)
Of these two conditions, we have control over the planned expiration, but not future LC revocation. I can see improvements on the expiration front at least.
| description: The Issued-At timestamp | ||
| exp: | ||
| type: number | ||
| description: The Expiration timestamp |
There was a problem hiding this comment.
We might want to be clearer that making an access decision after the exp is reached is unsupported.
There was a problem hiding this comment.
ControlledAccessGrants is just one type of visa which is what that language would be applicable to. I think it would be confusing with respect to the other visa types that exist, such as ResearcherStatus or AffiliationAndRole.
There was a problem hiding this comment.
ControlledAccessGrantsis just one type of visa which is what that language would be applicable to. I think it would be confusing with respect to the other visa types that exist, such asResearcherStatusorAffiliationAndRole.
I have to correct myself. exp applies equally to all Visas, and in the case of ControlledAccessGrants it does NOT refer to the expiration of the user's access to the dataset. It applies only to the state of the Visa such that the visa will always expire 1 hour from issuance.
|
As I'm coming up to speed on the GA4GH Passport spec, I'm wondering if we should be creating durable logs for every passport we issue so that we can trace (with high fidelity) all of the clients that have requested these objects and know their expiration so that we can:
|
Absolutely, these are great features. There are a number of other things we need to do to be fully compliant as noted in the PR description so I intend that this be iterated upon over time. Currently, there are no clients that will be using this in the near (1-3 month at a minimum) future. |
fboulnois
left a comment
There was a problem hiding this comment.
As a first approach, this looks reasonable! 👍
|
Thanks for the harmonization around dates. I think that's going to be helpful in the future. I'm wondering if the resource should be updated so that it's not PermitAll, but rather Admin and maybe Service Account for now. I think there are Expiration and Revocation cases that are important from a compliance standpoint that are missing from this that make me concerned we'll communicate a controlled access grant without having these other mechanisms in place. https://github.com/ga4gh-duri/ga4gh-duri.github.io/blob/master/researcher_ids/ga4gh_passport_v1.md#overview Would that be an okay next step on this? |
Sure thing. I'd prefer to limit it to Admin for now rather than SA since they are not an intended audience, general researchers are the current target. For comparison, this API is doing essentially the same thing that https://consent.dsde-prod.broadinstitute.org/#/User/get_api_user_me_researcher_datasets does ... retrieving the same entity for an authenticated user. That API is also |
|



Addresses
https://broadworkbench.atlassian.net/browse/DT-2991
Summary
This PR represents our first effort to generate a compliant GA4GH passport implementation. This PR implements the following features:
ControlledAccessGrantsVisa per dataset the user has current access to.AffiliationAndRoleVisa describing the user's affiliationResearcherStatusVisa describing the user's statusWhat this PR does NOT cover
This work should be slated for future implementation efforts.
ga4gh_passport_v1Have you read CONTRIBUTING.md lately? If not, do that first.