mcp-wordpress 2.4.2 → 2.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +124 -54
- package/bin/status.js +1 -1
- package/dist/cache/CacheInvalidation.d.ts +3 -1
- package/dist/cache/CacheInvalidation.d.ts.map +1 -1
- package/dist/cache/CacheInvalidation.js +10 -4
- package/dist/cache/CacheInvalidation.js.map +1 -1
- package/dist/cache/CacheManager.d.ts +3 -2
- package/dist/cache/CacheManager.d.ts.map +1 -1
- package/dist/cache/CacheManager.js +11 -3
- package/dist/cache/CacheManager.js.map +1 -1
- package/dist/cache/HttpCacheWrapper.d.ts +7 -6
- package/dist/cache/HttpCacheWrapper.d.ts.map +1 -1
- package/dist/cache/HttpCacheWrapper.js +8 -5
- package/dist/cache/HttpCacheWrapper.js.map +1 -1
- package/dist/cache/index.d.ts +3 -3
- package/dist/cache/index.d.ts.map +1 -1
- package/dist/cache/index.js +1 -1
- package/dist/cache/index.js.map +1 -1
- package/dist/client/CachedWordPressClient.d.ts +23 -9
- package/dist/client/CachedWordPressClient.d.ts.map +1 -1
- package/dist/client/CachedWordPressClient.js +4 -1
- package/dist/client/CachedWordPressClient.js.map +1 -1
- package/dist/client/MockWordPressClient.d.ts +2 -1
- package/dist/client/MockWordPressClient.d.ts.map +1 -1
- package/dist/client/MockWordPressClient.js +3 -1
- package/dist/client/MockWordPressClient.js.map +1 -1
- package/dist/client/api.d.ts +17 -13
- package/dist/client/api.d.ts.map +1 -1
- package/dist/client/api.js +135 -30
- package/dist/client/api.js.map +1 -1
- package/dist/client/auth.d.ts.map +1 -1
- package/dist/client/auth.js +2 -3
- package/dist/client/auth.js.map +1 -1
- package/dist/client/managers/AuthenticationManager.d.ts +55 -2
- package/dist/client/managers/AuthenticationManager.d.ts.map +1 -1
- package/dist/client/managers/AuthenticationManager.js +269 -71
- package/dist/client/managers/AuthenticationManager.js.map +1 -1
- package/dist/client/managers/BaseManager.d.ts +3 -3
- package/dist/client/managers/BaseManager.d.ts.map +1 -1
- package/dist/client/managers/BaseManager.js +11 -5
- package/dist/client/managers/BaseManager.js.map +1 -1
- package/dist/client/managers/RequestManager.d.ts +2 -2
- package/dist/client/managers/RequestManager.d.ts.map +1 -1
- package/dist/client/managers/RequestManager.js +25 -12
- package/dist/client/managers/RequestManager.js.map +1 -1
- package/dist/config/Config.d.ts +155 -0
- package/dist/config/Config.d.ts.map +1 -0
- package/dist/config/Config.js +215 -0
- package/dist/config/Config.js.map +1 -0
- package/dist/config/ConfigurationSchema.d.ts +21 -21
- package/dist/config/ConfigurationSchema.d.ts.map +1 -1
- package/dist/config/ConfigurationSchema.js +19 -2
- package/dist/config/ConfigurationSchema.js.map +1 -1
- package/dist/config/ServerConfiguration.d.ts +2 -1
- package/dist/config/ServerConfiguration.d.ts.map +1 -1
- package/dist/config/ServerConfiguration.js +73 -43
- package/dist/config/ServerConfiguration.js.map +1 -1
- package/dist/docs/DocumentationGenerator.d.ts +9 -8
- package/dist/docs/DocumentationGenerator.d.ts.map +1 -1
- package/dist/docs/DocumentationGenerator.js +10 -7
- package/dist/docs/DocumentationGenerator.js.map +1 -1
- package/dist/docs/MarkdownFormatter.d.ts.map +1 -1
- package/dist/docs/MarkdownFormatter.js +3 -2
- package/dist/docs/MarkdownFormatter.js.map +1 -1
- package/dist/dxt-entry.js +15 -14
- package/dist/dxt-entry.js.map +1 -1
- package/dist/index.d.ts +3 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +37 -21
- package/dist/index.js.map +1 -1
- package/dist/performance/MetricsCollector.d.ts +13 -7
- package/dist/performance/MetricsCollector.d.ts.map +1 -1
- package/dist/performance/MetricsCollector.js +69 -27
- package/dist/performance/MetricsCollector.js.map +1 -1
- package/dist/performance/PerformanceAnalytics.d.ts +8 -2
- package/dist/performance/PerformanceAnalytics.d.ts.map +1 -1
- package/dist/performance/PerformanceAnalytics.js +17 -47
- package/dist/performance/PerformanceAnalytics.js.map +1 -1
- package/dist/performance/PerformanceMonitor.d.ts +2 -1
- package/dist/performance/PerformanceMonitor.d.ts.map +1 -1
- package/dist/performance/PerformanceMonitor.js +12 -13
- package/dist/performance/PerformanceMonitor.js.map +1 -1
- package/dist/performance/index.d.ts +2 -2
- package/dist/performance/index.d.ts.map +1 -1
- package/dist/security/AISecurityScanner.d.ts +1 -0
- package/dist/security/AISecurityScanner.d.ts.map +1 -1
- package/dist/security/AISecurityScanner.js +22 -12
- package/dist/security/AISecurityScanner.js.map +1 -1
- package/dist/security/AutomatedRemediation.d.ts +4 -3
- package/dist/security/AutomatedRemediation.d.ts.map +1 -1
- package/dist/security/AutomatedRemediation.js +46 -15
- package/dist/security/AutomatedRemediation.js.map +1 -1
- package/dist/security/InputValidator.d.ts +13 -9
- package/dist/security/InputValidator.d.ts.map +1 -1
- package/dist/security/InputValidator.js +4 -2
- package/dist/security/InputValidator.js.map +1 -1
- package/dist/security/SecurityCIPipeline.d.ts +1 -1
- package/dist/security/SecurityCIPipeline.d.ts.map +1 -1
- package/dist/security/SecurityCIPipeline.js +38 -29
- package/dist/security/SecurityCIPipeline.js.map +1 -1
- package/dist/security/SecurityConfig.d.ts +3 -3
- package/dist/security/SecurityConfig.d.ts.map +1 -1
- package/dist/security/SecurityConfig.js +13 -9
- package/dist/security/SecurityConfig.js.map +1 -1
- package/dist/security/SecurityConfigManager.d.ts +2 -2
- package/dist/security/SecurityConfigManager.d.ts.map +1 -1
- package/dist/security/SecurityConfigManager.js +20 -15
- package/dist/security/SecurityConfigManager.js.map +1 -1
- package/dist/security/SecurityMonitoring.d.ts +2 -2
- package/dist/security/SecurityMonitoring.d.ts.map +1 -1
- package/dist/security/SecurityMonitoring.js +19 -17
- package/dist/security/SecurityMonitoring.js.map +1 -1
- package/dist/security/SecurityReviewer.d.ts.map +1 -1
- package/dist/security/SecurityReviewer.js +10 -7
- package/dist/security/SecurityReviewer.js.map +1 -1
- package/dist/security/index.d.ts +24 -23
- package/dist/security/index.d.ts.map +1 -1
- package/dist/security/index.js +52 -23
- package/dist/security/index.js.map +1 -1
- package/dist/server/ConnectionTester.d.ts +12 -4
- package/dist/server/ConnectionTester.d.ts.map +1 -1
- package/dist/server/ConnectionTester.js +96 -22
- package/dist/server/ConnectionTester.js.map +1 -1
- package/dist/server/ToolRegistry.d.ts +2 -2
- package/dist/server/ToolRegistry.d.ts.map +1 -1
- package/dist/server/ToolRegistry.js +10 -5
- package/dist/server/ToolRegistry.js.map +1 -1
- package/dist/src/cache/CacheInvalidation.d.ts +120 -0
- package/dist/src/cache/CacheInvalidation.d.ts.map +1 -0
- package/dist/src/cache/CacheInvalidation.js +355 -0
- package/dist/src/cache/CacheInvalidation.js.map +1 -0
- package/dist/src/cache/CacheManager.d.ts +149 -0
- package/dist/src/cache/CacheManager.d.ts.map +1 -0
- package/dist/src/cache/CacheManager.js +326 -0
- package/dist/src/cache/CacheManager.js.map +1 -0
- package/dist/src/cache/HttpCacheWrapper.d.ts +122 -0
- package/dist/src/cache/HttpCacheWrapper.d.ts.map +1 -0
- package/dist/src/cache/HttpCacheWrapper.js +283 -0
- package/dist/src/cache/HttpCacheWrapper.js.map +1 -0
- package/dist/src/cache/index.d.ts +12 -0
- package/dist/src/cache/index.d.ts.map +1 -0
- package/dist/src/cache/index.js +9 -0
- package/dist/src/cache/index.js.map +1 -0
- package/dist/src/client/CachedWordPressClient.d.ts +174 -0
- package/dist/src/client/CachedWordPressClient.d.ts.map +1 -0
- package/dist/src/client/CachedWordPressClient.js +345 -0
- package/dist/src/client/CachedWordPressClient.js.map +1 -0
- package/dist/src/client/MockWordPressClient.d.ts +56 -0
- package/dist/src/client/MockWordPressClient.d.ts.map +1 -0
- package/dist/src/client/MockWordPressClient.js +371 -0
- package/dist/src/client/MockWordPressClient.js.map +1 -0
- package/dist/src/client/api.d.ts +235 -0
- package/dist/src/client/api.d.ts.map +1 -0
- package/dist/src/client/api.js +896 -0
- package/dist/src/client/api.js.map +1 -0
- package/dist/src/client/auth.d.ts +121 -0
- package/dist/src/client/auth.d.ts.map +1 -0
- package/dist/src/client/auth.js +429 -0
- package/dist/src/client/auth.js.map +1 -0
- package/dist/src/client/managers/AuthenticationManager.d.ts +92 -0
- package/dist/src/client/managers/AuthenticationManager.d.ts.map +1 -0
- package/dist/src/client/managers/AuthenticationManager.js +369 -0
- package/dist/src/client/managers/AuthenticationManager.js.map +1 -0
- package/dist/src/client/managers/BaseManager.d.ts +22 -0
- package/dist/src/client/managers/BaseManager.d.ts.map +1 -0
- package/dist/src/client/managers/BaseManager.js +53 -0
- package/dist/src/client/managers/BaseManager.js.map +1 -0
- package/dist/src/client/managers/RequestManager.d.ts +47 -0
- package/dist/src/client/managers/RequestManager.d.ts.map +1 -0
- package/dist/src/client/managers/RequestManager.js +193 -0
- package/dist/src/client/managers/RequestManager.js.map +1 -0
- package/dist/src/client/managers/index.d.ts +8 -0
- package/dist/src/client/managers/index.d.ts.map +1 -0
- package/dist/src/client/managers/index.js +8 -0
- package/dist/src/client/managers/index.js.map +1 -0
- package/dist/src/config/Config.d.ts +155 -0
- package/dist/src/config/Config.d.ts.map +1 -0
- package/dist/src/config/Config.js +215 -0
- package/dist/src/config/Config.js.map +1 -0
- package/dist/src/config/ConfigurationSchema.d.ts +281 -0
- package/dist/src/config/ConfigurationSchema.d.ts.map +1 -0
- package/dist/src/config/ConfigurationSchema.js +205 -0
- package/dist/src/config/ConfigurationSchema.js.map +1 -0
- package/dist/src/config/ServerConfiguration.d.ts +47 -0
- package/dist/src/config/ServerConfiguration.d.ts.map +1 -0
- package/dist/src/config/ServerConfiguration.js +255 -0
- package/dist/src/config/ServerConfiguration.js.map +1 -0
- package/dist/src/docs/DocumentationGenerator.d.ts +185 -0
- package/dist/src/docs/DocumentationGenerator.d.ts.map +1 -0
- package/dist/src/docs/DocumentationGenerator.js +777 -0
- package/dist/src/docs/DocumentationGenerator.js.map +1 -0
- package/dist/src/docs/MarkdownFormatter.d.ts +84 -0
- package/dist/src/docs/MarkdownFormatter.d.ts.map +1 -0
- package/dist/src/docs/MarkdownFormatter.js +458 -0
- package/dist/src/docs/MarkdownFormatter.js.map +1 -0
- package/dist/src/docs/index.d.ts +8 -0
- package/dist/src/docs/index.d.ts.map +1 -0
- package/dist/src/docs/index.js +7 -0
- package/dist/src/docs/index.js.map +1 -0
- package/dist/src/dxt-entry.d.ts +6 -0
- package/dist/src/dxt-entry.d.ts.map +1 -0
- package/dist/src/dxt-entry.js +39 -0
- package/dist/src/dxt-entry.js.map +1 -0
- package/dist/src/index.d.ts +18 -0
- package/dist/src/index.d.ts.map +1 -0
- package/dist/src/index.js +143 -0
- package/dist/src/index.js.map +1 -0
- package/dist/src/performance/MetricsCollector.d.ts +145 -0
- package/dist/src/performance/MetricsCollector.d.ts.map +1 -0
- package/dist/src/performance/MetricsCollector.js +368 -0
- package/dist/src/performance/MetricsCollector.js.map +1 -0
- package/dist/src/performance/PerformanceAnalytics.d.ts +168 -0
- package/dist/src/performance/PerformanceAnalytics.d.ts.map +1 -0
- package/dist/src/performance/PerformanceAnalytics.js +570 -0
- package/dist/src/performance/PerformanceAnalytics.js.map +1 -0
- package/dist/src/performance/PerformanceMonitor.d.ts +203 -0
- package/dist/src/performance/PerformanceMonitor.d.ts.map +1 -0
- package/dist/src/performance/PerformanceMonitor.js +478 -0
- package/dist/src/performance/PerformanceMonitor.js.map +1 -0
- package/dist/src/performance/index.d.ts +11 -0
- package/dist/src/performance/index.d.ts.map +1 -0
- package/dist/src/performance/index.js +8 -0
- package/dist/src/performance/index.js.map +1 -0
- package/dist/src/security/AISecurityScanner.d.ts +176 -0
- package/dist/src/security/AISecurityScanner.d.ts.map +1 -0
- package/dist/src/security/AISecurityScanner.js +655 -0
- package/dist/src/security/AISecurityScanner.js.map +1 -0
- package/dist/src/security/AutomatedRemediation.d.ts +146 -0
- package/dist/src/security/AutomatedRemediation.d.ts.map +1 -0
- package/dist/src/security/AutomatedRemediation.js +566 -0
- package/dist/src/security/AutomatedRemediation.js.map +1 -0
- package/dist/src/security/InputValidator.d.ts +219 -0
- package/dist/src/security/InputValidator.d.ts.map +1 -0
- package/dist/src/security/InputValidator.js +295 -0
- package/dist/src/security/InputValidator.js.map +1 -0
- package/dist/src/security/SecurityCIPipeline.d.ts +213 -0
- package/dist/src/security/SecurityCIPipeline.d.ts.map +1 -0
- package/dist/src/security/SecurityCIPipeline.js +693 -0
- package/dist/src/security/SecurityCIPipeline.js.map +1 -0
- package/dist/src/security/SecurityConfig.d.ts +129 -0
- package/dist/src/security/SecurityConfig.d.ts.map +1 -0
- package/dist/src/security/SecurityConfig.js +266 -0
- package/dist/src/security/SecurityConfig.js.map +1 -0
- package/dist/src/security/SecurityConfigManager.d.ts +294 -0
- package/dist/src/security/SecurityConfigManager.d.ts.map +1 -0
- package/dist/src/security/SecurityConfigManager.js +558 -0
- package/dist/src/security/SecurityConfigManager.js.map +1 -0
- package/dist/src/security/SecurityMonitoring.d.ts +245 -0
- package/dist/src/security/SecurityMonitoring.d.ts.map +1 -0
- package/dist/src/security/SecurityMonitoring.js +598 -0
- package/dist/src/security/SecurityMonitoring.js.map +1 -0
- package/dist/src/security/SecurityReviewer.d.ts +168 -0
- package/dist/src/security/SecurityReviewer.d.ts.map +1 -0
- package/dist/src/security/SecurityReviewer.js +686 -0
- package/dist/src/security/SecurityReviewer.js.map +1 -0
- package/dist/src/security/index.d.ts +183 -0
- package/dist/src/security/index.d.ts.map +1 -0
- package/dist/src/security/index.js +218 -0
- package/dist/src/security/index.js.map +1 -0
- package/dist/src/server/ConnectionTester.d.ts +32 -0
- package/dist/src/server/ConnectionTester.d.ts.map +1 -0
- package/dist/src/server/ConnectionTester.js +135 -0
- package/dist/src/server/ConnectionTester.js.map +1 -0
- package/dist/src/server/ToolRegistry.d.ts +50 -0
- package/dist/src/server/ToolRegistry.d.ts.map +1 -0
- package/dist/src/server/ToolRegistry.js +219 -0
- package/dist/src/server/ToolRegistry.js.map +1 -0
- package/dist/src/server.d.ts +7 -0
- package/dist/src/server.d.ts.map +1 -0
- package/dist/src/server.js +7 -0
- package/dist/src/server.js.map +1 -0
- package/dist/src/tools/BaseToolManager.d.ts +62 -0
- package/dist/src/tools/BaseToolManager.d.ts.map +1 -0
- package/dist/src/tools/BaseToolManager.js +195 -0
- package/dist/src/tools/BaseToolManager.js.map +1 -0
- package/dist/src/tools/auth.d.ts +50 -0
- package/dist/src/tools/auth.d.ts.map +1 -0
- package/dist/src/tools/auth.js +133 -0
- package/dist/src/tools/auth.js.map +1 -0
- package/dist/src/tools/cache.d.ts +260 -0
- package/dist/src/tools/cache.d.ts.map +1 -0
- package/dist/src/tools/cache.js +232 -0
- package/dist/src/tools/cache.js.map +1 -0
- package/dist/src/tools/comments.d.ts +33 -0
- package/dist/src/tools/comments.d.ts.map +1 -0
- package/dist/src/tools/comments.js +235 -0
- package/dist/src/tools/comments.js.map +1 -0
- package/dist/src/tools/index.d.ts +11 -0
- package/dist/src/tools/index.d.ts.map +1 -0
- package/dist/src/tools/index.js +11 -0
- package/dist/src/tools/index.js.map +1 -0
- package/dist/src/tools/media.d.ts +70 -0
- package/dist/src/tools/media.d.ts.map +1 -0
- package/dist/src/tools/media.js +248 -0
- package/dist/src/tools/media.js.map +1 -0
- package/dist/src/tools/pages.d.ts +32 -0
- package/dist/src/tools/pages.d.ts.map +1 -0
- package/dist/src/tools/pages.js +215 -0
- package/dist/src/tools/pages.js.map +1 -0
- package/dist/src/tools/performance.d.ts +73 -0
- package/dist/src/tools/performance.d.ts.map +1 -0
- package/dist/src/tools/performance.js +922 -0
- package/dist/src/tools/performance.js.map +1 -0
- package/dist/src/tools/posts/PostHandlers.d.ts +46 -0
- package/dist/src/tools/posts/PostHandlers.d.ts.map +1 -0
- package/dist/src/tools/posts/PostHandlers.js +400 -0
- package/dist/src/tools/posts/PostHandlers.js.map +1 -0
- package/dist/src/tools/posts/PostToolDefinitions.d.ts +37 -0
- package/dist/src/tools/posts/PostToolDefinitions.d.ts.map +1 -0
- package/dist/src/tools/posts/PostToolDefinitions.js +236 -0
- package/dist/src/tools/posts/PostToolDefinitions.js.map +1 -0
- package/dist/src/tools/posts/index.d.ts +138 -0
- package/dist/src/tools/posts/index.d.ts.map +1 -0
- package/dist/src/tools/posts/index.js +163 -0
- package/dist/src/tools/posts/index.js.map +1 -0
- package/dist/src/tools/posts.d.ts +15 -0
- package/dist/src/tools/posts.d.ts.map +1 -0
- package/dist/src/tools/posts.js +16 -0
- package/dist/src/tools/posts.js.map +1 -0
- package/dist/src/tools/site.d.ts +32 -0
- package/dist/src/tools/site.d.ts.map +1 -0
- package/dist/src/tools/site.js +234 -0
- package/dist/src/tools/site.js.map +1 -0
- package/dist/src/tools/taxonomies.d.ts +36 -0
- package/dist/src/tools/taxonomies.d.ts.map +1 -0
- package/dist/src/tools/taxonomies.js +286 -0
- package/dist/src/tools/taxonomies.js.map +1 -0
- package/dist/src/tools/users.d.ts +33 -0
- package/dist/src/tools/users.d.ts.map +1 -0
- package/dist/src/tools/users.js +308 -0
- package/dist/src/tools/users.js.map +1 -0
- package/dist/src/types/client.d.ts +223 -0
- package/dist/src/types/client.d.ts.map +1 -0
- package/dist/src/types/client.js +97 -0
- package/dist/src/types/client.js.map +1 -0
- package/dist/src/types/enhanced.d.ts +237 -0
- package/dist/src/types/enhanced.d.ts.map +1 -0
- package/dist/src/types/enhanced.js +49 -0
- package/dist/src/types/enhanced.js.map +1 -0
- package/dist/src/types/index.d.ts +160 -0
- package/dist/src/types/index.d.ts.map +1 -0
- package/dist/src/types/index.js +14 -0
- package/dist/src/types/index.js.map +1 -0
- package/dist/src/types/mcp.d.ts +178 -0
- package/dist/src/types/mcp.d.ts.map +1 -0
- package/dist/src/types/mcp.js +7 -0
- package/dist/src/types/mcp.js.map +1 -0
- package/dist/src/types/requests.d.ts +322 -0
- package/dist/src/types/requests.d.ts.map +1 -0
- package/dist/src/types/requests.js +8 -0
- package/dist/src/types/requests.js.map +1 -0
- package/dist/src/types/tools.d.ts +506 -0
- package/dist/src/types/tools.d.ts.map +1 -0
- package/dist/src/types/tools.js +8 -0
- package/dist/src/types/tools.js.map +1 -0
- package/dist/src/types/wordpress.d.ts +471 -0
- package/dist/src/types/wordpress.d.ts.map +1 -0
- package/dist/src/types/wordpress.js +14 -0
- package/dist/src/types/wordpress.js.map +1 -0
- package/dist/src/utils/debug.d.ts +71 -0
- package/dist/src/utils/debug.d.ts.map +1 -0
- package/dist/src/utils/debug.js +235 -0
- package/dist/src/utils/debug.js.map +1 -0
- package/dist/src/utils/enhancedError.d.ts +61 -0
- package/dist/src/utils/enhancedError.d.ts.map +1 -0
- package/dist/src/utils/enhancedError.js +221 -0
- package/dist/src/utils/enhancedError.js.map +1 -0
- package/dist/src/utils/error.d.ts +17 -0
- package/dist/src/utils/error.d.ts.map +1 -0
- package/dist/src/utils/error.js +108 -0
- package/dist/src/utils/error.js.map +1 -0
- package/dist/src/utils/logger.d.ts +106 -0
- package/dist/src/utils/logger.d.ts.map +1 -0
- package/dist/src/utils/logger.js +280 -0
- package/dist/src/utils/logger.js.map +1 -0
- package/dist/src/utils/streaming.d.ts +104 -0
- package/dist/src/utils/streaming.d.ts.map +1 -0
- package/dist/src/utils/streaming.js +331 -0
- package/dist/src/utils/streaming.js.map +1 -0
- package/dist/src/utils/toolWrapper.d.ts +42 -0
- package/dist/src/utils/toolWrapper.d.ts.map +1 -0
- package/dist/src/utils/toolWrapper.js +101 -0
- package/dist/src/utils/toolWrapper.js.map +1 -0
- package/dist/src/utils/validation/core.d.ts +21 -0
- package/dist/src/utils/validation/core.d.ts.map +1 -0
- package/dist/src/utils/validation/core.js +71 -0
- package/dist/src/utils/validation/core.js.map +1 -0
- package/dist/src/utils/validation/index.d.ts +25 -0
- package/dist/src/utils/validation/index.d.ts.map +1 -0
- package/dist/src/utils/validation/index.js +29 -0
- package/dist/src/utils/validation/index.js.map +1 -0
- package/dist/src/utils/validation/network.d.ts +19 -0
- package/dist/src/utils/validation/network.d.ts.map +1 -0
- package/dist/src/utils/validation/network.js +93 -0
- package/dist/src/utils/validation/network.js.map +1 -0
- package/dist/src/utils/validation/rateLimit.d.ts +21 -0
- package/dist/src/utils/validation/rateLimit.d.ts.map +1 -0
- package/dist/src/utils/validation/rateLimit.js +43 -0
- package/dist/src/utils/validation/rateLimit.js.map +1 -0
- package/dist/src/utils/validation/security.d.ts +29 -0
- package/dist/src/utils/validation/security.d.ts.map +1 -0
- package/dist/src/utils/validation/security.js +327 -0
- package/dist/src/utils/validation/security.js.map +1 -0
- package/dist/src/utils/validation/wordpress.d.ts +31 -0
- package/dist/src/utils/validation/wordpress.d.ts.map +1 -0
- package/dist/src/utils/validation/wordpress.js +146 -0
- package/dist/src/utils/validation/wordpress.js.map +1 -0
- package/dist/src/utils/validation.d.ts +15 -0
- package/dist/src/utils/validation.d.ts.map +1 -0
- package/dist/src/utils/validation.js +27 -0
- package/dist/src/utils/validation.js.map +1 -0
- package/dist/tests/vitest.setup.d.ts +6 -0
- package/dist/tests/vitest.setup.d.ts.map +1 -0
- package/dist/tests/vitest.setup.js +39 -0
- package/dist/tests/vitest.setup.js.map +1 -0
- package/dist/tools/BaseToolManager.d.ts +47 -11
- package/dist/tools/BaseToolManager.d.ts.map +1 -1
- package/dist/tools/BaseToolManager.js +168 -29
- package/dist/tools/BaseToolManager.js.map +1 -1
- package/dist/tools/auth.d.ts +16 -10
- package/dist/tools/auth.d.ts.map +1 -1
- package/dist/tools/auth.js +3 -2
- package/dist/tools/auth.js.map +1 -1
- package/dist/tools/cache.d.ts +30 -30
- package/dist/tools/cache.d.ts.map +1 -1
- package/dist/tools/cache.js +1 -6
- package/dist/tools/cache.js.map +1 -1
- package/dist/tools/comments.d.ts +20 -20
- package/dist/tools/comments.d.ts.map +1 -1
- package/dist/tools/comments.js +16 -9
- package/dist/tools/comments.js.map +1 -1
- package/dist/tools/media.d.ts +18 -16
- package/dist/tools/media.d.ts.map +1 -1
- package/dist/tools/media.js +16 -15
- package/dist/tools/media.js.map +1 -1
- package/dist/tools/pages.d.ts +19 -17
- package/dist/tools/pages.d.ts.map +1 -1
- package/dist/tools/pages.js +16 -12
- package/dist/tools/pages.js.map +1 -1
- package/dist/tools/performance.d.ts +11 -1
- package/dist/tools/performance.d.ts.map +1 -1
- package/dist/tools/performance.js +67 -34
- package/dist/tools/performance.js.map +1 -1
- package/dist/tools/posts/PostHandlers.d.ts +46 -0
- package/dist/tools/posts/PostHandlers.d.ts.map +1 -0
- package/dist/tools/posts/PostHandlers.js +400 -0
- package/dist/tools/posts/PostHandlers.js.map +1 -0
- package/dist/tools/posts/PostToolDefinitions.d.ts +37 -0
- package/dist/tools/posts/PostToolDefinitions.d.ts.map +1 -0
- package/dist/tools/posts/PostToolDefinitions.js +236 -0
- package/dist/tools/posts/PostToolDefinitions.js.map +1 -0
- package/dist/tools/posts/index.d.ts +138 -0
- package/dist/tools/posts/index.d.ts.map +1 -0
- package/dist/tools/posts/index.js +163 -0
- package/dist/tools/posts/index.js.map +1 -0
- package/dist/tools/posts.d.ts +10 -246
- package/dist/tools/posts.d.ts.map +1 -1
- package/dist/tools/posts.js +11 -723
- package/dist/tools/posts.js.map +1 -1
- package/dist/tools/site.d.ts +19 -18
- package/dist/tools/site.d.ts.map +1 -1
- package/dist/tools/site.js +14 -10
- package/dist/tools/site.js.map +1 -1
- package/dist/tools/taxonomies.d.ts +23 -24
- package/dist/tools/taxonomies.d.ts.map +1 -1
- package/dist/tools/taxonomies.js +24 -18
- package/dist/tools/taxonomies.js.map +1 -1
- package/dist/tools/users.d.ts +20 -15
- package/dist/tools/users.d.ts.map +1 -1
- package/dist/tools/users.js +12 -8
- package/dist/tools/users.js.map +1 -1
- package/dist/types/client.d.ts +48 -41
- package/dist/types/client.d.ts.map +1 -1
- package/dist/types/client.js +30 -5
- package/dist/types/client.js.map +1 -1
- package/dist/types/enhanced.d.ts +237 -0
- package/dist/types/enhanced.d.ts.map +1 -0
- package/dist/types/enhanced.js +49 -0
- package/dist/types/enhanced.js.map +1 -0
- package/dist/types/index.d.ts +15 -12
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/index.js +2 -0
- package/dist/types/index.js.map +1 -1
- package/dist/types/mcp.d.ts +12 -12
- package/dist/types/mcp.d.ts.map +1 -1
- package/dist/types/requests.d.ts +322 -0
- package/dist/types/requests.d.ts.map +1 -0
- package/dist/types/requests.js +8 -0
- package/dist/types/requests.js.map +1 -0
- package/dist/types/tools.d.ts +506 -0
- package/dist/types/tools.d.ts.map +1 -0
- package/dist/types/tools.js +8 -0
- package/dist/types/tools.js.map +1 -0
- package/dist/types/wordpress.d.ts +43 -15
- package/dist/types/wordpress.d.ts.map +1 -1
- package/dist/types/wordpress.js +8 -1
- package/dist/types/wordpress.js.map +1 -1
- package/dist/utils/debug.d.ts +19 -11
- package/dist/utils/debug.d.ts.map +1 -1
- package/dist/utils/debug.js +46 -10
- package/dist/utils/debug.js.map +1 -1
- package/dist/utils/enhancedError.d.ts +8 -8
- package/dist/utils/enhancedError.d.ts.map +1 -1
- package/dist/utils/enhancedError.js.map +1 -1
- package/dist/utils/error.d.ts +2 -4
- package/dist/utils/error.d.ts.map +1 -1
- package/dist/utils/error.js +42 -5
- package/dist/utils/error.js.map +1 -1
- package/dist/utils/logger.d.ts +106 -0
- package/dist/utils/logger.d.ts.map +1 -0
- package/dist/utils/logger.js +280 -0
- package/dist/utils/logger.js.map +1 -0
- package/dist/utils/streaming.d.ts +9 -9
- package/dist/utils/streaming.d.ts.map +1 -1
- package/dist/utils/streaming.js +71 -52
- package/dist/utils/streaming.js.map +1 -1
- package/dist/utils/toolWrapper.d.ts +9 -7
- package/dist/utils/toolWrapper.d.ts.map +1 -1
- package/dist/utils/toolWrapper.js.map +1 -1
- package/dist/utils/validation/core.d.ts +21 -0
- package/dist/utils/validation/core.d.ts.map +1 -0
- package/dist/utils/validation/core.js +71 -0
- package/dist/utils/validation/core.js.map +1 -0
- package/dist/utils/validation/index.d.ts +25 -0
- package/dist/utils/validation/index.d.ts.map +1 -0
- package/dist/utils/validation/index.js +29 -0
- package/dist/utils/validation/index.js.map +1 -0
- package/dist/utils/validation/network.d.ts +19 -0
- package/dist/utils/validation/network.d.ts.map +1 -0
- package/dist/utils/validation/network.js +93 -0
- package/dist/utils/validation/network.js.map +1 -0
- package/dist/utils/validation/rateLimit.d.ts +21 -0
- package/dist/utils/validation/rateLimit.d.ts.map +1 -0
- package/dist/utils/validation/rateLimit.js +43 -0
- package/dist/utils/validation/rateLimit.js.map +1 -0
- package/dist/utils/validation/security.d.ts +29 -0
- package/dist/utils/validation/security.d.ts.map +1 -0
- package/dist/utils/validation/security.js +327 -0
- package/dist/utils/validation/security.js.map +1 -0
- package/dist/utils/validation/wordpress.d.ts +31 -0
- package/dist/utils/validation/wordpress.d.ts.map +1 -0
- package/dist/utils/validation/wordpress.js +146 -0
- package/dist/utils/validation/wordpress.js.map +1 -0
- package/dist/utils/validation.d.ts +13 -82
- package/dist/utils/validation.d.ts.map +1 -1
- package/dist/utils/validation.js +25 -343
- package/dist/utils/validation.js.map +1 -1
- package/docs/BADGE_UPDATES.md +132 -0
- package/docs/CI_CD_IMPROVEMENTS.md +191 -0
- package/docs/INCREMENTAL_COVERAGE.md +183 -0
- package/docs/INSTALLATION.md +4 -2
- package/docs/TROUBLESHOOTING.md +2 -1
- package/docs/api/README.md +3 -1
- package/docs/api/openapi.json +5 -1
- package/docs/api/summary.json +1 -1
- package/docs/api/tools/wp_create_post.md +12 -14
- package/docs/developer/TESTING.md +24 -19
- package/docs/examples/claude-desktop-config.md +1 -1
- package/docs/examples/docker-production.md +100 -93
- package/docs/examples/multi-site-setup.md +5 -4
- package/docs/examples/single-site-setup.md +3 -4
- package/docs/examples/use-case-workflows.md +4 -5
- package/docs/integrations/claude-desktop.md +39 -34
- package/docs/integrations/cline.md +4 -4
- package/docs/integrations/vs-code.md +9 -8
- package/docs/user-guides/DXT_INSTALLATION.md +2 -1
- package/docs/user-guides/SMITHERY_SETUP.md +10 -10
- package/package.json +57 -39
- package/src/cache/CacheInvalidation.ts +12 -5
- package/src/cache/CacheManager.ts +18 -15
- package/src/cache/HttpCacheWrapper.ts +30 -59
- package/src/cache/__tests__/HttpCacheWrapper.test.ts +6 -5
- package/src/cache/index.ts +3 -14
- package/src/client/CachedWordPressClient.ts +32 -30
- package/src/client/MockWordPressClient.ts +4 -2
- package/src/client/api.ts +186 -64
- package/src/client/auth.ts +15 -40
- package/src/client/managers/AuthenticationManager.ts +337 -77
- package/src/client/managers/BaseManager.ts +18 -30
- package/src/client/managers/RequestManager.ts +39 -44
- package/src/config/Config.ts +308 -0
- package/src/config/ConfigurationSchema.ts +23 -2
- package/src/config/ServerConfiguration.ts +73 -49
- package/src/docs/DocumentationGenerator.ts +50 -39
- package/src/docs/MarkdownFormatter.ts +19 -29
- package/src/dxt-entry.cjs +26 -16
- package/src/dxt-entry.ts +17 -27
- package/src/index.ts +42 -28
- package/src/performance/MetricsCollector.ts +108 -86
- package/src/performance/PerformanceAnalytics.ts +69 -164
- package/src/performance/PerformanceMonitor.ts +32 -47
- package/src/performance/index.ts +2 -10
- package/src/security/AISecurityScanner.ts +22 -12
- package/src/security/AutomatedRemediation.ts +49 -18
- package/src/security/InputValidator.ts +9 -6
- package/src/security/SecurityCIPipeline.ts +53 -37
- package/src/security/SecurityConfig.ts +22 -22
- package/src/security/SecurityConfigManager.ts +23 -19
- package/src/security/SecurityMonitoring.ts +24 -21
- package/src/security/SecurityReviewer.ts +10 -7
- package/src/security/index.ts +64 -29
- package/src/server/ConnectionTester.ts +120 -31
- package/src/server/ToolRegistry.ts +31 -21
- package/src/tools/BaseToolManager.ts +286 -33
- package/src/tools/auth.ts +20 -8
- package/src/tools/cache.ts +5 -15
- package/src/tools/comments.ts +34 -48
- package/src/tools/media.ts +41 -53
- package/src/tools/pages.ts +32 -54
- package/src/tools/performance.ts +141 -176
- package/src/tools/posts/PostHandlers.ts +474 -0
- package/src/tools/posts/PostToolDefinitions.ts +250 -0
- package/src/tools/posts/index.ts +192 -0
- package/src/tools/posts.ts +24 -780
- package/src/tools/site.ts +34 -19
- package/src/tools/taxonomies.ts +41 -57
- package/src/tools/users.ts +28 -16
- package/src/types/client.ts +114 -138
- package/src/types/enhanced.ts +318 -0
- package/src/types/index.ts +51 -30
- package/src/types/mcp.ts +20 -42
- package/src/types/requests.ts +378 -0
- package/src/types/tools.ts +608 -0
- package/src/types/wordpress.ts +56 -34
- package/src/utils/debug.ts +77 -59
- package/src/utils/enhancedError.ts +8 -8
- package/src/utils/error.ts +53 -31
- package/src/utils/logger.ts +351 -0
- package/src/utils/streaming.ts +86 -68
- package/src/utils/toolWrapper.ts +10 -12
- package/src/utils/validation/core.ts +108 -0
- package/src/utils/validation/index.ts +36 -0
- package/src/utils/validation/network.ts +132 -0
- package/src/utils/validation/rateLimit.ts +54 -0
- package/src/utils/validation/security.ts +361 -0
- package/src/utils/validation/wordpress.ts +180 -0
- package/src/utils/validation.ts +47 -470
- package/dist/cache/__tests__/CacheInvalidation.test.d.ts +0 -5
- package/dist/cache/__tests__/CacheInvalidation.test.d.ts.map +0 -1
- package/dist/cache/__tests__/CacheInvalidation.test.js +0 -238
- package/dist/cache/__tests__/CacheInvalidation.test.js.map +0 -1
- package/dist/cache/__tests__/CacheManager.test.d.ts +0 -5
- package/dist/cache/__tests__/CacheManager.test.d.ts.map +0 -1
- package/dist/cache/__tests__/CacheManager.test.js +0 -233
- package/dist/cache/__tests__/CacheManager.test.js.map +0 -1
- package/dist/cache/__tests__/CachedWordPressClient.test.d.ts +0 -5
- package/dist/cache/__tests__/CachedWordPressClient.test.d.ts.map +0 -1
- package/dist/cache/__tests__/CachedWordPressClient.test.js +0 -231
- package/dist/cache/__tests__/CachedWordPressClient.test.js.map +0 -1
- package/dist/cache/__tests__/HttpCacheWrapper.test.d.ts +0 -5
- package/dist/cache/__tests__/HttpCacheWrapper.test.d.ts.map +0 -1
- package/dist/cache/__tests__/HttpCacheWrapper.test.js +0 -299
- package/dist/cache/__tests__/HttpCacheWrapper.test.js.map +0 -1
|
@@ -0,0 +1,693 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Security CI/CD Pipeline Integration
|
|
3
|
+
* Provides security checks and gates for continuous integration and deployment
|
|
4
|
+
*/
|
|
5
|
+
import { AISecurityScanner } from "./AISecurityScanner.js";
|
|
6
|
+
import { AutomatedRemediation } from "./AutomatedRemediation.js";
|
|
7
|
+
import { SecurityReviewer } from "./SecurityReviewer.js";
|
|
8
|
+
import { SecurityConfigManager } from "./SecurityConfigManager.js";
|
|
9
|
+
import { SecurityUtils } from "./SecurityConfig.js";
|
|
10
|
+
import { SecurityValidationError } from "./InputValidator.js";
|
|
11
|
+
import { LoggerFactory } from "../utils/logger.js";
|
|
12
|
+
const logger = LoggerFactory.security();
|
|
13
|
+
/**
|
|
14
|
+
* Security CI/CD Pipeline Manager
|
|
15
|
+
*/
|
|
16
|
+
export class SecurityCIPipeline {
|
|
17
|
+
scanner;
|
|
18
|
+
remediation;
|
|
19
|
+
reviewer;
|
|
20
|
+
configManager;
|
|
21
|
+
gates = new Map();
|
|
22
|
+
reports = [];
|
|
23
|
+
constructor() {
|
|
24
|
+
this.scanner = new AISecurityScanner();
|
|
25
|
+
this.remediation = new AutomatedRemediation();
|
|
26
|
+
this.reviewer = new SecurityReviewer();
|
|
27
|
+
this.configManager = new SecurityConfigManager();
|
|
28
|
+
this.initializeDefaultGates();
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Initialize the security pipeline
|
|
32
|
+
*/
|
|
33
|
+
async initialize() {
|
|
34
|
+
logger.info("Initializing security CI/CD pipeline");
|
|
35
|
+
await this.configManager.initialize();
|
|
36
|
+
logger.info("Security pipeline ready");
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Execute security gates for a pipeline stage
|
|
40
|
+
*/
|
|
41
|
+
async executeSecurityGates(stage, context, options = {}) {
|
|
42
|
+
const reportId = SecurityUtils.generateSecureToken(16);
|
|
43
|
+
const startTime = Date.now();
|
|
44
|
+
logger.info(`Executing ${stage} security gates`, {
|
|
45
|
+
stage,
|
|
46
|
+
branch: context.branch,
|
|
47
|
+
commit: context.commit
|
|
48
|
+
});
|
|
49
|
+
const applicableGates = Array.from(this.gates.values()).filter((gate) => gate.stage === stage && gate.enabled);
|
|
50
|
+
if (applicableGates.length === 0) {
|
|
51
|
+
logger.warn(`No security gates configured for stage: ${stage}`, { stage });
|
|
52
|
+
return this.createEmptyReport(reportId, stage, startTime);
|
|
53
|
+
}
|
|
54
|
+
const gateResults = [];
|
|
55
|
+
let overallStatus = "passed";
|
|
56
|
+
for (const gate of applicableGates) {
|
|
57
|
+
logger.info(`Executing gate: ${gate.name}`, { gateName: gate.name });
|
|
58
|
+
try {
|
|
59
|
+
const gateResult = await this.executeSecurityGate(gate, context, options);
|
|
60
|
+
gateResults.push(gateResult);
|
|
61
|
+
// Update overall status
|
|
62
|
+
if (gateResult.status === "failed" && gate.blocking) {
|
|
63
|
+
overallStatus = "failed";
|
|
64
|
+
}
|
|
65
|
+
else if (gateResult.status === "warning" && overallStatus === "passed") {
|
|
66
|
+
overallStatus = "warning";
|
|
67
|
+
}
|
|
68
|
+
// Stop on blocking failure unless continuing on failure
|
|
69
|
+
if (gateResult.status === "failed" && gate.blocking && !options.continueOnFailure) {
|
|
70
|
+
logger.error(`Stopping pipeline due to blocking gate failure: ${gate.name}`, { gateName: gate.name });
|
|
71
|
+
break;
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
catch (error) {
|
|
75
|
+
logger.error(`Gate execution error: ${gate.name}`, { gateName: gate.name, error });
|
|
76
|
+
const errorResult = {
|
|
77
|
+
gateId: gate.id,
|
|
78
|
+
gateName: gate.name,
|
|
79
|
+
status: "failed",
|
|
80
|
+
duration: Date.now() - startTime,
|
|
81
|
+
checks: [],
|
|
82
|
+
blocking: gate.blocking,
|
|
83
|
+
message: `Gate execution failed: ${error instanceof Error ? error.message : String(error)}`,
|
|
84
|
+
};
|
|
85
|
+
gateResults.push(errorResult);
|
|
86
|
+
if (gate.blocking && !options.continueOnFailure) {
|
|
87
|
+
overallStatus = "failed";
|
|
88
|
+
break;
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
const report = this.generatePipelineReport(reportId, stage, startTime, overallStatus, gateResults, context);
|
|
93
|
+
this.reports.push(report);
|
|
94
|
+
logger.info(`${stage} gates completed`, { stage, status: overallStatus });
|
|
95
|
+
return report;
|
|
96
|
+
}
|
|
97
|
+
/**
|
|
98
|
+
* Execute a single security gate
|
|
99
|
+
*/
|
|
100
|
+
async executeSecurityGate(gate, context, options = {}) {
|
|
101
|
+
const startTime = Date.now();
|
|
102
|
+
const checkResults = [];
|
|
103
|
+
for (const check of gate.checks) {
|
|
104
|
+
if (!check.enabled) {
|
|
105
|
+
continue;
|
|
106
|
+
}
|
|
107
|
+
logger.info(`Running check: ${check.name}`, { checkName: check.name });
|
|
108
|
+
try {
|
|
109
|
+
const checkResult = await this.executeSecurityCheck(check, context, options);
|
|
110
|
+
checkResults.push(checkResult);
|
|
111
|
+
}
|
|
112
|
+
catch (error) {
|
|
113
|
+
logger.error(`Check execution error: ${check.name}`, { checkName: check.name, error });
|
|
114
|
+
checkResults.push({
|
|
115
|
+
checkId: check.id,
|
|
116
|
+
checkName: check.name,
|
|
117
|
+
status: "error",
|
|
118
|
+
duration: Date.now() - startTime,
|
|
119
|
+
findings: [],
|
|
120
|
+
details: `Check execution failed: ${error instanceof Error ? error.message : String(error)}`,
|
|
121
|
+
score: 0,
|
|
122
|
+
});
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
// Evaluate gate status based on check results and thresholds
|
|
126
|
+
const gateStatus = this.evaluateGateStatus(gate, checkResults);
|
|
127
|
+
return {
|
|
128
|
+
gateId: gate.id,
|
|
129
|
+
gateName: gate.name,
|
|
130
|
+
status: gateStatus.status,
|
|
131
|
+
duration: Date.now() - startTime,
|
|
132
|
+
checks: checkResults,
|
|
133
|
+
blocking: gate.blocking,
|
|
134
|
+
message: gateStatus.message,
|
|
135
|
+
};
|
|
136
|
+
}
|
|
137
|
+
/**
|
|
138
|
+
* Execute a single security check
|
|
139
|
+
*/
|
|
140
|
+
async executeSecurityCheck(check, context, options = {}) {
|
|
141
|
+
const startTime = Date.now();
|
|
142
|
+
const findings = [];
|
|
143
|
+
let score = 100; // Initialize with safe default
|
|
144
|
+
let details = "";
|
|
145
|
+
if (options.dryRun) {
|
|
146
|
+
return {
|
|
147
|
+
checkId: check.id,
|
|
148
|
+
checkName: check.name,
|
|
149
|
+
status: "passed",
|
|
150
|
+
duration: Date.now() - startTime,
|
|
151
|
+
findings: [],
|
|
152
|
+
details: "Dry run - no actual checks performed",
|
|
153
|
+
score: 100,
|
|
154
|
+
};
|
|
155
|
+
}
|
|
156
|
+
try {
|
|
157
|
+
switch (check.type) {
|
|
158
|
+
case "scan":
|
|
159
|
+
const scanResults = await this.executeScanCheck(check, context);
|
|
160
|
+
findings.push(...scanResults.findings);
|
|
161
|
+
score = scanResults.score;
|
|
162
|
+
details = scanResults.details;
|
|
163
|
+
break;
|
|
164
|
+
case "review":
|
|
165
|
+
const reviewResults = await this.executeReviewCheck(check, context);
|
|
166
|
+
findings.push(...reviewResults.findings);
|
|
167
|
+
score = reviewResults.score;
|
|
168
|
+
details = reviewResults.details;
|
|
169
|
+
break;
|
|
170
|
+
case "dependency":
|
|
171
|
+
const depResults = await this.executeDependencyCheck(check, context);
|
|
172
|
+
findings.push(...depResults.findings);
|
|
173
|
+
score = depResults.score;
|
|
174
|
+
details = depResults.details;
|
|
175
|
+
break;
|
|
176
|
+
case "configuration":
|
|
177
|
+
const configResults = await this.executeConfigurationCheck(check, context);
|
|
178
|
+
findings.push(...configResults.findings);
|
|
179
|
+
score = configResults.score;
|
|
180
|
+
details = configResults.details;
|
|
181
|
+
break;
|
|
182
|
+
case "secrets":
|
|
183
|
+
const secretResults = await this.executeSecretsCheck(check, context);
|
|
184
|
+
findings.push(...secretResults.findings);
|
|
185
|
+
score = secretResults.score;
|
|
186
|
+
details = secretResults.details;
|
|
187
|
+
break;
|
|
188
|
+
case "compliance":
|
|
189
|
+
const complianceResults = await this.executeComplianceCheck(check, context);
|
|
190
|
+
findings.push(...complianceResults.findings);
|
|
191
|
+
score = complianceResults.score;
|
|
192
|
+
details = complianceResults.details;
|
|
193
|
+
break;
|
|
194
|
+
default:
|
|
195
|
+
throw new Error(`Unknown check type: ${check.type}`);
|
|
196
|
+
}
|
|
197
|
+
// Determine check status based on findings
|
|
198
|
+
const criticalCount = findings.filter((f) => f.severity === "critical").length;
|
|
199
|
+
const highCount = findings.filter((f) => f.severity === "high").length;
|
|
200
|
+
let status;
|
|
201
|
+
if (criticalCount > 0) {
|
|
202
|
+
status = "failed";
|
|
203
|
+
}
|
|
204
|
+
else if (highCount > 0) {
|
|
205
|
+
status = "warning";
|
|
206
|
+
}
|
|
207
|
+
else {
|
|
208
|
+
status = "passed";
|
|
209
|
+
}
|
|
210
|
+
return {
|
|
211
|
+
checkId: check.id,
|
|
212
|
+
checkName: check.name,
|
|
213
|
+
status,
|
|
214
|
+
duration: Date.now() - startTime,
|
|
215
|
+
findings,
|
|
216
|
+
details,
|
|
217
|
+
score,
|
|
218
|
+
};
|
|
219
|
+
}
|
|
220
|
+
catch (error) {
|
|
221
|
+
throw new SecurityValidationError(`Check ${check.name} failed`, [{ message: String(error) }]);
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
/**
|
|
225
|
+
* Execute security scan check
|
|
226
|
+
*/
|
|
227
|
+
async executeScanCheck(check, context) {
|
|
228
|
+
const scanParams = check.parameters;
|
|
229
|
+
const scanResult = await this.scanner.performScan({
|
|
230
|
+
targets: scanParams.targets ?? ["src/"],
|
|
231
|
+
depth: scanParams.depth ?? "deep",
|
|
232
|
+
includeRuntime: scanParams.includeRuntime ?? false,
|
|
233
|
+
includeFileSystem: scanParams.includeFileSystem ?? true,
|
|
234
|
+
});
|
|
235
|
+
const findings = scanResult.vulnerabilities.map((vuln) => ({
|
|
236
|
+
id: vuln.id,
|
|
237
|
+
severity: vuln.severity,
|
|
238
|
+
type: vuln.type,
|
|
239
|
+
description: vuln.description,
|
|
240
|
+
file: vuln.location.file,
|
|
241
|
+
line: vuln.location.line,
|
|
242
|
+
remediation: vuln.remediation.suggested,
|
|
243
|
+
}));
|
|
244
|
+
const score = Math.max(0, 100 - (scanResult.summary.critical * 10 + scanResult.summary.high * 5 + scanResult.summary.medium * 2));
|
|
245
|
+
return {
|
|
246
|
+
findings,
|
|
247
|
+
score,
|
|
248
|
+
details: `Scanned codebase: ${scanResult.summary.total} vulnerabilities found`,
|
|
249
|
+
};
|
|
250
|
+
}
|
|
251
|
+
/**
|
|
252
|
+
* Execute code review check
|
|
253
|
+
*/
|
|
254
|
+
async executeReviewCheck(check, context) {
|
|
255
|
+
const reviewParams = check.parameters;
|
|
256
|
+
const reviewResults = await this.reviewer.reviewDirectory("src/", {
|
|
257
|
+
recursive: true,
|
|
258
|
+
rules: reviewParams.rules ?? [],
|
|
259
|
+
excludeRules: reviewParams.excludeRules ?? [],
|
|
260
|
+
aiAnalysis: reviewParams.aiAnalysis ?? false,
|
|
261
|
+
});
|
|
262
|
+
const allFindings = [];
|
|
263
|
+
let totalScore = 0;
|
|
264
|
+
for (const result of reviewResults) {
|
|
265
|
+
const resultFindings = result.findings.map((finding) => ({
|
|
266
|
+
id: finding.id,
|
|
267
|
+
severity: finding.severity,
|
|
268
|
+
type: finding.category,
|
|
269
|
+
description: finding.message,
|
|
270
|
+
file: result.file,
|
|
271
|
+
line: finding.line,
|
|
272
|
+
remediation: finding.recommendation,
|
|
273
|
+
}));
|
|
274
|
+
allFindings.push(...resultFindings);
|
|
275
|
+
totalScore += this.calculateFileScore(result.findings);
|
|
276
|
+
}
|
|
277
|
+
const averageScore = reviewResults.length > 0 ? totalScore / reviewResults.length : 100;
|
|
278
|
+
return {
|
|
279
|
+
findings: allFindings,
|
|
280
|
+
score: averageScore,
|
|
281
|
+
details: `Reviewed ${reviewResults.length} files: ${allFindings.length} security issues found`,
|
|
282
|
+
};
|
|
283
|
+
}
|
|
284
|
+
/**
|
|
285
|
+
* Execute dependency check
|
|
286
|
+
*/
|
|
287
|
+
async executeDependencyCheck(check, context) {
|
|
288
|
+
// This would integrate with npm audit, Snyk, or similar tools
|
|
289
|
+
logger.info("Dependency check - integration with external tools required");
|
|
290
|
+
return {
|
|
291
|
+
findings: [],
|
|
292
|
+
score: 100,
|
|
293
|
+
details: "Dependency check completed - no vulnerabilities found",
|
|
294
|
+
};
|
|
295
|
+
}
|
|
296
|
+
/**
|
|
297
|
+
* Execute configuration check
|
|
298
|
+
*/
|
|
299
|
+
async executeConfigurationCheck(check, context) {
|
|
300
|
+
const compliance = await this.configManager.validateCompliance(context.environment);
|
|
301
|
+
const findings = compliance.violations.map((violation, index) => ({
|
|
302
|
+
id: `config-${index}`,
|
|
303
|
+
severity: "medium",
|
|
304
|
+
type: "Configuration",
|
|
305
|
+
description: violation,
|
|
306
|
+
remediation: "Review security configuration",
|
|
307
|
+
}));
|
|
308
|
+
const score = compliance.compliant ? 100 : Math.max(0, 100 - compliance.violations.length * 10);
|
|
309
|
+
return {
|
|
310
|
+
findings,
|
|
311
|
+
score,
|
|
312
|
+
details: `Configuration compliance: ${compliance.compliant ? "compliant" : "non-compliant"}`,
|
|
313
|
+
};
|
|
314
|
+
}
|
|
315
|
+
/**
|
|
316
|
+
* Execute secrets check
|
|
317
|
+
*/
|
|
318
|
+
async executeSecretsCheck(check, context) {
|
|
319
|
+
// This would integrate with tools like TruffleHog, GitLeaks, etc.
|
|
320
|
+
logger.info("Secrets check - integration with secret scanning tools required");
|
|
321
|
+
return {
|
|
322
|
+
findings: [],
|
|
323
|
+
score: 100,
|
|
324
|
+
details: "Secrets scan completed - no exposed secrets found",
|
|
325
|
+
};
|
|
326
|
+
}
|
|
327
|
+
/**
|
|
328
|
+
* Execute compliance check
|
|
329
|
+
*/
|
|
330
|
+
async executeComplianceCheck(check, context) {
|
|
331
|
+
const complianceParams = check.parameters;
|
|
332
|
+
const frameworks = complianceParams.frameworks ?? ["OWASP", "CWE"];
|
|
333
|
+
const findings = [];
|
|
334
|
+
// Check for compliance with security frameworks
|
|
335
|
+
for (const framework of frameworks) {
|
|
336
|
+
// This would integrate with compliance checking tools
|
|
337
|
+
logger.info(`Checking ${framework} compliance`, { framework });
|
|
338
|
+
}
|
|
339
|
+
return {
|
|
340
|
+
findings,
|
|
341
|
+
score: 100,
|
|
342
|
+
details: `Compliance check completed for frameworks: ${frameworks.join(", ")}`,
|
|
343
|
+
};
|
|
344
|
+
}
|
|
345
|
+
/**
|
|
346
|
+
* Calculate security score for file findings
|
|
347
|
+
*/
|
|
348
|
+
calculateFileScore(findings) {
|
|
349
|
+
const severityWeights = { critical: 20, high: 10, medium: 5, low: 2, info: 1 };
|
|
350
|
+
const penalty = findings.reduce((sum, finding) => {
|
|
351
|
+
return sum + (severityWeights[finding.severity] || 0);
|
|
352
|
+
}, 0);
|
|
353
|
+
return Math.max(0, 100 - penalty);
|
|
354
|
+
}
|
|
355
|
+
/**
|
|
356
|
+
* Evaluate gate status based on check results and thresholds
|
|
357
|
+
*/
|
|
358
|
+
evaluateGateStatus(gate, checkResults) {
|
|
359
|
+
const allFindings = checkResults.flatMap((result) => result.findings);
|
|
360
|
+
const criticalCount = allFindings.filter((f) => f.severity === "critical").length;
|
|
361
|
+
const highCount = allFindings.filter((f) => f.severity === "high").length;
|
|
362
|
+
const mediumCount = allFindings.filter((f) => f.severity === "medium").length;
|
|
363
|
+
const averageScore = checkResults.length > 0 ? checkResults.reduce((sum, result) => sum + result.score, 0) / checkResults.length : 100;
|
|
364
|
+
// Check thresholds
|
|
365
|
+
if (criticalCount > gate.thresholds.maxCritical) {
|
|
366
|
+
return {
|
|
367
|
+
status: "failed",
|
|
368
|
+
message: `Critical vulnerabilities (${criticalCount}) exceed threshold (${gate.thresholds.maxCritical})`,
|
|
369
|
+
};
|
|
370
|
+
}
|
|
371
|
+
if (highCount > gate.thresholds.maxHigh) {
|
|
372
|
+
return {
|
|
373
|
+
status: "failed",
|
|
374
|
+
message: `High-severity vulnerabilities (${highCount}) exceed threshold (${gate.thresholds.maxHigh})`,
|
|
375
|
+
};
|
|
376
|
+
}
|
|
377
|
+
if (averageScore < gate.thresholds.minSecurityScore) {
|
|
378
|
+
return {
|
|
379
|
+
status: "failed",
|
|
380
|
+
message: `Security score (${averageScore.toFixed(1)}) below threshold (${gate.thresholds.minSecurityScore})`,
|
|
381
|
+
};
|
|
382
|
+
}
|
|
383
|
+
if (mediumCount > gate.thresholds.maxMedium) {
|
|
384
|
+
return {
|
|
385
|
+
status: "warning",
|
|
386
|
+
message: `Medium-severity vulnerabilities (${mediumCount}) exceed threshold (${gate.thresholds.maxMedium})`,
|
|
387
|
+
};
|
|
388
|
+
}
|
|
389
|
+
return {
|
|
390
|
+
status: "passed",
|
|
391
|
+
message: "All security checks passed",
|
|
392
|
+
};
|
|
393
|
+
}
|
|
394
|
+
/**
|
|
395
|
+
* Generate pipeline security report
|
|
396
|
+
*/
|
|
397
|
+
generatePipelineReport(reportId, stage, startTime, status, gateResults, context) {
|
|
398
|
+
const allFindings = gateResults.flatMap((gate) => gate.checks.flatMap((check) => check.findings));
|
|
399
|
+
const summary = {
|
|
400
|
+
totalIssues: allFindings.length,
|
|
401
|
+
criticalIssues: allFindings.filter((f) => f.severity === "critical").length,
|
|
402
|
+
highIssues: allFindings.filter((f) => f.severity === "high").length,
|
|
403
|
+
mediumIssues: allFindings.filter((f) => f.severity === "medium").length,
|
|
404
|
+
lowIssues: allFindings.filter((f) => f.severity === "low").length,
|
|
405
|
+
securityScore: this.calculateOverallSecurityScore(gateResults),
|
|
406
|
+
compliance: status === "passed",
|
|
407
|
+
};
|
|
408
|
+
const recommendations = this.generateRecommendations(gateResults, summary);
|
|
409
|
+
return {
|
|
410
|
+
reportId,
|
|
411
|
+
timestamp: new Date(),
|
|
412
|
+
stage,
|
|
413
|
+
status,
|
|
414
|
+
duration: Date.now() - startTime,
|
|
415
|
+
gates: gateResults,
|
|
416
|
+
summary,
|
|
417
|
+
recommendations,
|
|
418
|
+
artifacts: this.generateArtifacts(reportId, gateResults),
|
|
419
|
+
};
|
|
420
|
+
}
|
|
421
|
+
/**
|
|
422
|
+
* Calculate overall security score
|
|
423
|
+
*/
|
|
424
|
+
calculateOverallSecurityScore(gateResults) {
|
|
425
|
+
const allChecks = gateResults.flatMap((gate) => gate.checks);
|
|
426
|
+
if (allChecks.length === 0) {
|
|
427
|
+
return 100;
|
|
428
|
+
}
|
|
429
|
+
const totalScore = allChecks.reduce((sum, check) => sum + check.score, 0);
|
|
430
|
+
return totalScore / allChecks.length;
|
|
431
|
+
}
|
|
432
|
+
/**
|
|
433
|
+
* Generate recommendations based on results
|
|
434
|
+
*/
|
|
435
|
+
generateRecommendations(gateResults, summary) {
|
|
436
|
+
const recommendations = [];
|
|
437
|
+
if (summary.criticalIssues > 0) {
|
|
438
|
+
recommendations.push("Address critical security vulnerabilities immediately before deployment");
|
|
439
|
+
}
|
|
440
|
+
if (summary.highIssues > 5) {
|
|
441
|
+
recommendations.push("Review and remediate high-severity security issues");
|
|
442
|
+
}
|
|
443
|
+
if (summary.securityScore < 80) {
|
|
444
|
+
recommendations.push("Improve overall security posture through code review and security training");
|
|
445
|
+
}
|
|
446
|
+
const failedGates = gateResults.filter((gate) => gate.status === "failed");
|
|
447
|
+
if (failedGates.length > 0) {
|
|
448
|
+
recommendations.push(`Review failed security gates: ${failedGates.map((g) => g.gateName).join(", ")}`);
|
|
449
|
+
}
|
|
450
|
+
return recommendations;
|
|
451
|
+
}
|
|
452
|
+
/**
|
|
453
|
+
* Generate artifacts for the security report
|
|
454
|
+
*/
|
|
455
|
+
generateArtifacts(reportId, gateResults) {
|
|
456
|
+
// In a real implementation, this would generate SARIF files, security reports, etc.
|
|
457
|
+
return [`security-report-${reportId}.json`, `security-findings-${reportId}.sarif`];
|
|
458
|
+
}
|
|
459
|
+
/**
|
|
460
|
+
* Create empty report for stages with no gates
|
|
461
|
+
*/
|
|
462
|
+
createEmptyReport(reportId, stage, startTime) {
|
|
463
|
+
return {
|
|
464
|
+
reportId,
|
|
465
|
+
timestamp: new Date(),
|
|
466
|
+
stage,
|
|
467
|
+
status: "passed",
|
|
468
|
+
duration: Date.now() - startTime,
|
|
469
|
+
gates: [],
|
|
470
|
+
summary: {
|
|
471
|
+
totalIssues: 0,
|
|
472
|
+
criticalIssues: 0,
|
|
473
|
+
highIssues: 0,
|
|
474
|
+
mediumIssues: 0,
|
|
475
|
+
lowIssues: 0,
|
|
476
|
+
securityScore: 100,
|
|
477
|
+
compliance: true,
|
|
478
|
+
},
|
|
479
|
+
recommendations: [],
|
|
480
|
+
artifacts: [],
|
|
481
|
+
};
|
|
482
|
+
}
|
|
483
|
+
/**
|
|
484
|
+
* Initialize default security gates
|
|
485
|
+
*/
|
|
486
|
+
initializeDefaultGates() {
|
|
487
|
+
// Pre-commit gate
|
|
488
|
+
this.gates.set("pre-commit", {
|
|
489
|
+
id: "pre-commit",
|
|
490
|
+
name: "Pre-commit Security Gate",
|
|
491
|
+
stage: "pre-commit",
|
|
492
|
+
enabled: true,
|
|
493
|
+
blocking: true,
|
|
494
|
+
checks: [
|
|
495
|
+
{
|
|
496
|
+
id: "secrets-scan",
|
|
497
|
+
name: "Secrets Scan",
|
|
498
|
+
type: "secrets",
|
|
499
|
+
enabled: true,
|
|
500
|
+
timeout: 60000,
|
|
501
|
+
retries: 1,
|
|
502
|
+
parameters: {},
|
|
503
|
+
},
|
|
504
|
+
{
|
|
505
|
+
id: "basic-review",
|
|
506
|
+
name: "Basic Security Review",
|
|
507
|
+
type: "review",
|
|
508
|
+
enabled: true,
|
|
509
|
+
timeout: 120000,
|
|
510
|
+
retries: 1,
|
|
511
|
+
parameters: { rules: ["auth-001", "input-001", "crypto-001"] },
|
|
512
|
+
},
|
|
513
|
+
],
|
|
514
|
+
thresholds: {
|
|
515
|
+
maxCritical: 0,
|
|
516
|
+
maxHigh: 2,
|
|
517
|
+
maxMedium: 10,
|
|
518
|
+
minSecurityScore: 80,
|
|
519
|
+
},
|
|
520
|
+
exceptions: [],
|
|
521
|
+
});
|
|
522
|
+
// Pre-build gate
|
|
523
|
+
this.gates.set("pre-build", {
|
|
524
|
+
id: "pre-build",
|
|
525
|
+
name: "Pre-build Security Gate",
|
|
526
|
+
stage: "pre-build",
|
|
527
|
+
enabled: true,
|
|
528
|
+
blocking: true,
|
|
529
|
+
checks: [
|
|
530
|
+
{
|
|
531
|
+
id: "full-scan",
|
|
532
|
+
name: "Full Security Scan",
|
|
533
|
+
type: "scan",
|
|
534
|
+
enabled: true,
|
|
535
|
+
timeout: 300000,
|
|
536
|
+
retries: 1,
|
|
537
|
+
parameters: { depth: "comprehensive", includeRuntime: true },
|
|
538
|
+
},
|
|
539
|
+
{
|
|
540
|
+
id: "dependency-check",
|
|
541
|
+
name: "Dependency Vulnerability Check",
|
|
542
|
+
type: "dependency",
|
|
543
|
+
enabled: true,
|
|
544
|
+
timeout: 180000,
|
|
545
|
+
retries: 2,
|
|
546
|
+
parameters: {},
|
|
547
|
+
},
|
|
548
|
+
{
|
|
549
|
+
id: "config-review",
|
|
550
|
+
name: "Configuration Review",
|
|
551
|
+
type: "configuration",
|
|
552
|
+
enabled: true,
|
|
553
|
+
timeout: 60000,
|
|
554
|
+
retries: 1,
|
|
555
|
+
parameters: {},
|
|
556
|
+
},
|
|
557
|
+
],
|
|
558
|
+
thresholds: {
|
|
559
|
+
maxCritical: 0,
|
|
560
|
+
maxHigh: 5,
|
|
561
|
+
maxMedium: 20,
|
|
562
|
+
minSecurityScore: 75,
|
|
563
|
+
},
|
|
564
|
+
exceptions: [],
|
|
565
|
+
});
|
|
566
|
+
// Pre-deploy gate
|
|
567
|
+
this.gates.set("pre-deploy", {
|
|
568
|
+
id: "pre-deploy",
|
|
569
|
+
name: "Pre-deployment Security Gate",
|
|
570
|
+
stage: "pre-deploy",
|
|
571
|
+
enabled: true,
|
|
572
|
+
blocking: true,
|
|
573
|
+
checks: [
|
|
574
|
+
{
|
|
575
|
+
id: "compliance-check",
|
|
576
|
+
name: "Compliance Validation",
|
|
577
|
+
type: "compliance",
|
|
578
|
+
enabled: true,
|
|
579
|
+
timeout: 120000,
|
|
580
|
+
retries: 1,
|
|
581
|
+
parameters: { frameworks: ["OWASP", "CWE"] },
|
|
582
|
+
},
|
|
583
|
+
{
|
|
584
|
+
id: "final-review",
|
|
585
|
+
name: "Final Security Review",
|
|
586
|
+
type: "review",
|
|
587
|
+
enabled: true,
|
|
588
|
+
timeout: 240000,
|
|
589
|
+
retries: 1,
|
|
590
|
+
parameters: { aiAnalysis: true },
|
|
591
|
+
},
|
|
592
|
+
],
|
|
593
|
+
thresholds: {
|
|
594
|
+
maxCritical: 0,
|
|
595
|
+
maxHigh: 1,
|
|
596
|
+
maxMedium: 5,
|
|
597
|
+
minSecurityScore: 85,
|
|
598
|
+
},
|
|
599
|
+
exceptions: [],
|
|
600
|
+
});
|
|
601
|
+
}
|
|
602
|
+
/**
|
|
603
|
+
* Get security gate configuration
|
|
604
|
+
*/
|
|
605
|
+
getSecurityGate(gateId) {
|
|
606
|
+
return this.gates.get(gateId) || null;
|
|
607
|
+
}
|
|
608
|
+
/**
|
|
609
|
+
* Update security gate configuration
|
|
610
|
+
*/
|
|
611
|
+
updateSecurityGate(gateId, updates) {
|
|
612
|
+
const gate = this.gates.get(gateId);
|
|
613
|
+
if (!gate) {
|
|
614
|
+
return false;
|
|
615
|
+
}
|
|
616
|
+
const updatedGate = { ...gate, ...updates, id: gateId };
|
|
617
|
+
this.gates.set(gateId, updatedGate);
|
|
618
|
+
logger.info(`Updated security gate: ${updatedGate.name}`, { gateName: updatedGate.name });
|
|
619
|
+
return true;
|
|
620
|
+
}
|
|
621
|
+
/**
|
|
622
|
+
* Get pipeline reports
|
|
623
|
+
*/
|
|
624
|
+
getReports(options = {}) {
|
|
625
|
+
let reports = [...this.reports];
|
|
626
|
+
if (options.stage) {
|
|
627
|
+
reports = reports.filter((r) => r.stage === options.stage);
|
|
628
|
+
}
|
|
629
|
+
if (options.status) {
|
|
630
|
+
reports = reports.filter((r) => r.status === options.status);
|
|
631
|
+
}
|
|
632
|
+
if (options.since) {
|
|
633
|
+
reports = reports.filter((r) => r.timestamp >= options.since);
|
|
634
|
+
}
|
|
635
|
+
// Sort by timestamp (newest first)
|
|
636
|
+
reports.sort((a, b) => b.timestamp.getTime() - a.timestamp.getTime());
|
|
637
|
+
if (options.limit) {
|
|
638
|
+
reports = reports.slice(0, options.limit);
|
|
639
|
+
}
|
|
640
|
+
return reports;
|
|
641
|
+
}
|
|
642
|
+
/**
|
|
643
|
+
* Get pipeline statistics
|
|
644
|
+
*/
|
|
645
|
+
getStatistics() {
|
|
646
|
+
const totalReports = this.reports.length;
|
|
647
|
+
const passedReports = this.reports.filter((r) => r.status === "passed").length;
|
|
648
|
+
const passRate = totalReports > 0 ? passedReports / totalReports : 1;
|
|
649
|
+
const averageSecurityScore = totalReports > 0 ? this.reports.reduce((sum, r) => sum + r.summary.securityScore, 0) / totalReports : 100;
|
|
650
|
+
// Count issue types
|
|
651
|
+
const issueTypes = {};
|
|
652
|
+
this.reports.forEach((report) => {
|
|
653
|
+
report.gates.forEach((gate) => {
|
|
654
|
+
gate.checks.forEach((check) => {
|
|
655
|
+
check.findings.forEach((finding) => {
|
|
656
|
+
issueTypes[finding.type] = (issueTypes[finding.type] || 0) + 1;
|
|
657
|
+
});
|
|
658
|
+
});
|
|
659
|
+
});
|
|
660
|
+
});
|
|
661
|
+
const mostCommonIssues = Object.entries(issueTypes)
|
|
662
|
+
.map(([type, count]) => ({ type, count }))
|
|
663
|
+
.sort((a, b) => b.count - a.count)
|
|
664
|
+
.slice(0, 5);
|
|
665
|
+
// Calculate gate performance
|
|
666
|
+
const gateStats = {};
|
|
667
|
+
this.reports.forEach((report) => {
|
|
668
|
+
report.gates.forEach((gate) => {
|
|
669
|
+
if (!gateStats[gate.gateId]) {
|
|
670
|
+
gateStats[gate.gateId] = { total: 0, passed: 0, totalDuration: 0 };
|
|
671
|
+
}
|
|
672
|
+
gateStats[gate.gateId].total++;
|
|
673
|
+
gateStats[gate.gateId].totalDuration += gate.duration;
|
|
674
|
+
if (gate.status === "passed") {
|
|
675
|
+
gateStats[gate.gateId].passed++;
|
|
676
|
+
}
|
|
677
|
+
});
|
|
678
|
+
});
|
|
679
|
+
const gatePerformance = Object.entries(gateStats).map(([gateId, stats]) => ({
|
|
680
|
+
gateId,
|
|
681
|
+
successRate: stats.total > 0 ? stats.passed / stats.total : 0,
|
|
682
|
+
averageDuration: stats.total > 0 ? stats.totalDuration / stats.total : 0,
|
|
683
|
+
}));
|
|
684
|
+
return {
|
|
685
|
+
totalReports,
|
|
686
|
+
passRate,
|
|
687
|
+
averageSecurityScore,
|
|
688
|
+
mostCommonIssues,
|
|
689
|
+
gatePerformance,
|
|
690
|
+
};
|
|
691
|
+
}
|
|
692
|
+
}
|
|
693
|
+
//# sourceMappingURL=SecurityCIPipeline.js.map
|