pecunia-root 0.1.1 → 0.1.3

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.
Files changed (328) hide show
  1. package/dist/adapters/prisma-adapter/index.d.mts +1 -1
  2. package/dist/adapters/prisma-adapter/index.mjs +1 -1
  3. package/dist/adapters/prisma-adapter/index.mjs.map +1 -1
  4. package/dist/context/index.mjs +1 -1
  5. package/dist/context/index.mjs.map +1 -1
  6. package/dist/index.d.mts +1 -2
  7. package/dist/index.mjs +1 -2
  8. package/package.json +2 -16
  9. package/dist/_virtual/rolldown_runtime.mjs +0 -8
  10. package/dist/adapters/mongodb-adapter/index.d.mts +0 -35
  11. package/dist/adapters/mongodb-adapter/index.mjs +0 -314
  12. package/dist/adapters/mongodb-adapter/index.mjs.map +0 -1
  13. package/dist/node_modules/.pnpm/@mongodb-js_saslprep@1.4.4/node_modules/@mongodb-js/saslprep/dist/code-points-data.mjs +0 -14
  14. package/dist/node_modules/.pnpm/@mongodb-js_saslprep@1.4.4/node_modules/@mongodb-js/saslprep/dist/code-points-data.mjs.map +0 -1
  15. package/dist/node_modules/.pnpm/@mongodb-js_saslprep@1.4.4/node_modules/@mongodb-js/saslprep/dist/index.mjs +0 -54
  16. package/dist/node_modules/.pnpm/@mongodb-js_saslprep@1.4.4/node_modules/@mongodb-js/saslprep/dist/index.mjs.map +0 -1
  17. package/dist/node_modules/.pnpm/@mongodb-js_saslprep@1.4.4/node_modules/@mongodb-js/saslprep/dist/memory-code-points.mjs +0 -36
  18. package/dist/node_modules/.pnpm/@mongodb-js_saslprep@1.4.4/node_modules/@mongodb-js/saslprep/dist/memory-code-points.mjs.map +0 -1
  19. package/dist/node_modules/.pnpm/@mongodb-js_saslprep@1.4.4/node_modules/@mongodb-js/saslprep/dist/node.mjs +0 -27
  20. package/dist/node_modules/.pnpm/@mongodb-js_saslprep@1.4.4/node_modules/@mongodb-js/saslprep/dist/node.mjs.map +0 -1
  21. package/dist/node_modules/.pnpm/bson@6.10.4/node_modules/bson/lib/bson.mjs +0 -3728
  22. package/dist/node_modules/.pnpm/bson@6.10.4/node_modules/bson/lib/bson.mjs.map +0 -1
  23. package/dist/node_modules/.pnpm/memory-pager@1.5.0/node_modules/memory-pager/index.mjs +0 -137
  24. package/dist/node_modules/.pnpm/memory-pager@1.5.0/node_modules/memory-pager/index.mjs.map +0 -1
  25. package/dist/node_modules/.pnpm/mongodb-connection-string-url@3.0.2/node_modules/mongodb-connection-string-url/lib/index.mjs +0 -211
  26. package/dist/node_modules/.pnpm/mongodb-connection-string-url@3.0.2/node_modules/mongodb-connection-string-url/lib/index.mjs.map +0 -1
  27. package/dist/node_modules/.pnpm/mongodb-connection-string-url@3.0.2/node_modules/mongodb-connection-string-url/lib/redact.mjs +0 -95
  28. package/dist/node_modules/.pnpm/mongodb-connection-string-url@3.0.2/node_modules/mongodb-connection-string-url/lib/redact.mjs.map +0 -1
  29. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/admin.mjs +0 -158
  30. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/admin.mjs.map +0 -1
  31. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/bson.mjs +0 -195
  32. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/bson.mjs.map +0 -1
  33. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/bulk/common.mjs +0 -710
  34. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/bulk/common.mjs.map +0 -1
  35. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/bulk/ordered.mjs +0 -53
  36. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/bulk/ordered.mjs.map +0 -1
  37. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/bulk/unordered.mjs +0 -63
  38. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/bulk/unordered.mjs.map +0 -1
  39. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/change_stream.mjs +0 -368
  40. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/change_stream.mjs.map +0 -1
  41. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/client-side-encryption/auto_encrypter.mjs +0 -234
  42. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/client-side-encryption/auto_encrypter.mjs.map +0 -1
  43. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/client-side-encryption/client_encryption.mjs +0 -545
  44. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/client-side-encryption/client_encryption.mjs.map +0 -1
  45. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/client-side-encryption/crypto_callbacks.mjs +0 -83
  46. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/client-side-encryption/crypto_callbacks.mjs.map +0 -1
  47. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/client-side-encryption/errors.mjs +0 -146
  48. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/client-side-encryption/errors.mjs.map +0 -1
  49. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/client-side-encryption/mongocryptd_manager.mjs +0 -58
  50. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/client-side-encryption/mongocryptd_manager.mjs.map +0 -1
  51. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/client-side-encryption/providers/aws.mjs +0 -30
  52. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/client-side-encryption/providers/aws.mjs.map +0 -1
  53. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/client-side-encryption/providers/azure.mjs +0 -135
  54. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/client-side-encryption/providers/azure.mjs.map +0 -1
  55. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/client-side-encryption/providers/gcp.mjs +0 -25
  56. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/client-side-encryption/providers/gcp.mjs.map +0 -1
  57. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/client-side-encryption/providers/index.mjs +0 -47
  58. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/client-side-encryption/providers/index.mjs.map +0 -1
  59. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/client-side-encryption/state_machine.mjs +0 -362
  60. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/client-side-encryption/state_machine.mjs.map +0 -1
  61. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/auth/auth_provider.mjs +0 -58
  62. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/auth/auth_provider.mjs.map +0 -1
  63. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/auth/aws_temporary_credentials.mjs +0 -123
  64. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/auth/aws_temporary_credentials.mjs.map +0 -1
  65. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/auth/gssapi.mjs +0 -128
  66. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/auth/gssapi.mjs.map +0 -1
  67. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/auth/mongo_credentials.mjs +0 -133
  68. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/auth/mongo_credentials.mjs.map +0 -1
  69. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/auth/mongodb_aws.mjs +0 -126
  70. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/auth/mongodb_aws.mjs.map +0 -1
  71. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/auth/mongodb_oidc/automated_callback_workflow.mjs +0 -79
  72. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/auth/mongodb_oidc/automated_callback_workflow.mjs.map +0 -1
  73. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/auth/mongodb_oidc/azure_machine_workflow.mjs +0 -65
  74. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/auth/mongodb_oidc/azure_machine_workflow.mjs.map +0 -1
  75. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/auth/mongodb_oidc/callback_workflow.mjs +0 -127
  76. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/auth/mongodb_oidc/callback_workflow.mjs.map +0 -1
  77. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/auth/mongodb_oidc/command_builders.mjs +0 -47
  78. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/auth/mongodb_oidc/command_builders.mjs.map +0 -1
  79. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/auth/mongodb_oidc/gcp_machine_workflow.mjs +0 -44
  80. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/auth/mongodb_oidc/gcp_machine_workflow.mjs.map +0 -1
  81. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/auth/mongodb_oidc/human_callback_workflow.mjs +0 -101
  82. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/auth/mongodb_oidc/human_callback_workflow.mjs.map +0 -1
  83. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/auth/mongodb_oidc/k8s_machine_workflow.mjs +0 -33
  84. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/auth/mongodb_oidc/k8s_machine_workflow.mjs.map +0 -1
  85. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/auth/mongodb_oidc/token_cache.mjs +0 -53
  86. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/auth/mongodb_oidc/token_cache.mjs.map +0 -1
  87. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/auth/mongodb_oidc/token_machine_workflow.mjs +0 -29
  88. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/auth/mongodb_oidc/token_machine_workflow.mjs.map +0 -1
  89. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/auth/mongodb_oidc.mjs +0 -83
  90. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/auth/mongodb_oidc.mjs.map +0 -1
  91. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/auth/plain.mjs +0 -36
  92. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/auth/plain.mjs.map +0 -1
  93. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/auth/providers.mjs +0 -32
  94. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/auth/providers.mjs.map +0 -1
  95. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/auth/scram.mjs +0 -206
  96. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/auth/scram.mjs.map +0 -1
  97. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/auth/x509.mjs +0 -45
  98. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/auth/x509.mjs.map +0 -1
  99. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/command_monitoring_events.mjs +0 -213
  100. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/command_monitoring_events.mjs.map +0 -1
  101. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/commands.mjs +0 -411
  102. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/commands.mjs.map +0 -1
  103. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/connect.mjs +0 -288
  104. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/connect.mjs.map +0 -1
  105. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/connection.mjs +0 -423
  106. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/connection.mjs.map +0 -1
  107. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/connection_pool.mjs +0 -483
  108. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/connection_pool.mjs.map +0 -1
  109. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/connection_pool_events.mjs +0 -207
  110. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/connection_pool_events.mjs.map +0 -1
  111. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/errors.mjs +0 -116
  112. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/errors.mjs.map +0 -1
  113. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/handshake/client_metadata.mjs +0 -183
  114. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/handshake/client_metadata.mjs.map +0 -1
  115. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/metrics.mjs +0 -55
  116. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/metrics.mjs.map +0 -1
  117. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/stream_description.mjs +0 -60
  118. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/stream_description.mjs.map +0 -1
  119. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/wire_protocol/compression.mjs +0 -139
  120. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/wire_protocol/compression.mjs.map +0 -1
  121. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/wire_protocol/constants.mjs +0 -28
  122. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/wire_protocol/constants.mjs.map +0 -1
  123. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/wire_protocol/on_data.mjs +0 -117
  124. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/wire_protocol/on_data.mjs.map +0 -1
  125. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/wire_protocol/on_demand/document.mjs +0 -182
  126. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/wire_protocol/on_demand/document.mjs.map +0 -1
  127. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/wire_protocol/responses.mjs +0 -304
  128. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/wire_protocol/responses.mjs.map +0 -1
  129. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/wire_protocol/shared.mjs +0 -34
  130. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/wire_protocol/shared.mjs.map +0 -1
  131. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/collection.mjs +0 -739
  132. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/collection.mjs.map +0 -1
  133. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/connection_string.mjs +0 -805
  134. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/connection_string.mjs.map +0 -1
  135. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/constants.mjs +0 -174
  136. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/constants.mjs.map +0 -1
  137. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cursor/abstract_cursor.mjs +0 -726
  138. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cursor/abstract_cursor.mjs.map +0 -1
  139. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cursor/aggregation_cursor.mjs +0 -172
  140. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cursor/aggregation_cursor.mjs.map +0 -1
  141. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cursor/change_stream_cursor.mjs +0 -103
  142. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cursor/change_stream_cursor.mjs.map +0 -1
  143. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cursor/client_bulk_write_cursor.mjs +0 -66
  144. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cursor/client_bulk_write_cursor.mjs.map +0 -1
  145. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cursor/explainable_cursor.mjs +0 -41
  146. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cursor/explainable_cursor.mjs.map +0 -1
  147. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cursor/find_cursor.mjs +0 -365
  148. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cursor/find_cursor.mjs.map +0 -1
  149. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cursor/list_collections_cursor.mjs +0 -50
  150. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cursor/list_collections_cursor.mjs.map +0 -1
  151. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cursor/list_indexes_cursor.mjs +0 -48
  152. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cursor/list_indexes_cursor.mjs.map +0 -1
  153. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cursor/list_search_indexes_cursor.mjs +0 -23
  154. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cursor/list_search_indexes_cursor.mjs.map +0 -1
  155. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cursor/run_command_cursor.mjs +0 -106
  156. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cursor/run_command_cursor.mjs.map +0 -1
  157. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/db.mjs +0 -428
  158. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/db.mjs.map +0 -1
  159. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/deps.mjs +0 -124
  160. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/deps.mjs.map +0 -1
  161. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/encrypter.mjs +0 -95
  162. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/encrypter.mjs.map +0 -1
  163. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/error.mjs +0 -1305
  164. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/error.mjs.map +0 -1
  165. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/explain.mjs +0 -59
  166. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/explain.mjs.map +0 -1
  167. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/gridfs/download.mjs +0 -250
  168. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/gridfs/download.mjs.map +0 -1
  169. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/gridfs/index.mjs +0 -170
  170. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/gridfs/index.mjs.map +0 -1
  171. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/gridfs/upload.mjs +0 -315
  172. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/gridfs/upload.mjs.map +0 -1
  173. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/index.mjs +0 -925
  174. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/index.mjs.map +0 -1
  175. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/mongo_client.mjs +0 -520
  176. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/mongo_client.mjs.map +0 -1
  177. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/mongo_client_auth_providers.mjs +0 -90
  178. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/mongo_client_auth_providers.mjs.map +0 -1
  179. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/mongo_logger.mjs +0 -582
  180. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/mongo_logger.mjs.map +0 -1
  181. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/mongo_types.mjs +0 -64
  182. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/mongo_types.mjs.map +0 -1
  183. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/aggregate.mjs +0 -86
  184. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/aggregate.mjs.map +0 -1
  185. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/client_bulk_write/client_bulk_write.mjs +0 -60
  186. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/client_bulk_write/client_bulk_write.mjs.map +0 -1
  187. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/client_bulk_write/command_builder.mjs +0 -264
  188. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/client_bulk_write/command_builder.mjs.map +0 -1
  189. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/client_bulk_write/executor.mjs +0 -109
  190. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/client_bulk_write/executor.mjs.map +0 -1
  191. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/client_bulk_write/results_merger.mjs +0 -172
  192. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/client_bulk_write/results_merger.mjs.map +0 -1
  193. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/command.mjs +0 -68
  194. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/command.mjs.map +0 -1
  195. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/count.mjs +0 -53
  196. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/count.mjs.map +0 -1
  197. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/create_collection.mjs +0 -123
  198. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/create_collection.mjs.map +0 -1
  199. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/delete.mjs +0 -119
  200. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/delete.mjs.map +0 -1
  201. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/distinct.mjs +0 -65
  202. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/distinct.mjs.map +0 -1
  203. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/drop.mjs +0 -97
  204. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/drop.mjs.map +0 -1
  205. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/estimated_document_count.mjs +0 -47
  206. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/estimated_document_count.mjs.map +0 -1
  207. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/execute_operation.mjs +0 -188
  208. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/execute_operation.mjs.map +0 -1
  209. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/find.mjs +0 -103
  210. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/find.mjs.map +0 -1
  211. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/find_and_modify.mjs +0 -136
  212. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/find_and_modify.mjs.map +0 -1
  213. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/get_more.mjs +0 -61
  214. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/get_more.mjs.map +0 -1
  215. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/indexes.mjs +0 -179
  216. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/indexes.mjs.map +0 -1
  217. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/insert.mjs +0 -77
  218. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/insert.mjs.map +0 -1
  219. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/kill_cursors.mjs +0 -48
  220. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/kill_cursors.mjs.map +0 -1
  221. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/list_collections.mjs +0 -60
  222. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/list_collections.mjs.map +0 -1
  223. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/list_databases.mjs +0 -43
  224. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/list_databases.mjs.map +0 -1
  225. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/operation.mjs +0 -105
  226. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/operation.mjs.map +0 -1
  227. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/profiling_level.mjs +0 -50
  228. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/profiling_level.mjs.map +0 -1
  229. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/remove_user.mjs +0 -39
  230. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/remove_user.mjs.map +0 -1
  231. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/rename.mjs +0 -49
  232. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/rename.mjs.map +0 -1
  233. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/run_command.mjs +0 -58
  234. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/run_command.mjs.map +0 -1
  235. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/search_indexes/create.mjs +0 -46
  236. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/search_indexes/create.mjs.map +0 -1
  237. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/search_indexes/drop.mjs +0 -48
  238. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/search_indexes/drop.mjs.map +0 -1
  239. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/search_indexes/update.mjs +0 -46
  240. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/search_indexes/update.mjs.map +0 -1
  241. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/set_profiling_level.mjs +0 -67
  242. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/set_profiling_level.mjs.map +0 -1
  243. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/stats.mjs +0 -37
  244. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/stats.mjs.map +0 -1
  245. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/update.mjs +0 -171
  246. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/update.mjs.map +0 -1
  247. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/validate_collection.mjs +0 -45
  248. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/validate_collection.mjs.map +0 -1
  249. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/read_concern.mjs +0 -71
  250. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/read_concern.mjs.map +0 -1
  251. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/read_preference.mjs +0 -165
  252. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/read_preference.mjs.map +0 -1
  253. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/resource_management.mjs +0 -62
  254. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/resource_management.mjs.map +0 -1
  255. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/sdam/common.mjs +0 -51
  256. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/sdam/common.mjs.map +0 -1
  257. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/sdam/events.mjs +0 -156
  258. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/sdam/events.mjs.map +0 -1
  259. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/sdam/monitor.mjs +0 -477
  260. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/sdam/monitor.mjs.map +0 -1
  261. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/sdam/server.mjs +0 -315
  262. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/sdam/server.mjs.map +0 -1
  263. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/sdam/server_description.mjs +0 -157
  264. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/sdam/server_description.mjs.map +0 -1
  265. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/sdam/server_selection.mjs +0 -184
  266. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/sdam/server_selection.mjs.map +0 -1
  267. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/sdam/server_selection_events.mjs +0 -96
  268. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/sdam/server_selection_events.mjs.map +0 -1
  269. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/sdam/srv_polling.mjs +0 -107
  270. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/sdam/srv_polling.mjs.map +0 -1
  271. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/sdam/topology.mjs +0 -540
  272. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/sdam/topology.mjs.map +0 -1
  273. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/sdam/topology_description.mjs +0 -298
  274. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/sdam/topology_description.mjs.map +0 -1
  275. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/sessions.mjs +0 -623
  276. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/sessions.mjs.map +0 -1
  277. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/sort.mjs +0 -91
  278. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/sort.mjs.map +0 -1
  279. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/timeout.mjs +0 -254
  280. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/timeout.mjs.map +0 -1
  281. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/transactions.mjs +0 -138
  282. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/transactions.mjs.map +0 -1
  283. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/utils.mjs +0 -993
  284. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/utils.mjs.map +0 -1
  285. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/write_concern.mjs +0 -81
  286. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/write_concern.mjs.map +0 -1
  287. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/package.mjs +0 -171
  288. package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/package.mjs.map +0 -1
  289. package/dist/node_modules/.pnpm/punycode@2.3.1/node_modules/punycode/punycode.mjs +0 -295
  290. package/dist/node_modules/.pnpm/punycode@2.3.1/node_modules/punycode/punycode.mjs.map +0 -1
  291. package/dist/node_modules/.pnpm/sparse-bitfield@3.0.3/node_modules/sparse-bitfield/index.mjs +0 -81
  292. package/dist/node_modules/.pnpm/sparse-bitfield@3.0.3/node_modules/sparse-bitfield/index.mjs.map +0 -1
  293. package/dist/node_modules/.pnpm/tr46@5.1.1/node_modules/tr46/index.mjs +0 -206
  294. package/dist/node_modules/.pnpm/tr46@5.1.1/node_modules/tr46/index.mjs.map +0 -1
  295. package/dist/node_modules/.pnpm/tr46@5.1.1/node_modules/tr46/lib/mappingTable.mjs +0 -33590
  296. package/dist/node_modules/.pnpm/tr46@5.1.1/node_modules/tr46/lib/mappingTable.mjs.map +0 -1
  297. package/dist/node_modules/.pnpm/tr46@5.1.1/node_modules/tr46/lib/regexes.mjs +0 -37
  298. package/dist/node_modules/.pnpm/tr46@5.1.1/node_modules/tr46/lib/regexes.mjs.map +0 -1
  299. package/dist/node_modules/.pnpm/tr46@5.1.1/node_modules/tr46/lib/statusMapping.mjs +0 -18
  300. package/dist/node_modules/.pnpm/tr46@5.1.1/node_modules/tr46/lib/statusMapping.mjs.map +0 -1
  301. package/dist/node_modules/.pnpm/webidl-conversions@7.0.0/node_modules/webidl-conversions/lib/index.mjs +0 -252
  302. package/dist/node_modules/.pnpm/webidl-conversions@7.0.0/node_modules/webidl-conversions/lib/index.mjs.map +0 -1
  303. package/dist/node_modules/.pnpm/whatwg-url@14.2.0/node_modules/whatwg-url/index.mjs +0 -41
  304. package/dist/node_modules/.pnpm/whatwg-url@14.2.0/node_modules/whatwg-url/index.mjs.map +0 -1
  305. package/dist/node_modules/.pnpm/whatwg-url@14.2.0/node_modules/whatwg-url/lib/Function.mjs +0 -41
  306. package/dist/node_modules/.pnpm/whatwg-url@14.2.0/node_modules/whatwg-url/lib/Function.mjs.map +0 -1
  307. package/dist/node_modules/.pnpm/whatwg-url@14.2.0/node_modules/whatwg-url/lib/URL-impl.mjs +0 -173
  308. package/dist/node_modules/.pnpm/whatwg-url@14.2.0/node_modules/whatwg-url/lib/URL-impl.mjs.map +0 -1
  309. package/dist/node_modules/.pnpm/whatwg-url@14.2.0/node_modules/whatwg-url/lib/URL.mjs +0 -334
  310. package/dist/node_modules/.pnpm/whatwg-url@14.2.0/node_modules/whatwg-url/lib/URL.mjs.map +0 -1
  311. package/dist/node_modules/.pnpm/whatwg-url@14.2.0/node_modules/whatwg-url/lib/URLSearchParams-impl.mjs +0 -90
  312. package/dist/node_modules/.pnpm/whatwg-url@14.2.0/node_modules/whatwg-url/lib/URLSearchParams-impl.mjs.map +0 -1
  313. package/dist/node_modules/.pnpm/whatwg-url@14.2.0/node_modules/whatwg-url/lib/URLSearchParams.mjs +0 -356
  314. package/dist/node_modules/.pnpm/whatwg-url@14.2.0/node_modules/whatwg-url/lib/URLSearchParams.mjs.map +0 -1
  315. package/dist/node_modules/.pnpm/whatwg-url@14.2.0/node_modules/whatwg-url/lib/encoding.mjs +0 -23
  316. package/dist/node_modules/.pnpm/whatwg-url@14.2.0/node_modules/whatwg-url/lib/encoding.mjs.map +0 -1
  317. package/dist/node_modules/.pnpm/whatwg-url@14.2.0/node_modules/whatwg-url/lib/infra.mjs +0 -29
  318. package/dist/node_modules/.pnpm/whatwg-url@14.2.0/node_modules/whatwg-url/lib/infra.mjs.map +0 -1
  319. package/dist/node_modules/.pnpm/whatwg-url@14.2.0/node_modules/whatwg-url/lib/percent-encoding.mjs +0 -140
  320. package/dist/node_modules/.pnpm/whatwg-url@14.2.0/node_modules/whatwg-url/lib/percent-encoding.mjs.map +0 -1
  321. package/dist/node_modules/.pnpm/whatwg-url@14.2.0/node_modules/whatwg-url/lib/url-state-machine.mjs +0 -831
  322. package/dist/node_modules/.pnpm/whatwg-url@14.2.0/node_modules/whatwg-url/lib/url-state-machine.mjs.map +0 -1
  323. package/dist/node_modules/.pnpm/whatwg-url@14.2.0/node_modules/whatwg-url/lib/urlencoded.mjs +0 -77
  324. package/dist/node_modules/.pnpm/whatwg-url@14.2.0/node_modules/whatwg-url/lib/urlencoded.mjs.map +0 -1
  325. package/dist/node_modules/.pnpm/whatwg-url@14.2.0/node_modules/whatwg-url/lib/utils.mjs +0 -147
  326. package/dist/node_modules/.pnpm/whatwg-url@14.2.0/node_modules/whatwg-url/lib/utils.mjs.map +0 -1
  327. package/dist/node_modules/.pnpm/whatwg-url@14.2.0/node_modules/whatwg-url/webidl2js-wrapper.mjs +0 -17
  328. package/dist/node_modules/.pnpm/whatwg-url@14.2.0/node_modules/whatwg-url/webidl2js-wrapper.mjs.map +0 -1
