create_plan api - #354
Conversation
Added link
docs: Update CustomizingAzdParameters.md
fix: Merge the telemetry issue changes from dev to main
fix: added current step action and function with history to execute correct task when approving parallelly
…ndard chore: migrate model type to global standard
fix: add principalType as 'ServicePrincipal' for role assignments
fix: Prefix/Suffix fixes - dev to main
| static async createPlan( | ||
| description: string | ||
| ): Promise<{ plan_id: string; status: string; session_id: string }> { | ||
| const sessionId = this.generateSessionId(); |
Check failure
Code scanning / CodeQL
Insecure randomness High
Show autofix suggestion
Hide autofix suggestion
Copilot Autofix
AI about 1 year ago
To fix the problem, replace the use of Math.random() in the generateSessionId method with a cryptographically secure random number generator. In the browser, the recommended approach is to use window.crypto.getRandomValues. This can be used to generate a random 32-bit integer, which can then be used in place of the insecure random value. The fix should only affect the generateSessionId method in src/frontend/src/services/TaskService.tsx. No changes to the method's interface or usage are required. No new dependencies are needed, as window.crypto is available in all modern browsers.
| @@ -103,3 +103,6 @@ | ||
| const timestamp = new Date().getTime(); | ||
| const random = Math.floor(Math.random() * 10000); | ||
| // Use cryptographically secure random number | ||
| const array = new Uint32Array(1); | ||
| window.crypto.getRandomValues(array); | ||
| const random = array[0] % 10000; | ||
| return `sid_${timestamp}_${random}`; |
(cherry picked from commit 8e47eb8)
|
🎉 This PR is included in version 2.2.0 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
create_plan api
Purpose
Does this introduce a breaking change?
How to Test
What to Check
Verify that the following are valid
Other Information