dataflow.auth.supabase¶

Attributes¶

Classes¶

SupabaseAuth

Authentication provider using Supabase JWT.

Functions¶

get_auth_instance()

Get the auth instance for dependency injection.

get_current_user(, auth)

Verify the token and return the user ID.

require_auth() → str)

Require authentication for a route.

Module Contents¶

class dataflow.auth.supabase.SupabaseAuth(server_config: haive.dataflow.auth.config.environment.SupabaseServerConfig | None = None)¶

Authentication provider using Supabase JWT.

get_user_id(token: str) str | None¶

Extract user ID from token.

verify_token(token: str) dict[str, Any] | None¶

Verify Supabase JWT token and return payload if valid.

config¶
dataflow.auth.supabase.get_auth_instance()¶

Get the auth instance for dependency injection.

async dataflow.auth.supabase.get_current_user(credentials: fastapi.security.HTTPAuthorizationCredentials | None = Depends(security), auth: SupabaseAuth = Depends(get_auth_instance)) str | None¶

Verify the token and return the user ID.

This is for frontend API routes - can be used with FastAPI Depends.

async dataflow.auth.supabase.require_auth(user_id: str | None = Depends(get_current_user)) str¶

Require authentication for a route.

Raises HTTPException if not authenticated.

dataflow.auth.supabase.logger¶
dataflow.auth.supabase.security¶