Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wandb SCIM py wrapper #519

Merged
merged 17 commits into from
May 7, 2024
Merged

Wandb SCIM py wrapper #519

merged 17 commits into from
May 7, 2024

Conversation

velotioaastha
Copy link
Contributor

@velotioaastha velotioaastha commented Apr 25, 2024

Added a wrapper to call SCIM APIS for access management.

  • User
  • Team
  • Custom Roles

The provided code consists of three Python example modules:

custom_roles_example.py:

  • Defines functions to interact with custom roles in a user management system.
  • Functions include creating custom roles, getting details of a custom role, getting all custom roles, adding permissions to a custom role, removing permissions from a custom role, and updating a custom role.
  • Utilizes a CustomRole class which is assumed to be defined in a separate file named custom_role.py.
  • Includes error handling for API requests.

teams_example.py:

  • Provides functions to manage teams within the user management system.
  • Functions involve creating a team, getting team details, getting all teams, updating a team by adding or removing members.
  • Uses a Teams class, presumed to be defined in a separate file named teams.py.
  • Implements error handling for API requests.

users_example.py:

  • Contains functions to handle user-related operations such as creating a user, getting user details, getting all - users, deactivating a user, assigning roles to a user, and assigning team roles to a user.
  • Utilizes a User class assumed to be defined in a separate file named users.py.
  • Demonstrates the usage of the User class by creating a new user with the specified request payload.

Each module follows a similar structure:

  • Functions encapsulate specific actions related to custom roles, teams, or users.
  • Error handling is implemented using try-except blocks to catch and handle potential API request exceptions.
  • The main module demonstrates the usage of functions by calling them with appropriate parameters, such as base URL, username, API key, and request payload.

Overall, this code facilitates interaction with a user management system through HTTP requests, covering various aspects such as managing custom roles, teams, and users.

@velotioaastha velotioaastha requested a review from abhinavg6 April 25, 2024 06:57
@velotioaastha velotioaastha self-assigned this Apr 25, 2024
Copy link

@abhinavg6 abhinavg6 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work - this is really comprehensive. I've requested a couple of core changes, and changes to method names.

wandb-scim/custom_roles.py Outdated Show resolved Hide resolved
wandb-scim/custom_roles.py Outdated Show resolved Hide resolved
wandb-scim/custom_roles.py Outdated Show resolved Hide resolved
wandb-scim/custom_roles.py Outdated Show resolved Hide resolved
wandb-scim/custom_roles.py Outdated Show resolved Hide resolved
wandb-scim/users.py Outdated Show resolved Hide resolved
wandb-scim/users.py Outdated Show resolved Hide resolved
wandb-scim/users.py Outdated Show resolved Hide resolved
wandb-scim/users.py Outdated Show resolved Hide resolved
wandb-scim/users.py Outdated Show resolved Hide resolved
@velotioaastha velotioaastha requested a review from abhinavg6 May 6, 2024 07:48
Copy link

@abhinavg6 abhinavg6 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the changes. Requested more changes. I think some are repeat from last time.

wandb-scim/custom_roles.py Outdated Show resolved Hide resolved
wandb-scim/custom_roles.py Outdated Show resolved Hide resolved
wandb-scim/custom_roles.py Outdated Show resolved Hide resolved
wandb-scim/custom_roles.py Show resolved Hide resolved
wandb-scim/custom_roles.py Outdated Show resolved Hide resolved
wandb-scim/teams.py Outdated Show resolved Hide resolved
wandb-scim/teams.py Outdated Show resolved Hide resolved
wandb-scim/teams.py Outdated Show resolved Hide resolved
wandb-scim/teams.py Outdated Show resolved Hide resolved
wandb-scim/users.py Show resolved Hide resolved
@velotioaastha velotioaastha requested a review from abhinavg6 May 7, 2024 09:09
Copy link

@abhinavg6 abhinavg6 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@abhinavg6 abhinavg6 merged commit 064b8be into master May 7, 2024
2 checks passed
@velotioaastha velotioaastha deleted the wandb-scim-py branch May 8, 2024 06:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants