serverless-spy 0.0.5 → 0.0.6

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 (269) hide show
  1. package/.jsii +3 -2
  2. package/lib/ServerlessSpy.js +1 -1
  3. package/listener/createServerlessSpyListener.ts +12 -2
  4. package/listener/index.ts +1 -0
  5. package/node_modules/@aws-sdk/client-cognito-identity/CHANGELOG.md +4150 -0
  6. package/node_modules/@aws-sdk/client-cognito-identity/LICENSE +201 -0
  7. package/node_modules/@aws-sdk/client-cognito-identity/README.md +219 -0
  8. package/node_modules/@aws-sdk/client-cognito-identity/dist-cjs/CognitoIdentity.js +352 -0
  9. package/node_modules/@aws-sdk/client-cognito-identity/dist-cjs/CognitoIdentityClient.js +36 -0
  10. package/node_modules/@aws-sdk/client-cognito-identity/dist-cjs/commands/CreateIdentityPoolCommand.js +38 -0
  11. package/node_modules/@aws-sdk/client-cognito-identity/dist-cjs/commands/DeleteIdentitiesCommand.js +38 -0
  12. package/node_modules/@aws-sdk/client-cognito-identity/dist-cjs/commands/DeleteIdentityPoolCommand.js +38 -0
  13. package/node_modules/@aws-sdk/client-cognito-identity/dist-cjs/commands/DescribeIdentityCommand.js +38 -0
  14. package/node_modules/@aws-sdk/client-cognito-identity/dist-cjs/commands/DescribeIdentityPoolCommand.js +38 -0
  15. package/node_modules/@aws-sdk/client-cognito-identity/dist-cjs/commands/GetCredentialsForIdentityCommand.js +36 -0
  16. package/node_modules/@aws-sdk/client-cognito-identity/dist-cjs/commands/GetIdCommand.js +36 -0
  17. package/node_modules/@aws-sdk/client-cognito-identity/dist-cjs/commands/GetIdentityPoolRolesCommand.js +38 -0
  18. package/node_modules/@aws-sdk/client-cognito-identity/dist-cjs/commands/GetOpenIdTokenCommand.js +36 -0
  19. package/node_modules/@aws-sdk/client-cognito-identity/dist-cjs/commands/GetOpenIdTokenForDeveloperIdentityCommand.js +38 -0
  20. package/node_modules/@aws-sdk/client-cognito-identity/dist-cjs/commands/GetPrincipalTagAttributeMapCommand.js +38 -0
  21. package/node_modules/@aws-sdk/client-cognito-identity/dist-cjs/commands/ListIdentitiesCommand.js +38 -0
  22. package/node_modules/@aws-sdk/client-cognito-identity/dist-cjs/commands/ListIdentityPoolsCommand.js +38 -0
  23. package/node_modules/@aws-sdk/client-cognito-identity/dist-cjs/commands/ListTagsForResourceCommand.js +38 -0
  24. package/node_modules/@aws-sdk/client-cognito-identity/dist-cjs/commands/LookupDeveloperIdentityCommand.js +38 -0
  25. package/node_modules/@aws-sdk/client-cognito-identity/dist-cjs/commands/MergeDeveloperIdentitiesCommand.js +38 -0
  26. package/node_modules/@aws-sdk/client-cognito-identity/dist-cjs/commands/SetIdentityPoolRolesCommand.js +38 -0
  27. package/node_modules/@aws-sdk/client-cognito-identity/dist-cjs/commands/SetPrincipalTagAttributeMapCommand.js +38 -0
  28. package/node_modules/@aws-sdk/client-cognito-identity/dist-cjs/commands/TagResourceCommand.js +38 -0
  29. package/node_modules/@aws-sdk/client-cognito-identity/dist-cjs/commands/UnlinkDeveloperIdentityCommand.js +38 -0
  30. package/node_modules/@aws-sdk/client-cognito-identity/dist-cjs/commands/UnlinkIdentityCommand.js +36 -0
  31. package/node_modules/@aws-sdk/client-cognito-identity/dist-cjs/commands/UntagResourceCommand.js +38 -0
  32. package/node_modules/@aws-sdk/client-cognito-identity/dist-cjs/commands/UpdateIdentityPoolCommand.js +38 -0
  33. package/node_modules/@aws-sdk/client-cognito-identity/dist-cjs/commands/index.js +26 -0
  34. package/node_modules/@aws-sdk/client-cognito-identity/dist-cjs/endpoints.js +167 -0
  35. package/node_modules/@aws-sdk/client-cognito-identity/dist-cjs/index.js +11 -0
  36. package/node_modules/@aws-sdk/client-cognito-identity/dist-cjs/models/CognitoIdentityServiceException.js +11 -0
  37. package/node_modules/@aws-sdk/client-cognito-identity/dist-cjs/models/index.js +4 -0
  38. package/node_modules/@aws-sdk/client-cognito-identity/dist-cjs/models/models_0.js +354 -0
  39. package/node_modules/@aws-sdk/client-cognito-identity/dist-cjs/pagination/Interfaces.js +2 -0
  40. package/node_modules/@aws-sdk/client-cognito-identity/dist-cjs/pagination/ListIdentityPoolsPaginator.js +36 -0
  41. package/node_modules/@aws-sdk/client-cognito-identity/dist-cjs/pagination/index.js +5 -0
  42. package/node_modules/@aws-sdk/client-cognito-identity/dist-cjs/protocols/Aws_json1_1.js +2236 -0
  43. package/node_modules/@aws-sdk/client-cognito-identity/dist-cjs/runtimeConfig.browser.js +45 -0
  44. package/node_modules/@aws-sdk/client-cognito-identity/dist-cjs/runtimeConfig.js +52 -0
  45. package/node_modules/@aws-sdk/client-cognito-identity/dist-cjs/runtimeConfig.native.js +16 -0
  46. package/node_modules/@aws-sdk/client-cognito-identity/dist-cjs/runtimeConfig.shared.js +17 -0
  47. package/node_modules/@aws-sdk/client-cognito-identity/dist-es/CognitoIdentity.js +355 -0
  48. package/node_modules/@aws-sdk/client-cognito-identity/dist-es/CognitoIdentityClient.js +38 -0
  49. package/node_modules/@aws-sdk/client-cognito-identity/dist-es/commands/CreateIdentityPoolCommand.js +41 -0
  50. package/node_modules/@aws-sdk/client-cognito-identity/dist-es/commands/DeleteIdentitiesCommand.js +41 -0
  51. package/node_modules/@aws-sdk/client-cognito-identity/dist-es/commands/DeleteIdentityPoolCommand.js +41 -0
  52. package/node_modules/@aws-sdk/client-cognito-identity/dist-es/commands/DescribeIdentityCommand.js +41 -0
  53. package/node_modules/@aws-sdk/client-cognito-identity/dist-es/commands/DescribeIdentityPoolCommand.js +41 -0
  54. package/node_modules/@aws-sdk/client-cognito-identity/dist-es/commands/GetCredentialsForIdentityCommand.js +39 -0
  55. package/node_modules/@aws-sdk/client-cognito-identity/dist-es/commands/GetIdCommand.js +39 -0
  56. package/node_modules/@aws-sdk/client-cognito-identity/dist-es/commands/GetIdentityPoolRolesCommand.js +41 -0
  57. package/node_modules/@aws-sdk/client-cognito-identity/dist-es/commands/GetOpenIdTokenCommand.js +39 -0
  58. package/node_modules/@aws-sdk/client-cognito-identity/dist-es/commands/GetOpenIdTokenForDeveloperIdentityCommand.js +41 -0
  59. package/node_modules/@aws-sdk/client-cognito-identity/dist-es/commands/GetPrincipalTagAttributeMapCommand.js +41 -0
  60. package/node_modules/@aws-sdk/client-cognito-identity/dist-es/commands/ListIdentitiesCommand.js +41 -0
  61. package/node_modules/@aws-sdk/client-cognito-identity/dist-es/commands/ListIdentityPoolsCommand.js +41 -0
  62. package/node_modules/@aws-sdk/client-cognito-identity/dist-es/commands/ListTagsForResourceCommand.js +41 -0
  63. package/node_modules/@aws-sdk/client-cognito-identity/dist-es/commands/LookupDeveloperIdentityCommand.js +41 -0
  64. package/node_modules/@aws-sdk/client-cognito-identity/dist-es/commands/MergeDeveloperIdentitiesCommand.js +41 -0
  65. package/node_modules/@aws-sdk/client-cognito-identity/dist-es/commands/SetIdentityPoolRolesCommand.js +41 -0
  66. package/node_modules/@aws-sdk/client-cognito-identity/dist-es/commands/SetPrincipalTagAttributeMapCommand.js +41 -0
  67. package/node_modules/@aws-sdk/client-cognito-identity/dist-es/commands/TagResourceCommand.js +41 -0
  68. package/node_modules/@aws-sdk/client-cognito-identity/dist-es/commands/UnlinkDeveloperIdentityCommand.js +41 -0
  69. package/node_modules/@aws-sdk/client-cognito-identity/dist-es/commands/UnlinkIdentityCommand.js +39 -0
  70. package/node_modules/@aws-sdk/client-cognito-identity/dist-es/commands/UntagResourceCommand.js +41 -0
  71. package/node_modules/@aws-sdk/client-cognito-identity/dist-es/commands/UpdateIdentityPoolCommand.js +41 -0
  72. package/node_modules/@aws-sdk/client-cognito-identity/dist-es/commands/index.js +23 -0
  73. package/node_modules/@aws-sdk/client-cognito-identity/dist-es/endpoints.js +163 -0
  74. package/node_modules/@aws-sdk/client-cognito-identity/dist-es/index.js +6 -0
  75. package/node_modules/@aws-sdk/client-cognito-identity/dist-es/models/CognitoIdentityServiceException.js +12 -0
  76. package/node_modules/@aws-sdk/client-cognito-identity/dist-es/models/index.js +1 -0
  77. package/node_modules/@aws-sdk/client-cognito-identity/dist-es/models/models_0.js +202 -0
  78. package/node_modules/@aws-sdk/client-cognito-identity/dist-es/pagination/Interfaces.js +1 -0
  79. package/node_modules/@aws-sdk/client-cognito-identity/dist-es/pagination/ListIdentityPoolsPaginator.js +75 -0
  80. package/node_modules/@aws-sdk/client-cognito-identity/dist-es/pagination/index.js +2 -0
  81. package/node_modules/@aws-sdk/client-cognito-identity/dist-es/protocols/Aws_json1_1.js +2662 -0
  82. package/node_modules/@aws-sdk/client-cognito-identity/dist-es/runtimeConfig.browser.js +26 -0
  83. package/node_modules/@aws-sdk/client-cognito-identity/dist-es/runtimeConfig.js +30 -0
  84. package/node_modules/@aws-sdk/client-cognito-identity/dist-es/runtimeConfig.native.js +8 -0
  85. package/node_modules/@aws-sdk/client-cognito-identity/dist-es/runtimeConfig.shared.js +13 -0
  86. package/node_modules/@aws-sdk/client-cognito-identity/dist-types/CognitoIdentity.d.ts +295 -0
  87. package/node_modules/@aws-sdk/client-cognito-identity/dist-types/CognitoIdentityClient.d.ts +180 -0
  88. package/node_modules/@aws-sdk/client-cognito-identity/dist-types/commands/CreateIdentityPoolCommand.d.ts +61 -0
  89. package/node_modules/@aws-sdk/client-cognito-identity/dist-types/commands/DeleteIdentitiesCommand.d.ts +37 -0
  90. package/node_modules/@aws-sdk/client-cognito-identity/dist-types/commands/DeleteIdentityPoolCommand.d.ts +37 -0
  91. package/node_modules/@aws-sdk/client-cognito-identity/dist-types/commands/DescribeIdentityCommand.d.ts +37 -0
  92. package/node_modules/@aws-sdk/client-cognito-identity/dist-types/commands/DescribeIdentityPoolCommand.d.ts +37 -0
  93. package/node_modules/@aws-sdk/client-cognito-identity/dist-types/commands/GetCredentialsForIdentityCommand.d.ts +39 -0
  94. package/node_modules/@aws-sdk/client-cognito-identity/dist-types/commands/GetIdCommand.d.ts +37 -0
  95. package/node_modules/@aws-sdk/client-cognito-identity/dist-types/commands/GetIdentityPoolRolesCommand.d.ts +36 -0
  96. package/node_modules/@aws-sdk/client-cognito-identity/dist-types/commands/GetOpenIdTokenCommand.d.ts +39 -0
  97. package/node_modules/@aws-sdk/client-cognito-identity/dist-types/commands/GetOpenIdTokenForDeveloperIdentityCommand.d.ts +47 -0
  98. package/node_modules/@aws-sdk/client-cognito-identity/dist-types/commands/GetPrincipalTagAttributeMapCommand.d.ts +35 -0
  99. package/node_modules/@aws-sdk/client-cognito-identity/dist-types/commands/ListIdentitiesCommand.d.ts +36 -0
  100. package/node_modules/@aws-sdk/client-cognito-identity/dist-types/commands/ListIdentityPoolsCommand.d.ts +36 -0
  101. package/node_modules/@aws-sdk/client-cognito-identity/dist-types/commands/ListTagsForResourceCommand.d.ts +38 -0
  102. package/node_modules/@aws-sdk/client-cognito-identity/dist-types/commands/LookupDeveloperIdentityCommand.d.ts +51 -0
  103. package/node_modules/@aws-sdk/client-cognito-identity/dist-types/commands/MergeDeveloperIdentitiesCommand.d.ts +47 -0
  104. package/node_modules/@aws-sdk/client-cognito-identity/dist-types/commands/SetIdentityPoolRolesCommand.d.ts +36 -0
  105. package/node_modules/@aws-sdk/client-cognito-identity/dist-types/commands/SetPrincipalTagAttributeMapCommand.d.ts +35 -0
  106. package/node_modules/@aws-sdk/client-cognito-identity/dist-types/commands/TagResourceCommand.d.ts +49 -0
  107. package/node_modules/@aws-sdk/client-cognito-identity/dist-types/commands/UnlinkDeveloperIdentityCommand.d.ts +39 -0
  108. package/node_modules/@aws-sdk/client-cognito-identity/dist-types/commands/UnlinkIdentityCommand.d.ts +38 -0
  109. package/node_modules/@aws-sdk/client-cognito-identity/dist-types/commands/UntagResourceCommand.d.ts +36 -0
  110. package/node_modules/@aws-sdk/client-cognito-identity/dist-types/commands/UpdateIdentityPoolCommand.d.ts +36 -0
  111. package/node_modules/@aws-sdk/client-cognito-identity/dist-types/commands/index.d.ts +23 -0
  112. package/node_modules/@aws-sdk/client-cognito-identity/dist-types/endpoints.d.ts +2 -0
  113. package/node_modules/@aws-sdk/client-cognito-identity/dist-types/index.d.ts +6 -0
  114. package/node_modules/@aws-sdk/client-cognito-identity/dist-types/models/CognitoIdentityServiceException.d.ts +10 -0
  115. package/node_modules/@aws-sdk/client-cognito-identity/dist-types/models/index.d.ts +1 -0
  116. package/node_modules/@aws-sdk/client-cognito-identity/dist-types/models/models_0.d.ts +1166 -0
  117. package/node_modules/@aws-sdk/client-cognito-identity/dist-types/pagination/Interfaces.d.ts +6 -0
  118. package/node_modules/@aws-sdk/client-cognito-identity/dist-types/pagination/ListIdentityPoolsPaginator.d.ts +4 -0
  119. package/node_modules/@aws-sdk/client-cognito-identity/dist-types/pagination/index.d.ts +2 -0
  120. package/node_modules/@aws-sdk/client-cognito-identity/dist-types/protocols/Aws_json1_1.d.ts +71 -0
  121. package/node_modules/@aws-sdk/client-cognito-identity/dist-types/runtimeConfig.browser.d.ts +40 -0
  122. package/node_modules/@aws-sdk/client-cognito-identity/dist-types/runtimeConfig.d.ts +40 -0
  123. package/node_modules/@aws-sdk/client-cognito-identity/dist-types/runtimeConfig.native.d.ts +39 -0
  124. package/node_modules/@aws-sdk/client-cognito-identity/dist-types/runtimeConfig.shared.d.ts +13 -0
  125. package/node_modules/@aws-sdk/client-cognito-identity/dist-types/ts3.4/CognitoIdentity.d.ts +120 -0
  126. package/node_modules/@aws-sdk/client-cognito-identity/dist-types/ts3.4/CognitoIdentityClient.d.ts +96 -0
  127. package/node_modules/@aws-sdk/client-cognito-identity/dist-types/ts3.4/commands/CreateIdentityPoolCommand.d.ts +17 -0
  128. package/node_modules/@aws-sdk/client-cognito-identity/dist-types/ts3.4/commands/DeleteIdentitiesCommand.d.ts +17 -0
  129. package/node_modules/@aws-sdk/client-cognito-identity/dist-types/ts3.4/commands/DeleteIdentityPoolCommand.d.ts +17 -0
  130. package/node_modules/@aws-sdk/client-cognito-identity/dist-types/ts3.4/commands/DescribeIdentityCommand.d.ts +17 -0
  131. package/node_modules/@aws-sdk/client-cognito-identity/dist-types/ts3.4/commands/DescribeIdentityPoolCommand.d.ts +17 -0
  132. package/node_modules/@aws-sdk/client-cognito-identity/dist-types/ts3.4/commands/GetCredentialsForIdentityCommand.d.ts +17 -0
  133. package/node_modules/@aws-sdk/client-cognito-identity/dist-types/ts3.4/commands/GetIdCommand.d.ts +17 -0
  134. package/node_modules/@aws-sdk/client-cognito-identity/dist-types/ts3.4/commands/GetIdentityPoolRolesCommand.d.ts +17 -0
  135. package/node_modules/@aws-sdk/client-cognito-identity/dist-types/ts3.4/commands/GetOpenIdTokenCommand.d.ts +17 -0
  136. package/node_modules/@aws-sdk/client-cognito-identity/dist-types/ts3.4/commands/GetOpenIdTokenForDeveloperIdentityCommand.d.ts +17 -0
  137. package/node_modules/@aws-sdk/client-cognito-identity/dist-types/ts3.4/commands/GetPrincipalTagAttributeMapCommand.d.ts +17 -0
  138. package/node_modules/@aws-sdk/client-cognito-identity/dist-types/ts3.4/commands/ListIdentitiesCommand.d.ts +17 -0
  139. package/node_modules/@aws-sdk/client-cognito-identity/dist-types/ts3.4/commands/ListIdentityPoolsCommand.d.ts +17 -0
  140. package/node_modules/@aws-sdk/client-cognito-identity/dist-types/ts3.4/commands/ListTagsForResourceCommand.d.ts +17 -0
  141. package/node_modules/@aws-sdk/client-cognito-identity/dist-types/ts3.4/commands/LookupDeveloperIdentityCommand.d.ts +17 -0
  142. package/node_modules/@aws-sdk/client-cognito-identity/dist-types/ts3.4/commands/MergeDeveloperIdentitiesCommand.d.ts +17 -0
  143. package/node_modules/@aws-sdk/client-cognito-identity/dist-types/ts3.4/commands/SetIdentityPoolRolesCommand.d.ts +17 -0
  144. package/node_modules/@aws-sdk/client-cognito-identity/dist-types/ts3.4/commands/SetPrincipalTagAttributeMapCommand.d.ts +17 -0
  145. package/node_modules/@aws-sdk/client-cognito-identity/dist-types/ts3.4/commands/TagResourceCommand.d.ts +17 -0
  146. package/node_modules/@aws-sdk/client-cognito-identity/dist-types/ts3.4/commands/UnlinkDeveloperIdentityCommand.d.ts +17 -0
  147. package/node_modules/@aws-sdk/client-cognito-identity/dist-types/ts3.4/commands/UnlinkIdentityCommand.d.ts +17 -0
  148. package/node_modules/@aws-sdk/client-cognito-identity/dist-types/ts3.4/commands/UntagResourceCommand.d.ts +17 -0
  149. package/node_modules/@aws-sdk/client-cognito-identity/dist-types/ts3.4/commands/UpdateIdentityPoolCommand.d.ts +17 -0
  150. package/node_modules/@aws-sdk/client-cognito-identity/dist-types/ts3.4/commands/index.d.ts +23 -0
  151. package/node_modules/@aws-sdk/client-cognito-identity/dist-types/ts3.4/endpoints.d.ts +2 -0
  152. package/node_modules/@aws-sdk/client-cognito-identity/dist-types/ts3.4/index.d.ts +6 -0
  153. package/node_modules/@aws-sdk/client-cognito-identity/dist-types/ts3.4/models/CognitoIdentityServiceException.d.ts +6 -0
  154. package/node_modules/@aws-sdk/client-cognito-identity/dist-types/ts3.4/models/index.d.ts +1 -0
  155. package/node_modules/@aws-sdk/client-cognito-identity/dist-types/ts3.4/models/models_0.d.ts +567 -0
  156. package/node_modules/@aws-sdk/client-cognito-identity/dist-types/ts3.4/pagination/Interfaces.d.ts +6 -0
  157. package/node_modules/@aws-sdk/client-cognito-identity/dist-types/ts3.4/pagination/ListIdentityPoolsPaginator.d.ts +4 -0
  158. package/node_modules/@aws-sdk/client-cognito-identity/dist-types/ts3.4/pagination/index.d.ts +2 -0
  159. package/node_modules/@aws-sdk/client-cognito-identity/dist-types/ts3.4/protocols/Aws_json1_1.d.ts +71 -0
  160. package/node_modules/@aws-sdk/client-cognito-identity/dist-types/ts3.4/runtimeConfig.browser.d.ts +38 -0
  161. package/node_modules/@aws-sdk/client-cognito-identity/dist-types/ts3.4/runtimeConfig.d.ts +38 -0
  162. package/node_modules/@aws-sdk/client-cognito-identity/dist-types/ts3.4/runtimeConfig.native.d.ts +37 -0
  163. package/node_modules/@aws-sdk/client-cognito-identity/dist-types/ts3.4/runtimeConfig.shared.d.ts +11 -0
  164. package/node_modules/@aws-sdk/client-cognito-identity/package.json +107 -0
  165. package/node_modules/@aws-sdk/credential-provider-cognito-identity/CHANGELOG.md +4874 -0
  166. package/node_modules/@aws-sdk/credential-provider-cognito-identity/LICENSE +201 -0
  167. package/node_modules/@aws-sdk/credential-provider-cognito-identity/README.md +11 -0
  168. package/node_modules/@aws-sdk/credential-provider-cognito-identity/dist-cjs/CognitoProviderParameters.js +2 -0
  169. package/node_modules/@aws-sdk/credential-provider-cognito-identity/dist-cjs/InMemoryStorage.js +21 -0
  170. package/node_modules/@aws-sdk/credential-provider-cognito-identity/dist-cjs/IndexedDbStorage.js +71 -0
  171. package/node_modules/@aws-sdk/credential-provider-cognito-identity/dist-cjs/Logins.js +2 -0
  172. package/node_modules/@aws-sdk/credential-provider-cognito-identity/dist-cjs/Storage.js +2 -0
  173. package/node_modules/@aws-sdk/credential-provider-cognito-identity/dist-cjs/fromCognitoIdentity.js +32 -0
  174. package/node_modules/@aws-sdk/credential-provider-cognito-identity/dist-cjs/fromCognitoIdentityPool.js +42 -0
  175. package/node_modules/@aws-sdk/credential-provider-cognito-identity/dist-cjs/index.js +8 -0
  176. package/node_modules/@aws-sdk/credential-provider-cognito-identity/dist-cjs/localStorage.js +16 -0
  177. package/node_modules/@aws-sdk/credential-provider-cognito-identity/dist-cjs/resolveLogins.js +19 -0
  178. package/node_modules/@aws-sdk/credential-provider-cognito-identity/dist-es/CognitoProviderParameters.js +1 -0
  179. package/node_modules/@aws-sdk/credential-provider-cognito-identity/dist-es/InMemoryStorage.js +20 -0
  180. package/node_modules/@aws-sdk/credential-provider-cognito-identity/dist-es/IndexedDbStorage.js +70 -0
  181. package/node_modules/@aws-sdk/credential-provider-cognito-identity/dist-es/Logins.js +1 -0
  182. package/node_modules/@aws-sdk/credential-provider-cognito-identity/dist-es/Storage.js +1 -0
  183. package/node_modules/@aws-sdk/credential-provider-cognito-identity/dist-es/fromCognitoIdentity.js +50 -0
  184. package/node_modules/@aws-sdk/credential-provider-cognito-identity/dist-es/fromCognitoIdentityPool.js +73 -0
  185. package/node_modules/@aws-sdk/credential-provider-cognito-identity/dist-es/index.js +5 -0
  186. package/node_modules/@aws-sdk/credential-provider-cognito-identity/dist-es/localStorage.js +12 -0
  187. package/node_modules/@aws-sdk/credential-provider-cognito-identity/dist-es/resolveLogins.js +19 -0
  188. package/node_modules/@aws-sdk/credential-provider-cognito-identity/dist-types/CognitoProviderParameters.d.ts +25 -0
  189. package/node_modules/@aws-sdk/credential-provider-cognito-identity/dist-types/InMemoryStorage.d.ts +8 -0
  190. package/node_modules/@aws-sdk/credential-provider-cognito-identity/dist-types/IndexedDbStorage.d.ts +10 -0
  191. package/node_modules/@aws-sdk/credential-provider-cognito-identity/dist-types/Logins.d.ts +3 -0
  192. package/node_modules/@aws-sdk/credential-provider-cognito-identity/dist-types/Storage.d.ts +14 -0
  193. package/node_modules/@aws-sdk/credential-provider-cognito-identity/dist-types/fromCognitoIdentity.d.ts +23 -0
  194. package/node_modules/@aws-sdk/credential-provider-cognito-identity/dist-types/fromCognitoIdentityPool.d.ts +44 -0
  195. package/node_modules/@aws-sdk/credential-provider-cognito-identity/dist-types/index.d.ts +5 -0
  196. package/node_modules/@aws-sdk/credential-provider-cognito-identity/dist-types/localStorage.d.ts +2 -0
  197. package/node_modules/@aws-sdk/credential-provider-cognito-identity/dist-types/resolveLogins.d.ts +5 -0
  198. package/node_modules/@aws-sdk/credential-provider-cognito-identity/dist-types/ts3.4/CognitoProviderParameters.d.ts +10 -0
  199. package/node_modules/@aws-sdk/credential-provider-cognito-identity/dist-types/ts3.4/InMemoryStorage.d.ts +8 -0
  200. package/node_modules/@aws-sdk/credential-provider-cognito-identity/dist-types/ts3.4/IndexedDbStorage.d.ts +10 -0
  201. package/node_modules/@aws-sdk/credential-provider-cognito-identity/dist-types/ts3.4/Logins.d.ts +3 -0
  202. package/node_modules/@aws-sdk/credential-provider-cognito-identity/dist-types/ts3.4/Storage.d.ts +6 -0
  203. package/node_modules/@aws-sdk/credential-provider-cognito-identity/dist-types/ts3.4/fromCognitoIdentity.d.ts +13 -0
  204. package/node_modules/@aws-sdk/credential-provider-cognito-identity/dist-types/ts3.4/fromCognitoIdentityPool.d.ts +15 -0
  205. package/node_modules/@aws-sdk/credential-provider-cognito-identity/dist-types/ts3.4/index.d.ts +5 -0
  206. package/node_modules/@aws-sdk/credential-provider-cognito-identity/dist-types/ts3.4/localStorage.d.ts +2 -0
  207. package/node_modules/@aws-sdk/credential-provider-cognito-identity/dist-types/ts3.4/resolveLogins.d.ts +3 -0
  208. package/node_modules/@aws-sdk/credential-provider-cognito-identity/package.json +59 -0
  209. package/node_modules/@aws-sdk/credential-providers/CHANGELOG.md +570 -0
  210. package/node_modules/@aws-sdk/credential-providers/LICENSE +201 -0
  211. package/node_modules/@aws-sdk/credential-providers/README.md +663 -0
  212. package/node_modules/@aws-sdk/credential-providers/dist-cjs/fromCognitoIdentity.js +13 -0
  213. package/node_modules/@aws-sdk/credential-providers/dist-cjs/fromCognitoIdentityPool.js +13 -0
  214. package/node_modules/@aws-sdk/credential-providers/dist-cjs/fromContainerMetadata.js +6 -0
  215. package/node_modules/@aws-sdk/credential-providers/dist-cjs/fromEnv.js +6 -0
  216. package/node_modules/@aws-sdk/credential-providers/dist-cjs/fromIni.js +14 -0
  217. package/node_modules/@aws-sdk/credential-providers/dist-cjs/fromInstanceMetadata.js +6 -0
  218. package/node_modules/@aws-sdk/credential-providers/dist-cjs/fromNodeProviderChain.js +14 -0
  219. package/node_modules/@aws-sdk/credential-providers/dist-cjs/fromProcess.js +6 -0
  220. package/node_modules/@aws-sdk/credential-providers/dist-cjs/fromSSO.js +7 -0
  221. package/node_modules/@aws-sdk/credential-providers/dist-cjs/fromTemporaryCredentials.js +31 -0
  222. package/node_modules/@aws-sdk/credential-providers/dist-cjs/fromTokenFile.js +13 -0
  223. package/node_modules/@aws-sdk/credential-providers/dist-cjs/fromWebToken.js +13 -0
  224. package/node_modules/@aws-sdk/credential-providers/dist-cjs/index.js +15 -0
  225. package/node_modules/@aws-sdk/credential-providers/dist-cjs/index.web.js +7 -0
  226. package/node_modules/@aws-sdk/credential-providers/dist-es/fromCognitoIdentity.js +7 -0
  227. package/node_modules/@aws-sdk/credential-providers/dist-es/fromCognitoIdentityPool.js +7 -0
  228. package/node_modules/@aws-sdk/credential-providers/dist-es/fromContainerMetadata.js +2 -0
  229. package/node_modules/@aws-sdk/credential-providers/dist-es/fromEnv.js +2 -0
  230. package/node_modules/@aws-sdk/credential-providers/dist-es/fromIni.js +8 -0
  231. package/node_modules/@aws-sdk/credential-providers/dist-es/fromInstanceMetadata.js +2 -0
  232. package/node_modules/@aws-sdk/credential-providers/dist-es/fromNodeProviderChain.js +8 -0
  233. package/node_modules/@aws-sdk/credential-providers/dist-es/fromProcess.js +2 -0
  234. package/node_modules/@aws-sdk/credential-providers/dist-es/fromSSO.js +7 -0
  235. package/node_modules/@aws-sdk/credential-providers/dist-es/fromTemporaryCredentials.js +40 -0
  236. package/node_modules/@aws-sdk/credential-providers/dist-es/fromTokenFile.js +8 -0
  237. package/node_modules/@aws-sdk/credential-providers/dist-es/fromWebToken.js +7 -0
  238. package/node_modules/@aws-sdk/credential-providers/dist-es/index.js +12 -0
  239. package/node_modules/@aws-sdk/credential-providers/dist-es/index.web.js +4 -0
  240. package/node_modules/@aws-sdk/credential-providers/dist-types/fromCognitoIdentity.d.ts +45 -0
  241. package/node_modules/@aws-sdk/credential-providers/dist-types/fromCognitoIdentityPool.d.ts +46 -0
  242. package/node_modules/@aws-sdk/credential-providers/dist-types/fromContainerMetadata.d.ts +24 -0
  243. package/node_modules/@aws-sdk/credential-providers/dist-types/fromEnv.d.ts +26 -0
  244. package/node_modules/@aws-sdk/credential-providers/dist-types/fromIni.d.ts +43 -0
  245. package/node_modules/@aws-sdk/credential-providers/dist-types/fromInstanceMetadata.d.ts +22 -0
  246. package/node_modules/@aws-sdk/credential-providers/dist-types/fromNodeProviderChain.d.ts +29 -0
  247. package/node_modules/@aws-sdk/credential-providers/dist-types/fromProcess.d.ts +28 -0
  248. package/node_modules/@aws-sdk/credential-providers/dist-types/fromSSO.d.ts +48 -0
  249. package/node_modules/@aws-sdk/credential-providers/dist-types/fromTemporaryCredentials.d.ts +48 -0
  250. package/node_modules/@aws-sdk/credential-providers/dist-types/fromTokenFile.d.ts +32 -0
  251. package/node_modules/@aws-sdk/credential-providers/dist-types/fromWebToken.d.ts +41 -0
  252. package/node_modules/@aws-sdk/credential-providers/dist-types/index.d.ts +12 -0
  253. package/node_modules/@aws-sdk/credential-providers/dist-types/index.web.d.ts +4 -0
  254. package/node_modules/@aws-sdk/credential-providers/dist-types/ts3.4/fromCognitoIdentity.d.ts +9 -0
  255. package/node_modules/@aws-sdk/credential-providers/dist-types/ts3.4/fromCognitoIdentityPool.d.ts +7 -0
  256. package/node_modules/@aws-sdk/credential-providers/dist-types/ts3.4/fromContainerMetadata.d.ts +6 -0
  257. package/node_modules/@aws-sdk/credential-providers/dist-types/ts3.4/fromEnv.d.ts +3 -0
  258. package/node_modules/@aws-sdk/credential-providers/dist-types/ts3.4/fromIni.d.ts +8 -0
  259. package/node_modules/@aws-sdk/credential-providers/dist-types/ts3.4/fromInstanceMetadata.d.ts +4 -0
  260. package/node_modules/@aws-sdk/credential-providers/dist-types/ts3.4/fromNodeProviderChain.d.ts +8 -0
  261. package/node_modules/@aws-sdk/credential-providers/dist-types/ts3.4/fromProcess.d.ts +6 -0
  262. package/node_modules/@aws-sdk/credential-providers/dist-types/ts3.4/fromSSO.d.ts +8 -0
  263. package/node_modules/@aws-sdk/credential-providers/dist-types/ts3.4/fromTemporaryCredentials.d.ts +12 -0
  264. package/node_modules/@aws-sdk/credential-providers/dist-types/ts3.4/fromTokenFile.d.ts +8 -0
  265. package/node_modules/@aws-sdk/credential-providers/dist-types/ts3.4/fromWebToken.d.ts +8 -0
  266. package/node_modules/@aws-sdk/credential-providers/dist-types/ts3.4/index.d.ts +12 -0
  267. package/node_modules/@aws-sdk/credential-providers/dist-types/ts3.4/index.web.d.ts +4 -0
  268. package/node_modules/@aws-sdk/credential-providers/package.json +78 -0
  269. package/package.json +4 -2
