Skip to content

feat: pass namespaceFilter to GET /workspacekinds from frontend - #1010

Merged
google-oss-prow[bot] merged 1 commit into
kubeflow:notebooks-v2from
andyatmiami:feat/wsk-namespace-filter-frontend
Apr 3, 2026
Merged

google-oss-prow[bot] merged 1 commit into
kubeflow:notebooks-v2from
andyatmiami:feat/wsk-namespace-filter-frontend

Conversation

@andyatmiami

@andyatmiami andyatmiami commented Apr 3, 2026 •

Copy link
Copy Markdown
Contributor

closes: #738
related: #860

The backend added a namespaceFilter query param to GET /workspacekinds (#1009). Without it, the endpoint requires cluster-wide list workspacekinds permission (admin-only). With the filter, auth falls back to checking create workspaces in the given namespace, allowing regular users access.

The frontend was always calling listWorkspaceKinds() without the filter, so non-admin users would get 403 when auth is enabled.

Changes:

  • Update swagger.version to include the namespaceFilter swagger changes
  • Regenerate the API client from the updated swagger spec
  • Add optional namespaceFilter param to the useWorkspaceKinds hook
  • Thread namespace through WorkspaceFormKindSelection and WorkspaceTable
  • Add unit test coverage for the new parameter
  • Sync package-lock.json engines field with package.json

@github-project-automation github-project-automation Bot moved this to Needs Triage in Kubeflow Notebooks Apr 3, 2026
@google-oss-prow google-oss-prow Bot added do-not-merge/work-in-progress area/frontend area - related to frontend components labels Apr 3, 2026
@google-oss-prow
google-oss-prow Bot requested review from ederign and paulovmr April 3, 2026 12:00
@google-oss-prow google-oss-prow Bot added area/v2 area - version - kubeflow notebooks v2 size/M labels Apr 3, 2026
@andyatmiami
andyatmiami force-pushed the feat/wsk-namespace-filter-frontend branch from c8cce93 to 7c91037 Compare April 3, 2026 12:01
The backend added a `namespaceFilter` query param to GET /workspacekinds
(kubeflow#1009). Without it, the endpoint requires cluster-wide `list workspacekinds`
permission (admin-only). With the filter, auth falls back to checking
`create workspaces` in the given namespace, allowing regular users access.

The frontend was always calling `listWorkspaceKinds()` without the filter,
so non-admin users would get 403 when auth is enabled.

Changes:
- Update swagger.version to include the namespaceFilter swagger changes
- Regenerate the API client from the updated swagger spec
- Add optional `namespaceFilter` param to the `useWorkspaceKinds` hook
- Thread namespace through WorkspaceFormKindSelection and WorkspaceTable
- Add unit test coverage for the new parameter
- Sync package-lock.json engines field with package.json
    - `package.json` updated as part of kubeflow#1003 but `npm` was not ran to
      reflect this in the lock file

Signed-off-by: Andy Stoneberg <astonebe@redhat.com>
@andyatmiami
andyatmiami force-pushed the feat/wsk-namespace-filter-frontend branch from 7c91037 to 8b521dd Compare April 3, 2026 12:17
@andyatmiami
andyatmiami marked this pull request as ready for review April 3, 2026 12:17
@andyatmiami

Copy link
Copy Markdown
Contributor Author

/ok-to-test

@andyatmiami

andyatmiami commented Apr 3, 2026 •

Copy link
Copy Markdown
Contributor Author

Verification

in "normal" tilt mode

image - with auth disabled - this doesn't truly confirm things are working - but here we see `namespaceFilter` at least properly being passed

with auth enabled

Methodology

Uploading auth-test-verification.md…

UI Test (relying on Envoy Filter configured above)

image - ℹ️ **EXPECTED** our `regular` user does **NOT** have `list workspacekinds` image - ℹ️ **EXPECTED** our `regular` user **DOES** is able to "see" workspacekinds through the Wizard

@thaorell thaorell left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Rendering a 403 error page for non-admin users while still having the link on the NavBar is confusing. Can we either address that here or open a separate issue for it?

},
"engines": {
"node": ">=20.0.0"
"node": "^20",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Why are we applying these constraints to npm and node?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

discussed in prior PR that was merged (but npm install was never ran which is why we see package-lock.json having this now)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

short answer: reacting to improve our security posture wherever possible in light of recent spate of supply chain attacks

@andyatmiami andyatmiami Apr 3, 2026 •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

i would prefer to open a separate issue for hiding workspace kinds page so we can get this in ASAP

this was not a new issue introduced as part of my PR... its always been this way - its just that developers basically NEVER run with auth enabled.. and then would ALSO need to run with a non-admin user to see this...

so its always been broken - but agree on your recommendation to be clear!

@thaorell thaorell left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

/lgtm

@ederign

ederign commented Apr 3, 2026

Copy link
Copy Markdown
Member

/approve
/lgtm

@google-oss-prow

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: ederign

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@google-oss-prow
google-oss-prow Bot merged commit f62ed04 into kubeflow:notebooks-v2 Apr 3, 2026
10 checks passed
@github-project-automation github-project-automation Bot moved this from Needs Triage to Done in Kubeflow Notebooks Apr 3, 2026
thesuperzapper pushed a commit that referenced this pull request Apr 7, 2026
The backend added a `namespaceFilter` query param to GET /workspacekinds
(#1009). Without it, the endpoint requires cluster-wide `list workspacekinds`
permission (admin-only). With the filter, auth falls back to checking
`create workspaces` in the given namespace, allowing regular users access.

The frontend was always calling `listWorkspaceKinds()` without the filter,
so non-admin users would get 403 when auth is enabled.

Changes:
- Update swagger.version to include the namespaceFilter swagger changes
- Regenerate the API client from the updated swagger spec
- Add optional `namespaceFilter` param to the `useWorkspaceKinds` hook
- Thread namespace through WorkspaceFormKindSelection and WorkspaceTable
- Add unit test coverage for the new parameter
- Sync package-lock.json engines field with package.json
    - `package.json` updated as part of #1003 but `npm` was not ran to
      reflect this in the lock file

Signed-off-by: Andy Stoneberg <astonebe@redhat.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved area/frontend area - related to frontend components area/v2 area - version - kubeflow notebooks v2 lgtm ok-to-test size/M

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

3 participants