Repository navigation
feat: cap role description length and update timestamp on permission drops #679
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -249,7 +249,7 @@ class CreateCustomRoleSerializer(serializers.Serializer): # pylint: disable=abs | |
| """ | ||
|
|
||
| display_name = StrictCharField() | ||
| description = serializers.CharField(required=False, default="", allow_blank=True) | ||
| description = serializers.CharField(required=False, default="", allow_blank=True, max_length=500) | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should we also enforce this limit at the python API level at create_custom_role and update_custom_role in api/custom_roles.py? what do you think? |
||
| scope_types = serializers.ListField( | ||
| child=serializers.ChoiceField(choices=ScopesTypeField.values()), | ||
| min_length=1, | ||
|
|
@@ -268,7 +268,7 @@ class UpdateCustomRoleSerializer(serializers.Serializer): # pylint: disable=abs | |
|
|
||
| FIXED_FIELDS = ("display_name", "scope_types") | ||
|
|
||
| description = serializers.CharField(required=False, allow_blank=True) | ||
| description = serializers.CharField(required=False, allow_blank=True, max_length=500) | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Also, should we make this 500 a constant to avoid repeating it several times? |
||
| permissions = serializers.ListField(child=serializers.CharField(), required=False) | ||
|
|
||
| def validate(self, attrs: dict) -> dict: | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.