-
Notifications
You must be signed in to change notification settings - Fork 12
feat: site sandbox configuration #941
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?
Conversation
- Add sandboxAudits attribute to global configuration schema - Add helper methods for managing sandbox audit configurations - Enable sandbox sites to override regular audit handler settings
This PR will trigger a minor release when merged. |
… sandboxAudits - Replace this.state.sandboxAudits with this.getSandboxAudits() and this.setSandboxAudits() - Fix updateSandboxAuditConfig, getSandboxAuditConfig, getEnabledSandboxAudits, and removeSandboxAuditConfig methods - Ensure sandbox audit configurations persist properly in database - Add comprehensive logging for debugging sandbox audit operations
efff862
to
4f00e5e
Compare
- Add comprehensive documentation for the sandbox audit configuration update method - Ensure clear understanding of method purpose and functionality
437e0f8
to
0b776e1
Compare
…oi schema validation.
- Update updateSandboxAuditConfig to properly handle null values for removal - Simplify schema validation to only require 'enabled' (boolean) and 'expire' (string/number) - Allow additional properties for future extensibility - Update tests to match new simplified schema and removal behavior This ensures sandbox audit configurations can be properly removed by passing null values.
- Add sandbox audit methods to Configuration model - Support updateSandboxAuditConfig, getSandboxAudits, etc. - Fix regex pattern for audit type validation - Simplify validation logic (remove null/undefined bypass) - Remove auto-enable logic for sandbox sites - Add comprehensive test coverage
- Rollback package-lock.json version updates - Rollback unrelated test changes in audit/site models - Rollback url-helpers.js export addition - Remove unrelated test files (adobe-fetch.test.js, test-rum.js) - Keep PR focused only on sandbox audit configuration
- Remove fix-entity.schema.test.js (99 lines, unrelated) - Remove trial-user.schema.test.js (73 lines, unrelated) - Keep feature branch focused only on sandbox configuration
…uration - Update configuration schema to use cooldownHours instead of expire - Update tests to reflect the new cooldownHours field - Improve clarity: cooldownHours better describes the rate limiting behavior - All tests passing with 100% coverage
- Restore original 768+ line API documentation file - No functional changes to sandbox configuration feature - Keep spacecat-shared focused on our sandbox changes only
|
||
// Get all enabled sandbox audit types | ||
getEnabledSandboxAudits() { | ||
return Object.keys(this.getSandboxAudits() || {}); |
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.
Shouldn't the list be filtered by enabled true, according to the schema https://github.com/adobe/spacecat-shared/pull/941/files#diff-ec6a8162056224108b6fc55e86bf6d58298ed01c9cd75a0bb024369f6356b49bR52 ?
Same for isAuditEnabledForSandbox
below.
Add Sandbox Audit Configuration API
Problem
Need centralized control over sandbox audit execution:
Solution
Adds global sandbox audit configuration with full API support:
sandboxAudits
attribute in Configuration model for centralized control/configurations/sandbox
API endpoint for runtime updatesChanges
spacecat-shared (Configuration Model):
getSandboxAudits()
,setSandboxAudits()
,getSandboxAuditConfig(auditType)
updateSandboxAuditConfig(auditType, config)
for updatesisAuditEnabledForSandbox(auditType)
,hasSandboxAudits()
helpersgetEnabledSandboxAudits()
for listing enabled audit typesAPI Usage