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

Listing archived workflows API is inconsistent/sensitive to DB order #1981

Closed
2 of 4 tasks
jessesuen opened this issue Jan 15, 2020 · 1 comment
Closed
2 of 4 tasks
Assignees
Labels
Milestone

Comments

@jessesuen
Copy link
Member

Checklist:

  • I've included the version.
  • I've included reproduction steps.
  • I've included the workflow YAML.
  • I've included the logs.

What happened:

See comment:
#1882 (comment)

If I request to list archived workflows with a small page size (lets say size 1), and the first workflow in the list, happens to be in a namespace which I have permissions to, then this call will return successfully.

On the other hand, if I make the same exact request, and the first workflow in the list is in a namespace which I do not have access to, then the API will return 403.

This means the API is inconsistent depending on how the order in which the database is returning values.

This could be simplified to:

  • is the request asking to list workflows at the cluster scope? If yes, perform the equivalent of:
    kubectl auth can-i get wf --all-namespaces up front
  • otherwise perform the equivalent of:
    kubectl auth can-i get wf --namespace NAMESPACE up front

Both cases we can return earlier and perform authentication up front, instead of inline.

What you expected to happen:

API should be consistent in behavior.

@jessesuen jessesuen added this to the v2.5 milestone Jan 15, 2020
@alexec alexec self-assigned this Jan 22, 2020
@alexec
Copy link
Contributor

alexec commented Jan 28, 2020

I've reviewed the code and added a test case that demonstrates this bug does not exist (anymore?), it maybe that the implementation has change since it was raised.

This will come in the PR for #2049.

@alexec alexec closed this as completed Jan 28, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants