@aws/lsp-codewhisperer 0.0.26 → 0.0.27

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 (351) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@aws-sdk/token-providers/LICENSE +201 -0
  3. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@aws-sdk/token-providers/README.md +53 -0
  4. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@aws-sdk/token-providers/dist-cjs/index.js +209 -0
  5. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@aws-sdk/token-providers/dist-es/constants.js +2 -0
  6. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@aws-sdk/token-providers/dist-es/fromSso.js +79 -0
  7. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@aws-sdk/token-providers/dist-es/fromStatic.js +8 -0
  8. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@aws-sdk/token-providers/dist-es/getNewSsoOidcToken.js +11 -0
  9. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@aws-sdk/token-providers/dist-es/getSsoOidcClient.js +10 -0
  10. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@aws-sdk/token-providers/dist-es/index.js +3 -0
  11. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@aws-sdk/token-providers/dist-es/nodeProvider.js +5 -0
  12. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@aws-sdk/token-providers/dist-es/validateTokenExpiry.js +7 -0
  13. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@aws-sdk/token-providers/dist-es/validateTokenKey.js +7 -0
  14. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@aws-sdk/token-providers/dist-es/writeSSOTokenToFile.js +8 -0
  15. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@aws-sdk/token-providers/dist-types/constants.d.ts +8 -0
  16. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@aws-sdk/token-providers/dist-types/fromSso.d.ts +8 -0
  17. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@aws-sdk/token-providers/dist-types/fromStatic.d.ts +8 -0
  18. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@aws-sdk/token-providers/dist-types/getNewSsoOidcToken.d.ts +6 -0
  19. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@aws-sdk/token-providers/dist-types/getSsoOidcClient.d.ts +6 -0
  20. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@aws-sdk/token-providers/dist-types/index.d.ts +3 -0
  21. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@aws-sdk/token-providers/dist-types/nodeProvider.d.ts +18 -0
  22. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@aws-sdk/token-providers/dist-types/ts3.4/constants.d.ts +3 -0
  23. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@aws-sdk/token-providers/dist-types/ts3.4/fromSso.d.ts +9 -0
  24. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@aws-sdk/token-providers/dist-types/ts3.4/fromStatic.d.ts +12 -0
  25. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@aws-sdk/token-providers/dist-types/ts3.4/getNewSsoOidcToken.d.ts +5 -0
  26. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@aws-sdk/token-providers/dist-types/ts3.4/getSsoOidcClient.d.ts +1 -0
  27. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@aws-sdk/token-providers/dist-types/ts3.4/index.d.ts +3 -0
  28. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@aws-sdk/token-providers/dist-types/ts3.4/nodeProvider.d.ts +5 -0
  29. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@aws-sdk/token-providers/dist-types/ts3.4/validateTokenExpiry.d.ts +2 -0
  30. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@aws-sdk/token-providers/dist-types/ts3.4/validateTokenKey.d.ts +5 -0
  31. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@aws-sdk/token-providers/dist-types/ts3.4/writeSSOTokenToFile.d.ts +5 -0
  32. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@aws-sdk/token-providers/dist-types/validateTokenExpiry.d.ts +5 -0
  33. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@aws-sdk/token-providers/dist-types/validateTokenKey.d.ts +4 -0
  34. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@aws-sdk/token-providers/dist-types/writeSSOTokenToFile.d.ts +5 -0
  35. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@aws-sdk/token-providers/package.json +68 -0
  36. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@aws-sdk/types/LICENSE +201 -0
  37. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@aws-sdk/types/README.md +4 -0
  38. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@aws-sdk/types/dist-cjs/index.js +295 -0
  39. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@aws-sdk/types/dist-es/abort.js +1 -0
  40. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@aws-sdk/types/dist-es/auth.js +1 -0
  41. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@aws-sdk/types/dist-es/blob/blob-types.js +1 -0
  42. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@aws-sdk/types/dist-es/checksum.js +1 -0
  43. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@aws-sdk/types/dist-es/client.js +1 -0
  44. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@aws-sdk/types/dist-es/command.js +1 -0
  45. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@aws-sdk/types/dist-es/connection.js +1 -0
  46. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@aws-sdk/types/dist-es/credentials.js +1 -0
  47. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@aws-sdk/types/dist-es/crypto.js +1 -0
  48. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@aws-sdk/types/dist-es/dns.js +5 -0
  49. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@aws-sdk/types/dist-es/encode.js +1 -0
  50. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@aws-sdk/types/dist-es/endpoint.js +1 -0
  51. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@aws-sdk/types/dist-es/eventStream.js +1 -0
  52. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@aws-sdk/types/dist-es/extensions/index.js +1 -0
  53. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@aws-sdk/types/dist-es/http.js +1 -0
  54. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@aws-sdk/types/dist-es/identity/AnonymousIdentity.js +1 -0
  55. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@aws-sdk/types/dist-es/identity/AwsCredentialIdentity.js +1 -0
  56. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@aws-sdk/types/dist-es/identity/Identity.js +1 -0
  57. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@aws-sdk/types/dist-es/identity/LoginIdentity.js +1 -0
  58. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@aws-sdk/types/dist-es/identity/TokenIdentity.js +1 -0
  59. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@aws-sdk/types/dist-es/identity/index.js +5 -0
  60. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@aws-sdk/types/dist-es/index.js +32 -0
  61. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@aws-sdk/types/dist-es/logger.js +1 -0
  62. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@aws-sdk/types/dist-es/middleware.js +1 -0
  63. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@aws-sdk/types/dist-es/pagination.js +1 -0
  64. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@aws-sdk/types/dist-es/profile.js +1 -0
  65. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@aws-sdk/types/dist-es/request.js +1 -0
  66. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@aws-sdk/types/dist-es/response.js +1 -0
  67. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@aws-sdk/types/dist-es/retry.js +1 -0
  68. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@aws-sdk/types/dist-es/serde.js +1 -0
  69. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@aws-sdk/types/dist-es/shapes.js +1 -0
  70. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@aws-sdk/types/dist-es/signature.js +1 -0
  71. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@aws-sdk/types/dist-es/stream.js +1 -0
  72. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@aws-sdk/types/dist-es/token.js +1 -0
  73. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@aws-sdk/types/dist-es/transfer.js +1 -0
  74. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@aws-sdk/types/dist-es/uri.js +1 -0
  75. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@aws-sdk/types/dist-es/util.js +1 -0
  76. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@aws-sdk/types/dist-es/waiter.js +1 -0
  77. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@aws-sdk/types/dist-types/abort.d.ts +1 -0
  78. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@aws-sdk/types/dist-types/auth.d.ts +1 -0
  79. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@aws-sdk/types/dist-types/blob/blob-types.d.ts +2 -0
  80. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@aws-sdk/types/dist-types/checksum.d.ts +1 -0
  81. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@aws-sdk/types/dist-types/client.d.ts +1 -0
  82. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@aws-sdk/types/dist-types/command.d.ts +1 -0
  83. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@aws-sdk/types/dist-types/connection.d.ts +1 -0
  84. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@aws-sdk/types/dist-types/credentials.d.ts +49 -0
  85. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@aws-sdk/types/dist-types/crypto.d.ts +1 -0
  86. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@aws-sdk/types/dist-types/dns.d.ts +85 -0
  87. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@aws-sdk/types/dist-types/encode.d.ts +1 -0
  88. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@aws-sdk/types/dist-types/endpoint.d.ts +1 -0
  89. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@aws-sdk/types/dist-types/eventStream.d.ts +1 -0
  90. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@aws-sdk/types/dist-types/extensions/index.d.ts +8 -0
  91. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@aws-sdk/types/dist-types/http.d.ts +33 -0
  92. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@aws-sdk/types/dist-types/identity/AnonymousIdentity.d.ts +6 -0
  93. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@aws-sdk/types/dist-types/identity/AwsCredentialIdentity.d.ts +1 -0
  94. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@aws-sdk/types/dist-types/identity/Identity.d.ts +1 -0
  95. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@aws-sdk/types/dist-types/identity/LoginIdentity.d.ts +18 -0
  96. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@aws-sdk/types/dist-types/identity/TokenIdentity.d.ts +1 -0
  97. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@aws-sdk/types/dist-types/identity/index.d.ts +5 -0
  98. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@aws-sdk/types/dist-types/index.d.ts +32 -0
  99. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@aws-sdk/types/dist-types/logger.d.ts +22 -0
  100. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@aws-sdk/types/dist-types/middleware.d.ts +1 -0
  101. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@aws-sdk/types/dist-types/pagination.d.ts +1 -0
  102. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@aws-sdk/types/dist-types/profile.d.ts +1 -0
  103. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@aws-sdk/types/dist-types/request.d.ts +7 -0
  104. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@aws-sdk/types/dist-types/response.d.ts +7 -0
  105. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@aws-sdk/types/dist-types/retry.d.ts +1 -0
  106. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@aws-sdk/types/dist-types/serde.d.ts +24 -0
  107. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@aws-sdk/types/dist-types/shapes.d.ts +1 -0
  108. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@aws-sdk/types/dist-types/signature.d.ts +1 -0
  109. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@aws-sdk/types/dist-types/stream.d.ts +1 -0
  110. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@aws-sdk/types/dist-types/token.d.ts +17 -0
  111. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@aws-sdk/types/dist-types/transfer.d.ts +1 -0
  112. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@aws-sdk/types/dist-types/ts3.4/abort.d.ts +1 -0
  113. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@aws-sdk/types/dist-types/ts3.4/auth.d.ts +5 -0
  114. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@aws-sdk/types/dist-types/ts3.4/blob/blob-types.d.ts +2 -0
  115. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@aws-sdk/types/dist-types/ts3.4/checksum.d.ts +1 -0
  116. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@aws-sdk/types/dist-types/ts3.4/client.d.ts +1 -0
  117. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@aws-sdk/types/dist-types/ts3.4/command.d.ts +1 -0
  118. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@aws-sdk/types/dist-types/ts3.4/connection.d.ts +6 -0
  119. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@aws-sdk/types/dist-types/ts3.4/credentials.d.ts +12 -0
  120. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@aws-sdk/types/dist-types/ts3.4/crypto.d.ts +7 -0
  121. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@aws-sdk/types/dist-types/ts3.4/dns.d.ts +19 -0
  122. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@aws-sdk/types/dist-types/ts3.4/encode.d.ts +6 -0
  123. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@aws-sdk/types/dist-types/ts3.4/endpoint.d.ts +9 -0
  124. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@aws-sdk/types/dist-types/ts3.4/eventStream.d.ts +24 -0
  125. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@aws-sdk/types/dist-types/ts3.4/extensions/index.d.ts +5 -0
  126. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@aws-sdk/types/dist-types/ts3.4/http.d.ts +17 -0
  127. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@aws-sdk/types/dist-types/ts3.4/identity/AnonymousIdentity.d.ts +2 -0
  128. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@aws-sdk/types/dist-types/ts3.4/identity/AwsCredentialIdentity.d.ts +4 -0
  129. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@aws-sdk/types/dist-types/ts3.4/identity/Identity.d.ts +1 -0
  130. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@aws-sdk/types/dist-types/ts3.4/identity/LoginIdentity.d.ts +6 -0
  131. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@aws-sdk/types/dist-types/ts3.4/identity/TokenIdentity.d.ts +1 -0
  132. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@aws-sdk/types/dist-types/ts3.4/identity/index.d.ts +5 -0
  133. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@aws-sdk/types/dist-types/ts3.4/index.d.ts +32 -0
  134. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@aws-sdk/types/dist-types/ts3.4/logger.d.ts +15 -0
  135. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@aws-sdk/types/dist-types/ts3.4/middleware.d.ts +40 -0
  136. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@aws-sdk/types/dist-types/ts3.4/pagination.d.ts +1 -0
  137. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@aws-sdk/types/dist-types/ts3.4/profile.d.ts +6 -0
  138. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@aws-sdk/types/dist-types/ts3.4/request.d.ts +4 -0
  139. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@aws-sdk/types/dist-types/ts3.4/response.d.ts +4 -0
  140. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@aws-sdk/types/dist-types/ts3.4/retry.d.ts +12 -0
  141. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@aws-sdk/types/dist-types/ts3.4/serde.d.ts +16 -0
  142. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@aws-sdk/types/dist-types/ts3.4/shapes.d.ts +6 -0
  143. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@aws-sdk/types/dist-types/ts3.4/signature.d.ts +15 -0
  144. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@aws-sdk/types/dist-types/ts3.4/stream.d.ts +4 -0
  145. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@aws-sdk/types/dist-types/ts3.4/token.d.ts +4 -0
  146. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@aws-sdk/types/dist-types/ts3.4/transfer.d.ts +7 -0
  147. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@aws-sdk/types/dist-types/ts3.4/uri.d.ts +1 -0
  148. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@aws-sdk/types/dist-types/ts3.4/util.d.ts +14 -0
  149. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@aws-sdk/types/dist-types/ts3.4/waiter.d.ts +1 -0
  150. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@aws-sdk/types/dist-types/uri.d.ts +1 -0
  151. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@aws-sdk/types/dist-types/util.d.ts +1 -0
  152. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@aws-sdk/types/dist-types/waiter.d.ts +1 -0
  153. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@aws-sdk/types/package.json +56 -0
  154. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/shared-ini-file-loader/LICENSE +201 -0
  155. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/shared-ini-file-loader/README.md +105 -0
  156. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/shared-ini-file-loader/dist-cjs/getConfigData.js +1 -0
  157. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/shared-ini-file-loader/dist-cjs/getConfigFilepath.js +1 -0
  158. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/shared-ini-file-loader/dist-cjs/getCredentialsFilepath.js +1 -0
  159. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/shared-ini-file-loader/dist-cjs/getHomeDir.js +26 -0
  160. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/shared-ini-file-loader/dist-cjs/getProfileName.js +1 -0
  161. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/shared-ini-file-loader/dist-cjs/getSSOTokenFilepath.js +12 -0
  162. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/shared-ini-file-loader/dist-cjs/getSSOTokenFromFile.js +12 -0
  163. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/shared-ini-file-loader/dist-cjs/getSsoSessionData.js +1 -0
  164. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/shared-ini-file-loader/dist-cjs/index.js +206 -0
  165. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/shared-ini-file-loader/dist-cjs/loadSharedConfigFiles.js +1 -0
  166. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/shared-ini-file-loader/dist-cjs/loadSsoSessionData.js +1 -0
  167. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/shared-ini-file-loader/dist-cjs/mergeConfigFiles.js +1 -0
  168. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/shared-ini-file-loader/dist-cjs/parseIni.js +1 -0
  169. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/shared-ini-file-loader/dist-cjs/parseKnownFiles.js +1 -0
  170. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/shared-ini-file-loader/dist-cjs/slurpFile.js +13 -0
  171. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/shared-ini-file-loader/dist-cjs/types.js +1 -0
  172. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/shared-ini-file-loader/dist-es/getConfigData.js +18 -0
  173. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/shared-ini-file-loader/dist-es/getConfigFilepath.js +4 -0
  174. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/shared-ini-file-loader/dist-es/getCredentialsFilepath.js +4 -0
  175. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/shared-ini-file-loader/dist-es/getHomeDir.js +22 -0
  176. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/shared-ini-file-loader/dist-es/getProfileName.js +3 -0
  177. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/shared-ini-file-loader/dist-es/getSSOTokenFilepath.js +8 -0
  178. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/shared-ini-file-loader/dist-es/getSSOTokenFromFile.js +8 -0
  179. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/shared-ini-file-loader/dist-es/getSsoSessionData.js +5 -0
  180. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/shared-ini-file-loader/dist-es/index.js +8 -0
  181. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/shared-ini-file-loader/dist-es/loadSharedConfigFiles.js +39 -0
  182. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/shared-ini-file-loader/dist-es/loadSsoSessionData.js +9 -0
  183. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/shared-ini-file-loader/dist-es/mergeConfigFiles.js +14 -0
  184. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/shared-ini-file-loader/dist-es/parseIni.js +52 -0
  185. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/shared-ini-file-loader/dist-es/parseKnownFiles.js +6 -0
  186. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/shared-ini-file-loader/dist-es/slurpFile.js +9 -0
  187. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/shared-ini-file-loader/dist-es/types.js +1 -0
  188. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/shared-ini-file-loader/dist-types/getConfigData.d.ts +8 -0
  189. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/shared-ini-file-loader/dist-types/getConfigFilepath.d.ts +2 -0
  190. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/shared-ini-file-loader/dist-types/getCredentialsFilepath.d.ts +2 -0
  191. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/shared-ini-file-loader/dist-types/getHomeDir.d.ts +6 -0
  192. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/shared-ini-file-loader/dist-types/getProfileName.d.ts +5 -0
  193. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/shared-ini-file-loader/dist-types/getSSOTokenFilepath.d.ts +4 -0
  194. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/shared-ini-file-loader/dist-types/getSSOTokenFromFile.d.ts +44 -0
  195. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/shared-ini-file-loader/dist-types/getSsoSessionData.d.ts +6 -0
  196. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/shared-ini-file-loader/dist-types/index.d.ts +8 -0
  197. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/shared-ini-file-loader/dist-types/loadSharedConfigFiles.d.ts +26 -0
  198. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/shared-ini-file-loader/dist-types/loadSsoSessionData.d.ts +10 -0
  199. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/shared-ini-file-loader/dist-types/mergeConfigFiles.d.ts +7 -0
  200. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/shared-ini-file-loader/dist-types/parseIni.d.ts +2 -0
  201. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/shared-ini-file-loader/dist-types/parseKnownFiles.d.ts +15 -0
  202. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/shared-ini-file-loader/dist-types/slurpFile.d.ts +5 -0
  203. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/shared-ini-file-loader/dist-types/ts3.4/getConfigData.d.ts +8 -0
  204. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/shared-ini-file-loader/dist-types/ts3.4/getConfigFilepath.d.ts +2 -0
  205. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/shared-ini-file-loader/dist-types/ts3.4/getCredentialsFilepath.d.ts +2 -0
  206. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/shared-ini-file-loader/dist-types/ts3.4/getHomeDir.d.ts +6 -0
  207. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/shared-ini-file-loader/dist-types/ts3.4/getProfileName.d.ts +5 -0
  208. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/shared-ini-file-loader/dist-types/ts3.4/getSSOTokenFilepath.d.ts +4 -0
  209. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/shared-ini-file-loader/dist-types/ts3.4/getSSOTokenFromFile.d.ts +44 -0
  210. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/shared-ini-file-loader/dist-types/ts3.4/getSsoSessionData.d.ts +6 -0
  211. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/shared-ini-file-loader/dist-types/ts3.4/index.d.ts +8 -0
  212. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/shared-ini-file-loader/dist-types/ts3.4/loadSharedConfigFiles.d.ts +26 -0
  213. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/shared-ini-file-loader/dist-types/ts3.4/loadSsoSessionData.d.ts +10 -0
  214. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/shared-ini-file-loader/dist-types/ts3.4/mergeConfigFiles.d.ts +7 -0
  215. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/shared-ini-file-loader/dist-types/ts3.4/parseIni.d.ts +2 -0
  216. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/shared-ini-file-loader/dist-types/ts3.4/parseKnownFiles.d.ts +15 -0
  217. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/shared-ini-file-loader/dist-types/ts3.4/slurpFile.d.ts +5 -0
  218. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/shared-ini-file-loader/dist-types/ts3.4/types.d.ts +13 -0
  219. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/shared-ini-file-loader/dist-types/types.d.ts +13 -0
  220. package/node_modules/@amzn/codewhisperer-streaming/node_modules/@smithy/shared-ini-file-loader/package.json +72 -0
  221. package/node_modules/@amzn/codewhisperer-streaming/node_modules/uuid/CHANGELOG.md +274 -0
  222. package/node_modules/@amzn/codewhisperer-streaming/node_modules/uuid/CONTRIBUTING.md +18 -0
  223. package/node_modules/@amzn/codewhisperer-streaming/node_modules/uuid/LICENSE.md +9 -0
  224. package/node_modules/@amzn/codewhisperer-streaming/node_modules/uuid/README.md +466 -0
  225. package/node_modules/@amzn/codewhisperer-streaming/node_modules/uuid/dist/bin/uuid +2 -0
  226. package/node_modules/@amzn/codewhisperer-streaming/node_modules/uuid/dist/commonjs-browser/index.js +79 -0
  227. package/node_modules/@amzn/codewhisperer-streaming/node_modules/uuid/dist/commonjs-browser/md5.js +223 -0
  228. package/node_modules/@amzn/codewhisperer-streaming/node_modules/uuid/dist/commonjs-browser/native.js +11 -0
  229. package/node_modules/@amzn/codewhisperer-streaming/node_modules/uuid/dist/commonjs-browser/nil.js +8 -0
  230. package/node_modules/@amzn/codewhisperer-streaming/node_modules/uuid/dist/commonjs-browser/parse.js +45 -0
  231. package/node_modules/@amzn/codewhisperer-streaming/node_modules/uuid/dist/commonjs-browser/regex.js +8 -0
  232. package/node_modules/@amzn/codewhisperer-streaming/node_modules/uuid/dist/commonjs-browser/rng.js +25 -0
  233. package/node_modules/@amzn/codewhisperer-streaming/node_modules/uuid/dist/commonjs-browser/sha1.js +104 -0
  234. package/node_modules/@amzn/codewhisperer-streaming/node_modules/uuid/dist/commonjs-browser/stringify.js +44 -0
  235. package/node_modules/@amzn/codewhisperer-streaming/node_modules/uuid/dist/commonjs-browser/v1.js +107 -0
  236. package/node_modules/@amzn/codewhisperer-streaming/node_modules/uuid/dist/commonjs-browser/v3.js +16 -0
  237. package/node_modules/@amzn/codewhisperer-streaming/node_modules/uuid/dist/commonjs-browser/v35.js +80 -0
  238. package/node_modules/@amzn/codewhisperer-streaming/node_modules/uuid/dist/commonjs-browser/v4.js +43 -0
  239. package/node_modules/@amzn/codewhisperer-streaming/node_modules/uuid/dist/commonjs-browser/v5.js +16 -0
  240. package/node_modules/@amzn/codewhisperer-streaming/node_modules/uuid/dist/commonjs-browser/validate.js +17 -0
  241. package/node_modules/@amzn/codewhisperer-streaming/node_modules/uuid/dist/commonjs-browser/version.js +21 -0
  242. package/node_modules/@amzn/codewhisperer-streaming/node_modules/uuid/dist/esm-browser/index.js +9 -0
  243. package/node_modules/@amzn/codewhisperer-streaming/node_modules/uuid/dist/esm-browser/md5.js +215 -0
  244. package/node_modules/@amzn/codewhisperer-streaming/node_modules/uuid/dist/esm-browser/native.js +4 -0
  245. package/node_modules/@amzn/codewhisperer-streaming/node_modules/uuid/dist/esm-browser/nil.js +1 -0
  246. package/node_modules/@amzn/codewhisperer-streaming/node_modules/uuid/dist/esm-browser/parse.js +35 -0
  247. package/node_modules/@amzn/codewhisperer-streaming/node_modules/uuid/dist/esm-browser/regex.js +1 -0
  248. package/node_modules/@amzn/codewhisperer-streaming/node_modules/uuid/dist/esm-browser/rng.js +18 -0
  249. package/node_modules/@amzn/codewhisperer-streaming/node_modules/uuid/dist/esm-browser/sha1.js +96 -0
  250. package/node_modules/@amzn/codewhisperer-streaming/node_modules/uuid/dist/esm-browser/stringify.js +33 -0
  251. package/node_modules/@amzn/codewhisperer-streaming/node_modules/uuid/dist/esm-browser/v1.js +95 -0
  252. package/node_modules/@amzn/codewhisperer-streaming/node_modules/uuid/dist/esm-browser/v3.js +4 -0
  253. package/node_modules/@amzn/codewhisperer-streaming/node_modules/uuid/dist/esm-browser/v35.js +66 -0
  254. package/node_modules/@amzn/codewhisperer-streaming/node_modules/uuid/dist/esm-browser/v4.js +29 -0
  255. package/node_modules/@amzn/codewhisperer-streaming/node_modules/uuid/dist/esm-browser/v5.js +4 -0
  256. package/node_modules/@amzn/codewhisperer-streaming/node_modules/uuid/dist/esm-browser/validate.js +7 -0
  257. package/node_modules/@amzn/codewhisperer-streaming/node_modules/uuid/dist/esm-browser/version.js +11 -0
  258. package/node_modules/@amzn/codewhisperer-streaming/node_modules/uuid/dist/esm-node/index.js +9 -0
  259. package/node_modules/@amzn/codewhisperer-streaming/node_modules/uuid/dist/esm-node/md5.js +13 -0
  260. package/node_modules/@amzn/codewhisperer-streaming/node_modules/uuid/dist/esm-node/native.js +4 -0
  261. package/node_modules/@amzn/codewhisperer-streaming/node_modules/uuid/dist/esm-node/nil.js +1 -0
  262. package/node_modules/@amzn/codewhisperer-streaming/node_modules/uuid/dist/esm-node/parse.js +35 -0
  263. package/node_modules/@amzn/codewhisperer-streaming/node_modules/uuid/dist/esm-node/regex.js +1 -0
  264. package/node_modules/@amzn/codewhisperer-streaming/node_modules/uuid/dist/esm-node/rng.js +12 -0
  265. package/node_modules/@amzn/codewhisperer-streaming/node_modules/uuid/dist/esm-node/sha1.js +13 -0
  266. package/node_modules/@amzn/codewhisperer-streaming/node_modules/uuid/dist/esm-node/stringify.js +33 -0
  267. package/node_modules/@amzn/codewhisperer-streaming/node_modules/uuid/dist/esm-node/v1.js +95 -0
  268. package/node_modules/@amzn/codewhisperer-streaming/node_modules/uuid/dist/esm-node/v3.js +4 -0
  269. package/node_modules/@amzn/codewhisperer-streaming/node_modules/uuid/dist/esm-node/v35.js +66 -0
  270. package/node_modules/@amzn/codewhisperer-streaming/node_modules/uuid/dist/esm-node/v4.js +29 -0
  271. package/node_modules/@amzn/codewhisperer-streaming/node_modules/uuid/dist/esm-node/v5.js +4 -0
  272. package/node_modules/@amzn/codewhisperer-streaming/node_modules/uuid/dist/esm-node/validate.js +7 -0
  273. package/node_modules/@amzn/codewhisperer-streaming/node_modules/uuid/dist/esm-node/version.js +11 -0
  274. package/node_modules/@amzn/codewhisperer-streaming/node_modules/uuid/dist/index.js +79 -0
  275. package/node_modules/@amzn/codewhisperer-streaming/node_modules/uuid/dist/md5-browser.js +223 -0
  276. package/node_modules/@amzn/codewhisperer-streaming/node_modules/uuid/dist/md5.js +23 -0
  277. package/node_modules/@amzn/codewhisperer-streaming/node_modules/uuid/dist/native-browser.js +11 -0
  278. package/node_modules/@amzn/codewhisperer-streaming/node_modules/uuid/dist/native.js +15 -0
  279. package/node_modules/@amzn/codewhisperer-streaming/node_modules/uuid/dist/nil.js +8 -0
  280. package/node_modules/@amzn/codewhisperer-streaming/node_modules/uuid/dist/parse.js +45 -0
  281. package/node_modules/@amzn/codewhisperer-streaming/node_modules/uuid/dist/regex.js +8 -0
  282. package/node_modules/@amzn/codewhisperer-streaming/node_modules/uuid/dist/rng-browser.js +25 -0
  283. package/node_modules/@amzn/codewhisperer-streaming/node_modules/uuid/dist/rng.js +24 -0
  284. package/node_modules/@amzn/codewhisperer-streaming/node_modules/uuid/dist/sha1-browser.js +104 -0
  285. package/node_modules/@amzn/codewhisperer-streaming/node_modules/uuid/dist/sha1.js +23 -0
  286. package/node_modules/@amzn/codewhisperer-streaming/node_modules/uuid/dist/stringify.js +44 -0
  287. package/node_modules/@amzn/codewhisperer-streaming/node_modules/uuid/dist/uuid-bin.js +85 -0
  288. package/node_modules/@amzn/codewhisperer-streaming/node_modules/uuid/dist/v1.js +107 -0
  289. package/node_modules/@amzn/codewhisperer-streaming/node_modules/uuid/dist/v3.js +16 -0
  290. package/node_modules/@amzn/codewhisperer-streaming/node_modules/uuid/dist/v35.js +80 -0
  291. package/node_modules/@amzn/codewhisperer-streaming/node_modules/uuid/dist/v4.js +43 -0
  292. package/node_modules/@amzn/codewhisperer-streaming/node_modules/uuid/dist/v5.js +16 -0
  293. package/node_modules/@amzn/codewhisperer-streaming/node_modules/uuid/dist/validate.js +17 -0
  294. package/node_modules/@amzn/codewhisperer-streaming/node_modules/uuid/dist/version.js +21 -0
  295. package/node_modules/@amzn/codewhisperer-streaming/node_modules/uuid/package.json +135 -0
  296. package/node_modules/@amzn/codewhisperer-streaming/node_modules/uuid/wrapper.mjs +10 -0
  297. package/out/client/sigv4/codewhisperer.d.ts +2 -1
  298. package/out/client/sigv4/codewhisperer.js +4 -4
  299. package/out/client/sigv4/codewhisperer.js.map +1 -1
  300. package/out/client/streamingClient/codewhispererStreamingClient.d.ts +3 -2
  301. package/out/client/streamingClient/codewhispererStreamingClient.js +4 -29
  302. package/out/client/streamingClient/codewhispererStreamingClient.js.map +1 -1
  303. package/out/client/token/bearer-token-service.json +2 -2
  304. package/out/client/token/codewhisperer.d.ts +2 -1
  305. package/out/client/token/codewhisperer.js +4 -4
  306. package/out/client/token/codewhisperer.js.map +1 -1
  307. package/out/language-server/chat/chatController.test.js +10 -2
  308. package/out/language-server/chat/chatController.test.js.map +1 -1
  309. package/out/language-server/chat/chatSessionManagementService.d.ts +2 -1
  310. package/out/language-server/chat/chatSessionManagementService.js +12 -1
  311. package/out/language-server/chat/chatSessionManagementService.js.map +1 -1
  312. package/out/language-server/chat/chatSessionManagementService.test.js +9 -1
  313. package/out/language-server/chat/chatSessionManagementService.test.js.map +1 -1
  314. package/out/language-server/chat/chatSessionService.d.ts +2 -1
  315. package/out/language-server/chat/chatSessionService.js +4 -2
  316. package/out/language-server/chat/chatSessionService.js.map +1 -1
  317. package/out/language-server/chat/chatSessionService.test.js +8 -1
  318. package/out/language-server/chat/chatSessionService.test.js.map +1 -1
  319. package/out/language-server/codeWhispererSecurityScanServer.d.ts +2 -1
  320. package/out/language-server/codeWhispererSecurityScanServer.js +2 -2
  321. package/out/language-server/codeWhispererSecurityScanServer.js.map +1 -1
  322. package/out/language-server/codeWhispererServer.d.ts +2 -2
  323. package/out/language-server/codeWhispererServer.js +8 -8
  324. package/out/language-server/codeWhispererServer.js.map +1 -1
  325. package/out/language-server/codeWhispererService.d.ts +3 -4
  326. package/out/language-server/codeWhispererService.js +11 -11
  327. package/out/language-server/codeWhispererService.js.map +1 -1
  328. package/out/language-server/configuration/qConfigurationServer.d.ts +2 -1
  329. package/out/language-server/configuration/qConfigurationServer.js +2 -2
  330. package/out/language-server/configuration/qConfigurationServer.js.map +1 -1
  331. package/out/language-server/netTransform/tests/transformHandler.test.js +9 -2
  332. package/out/language-server/netTransform/tests/transformHandler.test.js.map +1 -1
  333. package/out/language-server/netTransformServer.d.ts +2 -1
  334. package/out/language-server/netTransformServer.js +3 -3
  335. package/out/language-server/netTransformServer.js.map +1 -1
  336. package/out/language-server/proxy-server.js +12 -39
  337. package/out/language-server/proxy-server.js.map +1 -1
  338. package/out/language-server/qChatServer.d.ts +2 -1
  339. package/out/language-server/qChatServer.js +3 -3
  340. package/out/language-server/qChatServer.js.map +1 -1
  341. package/out/language-server/telemetryService.d.ts +2 -2
  342. package/out/language-server/telemetryService.js +2 -2
  343. package/out/language-server/telemetryService.js.map +1 -1
  344. package/out/language-server/telemetryService.test.js +29 -22
  345. package/out/language-server/telemetryService.test.js.map +1 -1
  346. package/out/language-server/utilities/supplementalContextUtil/crossFileContextUtil.js +15 -1
  347. package/out/language-server/utilities/supplementalContextUtil/crossFileContextUtil.js.map +1 -1
  348. package/out/language-server/utils.d.ts +2 -3
  349. package/out/language-server/utils.js +1 -26
  350. package/out/language-server/utils.js.map +1 -1
  351. package/package.json +4 -4
