We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents cca1079 + b803ae2 commit fb19128Copy full SHA for fb19128
libs/labelbox/src/labelbox/schema/api_key.py
@@ -324,7 +324,9 @@ def create_api_key(
324
raise ValueError("role must be a Role object or a valid role name")
325
326
allowed_roles = ApiKey._get_available_api_key_roles(client)
327
- if role_name not in allowed_roles:
+ # Normalize the allowed roles to lowercase for case-insensitive comparison
328
+ normalized_allowed_roles = [r.lower() for r in allowed_roles]
329
+ if role_name.lower() not in normalized_allowed_roles:
330
raise ValueError(
331
f"Invalid role specified. Allowed roles are: {allowed_roles}"
332
)
0 commit comments