File tree Expand file tree Collapse file tree 9 files changed +14
-10
lines changed
AppComplianceAutomation.Autorest/custom
Functions.Autorest/custom
LabServices/LabServices.Autorest/test
SecurityInsights/SecurityInsights.Autorest/test
ServiceLinker.Autorest/custom Expand file tree Collapse file tree 9 files changed +14
-10
lines changed Original file line number Diff line number Diff line change @@ -62,7 +62,8 @@ function Get-Token {
62
62
[Microsoft.Azure.PowerShell.Cmdlets.AppComplianceAutomation.DoNotExportAttribute ()]
63
63
param ()
64
64
try {
65
- return " Bearer " + (Get-AzAccessToken ).Token
65
+ $token = . " $PSScriptRoot /../utils/Unprotect-SecureString.ps1" (Get-AzAccessToken - AsSecureString).Token
66
+ return " Bearer " + $token
66
67
}
67
68
catch {}
68
69
return " "
Original file line number Diff line number Diff line change 18
18
- Additional information about change #1
19
19
-->
20
20
## Upcoming Release
21
+ * Used ` Get-AzAccessToken -AsSecureString ` inside the ` AppComplianceAutomation ` for the plain text version is going to be deprecate in the next release.
21
22
22
23
## Version 0.1.1
23
24
* Fixed secrets exposure in example documentation.
Original file line number Diff line number Diff line change @@ -1776,7 +1776,7 @@ function GetFunctionAppStackDefinition
1776
1776
}
1777
1777
1778
1778
Write-Debug " $DEBUG_PREFIX Get AccessToken."
1779
- $token = (Get-AzAccessToken ).Token
1779
+ $token = . " $PSScriptRoot /../utils/Unprotect-SecureString.ps1 " (Get-AzAccessToken - AsSecureString ).Token
1780
1780
$headers = @ {
1781
1781
Authorization = " Bearer $token "
1782
1782
}
@@ -1814,7 +1814,7 @@ function GetFunctionAppStackDefinition
1814
1814
if ($result.StatusCode -eq 401 )
1815
1815
{
1816
1816
# Get a new access token, create new headers and retry
1817
- $token = (Get-AzAccessToken ).Token
1817
+ $token = . " $PSScriptRoot /../utils/Unprotect-SecureString.ps1 " (Get-AzAccessToken - AsSecureString ).Token
1818
1818
1819
1819
$headers = @ {
1820
1820
Authorization = " Bearer $token "
Original file line number Diff line number Diff line change 18
18
- Additional information about change #1
19
19
-->
20
20
## Upcoming Release
21
+ * Used ` Get-AzAccessToken -AsSecureString ` inside the ` Functions ` for the plain text version is going to be deprecate in the next release.
21
22
22
23
## Version 4.1.0
23
24
* Upgraded to Microsoft.Web API version 2023-12-01 [ #25347 ]
Original file line number Diff line number Diff line change @@ -120,12 +120,12 @@ function Get-CallerPreference {
120
120
121
121
function GetHeaderWithAuthToken {
122
122
123
- $authToken = Get-AzAccessToken
124
- # Write-Host $authToken
123
+ $token = . " $PSScriptRoot /../utils/Unprotect-SecureString.ps1 " ( Get-AzAccessToken - AsSecureString).Token
124
+ # Write-Host $token
125
125
126
126
$header = @ {
127
127
' Content-Type' = ' application/json'
128
- " Authorization" = " Bearer " + $authToken .Token
128
+ " Authorization" = " Bearer " + $token
129
129
" Accept" = " application/json;odata=fullmetadata"
130
130
}
131
131
Original file line number Diff line number Diff line change @@ -519,7 +519,7 @@ Function Create-ThreatIntelligenceIndicator{
519
519
# $null = $env.Add(($PSVerb+'threatIntelligenceIndicatorId'), $threatIntelligenceIndicatorId)
520
520
# $null = $env.Add(($PSVerb+'threatIntelligenceIndicatorIP'), $IP)
521
521
# }
522
- $tiToken = (Get-AzAccessToken ).Token
522
+ $tiToken = . " $PSScriptRoot /../utils/Unprotect-SecureString.ps1 " (Get-AzAccessToken - AsSecureString ).Token
523
523
$tiHeaders = @ {
524
524
Authorization = " Bearer $tiToken "
525
525
Content = ' application/json'
Original file line number Diff line number Diff line change @@ -45,9 +45,9 @@ function setupEnv() {
45
45
$env.Tenant = (Get-AzContext ).Tenant.Id
46
46
47
47
# needed for custom api call
48
- $Token = (Get-AzAccessToken ).Token
48
+ $token = . " $PSScriptRoot /../utils/Unprotect-SecureString.ps1 " (Get-AzAccessToken - AsSecureString ).Token
49
49
$Header = @ {
50
- Authorization = " Bearer $Token "
50
+ Authorization = " Bearer $token "
51
51
Content = ' application/json'
52
52
}
53
53
Original file line number Diff line number Diff line change @@ -56,7 +56,7 @@ function Set-Header {
56
56
if ($PSBoundParameters.ContainsKey (" VNetSolutionType" ) -Or $PSBoundParameters.ContainsKey (" SecretStoreKeyVaultId" ) `
57
57
-Or $provider -eq " microsoft.keyvault" -Or $resourceType -eq " flexibleservers" ) {
58
58
if (-Not $PSBoundParameters.ContainsKey (' XmsServiceconnectorUserToken' )){
59
- $PSBoundParameters [' XmsServiceconnectorUserToken' ] = (Get-AzAccessToken ).Token
59
+ $PSBoundParameters [' XmsServiceconnectorUserToken' ] = . " $PSScriptRoot /../utils/Unprotect-SecureString.ps1 " (Get-AzAccessToken - AsSecureString ).Token
60
60
}
61
61
}
62
62
}
Original file line number Diff line number Diff line change 18
18
- Additional information about change #1
19
19
-->
20
20
## Upcoming Release
21
+ * Used ` Get-AzAccessToken -AsSecureString ` inside the ` ServiceLinker ` for the plain text version is going to be deprecate in the next release.
21
22
22
23
## Version 0.2.1
23
24
* Introduced secrets detection feature to safeguard sensitive data.
You can’t perform that action at this time.
0 commit comments