package/CHANGELOG.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # Changelog
2
2
 
3
+ ## [0.0.27](https://github.com/aws/language-servers/compare/lsp-codewhisperer/v0.0.26...lsp-codewhisperer/v0.0.27) (2025-02-20)
4
+
5
+
6
+ ### Bug Fixes
7
+
8
+ * fixing model change for skipped step ([#670](https://github.com/aws/language-servers/issues/670)) ([630e6fd](https://github.com/aws/language-servers/commit/630e6fde0b70bb1148e6acdc67c96d40319b6ce7))
9
+ * prevent override of client request listeners in CodeWhispererServiceIAM ([#784](https://github.com/aws/language-servers/issues/784)) ([cd85931](https://github.com/aws/language-servers/commit/cd85931f1981921cd5692944fbe1b638124e4457))
10
+
3
11
  ## [0.0.26](https://github.com/aws/language-servers/compare/lsp-codewhisperer/v0.0.25...lsp-codewhisperer/v0.0.26) (2025-02-03)
4
12
 
5
13
 
@@ -0,0 +1,201 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ APPENDIX: How to apply the Apache License to your work.
179
+
180
+ To apply the Apache License to your work, attach the following
181
+ boilerplate notice, with the fields enclosed by brackets "{}"
182
+ replaced with your own identifying information. (Don't include
183
+ the brackets!) The text should be enclosed in the appropriate
184
+ comment syntax for the file format. We also recommend that a
185
+ file or class name and description of purpose be included on the
186
+ same "printed page" as the copyright notice for easier
187
+ identification within third-party archives.
188
+
189
+ Copyright 2018-2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
190
+
191
+ Licensed under the Apache License, Version 2.0 (the "License");
192
+ you may not use this file except in compliance with the License.
193
+ You may obtain a copy of the License at
194
+
195
+ http://www.apache.org/licenses/LICENSE-2.0
196
+
197
+ Unless required by applicable law or agreed to in writing, software
198
+ distributed under the License is distributed on an "AS IS" BASIS,
199
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200
+ See the License for the specific language governing permissions and
201
+ limitations under the License.
@@ -0,0 +1,53 @@
1
+ # @aws-sdk/token-providers
2
+
3
+ [![NPM version](https://img.shields.io/npm/v/@aws-sdk/token-providers/latest.svg)](https://www.npmjs.com/package/@aws-sdk/token-providers)
4
+ [![NPM downloads](https://img.shields.io/npm/dm/@aws-sdk/token-providers.svg)](https://www.npmjs.com/package/@aws-sdk/token-providers)
5
+
6
+ A collection of all token providers. The token providers should be used when the authorization
7
+ type is going to be token based. For example, the `bearer` authorization type set using
8
+ [httpBearerAuth trait][http-bearer-auth-trait] in Smithy.
9
+
10
+ ## Static Token Provider
11
+
12
+ ```ts
13
+ import { fromStatic } from "@aws-sdk/token-providers";
14
+
15
+ const token = { token: "TOKEN" };
16
+ const staticTokenProvider = fromStatic(token);
17
+
18
+ const staticToken = await staticTokenProvider(); // returns { token: "TOKEN" }
19
+ ```
20
+
21
+ ## SSO Token Provider
22
+
23
+ ```ts
24
+ import { fromSso } from "@aws-sdk/token-providers";
25
+
26
+ // returns token from SSO token cache or ssoOidc.createToken() call.
27
+ const ssoToken = await fromSso();
28
+ ```
29
+
30
+ ## Token Provider Chain
31
+
32
+ ```ts
33
+ import { nodeProvider } from "@aws-sdk/token-providers";
34
+
35
+ // returns token from default providers.
36
+ const token = await nodeProvider();
37
+ ```
38
+
39
+ [http-bearer-auth-trait]: https://smithy.io/2.0/spec/authentication-traits.html#smithy-api-httpbearerauth-trait
40
+
41
+ ---
42
+
43
+ ### Development
44
+
45
+ This package contains a minimal copy of the SSO OIDC client, instead of relying on the full client, which
46
+ would cause a circular dependency.
47
+
48
+ When regenerating the bundled version of the SSO OIDC client, run the esbuild.js script and then make the following changes:
49
+
50
+ - Remove any dependency of the generated client on the credential chain such that it would create
51
+ a circular dependency back to this package. Because we only need the `CreateTokenCommand`, the client, and this command's
52
+ associated `Exception`s, it is possible to remove auth dependencies.
53
+ - Ensure all required packages are declared in the `package.json` of token-providers.
@@ -0,0 +1,209 @@
1
+ "use strict";
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
9
+ var __export = (target, all) => {
10
+ for (var name in all)
11
+ __defProp(target, name, { get: all[name], enumerable: true });
12
+ };
13
+ var __copyProps = (to, from, except, desc) => {
14
+ if (from && typeof from === "object" || typeof from === "function") {
15
+ for (let key of __getOwnPropNames(from))
16
+ if (!__hasOwnProp.call(to, key) && key !== except)
17
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
18
+ }
19
+ return to;
20
+ };
21
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
22
+ // If the importer is in node compatibility mode or this is not an ESM
23
+ // file that has been converted to a CommonJS file using a Babel-
24
+ // compatible transform (i.e. "__esModule" has not been set), then set
25
+ // "default" to the CommonJS "module.exports" for node compatibility.
26
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
27
+ mod
28
+ ));
29
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
30
+
31
+ // src/index.ts
32
+ var src_exports = {};
33
+ __export(src_exports, {
34
+ fromSso: () => fromSso,
35
+ fromStatic: () => fromStatic,
36
+ nodeProvider: () => nodeProvider
37
+ });
38
+ module.exports = __toCommonJS(src_exports);
39
+
40
+ // src/fromSso.ts
41
+
42
+
43
+
44
+ // src/constants.ts
45
+ var EXPIRE_WINDOW_MS = 5 * 60 * 1e3;
46
+ var REFRESH_MESSAGE = `To refresh this SSO session run 'aws sso login' with the corresponding profile.`;
47
+
48
+ // src/getSsoOidcClient.ts
49
+ var ssoOidcClientsHash = {};
50
+ var getSsoOidcClient = /* @__PURE__ */ __name(async (ssoRegion) => {
51
+ const { SSOOIDCClient } = await Promise.resolve().then(() => __toESM(require("@aws-sdk/client-sso-oidc")));
52
+ if (ssoOidcClientsHash[ssoRegion]) {
53
+ return ssoOidcClientsHash[ssoRegion];
54
+ }
55
+ const ssoOidcClient = new SSOOIDCClient({ region: ssoRegion });
56
+ ssoOidcClientsHash[ssoRegion] = ssoOidcClient;
57
+ return ssoOidcClient;
58
+ }, "getSsoOidcClient");
59
+
60
+ // src/getNewSsoOidcToken.ts
61
+ var getNewSsoOidcToken = /* @__PURE__ */ __name(async (ssoToken, ssoRegion) => {
62
+ const { CreateTokenCommand } = await Promise.resolve().then(() => __toESM(require("@aws-sdk/client-sso-oidc")));
63
+ const ssoOidcClient = await getSsoOidcClient(ssoRegion);
64
+ return ssoOidcClient.send(
65
+ new CreateTokenCommand({
66
+ clientId: ssoToken.clientId,
67
+ clientSecret: ssoToken.clientSecret,
68
+ refreshToken: ssoToken.refreshToken,
69
+ grantType: "refresh_token"
70
+ })
71
+ );
72
+ }, "getNewSsoOidcToken");
73
+
74
+ // src/validateTokenExpiry.ts
75
+ var import_property_provider = require("@smithy/property-provider");
76
+ var validateTokenExpiry = /* @__PURE__ */ __name((token) => {
77
+ if (token.expiration && token.expiration.getTime() < Date.now()) {
78
+ throw new import_property_provider.TokenProviderError(`Token is expired. ${REFRESH_MESSAGE}`, false);
79
+ }
80
+ }, "validateTokenExpiry");
81
+
82
+ // src/validateTokenKey.ts
83
+
84
+ var validateTokenKey = /* @__PURE__ */ __name((key, value, forRefresh = false) => {
85
+ if (typeof value === "undefined") {
86
+ throw new import_property_provider.TokenProviderError(
87
+ `Value not present for '${key}' in SSO Token${forRefresh ? ". Cannot refresh" : ""}. ${REFRESH_MESSAGE}`,
88
+ false
89
+ );
90
+ }
91
+ }, "validateTokenKey");
92
+
93
+ // src/writeSSOTokenToFile.ts
94
+ var import_shared_ini_file_loader = require("@smithy/shared-ini-file-loader");
95
+ var import_fs = require("fs");
96
+ var { writeFile } = import_fs.promises;
97
+ var writeSSOTokenToFile = /* @__PURE__ */ __name((id, ssoToken) => {
98
+ const tokenFilepath = (0, import_shared_ini_file_loader.getSSOTokenFilepath)(id);
99
+ const tokenString = JSON.stringify(ssoToken, null, 2);
100
+ return writeFile(tokenFilepath, tokenString);
101
+ }, "writeSSOTokenToFile");
102
+
103
+ // src/fromSso.ts
104
+ var lastRefreshAttemptTime = /* @__PURE__ */ new Date(0);
105
+ var fromSso = /* @__PURE__ */ __name((init = {}) => async () => {
106
+ var _a;
107
+ (_a = init.logger) == null ? void 0 : _a.debug("@aws-sdk/token-providers - fromSso");
108
+ const profiles = await (0, import_shared_ini_file_loader.parseKnownFiles)(init);
109
+ const profileName = (0, import_shared_ini_file_loader.getProfileName)(init);
110
+ const profile = profiles[profileName];
111
+ if (!profile) {
112
+ throw new import_property_provider.TokenProviderError(`Profile '${profileName}' could not be found in shared credentials file.`, false);
113
+ } else if (!profile["sso_session"]) {
114
+ throw new import_property_provider.TokenProviderError(`Profile '${profileName}' is missing required property 'sso_session'.`);
115
+ }
116
+ const ssoSessionName = profile["sso_session"];
117
+ const ssoSessions = await (0, import_shared_ini_file_loader.loadSsoSessionData)(init);
118
+ const ssoSession = ssoSessions[ssoSessionName];
119
+ if (!ssoSession) {
120
+ throw new import_property_provider.TokenProviderError(
121
+ `Sso session '${ssoSessionName}' could not be found in shared credentials file.`,
122
+ false
123
+ );
124
+ }
125
+ for (const ssoSessionRequiredKey of ["sso_start_url", "sso_region"]) {
126
+ if (!ssoSession[ssoSessionRequiredKey]) {
127
+ throw new import_property_provider.TokenProviderError(
128
+ `Sso session '${ssoSessionName}' is missing required property '${ssoSessionRequiredKey}'.`,
129
+ false
130
+ );
131
+ }
132
+ }
133
+ const ssoStartUrl = ssoSession["sso_start_url"];
134
+ const ssoRegion = ssoSession["sso_region"];
135
+ let ssoToken;
136
+ try {
137
+ ssoToken = await (0, import_shared_ini_file_loader.getSSOTokenFromFile)(ssoSessionName);
138
+ } catch (e) {
139
+ throw new import_property_provider.TokenProviderError(
140
+ `The SSO session token associated with profile=${profileName} was not found or is invalid. ${REFRESH_MESSAGE}`,
141
+ false
142
+ );
143
+ }
144
+ validateTokenKey("accessToken", ssoToken.accessToken);
145
+ validateTokenKey("expiresAt", ssoToken.expiresAt);
146
+ const { accessToken, expiresAt } = ssoToken;
147
+ const existingToken = { token: accessToken, expiration: new Date(expiresAt) };
148
+ if (existingToken.expiration.getTime() - Date.now() > EXPIRE_WINDOW_MS) {
149
+ return existingToken;
150
+ }
151
+ if (Date.now() - lastRefreshAttemptTime.getTime() < 30 * 1e3) {
152
+ validateTokenExpiry(existingToken);
153
+ return existingToken;
154
+ }
155
+ validateTokenKey("clientId", ssoToken.clientId, true);
156
+ validateTokenKey("clientSecret", ssoToken.clientSecret, true);
157
+ validateTokenKey("refreshToken", ssoToken.refreshToken, true);
158
+ try {
159
+ lastRefreshAttemptTime.setTime(Date.now());
160
+ const newSsoOidcToken = await getNewSsoOidcToken(ssoToken, ssoRegion);
161
+ validateTokenKey("accessToken", newSsoOidcToken.accessToken);
162
+ validateTokenKey("expiresIn", newSsoOidcToken.expiresIn);
163
+ const newTokenExpiration = new Date(Date.now() + newSsoOidcToken.expiresIn * 1e3);
164
+ try {
165
+ await writeSSOTokenToFile(ssoSessionName, {
166
+ ...ssoToken,
167
+ accessToken: newSsoOidcToken.accessToken,
168
+ expiresAt: newTokenExpiration.toISOString(),
169
+ refreshToken: newSsoOidcToken.refreshToken
170
+ });
171
+ } catch (error) {
172
+ }
173
+ return {
174
+ token: newSsoOidcToken.accessToken,
175
+ expiration: newTokenExpiration
176
+ };
177
+ } catch (error) {
178
+ validateTokenExpiry(existingToken);
179
+ return existingToken;
180
+ }
181
+ }, "fromSso");
182
+
183
+ // src/fromStatic.ts
184
+
185
+ var fromStatic = /* @__PURE__ */ __name(({ token, logger }) => async () => {
186
+ logger == null ? void 0 : logger.debug("@aws-sdk/token-providers - fromStatic");
187
+ if (!token || !token.token) {
188
+ throw new import_property_provider.TokenProviderError(`Please pass a valid token to fromStatic`, false);
189
+ }
190
+ return token;
191
+ }, "fromStatic");
192
+
193
+ // src/nodeProvider.ts
194
+
195
+ var nodeProvider = /* @__PURE__ */ __name((init = {}) => (0, import_property_provider.memoize)(
196
+ (0, import_property_provider.chain)(fromSso(init), async () => {
197
+ throw new import_property_provider.TokenProviderError("Could not load token from any providers", false);
198
+ }),
199
+ (token) => token.expiration !== void 0 && token.expiration.getTime() - Date.now() < 3e5,
200
+ (token) => token.expiration !== void 0
201
+ ), "nodeProvider");
202
+ // Annotate the CommonJS export names for ESM import in node:
203
+
204
+ 0 && (module.exports = {
205
+ fromSso,
206
+ fromStatic,
207
+ nodeProvider
208
+ });
209
+
@@ -0,0 +1,2 @@
1
+ export const EXPIRE_WINDOW_MS = 5 * 60 * 1000;
2
+ export const REFRESH_MESSAGE = `To refresh this SSO session run 'aws sso login' with the corresponding profile.`;
@@ -0,0 +1,79 @@
1
+ import { TokenProviderError } from "@smithy/property-provider";
2
+ import { getProfileName, getSSOTokenFromFile, loadSsoSessionData, parseKnownFiles, } from "@smithy/shared-ini-file-loader";
3
+ import { EXPIRE_WINDOW_MS, REFRESH_MESSAGE } from "./constants";
4
+ import { getNewSsoOidcToken } from "./getNewSsoOidcToken";
5
+ import { validateTokenExpiry } from "./validateTokenExpiry";
6
+ import { validateTokenKey } from "./validateTokenKey";
7
+ import { writeSSOTokenToFile } from "./writeSSOTokenToFile";
8
+ const lastRefreshAttemptTime = new Date(0);
9
+ export const fromSso = (init = {}) => async () => {
10
+ init.logger?.debug("@aws-sdk/token-providers - fromSso");
11
+ const profiles = await parseKnownFiles(init);
12
+ const profileName = getProfileName(init);
13
+ const profile = profiles[profileName];
14
+ if (!profile) {
15
+ throw new TokenProviderError(`Profile '${profileName}' could not be found in shared credentials file.`, false);
16
+ }
17
+ else if (!profile["sso_session"]) {
18
+ throw new TokenProviderError(`Profile '${profileName}' is missing required property 'sso_session'.`);
19
+ }
20
+ const ssoSessionName = profile["sso_session"];
21
+ const ssoSessions = await loadSsoSessionData(init);
22
+ const ssoSession = ssoSessions[ssoSessionName];
23
+ if (!ssoSession) {
24
+ throw new TokenProviderError(`Sso session '${ssoSessionName}' could not be found in shared credentials file.`, false);
25
+ }
26
+ for (const ssoSessionRequiredKey of ["sso_start_url", "sso_region"]) {
27
+ if (!ssoSession[ssoSessionRequiredKey]) {
28
+ throw new TokenProviderError(`Sso session '${ssoSessionName}' is missing required property '${ssoSessionRequiredKey}'.`, false);
29
+ }
30
+ }
31
+ const ssoStartUrl = ssoSession["sso_start_url"];
32
+ const ssoRegion = ssoSession["sso_region"];
33
+ let ssoToken;
34
+ try {
35
+ ssoToken = await getSSOTokenFromFile(ssoSessionName);
36
+ }
37
+ catch (e) {
38
+ throw new TokenProviderError(`The SSO session token associated with profile=${profileName} was not found or is invalid. ${REFRESH_MESSAGE}`, false);
39
+ }
40
+ validateTokenKey("accessToken", ssoToken.accessToken);
41
+ validateTokenKey("expiresAt", ssoToken.expiresAt);
42
+ const { accessToken, expiresAt } = ssoToken;
43
+ const existingToken = { token: accessToken, expiration: new Date(expiresAt) };
44
+ if (existingToken.expiration.getTime() - Date.now() > EXPIRE_WINDOW_MS) {
45
+ return existingToken;
46
+ }
47
+ if (Date.now() - lastRefreshAttemptTime.getTime() < 30 * 1000) {
48
+ validateTokenExpiry(existingToken);
49
+ return existingToken;
50
+ }
51
+ validateTokenKey("clientId", ssoToken.clientId, true);
52
+ validateTokenKey("clientSecret", ssoToken.clientSecret, true);
53
+ validateTokenKey("refreshToken", ssoToken.refreshToken, true);
54
+ try {
55
+ lastRefreshAttemptTime.setTime(Date.now());
56
+ const newSsoOidcToken = await getNewSsoOidcToken(ssoToken, ssoRegion);
57
+ validateTokenKey("accessToken", newSsoOidcToken.accessToken);
58
+ validateTokenKey("expiresIn", newSsoOidcToken.expiresIn);
59
+ const newTokenExpiration = new Date(Date.now() + newSsoOidcToken.expiresIn * 1000);
60
+ try {
61
+ await writeSSOTokenToFile(ssoSessionName, {
62
+ ...ssoToken,
63
+ accessToken: newSsoOidcToken.accessToken,
64
+ expiresAt: newTokenExpiration.toISOString(),
65
+ refreshToken: newSsoOidcToken.refreshToken,
66
+ });
67
+ }
68
+ catch (error) {
69
+ }
70
+ return {
71
+ token: newSsoOidcToken.accessToken,
72
+ expiration: newTokenExpiration,
73
+ };
74
+ }
75
+ catch (error) {
76
+ validateTokenExpiry(existingToken);
77
+ return existingToken;
78
+ }
79
+ };
@@ -0,0 +1,8 @@
1
+ import { TokenProviderError } from "@smithy/property-provider";
2
+ export const fromStatic = ({ token, logger }) => async () => {
3
+ logger?.debug("@aws-sdk/token-providers - fromStatic");
4
+ if (!token || !token.token) {
5
+ throw new TokenProviderError(`Please pass a valid token to fromStatic`, false);
6
+ }
7
+ return token;
8
+ };
@@ -0,0 +1,11 @@
1
+ import { getSsoOidcClient } from "./getSsoOidcClient";
2
+ export const getNewSsoOidcToken = async (ssoToken, ssoRegion) => {
3
+ const { CreateTokenCommand } = await import("@aws-sdk/client-sso-oidc");
4
+ const ssoOidcClient = await getSsoOidcClient(ssoRegion);
5
+ return ssoOidcClient.send(new CreateTokenCommand({
6
+ clientId: ssoToken.clientId,
7
+ clientSecret: ssoToken.clientSecret,
8
+ refreshToken: ssoToken.refreshToken,
9
+ grantType: "refresh_token",
10
+ }));
11
+ };
@@ -0,0 +1,10 @@
1
+ const ssoOidcClientsHash = {};
2
+ export const getSsoOidcClient = async (ssoRegion) => {
3
+ const { SSOOIDCClient } = await import("@aws-sdk/client-sso-oidc");
4
+ if (ssoOidcClientsHash[ssoRegion]) {
5
+ return ssoOidcClientsHash[ssoRegion];
6
+ }
7
+ const ssoOidcClient = new SSOOIDCClient({ region: ssoRegion });
8
+ ssoOidcClientsHash[ssoRegion] = ssoOidcClient;
9
+ return ssoOidcClient;
10
+ };
@@ -0,0 +1,3 @@
1
+ export * from "./fromSso";
2
+ export * from "./fromStatic";
3
+ export * from "./nodeProvider";
@@ -0,0 +1,5 @@
1
+ import { chain, memoize, TokenProviderError } from "@smithy/property-provider";
2
+ import { fromSso } from "./fromSso";
3
+ export const nodeProvider = (init = {}) => memoize(chain(fromSso(init), async () => {
4
+ throw new TokenProviderError("Could not load token from any providers", false);
5
+ }), (token) => token.expiration !== undefined && token.expiration.getTime() - Date.now() < 300000, (token) => token.expiration !== undefined);
@@ -0,0 +1,7 @@
1
+ import { TokenProviderError } from "@smithy/property-provider";
2
+ import { REFRESH_MESSAGE } from "./constants";
3
+ export const validateTokenExpiry = (token) => {
4
+ if (token.expiration && token.expiration.getTime() < Date.now()) {
5
+ throw new TokenProviderError(`Token is expired. ${REFRESH_MESSAGE}`, false);
6
+ }
7
+ };
@@ -0,0 +1,7 @@
1
+ import { TokenProviderError } from "@smithy/property-provider";
2
+ import { REFRESH_MESSAGE } from "./constants";
3
+ export const validateTokenKey = (key, value, forRefresh = false) => {
4
+ if (typeof value === "undefined") {
5
+ throw new TokenProviderError(`Value not present for '${key}' in SSO Token${forRefresh ? ". Cannot refresh" : ""}. ${REFRESH_MESSAGE}`, false);
6
+ }
7
+ };
@@ -0,0 +1,8 @@
1
+ import { getSSOTokenFilepath } from "@smithy/shared-ini-file-loader";
2
+ import { promises as fsPromises } from "fs";
3
+ const { writeFile } = fsPromises;
4
+ export const writeSSOTokenToFile = (id, ssoToken) => {
5
+ const tokenFilepath = getSSOTokenFilepath(id);
6
+ const tokenString = JSON.stringify(ssoToken, null, 2);
7
+ return writeFile(tokenFilepath, tokenString);
8
+ };
@@ -0,0 +1,8 @@
1
+ /**
2
+ * The time window (5 mins) that SDK will treat the SSO token expires in before the defined expiration date in token.
3
+ * This is needed because server side may have invalidated the token before the defined expiration date.
4
+ *
5
+ * @internal
6
+ */
7
+ export declare const EXPIRE_WINDOW_MS: number;
8
+ export declare const REFRESH_MESSAGE = "To refresh this SSO session run 'aws sso login' with the corresponding profile.";
@@ -0,0 +1,8 @@
1
+ import { CredentialProviderOptions, TokenIdentityProvider } from "@aws-sdk/types";
2
+ import { SourceProfileInit } from "@smithy/shared-ini-file-loader";
3
+ export interface FromSsoInit extends SourceProfileInit, CredentialProviderOptions {
4
+ }
5
+ /**
6
+ * Creates a token provider that will read from SSO token cache or ssoOidc.createToken() call.
7
+ */
8
+ export declare const fromSso: (init?: FromSsoInit) => TokenIdentityProvider;