@azure/identity-cache-persistence 1.1.2-alpha.20241112.1 → 1.1.2-alpha.20241114.2

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 (151) hide show
  1. package/dist/index.js.map +1 -1
  2. package/dist-esm/src/index.js.map +1 -0
  3. package/dist-esm/src/platforms.js.map +1 -0
  4. package/dist-esm/src/provider.js.map +1 -0
  5. package/package.json +3 -4
  6. package/dist-esm/identity/src/client/identityClient.js +0 -257
  7. package/dist-esm/identity/src/client/identityClient.js.map +0 -1
  8. package/dist-esm/identity/src/constants.js +0 -70
  9. package/dist-esm/identity/src/constants.js.map +0 -1
  10. package/dist-esm/identity/src/credentials/authorityValidationOptions.js +0 -4
  11. package/dist-esm/identity/src/credentials/authorityValidationOptions.js.map +0 -1
  12. package/dist-esm/identity/src/credentials/authorizationCodeCredential.js +0 -63
  13. package/dist-esm/identity/src/credentials/authorizationCodeCredential.js.map +0 -1
  14. package/dist-esm/identity/src/credentials/authorizationCodeCredentialOptions.js +0 -4
  15. package/dist-esm/identity/src/credentials/authorizationCodeCredentialOptions.js.map +0 -1
  16. package/dist-esm/identity/src/credentials/azureCliCredential.js +0 -194
  17. package/dist-esm/identity/src/credentials/azureCliCredential.js.map +0 -1
  18. package/dist-esm/identity/src/credentials/azureCliCredentialOptions.js +0 -4
  19. package/dist-esm/identity/src/credentials/azureCliCredentialOptions.js.map +0 -1
  20. package/dist-esm/identity/src/credentials/azureDeveloperCliCredential.js +0 -176
  21. package/dist-esm/identity/src/credentials/azureDeveloperCliCredential.js.map +0 -1
  22. package/dist-esm/identity/src/credentials/azureDeveloperCliCredentialOptions.js +0 -4
  23. package/dist-esm/identity/src/credentials/azureDeveloperCliCredentialOptions.js.map +0 -1
  24. package/dist-esm/identity/src/credentials/azurePipelinesCredential.js +0 -146
  25. package/dist-esm/identity/src/credentials/azurePipelinesCredential.js.map +0 -1
  26. package/dist-esm/identity/src/credentials/azurePipelinesCredentialOptions.js +0 -4
  27. package/dist-esm/identity/src/credentials/azurePipelinesCredentialOptions.js.map +0 -1
  28. package/dist-esm/identity/src/credentials/azurePowerShellCredential.js +0 -238
  29. package/dist-esm/identity/src/credentials/azurePowerShellCredential.js.map +0 -1
  30. package/dist-esm/identity/src/credentials/azurePowerShellCredentialOptions.js +0 -4
  31. package/dist-esm/identity/src/credentials/azurePowerShellCredentialOptions.js.map +0 -1
  32. package/dist-esm/identity/src/credentials/brokerAuthOptions.js +0 -2
  33. package/dist-esm/identity/src/credentials/brokerAuthOptions.js.map +0 -1
  34. package/dist-esm/identity/src/credentials/browserCustomizationOptions.js +0 -4
  35. package/dist-esm/identity/src/credentials/browserCustomizationOptions.js.map +0 -1
  36. package/dist-esm/identity/src/credentials/chainedTokenCredential.js +0 -95
  37. package/dist-esm/identity/src/credentials/chainedTokenCredential.js.map +0 -1
  38. package/dist-esm/identity/src/credentials/clientAssertionCredential.js +0 -58
  39. package/dist-esm/identity/src/credentials/clientAssertionCredential.js.map +0 -1
  40. package/dist-esm/identity/src/credentials/clientAssertionCredentialOptions.js +0 -4
  41. package/dist-esm/identity/src/credentials/clientAssertionCredentialOptions.js.map +0 -1
  42. package/dist-esm/identity/src/credentials/clientCertificateCredential.js +0 -126
  43. package/dist-esm/identity/src/credentials/clientCertificateCredential.js.map +0 -1
  44. package/dist-esm/identity/src/credentials/clientCertificateCredentialOptions.js +0 -4
  45. package/dist-esm/identity/src/credentials/clientCertificateCredentialOptions.js.map +0 -1
  46. package/dist-esm/identity/src/credentials/clientSecretCredential.js +0 -63
  47. package/dist-esm/identity/src/credentials/clientSecretCredential.js.map +0 -1
  48. package/dist-esm/identity/src/credentials/clientSecretCredentialOptions.js +0 -4
  49. package/dist-esm/identity/src/credentials/clientSecretCredentialOptions.js.map +0 -1
  50. package/dist-esm/identity/src/credentials/credentialPersistenceOptions.js +0 -4
  51. package/dist-esm/identity/src/credentials/credentialPersistenceOptions.js.map +0 -1
  52. package/dist-esm/identity/src/credentials/defaultAzureCredential.js +0 -164
  53. package/dist-esm/identity/src/credentials/defaultAzureCredential.js.map +0 -1
  54. package/dist-esm/identity/src/credentials/defaultAzureCredentialOptions.js +0 -4
  55. package/dist-esm/identity/src/credentials/defaultAzureCredentialOptions.js.map +0 -1
  56. package/dist-esm/identity/src/credentials/deviceCodeCredential.js +0 -96
  57. package/dist-esm/identity/src/credentials/deviceCodeCredential.js.map +0 -1
  58. package/dist-esm/identity/src/credentials/deviceCodeCredentialOptions.js +0 -4
  59. package/dist-esm/identity/src/credentials/deviceCodeCredentialOptions.js.map +0 -1
  60. package/dist-esm/identity/src/credentials/environmentCredential.js +0 -133
  61. package/dist-esm/identity/src/credentials/environmentCredential.js.map +0 -1
  62. package/dist-esm/identity/src/credentials/environmentCredentialOptions.js +0 -4
  63. package/dist-esm/identity/src/credentials/environmentCredentialOptions.js.map +0 -1
  64. package/dist-esm/identity/src/credentials/interactiveBrowserCredential.js +0 -96
  65. package/dist-esm/identity/src/credentials/interactiveBrowserCredential.js.map +0 -1
  66. package/dist-esm/identity/src/credentials/interactiveBrowserCredentialOptions.js +0 -4
  67. package/dist-esm/identity/src/credentials/interactiveBrowserCredentialOptions.js.map +0 -1
  68. package/dist-esm/identity/src/credentials/interactiveCredentialOptions.js +0 -4
  69. package/dist-esm/identity/src/credentials/interactiveCredentialOptions.js.map +0 -1
  70. package/dist-esm/identity/src/credentials/managedIdentityCredential/imdsMsi.js +0 -125
  71. package/dist-esm/identity/src/credentials/managedIdentityCredential/imdsMsi.js.map +0 -1
  72. package/dist-esm/identity/src/credentials/managedIdentityCredential/imdsRetryPolicy.js +0 -33
  73. package/dist-esm/identity/src/credentials/managedIdentityCredential/imdsRetryPolicy.js.map +0 -1
  74. package/dist-esm/identity/src/credentials/managedIdentityCredential/index.js +0 -220
  75. package/dist-esm/identity/src/credentials/managedIdentityCredential/index.js.map +0 -1
  76. package/dist-esm/identity/src/credentials/managedIdentityCredential/models.js +0 -4
  77. package/dist-esm/identity/src/credentials/managedIdentityCredential/models.js.map +0 -1
  78. package/dist-esm/identity/src/credentials/managedIdentityCredential/tokenExchangeMsi.js +0 -37
  79. package/dist-esm/identity/src/credentials/managedIdentityCredential/tokenExchangeMsi.js.map +0 -1
  80. package/dist-esm/identity/src/credentials/managedIdentityCredential/utils.js +0 -77
  81. package/dist-esm/identity/src/credentials/managedIdentityCredential/utils.js.map +0 -1
  82. package/dist-esm/identity/src/credentials/multiTenantTokenCredentialOptions.js +0 -4
  83. package/dist-esm/identity/src/credentials/multiTenantTokenCredentialOptions.js.map +0 -1
  84. package/dist-esm/identity/src/credentials/onBehalfOfCredential.js +0 -119
  85. package/dist-esm/identity/src/credentials/onBehalfOfCredential.js.map +0 -1
  86. package/dist-esm/identity/src/credentials/onBehalfOfCredentialOptions.js +0 -4
  87. package/dist-esm/identity/src/credentials/onBehalfOfCredentialOptions.js.map +0 -1
  88. package/dist-esm/identity/src/credentials/usernamePasswordCredential.js +0 -70
  89. package/dist-esm/identity/src/credentials/usernamePasswordCredential.js.map +0 -1
  90. package/dist-esm/identity/src/credentials/usernamePasswordCredentialOptions.js +0 -4
  91. package/dist-esm/identity/src/credentials/usernamePasswordCredentialOptions.js.map +0 -1
  92. package/dist-esm/identity/src/credentials/visualStudioCodeCredential.js +0 -195
  93. package/dist-esm/identity/src/credentials/visualStudioCodeCredential.js.map +0 -1
  94. package/dist-esm/identity/src/credentials/visualStudioCodeCredentialOptions.js +0 -4
  95. package/dist-esm/identity/src/credentials/visualStudioCodeCredentialOptions.js.map +0 -1
  96. package/dist-esm/identity/src/credentials/visualStudioCodeCredentialPlugin.js +0 -4
  97. package/dist-esm/identity/src/credentials/visualStudioCodeCredentialPlugin.js.map +0 -1
  98. package/dist-esm/identity/src/credentials/workloadIdentityCredential.js +0 -119
  99. package/dist-esm/identity/src/credentials/workloadIdentityCredential.js.map +0 -1
  100. package/dist-esm/identity/src/credentials/workloadIdentityCredentialOptions.js +0 -4
  101. package/dist-esm/identity/src/credentials/workloadIdentityCredentialOptions.js.map +0 -1
  102. package/dist-esm/identity/src/errors.js +0 -123
  103. package/dist-esm/identity/src/errors.js.map +0 -1
  104. package/dist-esm/identity/src/index.js +0 -34
  105. package/dist-esm/identity/src/index.js.map +0 -1
  106. package/dist-esm/identity/src/msal/msal.js +0 -5
  107. package/dist-esm/identity/src/msal/msal.js.map +0 -1
  108. package/dist-esm/identity/src/msal/nodeFlows/brokerOptions.js +0 -2
  109. package/dist-esm/identity/src/msal/nodeFlows/brokerOptions.js.map +0 -1
  110. package/dist-esm/identity/src/msal/nodeFlows/msalClient.js +0 -511
  111. package/dist-esm/identity/src/msal/nodeFlows/msalClient.js.map +0 -1
  112. package/dist-esm/identity/src/msal/nodeFlows/msalPlugins.js +0 -87
  113. package/dist-esm/identity/src/msal/nodeFlows/msalPlugins.js.map +0 -1
  114. package/dist-esm/identity/src/msal/nodeFlows/tokenCachePersistenceOptions.js +0 -4
  115. package/dist-esm/identity/src/msal/nodeFlows/tokenCachePersistenceOptions.js.map +0 -1
  116. package/dist-esm/identity/src/msal/types.js +0 -4
  117. package/dist-esm/identity/src/msal/types.js.map +0 -1
  118. package/dist-esm/identity/src/msal/utils.js +0 -232
  119. package/dist-esm/identity/src/msal/utils.js.map +0 -1
  120. package/dist-esm/identity/src/plugins/consumer.js +0 -43
  121. package/dist-esm/identity/src/plugins/consumer.js.map +0 -1
  122. package/dist-esm/identity/src/plugins/provider.js +0 -4
  123. package/dist-esm/identity/src/plugins/provider.js.map +0 -1
  124. package/dist-esm/identity/src/regionalAuthority.js +0 -140
  125. package/dist-esm/identity/src/regionalAuthority.js.map +0 -1
  126. package/dist-esm/identity/src/tokenCredentialOptions.js +0 -4
  127. package/dist-esm/identity/src/tokenCredentialOptions.js.map +0 -1
  128. package/dist-esm/identity/src/tokenProvider.js +0 -55
  129. package/dist-esm/identity/src/tokenProvider.js.map +0 -1
  130. package/dist-esm/identity/src/util/identityTokenEndpoint.js +0 -11
  131. package/dist-esm/identity/src/util/identityTokenEndpoint.js.map +0 -1
  132. package/dist-esm/identity/src/util/logging.js +0 -94
  133. package/dist-esm/identity/src/util/logging.js.map +0 -1
  134. package/dist-esm/identity/src/util/processMultiTenantRequest.js +0 -35
  135. package/dist-esm/identity/src/util/processMultiTenantRequest.js.map +0 -1
  136. package/dist-esm/identity/src/util/processUtils.js +0 -32
  137. package/dist-esm/identity/src/util/processUtils.js.map +0 -1
  138. package/dist-esm/identity/src/util/scopeUtils.js +0 -29
  139. package/dist-esm/identity/src/util/scopeUtils.js.map +0 -1
  140. package/dist-esm/identity/src/util/subscriptionUtils.js +0 -14
  141. package/dist-esm/identity/src/util/subscriptionUtils.js.map +0 -1
  142. package/dist-esm/identity/src/util/tenantIdUtils.js +0 -44
  143. package/dist-esm/identity/src/util/tenantIdUtils.js.map +0 -1
  144. package/dist-esm/identity/src/util/tracing.js +0 -14
  145. package/dist-esm/identity/src/util/tracing.js.map +0 -1
  146. package/dist-esm/identity-cache-persistence/src/index.js.map +0 -1
  147. package/dist-esm/identity-cache-persistence/src/platforms.js.map +0 -1
  148. package/dist-esm/identity-cache-persistence/src/provider.js.map +0 -1
  149. /package/dist-esm/{identity-cache-persistence/src → src}/index.js +0 -0
  150. /package/dist-esm/{identity-cache-persistence/src → src}/platforms.js +0 -0
  151. /package/dist-esm/{identity-cache-persistence/src → src}/provider.js +0 -0
