-
Couldn't load subscription status.
- Fork 11
feat: add sandbox configuration update API #1230
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
a34293f to
1958320
Compare
|
This PR will trigger a minor release when merged. |
f31281e to
d07c146
Compare
- Add PATCH /configurations/sandbox endpoint for updating sandbox audit configurations - Implement updateSandboxConfig method in ConfigurationController with admin access control
d07c146 to
2129b15
Compare
- Add updateSandboxConfig method to configuration controller - Update sandbox audit configurations using spacecat-shared methods - Add comprehensive tests for all scenarios including success and error paths - Achieve 99.96% coverage (remaining 0.04% from pre-existing uncovered paths) - Fix function coverage by replacing arrow functions with method references
01dea9f to
1356e41
Compare
1356e41 to
28edfe3
Compare
325943b to
615bef8
Compare
…ss with hasSandboxAudits() method
| "@adobe/spacecat-shared-athena-client": "1.3.0", | ||
| "@adobe/spacecat-shared-brand-client": "1.1.20", | ||
| "@adobe/spacecat-shared-data-access": "2.58.0", | ||
| "@adobe/spacecat-shared-data-access": "https://gitpkg.now.sh/adobe/spacecat-shared/packages/spacecat-shared-data-access?feature/site-sandbox-configuration", |
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.
Will remove this once spacecat shared configuration model is merged.
- Add PATCH /configurations/sandbox endpoint - Support updating sandbox audit configurations for multiple audit types - Simplify validation to basic input checking (spacecat-shared handles business rules) - Remove complex validation and excessive logging
… API - Update OpenAPI documentation to use cooldownHours instead of expire - Update test cases to use cooldownHours for better clarity - Add comprehensive OpenAPI documentation for sandbox configuration endpoint - Improve API clarity: cooldownHours better describes rate limiting behavior - All tests passing with 100% coverage
…ion updates - spacecat-shared merged with sandbox configuration model updates - redeploy needed to get updated dependencies with updateSandboxAuditConfig method
be95367 to
f5b6598
Compare
|
|
||
| const { sandboxConfigs } = context.data || {}; | ||
|
|
||
| if (!sandboxConfigs || typeof sandboxConfigs !== 'object') { |
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.
could use isObject or even isNonEmptyObject from spacecat-shared-utils
Add Sandbox Configuration API
Problem
Need API endpoint to manage sandbox audit settings without code deployments.
Solution
Adds
PATCH /configurations/sandboxendpoint for runtime sandbox audit management.Changes
New API Endpoint:
PATCH /configurations/sandbox- Update sandbox audit configurationx-api-keyauthentication{ sandboxConfigs: { "audit-type": { cooldownHours: "3", enabled: true } } }Controller Updates:
ConfigurationController.updateSandboxConfig()methodAPI Documentation:
configuration-api.yamlOther:
ConfigurationDtoto includesandboxAuditsin responsesUsage
PATCH /configurations/sandbox { "sandboxConfigs": { "meta-tags": { "cooldownHours": "3", "enabled": true } } }Testing
Note: Requires spacecat-shared Configuration model updates.


Testing