Weights & Biases - Using W&B Custom Roles with SCIM API
The video provides a step-by-step guide on creating custom roles with additional permissions in an enterprise setting. It starts by explaining how to access role settings and create a new role by inheriting permissions from existing roles like 'member' or 'viewer'. Users can add specific permissions such as deleting runs or projects. Once created, these roles can be assigned to team members through a dropdown menu in the user settings.
The video also covers automating role management using an API. It explains how to authenticate API calls using a username and API key, encoded in base64. The process involves making GET and POST requests to manage roles, with examples provided for creating a custom role via the API. The video concludes by showing how to verify the creation of roles in the system and assign them to users.
Key Points:
- Custom roles allow adding extra permissions to existing roles.
- Roles can be assigned to team members via user settings.
- API can automate role management, reducing manual effort.
- Authentication for API calls requires base64 encoded credentials.
- Verify role creation and assignment through the system interface.
Details:
1. Introduction to Custom Roles 🎬
1.1. Accessing Role Settings
1.2. Creating and Assigning Custom Roles
2. Creating and Assigning Custom Roles 🆕
2.1. Creating Custom Roles
2.2. Assigning Permissions
3. Automating Role Management with API 🤖
- Automating the assignment of roles using an API removes manual intervention, streamlining role management processes.
- The Scam API facilitates managing users, groups, and roles via endpoints like SLK users, SLG groups, and SL roles.
- Authentication for API calls requires a header with a Base64 encoded username and password, prefixed by 'Basic'.
- Instead of a password, an API key is generated for authentication, enhancing security.
- For users in multiple organizations, setting a default organization is crucial for correct API configuration.
- The setup involves importing 'requests' for API calls and 'base64' for encoding, establishing a clear process for execution.
- To effectively automate role management, follow a structured setup: 1) Import necessary libraries, 2) Generate and use an API key for authentication, 3) Configure the default organization if applicable, 4) Make API calls to manage users, groups, and roles.
4. API Setup and Authentication 🔑
- Create a variable for the username (e.g., 'rum') and an API key variable.
- Copy the API key from user settings and paste it in the defined variable.
- Credentials format should be 'username:API_key' and should be encoded using base64.
- Create authorization headers using the format 'Basic <encoded_credentials>'.
- Use a request library to make a GET call to the specified host URL.
- Example host URL format: 'https://your-host/api'.
- Include headers in the GET request to authenticate successfully.
- The API call should return specific role data, including custom roles.