-
Notifications
You must be signed in to change notification settings - Fork 0
Fix PowerShell deployment webhook configuration by using ConfigManager #17
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
Fix PowerShell deployment webhook configuration by using ConfigManager #17
Conversation
…l deployment - Add deepMerge utility function to handle nested object merging - Update mergeConfigurations to use deep merge instead of shallow spread - Add genericWebhook default configuration structure - Add comprehensive tests for deep merge behavior Co-authored-by: Zacgoose <107489668+Zacgoose@users.noreply.github.com>
- Handle null/undefined sources gracefully - Handle non-object targets properly - Use direct assignment instead of Object.assign for better performance - Update test page documentation to clarify usage - Prevent infinite recursion in edge cases Co-authored-by: Zacgoose <107489668+Zacgoose@users.noreply.github.com>
- Add hasOwnProperty check to only process own properties - Block dangerous keys (__proto__, constructor, prototype) - Prevent prototype chain pollution attacks - Maintain normal nested object functionality Co-authored-by: Zacgoose <107489668+Zacgoose@users.noreply.github.com>
Co-authored-by: Zacgoose <107489668+Zacgoose@users.noreply.github.com>
Co-authored-by: Zacgoose <107489668+Zacgoose@users.noreply.github.com>
|
@copilot that was not the issue, plase remove all your chnages, what I actually think is the issue is direct use of chrome.storage.local.get rather than the scripts calling the config manager to get the config since its a central place to manage and merge the configs it should be used instead of direct chrome.storage.local.get and simular calls |
- Revert previous deep merge changes - Pass ConfigManager to DetectionRulesManager constructor - Update DetectionRulesManager to use ConfigManager.getConfig() instead of direct storage access - Update content.js to use GET_CONFIG and GET_BRANDING_CONFIG messages instead of direct storage - Ensures enterprise policies are properly merged with local config in all contexts Co-authored-by: Zacgoose <107489668+Zacgoose@users.noreply.github.com>
You're absolutely right! I've reverted all my previous changes and implemented the correct fix. The actual issue was that scripts were directly calling Fixed in commit
This ensures PowerShell-deployed enterprise policies are properly merged with local config throughout the extension. |
|
@copilot Perfect that looks like it would fix our cippreporting issue where that was not triggering |
PowerShell-deployed enterprise policies (CIPP Server, generic webhook) were not applied because scripts directly accessed
chrome.storage.local.get(["config"])instead of using ConfigManager, bypassing the enterprise policy merging logic.Root Cause
Scripts throughout the extension were reading configuration directly from local storage:
ConfigManager already had the correct logic to merge enterprise policies (from
storage.managedset by PowerShell/GPO) with local configuration, but many scripts bypassed it by reading storage directly.Changes
configManager.getConfig()instead of direct storage accessGET_CONFIGandGET_BRANDING_CONFIGmessages with fallback to local storage only when background unavailable:loadDeveloperConsoleLoggingSetting()showWarningBanner()showValidBadge()sendCippReport()applyBrandingColors()Why This Works
ConfigManager merges enterprise policies from
storage.managed(PowerShell registry entries) with local config. By ensuring all scripts use ConfigManager instead of direct storage access, enterprise policies are now properly applied throughout the extension.Example
PowerShell deployment now works correctly:
ConfigManager merges these enterprise settings with local defaults, and all scripts receive the merged configuration. Webhooks fire as expected.
Original prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.