Skip to content

Put authentication and access control behind replaceable interfaces #9486

Open

Description

@bobbai00

Task Summary

Today tokens are checked by three setups: the shared filter, a second one in the Dashboard Service (#5428), and a copy in the notebook migration service. Access is checked by per-kind code (WorkflowAccess, ResourceAccess, ComputingUnitAccess, and a copy in the notebook migration service), which can disagree (#9227). This task puts both behind two interfaces in common/auth, with our own implementations first, so that Keycloak or OpenFGA can replace them later without changing the services.

// Who is calling?
trait Authenticator {
  def authenticate(token: String): Either[AuthError, Principal] // a user, a service or a computing unit
}

// May they do it?
trait AccessControl {
  def check(who: Principal, action: Action, rid: Rid): Boolean
  def visible(who: Principal, action: Action, kind: Kind): Visible // what a list may show
  def grant(rid: Rid, uid: Int, level: Level): Unit
  def revoke(rid: Rid, uid: Int): Unit
}
  1. Our implementations first. Authenticator verifies the tokens of Texera's own sign-in, and later it can verify the tokens of Keycloak or any other OpenID Connect provider (Add 3rd party Login Providers #7513). AccessControl reads the access table of Adjust the database schema for unified resource management #9484, and later OpenFGA can hold the grants.
  2. Rules that make the swap real. Services depend only on the interfaces, and configuration picks the implementation. Grants change only through grant and revoke. A check names an action from the API definition (Define the resource service's API in one contract and generate code from it #9485), not a level. A list asks visible: ours returns a SQL condition for the list query, and OpenFGA would return ids.
  3. One answer everywhere. Today's per-kind checks become calls to AccessControl, after tests pin what they answer today. POST /access/evaluation gives the same answer to callers outside the JVM, such as the gateway and the agent service, which verifies tokens the same way (feat(agent-service): authenticate requests via JWT and gateway ext_authz #9043).

Discussion points

  1. Signing: sign tokens with a key pair now, so that only the issuer can sign and every other service can only verify, or keep the shared secret until an identity provider is chosen.

Done when every service checks tokens through Authenticator and access through AccessControl.

Task Type

  • Refactor / Cleanup
  • DevOps / Deployment / CI
  • Testing / QA
  • Documentation
  • Performance
  • Other

Activity

  1. added theissue type on Nov 16, 2026
  2. changed the title [-]Verify tokens with one shared verifier in every service[/-] [+]Put authentication and access control behind replaceable interfaces[/+] on Nov 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions