-
Notifications
You must be signed in to change notification settings - Fork 90
Add default retention policy #623
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: Development
Are you sure you want to change the base?
Conversation
| if days == 1: | ||
| return '1 day' | ||
| elif days == 21: | ||
| return '21 days (3 weeks)' | ||
| elif days == 90: | ||
| return '90 days (3 months)' | ||
| elif days == 180: | ||
| return '180 days (6 months)' | ||
| elif days == 365: | ||
| return '365 days (1 year)' | ||
| elif days == 730: | ||
| return '730 days (2 years)' | ||
| else: | ||
| return f'{days} days' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks like we have these set here, but also in the javascript. We should consider condensing it down into a single source, creating an api call, from the UI to get this since we need it in both areas. Managing it in two places it never good.
|
|
||
| cosmos_user_settings_container.upsert_item(user) | ||
| personal_count += 1 | ||
| except Exception as e: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should consider logging these with log_event, especially since they are admin events.
| cosmos_public_workspaces_container.upsert_item(workspace) | ||
| public_count += 1 | ||
| except Exception as e: | ||
| debug_print(f"Error updating public workspace {workspace_id}: {e}") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here with log_event
| log_event(f"Force push retention defaults failed: {e}", level=logging.ERROR) | ||
| return jsonify({ | ||
| 'success': False, | ||
| 'error': f'Failed to push retention defaults: {str(e)}' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
CodeQL may tag this as a high security vulnerability because it potentially exposes error information to end users. I disagree strictly because it is an admin endpoint, but we should watch for it.
Bionic711
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nothing needed to stop the PR, but a couple notes to do in a future push.
activity_logscontainer for audit purposes with admin info, affected scopes, and results summary./api/retention-policy/defaults/<workspace_type>(GET) and/api/admin/retention-policy/force-push(POST) endpoints.functions_settings.py,admin_settings.html,route_frontend_admin_settings.py,route_backend_retention_policy.py,functions_retention_policy.py,functions_activity_logging.py,profile.html,control_center.html,workspace-manager.js.