Authorization#
The NeMo Microservices Platform includes a comprehensive authorization system that controls who can access which resources and what actions they can perform. This enables secure multi-user deployments where teams can collaborate on AI projects while maintaining proper access controls.
Key Features#
Workspace-based Access Control: All resources are organized into workspaces, which serve as the primary authorization boundary.
Role-Based Permissions: Grant predefined roles (Viewer, Editor, Admin) to users within workspaces.
Flexible Sharing: Share workspaces with specific users or make them publicly accessible for read-only collaboration.
API Scopes: Create fine-grained, token-level controls for API access.
Getting Started#
Step 2: Make Authenticated Calls#
Once authorization is enabled, all API requests must be authenticated. The CLI is already configured after Step 1. For the Python SDK, pass the token in the default_headers when creating the client.
# CLI is already configured after quickstart configure
# All commands are authenticated as the admin
nmp workspaces list
# To use a different identity:
nmp config set --api-key other-user@example.com
from nemo_microservices import NeMoMicroservices
client = NeMoMicroservices(
base_url="http://localhost:8080",
default_headers={
"Authorization": f"Bearer {TOKEN}"
}
)
# Make authenticated API calls
workspaces = client.workspaces.list()
print(f"Found {len(workspaces.data)} workspaces")
Note
Quickstart Mode
In quickstart/development mode, you can authenticate by setting the X-NMP-Principal-Id header directly to your email address instead of using a Bearer token:
client = NeMoMicroservices(
base_url="http://localhost:8080",
default_headers={
"X-NMP-Principal-Id": "admin@example.com"
}
)
Next Steps#
Authorization Concepts: Learn about the authorization model, roles, permissions, and how access control works.
Managing Access: Add users to workspaces, assign roles, and manage permissions for your team.