@@ -1,140 +0,0 @@
1
- // Copyright (c) Microsoft Corporation.
2
- // Licensed under the MIT License.
3
- /**
4
- * Helps specify a regional authority, or "AutoDiscoverRegion" to auto-detect the region.
5
- */
6
- export var RegionalAuthority;
7
- (function (RegionalAuthority) {
8
- /** Instructs MSAL to attempt to discover the region */
9
- RegionalAuthority["AutoDiscoverRegion"] = "AutoDiscoverRegion";
10
- /** Uses the {@link RegionalAuthority} for the Azure 'westus' region. */
11
- RegionalAuthority["USWest"] = "westus";
12
- /** Uses the {@link RegionalAuthority} for the Azure 'westus2' region. */
13
- RegionalAuthority["USWest2"] = "westus2";
14
- /** Uses the {@link RegionalAuthority} for the Azure 'centralus' region. */
15
- RegionalAuthority["USCentral"] = "centralus";
16
- /** Uses the {@link RegionalAuthority} for the Azure 'eastus' region. */
17
- RegionalAuthority["USEast"] = "eastus";
18
- /** Uses the {@link RegionalAuthority} for the Azure 'eastus2' region. */
19
- RegionalAuthority["USEast2"] = "eastus2";
20
- /** Uses the {@link RegionalAuthority} for the Azure 'northcentralus' region. */
21
- RegionalAuthority["USNorthCentral"] = "northcentralus";
22
- /** Uses the {@link RegionalAuthority} for the Azure 'southcentralus' region. */
23
- RegionalAuthority["USSouthCentral"] = "southcentralus";
24
- /** Uses the {@link RegionalAuthority} for the Azure 'westcentralus' region. */
25
- RegionalAuthority["USWestCentral"] = "westcentralus";
26
- /** Uses the {@link RegionalAuthority} for the Azure 'canadacentral' region. */
27
- RegionalAuthority["CanadaCentral"] = "canadacentral";
28
- /** Uses the {@link RegionalAuthority} for the Azure 'canadaeast' region. */
29
- RegionalAuthority["CanadaEast"] = "canadaeast";
30
- /** Uses the {@link RegionalAuthority} for the Azure 'brazilsouth' region. */
31
- RegionalAuthority["BrazilSouth"] = "brazilsouth";
32
- /** Uses the {@link RegionalAuthority} for the Azure 'northeurope' region. */
33
- RegionalAuthority["EuropeNorth"] = "northeurope";
34
- /** Uses the {@link RegionalAuthority} for the Azure 'westeurope' region. */
35
- RegionalAuthority["EuropeWest"] = "westeurope";
36
- /** Uses the {@link RegionalAuthority} for the Azure 'uksouth' region. */
37
- RegionalAuthority["UKSouth"] = "uksouth";
38
- /** Uses the {@link RegionalAuthority} for the Azure 'ukwest' region. */
39
- RegionalAuthority["UKWest"] = "ukwest";
40
- /** Uses the {@link RegionalAuthority} for the Azure 'francecentral' region. */
41
- RegionalAuthority["FranceCentral"] = "francecentral";
42
- /** Uses the {@link RegionalAuthority} for the Azure 'francesouth' region. */
43
- RegionalAuthority["FranceSouth"] = "francesouth";
44
- /** Uses the {@link RegionalAuthority} for the Azure 'switzerlandnorth' region. */
45
- RegionalAuthority["SwitzerlandNorth"] = "switzerlandnorth";
46
- /** Uses the {@link RegionalAuthority} for the Azure 'switzerlandwest' region. */
47
- RegionalAuthority["SwitzerlandWest"] = "switzerlandwest";
48
- /** Uses the {@link RegionalAuthority} for the Azure 'germanynorth' region. */
49
- RegionalAuthority["GermanyNorth"] = "germanynorth";
50
- /** Uses the {@link RegionalAuthority} for the Azure 'germanywestcentral' region. */
51
- RegionalAuthority["GermanyWestCentral"] = "germanywestcentral";
52
- /** Uses the {@link RegionalAuthority} for the Azure 'norwaywest' region. */
53
- RegionalAuthority["NorwayWest"] = "norwaywest";
54
- /** Uses the {@link RegionalAuthority} for the Azure 'norwayeast' region. */
55
- RegionalAuthority["NorwayEast"] = "norwayeast";
56
- /** Uses the {@link RegionalAuthority} for the Azure 'eastasia' region. */
57
- RegionalAuthority["AsiaEast"] = "eastasia";
58
- /** Uses the {@link RegionalAuthority} for the Azure 'southeastasia' region. */
59
- RegionalAuthority["AsiaSouthEast"] = "southeastasia";
60
- /** Uses the {@link RegionalAuthority} for the Azure 'japaneast' region. */
61
- RegionalAuthority["JapanEast"] = "japaneast";
62
- /** Uses the {@link RegionalAuthority} for the Azure 'japanwest' region. */
63
- RegionalAuthority["JapanWest"] = "japanwest";
64
- /** Uses the {@link RegionalAuthority} for the Azure 'australiaeast' region. */
65
- RegionalAuthority["AustraliaEast"] = "australiaeast";
66
- /** Uses the {@link RegionalAuthority} for the Azure 'australiasoutheast' region. */
67
- RegionalAuthority["AustraliaSouthEast"] = "australiasoutheast";
68
- /** Uses the {@link RegionalAuthority} for the Azure 'australiacentral' region. */
69
- RegionalAuthority["AustraliaCentral"] = "australiacentral";
70
- /** Uses the {@link RegionalAuthority} for the Azure 'australiacentral2' region. */
71
- RegionalAuthority["AustraliaCentral2"] = "australiacentral2";
72
- /** Uses the {@link RegionalAuthority} for the Azure 'centralindia' region. */
73
- RegionalAuthority["IndiaCentral"] = "centralindia";
74
- /** Uses the {@link RegionalAuthority} for the Azure 'southindia' region. */
75
- RegionalAuthority["IndiaSouth"] = "southindia";
76
- /** Uses the {@link RegionalAuthority} for the Azure 'westindia' region. */
77
- RegionalAuthority["IndiaWest"] = "westindia";
78
- /** Uses the {@link RegionalAuthority} for the Azure 'koreasouth' region. */
79
- RegionalAuthority["KoreaSouth"] = "koreasouth";
80
- /** Uses the {@link RegionalAuthority} for the Azure 'koreacentral' region. */
81
- RegionalAuthority["KoreaCentral"] = "koreacentral";
82
- /** Uses the {@link RegionalAuthority} for the Azure 'uaecentral' region. */
83
- RegionalAuthority["UAECentral"] = "uaecentral";
84
- /** Uses the {@link RegionalAuthority} for the Azure 'uaenorth' region. */
85
- RegionalAuthority["UAENorth"] = "uaenorth";
86
- /** Uses the {@link RegionalAuthority} for the Azure 'southafricanorth' region. */
87
- RegionalAuthority["SouthAfricaNorth"] = "southafricanorth";
88
- /** Uses the {@link RegionalAuthority} for the Azure 'southafricawest' region. */
89
- RegionalAuthority["SouthAfricaWest"] = "southafricawest";
90
- /** Uses the {@link RegionalAuthority} for the Azure 'chinanorth' region. */
91
- RegionalAuthority["ChinaNorth"] = "chinanorth";
92
- /** Uses the {@link RegionalAuthority} for the Azure 'chinaeast' region. */
93
- RegionalAuthority["ChinaEast"] = "chinaeast";
94
- /** Uses the {@link RegionalAuthority} for the Azure 'chinanorth2' region. */
95
- RegionalAuthority["ChinaNorth2"] = "chinanorth2";
96
- /** Uses the {@link RegionalAuthority} for the Azure 'chinaeast2' region. */
97
- RegionalAuthority["ChinaEast2"] = "chinaeast2";
98
- /** Uses the {@link RegionalAuthority} for the Azure 'germanycentral' region. */
99
- RegionalAuthority["GermanyCentral"] = "germanycentral";
100
- /** Uses the {@link RegionalAuthority} for the Azure 'germanynortheast' region. */
101
- RegionalAuthority["GermanyNorthEast"] = "germanynortheast";
102
- /** Uses the {@link RegionalAuthority} for the Azure 'usgovvirginia' region. */
103
- RegionalAuthority["GovernmentUSVirginia"] = "usgovvirginia";
104
- /** Uses the {@link RegionalAuthority} for the Azure 'usgoviowa' region. */
105
- RegionalAuthority["GovernmentUSIowa"] = "usgoviowa";
106
- /** Uses the {@link RegionalAuthority} for the Azure 'usgovarizona' region. */
107
- RegionalAuthority["GovernmentUSArizona"] = "usgovarizona";
108
- /** Uses the {@link RegionalAuthority} for the Azure 'usgovtexas' region. */
109
- RegionalAuthority["GovernmentUSTexas"] = "usgovtexas";
110
- /** Uses the {@link RegionalAuthority} for the Azure 'usdodeast' region. */
111
- RegionalAuthority["GovernmentUSDodEast"] = "usdodeast";
112
- /** Uses the {@link RegionalAuthority} for the Azure 'usdodcentral' region. */
113
- RegionalAuthority["GovernmentUSDodCentral"] = "usdodcentral";
114
- })(RegionalAuthority || (RegionalAuthority = {}));
115
- /**
116
- * Calculates the correct regional authority based on the supplied value
117
- * and the AZURE_REGIONAL_AUTHORITY_NAME environment variable.
118
- *
119
- * Values will be returned verbatim, except for {@link RegionalAuthority.AutoDiscoverRegion}
120
- * which is mapped to a value MSAL can understand.
121
- *
122
- * @internal
123
- */
124
- export function calculateRegionalAuthority(regionalAuthority) {
125
- // Note: as of today only 3 credentials support regional authority, and the parameter
126
- // is not exposed via the public API. Regional Authority is _only_ supported
127
- // via the AZURE_REGIONAL_AUTHORITY_NAME env var and _only_ for: ClientSecretCredential, ClientCertificateCredential, and ClientAssertionCredential.
128
- var _a, _b;
129
- // Accepting the regionalAuthority parameter will allow us to support it in the future.
130
- let azureRegion = regionalAuthority;
131
- if (azureRegion === undefined &&
132
- ((_b = (_a = globalThis.process) === null || _a === void 0 ? void 0 : _a.env) === null || _b === void 0 ? void 0 : _b.AZURE_REGIONAL_AUTHORITY_NAME) !== undefined) {
133
- azureRegion = process.env.AZURE_REGIONAL_AUTHORITY_NAME;
134
- }
135
- if (azureRegion === RegionalAuthority.AutoDiscoverRegion) {
136
- return "AUTO_DISCOVER";
137
- }
138
- return azureRegion;
139
- }
140
- //# sourceMappingURL=regionalAuthority.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"regionalAuthority.js","sourceRoot":"","sources":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,KAAK,iBAAiB,CAAC,kBAAkB,EAAE,CAAC;QACzD,OAAO,eAAe,CAAC;IACzB,CAAC;IAED,OAAO,WAAW,CAAC;AACrB,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\n/**\n * Helps specify a regional authority, or \"AutoDiscoverRegion\" to auto-detect the region.\n */\nexport enum RegionalAuthority {\n /** Instructs MSAL to attempt to discover the region */\n AutoDiscoverRegion = \"AutoDiscoverRegion\",\n /** Uses the {@link RegionalAuthority} for the Azure 'westus' region. */\n USWest = \"westus\",\n /** Uses the {@link RegionalAuthority} for the Azure 'westus2' region. */\n USWest2 = \"westus2\",\n /** Uses the {@link RegionalAuthority} for the Azure 'centralus' region. */\n USCentral = \"centralus\",\n /** Uses the {@link RegionalAuthority} for the Azure 'eastus' region. */\n USEast = \"eastus\",\n /** Uses the {@link RegionalAuthority} for the Azure 'eastus2' region. */\n USEast2 = \"eastus2\",\n /** Uses the {@link RegionalAuthority} for the Azure 'northcentralus' region. */\n USNorthCentral = \"northcentralus\",\n /** Uses the {@link RegionalAuthority} for the Azure 'southcentralus' region. */\n USSouthCentral = \"southcentralus\",\n /** Uses the {@link RegionalAuthority} for the Azure 'westcentralus' region. */\n USWestCentral = \"westcentralus\",\n /** Uses the {@link RegionalAuthority} for the Azure 'canadacentral' region. */\n CanadaCentral = \"canadacentral\",\n /** Uses the {@link RegionalAuthority} for the Azure 'canadaeast' region. */\n CanadaEast = \"canadaeast\",\n /** Uses the {@link RegionalAuthority} for the Azure 'brazilsouth' region. */\n BrazilSouth = \"brazilsouth\",\n /** Uses the {@link RegionalAuthority} for the Azure 'northeurope' region. */\n EuropeNorth = \"northeurope\",\n /** Uses the {@link RegionalAuthority} for the Azure 'westeurope' region. */\n EuropeWest = \"westeurope\",\n /** Uses the {@link RegionalAuthority} for the Azure 'uksouth' region. */\n UKSouth = \"uksouth\",\n /** Uses the {@link RegionalAuthority} for the Azure 'ukwest' region. */\n UKWest = \"ukwest\",\n /** Uses the {@link RegionalAuthority} for the Azure 'francecentral' region. */\n FranceCentral = \"francecentral\",\n /** Uses the {@link RegionalAuthority} for the Azure 'francesouth' region. */\n FranceSouth = \"francesouth\",\n /** Uses the {@link RegionalAuthority} for the Azure 'switzerlandnorth' region. */\n SwitzerlandNorth = \"switzerlandnorth\",\n /** Uses the {@link RegionalAuthority} for the Azure 'switzerlandwest' region. */\n SwitzerlandWest = \"switzerlandwest\",\n /** Uses the {@link RegionalAuthority} for the Azure 'germanynorth' region. */\n GermanyNorth = \"germanynorth\",\n /** Uses the {@link RegionalAuthority} for the Azure 'germanywestcentral' region. */\n GermanyWestCentral = \"germanywestcentral\",\n /** Uses the {@link RegionalAuthority} for the Azure 'norwaywest' region. */\n NorwayWest = \"norwaywest\",\n /** Uses the {@link RegionalAuthority} for the Azure 'norwayeast' region. */\n NorwayEast = \"norwayeast\",\n /** Uses the {@link RegionalAuthority} for the Azure 'eastasia' region. */\n AsiaEast = \"eastasia\",\n /** Uses the {@link RegionalAuthority} for the Azure 'southeastasia' region. */\n AsiaSouthEast = \"southeastasia\",\n /** Uses the {@link RegionalAuthority} for the Azure 'japaneast' region. */\n JapanEast = \"japaneast\",\n /** Uses the {@link RegionalAuthority} for the Azure 'japanwest' region. */\n JapanWest = \"japanwest\",\n /** Uses the {@link RegionalAuthority} for the Azure 'australiaeast' region. */\n AustraliaEast = \"australiaeast\",\n /** Uses the {@link RegionalAuthority} for the Azure 'australiasoutheast' region. */\n AustraliaSouthEast = \"australiasoutheast\",\n /** Uses the {@link RegionalAuthority} for the Azure 'australiacentral' region. */\n AustraliaCentral = \"australiacentral\",\n /** Uses the {@link RegionalAuthority} for the Azure 'australiacentral2' region. */\n AustraliaCentral2 = \"australiacentral2\",\n /** Uses the {@link RegionalAuthority} for the Azure 'centralindia' region. */\n IndiaCentral = \"centralindia\",\n /** Uses the {@link RegionalAuthority} for the Azure 'southindia' region. */\n IndiaSouth = \"southindia\",\n /** Uses the {@link RegionalAuthority} for the Azure 'westindia' region. */\n IndiaWest = \"westindia\",\n /** Uses the {@link RegionalAuthority} for the Azure 'koreasouth' region. */\n KoreaSouth = \"koreasouth\",\n /** Uses the {@link RegionalAuthority} for the Azure 'koreacentral' region. */\n KoreaCentral = \"koreacentral\",\n /** Uses the {@link RegionalAuthority} for the Azure 'uaecentral' region. */\n UAECentral = \"uaecentral\",\n /** Uses the {@link RegionalAuthority} for the Azure 'uaenorth' region. */\n UAENorth = \"uaenorth\",\n /** Uses the {@link RegionalAuthority} for the Azure 'southafricanorth' region. */\n SouthAfricaNorth = \"southafricanorth\",\n /** Uses the {@link RegionalAuthority} for the Azure 'southafricawest' region. */\n SouthAfricaWest = \"southafricawest\",\n /** Uses the {@link RegionalAuthority} for the Azure 'chinanorth' region. */\n ChinaNorth = \"chinanorth\",\n /** Uses the {@link RegionalAuthority} for the Azure 'chinaeast' region. */\n ChinaEast = \"chinaeast\",\n /** Uses the {@link RegionalAuthority} for the Azure 'chinanorth2' region. */\n ChinaNorth2 = \"chinanorth2\",\n /** Uses the {@link RegionalAuthority} for the Azure 'chinaeast2' region. */\n ChinaEast2 = \"chinaeast2\",\n /** Uses the {@link RegionalAuthority} for the Azure 'germanycentral' region. */\n GermanyCentral = \"germanycentral\",\n /** Uses the {@link RegionalAuthority} for the Azure 'germanynortheast' region. */\n GermanyNorthEast = \"germanynortheast\",\n /** Uses the {@link RegionalAuthority} for the Azure 'usgovvirginia' region. */\n GovernmentUSVirginia = \"usgovvirginia\",\n /** Uses the {@link RegionalAuthority} for the Azure 'usgoviowa' region. */\n GovernmentUSIowa = \"usgoviowa\",\n /** Uses the {@link RegionalAuthority} for the Azure 'usgovarizona' region. */\n GovernmentUSArizona = \"usgovarizona\",\n /** Uses the {@link RegionalAuthority} for the Azure 'usgovtexas' region. */\n GovernmentUSTexas = \"usgovtexas\",\n /** Uses the {@link RegionalAuthority} for the Azure 'usdodeast' region. */\n GovernmentUSDodEast = \"usdodeast\",\n /** Uses the {@link RegionalAuthority} for the Azure 'usdodcentral' region. */\n GovernmentUSDodCentral = \"usdodcentral\",\n}\n\n/**\n * Calculates the correct regional authority based on the supplied value\n * and the AZURE_REGIONAL_AUTHORITY_NAME environment variable.\n *\n * Values will be returned verbatim, except for {@link RegionalAuthority.AutoDiscoverRegion}\n * which is mapped to a value MSAL can understand.\n *\n * @internal\n */\nexport function calculateRegionalAuthority(regionalAuthority?: string): string | undefined {\n // Note: as of today only 3 credentials support regional authority, and the parameter\n // is not exposed via the public API. Regional Authority is _only_ supported\n // via the AZURE_REGIONAL_AUTHORITY_NAME env var and _only_ for: ClientSecretCredential, ClientCertificateCredential, and ClientAssertionCredential.\n\n // Accepting the regionalAuthority parameter will allow us to support it in the future.\n let azureRegion = regionalAuthority;\n\n if (\n azureRegion === undefined &&\n globalThis.process?.env?.AZURE_REGIONAL_AUTHORITY_NAME !== undefined\n ) {\n azureRegion = process.env.AZURE_REGIONAL_AUTHORITY_NAME;\n }\n\n if (azureRegion === RegionalAuthority.AutoDiscoverRegion) {\n return \"AUTO_DISCOVER\";\n }\n\n return azureRegion;\n}\n"]}
@@ -1,4 +0,0 @@
1
- // Copyright (c) Microsoft Corporation.
2
- // Licensed under the MIT License.
3
- export {};
4
- //# sourceMappingURL=tokenCredentialOptions.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"tokenCredentialOptions.js","sourceRoot":"","sources":["../../../../identity/src/tokenCredentialOptions.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type { CommonClientOptions } from \"@azure/core-client\";\nimport type { LogPolicyOptions } from \"@azure/core-rest-pipeline\";\n\n/**\n * Provides options to configure how the Identity library makes authentication\n * requests to Microsoft Entra ID.\n */\nexport interface TokenCredentialOptions extends CommonClientOptions {\n /**\n * The authority host to use for authentication requests.\n * Possible values are available through {@link AzureAuthorityHosts}.\n * The default is \"https://login.microsoftonline.com\".\n */\n authorityHost?: string;\n /**\n * Allows users to configure settings for logging policy options, allow logging account information and personally identifiable information for customer support.\n */\n loggingOptions?: LogPolicyOptions & {\n /**\n * Allows logging account information once the authentication flow succeeds.\n */\n allowLoggingAccountIdentifiers?: boolean;\n /**\n * Allows logging personally identifiable information for customer support.\n */\n enableUnsafeSupportLogging?: boolean;\n };\n}\n"]}
@@ -1,55 +0,0 @@
1
- // Copyright (c) Microsoft Corporation.
2
- // Licensed under the MIT License.
3
- import { __awaiter } from "tslib";
4
- import { bearerTokenAuthenticationPolicy, createEmptyPipeline, createPipelineRequest, } from "@azure/core-rest-pipeline";
5
- /**
6
- * Returns a callback that provides a bearer token.
7
- * For example, the bearer token can be used to authenticate a request as follows:
8
- * ```ts snippet:token_provider_example
9
- * import { DefaultAzureCredential, getBearerTokenProvider } from "@azure/identity";
10
- * import { createPipelineRequest } from "@azure/core-rest-pipeline";
11
- *
12
- * const credential = new DefaultAzureCredential();
13
- * const scope = "https://cognitiveservices.azure.com/.default";
14
- * const getAccessToken = getBearerTokenProvider(credential, scope);
15
- * const token = await getAccessToken();
16
- * // usage
17
- * const request = createPipelineRequest({ url: "https://example.com" });
18
- * request.headers.set("Authorization", `Bearer ${token}`);
19
- * ```
20
- *
21
- * @param credential - The credential used to authenticate the request.
22
- * @param scopes - The scopes required for the bearer token.
23
- * @param options - Options to configure the token provider.
24
- * @returns a callback that provides a bearer token.
25
- */
26
- export function getBearerTokenProvider(credential, scopes, options) {
27
- const { abortSignal, tracingOptions } = options || {};
28
- const pipeline = createEmptyPipeline();
29
- pipeline.addPolicy(bearerTokenAuthenticationPolicy({ credential, scopes }));
30
- function getRefreshedToken() {
31
- return __awaiter(this, void 0, void 0, function* () {
32
- var _a;
33
- // Create a pipeline with just the bearer token policy
34
- // and run a dummy request through it to get the token
35
- const res = yield pipeline.sendRequest({
36
- sendRequest: (request) => Promise.resolve({
37
- request,
38
- status: 200,
39
- headers: request.headers,
40
- }),
41
- }, createPipelineRequest({
42
- url: "https://example.com",
43
- abortSignal,
44
- tracingOptions,
45
- }));
46
- const accessToken = (_a = res.headers.get("authorization")) === null || _a === void 0 ? void 0 : _a.split(" ")[1];
47
- if (!accessToken) {
48
- throw new Error("Failed to get access token");
49
- }
50
- return accessToken;
51
- });
52
- }
53
- return getRefreshedToken;
54
- }
55
- //# sourceMappingURL=tokenProvider.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"tokenProvider.js","sourceRoot":"","sources":["../../../../identity/src/tokenProvider.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;;AAGlC,OAAO,EACL,+BAA+B,EAC/B,mBAAmB,EACnB,qBAAqB,GACtB,MAAM,2BAA2B,CAAC;AAiBnC;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,MAAM,UAAU,sBAAsB,CACpC,UAA2B,EAC3B,MAAyB,EACzB,OAAuC;IAEvC,MAAM,EAAE,WAAW,EAAE,cAAc,EAAE,GAAG,OAAO,IAAI,EAAE,CAAC;IACtD,MAAM,QAAQ,GAAG,mBAAmB,EAAE,CAAC;IACvC,QAAQ,CAAC,SAAS,CAAC,+BAA+B,CAAC,EAAE,UAAU,EAAE,MAAM,EAAE,CAAC,CAAC,CAAC;IAC5E,SAAe,iBAAiB;;;YAC9B,sDAAsD;YACtD,sDAAsD;YACtD,MAAM,GAAG,GAAG,MAAM,QAAQ,CAAC,WAAW,CACpC;gBACE,WAAW,EAAE,CAAC,OAAO,EAAE,EAAE,CACvB,OAAO,CAAC,OAAO,CAAC;oBACd,OAAO;oBACP,MAAM,EAAE,GAAG;oBACX,OAAO,EAAE,OAAO,CAAC,OAAO;iBACzB,CAAC;aACL,EACD,qBAAqB,CAAC;gBACpB,GAAG,EAAE,qBAAqB;gBAC1B,WAAW;gBACX,cAAc;aACf,CAAC,CACH,CAAC;YACF,MAAM,WAAW,GAAG,MAAA,GAAG,CAAC,OAAO,CAAC,GAAG,CAAC,eAAe,CAAC,0CAAE,KAAK,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC;YACpE,IAAI,CAAC,WAAW,EAAE,CAAC;gBACjB,MAAM,IAAI,KAAK,CAAC,4BAA4B,CAAC,CAAC;YAChD,CAAC;YACD,OAAO,WAAW,CAAC;QACrB,CAAC;KAAA;IACD,OAAO,iBAAiB,CAAC;AAC3B,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type { TokenCredential, TracingContext } from \"@azure/core-auth\";\nimport {\n bearerTokenAuthenticationPolicy,\n createEmptyPipeline,\n createPipelineRequest,\n} from \"@azure/core-rest-pipeline\";\n\n/**\n * The options to configure the token provider.\n */\nexport interface GetBearerTokenProviderOptions {\n /** The abort signal to abort requests to get tokens */\n abortSignal?: AbortSignal;\n /** The tracing options for the requests to get tokens */\n tracingOptions?: {\n /**\n * Tracing Context for the current request to get a token.\n */\n tracingContext?: TracingContext;\n };\n}\n\n/**\n * Returns a callback that provides a bearer token.\n * For example, the bearer token can be used to authenticate a request as follows:\n * ```ts snippet:token_provider_example\n * import { DefaultAzureCredential, getBearerTokenProvider } from \"@azure/identity\";\n * import { createPipelineRequest } from \"@azure/core-rest-pipeline\";\n *\n * const credential = new DefaultAzureCredential();\n * const scope = \"https://cognitiveservices.azure.com/.default\";\n * const getAccessToken = getBearerTokenProvider(credential, scope);\n * const token = await getAccessToken();\n * // usage\n * const request = createPipelineRequest({ url: \"https://example.com\" });\n * request.headers.set(\"Authorization\", `Bearer ${token}`);\n * ```\n *\n * @param credential - The credential used to authenticate the request.\n * @param scopes - The scopes required for the bearer token.\n * @param options - Options to configure the token provider.\n * @returns a callback that provides a bearer token.\n */\nexport function getBearerTokenProvider(\n credential: TokenCredential,\n scopes: string | string[],\n options?: GetBearerTokenProviderOptions,\n): () => Promise<string> {\n const { abortSignal, tracingOptions } = options || {};\n const pipeline = createEmptyPipeline();\n pipeline.addPolicy(bearerTokenAuthenticationPolicy({ credential, scopes }));\n async function getRefreshedToken(): Promise<string> {\n // Create a pipeline with just the bearer token policy\n // and run a dummy request through it to get the token\n const res = await pipeline.sendRequest(\n {\n sendRequest: (request) =>\n Promise.resolve({\n request,\n status: 200,\n headers: request.headers,\n }),\n },\n createPipelineRequest({\n url: \"https://example.com\",\n abortSignal,\n tracingOptions,\n }),\n );\n const accessToken = res.headers.get(\"authorization\")?.split(\" \")[1];\n if (!accessToken) {\n throw new Error(\"Failed to get access token\");\n }\n return accessToken;\n }\n return getRefreshedToken;\n}\n"]}
@@ -1,11 +0,0 @@
1
- // Copyright (c) Microsoft Corporation.
2
- // Licensed under the MIT License.
3
- export function getIdentityTokenEndpointSuffix(tenantId) {
4
- if (tenantId === "adfs") {
5
- return "oauth2/token";
6
- }
7
- else {
8
- return "oauth2/v2.0/token";
9
- }
10
- }
11
- //# sourceMappingURL=identityTokenEndpoint.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"identityTokenEndpoint.js","sourceRoot":"","sources":["../../../../../identity/src/util/identityTokenEndpoint.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,MAAM,UAAU,8BAA8B,CAAC,QAAgB;IAC7D,IAAI,QAAQ,KAAK,MAAM,EAAE,CAAC;QACxB,OAAO,cAAc,CAAC;IACxB,CAAC;SAAM,CAAC;QACN,OAAO,mBAAmB,CAAC;IAC7B,CAAC;AACH,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nexport function getIdentityTokenEndpointSuffix(tenantId: string): string {\n if (tenantId === \"adfs\") {\n return \"oauth2/token\";\n } else {\n return \"oauth2/v2.0/token\";\n }\n}\n"]}
@@ -1,94 +0,0 @@
1
- // Copyright (c) Microsoft Corporation.
2
- // Licensed under the MIT License.
3
- import { createClientLogger } from "@azure/logger";
4
- /**
5
- * The AzureLogger used for all clients within the identity package
6
- */
7
- export const logger = createClientLogger("identity");
8
- /**
9
- * Separates a list of environment variable names into a plain object with two arrays: an array of missing environment variables and another array with assigned environment variables.
10
- * @param supportedEnvVars - List of environment variable names
11
- */
12
- export function processEnvVars(supportedEnvVars) {
13
- return supportedEnvVars.reduce((acc, envVariable) => {
14
- if (process.env[envVariable]) {
15
- acc.assigned.push(envVariable);
16
- }
17
- else {
18
- acc.missing.push(envVariable);
19
- }
20
- return acc;
21
- }, { missing: [], assigned: [] });
22
- }
23
- /**
24
- * Based on a given list of environment variable names,
25
- * logs the environment variables currently assigned during the usage of a credential that goes by the given name.
26
- * @param credentialName - Name of the credential in use
27
- * @param supportedEnvVars - List of environment variables supported by that credential
28
- */
29
- export function logEnvVars(credentialName, supportedEnvVars) {
30
- const { assigned } = processEnvVars(supportedEnvVars);
31
- logger.info(`${credentialName} => Found the following environment variables: ${assigned.join(", ")}`);
32
- }
33
- /**
34
- * Formatting the success event on the credentials
35
- */
36
- export function formatSuccess(scope) {
37
- return `SUCCESS. Scopes: ${Array.isArray(scope) ? scope.join(", ") : scope}.`;
38
- }
39
- /**
40
- * Formatting the success event on the credentials
41
- */
42
- export function formatError(scope, error) {
43
- let message = "ERROR.";
44
- if (scope === null || scope === void 0 ? void 0 : scope.length) {
45
- message += ` Scopes: ${Array.isArray(scope) ? scope.join(", ") : scope}.`;
46
- }
47
- return `${message} Error message: ${typeof error === "string" ? error : error.message}.`;
48
- }
49
- /**
50
- * Generates a CredentialLoggerInstance.
51
- *
52
- * It logs with the format:
53
- *
54
- * `[title] => [message]`
55
- *
56
- */
57
- export function credentialLoggerInstance(title, parent, log = logger) {
58
- const fullTitle = parent ? `${parent.fullTitle} ${title}` : title;
59
- function info(message) {
60
- log.info(`${fullTitle} =>`, message);
61
- }
62
- function warning(message) {
63
- log.warning(`${fullTitle} =>`, message);
64
- }
65
- function verbose(message) {
66
- log.verbose(`${fullTitle} =>`, message);
67
- }
68
- function error(message) {
69
- log.error(`${fullTitle} =>`, message);
70
- }
71
- return {
72
- title,
73
- fullTitle,
74
- info,
75
- warning,
76
- verbose,
77
- error,
78
- };
79
- }
80
- /**
81
- * Generates a CredentialLogger, which is a logger declared at the credential's constructor, and used at any point in the credential.
82
- * It has all the properties of a CredentialLoggerInstance, plus other logger instances, one per method.
83
- *
84
- * It logs with the format:
85
- *
86
- * `[title] => [message]`
87
- * `[title] => getToken() => [message]`
88
- *
89
- */
90
- export function credentialLogger(title, log = logger) {
91
- const credLogger = credentialLoggerInstance(title, undefined, log);
92
- return Object.assign(Object.assign({}, credLogger), { parent: log, getToken: credentialLoggerInstance("=> getToken()", credLogger, log) });
93
- }
94
- //# sourceMappingURL=logging.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"logging.js","sourceRoot":"","sources":["../../../../../identity/src/util/logging.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAGlC,OAAO,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AAEnD;;GAEG;AACH,MAAM,CAAC,MAAM,MAAM,GAAG,kBAAkB,CAAC,UAAU,CAAC,CAAC;AAOrD;;;GAGG;AACH,MAAM,UAAU,cAAc,CAAC,gBAA0B;IACvD,OAAO,gBAAgB,CAAC,MAAM,CAC5B,CAAC,GAA2B,EAAE,WAAmB,EAAE,EAAE;QACnD,IAAI,OAAO,CAAC,GAAG,CAAC,WAAW,CAAC,EAAE,CAAC;YAC7B,GAAG,CAAC,QAAQ,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;QACjC,CAAC;aAAM,CAAC;YACN,GAAG,CAAC,OAAO,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;QAChC,CAAC;QACD,OAAO,GAAG,CAAC;IACb,CAAC,EACD,EAAE,OAAO,EAAE,EAAE,EAAE,QAAQ,EAAE,EAAE,EAAE,CAC9B,CAAC;AACJ,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,UAAU,CAAC,cAAsB,EAAE,gBAA0B;IAC3E,MAAM,EAAE,QAAQ,EAAE,GAAG,cAAc,CAAC,gBAAgB,CAAC,CAAC;IACtD,MAAM,CAAC,IAAI,CACT,GAAG,cAAc,kDAAkD,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE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O,CAAC,CAAC;IAC1C,CAAC;IAED,SAAS,KAAK,CAAC,OAAe;QAC5B,GAAG,CAAC,KAAK,CAAC,GAAG,SAAS,KAAK,EAAE,OAAO,CAAC,CAAC;IACxC,CAAC;IAED,OAAO;QACL,KAAK;QACL,SAAS;QACT,IAAI;QACJ,OAAO;QACP,OAAO;QACP,KAAK;KACN,CAAC;AACJ,CAAC;AAWD;;;;;;;;;GASG;AACH,MAAM,UAAU,gBAAgB,CAAC,KAAa,EAAE,MAAmB,MAAM;IACvE,MAAM,UAAU,GAAG,wBAAwB,CAAC,KAAK,EAAE,SAAS,EAAE,GAAG,CAAC,CAAC;IACnE,uCACK,UAAU,KACb,MAAM,EAAE,GAAG,EACX,QAAQ,EAAE,wBAAwB,CAAC,eAAe,EAAE,UAAU,EAAE,GAAG,CAAC,IACpE;AACJ,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type { AzureLogger } from \"@azure/logger\";\nimport { createClientLogger } from \"@azure/logger\";\n\n/**\n * The AzureLogger used for all clients within the identity package\n */\nexport const logger = createClientLogger(\"identity\");\n\ninterface EnvironmentAccumulator {\n missing: string[];\n assigned: string[];\n}\n\n/**\n * Separates a list of environment variable names into a plain object with two arrays: an array of missing environment variables and another array with assigned environment variables.\n * @param supportedEnvVars - List of environment variable names\n */\nexport function processEnvVars(supportedEnvVars: string[]): EnvironmentAccumulator {\n return supportedEnvVars.reduce(\n (acc: EnvironmentAccumulator, envVariable: string) => {\n if (process.env[envVariable]) {\n acc.assigned.push(envVariable);\n } else {\n acc.missing.push(envVariable);\n }\n return acc;\n },\n { missing: [], assigned: [] },\n );\n}\n\n/**\n * Based on a given list of environment variable names,\n * logs the environment variables currently assigned during the usage of a credential that goes by the given name.\n * @param credentialName - Name of the credential in use\n * @param supportedEnvVars - List of environment variables supported by that credential\n */\nexport function logEnvVars(credentialName: string, supportedEnvVars: string[]): void {\n const { assigned } = processEnvVars(supportedEnvVars);\n logger.info(\n `${credentialName} => Found the following environment variables: ${assigned.join(\", \")}`,\n );\n}\n\n/**\n * Formatting the success event on the credentials\n */\nexport function formatSuccess(scope: string | string[]): string {\n return `SUCCESS. Scopes: ${Array.isArray(scope) ? scope.join(\", \") : scope}.`;\n}\n\n/**\n * Formatting the success event on the credentials\n */\nexport function formatError(scope: string | string[] | undefined, error: Error | string): string {\n let message = \"ERROR.\";\n if (scope?.length) {\n message += ` Scopes: ${Array.isArray(scope) ? scope.join(\", \") : scope}.`;\n }\n return `${message} Error message: ${typeof error === \"string\" ? error : error.message}.`;\n}\n\n/**\n * A CredentialLoggerInstance is a logger properly formatted to work in a credential's constructor, and its methods.\n */\nexport interface CredentialLoggerInstance {\n title: string;\n fullTitle: string;\n info(message: string): void;\n warning(message: string): void;\n verbose(message: string): void;\n error(err: string): void;\n}\n\n/**\n * Generates a CredentialLoggerInstance.\n *\n * It logs with the format:\n *\n * `[title] => [message]`\n *\n */\nexport function credentialLoggerInstance(\n title: string,\n parent?: CredentialLoggerInstance,\n log: AzureLogger = logger,\n): CredentialLoggerInstance {\n const fullTitle = parent ? `${parent.fullTitle} ${title}` : title;\n\n function info(message: string): void {\n log.info(`${fullTitle} =>`, message);\n }\n\n function warning(message: string): void {\n log.warning(`${fullTitle} =>`, message);\n }\n\n function verbose(message: string): void {\n log.verbose(`${fullTitle} =>`, message);\n }\n\n function error(message: string): void {\n log.error(`${fullTitle} =>`, message);\n }\n\n return {\n title,\n fullTitle,\n info,\n warning,\n verbose,\n error,\n };\n}\n\n/**\n * A CredentialLogger is a logger declared at the credential's constructor, and used at any point in the credential.\n * It has all the properties of a CredentialLoggerInstance, plus other logger instances, one per method.\n */\nexport interface CredentialLogger extends CredentialLoggerInstance {\n parent: AzureLogger;\n getToken: CredentialLoggerInstance;\n}\n\n/**\n * Generates a CredentialLogger, which is a logger declared at the credential's constructor, and used at any point in the credential.\n * It has all the properties of a CredentialLoggerInstance, plus other logger instances, one per method.\n *\n * It logs with the format:\n *\n * `[title] => [message]`\n * `[title] => getToken() => [message]`\n *\n */\nexport function credentialLogger(title: string, log: AzureLogger = logger): CredentialLogger {\n const credLogger = credentialLoggerInstance(title, undefined, log);\n return {\n ...credLogger,\n parent: log,\n getToken: credentialLoggerInstance(\"=> getToken()\", credLogger, log),\n };\n}\n"]}
@@ -1,35 +0,0 @@
1
- // Copyright (c) Microsoft Corporation.
2
- // Licensed under the MIT License.
3
- import { CredentialUnavailableError } from "../errors";
4
- function createConfigurationErrorMessage(tenantId) {
5
- return `The current credential is not configured to acquire tokens for tenant ${tenantId}. To enable acquiring tokens for this tenant add it to the AdditionallyAllowedTenants on the credential options, or add "*" to AdditionallyAllowedTenants to allow acquiring tokens for any tenant.`;
6
- }
7
- /**
8
- * Of getToken contains a tenantId, this functions allows picking this tenantId as the appropriate for authentication,
9
- * unless multitenant authentication has been disabled through the AZURE_IDENTITY_DISABLE_MULTITENANTAUTH (on Node.js),
10
- * or unless the original tenant Id is `adfs`.
11
- * @internal
12
- */
13
- export function processMultiTenantRequest(tenantId, getTokenOptions, additionallyAllowedTenantIds = [], logger) {
14
- var _a;
15
- let resolvedTenantId;
16
- if (process.env.AZURE_IDENTITY_DISABLE_MULTITENANTAUTH) {
17
- resolvedTenantId = tenantId;
18
- }
19
- else if (tenantId === "adfs") {
20
- resolvedTenantId = tenantId;
21
- }
22
- else {
23
- resolvedTenantId = (_a = getTokenOptions === null || getTokenOptions === void 0 ? void 0 : getTokenOptions.tenantId) !== null && _a !== void 0 ? _a : tenantId;
24
- }
25
- if (tenantId &&
26
- resolvedTenantId !== tenantId &&
27
- !additionallyAllowedTenantIds.includes("*") &&
28
- !additionallyAllowedTenantIds.some((t) => t.localeCompare(resolvedTenantId) === 0)) {
29
- const message = createConfigurationErrorMessage(tenantId);
30
- logger === null || logger === void 0 ? void 0 : logger.info(message);
31
- throw new CredentialUnavailableError(message);
32
- }
33
- return resolvedTenantId;
34
- }
35
- //# sourceMappingURL=processMultiTenantRequest.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"processMultiTenantRequest.js","sourceRoot":"","sources":["../../../../../identity/src/util/processMultiTenantRequest.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAGlC,OAAO,EAAE,0BAA0B,EAAE,MAAM,WAAW,CAAC;AAGvD,SAAS,+BAA+B,CAAC,QAAgB;IACvD,OAAO,yEAAyE,QAAQ,qMAAqM,CAAC;AAChS,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,yBAAyB,CACvC,QAAiB,EACjB,eAAiC,EACjC,+BAAyC,EAAE,EAC3C,MAAyB;;IAEzB,IAAI,gBAAoC,CAAC;IACzC,IAAI,OAAO,CAAC,GAAG,CAAC,sCAAsC,EAAE,CAAC;QACvD,gBAAgB,GAAG,QAAQ,CAAC;IAC9B,CAAC;SAAM,IAAI,QAAQ,KAAK,MAAM,EAAE,CAAC;QAC/B,gBAAgB,GAAG,QAAQ,CAAC;IAC9B,CAAC;SAAM,CAAC;QACN,gBAAgB,GAAG,MAAA,eAAe,aAAf,eAAe,uBAAf,eAAe,CAAE,QAAQ,mCAAI,QAAQ,CAAC;IAC3D,CAAC;IACD,IACE,QAAQ;QACR,gBAAgB,KAAK,QAAQ;QAC7B,CAAC,4BAA4B,CAAC,QAAQ,CAAC,GAAG,CAAC;QAC3C,CAAC,4BAA4B,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,aAAa,CAAC,gBAAiB,CAAC,KAAK,CAAC,CAAC,EACnF,CAAC;QACD,MAAM,OAAO,GAAG,+BAA+B,CAAC,QAAQ,CAAC,CAAC;QAC1D,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,IAAI,CAAC,OAAO,CAAC,CAAC;QACtB,MAAM,IAAI,0BAA0B,CAAC,OAAO,CAAC,CAAC;IAChD,CAAC;IAED,OAAO,gBAAgB,CAAC;AAC1B,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type { GetTokenOptions } from \"@azure/core-auth\";\nimport { CredentialUnavailableError } from \"../errors\";\nimport type { CredentialLogger } from \"./logging\";\n\nfunction createConfigurationErrorMessage(tenantId: string): string {\n return `The current credential is not configured to acquire tokens for tenant ${tenantId}. To enable acquiring tokens for this tenant add it to the AdditionallyAllowedTenants on the credential options, or add \"*\" to AdditionallyAllowedTenants to allow acquiring tokens for any tenant.`;\n}\n\n/**\n * Of getToken contains a tenantId, this functions allows picking this tenantId as the appropriate for authentication,\n * unless multitenant authentication has been disabled through the AZURE_IDENTITY_DISABLE_MULTITENANTAUTH (on Node.js),\n * or unless the original tenant Id is `adfs`.\n * @internal\n */\nexport function processMultiTenantRequest(\n tenantId?: string,\n getTokenOptions?: GetTokenOptions,\n additionallyAllowedTenantIds: string[] = [],\n logger?: CredentialLogger,\n): string | undefined {\n let resolvedTenantId: string | undefined;\n if (process.env.AZURE_IDENTITY_DISABLE_MULTITENANTAUTH) {\n resolvedTenantId = tenantId;\n } else if (tenantId === \"adfs\") {\n resolvedTenantId = tenantId;\n } else {\n resolvedTenantId = getTokenOptions?.tenantId ?? tenantId;\n }\n if (\n tenantId &&\n resolvedTenantId !== tenantId &&\n !additionallyAllowedTenantIds.includes(\"*\") &&\n !additionallyAllowedTenantIds.some((t) => t.localeCompare(resolvedTenantId!) === 0)\n ) {\n const message = createConfigurationErrorMessage(tenantId);\n logger?.info(message);\n throw new CredentialUnavailableError(message);\n }\n\n return resolvedTenantId;\n}\n"]}
@@ -1,32 +0,0 @@
1
- // Copyright (c) Microsoft Corporation.
2
- // Licensed under the MIT License.
3
- import * as childProcess from "child_process";
4
- /**
5
- * Easy to mock childProcess utils.
6
- * @internal
7
- */
8
- export const processUtils = {
9
- /**
10
- * Promisifying childProcess.execFile
11
- * @internal
12
- */
13
- execFile(file, params, options) {
14
- return new Promise((resolve, reject) => {
15
- childProcess.execFile(file, params, options, (error, stdout, stderr) => {
16
- if (Buffer.isBuffer(stdout)) {
17
- stdout = stdout.toString("utf8");
18
- }
19
- if (Buffer.isBuffer(stderr)) {
20
- stderr = stderr.toString("utf8");
21
- }
22
- if (stderr || error) {
23
- reject(stderr ? new Error(stderr) : error);
24
- }
25
- else {
26
- resolve(stdout);
27
- }
28
- });
29
- });
30
- },
31
- };
32
- //# sourceMappingURL=processUtils.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"processUtils.js","sourceRoot":"","sources":["../../../../../identity/src/util/processUtils.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,KAAK,YAAY,MAAM,eAAe,CAAC;AAE9C;;;GAGG;AACH,MAAM,CAAC,MAAM,YAAY,GAAG;IAC1B;;;OAGG;IACH,QAAQ,CACN,IAAY,EACZ,MAAgB,EAChB,OAAwD;QAExD,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;YACrC,YAAY,CAAC,QAAQ,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,EAAE;gBACrE,IAAI,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE,CAAC;oBAC5B,MAAM,GAAG,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;gBACnC,CAAC;gBACD,IAAI,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE,CAAC;oBAC5B,MAAM,GAAG,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;gBACnC,CAAC;gBACD,IAAI,MAAM,IAAI,KAAK,EAAE,CAAC;oBACpB,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC;gBAC7C,CAAC;qBAAM,CAAC;oBACN,OAAO,CAAC,MAAM,CAAC,CAAC;gBAClB,CAAC;YACH,CAAC,CAAC,CAAC;QACL,CAAC,CAAC,CAAC;IACL,CAAC;CACF,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport * as childProcess from \"child_process\";\n\n/**\n * Easy to mock childProcess utils.\n * @internal\n */\nexport const processUtils = {\n /**\n * Promisifying childProcess.execFile\n * @internal\n */\n execFile(\n file: string,\n params: string[],\n options?: childProcess.ExecFileOptionsWithStringEncoding,\n ): Promise<string | Buffer> {\n return new Promise((resolve, reject) => {\n childProcess.execFile(file, params, options, (error, stdout, stderr) => {\n if (Buffer.isBuffer(stdout)) {\n stdout = stdout.toString(\"utf8\");\n }\n if (Buffer.isBuffer(stderr)) {\n stderr = stderr.toString(\"utf8\");\n }\n if (stderr || error) {\n reject(stderr ? new Error(stderr) : error);\n } else {\n resolve(stdout);\n }\n });\n });\n },\n};\n"]}
@@ -1,29 +0,0 @@
1
- // Copyright (c) Microsoft Corporation.
2
- // Licensed under the MIT License.
3
- import { formatError } from "./logging";
4
- /**
5
- * Ensures the scopes value is an array.
6
- * @internal
7
- */
8
- export function ensureScopes(scopes) {
9
- return Array.isArray(scopes) ? scopes : [scopes];
10
- }
11
- /**
12
- * Throws if the received scope is not valid.
13
- * @internal
14
- */
15
- export function ensureValidScopeForDevTimeCreds(scope, logger) {
16
- if (!scope.match(/^[0-9a-zA-Z-_.:/]+$/)) {
17
- const error = new Error("Invalid scope was specified by the user or calling client");
18
- logger.getToken.info(formatError(scope, error));
19
- throw error;
20
- }
21
- }
22
- /**
23
- * Returns the resource out of a scope.
24
- * @internal
25
- */
26
- export function getScopeResource(scope) {
27
- return scope.replace(/\/.default$/, "");
28
- }
29
- //# sourceMappingURL=scopeUtils.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"scopeUtils.js","sourceRoot":"","sources":["../../../../../identity/src/util/scopeUtils.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAGlC,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAExC;;;GAGG;AACH,MAAM,UAAU,YAAY,CAAC,MAAyB;IACpD,OAAO,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC;AACnD,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,+BAA+B,CAAC,KAAa,EAAE,MAAwB;IACrF,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,qBAAqB,CAAC,EAAE,CAAC;QACxC,MAAM,KAAK,GAAG,IAAI,KAAK,CAAC,2DAA2D,CAAC,CAAC;QACrF,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,WAAW,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC,CAAC;QAChD,MAAM,KAAK,CAAC;IACd,CAAC;AACH,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,gBAAgB,CAAC,KAAa;IAC5C,OAAO,KAAK,CAAC,OAAO,CAAC,aAAa,EAAE,EAAE,CAAC,CAAC;AAC1C,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type { CredentialLogger } from \"./logging\";\nimport { formatError } from \"./logging\";\n\n/**\n * Ensures the scopes value is an array.\n * @internal\n */\nexport function ensureScopes(scopes: string | string[]): string[] {\n return Array.isArray(scopes) ? scopes : [scopes];\n}\n\n/**\n * Throws if the received scope is not valid.\n * @internal\n */\nexport function ensureValidScopeForDevTimeCreds(scope: string, logger: CredentialLogger): void {\n if (!scope.match(/^[0-9a-zA-Z-_.:/]+$/)) {\n const error = new Error(\"Invalid scope was specified by the user or calling client\");\n logger.getToken.info(formatError(scope, error));\n throw error;\n }\n}\n\n/**\n * Returns the resource out of a scope.\n * @internal\n */\nexport function getScopeResource(scope: string): string {\n return scope.replace(/\\/.default$/, \"\");\n}\n"]}
@@ -1,14 +0,0 @@
1
- // Copyright (c) Microsoft Corporation.
2
- // Licensed under the MIT License.
3
- import { formatError } from "./logging";
4
- /**
5
- * @internal
6
- */
7
- export function checkSubscription(logger, subscription) {
8
- if (!subscription.match(/^[0-9a-zA-Z-._ ]+$/)) {
9
- const error = new Error("Invalid subscription provided. You can locate your subscription by following the instructions listed here: https://learn.microsoft.com/azure/azure-portal/get-subscription-tenant-id.");
10
- logger.info(formatError("", error));
11
- throw error;
12
- }
13
- }
14
- //# sourceMappingURL=subscriptionUtils.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"subscriptionUtils.js","sourceRoot":"","sources":["../../../../../identity/src/util/subscriptionUtils.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAGlC,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAExC;;GAEG;AACH,MAAM,UAAU,iBAAiB,CAAC,MAAwB,EAAE,YAAoB;IAC9E,IAAI,CAAC,YAAY,CAAC,KAAK,CAAC,oBAAoB,CAAC,EAAE,CAAC;QAC9C,MAAM,KAAK,GAAG,IAAI,KAAK,CACrB,uLAAuL,CACxL,CAAC;QACF,MAAM,CAAC,IAAI,CAAC,WAAW,CAAC,EAAE,EAAE,KAAK,CAAC,CAAC,CAAC;QACpC,MAAM,KAAK,CAAC;IACd,CAAC;AACH,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type { CredentialLogger } from \"./logging\";\nimport { formatError } from \"./logging\";\n\n/**\n * @internal\n */\nexport function checkSubscription(logger: CredentialLogger, subscription: string): void {\n if (!subscription.match(/^[0-9a-zA-Z-._ ]+$/)) {\n const error = new Error(\n \"Invalid subscription provided. You can locate your subscription by following the instructions listed here: https://learn.microsoft.com/azure/azure-portal/get-subscription-tenant-id.\",\n );\n logger.info(formatError(\"\", error));\n throw error;\n }\n}\n"]}
@@ -1,44 +0,0 @@
1
- // Copyright (c) Microsoft Corporation.
2
- // Licensed under the MIT License.
3
- import { ALL_TENANTS, DeveloperSignOnClientId } from "../constants";
4
- import { formatError } from "./logging";
5
- export { processMultiTenantRequest } from "./processMultiTenantRequest";
6
- /**
7
- * @internal
8
- */
9
- export function checkTenantId(logger, tenantId) {
10
- if (!tenantId.match(/^[0-9a-zA-Z-.]+$/)) {
11
- const error = new Error("Invalid tenant id provided. You can locate your tenant id by following the instructions listed here: https://learn.microsoft.com/partner-center/find-ids-and-domain-names.");
12
- logger.info(formatError("", error));
13
- throw error;
14
- }
15
- }
16
- /**
17
- * @internal
18
- */
19
- export function resolveTenantId(logger, tenantId, clientId) {
20
- if (tenantId) {
21
- checkTenantId(logger, tenantId);
22
- return tenantId;
23
- }
24
- if (!clientId) {
25
- clientId = DeveloperSignOnClientId;
26
- }
27
- if (clientId !== DeveloperSignOnClientId) {
28
- return "common";
29
- }
30
- return "organizations";
31
- }
32
- /**
33
- * @internal
34
- */
35
- export function resolveAdditionallyAllowedTenantIds(additionallyAllowedTenants) {
36
- if (!additionallyAllowedTenants || additionallyAllowedTenants.length === 0) {
37
- return [];
38
- }
39
- if (additionallyAllowedTenants.includes("*")) {
40
- return ALL_TENANTS;
41
- }
42
- return additionallyAllowedTenants;
43
- }
44
- //# sourceMappingURL=tenantIdUtils.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"tenantIdUtils.js","sourceRoot":"","sources":["../../../../../identity/src/util/tenantIdUtils.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EAAE,WAAW,EAAE,uBAAuB,EAAE,MAAM,cAAc,CAAC;AAEpE,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AACxC,OAAO,EAAE,yBAAyB,EAAE,MAAM,6BAA6B,CAAC;AAExE;;GAEG;AACH,MAAM,UAAU,aAAa,CAAC,MAAwB,EAAE,QAAgB;IACtE,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,kBAAkB,CAAC,EAAE,CAAC;QACxC,MAAM,KAAK,GAAG,IAAI,KAAK,CACrB,4KAA4K,CAC7K,CAAC;QACF,MAAM,CAAC,IAAI,CAAC,WAAW,CAAC,EAAE,EAAE,KAAK,CAAC,CAAC,CAAC;QACpC,MAAM,KAAK,CAAC;IACd,CAAC;AACH,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,eAAe,CAC7B,MAAwB,EACxB,QAAiB,EACjB,QAAiB;IAEjB,IAAI,QAAQ,EAAE,CAAC;QACb,aAAa,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;QAChC,OAAO,QAAQ,CAAC;IAClB,CAAC;IACD,IAAI,CAAC,QAAQ,EAAE,CAAC;QACd,QAAQ,GAAG,uBAAuB,CAAC;IACrC,CAAC;IACD,IAAI,QAAQ,KAAK,uBAAuB,EAAE,CAAC;QACzC,OAAO,QAAQ,CAAC;IAClB,CAAC;IACD,OAAO,eAAe,CAAC;AACzB,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,mCAAmC,CACjD,0BAAqC;IAErC,IAAI,CAAC,0BAA0B,IAAI,0BAA0B,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QAC3E,OAAO,EAAE,CAAC;IACZ,CAAC;IAED,IAAI,0BAA0B,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAC;QAC7C,OAAO,WAAW,CAAC;IACrB,CAAC;IAED,OAAO,0BAA0B,CAAC;AACpC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { ALL_TENANTS, DeveloperSignOnClientId } from \"../constants\";\nimport type { CredentialLogger } from \"./logging\";\nimport { formatError } from \"./logging\";\nexport { processMultiTenantRequest } from \"./processMultiTenantRequest\";\n\n/**\n * @internal\n */\nexport function checkTenantId(logger: CredentialLogger, tenantId: string): void {\n if (!tenantId.match(/^[0-9a-zA-Z-.]+$/)) {\n const error = new Error(\n \"Invalid tenant id provided. You can locate your tenant id by following the instructions listed here: https://learn.microsoft.com/partner-center/find-ids-and-domain-names.\",\n );\n logger.info(formatError(\"\", error));\n throw error;\n }\n}\n\n/**\n * @internal\n */\nexport function resolveTenantId(\n logger: CredentialLogger,\n tenantId?: string,\n clientId?: string,\n): string {\n if (tenantId) {\n checkTenantId(logger, tenantId);\n return tenantId;\n }\n if (!clientId) {\n clientId = DeveloperSignOnClientId;\n }\n if (clientId !== DeveloperSignOnClientId) {\n return \"common\";\n }\n return \"organizations\";\n}\n\n/**\n * @internal\n */\nexport function resolveAdditionallyAllowedTenantIds(\n additionallyAllowedTenants?: string[],\n): string[] {\n if (!additionallyAllowedTenants || additionallyAllowedTenants.length === 0) {\n return [];\n }\n\n if (additionallyAllowedTenants.includes(\"*\")) {\n return ALL_TENANTS;\n }\n\n return additionallyAllowedTenants;\n}\n"]}
@@ -1,14 +0,0 @@
1
- // Copyright (c) Microsoft Corporation.
2
- // Licensed under the MIT License.
3
- import { SDK_VERSION } from "../constants";
4
- import { createTracingClient } from "@azure/core-tracing";
5
- /**
6
- * Creates a span using the global tracer.
7
- * @internal
8
- */
9
- export const tracingClient = createTracingClient({
10
- namespace: "Microsoft.AAD",
11
- packageName: "@azure/identity",
12
- packageVersion: SDK_VERSION,
13
- });
14
- //# sourceMappingURL=tracing.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"tracing.js","sourceRoot":"","sources":["../../../../../identity/src/util/tracing.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAC3C,OAAO,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAE1D;;;GAGG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG,mBAAmB,CAAC;IAC/C,SAAS,EAAE,eAAe;IAC1B,WAAW,EAAE,iBAAiB;IAC9B,cAAc,EAAE,WAAW;CAC5B,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { SDK_VERSION } from \"../constants\";\nimport { createTracingClient } from \"@azure/core-tracing\";\n\n/**\n * Creates a span using the global tracer.\n * @internal\n */\nexport const tracingClient = createTracingClient({\n namespace: \"Microsoft.AAD\",\n packageName: \"@azure/identity\",\n packageVersion: SDK_VERSION,\n});\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAIlC,OAAO,EAAE,4BAA4B,EAAE,MAAM,YAAY,CAAC;AAE1D;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAEH,MAAM,CAAC,MAAM,sBAAsB,GAAmB,CAAC,OAAO,EAAE,EAAE;IAChE,MAAM,EAAE,kBAAkB,EAAE,GAAG,OAA6B,CAAC;IAE7D,kBAAkB,CAAC,cAAc,CAAC,4BAA4B,CAAC,CAAC;AAClE,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type { AzurePluginContext } from \"../../identity/src/plugins/provider\";\nimport type { IdentityPlugin } from \"@azure/identity\";\nimport { createPersistenceCachePlugin } from \"./provider\";\n\n/**\n * A plugin that provides persistent token caching for `@azure/identity`\n * credentials. The plugin API is compatible with `@azure/identity` versions\n * 2.0.0 and later. Load this plugin using the `useIdentityPlugin`\n * function, imported from `@azure/identity`.\n *\n * In order to enable this functionality, you must also pass\n * `tokenCachePersistenceOptions` to your credential constructors with an\n * `enabled` property set to true.\n *\n * Example:\n *\n * ```ts snippet:device_code_credential_example\n * import { DeviceCodeCredential } from \"@azure/identity\";\n *\n * const credential = new DeviceCodeCredential({\n * tokenCachePersistenceOptions: {\n * enabled: true,\n * },\n * });\n * // We'll use the Microsoft Graph scope as an example\n * const scope = \"https://graph.microsoft.com/.default\";\n * // Print out part of the access token\n * console.log((await credential.getToken(scope)).token.substring(0, 10), \"...\");\n * ```\n */\n\nexport const cachePersistencePlugin: IdentityPlugin = (context) => {\n const { cachePluginControl } = context as AzurePluginContext;\n\n cachePluginControl.setPersistence(createPersistenceCachePlugin);\n};\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"platforms.js","sourceRoot":"","sources":["../../../src/platforms.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;;;AAEl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AW,CAAC,IAAI,EAAE,CAAC;YACzB,OAAO,WAAW,CAAC;QACrB,CAAC;QAAC,OAAO,CAAM,EAAE,CAAC;YAChB,4DAA4D;YAC5D,sFAAsF;YACtF,IAAI,CAAC,6BAA6B,EAAE,CAAC;gBACnC,MAAM,IAAI,KAAK,CAAC,qDAAqD,CAAC,CAAC;YACzE,CAAC;YACD,OAAO,eAAe,CAAC,MAAM,CAAC,eAAe,CAAC,CAAC;QACjD,CAAC;IACH,CAAC,CAAA;CACF,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\n/* eslint-disable tsdoc/syntax */\n\nimport * as path from \"path\";\nimport type { IPersistence as Persistence } from \"@azure/msal-node-extensions\";\nimport {\n DataProtectionScope,\n FilePersistence,\n FilePersistenceWithDataProtection,\n KeychainPersistence,\n LibSecretPersistence,\n} from \"@azure/msal-node-extensions\";\nimport type { TokenCachePersistenceOptions } from \"@azure/identity\";\n\n/**\n * Local application data folder\n * Expected values:\n * - Darwin: '/Users/user/'\n * - Windows 8+: 'C:\\Users\\user\\AppData\\Local'\n * - Linux: '/home/user/.local/share'\n * @internal\n */\nconst localApplicationDataFolder =\n process.env.APPDATA?.replace?.(/(.Roaming)*$/, \"\\\\Local\") ?? process.env.HOME!;\n\n/**\n * Dictionary of values that we use as default as we discover, pick and enable the persistence layer.\n * @internal\n */\nexport const defaultMsalValues = {\n tokenCache: {\n name: \"msal.cache\",\n // Expected values:\n // - Darwin: '/Users/user/.IdentityService'\n // - Windows 8+: 'C:\\Users\\user\\AppData\\Local\\.IdentityService'\n // - Linux: '/home/user/.IdentityService'\n directory: path.join(localApplicationDataFolder, \".IdentityService\"),\n },\n keyRing: {\n label: \"MSALCache\",\n schema: \"msal.cache\",\n collection: \"default\",\n attributes: {\n MsalClientID: \"Microsoft.Developer.IdentityService\",\n \"Microsoft.Developer.IdentityService\": \"1.0.0.0\",\n },\n service: \"Microsoft.Developer.IdentityService\",\n account: \"MSALCache\",\n },\n keyChain: {\n service: \"Microsoft.Developer.IdentityService\",\n account: \"MSALCache\",\n },\n};\n\n/**\n * Options that are used by the underlying MSAL cache provider.\n * @internal\n */\nexport type MsalPersistenceOptions = Omit<TokenCachePersistenceOptions, \"enabled\">;\n\n/**\n * A function that returns a persistent token cache instance.\n * @internal\n */\ntype MsalPersistenceFactory = (options?: MsalPersistenceOptions) => Promise<Persistence>;\n\n/**\n * Expected responses:\n * - Darwin: '/Users/user/.IdentityService/<name>'\n * - Windows 8+: 'C:\\Users\\user\\AppData\\Local\\.IdentityService\\<name>'\n * - Linux: '/home/user/.IdentityService/<name>'\n * @internal\n */\nfunction getPersistencePath(name: string): string {\n return path.join(defaultMsalValues.tokenCache.directory, name);\n}\n\n/**\n * Set of the platforms we attempt to deliver persistence on.\n *\n * - On Windows we use DPAPI.\n * - On OSX (Darwin), we try to use the system's Keychain, otherwise if the property `unsafeAllowUnencryptedStorage` is set to true, we use an unencrypted file.\n * - On Linux, we try to use the system's Keyring, otherwise if the property `unsafeAllowUnencryptedStorage` is set to true, we use an unencrypted file.\n *\n * Other platforms _are not supported_ at this time.\n *\n * @internal\n */\nexport const msalPersistencePlatforms: Partial<Record<NodeJS.Platform, MsalPersistenceFactory>> = {\n win32: ({ name = defaultMsalValues.tokenCache.name } = {}): Promise<Persistence> =>\n FilePersistenceWithDataProtection.create(\n getPersistencePath(name),\n DataProtectionScope.CurrentUser,\n ),\n\n darwin: async (options: MsalPersistenceOptions = {}): Promise<Persistence> => {\n const { name, unsafeAllowUnencryptedStorage } = options;\n const { service, account } = defaultMsalValues.keyChain;\n const persistencePath = getPersistencePath(name || defaultMsalValues.tokenCache.name);\n\n try {\n const persistence = await KeychainPersistence.create(persistencePath, service, account);\n // If we don't encounter an error when trying to read from the keychain, then we should be good to go.\n await persistence.load();\n return persistence;\n } catch (e: any) {\n // If we got an error while trying to read from the keyring,\n // we will proceed only if the user has specified that unencrypted storage is allowed.\n if (!unsafeAllowUnencryptedStorage) {\n throw new Error(\"Unable to read from the macOS Keychain.\");\n }\n return FilePersistence.create(persistencePath);\n }\n },\n\n linux: async (options: MsalPersistenceOptions = {}): Promise<Persistence> => {\n const { name, unsafeAllowUnencryptedStorage } = options;\n const { service, account } = defaultMsalValues.keyRing;\n const persistencePath = getPersistencePath(name || defaultMsalValues.tokenCache.name);\n\n try {\n const persistence = await LibSecretPersistence.create(persistencePath, service, account);\n // If we don't encounter an error when trying to read from the keyring, then we should be good to go.\n await persistence.load();\n return persistence;\n } catch (e: any) {\n // If we got an error while trying to read from the keyring,\n // we will proceed only if the user has specified that unencrypted storage is allowed.\n if (!unsafeAllowUnencryptedStorage) {\n throw new Error(\"Unable to read from the system keyring (libsecret).\");\n }\n return FilePersistence.create(persistencePath);\n }\n },\n};\n"]}