Comprehensive user management with role-based access control
ShibuDB provides a comprehensive user management system with role-based access control (RBAC) and fine-grained permissions. The system supports multiple user roles and space-specific permissions to ensure secure access to database resources.
┌─────────────────────────────────────┐
│ Authentication Layer │
├─────────────────────────────────────┤
│ Username/Password Validation │
├─────────────────────────────────────┤
│ Authorization Layer │
├─────────────────────────────────────┤
│ Role-Based Access Control (RBAC) │
├─────────────────────────────────────┤
│ Permission Enforcement │
├─────────────────────────────────────┤
│ Space-Level Permission Checks │
└─────────────────────────────────────┘
Understanding how authentication works in ShibuDB.
On first startup, ShibuDB prompts you to create an admin user. You can also pass credentials directly:
admin# Connect to ShibuDB (interactive prompt)
shibudb connect 9090
# You'll be prompted for credentials
Username: admin
Password: ****
# Connect with credentials (non-interactive)
shibudb connect --admin-user admin --admin-password admin 9090
# Successful login response
Login successful.
[]>
Different user roles with specific privileges and use cases.
Use Case: System administrators, database owners
Use Case: Application users, developers, analysts
Commands for managing users and their permissions. All commands are admin-only unless stated otherwise.
The CREATE-USER command is interactive — it will prompt for username, password, role, and permissions:
# Create a new user (interactive prompts for username, password, role, permissions)
CREATE-USER
# Update a user's password (interactive prompt for new password)
UPDATE-USER-PASSWORD john
# Update a user's role (interactive prompt for new role: admin/user)
UPDATE-USER-ROLE john
# Update a user's space permissions (interactive)
# Permission format: space_name=permission_type (e.g. users=read, products=write)
UPDATE-USER-PERMISSIONS john
# Get user information
GET-USER john
# Delete user
DELETE-USER john
Understanding the permission system and access control.
Permissions use the format <space_name>=<permission_type>:
Assign permissions interactively using UPDATE-USER-PERMISSIONS. Enter permissions in the format space_name=permission_type:
# Example permission entries (entered interactively):
users=read
products=write
analytics=write
tenant_a_data=read
Recommended security practices for user management.
Common scenarios and practical examples.
# Create spaces for different tenants (admin)
CREATE-SPACE tenant1_data --engine key-value
CREATE-SPACE tenant2_data --engine key-value
# Create users for each tenant (interactive - CREATE-USER prompts for details)
CREATE-USER
# Enter: username=tenant1_user, role=user, permissions: tenant1_data=write
CREATE-USER
# Enter: username=tenant2_user, role=user, permissions: tenant2_data=write
# Create development spaces (admin)
CREATE-SPACE dev_users --engine key-value
CREATE-SPACE dev_vectors --engine vector --dimension 128
# Create development user (interactive)
CREATE-USER
# Enter: username=dev_user, role=user, permissions: dev_users=write, dev_vectors=write
# Create analytics user (interactive)
CREATE-USER
# Enter: username=analyst, role=user
# Permissions: users=read, products=read, analytics=write
# To update permissions later:
UPDATE-USER-PERMISSIONS analyst
Common issues and solutions for user management.
# Stop the server
shibudb stop
# Remove users file to reset
rm ~/.shibudb/lib/users.json
# Start server (will prompt for new admin credentials)
shibudb start 9090
# Get detailed user info
GET-USER username
# Delete user
DELETE-USER username
# Update user password (interactive)
UPDATE-USER-PASSWORD username
# Update user role (interactive)
UPDATE-USER-ROLE username
# Update user permissions (interactive)
UPDATE-USER-PERMISSIONS username