Skip to content

Commit 203ad64

Browse files
committed
fix HIBP auth
1 parent ee0f5b7 commit 203ad64

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

Modules/CippExtensions/Public/Extension Functions/Set-ExtensionAPIKey.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ function Set-ExtensionAPIKey {
2929
$null = Set-AzContext -SubscriptionId $SubscriptionId
3030
$null = Set-AzKeyVaultSecret -VaultName $keyvaultname -Name $Extension -SecretValue (ConvertTo-SecureString -AsPlainText -Force -String $APIKey)
3131
}
32-
Set-Item -Path "ENV:$Var" -Value $APIKey -Force -ErrorAction SilentlyContinue
32+
Set-Item -Path "env:$Var" -Value $APIKey -Force -ErrorAction SilentlyContinue
3333
}
3434
return $true
3535
}

Modules/CippExtensions/Public/HIBP/Get-HIBPAuth.ps1

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
function Get-HIBPAuth {
22
$Var = 'Ext_HIBP'
3-
$APIKey = Get-Item -Path "ENV:$Var" -ErrorAction SilentlyContinue | Select-Object -ExpandProperty Value
3+
$APIKey = Get-Item -Path "env:$Var" -ErrorAction SilentlyContinue | Select-Object -ExpandProperty Value
44
if ($APIKey) {
55
Write-Information 'Using cached API Key for HIBP'
6+
$Secret = $APIKey
67
} else {
78
if ($env:AzureWebJobsStorage -eq 'UseDevelopmentStorage=true') {
89
$DevSecretsTable = Get-CIPPTable -tablename 'DevSecrets'
@@ -27,7 +28,7 @@ function Get-HIBPAuth {
2728
$Secret = Get-AzKeyVaultSecret -VaultName $VaultName -Name 'HIBP' -AsPlainText
2829
}
2930
}
30-
Set-Item -Path "ENV:$Var" -Value $APIKey -Force -ErrorAction SilentlyContinue
31+
Set-Item -Path "env:$Var" -Value $APIKey -Force -ErrorAction SilentlyContinue
3132
}
3233

3334
return @{

0 commit comments

Comments
 (0)