Sidecar Logo

middleware/auth.ts

Configuration

/**
 * Sidecar Config for middleware/auth.ts
 */
module.exports = {
  title: "auth.ts",
  description: "Auto-generated draft",
};

Route Flow Map

--- title: "Route Flow: ssutil/src/middleware/auth.ts" --- flowchart TD title["Route Flow: ssutil/src/middleware/auth.ts"] style title fill:none,stroke:none,color:#B4976A,font-size:18px saltpassword{{"saltpassword"}} style saltpassword fill:#161b22,color:#fff,stroke:#c2a35d domaintopassword{{"domaintopassword"}} style domaintopassword fill:#161b22,color:#fff,stroke:#c2a35d generateRandomPadding{{"generateRandomPadding"}} style generateRandomPadding fill:#161b22,color:#fff,stroke:#c2a35d padWithZeros{{"padWithZeros"}} style padWithZeros fill:#161b22,color:#fff,stroke:#c2a35d UserIDToAPIKey{{"UserIDToAPIKey"}} style UserIDToAPIKey fill:#161b22,color:#fff,stroke:#c2a35d reverseObject{{"reverseObject"}} style reverseObject fill:#161b22,color:#fff,stroke:#c2a35d UserIDToAPIKey --> generateRandomPadding UserIDToAPIKey --> padWithZeros linkStyle default stroke:#c2a35d,stroke-width:2px,color:#fff classDef default color:#fff

AST Code Structure

--- title: "AST Structure: ssutil/src/middleware/auth.ts" --- graph TD n0["SF"] n1["VS"] n0 --> n1 n3["VD: salt"] n1 --> n3 n6["FD: saltpassword"] n0 --> n6 n17["VS"] n6 --> n17 n19["VD: msgUint8"] n17 --> n19 n21["CE: new TextEncoder().encode"] n19 --> n21 n23["NE"] n21 --> n23 n26["BE"] n21 --> n26 n30["VS"] n6 --> n30 n32["VD: hashBuffer"] n30 --> n32 n35["CE: crypto.subtle.digest"] n32 --> n35 n43["VS"] n6 --> n43 n45["VD: hashArray"] n43 --> n45 n47["CE: Array.from"] n45 --> n47 n51["NE"] n47 --> n51 n54["VS"] n6 --> n54 n56["VD: hashHex"] n54 --> n56 n58["CE: hashArray.map(b => b.toString(16).padStart(2, '0')).join"] n56 --> n58 n60["CE: hashArray.map"] n58 --> n60 n64["AF"] n60 --> n64 n67["RS"] n6 --> n67 n69["FD: domaintopassword"] n0 --> n69 n77["IS"] n69 --> n77 n80["RS"] n77 --> n80 n82["VS"] n69 --> n82 n84["VD: cleaned"] n82 --> n84 n86["CE: domain.replace"] n84 --> n86 n92["VS"] n69 --> n92 n94["VD: password"] n92 --> n94 n96["CE: cleaned.substring"] n94 --> n96 n102["IS"] n69 --> n102 n103["BE"] n102 --> n103 n110["VS"] n102 --> n110 n112["VD: padding"] n110 --> n112 n116["BE"] n102 --> n116 n119["BE"] n116 --> n119 n122["CE: padding.substring"] n119 --> n122 n127["BE"] n122 --> n127 n128["RS"] n69 --> n128 n129["BE"] n128 --> n129 n133["VS"] n0 --> n133 n135["VD: substitutionMap"] n133 --> n135 n328["VS"] n0 --> n328 n330["VD: reverseObject"] n328 --> n330 n332["AF"] n330 --> n332 n345["RS"] n332 --> n345 n346["CE: Object.entries(obj).reduce"] n345 --> n346 n348["CE: Object.entries"] n346 --> n348 n350["AF"] n346 --> n350 n352["FD: generateRandomPadding"] n0 --> n352 n359["VS"] n352 --> n359 n361["VD: padding"] n359 --> n361 n364["VS"] n352 --> n364 n366["VD: possibleChars"] n364 --> n366 n371["VD: i"] n352 --> n371 n374["BE"] n352 --> n374 n381["VS"] n352 --> n381 n383["VD: randomIndex"] n381 --> n383 n385["CE: Math.floor"] n383 --> n385 n389["BE"] n385 --> n389 n390["CE: Math.random"] n389 --> n390 n396["BE"] n352 --> n396 n399["CE: possibleChars.charAt"] n396 --> n399 n404["RS"] n352 --> n404 n406["FD: padWithZeros"] n0 --> n406 n416["RS"] n406 --> n416 n417["CE: number.toString().padStart"] n416 --> n417 n419["CE: number.toString"] n417 --> n419 n426["FD: UserIDToAPIKey"] n0 --> n426 n438["VS"] n426 --> n438 n440["VD: useridStr"] n438 --> n440 n442["CE: String"] n440 --> n442 n445["VS"] n426 --> n445 n447["VD: encryptedUserId"] n445 --> n447 n449["CE: useridStr.replace"] n447 --> n449 n454["AF"] n449 --> n454 n458["BE"] n454 --> n458 n459["VS"] n426 --> n459 n461["VD: paddingLength"] n459 --> n461 n463["BE"] n461 --> n463 n469["VS"] n426 --> n469 n471["VD: padding"] n469 --> n471 n473["CE: generateRandomPadding"] n471 --> n473 n476["VS"] n426 --> n476 n478["VD: finalRandomChar"] n476 --> n478 n480["CE: generateRandomPadding"] n478 --> n480 n483["VS"] n426 --> n483 n485["VD: paddedLength"] n483 --> n485 n487["CE: padWithZeros"] n485 --> n487 n493["VS"] n426 --> n493 n495["VD: api_key"] n493 --> n495 n497["BE"] n495 --> n497 n498["BE"] n497 --> n498 n499["BE"] n498 --> n499 n504["RS"] n426 --> n504 style n0 fill:#5E377B,color:#fff,stroke:#B4976A linkStyle default stroke:#c2a35d,stroke-width:1px,opacity:0.6
AF ArrowFunctionBE BinaryExpressionCE CallExpressionFD FunctionDeclarationIS IfStatementNE NewExpressionRS ReturnStatementSF SourceFileVD VariableDeclarationVS VariableStatement