@@ -0,0 +1,663 @@
1
+ # @aws-sdk/credential-providers
2
+
3
+ [![NPM version](https://img.shields.io/npm/v/@aws-sdk/credential-providers/latest.svg)](https://www.npmjs.com/package/@aws-sdk/credential-providers)
4
+ [![NPM downloads](https://img.shields.io/npm/dm/@aws-sdk/credential-providers.svg)](https://www.npmjs.com/package/@aws-sdk/credential-providers)
5
+
6
+ A collection of all credential providers, with default clients.
7
+
8
+ # Table of Contents
9
+
10
+ 1. [From Cognito Identity](#fromcognitoidentity)
11
+ 1. [From Cognito Identity Pool](#fromcognitoidentitypool)
12
+ 1. [From Temporary Credentials](#fromtemporarycredentials)
13
+ 1. [From Web Token](#fromwebtoken)
14
+ 1. [Examples](#examples)
15
+ 1. [From Token File](#fromtokenfile)
16
+ 1. [From Instance and Container Metadata Service](#fromcontainermetadata-and-frominstancemetadata)
17
+ 1. [From Shared INI files](#fromini)
18
+ 1. [Sample Files](#sample-files)
19
+ 1. [From Environmental Variables](#fromenv)
20
+ 1. [From Credential Process](#fromprocess)
21
+ 1. [Sample files](#sample-files-1)
22
+ 1. [From Single Sign-On Service](#fromsso)
23
+ 1. [Supported Configuration](#supported-configuration)
24
+ 1. [SSO login with AWS CLI](#sso-login-with-the-aws-cli)
25
+ 1. [Sample Files](#sample-files-2)
26
+ 1. [From Node.js default credentials provider chain](#fromNodeProviderChain)
27
+
28
+ ## `fromCognitoIdentity()`
29
+
30
+ The function `fromCognitoIdentity()` returns `CredentialsProvider` that retrieves credentials for
31
+ the provided identity ID. See [GetCredentialsForIdentity API][getcredentialsforidentity_api]
32
+ for more information.
33
+
34
+ ```javascript
35
+ import { fromCognitoIdentity } from "@aws-sdk/credential-providers"; // ES6 import
36
+ // const { fromCognitoIdentity } = require("@aws-sdk/credential-providers"); // CommonJS import
37
+
38
+ const client = new FooClient({
39
+ region,
40
+ credentials: fromCognitoIdentity({
41
+ // Required. The unique identifier for the identity against which credentials
42
+ // will be issued.
43
+ identityId: "us-east-1:128d0a74-c82f-4553-916d-90053example",
44
+ // Optional. The ARN of the role to be assumed when multiple roles were received in the token
45
+ // from the identity provider.
46
+ customRoleArn: "arn:aws:iam::1234567890:role/MYAPP-CognitoIdentity",
47
+ // Optional. A set of name-value pairs that map provider names to provider tokens.
48
+ // Required when using identities associated with external identity providers such as Facebook.
49
+ logins: {
50
+ "graph.facebook.com": "FBTOKEN",
51
+ "www.amazon.com": "AMAZONTOKEN",
52
+ "accounts.google.com": "GOOGLETOKEN",
53
+ "api.twitter.com": "TWITTERTOKEN'",
54
+ "www.digits.com": "DIGITSTOKEN",
55
+ },
56
+ // Optional. Custom client config if you need overwrite default Cognito Identity client
57
+ // configuration.
58
+ clientConfig: { region },
59
+ }),
60
+ });
61
+ ```
62
+
63
+ ## `fromCognitoIdentityPool()`
64
+
65
+ The function `fromCognitoIdentityPool()` returns `CredentialProvider` that calls [GetId API][getid_api]
66
+ to obtain an `identityId`, then generates temporary AWS credentials with
67
+ [GetCredentialsForIdentity API][getcredentialsforidentity_api], see
68
+ [`fromCognitoIdentity()`](#fromcognitoidentity).
69
+
70
+ Results from `GetId` are cached internally, but results from `GetCredentialsForIdentity` are not.
71
+
72
+ ```javascript
73
+ import { fromCognitoIdentityPool } from "@aws-sdk/credential-providers"; // ES6 import
74
+ // const { fromCognitoIdentityPool } = require("@aws-sdk/credential-providers"); // CommonJS import
75
+
76
+ const client = new FooClient({
77
+ region,
78
+ credentials: fromCognitoIdentityPool({
79
+ // Required. The unique identifier for the identity pool from which an identity should be
80
+ // retrieved or generated.
81
+ identityPoolId: "us-east-1:1699ebc0-7900-4099-b910-2df94f52a030",
82
+ // Optional. A standard AWS account ID (9+ digits)
83
+ accountId: "123456789",
84
+ // Optional. A cache in which to store resolved Cognito IdentityIds.
85
+ cache: custom_storage,
86
+ // Optional. A unique identifier for the user used to cache Cognito IdentityIds on a per-user
87
+ // basis.
88
+ userIdentifier: "user_0",
89
+ // Optional. The ARN of the role to be assumed when multiple roles were received in the token
90
+ // from the identity provider.
91
+ customRoleArn: "arn:aws:iam::1234567890:role/MYAPP-CognitoIdentity",
92
+ // Optional. A set of name-value pairs that map provider names to provider tokens.
93
+ // Required when using identities associated with external identity providers such as Facebook.
94
+ logins: {
95
+ "graph.facebook.com": "FBTOKEN",
96
+ "www.amazon.com": "AMAZONTOKEN",
97
+ "accounts.google.com": "GOOGLETOKEN",
98
+ "api.twitter.com": "TWITTERTOKEN",
99
+ "www.digits.com": "DIGITSTOKEN",
100
+ },
101
+ // Optional. Custom client config if you need overwrite default Cognito Identity client
102
+ // configuration.
103
+ clientConfig: { region },
104
+ }),
105
+ });
106
+ ```
107
+
108
+ ## `fromTemporaryCredentials()`
109
+
110
+ The function `fromTemporaryCredentials` returns `CredentialProvider` that retrieves temporary
111
+ credentials from [STS AssumeRole API][assumerole_api].
112
+
113
+ ```javascript
114
+ import { fromTemporaryCredentials } from "@aws-sdk/credential-providers"; // ES6 import
115
+ // const { fromTemporaryCredentials } = require("@aws-sdk/credential-providers"); // CommonJS import
116
+
117
+ const client = new FooClient({
118
+ region,
119
+ credentials: fromTemporaryCredentials({
120
+ // Optional. The master credentials used to get and refresh temporary credentials from AWS STS.
121
+ // If skipped, it uses the default credential resolved by internal STS client.
122
+ masterCredentials: fromTemporaryCredentials({
123
+ params: { RoleArn: "arn:aws:iam::1234567890:role/RoleA" },
124
+ }),
125
+ // Required. Options passed to STS AssumeRole operation.
126
+ params: {
127
+ // Required. ARN of role to assume.
128
+ RoleArn: "arn:aws:iam::1234567890:role/RoleB",
129
+ // Optional. An identifier for the assumed role session. If skipped, it generates a random
130
+ // session name with prefix of 'aws-sdk-js-'.
131
+ RoleSessionName: "aws-sdk-js-123",
132
+ // Optional. The duration, in seconds, of the role session.
133
+ DurationSeconds: 3600,
134
+ // ... For more options see https://docs.aws.amazon.com/STS/latest/APIReference/API_AssumeRole.html
135
+ },
136
+ // Optional. Custom STS client configurations overriding the default ones.
137
+ clientConfig: { region },
138
+ // Optional. A function that returns a promise fulfilled with an MFA token code for the provided
139
+ // MFA Serial code. Required if `params` has `SerialNumber` config.
140
+ mfaCodeProvider: async (mfaSerial) => {
141
+ return "token";
142
+ },
143
+ }),
144
+ });
145
+ ```
146
+
147
+ ## `fromWebToken()`
148
+
149
+ The function `fromWebToken` returns `CredentialProvider` that gets credentials calling
150
+ [STS AssumeRoleWithWebIdentity API][assumerolewithwebidentity_api]
151
+
152
+ ```javascript
153
+ import { fromWebToken } from "@aws-sdk/credential-providers"; // ES6 import
154
+ // const { fromWebToken } = require("@aws-sdk/credential-providers"); // CommonJS import
155
+
156
+ const client = new FooClient({
157
+ region,
158
+ credentials: fromWebToken({
159
+ // Required. ARN of the role that the caller is assuming.
160
+ roleArn: "arn:aws:iam::1234567890:role/RoleA",
161
+ // Required. The OAuth 2.0 access token or OpenID Connect ID token that is provided by the
162
+ // identity provider.
163
+ webIdentityToken: await openIdProvider(),
164
+ // Optional. Custom STS client configurations overriding the default ones.
165
+ clientConfig: { region },
166
+ // Optional. A function that assumes a role with web identity and returns a promise fulfilled
167
+ // with credentials for the assumed role.
168
+ roleAssumerWithWebIdentity,
169
+ // Optional. An identifier for the assumed role session.
170
+ roleSessionName: "session_123",
171
+ // Optional. The fully qualified host component of the domain name of the identity provider.
172
+ providerId: "graph.facebook.com",
173
+ // Optional. ARNs of the IAM managed policies that you want to use as managed session.
174
+ policyArns: [{ arn: "arn:aws:iam::1234567890:policy/SomePolicy" }],
175
+ // Optional. An IAM policy in JSON format that you want to use as an inline session policy.
176
+ policy: "JSON_STRING",
177
+ // Optional. The duration, in seconds, of the role session. Default to 3600.
178
+ durationSeconds: 7200,
179
+ }),
180
+ });
181
+ ```
182
+
183
+ ### Examples
184
+
185
+ You can directly configure individual identity providers to access AWS resources using web identity
186
+ federation. AWS currently supports authenticating users using web identity federation through
187
+ several identity providers:
188
+
189
+ - [Login with Amazon](https://login.amazon.com/)
190
+
191
+ - [Facebook Login](https://developers.facebook.com/docs/facebook-login/web/)
192
+
193
+ - [Google Sign-in](https://developers.google.com/identity/)
194
+
195
+ You must first register your application with the providers that your application supports. Next,
196
+ create an IAM role and set up permissions for it. The IAM role you create is then used to grant the
197
+ permissions you configured for it through the respective identity provider. For example, you can set
198
+ up a role that allows users who logged in through Facebook to have read access to a specific Amazon
199
+ S3 bucket you control.
200
+
201
+ After you have both an IAM role with configured privileges and an application registered with your
202
+ chosen identity providers, you can set up the SDK to get credentials for the IAM role using helper
203
+ code, as follows:
204
+
205
+ The value in the ProviderId parameter depends on the specified identity provider. The value in the
206
+ WebIdentityToken parameter is the access token retrieved from a successful login with the identity
207
+ provider. For more information on how to configure and retrieve access tokens for each identity
208
+ provider, see the documentation for the identity provider.
209
+
210
+ ## `fromContainerMetadata()` and `fromInstanceMetadata()`
211
+
212
+ `fromContainerMetadata` and `fromInstanceMetadata` will create `CredentialProvider` functions that
213
+ read from the ECS container metadata service and the EC2 instance metadata service, respectively.
214
+
215
+ ```javascript
216
+ import { fromInstanceMetadata } from "@aws-sdk/credential-providers"; // ES6 import
217
+ // const { fromInstanceMetadata } = require("@aws-sdk/credential-providers"); // CommonJS import
218
+
219
+ const client = new FooClient({
220
+ credentials: fromInstanceMetadata({
221
+ // Optional. The connection timeout (in milliseconds) to apply to any remote requests.
222
+ // If not specified, a default value of `1000` (one second) is used.
223
+ timeout: 1000,
224
+ // Optional. The maximum number of times any HTTP connections should be retried. If not
225
+ // specified, a default value of `0` will be used.
226
+ maxRetries: 0,
227
+ }),
228
+ });
229
+ ```
230
+
231
+ ```javascript
232
+ import { fromContainerMetadata } from "@aws-sdk/credential-providers"; // ES6 import
233
+ // const { fromContainerMetadata } = require("@aws-sdk/credential-providers"); // CommonJS import
234
+
235
+ const client = new FooClient({
236
+ credentials: fromContainerMetadata({
237
+ // Optional. The connection timeout (in milliseconds) to apply to any remote requests.
238
+ // If not specified, a default value of `1000` (one second) is used.
239
+ timeout: 1000,
240
+ // Optional. The maximum number of times any HTTP connections should be retried. If not
241
+ // specified, a default value of `0` will be used.
242
+ maxRetries: 0,
243
+ }),
244
+ });
245
+ ```
246
+
247
+ A `CredentialProvider` function created with `fromContainerMetadata` will return a promise that will
248
+ resolve with credentials for the IAM role associated with containers in an Amazon ECS task. Please
249
+ see [IAM Roles for Tasks][iam_roles_for_tasks] for more information on using IAM roles with Amazon
250
+ ECS.
251
+
252
+ A `CredentialProvider` function created with `fromInstanceMetadata` will return a promise that will
253
+ resolve with credentials for the IAM role associated with an EC2 instance.
254
+ Please see [IAM Roles for Amazon EC2][iam_roles_for_ec2] for more information on using IAM roles
255
+ with Amazon EC2. Both IMDSv1 (a request/response method) and IMDSv2 (a session-oriented method) are
256
+ supported.
257
+
258
+ Please see [Configure the instance metadata service][config_instance_metadata] for more information.
259
+
260
+ ## `fromIni()`
261
+
262
+ `fromIni` creates `CredentialProvider` functions that read from a shared credentials file at
263
+ `~/.aws/credentials` and a shared configuration file at `~/.aws/config`. Both files are expected to
264
+ be INI formatted with section names corresponding to profiles. Sections in the credentials file are
265
+ treated as profile names, whereas profile sections in the config file must have the format of
266
+ `[profile profile-name]`, except for the default profile. Please see the
267
+ [sample files](#sample-files) below for examples of well-formed configuration and credentials files.
268
+
269
+ Profiles that appear in both files will not be merged, and the version that appears in the
270
+ credentials file will be given precedence over the profile found in the config file.
271
+
272
+ ```javascript
273
+ import { fromIni } from "@aws-sdk/credential-providers"; // ES6 import
274
+ // const { fromIni } = require("@aws-sdk/credential-providers"); // CommonJS import
275
+
276
+ const client = new FooClient({
277
+ credentials: fromIni({
278
+ // Optional. The configuration profile to use. If not specified, the provider will use the value
279
+ // in the `AWS_PROFILE` environment variable or a default of `default`.
280
+ profile: "profile",
281
+ // Optional. The path to the shared credentials file. If not specified, the provider will use
282
+ // the value in the `AWS_SHARED_CREDENTIALS_FILE` environment variable or a default of
283
+ // `~/.aws/credentials`.
284
+ filepath: "~/.aws/credentials",
285
+ // Optional. The path to the shared config file. If not specified, the provider will use the
286
+ // value in the `AWS_CONFIG_FILE` environment variable or a default of `~/.aws/config`.
287
+ configFilepath: "~/.aws/config",
288
+ // Optional. A function that returns a a promise fulfilled with an MFA token code for the
289
+ // provided MFA Serial code. If a profile requires an MFA code and `mfaCodeProvider` is not a
290
+ // valid function, the credential provider promise will be rejected.
291
+ mfaCodeProvider: async (mfaSerial) => {
292
+ return "token";
293
+ },
294
+ // Optional. Custom STS client configurations overriding the default ones.
295
+ clientConfig: { region },
296
+ }),
297
+ });
298
+ ```
299
+
300
+ ### Sample files
301
+
302
+ #### `~/.aws/credentials`
303
+
304
+ ```ini
305
+ [default]
306
+ aws_access_key_id=foo
307
+ aws_secret_access_key=bar
308
+
309
+ [dev]
310
+ aws_access_key_id=foo2
311
+ aws_secret_access_key=bar2
312
+ ```
313
+
314
+ #### `~/.aws/config`
315
+
316
+ ```ini
317
+ [default]
318
+ aws_access_key_id=foo
319
+ aws_secret_access_key=bar
320
+
321
+ [profile dev]
322
+ aws_access_key_id=foo2
323
+ aws_secret_access_key=bar2
324
+ ```
325
+
326
+ #### profile with source profile
327
+
328
+ ```ini
329
+ [second]
330
+ aws_access_key_id=foo
331
+ aws_secret_access_key=bar
332
+
333
+ [first]
334
+ source_profile=second
335
+ role_arn=arn:aws:iam::123456789012:role/example-role-arn
336
+ ```
337
+
338
+ #### profile with source provider
339
+
340
+ You can supply `credential_source` options to tell the SDK where to source credentials for the call
341
+ to `AssumeRole`. The supported credential providers are listed below:
342
+
343
+ ```ini
344
+ [default]
345
+ role_arn=arn:aws:iam::123456789012:role/example-role-arn
346
+ credential_source = Ec2InstanceMetadata
347
+ ```
348
+
349
+ ```ini
350
+ [default]
351
+ role_arn=arn:aws:iam::123456789012:role/example-role-arn
352
+ credential_source = Environment
353
+ ```
354
+
355
+ ```ini
356
+ [default]
357
+ role_arn=arn:aws:iam::123456789012:role/example-role-arn
358
+ credential_source = EcsContainer
359
+ ```
360
+
361
+ #### profile with web_identity_token_file
362
+
363
+ ```ini
364
+ [default]
365
+ web_identity_token_file=/temp/token
366
+ role_arn=arn:aws:iam::123456789012:role/example-role-arn
367
+ ```
368
+
369
+ You can specify another profile(`second`) whose credentials are used to assume the role by the
370
+ `role_arn` setting in this profile(`first`).
371
+
372
+ ```ini
373
+ [second]
374
+ web_identity_token_file=/temp/token
375
+ role_arn=arn:aws:iam::123456789012:role/example-role-2
376
+
377
+ [first]
378
+ source_profile=second
379
+ role_arn=arn:aws:iam::123456789012:role/example-role
380
+ ```
381
+
382
+ #### profile with sso credentials
383
+
384
+ See [`fromSSO()`](#fromsso) fro more information
385
+
386
+ ## `fromEnv()`
387
+
388
+ ```javascript
389
+ import { fromEnv } from "@aws-sdk/credential-providers"; // ES6 import
390
+ // const { fromEnv } = require("@aws-sdk/credential-providers"); // CommonJS import
391
+
392
+ const client = new FooClient({
393
+ credentials: fromEnv(),
394
+ });
395
+ ```
396
+
397
+ `fromEnv` returns a `CredentialProvider` function, that reads credentials from the following
398
+ environment variables:
399
+
400
+ - `AWS_ACCESS_KEY_ID` - The access key for your AWS account.
401
+ - `AWS_SECRET_ACCESS_KEY` - The secret key for your AWS account.
402
+ - `AWS_SESSION_TOKEN` - The session key for your AWS account. This is only needed when you are using
403
+ temporarycredentials.
404
+ - `AWS_CREDENTIAL_EXPIRATION` - The expiration time of the credentials contained in the environment
405
+ variables described above. This value must be in a format compatible with the
406
+ [ISO-8601 standard][iso8601_standard] and is only needed when you are using temporary credentials.
407
+
408
+ If either the `AWS_ACCESS_KEY_ID` or `AWS_SECRET_ACCESS_KEY` environment variable is not set or
409
+ contains a falsy value, the promise returned by the `fromEnv` function will be rejected.
410
+
411
+ ## `fromProcess()`
412
+
413
+ ```javascript
414
+ import { fromProcess } from "@aws-sdk/credential-providers"; // ES6 import
415
+ // const { fromProcess } = require("@aws-sdk/credential-providers"); // CommonJS import
416
+
417
+ const client = new FooClient({
418
+ credentials: fromProcess({
419
+ // Optional. The configuration profile to use. If not specified, the provider will use the value
420
+ // in the `AWS_PROFILE` environment variable or a default of `default`.
421
+ profile: "profile",
422
+ // Optional. The path to the shared credentials file. If not specified, the provider will use
423
+ // the value in the `AWS_SHARED_CREDENTIALS_FILE` environment variable or a default of
424
+ // `~/.aws/credentials`.
425
+ filepath: "~/.aws/credentials",
426
+ // Optional. The path to the shared config file. If not specified, the provider will use the
427
+ // value in the `AWS_CONFIG_FILE` environment variable or a default of `~/.aws/config`.
428
+ configFilepath: "~/.aws/config",
429
+ }),
430
+ });
431
+ ```
432
+
433
+ `fromSharedConfigFiles` creates a `CredentialProvider` functions that executes a given process and
434
+ attempt to read its standard output to receive a JSON payload containing the credentials. The
435
+ process command is read from a shared credentials file at `~/.aws/credentials` and a shared
436
+ configuration file at `~/.aws/config`. Both files are expected to be INI formatted with section
437
+ names corresponding to profiles. Sections in the credentials file are treated as profile names,
438
+ whereas profile sections in the config file must have the format of`[profile profile-name]`, except
439
+ for the default profile. Please see the [sample files](#sample-files-1) below for examples of
440
+ well-formed configuration and credentials files.
441
+
442
+ Profiles that appear in both files will not be merged, and the version that appears in the
443
+ credentials file will be given precedence over the profile found in the config file.
444
+
445
+ ### Sample files
446
+
447
+ #### `~/.aws/credentials`
448
+
449
+ ```ini
450
+ [default]
451
+ credential_process = /usr/local/bin/awscreds
452
+
453
+ [dev]
454
+ credential_process = /usr/local/bin/awscreds dev
455
+ ```
456
+
457
+ #### `~/.aws/config`
458
+
459
+ ```ini
460
+ [default]
461
+ credential_process = /usr/local/bin/awscreds
462
+
463
+ [profile dev]
464
+ credential_process = /usr/local/bin/awscreds dev
465
+ ```
466
+
467
+ ## `fromTokenFile()`
468
+
469
+ The function `fromTokenFile` returns `CredentialProvider` that reads credentials as follows:
470
+
471
+ - Reads file location of where the OIDC token is stored from either provided option
472
+ `webIdentityTokenFile` or environment variable `AWS_WEB_IDENTITY_TOKEN_FILE`.
473
+ - Reads IAM role wanting to be assumed from either provided option `roleArn` or environment
474
+ variable `AWS_ROLE_ARN`.
475
+ - Reads optional role session name to be used to distinguish sessions from provided option
476
+ `roleSessionName` or environment variable `AWS_ROLE_SESSION_NAME`. If session name is not defined,
477
+ it comes up with a role session name.
478
+ - Reads OIDC token from file on disk.
479
+ - Calls sts:AssumeRoleWithWebIdentity via `roleAssumerWithWebIdentity` option to get credentials.
480
+
481
+ | **Configuration Key** | **Environment Variable** | **Required** | **Description** |
482
+ | --------------------- | --------------------------- | ------------ | ------------------------------------------------- |
483
+ | webIdentityTokenFile | AWS_WEB_IDENTITY_TOKEN_FILE | true | File location of where the `OIDC` token is stored |
484
+ | roleArn | AWS_IAM_ROLE_ARN | true | The IAM role wanting to be assumed |
485
+ | roleSessionName | AWS_IAM_ROLE_SESSION_NAME | false | The IAM session name used to distinguish sessions |
486
+
487
+ ```javascript
488
+ import { fromTokenFile } from "@aws-sdk/credential-providers"; // ES6 import
489
+ // const { fromTokenFile } = require("@aws-sdk/credential-providers"); // CommonJS import
490
+
491
+ const client = new FooClient({
492
+ credentials: fromTokenFile({
493
+ // Optional. STS client config to make the assume role request.
494
+ clientConfig: { region }
495
+ });
496
+ });
497
+ ```
498
+
499
+ ## `fromSSO()`
500
+
501
+ > This credential provider **ONLY** supports profiles using the SSO credential. If you have a
502
+ > profile that assumes a role which derived from the SSO credential, you should use the
503
+ > [`fromIni()`](#fromini), or `@aws-sdk/credential-provider-node` package.
504
+
505
+ `fromSSO`, that creates `CredentialProvider` functions that read from the _resolved_ access token
506
+ from local disk then requests temporary AWS credentials. For guidance on the AWS Single Sign-On
507
+ service, please refer to [AWS's Single Sign-On documentation][sso_api].
508
+
509
+ You can create the `CredentialProvider` functions using the inline SSO parameters(`ssoStartUrl`,
510
+ `ssoAccountId`, `ssoRegion`, `ssoRoleName`) or load them from
511
+ [AWS SDKs and Tools shared configuration and credentials files][shared_config_files].
512
+ Profiles in the `credentials` file are given precedence over profiles in the `config` file.
513
+
514
+ This credential provider is intended for use with the AWS SDK for Node.js.
515
+
516
+ ### Supported configuration
517
+
518
+ You may customize how credentials are resolved by providing an options hash to the `fromSSO` factory
519
+ function. You can either load the SSO config from shared INI credential files, or specify the
520
+ `ssoStartUrl`, `ssoAccountId`, `ssoRegion`, and `ssoRoleName` directly from the code.
521
+
522
+ ```javascript
523
+ import { fromSSO } from "@aws-sdk/credential-providers"; // ES6 import
524
+ // const { fromSSO } = require(@aws-sdk/credential-providers") // CommonJS import
525
+
526
+ const client = new FooClient({
527
+ credentials: fromSSO({
528
+ // Optional. The configuration profile to use. If not specified, the provider will use the value
529
+ // in the `AWS_PROFILE` environment variable or `default` by default.
530
+ profile: "my-sso-profile",
531
+ // Optional. The path to the shared credentials file. If not specified, the provider will use
532
+ // the value in the `AWS_SHARED_CREDENTIALS_FILE` environment variable or a default of
533
+ // `~/.aws/credentials`.
534
+ filepath: "~/.aws/credentials",
535
+ // Optional. The path to the shared config file. If not specified, the provider will use the
536
+ // value in the `AWS_CONFIG_FILE` environment variable or a default of `~/.aws/config`.
537
+ configFilepath: "~/.aws/config",
538
+ // Optional. The URL to the AWS SSO service. Required if any of the `sso*` options(except for
539
+ // `ssoClient`) is provided.
540
+ ssoStartUrl: "https://d-abc123.awsapps.com/start",
541
+ // Optional. The ID of the AWS account to use for temporary credentials. Required if any of the
542
+ // `sso*` options(except for `ssoClient`) is provided.
543
+ ssoAccountId: "1234567890",
544
+ // Optional. The AWS region to use for temporary credentials. Required if any of the `sso*`
545
+ // options(except for `ssoClient`) is provided.
546
+ ssoRegion: "us-east-1",
547
+ // Optional. The name of the AWS role to assume. Required if any of the `sso*` options(except
548
+ // for `ssoClient`) is provided.
549
+ ssoRoleName: "SampleRole",
550
+ // Optional. Overwrite the configuration used construct the SSO service client. If not
551
+ // specified, a default SSO client will be created with the region specified in the profile
552
+ // `sso_region` entry.
553
+ clientConfig: { region },
554
+ }),
555
+ });
556
+ ```
557
+
558
+ ### SSO Login with the AWS CLI
559
+
560
+ This credential provider relies on the [AWS CLI][cli_sso] to log into an AWS SSO session. Here's a
561
+ brief walk-through:
562
+
563
+ 1. Create a new AWS SSO enabled profile using the AWS CLI. It will ask you to login to your AWS SSO
564
+ account and prompt for the name of the profile:
565
+
566
+ ```console
567
+ $ aws configure sso
568
+ ...
569
+ ...
570
+ CLI profile name [123456789011_ReadOnly]: my-sso-profile<ENTER>
571
+ ```
572
+
573
+ 2. Configure your SDK client with the SSO credential provider:
574
+
575
+ ```javascript
576
+ //...
577
+ const client = new FooClient({ credentials: fromSSO({ profile: "my-sso-profile" });
578
+ ```
579
+
580
+ Alternatively, the SSO credential provider is supported in shared INI credentials provider
581
+
582
+ ```javascript
583
+ //...
584
+ const client = new FooClient({ credentials: fromIni({ profile: "my-sso-profile" });
585
+ ```
586
+
587
+ 3. To log out from the current SSO session, use the AWS CLI:
588
+
589
+ ```console
590
+ $ aws sso logout
591
+ Successfully signed out of all SSO profiles.
592
+ ```
593
+
594
+ ### Sample files
595
+
596
+ This credential provider is only applicable if the profile specified in shared configuration and
597
+ credentials files contain ALL of the following entries.
598
+
599
+ #### `~/.aws/credentials`
600
+
601
+ ```ini
602
+ [sample-profile]
603
+ sso_account_id = 012345678901
604
+ sso_region = us-east-1
605
+ sso_role_name = SampleRole
606
+ sso_start_url = https://d-abc123.awsapps.com/start
607
+ ```
608
+
609
+ #### `~/.aws/config`
610
+
611
+ ```ini
612
+ [profile sample-profile]
613
+ sso_account_id = 012345678901
614
+ sso_region = us-east-1
615
+ sso_role_name = SampleRole
616
+ sso_start_url = https://d-abc123.awsapps.com/start
617
+ ```
618
+
619
+ ## `fromNodeProviderChain()`
620
+
621
+ The credential provider used as default in the Node.js clients, but with default role assumers so
622
+ you don't need to import them from STS client and supply them manually. You normally don't need
623
+ to use this explicitly in the client constructor. It is useful for utility functions requiring
624
+ credentials like S3 presigner, or RDS signer.
625
+
626
+ This credential provider will attempt to find credentials from the following sources (listed in
627
+ order of precedence):
628
+
629
+ - [Environment variables exposed via `process.env`](#fromenv)
630
+ - [SSO credentials from token cache](#fromsso)
631
+ - [Web identity token credentials](#fromtokenfile)
632
+ - [Shared credentials and config ini files](#fromini)
633
+ - [The EC2/ECS Instance Metadata Service](#fromcontainermetadata-and-frominstancemetadata)
634
+
635
+ This credential provider will invoke one provider at a time and only
636
+ continue to the next if no credentials have been located. For example, if
637
+ the process finds values defined via the `AWS_ACCESS_KEY_ID` and
638
+ `AWS_SECRET_ACCESS_KEY` environment variables, the files at
639
+ `~/.aws/credentials` and `~/.aws/config` will not be read, nor will any
640
+ messages be sent to the Instance Metadata Service
641
+
642
+ ```js
643
+ import { fromNodeProviderChain } from "@aws-sdk/credential-providers"; // ES6 import
644
+ // const { fromNodeProviderChain } = require("@aws-sdk/credential-providers") // CommonJS import
645
+ const credentialProvider = fromNodeProviderChain({
646
+ //...any input of fromEnv(), fromSSO(), fromTokenFile(), fromIni(),
647
+ // fromProcess(), fromInstanceMetadata(), fromContainerMetadata()
648
+ // Optional. Custom STS client configurations overriding the default ones.
649
+ clientConfig: { region },
650
+ });
651
+ ```
652
+
653
+ [getcredentialsforidentity_api]: https://docs.aws.amazon.com/cognitoidentity/latest/APIReference/API_GetCredentialsForIdentity.html
654
+ [getid_api]: https://docs.aws.amazon.com/cognitoidentity/latest/APIReference/API_GetId.html
655
+ [assumerole_api]: https://docs.aws.amazon.com/STS/latest/APIReference/API_AssumeRole.html
656
+ [assumerolewithwebidentity_api]: https://docs.aws.amazon.com/STS/latest/APIReference/API_AssumeRoleWithWebIdentity.html
657
+ [iam_roles_for_tasks]: http://docs.aws.amazon.com/AmazonECS/latest/developerguide/task-iam-roles.html
658
+ [iam_roles_for_ec2]: http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/iam-roles-for-amazon-ec2.html
659
+ [config_instance_metadata]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/configuring-instance-metadata-service.html
660
+ [iso8601_standard]: https://en.wikipedia.org/wiki/ISO_8601
661
+ [sso_api]: https://aws.amazon.com/single-sign-on/
662
+ [shared_config_files]: https://docs.aws.amazon.com/credref/latest/refdocs/creds-config-files.html
663
+ [cli_sso]: https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-sso.html#sso-configure-profile
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.fromCognitoIdentity = void 0;
4
+ const client_cognito_identity_1 = require("@aws-sdk/client-cognito-identity");
5
+ const credential_provider_cognito_identity_1 = require("@aws-sdk/credential-provider-cognito-identity");
6
+ const fromCognitoIdentity = (options) => {
7
+ var _a;
8
+ return (0, credential_provider_cognito_identity_1.fromCognitoIdentity)({
9
+ ...options,
10
+ client: new client_cognito_identity_1.CognitoIdentityClient((_a = options.clientConfig) !== null && _a !== void 0 ? _a : {}),
11
+ });
12
+ };
13
+ exports.fromCognitoIdentity = fromCognitoIdentity;
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.fromCognitoIdentityPool = void 0;
4
+ const client_cognito_identity_1 = require("@aws-sdk/client-cognito-identity");
5
+ const credential_provider_cognito_identity_1 = require("@aws-sdk/credential-provider-cognito-identity");
6
+ const fromCognitoIdentityPool = (options) => {
7
+ var _a;
8
+ return (0, credential_provider_cognito_identity_1.fromCognitoIdentityPool)({
9
+ ...options,
10
+ client: new client_cognito_identity_1.CognitoIdentityClient((_a = options.clientConfig) !== null && _a !== void 0 ? _a : {}),
11
+ });
12
+ };
13
+ exports.fromCognitoIdentityPool = fromCognitoIdentityPool;