Skip to content
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

Filling some gaps in the DTS manifest #78

Merged
merged 9 commits into from
Aug 13, 2024
Merged

Filling some gaps in the DTS manifest #78

merged 9 commits into from
Aug 13, 2024

Conversation

jeff-cohere
Copy link
Collaborator

This set of changes adds several fields to our frictionless DataPackage format, in service of providing information that is helpful for the destination database in processing payloads. It also gathers user metadata into a single simple type within the auth package and propagates the information for the user requesting a transfer into the transfer process.

This should go in after #76.

Copy link

github-actions bot commented Aug 5, 2024

PR Preview Action v1.4.7
🚀 Deployed preview to https://kbase.github.io/dts/pr-preview/pr-78/
on branch gh-pages at 2024-08-13 15:15 UTC

@jeff-cohere jeff-cohere changed the base branch from main to metadata-endpoint August 6, 2024 17:45
Base automatically changed from metadata-endpoint to main August 13, 2024 15:14
Comment on lines +196 to +205
foundOrcid := false
for _, pid := range userInfo.Idents {
if pid.Provider == "OrcID" {
foundOrcid = true
break
}
}
if !foundOrcid {
return userInfo, fmt.Errorf("KBase Auth2: No ORCID IDs associated with this user!")
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is it worth setting the OrcID here, so that in the UserInfo function you don't do the same iteration through the list of Idents?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think it matters, unless a user has tens of thousands of ORCIDs associated(!). As it is now, kbaseUserInfo mirrors the information maintained by the KBase auth server, which doesn't prioritize the first ORCID. This mirrored structure is separate from our interpretation, which provides some clarity as to what we assume, which to me is more valuable than avoiding an extra loop.

if pid.Provider == "OrcID" {
orcidIds = append(orcidIds, pid.UserName)
userInfo.Orcid = pid.UserName
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is it guaranteed that there is only ever one Orcid associated with the user?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, but I don't know what we would do with more than one ORCID, so I'm assuming for now that we need to select one, and that the one we select is the first one.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What happens if the user has different OrcIDs associated with their accounts on different platforms? (well, I know what would happen -- nothing. The more useful case to think about is where they have a bunch of OrcIDs assoc'd with their KBase account, one of which is associated with their account on another platform).

Not deliberately trying to be annoying here -- just thinking of the kinds of annoying situations that may pop up in the wild.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense! I guess my logic is that I'd like to start simple, encounter real problems, and address accordingly. At least we have separate KBase and DTS user information so we can articulate our assumptions.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have been burned too many times by trying to keep it simple and assuming that KBase is doing sensible things...

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe it! Here's an issue: #81

tasks/tasks.go Outdated Show resolved Hide resolved
@jeff-cohere jeff-cohere merged commit 5a82033 into main Aug 13, 2024
2 checks passed
@jeff-cohere jeff-cohere deleted the manifest-gaps branch August 13, 2024 16:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants