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 creates a default admin user:
admin
admin
admin
# Connect to ShibuDB
shibudb connect 9090
# You'll be prompted for credentials
Username: admin
Password: admin
# 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.
# Create a new user (admin only)
CREATE-USER john --password secret123 --role user
# Create admin user
CREATE-USER admin2 --password adminpass --role admin
# Create user with specific permissions
CREATE-USER alice --password alice123 --role user --spaces users,products
# List all users
LIST-USERS
# Update user password
UPDATE-USER john --password newpassword
# Update user role
UPDATE-USER john --role admin
# Delete user
DELETE-USER john
# Get user information
INFO-USER john
# Grant space access to user
GRANT-ACCESS john --space users --permissions read,write
# Revoke space access
REVOKE-ACCESS john --space users
# List user permissions
LIST-PERMISSIONS john
# Grant admin permissions
GRANT-ADMIN john
Understanding the permission system and access control.
# Grant read-only access
GRANT-ACCESS john --space users --permissions read
# Grant read-write access
GRANT-ACCESS john --space products --permissions read,write
# Grant admin access to space
GRANT-ACCESS john --space admin --permissions admin
# Remove all access
REVOKE-ACCESS john --space users
Recommended security practices for user management.
Common scenarios and practical examples.
# Create spaces for different tenants
CREATE-SPACE tenant1_data --engine key-value
CREATE-SPACE tenant2_data --engine key-value
# Create users for each tenant
CREATE-USER tenant1_user --password pass1 --role user
CREATE-USER tenant2_user --password pass2 --role user
# Grant access to respective spaces
GRANT-ACCESS tenant1_user --space tenant1_data --permissions read,write
GRANT-ACCESS tenant2_user --space tenant2_data --permissions read,write
# Create development user
CREATE-USER dev_user --password devpass --role user
# Create development spaces
CREATE-SPACE dev_users --engine key-value
CREATE-SPACE dev_vectors --engine vector --dimension 128
# Grant development access
GRANT-ACCESS dev_user --space dev_users --permissions read,write
GRANT-ACCESS dev_user --space dev_vectors --permissions read,write
# Create analytics user
CREATE-USER analyst --password analyst123 --role user
# Grant read-only access to data spaces
GRANT-ACCESS analyst --space users --permissions read
GRANT-ACCESS analyst --space products --permissions read
GRANT-ACCESS analyst --space analytics --permissions read,write
Common issues and solutions for user management.
# Stop the server
sudo shibudb stop
# Remove users file to reset to defaults
sudo rm /usr/local/var/lib/shibudb/users.json
# Start server (will recreate default admin)
sudo shibudb start 9090
# Login with default credentials
Username: admin
Password: admin
# Check current user
WHOAMI
# List all users and their roles
LIST-USERS
# Check user permissions
LIST-PERMISSIONS username
# Get detailed user info
INFO-USER username