Skip to content

feat: ssh proxy service account authn - #1448

Closed
SalimKayal wants to merge 14 commits into
salimkayal/feat/ssh-keys_proxy-apifrom
salimkayal/feat/ssh-proxy-service-account-authn
Closed

SalimKayal wants to merge 14 commits into
salimkayal/feat/ssh-keys_proxy-apifrom
salimkayal/feat/ssh-proxy-service-account-authn

Conversation

@SalimKayal

@SalimKayal SalimKayal commented Sep 17, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

The internal proxy endpoint POST /internal/sessions/{session_id}/authorize now requires a Keycloak service-account token carrying the ssh-proxy realm role; it was unauthenticated (POC). Plan 3 of service-account-plan.md.

Motivation and context

The proxy is the internet-facing first hop. #1446 left the endpoint public so the flow could be exercised; this puts authentication back using a realm role created Keycloak.

Behavior

  • No/invalid token → 401; valid user token without the role → 403; ssh-proxy role → existing 204/404 logic.
  • renku-admin (is_admin) bypasses the role check.
  • Internal/session HS512 tokens are rejected (fail Keycloak JWKS).

Changes

  • ssh_proxy/blueprints.py, data_api/app.py: add authenticator + ssh_proxy_role="ssh-proxy" to SSHProxyBP, gate the handler with @authenticate + @require_role, wire dm.authenticator.
  • ssh_proxy/api.spec.yaml: add 401/403 responses.
  • test/.../test_ssh_proxy.py: auth-matrix tests (no token / user / wrong role / admin bypass / service account).
  • users/core.py: docstring now says "authorize endpoint" (incidental, unrelated).

Notes


PR Stack

@SalimKayal
SalimKayal changed the base branch from main to salimkayal/feat/ssh-keys_proxy-api September 17, 2026 14:28
@SalimKayal
SalimKayal added this pull request to stack #1445 September 17, 2026 14:28
@SalimKayal
SalimKayal force-pushed the salimkayal/feat/ssh-keys_proxy-api branch from 87caf4f to 5e87f9f Compare September 17, 2026 14:44
@SalimKayal
SalimKayal force-pushed the salimkayal/feat/ssh-proxy-service-account-authn branch from df9a178 to 5375ea2 Compare September 17, 2026 14:44
@SalimKayal
SalimKayal force-pushed the salimkayal/feat/ssh-proxy-service-account-authn branch from 5375ea2 to fd0eb53 Compare September 18, 2026 09:46
@SalimKayal
SalimKayal force-pushed the salimkayal/feat/ssh-keys_proxy-api branch from 5e87f9f to a1831be Compare September 18, 2026 09:46
@coveralls

coveralls commented Sep 18, 2026 •

Copy link
Copy Markdown

Coverage Report for CI Build 35978868057

Warning

No base build found for commit 3fe4321 on salimkayal/feat/ssh-keys_proxy-api.
Coverage changes can't be calculated without a base build.
If a base build is processing, this comment will update automatically when it completes.

Coverage: 85.455%

Details

  • Patch coverage: 7 of 7 lines across 1 file are fully covered (100%).

Uncovered Changes

No uncovered changes found.

Coverage Regressions

Requires a base build to compare against. How to fix this →


Coverage Stats

Coverage Status
Relevant Lines: 34602
Covered Lines: 29569
Line Coverage: 85.45%
Coverage Strength: 1.48 hits per line

💛 - Coveralls

@eikek
eikek force-pushed the salimkayal/feat/ssh-proxy-service-account-authn branch from 450e78e to 622144b Compare September 25, 2026 08:37
eikek
eikek previously approved these changes Sep 25, 2026
@SalimKayal
SalimKayal dismissed eikek’s stale review September 29, 2026 13:20

The merge-base changed after approval.

@SalimKayal
SalimKayal force-pushed the salimkayal/feat/ssh-keys_proxy-api branch from a5fd7d3 to 1ef456d Compare September 29, 2026 13:20
@SalimKayal
SalimKayal removed this pull request from stack #1445 September 29, 2026 14:59
@SalimKayal SalimKayal closed this Sep 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants