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

client: Unset project when querying permissions. #13116

Merged
merged 1 commit into from
Mar 12, 2024

Conversation

markylaing
Copy link
Contributor

lxc permission list expects an explicit project=<project_name> argument. If the client has a project set (other than default) then all requests made by the client will add a project=<project_name> query parameter if it is not already set. This leads to confusing/inconsistent results for this command.

`lxc permission list` expects an explicit `project=<project_name>`
argument. If the client has a project set (other than default) then all
requests made by the client will add a `project=<project_name>` query
parameter if it is not already set. This leads to confusing/inconsistent
results for this command.

Signed-off-by: Mark Laing <mark.laing@canonical.com>
@markylaing markylaing added the Bug Confirmed to be a bug label Mar 12, 2024
@markylaing markylaing self-assigned this Mar 12, 2024
@tomponline
Copy link
Member

@markylaing how is this handled already for other scenarios where project param isn't relevant, such as storage pool list?

@tomponline
Copy link
Member

@markylaing what i mean is, should the project param be ignored on the server rather than being removed in the client?

@markylaing
Copy link
Contributor Author

@markylaing what i mean is, should the project param be ignored on the server rather than being removed in the client?

I guess for other APIs the project parameter is ignored. In this case the permissions API accepts two query parameters: project and entity_type. Unlike other APIs, project really is just a filter and not a requirement, so we don't want the client to specify it if it hasn't been specified in the CLI.

@tomponline
Copy link
Member

@markylaing what i mean is, should the project param be ignored on the server rather than being removed in the client?

I guess for other APIs the project parameter is ignored. In this case the permissions API accepts two query parameters: project and entity_type. Unlike other APIs, project really is just a filter and not a requirement, so we don't want the client to specify it if it hasn't been specified in the CLI.

I see. Makes sense, so project param should always be specified explicitly on the command flags and not taken from the current active project?

Can you add a comment explaining what you just said there for future readers too please.

@tomponline tomponline merged commit 4e8c581 into canonical:main Mar 12, 2024
28 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Confirmed to be a bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants