-
-
Notifications
You must be signed in to change notification settings - Fork 15
Users #109
Comments
It's worth saying, at this point the support for the user endpoints has been built in. All that would be required is to create the methodology to retrieve a users full list of packages, and append it to this list. But for the meantime, the endpoint is at least functional |
Is this necessary for v1? I'd say let's postpone it to v2. Anyway I have some thoughts:
It's tricky, I'd say let's postpone this and focus on other priorities. |
I'm on board to postpone this. We will just include a user endpoint like I've already implemented, and leave the actual package side of things for v2. But to answer your question, yes and no. The way it should work: We later then ask GitHub give us every repo the user has access to. Then we enumerate this list, to determine do they have access to the repo they claim to (By attempting to delete or modify a package) under this name. We do match the ownership by using the full But you do bring up a great point. One oversight, is if a package is renamed then we would miss it. Keep in mind once renamed the old name will still resolve, that's why if you go to We should probably add in some check for this or some new methodology, but otherwise this should be mostly a non-issue to determine ownership at the time of modifying a package. But yeah I don't see any good way to do so statically. As in without a users Token and access to their GitHub, which can only take place during authenticated actions. That's why I was thinking we could have |
So I want to add, the users endpoint is fully implemented and working. The only aspect not functioning yet is listing a users stars. So I'll cross this off our todo list for v1, and we can worry about listing a users packages for v2 |
Alright one more oversight that's been pointed out, seems there is another undocumented API endpoint that's been discovered,
But we have two undocumented endpoints to cover, and another SQL Database change we need. Which on that last part @Digitalone1 I'd appreciate any assistance you can offer.
/api/users
: This will be an authenticated Endpoint, which returns the authenticating Users information back to them./api/users/:userName
: This endpoint will have no authentication, and will return the public details of another user. The big kicker here, this endpoint needs to return all of said users packages they have published.A few notes:
Firstly these endpoints are undocumented because they don't seem to actual exist on the backend API. But they exist on the frontend website. But since of course this API is supposed to include everything, I feel that it should be added here.
Secondly, the reason I mention a Database change, is because currently there is no foolproof way to determine which packages belong to which user. This is something we do by checking what they have access to on GitHub itself. Meaning we may need to add in another column on the packages that links the user to the package they are publishing, while they publish it.
Which brings me to my third point. What about already published and migrated packages? Do we make any attempt to link them to a user?
Which if we did, would mean that during a users onboarding process we would have to either use the username to determine ownership, which I really don't think is a good idea, because then otherwise we have to get a list of the repos they have access to and check that against every package in the system. This would become expensive fast, and doesn't really seem practical.
So if we decide to let all migrated packages remained orphaned, that's fine and something we can do, but if we do I recommend that for v2 we try and think of how we can let users adopt a migrated package, if they need to. Could be done during any updates, or have a dedicated new endpoint in v2 that would allow them to attempt to adopt a package.
Which the later suggestion is more what I feel is possible for us here, since it would be problematic to do a manual adoption any way I see it.
But would love to hear your thoughts, and that we are able to get these other steps done no matter what we decide to do for existing packages
The text was updated successfully, but these errors were encountered: