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

Implement new access API for projects #724

Open
stgraber opened this issue Apr 2, 2024 · 6 comments
Open

Implement new access API for projects #724

stgraber opened this issue Apr 2, 2024 · 6 comments
Assignees
Labels
API Changes to the REST API Documentation Documentation needs updating Easy Good for new contributors Feature New feature, not a bug
Milestone

Comments

@stgraber
Copy link
Member

stgraber commented Apr 2, 2024

It would be nice to have a /1.0/projects/NAME/access endpoint which one could GET to retrieve the list of who's allowed access and what access level they have on the object.

@stgraber stgraber added Documentation Documentation needs updating Feature New feature, not a bug Easy Good for new contributors API Changes to the REST API labels Apr 2, 2024
@stgraber stgraber added this to the soon milestone Apr 2, 2024
@sharathsivakumar
Copy link
Contributor

Hey @stgraber I would like to work on this!

@stgraber
Copy link
Member Author

stgraber commented Apr 3, 2024

I'm currently giving priority for those easier issues to the students at the University of Texas in Austin as they've literally ran out of things to work on but I'll happily assign you to this one if they don't claim it in the next week :)

@j2walker
Copy link

j2walker commented Apr 4, 2024

Hi @stgraber, I'm with the Virtualization class at UT Austin, could I work on this issue?

@stgraber
Copy link
Member Author

stgraber commented Apr 4, 2024

Yep, assigned it to you

@j2walker
Copy link

j2walker commented May 1, 2024

Hi @stgraber, I am beginning to work on this issue and have read your comments on #725. I found other API endpoints for /1.0/projects/{name} in /cmd/incusd/api_project.go, so I'm assuming that is where this new GET endpoint will go. Since we will be sharing the same access struct, I'll just reach out to my classmate to get their struct code so it's consistent between the two PRs.

I'm assuming the internal logic will be slightly different since this endpoint will be querying the projects for access instead of instances, but should it be something like GetProjectAccess(ctx context.Context, projectName string) (*api.Access, error) in internal/server/auth/access.go?

Then would checking access be the same as you've outlined in #725 where you check the certificate level?

@stgraber
Copy link
Member Author

stgraber commented May 2, 2024

Hi @stgraber, I am beginning to work on this issue and have read your comments on #725. I found other API endpoints for /1.0/projects/{name} in /cmd/incusd/api_project.go, so I'm assuming that is where this new GET endpoint will go. Since we will be sharing the same access struct, I'll just reach out to my classmate to get their struct code so it's consistent between the two PRs.

Yep, that's the correct location for it.

I'm assuming the internal logic will be slightly different since this endpoint will be querying the projects for access instead of instances, but should it be something like GetProjectAccess(ctx context.Context, projectName string) (*api.Access, error) in internal/server/auth/access.go?

Yep, that's correct and the check itself in the case of the tls driver should be basically identical to that for instance access given that the instance access logic in the case of the tls driver doesn't actually do anything with the instance name.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
API Changes to the REST API Documentation Documentation needs updating Easy Good for new contributors Feature New feature, not a bug
Development

No branches or pull requests

3 participants