@@ -1,128 +0,0 @@
1
- import { __commonJSMin, __require } from "../../../../../../../../_virtual/rolldown_runtime.mjs";
2
- import { require_error } from "../../error.mjs";
3
- import { require_utils } from "../../utils.mjs";
4
- import { require_deps } from "../../deps.mjs";
5
- import { require_auth_provider } from "./auth_provider.mjs";
6
-
7
- //#region ../../node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/auth/gssapi.js
8
- var require_gssapi = /* @__PURE__ */ __commonJSMin(((exports) => {
9
- Object.defineProperty(exports, "__esModule", { value: true });
10
- exports.GSSAPI = exports.GSSAPICanonicalizationValue = void 0;
11
- exports.performGSSAPICanonicalizeHostName = performGSSAPICanonicalizeHostName;
12
- exports.resolveCname = resolveCname;
13
- const dns = __require("dns");
14
- const deps_1 = require_deps();
15
- const error_1 = require_error();
16
- const utils_1 = require_utils();
17
- const auth_provider_1 = require_auth_provider();
18
- /** @public */
19
- exports.GSSAPICanonicalizationValue = Object.freeze({
20
- on: true,
21
- off: false,
22
- none: "none",
23
- forward: "forward",
24
- forwardAndReverse: "forwardAndReverse"
25
- });
26
- async function externalCommand(connection, command) {
27
- return await connection.command((0, utils_1.ns)("$external.$cmd"), command);
28
- }
29
- let krb;
30
- var GSSAPI = class extends auth_provider_1.AuthProvider {
31
- async auth(authContext) {
32
- const { connection, credentials } = authContext;
33
- if (credentials == null) throw new error_1.MongoMissingCredentialsError("Credentials required for GSSAPI authentication");
34
- const { username } = credentials;
35
- const client = await makeKerberosClient(authContext);
36
- const saslStartResponse = await externalCommand(connection, saslStart(await client.step("")));
37
- const saslContinueResponse = await externalCommand(connection, saslContinue(await negotiate(client, 10, saslStartResponse.payload), saslStartResponse.conversationId));
38
- const finalizePayload = await finalize(client, username, saslContinueResponse.payload);
39
- await externalCommand(connection, {
40
- saslContinue: 1,
41
- conversationId: saslContinueResponse.conversationId,
42
- payload: finalizePayload
43
- });
44
- }
45
- };
46
- exports.GSSAPI = GSSAPI;
47
- async function makeKerberosClient(authContext) {
48
- const { hostAddress } = authContext.options;
49
- const { credentials } = authContext;
50
- if (!hostAddress || typeof hostAddress.host !== "string" || !credentials) throw new error_1.MongoInvalidArgumentError("Connection must have host and port and credentials defined.");
51
- loadKrb();
52
- if ("kModuleError" in krb) throw krb["kModuleError"];
53
- const { initializeClient } = krb;
54
- const { username, password } = credentials;
55
- const mechanismProperties = credentials.mechanismProperties;
56
- const serviceName = mechanismProperties.SERVICE_NAME ?? "mongodb";
57
- const host = await performGSSAPICanonicalizeHostName(hostAddress.host, mechanismProperties);
58
- const initOptions = {};
59
- if (password != null) Object.assign(initOptions, {
60
- user: username,
61
- password
62
- });
63
- const spnHost = mechanismProperties.SERVICE_HOST ?? host;
64
- let spn = `${serviceName}${process.platform === "win32" ? "/" : "@"}${spnHost}`;
65
- if ("SERVICE_REALM" in mechanismProperties) spn = `${spn}@${mechanismProperties.SERVICE_REALM}`;
66
- return await initializeClient(spn, initOptions);
67
- }
68
- function saslStart(payload) {
69
- return {
70
- saslStart: 1,
71
- mechanism: "GSSAPI",
72
- payload,
73
- autoAuthorize: 1
74
- };
75
- }
76
- function saslContinue(payload, conversationId) {
77
- return {
78
- saslContinue: 1,
79
- conversationId,
80
- payload
81
- };
82
- }
83
- async function negotiate(client, retries, payload) {
84
- try {
85
- return await client.step(payload) || "";
86
- } catch (error) {
87
- if (retries === 0) throw error;
88
- return await negotiate(client, retries - 1, payload);
89
- }
90
- }
91
- async function finalize(client, user, payload) {
92
- const response = await client.unwrap(payload);
93
- return await client.wrap(response || "", { user });
94
- }
95
- async function performGSSAPICanonicalizeHostName(host, mechanismProperties) {
96
- const mode = mechanismProperties.CANONICALIZE_HOST_NAME;
97
- if (!mode || mode === exports.GSSAPICanonicalizationValue.none) return host;
98
- if (mode === exports.GSSAPICanonicalizationValue.on || mode === exports.GSSAPICanonicalizationValue.forwardAndReverse) {
99
- const { address } = await dns.promises.lookup(host);
100
- try {
101
- const results = await dns.promises.resolvePtr(address);
102
- return results.length > 0 ? results[0] : host;
103
- } catch {
104
- return await resolveCname(host);
105
- }
106
- } else return await resolveCname(host);
107
- }
108
- async function resolveCname(host) {
109
- try {
110
- const results = await dns.promises.resolveCname(host);
111
- return results.length > 0 ? results[0] : host;
112
- } catch {
113
- return host;
114
- }
115
- }
116
- /**
117
- * Load the Kerberos library.
118
- */
119
- function loadKrb() {
120
- if (!krb) krb = (0, deps_1.getKerberos)();
121
- }
122
- }));
123
-
124
- //#endregion
125
- export default require_gssapi();
126
-
127
- export { require_gssapi };
128
- //# sourceMappingURL=gssapi.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"gssapi.mjs","names":[],"sources":["../../../../../../../../../../../node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/auth/gssapi.js"],"sourcesContent":["\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.GSSAPI = exports.GSSAPICanonicalizationValue = void 0;\nexports.performGSSAPICanonicalizeHostName = performGSSAPICanonicalizeHostName;\nexports.resolveCname = resolveCname;\nconst dns = require(\"dns\");\nconst deps_1 = require(\"../../deps\");\nconst error_1 = require(\"../../error\");\nconst utils_1 = require(\"../../utils\");\nconst auth_provider_1 = require(\"./auth_provider\");\n/** @public */\nexports.GSSAPICanonicalizationValue = Object.freeze({\n on: true,\n off: false,\n none: 'none',\n forward: 'forward',\n forwardAndReverse: 'forwardAndReverse'\n});\nasync function externalCommand(connection, command) {\n const response = await connection.command((0, utils_1.ns)('$external.$cmd'), command);\n return response;\n}\nlet krb;\nclass GSSAPI extends auth_provider_1.AuthProvider {\n async auth(authContext) {\n const { connection, credentials } = authContext;\n if (credentials == null) {\n throw new error_1.MongoMissingCredentialsError('Credentials required for GSSAPI authentication');\n }\n const { username } = credentials;\n const client = await makeKerberosClient(authContext);\n const payload = await client.step('');\n const saslStartResponse = await externalCommand(connection, saslStart(payload));\n const negotiatedPayload = await negotiate(client, 10, saslStartResponse.payload);\n const saslContinueResponse = await externalCommand(connection, saslContinue(negotiatedPayload, saslStartResponse.conversationId));\n const finalizePayload = await finalize(client, username, saslContinueResponse.payload);\n await externalCommand(connection, {\n saslContinue: 1,\n conversationId: saslContinueResponse.conversationId,\n payload: finalizePayload\n });\n }\n}\nexports.GSSAPI = GSSAPI;\nasync function makeKerberosClient(authContext) {\n const { hostAddress } = authContext.options;\n const { credentials } = authContext;\n if (!hostAddress || typeof hostAddress.host !== 'string' || !credentials) {\n throw new error_1.MongoInvalidArgumentError('Connection must have host and port and credentials defined.');\n }\n loadKrb();\n if ('kModuleError' in krb) {\n throw krb['kModuleError'];\n }\n const { initializeClient } = krb;\n const { username, password } = credentials;\n const mechanismProperties = credentials.mechanismProperties;\n const serviceName = mechanismProperties.SERVICE_NAME ?? 'mongodb';\n const host = await performGSSAPICanonicalizeHostName(hostAddress.host, mechanismProperties);\n const initOptions = {};\n if (password != null) {\n // TODO(NODE-5139): These do not match the typescript options in initializeClient\n Object.assign(initOptions, { user: username, password: password });\n }\n const spnHost = mechanismProperties.SERVICE_HOST ?? host;\n let spn = `${serviceName}${process.platform === 'win32' ? '/' : '@'}${spnHost}`;\n if ('SERVICE_REALM' in mechanismProperties) {\n spn = `${spn}@${mechanismProperties.SERVICE_REALM}`;\n }\n return await initializeClient(spn, initOptions);\n}\nfunction saslStart(payload) {\n return {\n saslStart: 1,\n mechanism: 'GSSAPI',\n payload,\n autoAuthorize: 1\n };\n}\nfunction saslContinue(payload, conversationId) {\n return {\n saslContinue: 1,\n conversationId,\n payload\n };\n}\nasync function negotiate(client, retries, payload) {\n try {\n const response = await client.step(payload);\n return response || '';\n }\n catch (error) {\n if (retries === 0) {\n // Retries exhausted, raise error\n throw error;\n }\n // Adjust number of retries and call step again\n return await negotiate(client, retries - 1, payload);\n }\n}\nasync function finalize(client, user, payload) {\n // GSS Client Unwrap\n const response = await client.unwrap(payload);\n return await client.wrap(response || '', { user });\n}\nasync function performGSSAPICanonicalizeHostName(host, mechanismProperties) {\n const mode = mechanismProperties.CANONICALIZE_HOST_NAME;\n if (!mode || mode === exports.GSSAPICanonicalizationValue.none) {\n return host;\n }\n // If forward and reverse or true\n if (mode === exports.GSSAPICanonicalizationValue.on ||\n mode === exports.GSSAPICanonicalizationValue.forwardAndReverse) {\n // Perform the lookup of the ip address.\n const { address } = await dns.promises.lookup(host);\n try {\n // Perform a reverse ptr lookup on the ip address.\n const results = await dns.promises.resolvePtr(address);\n // If the ptr did not error but had no results, return the host.\n return results.length > 0 ? results[0] : host;\n }\n catch {\n // This can error as ptr records may not exist for all ips. In this case\n // fallback to a cname lookup as dns.lookup() does not return the\n // cname.\n return await resolveCname(host);\n }\n }\n else {\n // The case for forward is just to resolve the cname as dns.lookup()\n // will not return it.\n return await resolveCname(host);\n }\n}\nasync function resolveCname(host) {\n // Attempt to resolve the host name\n try {\n const results = await dns.promises.resolveCname(host);\n // Get the first resolved host id\n return results.length > 0 ? results[0] : host;\n }\n catch {\n return host;\n }\n}\n/**\n * Load the Kerberos library.\n */\nfunction loadKrb() {\n if (!krb) {\n krb = (0, deps_1.getKerberos)();\n }\n}\n//# sourceMappingURL=gssapi.js.map"],"x_google_ignoreList":[0],"mappings":";;;;;;;;AACA,QAAO,eAAe,SAAS,cAAc,EAAE,OAAO,MAAM,CAAC;AAC7D,SAAQ,SAAS,QAAQ,8BAA8B,KAAK;AAC5D,SAAQ,oCAAoC;AAC5C,SAAQ,eAAe;CACvB,MAAM,gBAAc,MAAM;CAC1B,MAAM;CACN,MAAM;CACN,MAAM;CACN,MAAM;;AAEN,SAAQ,8BAA8B,OAAO,OAAO;EAChD,IAAI;EACJ,KAAK;EACL,MAAM;EACN,SAAS;EACT,mBAAmB;EACtB,CAAC;CACF,eAAe,gBAAgB,YAAY,SAAS;AAEhD,SADiB,MAAM,WAAW,SAAS,GAAG,QAAQ,IAAI,iBAAiB,EAAE,QAAQ;;CAGzF,IAAI;CACJ,IAAM,SAAN,cAAqB,gBAAgB,aAAa;EAC9C,MAAM,KAAK,aAAa;GACpB,MAAM,EAAE,YAAY,gBAAgB;AACpC,OAAI,eAAe,KACf,OAAM,IAAI,QAAQ,6BAA6B,iDAAiD;GAEpG,MAAM,EAAE,aAAa;GACrB,MAAM,SAAS,MAAM,mBAAmB,YAAY;GAEpD,MAAM,oBAAoB,MAAM,gBAAgB,YAAY,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I;AAEA,UADiB,MAAM,OAAO,KAAK,QAAQ,IACxB;WAEhB,OAAO;AACV,OAAI,YAAY,EAEZ,OAAM;AAGV,UAAO,MAAM,UAAU,QAAQ,UAAU,GAAG,QAAQ;;;CAG5D,eAAe,SAAS,QAAQ,MAAM,SAAS;EAE3C,MAAM,WAAW,MAAM,OAAO,OAAO,QAAQ;AAC7C,SAAO,MAAM,OAAO,KAAK,YAAY,IAAI,EAAE,MAAM,CAAC;;CAEtD,eAAe,kCAAkC,MAAM,qBAAqB;EACxE,MAAM,OAAO,oBAAoB;AACjC,MAAI,CAAC,QAAQ,SAAS,QAAQ,4BAA4B,KACtD,QAAO;AAGX,MAAI,SAAS,QAAQ,4BAA4B,MAC7C,SAAS,QAAQ,4BAA4B,mBAAmB;GAEhE,MAAM,EAAE,YAAY,MAAM,IAAI,SAAS,OAAO,KAAK;AACnD,OAAI;IAEA,MAAM,UAAU,MAAM,IAAI,SAAS,WAAW,QAAQ;AAEtD,WAAO,QAAQ,SAAS,IAAI,QAAQ,KAAK;WAEvC;AAIF,WAAO,MAAM,aAAa,KAAK;;QAMnC,QAAO,MAAM,aAAa,KAAK;;CAGvC,eAAe,aAAa,MAAM;AAE9B,MAAI;GACA,MAAM,UAAU,MAAM,IAAI,SAAS,aAAa,KAAK;AAErD,UAAO,QAAQ,SAAS,IAAI,QAAQ,KAAK;UAEvC;AACF,UAAO;;;;;;CAMf,SAAS,UAAU;AACf,MAAI,CAAC,IACD,QAAO,GAAG,OAAO,cAAc"}
@@ -1,133 +0,0 @@
1
- import { __commonJSMin } from "../../../../../../../../_virtual/rolldown_runtime.mjs";
2
- import { require_error } from "../../error.mjs";
3
- import { require_gssapi } from "./gssapi.mjs";
4
- import { require_providers } from "./providers.mjs";
5
-
6
- //#region ../../node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/auth/mongo_credentials.js
7
- var require_mongo_credentials = /* @__PURE__ */ __commonJSMin(((exports) => {
8
- Object.defineProperty(exports, "__esModule", { value: true });
9
- exports.MongoCredentials = exports.DEFAULT_ALLOWED_HOSTS = void 0;
10
- const error_1 = require_error();
11
- const gssapi_1 = require_gssapi();
12
- const providers_1 = require_providers();
13
- /**
14
- * @see https://github.com/mongodb/specifications/blob/master/source/auth/auth.md
15
- */
16
- function getDefaultAuthMechanism(hello) {
17
- if (hello) {
18
- if (Array.isArray(hello.saslSupportedMechs)) return hello.saslSupportedMechs.includes(providers_1.AuthMechanism.MONGODB_SCRAM_SHA256) ? providers_1.AuthMechanism.MONGODB_SCRAM_SHA256 : providers_1.AuthMechanism.MONGODB_SCRAM_SHA1;
19
- }
20
- return providers_1.AuthMechanism.MONGODB_SCRAM_SHA256;
21
- }
22
- const ALLOWED_ENVIRONMENT_NAMES = [
23
- "test",
24
- "azure",
25
- "gcp",
26
- "k8s"
27
- ];
28
- const ALLOWED_HOSTS_ERROR = "Auth mechanism property ALLOWED_HOSTS must be an array of strings.";
29
- /** @internal */
30
- exports.DEFAULT_ALLOWED_HOSTS = [
31
- "*.mongodb.net",
32
- "*.mongodb-qa.net",
33
- "*.mongodb-dev.net",
34
- "*.mongodbgov.net",
35
- "localhost",
36
- "127.0.0.1",
37
- "::1"
38
- ];
39
- /** Error for when the token audience is missing in the environment. */
40
- const TOKEN_RESOURCE_MISSING_ERROR = "TOKEN_RESOURCE must be set in the auth mechanism properties when ENVIRONMENT is azure or gcp.";
41
- /**
42
- * A representation of the credentials used by MongoDB
43
- * @public
44
- */
45
- var MongoCredentials = class MongoCredentials {
46
- constructor(options) {
47
- this.username = options.username ?? "";
48
- this.password = options.password;
49
- this.source = options.source;
50
- if (!this.source && options.db) this.source = options.db;
51
- this.mechanism = options.mechanism || providers_1.AuthMechanism.MONGODB_DEFAULT;
52
- this.mechanismProperties = options.mechanismProperties || {};
53
- if (this.mechanism.match(/MONGODB-AWS/i)) {
54
- if (!this.username && process.env.AWS_ACCESS_KEY_ID) this.username = process.env.AWS_ACCESS_KEY_ID;
55
- if (!this.password && process.env.AWS_SECRET_ACCESS_KEY) this.password = process.env.AWS_SECRET_ACCESS_KEY;
56
- if (this.mechanismProperties.AWS_SESSION_TOKEN == null && process.env.AWS_SESSION_TOKEN != null) this.mechanismProperties = {
57
- ...this.mechanismProperties,
58
- AWS_SESSION_TOKEN: process.env.AWS_SESSION_TOKEN
59
- };
60
- }
61
- if (this.mechanism === providers_1.AuthMechanism.MONGODB_OIDC && !this.mechanismProperties.ALLOWED_HOSTS) this.mechanismProperties = {
62
- ...this.mechanismProperties,
63
- ALLOWED_HOSTS: exports.DEFAULT_ALLOWED_HOSTS
64
- };
65
- Object.freeze(this.mechanismProperties);
66
- Object.freeze(this);
67
- }
68
- /** Determines if two MongoCredentials objects are equivalent */
69
- equals(other) {
70
- return this.mechanism === other.mechanism && this.username === other.username && this.password === other.password && this.source === other.source;
71
- }
72
- /**
73
- * If the authentication mechanism is set to "default", resolves the authMechanism
74
- * based on the server version and server supported sasl mechanisms.
75
- *
76
- * @param hello - A hello response from the server
77
- */
78
- resolveAuthMechanism(hello) {
79
- if (this.mechanism.match(/DEFAULT/i)) return new MongoCredentials({
80
- username: this.username,
81
- password: this.password,
82
- source: this.source,
83
- mechanism: getDefaultAuthMechanism(hello),
84
- mechanismProperties: this.mechanismProperties
85
- });
86
- return this;
87
- }
88
- validate() {
89
- if ((this.mechanism === providers_1.AuthMechanism.MONGODB_GSSAPI || this.mechanism === providers_1.AuthMechanism.MONGODB_PLAIN || this.mechanism === providers_1.AuthMechanism.MONGODB_SCRAM_SHA1 || this.mechanism === providers_1.AuthMechanism.MONGODB_SCRAM_SHA256) && !this.username) throw new error_1.MongoMissingCredentialsError(`Username required for mechanism '${this.mechanism}'`);
90
- if (this.mechanism === providers_1.AuthMechanism.MONGODB_OIDC) {
91
- if (this.username && this.mechanismProperties.ENVIRONMENT && this.mechanismProperties.ENVIRONMENT !== "azure") throw new error_1.MongoInvalidArgumentError(`username and ENVIRONMENT '${this.mechanismProperties.ENVIRONMENT}' may not be used together for mechanism '${this.mechanism}'.`);
92
- if (this.username && this.password) throw new error_1.MongoInvalidArgumentError(`No password is allowed in ENVIRONMENT '${this.mechanismProperties.ENVIRONMENT}' for '${this.mechanism}'.`);
93
- if ((this.mechanismProperties.ENVIRONMENT === "azure" || this.mechanismProperties.ENVIRONMENT === "gcp") && !this.mechanismProperties.TOKEN_RESOURCE) throw new error_1.MongoInvalidArgumentError(TOKEN_RESOURCE_MISSING_ERROR);
94
- if (this.mechanismProperties.ENVIRONMENT && !ALLOWED_ENVIRONMENT_NAMES.includes(this.mechanismProperties.ENVIRONMENT)) throw new error_1.MongoInvalidArgumentError(`Currently only a ENVIRONMENT in ${ALLOWED_ENVIRONMENT_NAMES.join(",")} is supported for mechanism '${this.mechanism}'.`);
95
- if (!this.mechanismProperties.ENVIRONMENT && !this.mechanismProperties.OIDC_CALLBACK && !this.mechanismProperties.OIDC_HUMAN_CALLBACK) throw new error_1.MongoInvalidArgumentError(`Either a ENVIRONMENT, OIDC_CALLBACK, or OIDC_HUMAN_CALLBACK must be specified for mechanism '${this.mechanism}'.`);
96
- if (this.mechanismProperties.ALLOWED_HOSTS) {
97
- const hosts = this.mechanismProperties.ALLOWED_HOSTS;
98
- if (!Array.isArray(hosts)) throw new error_1.MongoInvalidArgumentError(ALLOWED_HOSTS_ERROR);
99
- for (const host of hosts) if (typeof host !== "string") throw new error_1.MongoInvalidArgumentError(ALLOWED_HOSTS_ERROR);
100
- }
101
- }
102
- if (providers_1.AUTH_MECHS_AUTH_SRC_EXTERNAL.has(this.mechanism)) {
103
- if (this.source != null && this.source !== "$external") throw new error_1.MongoAPIError(`Invalid source '${this.source}' for mechanism '${this.mechanism}' specified.`);
104
- }
105
- if (this.mechanism === providers_1.AuthMechanism.MONGODB_PLAIN && this.source == null) throw new error_1.MongoAPIError("PLAIN Authentication Mechanism needs an auth source");
106
- if (this.mechanism === providers_1.AuthMechanism.MONGODB_X509 && this.password != null) {
107
- if (this.password === "") {
108
- Reflect.set(this, "password", void 0);
109
- return;
110
- }
111
- throw new error_1.MongoAPIError(`Password not allowed for mechanism MONGODB-X509`);
112
- }
113
- const canonicalization = this.mechanismProperties.CANONICALIZE_HOST_NAME ?? false;
114
- if (!Object.values(gssapi_1.GSSAPICanonicalizationValue).includes(canonicalization)) throw new error_1.MongoAPIError(`Invalid CANONICALIZE_HOST_NAME value: ${canonicalization}`);
115
- }
116
- static merge(creds, options) {
117
- return new MongoCredentials({
118
- username: options.username ?? creds?.username ?? "",
119
- password: options.password ?? creds?.password ?? "",
120
- mechanism: options.mechanism ?? creds?.mechanism ?? providers_1.AuthMechanism.MONGODB_DEFAULT,
121
- mechanismProperties: options.mechanismProperties ?? creds?.mechanismProperties ?? {},
122
- source: options.source ?? options.db ?? creds?.source ?? "admin"
123
- });
124
- }
125
- };
126
- exports.MongoCredentials = MongoCredentials;
127
- }));
128
-
129
- //#endregion
130
- export default require_mongo_credentials();
131
-
132
- export { require_mongo_credentials };
133
- //# sourceMappingURL=mongo_credentials.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"mongo_credentials.mjs","names":[],"sources":["../../../../../../../../../../../node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/auth/mongo_credentials.js"],"sourcesContent":["\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.MongoCredentials = exports.DEFAULT_ALLOWED_HOSTS = void 0;\nconst error_1 = require(\"../../error\");\nconst gssapi_1 = require(\"./gssapi\");\nconst providers_1 = require(\"./providers\");\n/**\n * @see https://github.com/mongodb/specifications/blob/master/source/auth/auth.md\n */\nfunction getDefaultAuthMechanism(hello) {\n if (hello) {\n // If hello contains saslSupportedMechs, use scram-sha-256\n // if it is available, else scram-sha-1\n if (Array.isArray(hello.saslSupportedMechs)) {\n return hello.saslSupportedMechs.includes(providers_1.AuthMechanism.MONGODB_SCRAM_SHA256)\n ? providers_1.AuthMechanism.MONGODB_SCRAM_SHA256\n : providers_1.AuthMechanism.MONGODB_SCRAM_SHA1;\n }\n }\n // Default auth mechanism for 4.0 and higher.\n return providers_1.AuthMechanism.MONGODB_SCRAM_SHA256;\n}\nconst ALLOWED_ENVIRONMENT_NAMES = [\n 'test',\n 'azure',\n 'gcp',\n 'k8s'\n];\nconst ALLOWED_HOSTS_ERROR = 'Auth mechanism property ALLOWED_HOSTS must be an array of strings.';\n/** @internal */\nexports.DEFAULT_ALLOWED_HOSTS = [\n '*.mongodb.net',\n '*.mongodb-qa.net',\n '*.mongodb-dev.net',\n '*.mongodbgov.net',\n 'localhost',\n '127.0.0.1',\n '::1'\n];\n/** Error for when the token audience is missing in the environment. */\nconst TOKEN_RESOURCE_MISSING_ERROR = 'TOKEN_RESOURCE must be set in the auth mechanism properties when ENVIRONMENT is azure or gcp.';\n/**\n * A representation of the credentials used by MongoDB\n * @public\n */\nclass MongoCredentials {\n constructor(options) {\n this.username = options.username ?? '';\n this.password = options.password;\n this.source = options.source;\n if (!this.source && options.db) {\n this.source = options.db;\n }\n this.mechanism = options.mechanism || providers_1.AuthMechanism.MONGODB_DEFAULT;\n this.mechanismProperties = options.mechanismProperties || {};\n if (this.mechanism.match(/MONGODB-AWS/i)) {\n if (!this.username && process.env.AWS_ACCESS_KEY_ID) {\n this.username = process.env.AWS_ACCESS_KEY_ID;\n }\n if (!this.password && process.env.AWS_SECRET_ACCESS_KEY) {\n this.password = process.env.AWS_SECRET_ACCESS_KEY;\n }\n if (this.mechanismProperties.AWS_SESSION_TOKEN == null &&\n process.env.AWS_SESSION_TOKEN != null) {\n this.mechanismProperties = {\n ...this.mechanismProperties,\n AWS_SESSION_TOKEN: process.env.AWS_SESSION_TOKEN\n };\n }\n }\n if (this.mechanism === providers_1.AuthMechanism.MONGODB_OIDC && !this.mechanismProperties.ALLOWED_HOSTS) {\n this.mechanismProperties = {\n ...this.mechanismProperties,\n ALLOWED_HOSTS: exports.DEFAULT_ALLOWED_HOSTS\n };\n }\n Object.freeze(this.mechanismProperties);\n Object.freeze(this);\n }\n /** Determines if two MongoCredentials objects are equivalent */\n equals(other) {\n return (this.mechanism === other.mechanism &&\n this.username === other.username &&\n this.password === other.password &&\n this.source === other.source);\n }\n /**\n * If the authentication mechanism is set to \"default\", resolves the authMechanism\n * based on the server version and server supported sasl mechanisms.\n *\n * @param hello - A hello response from the server\n */\n resolveAuthMechanism(hello) {\n // If the mechanism is not \"default\", then it does not need to be resolved\n if (this.mechanism.match(/DEFAULT/i)) {\n return new MongoCredentials({\n username: this.username,\n password: this.password,\n source: this.source,\n mechanism: getDefaultAuthMechanism(hello),\n mechanismProperties: this.mechanismProperties\n });\n }\n return this;\n }\n validate() {\n if ((this.mechanism === providers_1.AuthMechanism.MONGODB_GSSAPI ||\n this.mechanism === providers_1.AuthMechanism.MONGODB_PLAIN ||\n this.mechanism === providers_1.AuthMechanism.MONGODB_SCRAM_SHA1 ||\n this.mechanism === providers_1.AuthMechanism.MONGODB_SCRAM_SHA256) &&\n !this.username) {\n throw new error_1.MongoMissingCredentialsError(`Username required for mechanism '${this.mechanism}'`);\n }\n if (this.mechanism === providers_1.AuthMechanism.MONGODB_OIDC) {\n if (this.username &&\n this.mechanismProperties.ENVIRONMENT &&\n this.mechanismProperties.ENVIRONMENT !== 'azure') {\n throw new error_1.MongoInvalidArgumentError(`username and ENVIRONMENT '${this.mechanismProperties.ENVIRONMENT}' may not be used together for mechanism '${this.mechanism}'.`);\n }\n if (this.username && this.password) {\n throw new error_1.MongoInvalidArgumentError(`No password is allowed in ENVIRONMENT '${this.mechanismProperties.ENVIRONMENT}' for '${this.mechanism}'.`);\n }\n if ((this.mechanismProperties.ENVIRONMENT === 'azure' ||\n this.mechanismProperties.ENVIRONMENT === 'gcp') &&\n !this.mechanismProperties.TOKEN_RESOURCE) {\n throw new error_1.MongoInvalidArgumentError(TOKEN_RESOURCE_MISSING_ERROR);\n }\n if (this.mechanismProperties.ENVIRONMENT &&\n !ALLOWED_ENVIRONMENT_NAMES.includes(this.mechanismProperties.ENVIRONMENT)) {\n throw new error_1.MongoInvalidArgumentError(`Currently only a ENVIRONMENT in ${ALLOWED_ENVIRONMENT_NAMES.join(',')} is supported for mechanism '${this.mechanism}'.`);\n }\n if (!this.mechanismProperties.ENVIRONMENT &&\n !this.mechanismProperties.OIDC_CALLBACK &&\n !this.mechanismProperties.OIDC_HUMAN_CALLBACK) {\n throw new error_1.MongoInvalidArgumentError(`Either a ENVIRONMENT, OIDC_CALLBACK, or OIDC_HUMAN_CALLBACK must be specified for mechanism '${this.mechanism}'.`);\n }\n if (this.mechanismProperties.ALLOWED_HOSTS) {\n const hosts = this.mechanismProperties.ALLOWED_HOSTS;\n if (!Array.isArray(hosts)) {\n throw new error_1.MongoInvalidArgumentError(ALLOWED_HOSTS_ERROR);\n }\n for (const host of hosts) {\n if (typeof host !== 'string') {\n throw new error_1.MongoInvalidArgumentError(ALLOWED_HOSTS_ERROR);\n }\n }\n }\n }\n if (providers_1.AUTH_MECHS_AUTH_SRC_EXTERNAL.has(this.mechanism)) {\n if (this.source != null && this.source !== '$external') {\n // TODO(NODE-3485): Replace this with a MongoAuthValidationError\n throw new error_1.MongoAPIError(`Invalid source '${this.source}' for mechanism '${this.mechanism}' specified.`);\n }\n }\n if (this.mechanism === providers_1.AuthMechanism.MONGODB_PLAIN && this.source == null) {\n // TODO(NODE-3485): Replace this with a MongoAuthValidationError\n throw new error_1.MongoAPIError('PLAIN Authentication Mechanism needs an auth source');\n }\n if (this.mechanism === providers_1.AuthMechanism.MONGODB_X509 && this.password != null) {\n if (this.password === '') {\n Reflect.set(this, 'password', undefined);\n return;\n }\n // TODO(NODE-3485): Replace this with a MongoAuthValidationError\n throw new error_1.MongoAPIError(`Password not allowed for mechanism MONGODB-X509`);\n }\n const canonicalization = this.mechanismProperties.CANONICALIZE_HOST_NAME ?? false;\n if (!Object.values(gssapi_1.GSSAPICanonicalizationValue).includes(canonicalization)) {\n throw new error_1.MongoAPIError(`Invalid CANONICALIZE_HOST_NAME value: ${canonicalization}`);\n }\n }\n static merge(creds, options) {\n return new MongoCredentials({\n username: options.username ?? creds?.username ?? '',\n password: options.password ?? creds?.password ?? '',\n mechanism: options.mechanism ?? creds?.mechanism ?? providers_1.AuthMechanism.MONGODB_DEFAULT,\n mechanismProperties: options.mechanismProperties ?? creds?.mechanismProperties ?? {},\n source: options.source ?? options.db ?? creds?.source ?? 'admin'\n });\n }\n}\nexports.MongoCredentials = MongoCredentials;\n//# sourceMappingURL=mongo_credentials.js.map"],"x_google_ignoreList":[0],"mappings":";;;;;;;AACA,QAAO,eAAe,SAAS,cAAc,EAAE,OAAO,MAAM,CAAC;AAC7D,SAAQ,mBAAmB,QAAQ,wBAAwB,KAAK;CAChE,MAAM;CACN,MAAM;CACN,MAAM;;;;CAIN,SAAS,wBAAwB,OAAO;AACpC,MAAI,OAGA;OAAI,MAAM,QAAQ,MAAM,mBAAmB,CACvC,QAAO,MAAM,mBAAmB,SAAS,YAAY,cAAc,qBAAqB,GAClF,YAAY,cAAc,uBAC1B,YAAY,cAAc;;AAIxC,SAAO,YAAY,cAAc;;CAErC,MAAM,4BAA4B;EAC9B;EACA;EACA;EACA;EACH;CACD,MAAM,sBAAsB;;AAE5B,SAAQ,wBAAwB;EAC5B;EACA;EACA;EACA;EACA;EACA;EACA;EACH;;CAED,MAAM,+BAA+B;;;;;CAKrC,IAAM,mBAAN,MAAM,iBAAiB;EACnB,YAAY,SAAS;AACjB,QAAK,WAAW,QAAQ,YAAY;AACpC,QAAK,WAAW,QAAQ;AACxB,QAAK,SAAS,QAAQ;AACtB,OAAI,CAAC,KAAK,UAAU,QAAQ,GACxB,MAAK,SAAS,QAAQ;AAE1B,QAAK,YAAY,QAAQ,aAAa,YAAY,cAAc;AAChE,QAAK,sBAAsB,QAAQ,uBAAuB,EAAE;AAC5D,OAAI,KAAK,UAAU,MAAM,eAAe,EAAE;AACtC,QAAI,CAAC,KAAK,YAAY,QAAQ,IAAI,kBAC9B,MAAK,WAAW,QAAQ,IAAI;AAEhC,QAAI,CAAC,KAAK,YAAY,QAAQ,IAAI,sBAC9B,MAAK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4B,CAAC,SAAS,iBAAiB,CAC/E,OAAM,IAAI,QAAQ,cAAc,yCAAyC,mBAAmB;;EAGpG,OAAO,MAAM,OAAO,SAAS;AACzB,UAAO,IAAI,iBAAiB;IACxB,UAAU,QAAQ,YAAY,OAAO,YAAY;IACjD,UAAU,QAAQ,YAAY,OAAO,YAAY;IACjD,WAAW,QAAQ,aAAa,OAAO,aAAa,YAAY,cAAc;IAC9E,qBAAqB,QAAQ,uBAAuB,OAAO,uBAAuB,EAAE;IACpF,QAAQ,QAAQ,UAAU,QAAQ,MAAM,OAAO,UAAU;IAC5D,CAAC;;;AAGV,SAAQ,mBAAmB"}
@@ -1,126 +0,0 @@
1
- import { __commonJSMin } from "../../../../../../../../_virtual/rolldown_runtime.mjs";
2
- import { require_bson } from "../../bson.mjs";
3
- import { require_error } from "../../error.mjs";
4
- import { require_utils } from "../../utils.mjs";
5
- import { require_deps } from "../../deps.mjs";
6
- import { require_auth_provider } from "./auth_provider.mjs";
7
- import { require_providers } from "./providers.mjs";
8
- import { require_mongo_credentials } from "./mongo_credentials.mjs";
9
- import { require_aws_temporary_credentials } from "./aws_temporary_credentials.mjs";
10
-
11
- //#region ../../node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/auth/mongodb_aws.js
12
- var require_mongodb_aws = /* @__PURE__ */ __commonJSMin(((exports) => {
13
- Object.defineProperty(exports, "__esModule", { value: true });
14
- exports.MongoDBAWS = void 0;
15
- const BSON = require_bson();
16
- const deps_1 = require_deps();
17
- const error_1 = require_error();
18
- const utils_1 = require_utils();
19
- const auth_provider_1 = require_auth_provider();
20
- const aws_temporary_credentials_1 = require_aws_temporary_credentials();
21
- const mongo_credentials_1 = require_mongo_credentials();
22
- const providers_1 = require_providers();
23
- const ASCII_N = 110;
24
- const bsonOptions = {
25
- useBigInt64: false,
26
- promoteLongs: true,
27
- promoteValues: true,
28
- promoteBuffers: false,
29
- bsonRegExp: false
30
- };
31
- var MongoDBAWS = class extends auth_provider_1.AuthProvider {
32
- constructor(credentialProvider) {
33
- super();
34
- this.credentialProvider = credentialProvider;
35
- this.credentialFetcher = aws_temporary_credentials_1.AWSTemporaryCredentialProvider.isAWSSDKInstalled ? new aws_temporary_credentials_1.AWSSDKCredentialProvider(credentialProvider) : new aws_temporary_credentials_1.LegacyAWSTemporaryCredentialProvider();
36
- }
37
- async auth(authContext) {
38
- const { connection } = authContext;
39
- if (!authContext.credentials) throw new error_1.MongoMissingCredentialsError("AuthContext must provide credentials.");
40
- if ("kModuleError" in deps_1.aws4) throw deps_1.aws4["kModuleError"];
41
- const { sign } = deps_1.aws4;
42
- if ((0, utils_1.maxWireVersion)(connection) < 9) throw new error_1.MongoCompatibilityError("MONGODB-AWS authentication requires MongoDB version 4.4 or later");
43
- if (!authContext.credentials.username) authContext.credentials = await makeTempCredentials(authContext.credentials, this.credentialFetcher);
44
- const { credentials } = authContext;
45
- const accessKeyId = credentials.username;
46
- const secretAccessKey = credentials.password;
47
- const sessionToken = credentials.mechanismProperties.AWS_SESSION_TOKEN;
48
- const awsCredentials = accessKeyId && secretAccessKey && sessionToken ? {
49
- accessKeyId,
50
- secretAccessKey,
51
- sessionToken
52
- } : accessKeyId && secretAccessKey ? {
53
- accessKeyId,
54
- secretAccessKey
55
- } : void 0;
56
- const db = credentials.source;
57
- const nonce = await (0, utils_1.randomBytes)(32);
58
- const saslStart = {
59
- saslStart: 1,
60
- mechanism: "MONGODB-AWS",
61
- payload: BSON.serialize({
62
- r: nonce,
63
- p: ASCII_N
64
- }, bsonOptions)
65
- };
66
- const saslStartResponse = await connection.command((0, utils_1.ns)(`${db}.$cmd`), saslStart, void 0);
67
- const serverResponse = BSON.deserialize(saslStartResponse.payload.buffer, bsonOptions);
68
- const host = serverResponse.h;
69
- const serverNonce = serverResponse.s.buffer;
70
- if (serverNonce.length !== 64) throw new error_1.MongoRuntimeError(`Invalid server nonce length ${serverNonce.length}, expected 64`);
71
- if (!utils_1.ByteUtils.equals(serverNonce.subarray(0, nonce.byteLength), nonce)) throw new error_1.MongoRuntimeError("Server nonce does not begin with client nonce");
72
- if (host.length < 1 || host.length > 255 || host.indexOf("..") !== -1) throw new error_1.MongoRuntimeError(`Server returned an invalid host: "${host}"`);
73
- const body = "Action=GetCallerIdentity&Version=2011-06-15";
74
- const options = sign({
75
- method: "POST",
76
- host,
77
- region: deriveRegion(serverResponse.h),
78
- service: "sts",
79
- headers: {
80
- "Content-Type": "application/x-www-form-urlencoded",
81
- "Content-Length": 43,
82
- "X-MongoDB-Server-Nonce": utils_1.ByteUtils.toBase64(serverNonce),
83
- "X-MongoDB-GS2-CB-Flag": "n"
84
- },
85
- path: "/",
86
- body
87
- }, awsCredentials);
88
- const payload = {
89
- a: options.headers.Authorization,
90
- d: options.headers["X-Amz-Date"]
91
- };
92
- if (sessionToken) payload.t = sessionToken;
93
- const saslContinue = {
94
- saslContinue: 1,
95
- conversationId: saslStartResponse.conversationId,
96
- payload: BSON.serialize(payload, bsonOptions)
97
- };
98
- await connection.command((0, utils_1.ns)(`${db}.$cmd`), saslContinue, void 0);
99
- }
100
- };
101
- exports.MongoDBAWS = MongoDBAWS;
102
- async function makeTempCredentials(credentials, awsCredentialFetcher) {
103
- function makeMongoCredentialsFromAWSTemp(creds) {
104
- if (!creds.AccessKeyId || !creds.SecretAccessKey) throw new error_1.MongoMissingCredentialsError("Could not obtain temporary MONGODB-AWS credentials");
105
- return new mongo_credentials_1.MongoCredentials({
106
- username: creds.AccessKeyId,
107
- password: creds.SecretAccessKey,
108
- source: credentials.source,
109
- mechanism: providers_1.AuthMechanism.MONGODB_AWS,
110
- mechanismProperties: { AWS_SESSION_TOKEN: creds.Token }
111
- });
112
- }
113
- return makeMongoCredentialsFromAWSTemp(await awsCredentialFetcher.getCredentials());
114
- }
115
- function deriveRegion(host) {
116
- const parts = host.split(".");
117
- if (parts.length === 1 || parts[1] === "amazonaws") return "us-east-1";
118
- return parts[1];
119
- }
120
- }));
121
-
122
- //#endregion
123
- export default require_mongodb_aws();
124
-
125
- export { require_mongodb_aws };
126
- //# sourceMappingURL=mongodb_aws.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"mongodb_aws.mjs","names":[],"sources":["../../../../../../../../../../../node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/auth/mongodb_aws.js"],"sourcesContent":["\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.MongoDBAWS = void 0;\nconst BSON = require(\"../../bson\");\nconst deps_1 = require(\"../../deps\");\nconst error_1 = require(\"../../error\");\nconst utils_1 = require(\"../../utils\");\nconst auth_provider_1 = require(\"./auth_provider\");\nconst aws_temporary_credentials_1 = require(\"./aws_temporary_credentials\");\nconst mongo_credentials_1 = require(\"./mongo_credentials\");\nconst providers_1 = require(\"./providers\");\nconst ASCII_N = 110;\nconst bsonOptions = {\n useBigInt64: false,\n promoteLongs: true,\n promoteValues: true,\n promoteBuffers: false,\n bsonRegExp: false\n};\nclass MongoDBAWS extends auth_provider_1.AuthProvider {\n constructor(credentialProvider) {\n super();\n this.credentialProvider = credentialProvider;\n this.credentialFetcher = aws_temporary_credentials_1.AWSTemporaryCredentialProvider.isAWSSDKInstalled\n ? new aws_temporary_credentials_1.AWSSDKCredentialProvider(credentialProvider)\n : new aws_temporary_credentials_1.LegacyAWSTemporaryCredentialProvider();\n }\n async auth(authContext) {\n const { connection } = authContext;\n if (!authContext.credentials) {\n throw new error_1.MongoMissingCredentialsError('AuthContext must provide credentials.');\n }\n if ('kModuleError' in deps_1.aws4) {\n throw deps_1.aws4['kModuleError'];\n }\n const { sign } = deps_1.aws4;\n if ((0, utils_1.maxWireVersion)(connection) < 9) {\n throw new error_1.MongoCompatibilityError('MONGODB-AWS authentication requires MongoDB version 4.4 or later');\n }\n if (!authContext.credentials.username) {\n authContext.credentials = await makeTempCredentials(authContext.credentials, this.credentialFetcher);\n }\n const { credentials } = authContext;\n const accessKeyId = credentials.username;\n const secretAccessKey = credentials.password;\n // Allow the user to specify an AWS session token for authentication with temporary credentials.\n const sessionToken = credentials.mechanismProperties.AWS_SESSION_TOKEN;\n // If all three defined, include sessionToken, else include username and pass, else no credentials\n const awsCredentials = accessKeyId && secretAccessKey && sessionToken\n ? { accessKeyId, secretAccessKey, sessionToken }\n : accessKeyId && secretAccessKey\n ? { accessKeyId, secretAccessKey }\n : undefined;\n const db = credentials.source;\n const nonce = await (0, utils_1.randomBytes)(32);\n // All messages between MongoDB clients and servers are sent as BSON objects\n // in the payload field of saslStart and saslContinue.\n const saslStart = {\n saslStart: 1,\n mechanism: 'MONGODB-AWS',\n payload: BSON.serialize({ r: nonce, p: ASCII_N }, bsonOptions)\n };\n const saslStartResponse = await connection.command((0, utils_1.ns)(`${db}.$cmd`), saslStart, undefined);\n const serverResponse = BSON.deserialize(saslStartResponse.payload.buffer, bsonOptions);\n const host = serverResponse.h;\n const serverNonce = serverResponse.s.buffer;\n if (serverNonce.length !== 64) {\n // TODO(NODE-3483)\n throw new error_1.MongoRuntimeError(`Invalid server nonce length ${serverNonce.length}, expected 64`);\n }\n if (!utils_1.ByteUtils.equals(serverNonce.subarray(0, nonce.byteLength), nonce)) {\n // throw because the serverNonce's leading 32 bytes must equal the client nonce's 32 bytes\n // https://github.com/mongodb/specifications/blob/master/source/auth/auth.md#conversation-5\n // TODO(NODE-3483)\n throw new error_1.MongoRuntimeError('Server nonce does not begin with client nonce');\n }\n if (host.length < 1 || host.length > 255 || host.indexOf('..') !== -1) {\n // TODO(NODE-3483)\n throw new error_1.MongoRuntimeError(`Server returned an invalid host: \"${host}\"`);\n }\n const body = 'Action=GetCallerIdentity&Version=2011-06-15';\n const options = sign({\n method: 'POST',\n host,\n region: deriveRegion(serverResponse.h),\n service: 'sts',\n headers: {\n 'Content-Type': 'application/x-www-form-urlencoded',\n 'Content-Length': body.length,\n 'X-MongoDB-Server-Nonce': utils_1.ByteUtils.toBase64(serverNonce),\n 'X-MongoDB-GS2-CB-Flag': 'n'\n },\n path: '/',\n body\n }, awsCredentials);\n const payload = {\n a: options.headers.Authorization,\n d: options.headers['X-Amz-Date']\n };\n if (sessionToken) {\n payload.t = sessionToken;\n }\n const saslContinue = {\n saslContinue: 1,\n conversationId: saslStartResponse.conversationId,\n payload: BSON.serialize(payload, bsonOptions)\n };\n await connection.command((0, utils_1.ns)(`${db}.$cmd`), saslContinue, undefined);\n }\n}\nexports.MongoDBAWS = MongoDBAWS;\nasync function makeTempCredentials(credentials, awsCredentialFetcher) {\n function makeMongoCredentialsFromAWSTemp(creds) {\n // The AWS session token (creds.Token) may or may not be set.\n if (!creds.AccessKeyId || !creds.SecretAccessKey) {\n throw new error_1.MongoMissingCredentialsError('Could not obtain temporary MONGODB-AWS credentials');\n }\n return new mongo_credentials_1.MongoCredentials({\n username: creds.AccessKeyId,\n password: creds.SecretAccessKey,\n source: credentials.source,\n mechanism: providers_1.AuthMechanism.MONGODB_AWS,\n mechanismProperties: {\n AWS_SESSION_TOKEN: creds.Token\n }\n });\n }\n const temporaryCredentials = await awsCredentialFetcher.getCredentials();\n return makeMongoCredentialsFromAWSTemp(temporaryCredentials);\n}\nfunction deriveRegion(host) {\n const parts = host.split('.');\n if (parts.length === 1 || parts[1] === 'amazonaws') {\n return 'us-east-1';\n }\n return parts[1];\n}\n//# sourceMappingURL=mongodb_aws.js.map"],"x_google_ignoreList":[0],"mappings":";;;;;;;;;;;;AACA,QAAO,eAAe,SAAS,cAAc,EAAE,OAAO,MAAM,CAAC;AAC7D,SAAQ,aAAa,KAAK;CAC1B,MAAM;CACN,MAAM;CACN,MAAM;CACN,MAAM;CACN,MAAM;CACN,MAAM;CACN,MAAM;CACN,MAAM;CACN,MAAM,UAAU;CAChB,MAAM,cAAc;EAChB,aAAa;EACb,cAAc;EACd,eAAe;EACf,gBAAgB;EAChB,YAAY;EACf;CACD,IAAM,aAAN,cAAyB,gBAAgB,aAAa;EAClD,YAAY,oBAAoB;AAC5B,UAAO;AACP,QAAK,qBAAqB;AAC1B,QAAK,oBAAoB,4BAA4B,+BAA+B,oBAC9E,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onJSMin } from "../../../../../../../../../_virtual/rolldown_runtime.mjs";
2
- import { require_error } from "../../../error.mjs";
3
- import { require_timeout } from "../../../timeout.mjs";
4
- import { require_callback_workflow } from "./callback_workflow.mjs";
5
- import { require_mongodb_oidc } from "../mongodb_oidc.mjs";
6
-
7
- //#region ../../node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/auth/mongodb_oidc/automated_callback_workflow.js
8
- var require_automated_callback_workflow = /* @__PURE__ */ __commonJSMin(((exports) => {
9
- Object.defineProperty(exports, "__esModule", { value: true });
10
- exports.AutomatedCallbackWorkflow = void 0;
11
- const error_1 = require_error();
12
- const timeout_1 = require_timeout();
13
- const mongodb_oidc_1 = require_mongodb_oidc();
14
- const callback_workflow_1 = require_callback_workflow();
15
- /**
16
- * Class implementing behaviour for the non human callback workflow.
17
- * @internal
18
- */
19
- var AutomatedCallbackWorkflow = class extends callback_workflow_1.CallbackWorkflow {
20
- /**
21
- * Instantiate the human callback workflow.
22
- */
23
- constructor(cache, callback) {
24
- super(cache, callback);
25
- }
26
- /**
27
- * Execute the OIDC callback workflow.
28
- */
29
- async execute(connection, credentials) {
30
- if (this.cache.hasAccessToken) {
31
- const token = this.cache.getAccessToken();
32
- if (!connection.accessToken) connection.accessToken = token;
33
- try {
34
- return await this.finishAuthentication(connection, credentials, token);
35
- } catch (error) {
36
- if (error instanceof error_1.MongoError && error.code === error_1.MONGODB_ERROR_CODES.AuthenticationFailed) {
37
- this.cache.removeAccessToken();
38
- return await this.execute(connection, credentials);
39
- } else throw error;
40
- }
41
- }
42
- const response = await this.fetchAccessToken(credentials);
43
- this.cache.put(response);
44
- connection.accessToken = response.accessToken;
45
- await this.finishAuthentication(connection, credentials, response.accessToken);
46
- }
47
- /**
48
- * Fetches the access token using the callback.
49
- */
50
- async fetchAccessToken(credentials) {
51
- const controller = new AbortController();
52
- const params = {
53
- timeoutContext: controller.signal,
54
- version: mongodb_oidc_1.OIDC_VERSION
55
- };
56
- if (credentials.username) params.username = credentials.username;
57
- if (credentials.mechanismProperties.TOKEN_RESOURCE) params.tokenAudience = credentials.mechanismProperties.TOKEN_RESOURCE;
58
- const timeout = timeout_1.Timeout.expires(callback_workflow_1.AUTOMATED_TIMEOUT_MS);
59
- try {
60
- return await Promise.race([this.executeAndValidateCallback(params), timeout]);
61
- } catch (error) {
62
- if (timeout_1.TimeoutError.is(error)) {
63
- controller.abort();
64
- throw new error_1.MongoOIDCError(`OIDC callback timed out after ${callback_workflow_1.AUTOMATED_TIMEOUT_MS}ms.`);
65
- }
66
- throw error;
67
- } finally {
68
- timeout.clear();
69
- }
70
- }
71
- };
72
- exports.AutomatedCallbackWorkflow = AutomatedCallbackWorkflow;
73
- }));
74
-
75
- //#endregion
76
- export default require_automated_callback_workflow();
77
-
78
- export { require_automated_callback_workflow };
79
- //# sourceMappingURL=automated_callback_workflow.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"automated_callback_workflow.mjs","names":[],"sources":["../../../../../../../../../../../../node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/auth/mongodb_oidc/automated_callback_workflow.js"],"sourcesContent":["\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.AutomatedCallbackWorkflow = void 0;\nconst error_1 = require(\"../../../error\");\nconst timeout_1 = require(\"../../../timeout\");\nconst mongodb_oidc_1 = require(\"../mongodb_oidc\");\nconst callback_workflow_1 = require(\"./callback_workflow\");\n/**\n * Class implementing behaviour for the non human callback workflow.\n * @internal\n */\nclass AutomatedCallbackWorkflow extends callback_workflow_1.CallbackWorkflow {\n /**\n * Instantiate the human callback workflow.\n */\n constructor(cache, callback) {\n super(cache, callback);\n }\n /**\n * Execute the OIDC callback workflow.\n */\n async execute(connection, credentials) {\n // If there is a cached access token, try to authenticate with it. If\n // authentication fails with an Authentication error (18),\n // invalidate the access token, fetch a new access token, and try\n // to authenticate again.\n // If the server fails for any other reason, do not clear the cache.\n if (this.cache.hasAccessToken) {\n const token = this.cache.getAccessToken();\n if (!connection.accessToken) {\n connection.accessToken = token;\n }\n try {\n return await this.finishAuthentication(connection, credentials, token);\n }\n catch (error) {\n if (error instanceof error_1.MongoError &&\n error.code === error_1.MONGODB_ERROR_CODES.AuthenticationFailed) {\n this.cache.removeAccessToken();\n return await this.execute(connection, credentials);\n }\n else {\n throw error;\n }\n }\n }\n const response = await this.fetchAccessToken(credentials);\n this.cache.put(response);\n connection.accessToken = response.accessToken;\n await this.finishAuthentication(connection, credentials, response.accessToken);\n }\n /**\n * Fetches the access token using the callback.\n */\n async fetchAccessToken(credentials) {\n const controller = new AbortController();\n const params = {\n timeoutContext: controller.signal,\n version: mongodb_oidc_1.OIDC_VERSION\n };\n if (credentials.username) {\n params.username = credentials.username;\n }\n if (credentials.mechanismProperties.TOKEN_RESOURCE) {\n params.tokenAudience = credentials.mechanismProperties.TOKEN_RESOURCE;\n }\n const timeout = timeout_1.Timeout.expires(callback_workflow_1.AUTOMATED_TIMEOUT_MS);\n try {\n return await Promise.race([this.executeAndValidateCallback(params), timeout]);\n }\n catch (error) {\n if (timeout_1.TimeoutError.is(error)) {\n controller.abort();\n throw new error_1.MongoOIDCError(`OIDC callback timed out after ${callback_workflow_1.AUTOMATED_TIMEOUT_MS}ms.`);\n }\n throw error;\n }\n finally {\n timeout.clear();\n }\n }\n}\nexports.AutomatedCallbackWorkflow = AutomatedCallbackWorkflow;\n//# sourceMappingURL=automated_callback_workflow.js.map"],"x_google_ignoreList":[0],"mappings":";;;;;;;;AACA,QAAO,eAAe,SAAS,cAAc,EAAE,OAAO,MAAM,CAAC;AAC7D,SAAQ,4BAA4B,KAAK;CACzC,MAAM;CACN,MAAM;CACN,MAAM;CACN,MAAM;;;;;CAKN,IAAM,4BAAN,cAAwC,oBAAoB,iBAAiB;;;;EAIzE,YAAY,OAAO,UAAU;AACzB,SAAM,OAAO,SAAS;;;;;EAK1B,MAAM,QAAQ,YAAY,aAAa;AAMnC,OAAI,KAAK,MAAM,gBAAgB;IAC3B,MAAM,QAAQ,KAAK,MAAM,gBAAgB;AACzC,QAAI,CAAC,WAAW,YACZ,YAAW,cAAc;AAE7B,QAAI;AACA,YAAO,MAAM,KAAK,qBAAqB,YAAY,aAAa,MAAM;aAEnE,OAAO;AACV,SAAI,iBAAiB,QAAQ,cACzB,MAAM,SAAS,QAAQ,oBAAoB,sBAAsB;AACjE,WAAK,MAAM,mBAAmB;AAC9B,aAAO,MAAM,KAAK,QAAQ,YAAY,YAAY;WAGlD,OAAM;;;GAIlB,MAAM,WAAW,MAAM,KAAK,iBAAiB,YAAY;AACzD,QAAK,MAAM,IAAI,SAAS;AACxB,cAAW,cAAc,SAAS;AAClC,SAAM,KAAK,qBAAqB,YAAY,aAAa,SAAS,YAAY;;;;;EAKlF,MAAM,iBAAiB,aAAa;GAChC,MAAM,aAAa,IAAI,iBAAiB;GACxC,MAAM,SAAS;IACX,gBAAgB,WAAW;IAC3B,SAAS,eAAe;IAC3B;AACD,OAAI,YAAY,SACZ,QAAO,WAAW,YAAY;AAElC,OAAI,YAAY,oBAAoB,eAChC,QAAO,gBAAgB,YAAY,oBAAoB;GAE3D,MAAM,UAAU,UAAU,QAAQ,QAAQ,oBAAoB,qBAAqB;AACnF,OAAI;AACA,WAAO,MAAM,QAAQ,KAAK,CAAC,KAAK,2BAA2B,OAAO,EAAE,QAAQ,CAAC;YAE1E,OAAO;AACV,QAAI,UAAU,aAAa,GAAG,MAAM,EAAE;AAClC,gBAAW,OAAO;AAClB,WAAM,IAAI,QAAQ,eAAe,iCAAiC,oBAAoB,qBAAqB,KAAK;;AAEpH,UAAM;aAEF;AACJ,YAAQ,OAAO;;;;AAI3B,SAAQ,4BAA4B"}
@@ -1,65 +0,0 @@
1
- import { __commonJSMin } from "../../../../../../../../../_virtual/rolldown_runtime.mjs";
2
- import { require_error } from "../../../error.mjs";
3
- import { require_utils } from "../../../utils.mjs";
4
- import { require_azure } from "../../../client-side-encryption/providers/azure.mjs";
5
-
6
- //#region ../../node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/auth/mongodb_oidc/azure_machine_workflow.js
7
- var require_azure_machine_workflow = /* @__PURE__ */ __commonJSMin(((exports) => {
8
- Object.defineProperty(exports, "__esModule", { value: true });
9
- exports.callback = void 0;
10
- const azure_1 = require_azure();
11
- const error_1 = require_error();
12
- const utils_1 = require_utils();
13
- /** Azure request headers. */
14
- const AZURE_HEADERS = Object.freeze({
15
- Metadata: "true",
16
- Accept: "application/json"
17
- });
18
- /** Invalid endpoint result error. */
19
- const ENDPOINT_RESULT_ERROR = "Azure endpoint did not return a value with only access_token and expires_in properties";
20
- /** Error for when the token audience is missing in the environment. */
21
- const TOKEN_RESOURCE_MISSING_ERROR = "TOKEN_RESOURCE must be set in the auth mechanism properties when ENVIRONMENT is azure.";
22
- /**
23
- * The callback function to be used in the automated callback workflow.
24
- * @param params - The OIDC callback parameters.
25
- * @returns The OIDC response.
26
- */
27
- const callback = async (params) => {
28
- const tokenAudience = params.tokenAudience;
29
- const username = params.username;
30
- if (!tokenAudience) throw new error_1.MongoAzureError(TOKEN_RESOURCE_MISSING_ERROR);
31
- const response = await getAzureTokenData(tokenAudience, username);
32
- if (!isEndpointResultValid(response)) throw new error_1.MongoAzureError(ENDPOINT_RESULT_ERROR);
33
- return response;
34
- };
35
- exports.callback = callback;
36
- /**
37
- * Hit the Azure endpoint to get the token data.
38
- */
39
- async function getAzureTokenData(tokenAudience, username) {
40
- const url = new URL(azure_1.AZURE_BASE_URL);
41
- (0, azure_1.addAzureParams)(url, tokenAudience, username);
42
- const response = await (0, utils_1.get)(url, { headers: AZURE_HEADERS });
43
- if (response.status !== 200) throw new error_1.MongoAzureError(`Status code ${response.status} returned from the Azure endpoint. Response body: ${response.body}`);
44
- const result = JSON.parse(response.body);
45
- return {
46
- accessToken: result.access_token,
47
- expiresInSeconds: Number(result.expires_in)
48
- };
49
- }
50
- /**
51
- * Determines if a result returned from the endpoint is valid.
52
- * This means the result is not nullish, contains the access_token required field
53
- * and the expires_in required field.
54
- */
55
- function isEndpointResultValid(token) {
56
- if (token == null || typeof token !== "object") return false;
57
- return "accessToken" in token && typeof token.accessToken === "string" && "expiresInSeconds" in token && typeof token.expiresInSeconds === "number";
58
- }
59
- }));
60
-
61
- //#endregion
62
- export default require_azure_machine_workflow();
63
-
64
- export { require_azure_machine_workflow };
65
- //# sourceMappingURL=azure_machine_workflow.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"azure_machine_workflow.mjs","names":[],"sources":["../../../../../../../../../../../../node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/auth/mongodb_oidc/azure_machine_workflow.js"],"sourcesContent":["\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.callback = void 0;\nconst azure_1 = require(\"../../../client-side-encryption/providers/azure\");\nconst error_1 = require(\"../../../error\");\nconst utils_1 = require(\"../../../utils\");\n/** Azure request headers. */\nconst AZURE_HEADERS = Object.freeze({ Metadata: 'true', Accept: 'application/json' });\n/** Invalid endpoint result error. */\nconst ENDPOINT_RESULT_ERROR = 'Azure endpoint did not return a value with only access_token and expires_in properties';\n/** Error for when the token audience is missing in the environment. */\nconst TOKEN_RESOURCE_MISSING_ERROR = 'TOKEN_RESOURCE must be set in the auth mechanism properties when ENVIRONMENT is azure.';\n/**\n * The callback function to be used in the automated callback workflow.\n * @param params - The OIDC callback parameters.\n * @returns The OIDC response.\n */\nconst callback = async (params) => {\n const tokenAudience = params.tokenAudience;\n const username = params.username;\n if (!tokenAudience) {\n throw new error_1.MongoAzureError(TOKEN_RESOURCE_MISSING_ERROR);\n }\n const response = await getAzureTokenData(tokenAudience, username);\n if (!isEndpointResultValid(response)) {\n throw new error_1.MongoAzureError(ENDPOINT_RESULT_ERROR);\n }\n return response;\n};\nexports.callback = callback;\n/**\n * Hit the Azure endpoint to get the token data.\n */\nasync function getAzureTokenData(tokenAudience, username) {\n const url = new URL(azure_1.AZURE_BASE_URL);\n (0, azure_1.addAzureParams)(url, tokenAudience, username);\n const response = await (0, utils_1.get)(url, {\n headers: AZURE_HEADERS\n });\n if (response.status !== 200) {\n throw new error_1.MongoAzureError(`Status code ${response.status} returned from the Azure endpoint. Response body: ${response.body}`);\n }\n const result = JSON.parse(response.body);\n return {\n accessToken: result.access_token,\n expiresInSeconds: Number(result.expires_in)\n };\n}\n/**\n * Determines if a result returned from the endpoint is valid.\n * This means the result is not nullish, contains the access_token required field\n * and the expires_in required field.\n */\nfunction isEndpointResultValid(token) {\n if (token == null || typeof token !== 'object')\n return false;\n return ('accessToken' in token &&\n typeof token.accessToken === 'string' &&\n 'expiresInSeconds' in token &&\n typeof token.expiresInSeconds === 'number');\n}\n//# sourceMappingURL=azure_machine_workflow.js.map"],"x_google_ignoreList":[0],"mappings":";;;;;;;AACA,QAAO,eAAe,SAAS,cAAc,EAAE,OAAO,MAAM,CAAC;AAC7D,SAAQ,WAAW,KAAK;CACxB,MAAM;CACN,MAAM;CACN,MAAM;;CAEN,MAAM,gBAAgB,OAAO,OAAO;EAAE,UAAU;EAAQ,QAAQ;EAAoB,CAAC;;CAErF,MAAM,wBAAwB;;CAE9B,MAAM,+BAA+B;;;;;;CAMrC,MAAM,WAAW,OAAO,WAAW;EAC/B,MAAM,gBAAgB,OAAO;EAC7B,MAAM,WAAW,OAAO;AACxB,MAAI,CAAC,cACD,OAAM,IAAI,QAAQ,gBAAgB,6BAA6B;EAEnE,MAAM,WAAW,MAAM,kBAAkB,eAAe,SAAS;AACjE,MAAI,CAAC,sBAAsB,SAAS,CAChC,OAAM,IAAI,QAAQ,gBAAgB,sBAAsB;AAE5D,SAAO;;AAEX,SAAQ,WAAW;;;;CAInB,eAAe,kBAAkB,eAAe,UAAU;EACtD,MAAM,MAAM,IAAI,IAAI,QAAQ,eAAe;AAC3C,GAAC,GAAG,QAAQ,gBAAgB,KAAK,eAAe,SAAS;EACzD,MAAM,WAAW,OAAO,GAAG,QAAQ,KAAK,KAAK,EACzC,SAAS,eACZ,CAAC;AACF,MAAI,SAAS,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