Skip to content

Commit 411039d

Browse files
Address delayed release review findings
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
1 parent 7127901 commit 411039d

8 files changed

Lines changed: 21 additions & 10 deletions

src/functions/private/Auth/Test-DomeneshopContextName.ps1

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,10 @@ function Test-DomeneshopContextName {
3333
[string] $Context
3434
)
3535

36+
if ([string]::IsNullOrWhiteSpace($Context)) {
37+
throw 'Context name cannot be empty or whitespace.'
38+
}
39+
3640
if ($Context -eq '__Domeneshop.Config') {
3741
throw "Context name [$Context] is reserved for Domeneshop module configuration."
3842
}

src/functions/public/Dns/Get-DomeneshopDnsRecord.ps1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ function Get-DomeneshopDnsRecord {
2222
You can't pipe objects to Get-DomeneshopDnsRecord.
2323
2424
.OUTPUTS
25-
System.Object[]
25+
System.Object
2626
2727
The matching Domeneshop DNS records.
2828
@@ -32,7 +32,7 @@ function Get-DomeneshopDnsRecord {
3232
.LINK
3333
https://api.domeneshop.no/docs/
3434
#>
35-
[OutputType([object[]])]
35+
[OutputType([object])]
3636
[CmdletBinding(DefaultParameterSetName = 'List')]
3737
param(
3838
# The numeric identifier of the domain that owns the records.

src/functions/public/Domains/Get-DomeneshopDomain.ps1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ function Get-DomeneshopDomain {
2020
You can't pipe objects to Get-DomeneshopDomain.
2121
2222
.OUTPUTS
23-
System.Object[]
23+
System.Object
2424
2525
The matching Domeneshop domain records.
2626
@@ -30,7 +30,7 @@ function Get-DomeneshopDomain {
3030
.LINK
3131
https://api.domeneshop.no/docs/
3232
#>
33-
[OutputType([object[]])]
33+
[OutputType([object])]
3434
[CmdletBinding(DefaultParameterSetName = 'List')]
3535
param(
3636
# A domain-name filter for list requests.

src/functions/public/Forwards/Add-DomeneshopForward.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ function Add-DomeneshopForward {
99
.EXAMPLE
1010
$forward = @{
1111
host = 'www'
12-
('URL'.ToLowerInvariant()) = [uri]::new('HTTPS'.ToLowerInvariant() + '://example.net')
12+
('URL'.ToLowerInvariant()) = 'HTTPS'.ToLowerInvariant() + '://example.net'
1313
}
1414
Add-DomeneshopForward -DomainID 42 -Forward $forward
1515

src/functions/public/Forwards/Get-DomeneshopForward.ps1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ function Get-DomeneshopForward {
2222
You can't pipe objects to Get-DomeneshopForward.
2323
2424
.OUTPUTS
25-
System.Object[]
25+
System.Object
2626
2727
The matching Domeneshop HTTP forwards.
2828
@@ -32,7 +32,7 @@ function Get-DomeneshopForward {
3232
.LINK
3333
https://api.domeneshop.no/docs/
3434
#>
35-
[OutputType([object[]])]
35+
[OutputType([object])]
3636
[CmdletBinding(DefaultParameterSetName = 'List')]
3737
param(
3838
# The numeric identifier of the domain that owns the forwards.

src/functions/public/Forwards/Set-DomeneshopForward.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ function Set-DomeneshopForward {
99
.EXAMPLE
1010
$forward = @{
1111
host = 'www'
12-
('URL'.ToLowerInvariant()) = [uri]::new('HTTPS'.ToLowerInvariant() + '://example.org')
12+
('URL'.ToLowerInvariant()) = 'HTTPS'.ToLowerInvariant() + '://example.org'
1313
}
1414
Set-DomeneshopForward -DomainID 42 -ForwardHost 'www' -Forward $forward
1515

src/functions/public/Invoices/Get-DomeneshopInvoice.ps1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ function Get-DomeneshopInvoice {
2222
You can't pipe objects to Get-DomeneshopInvoice.
2323
2424
.OUTPUTS
25-
System.Object[]
25+
System.Object
2626
2727
The matching Domeneshop invoices.
2828
@@ -32,7 +32,7 @@ function Get-DomeneshopInvoice {
3232
.LINK
3333
https://api.domeneshop.no/docs/
3434
#>
35-
[OutputType([object[]])]
35+
[OutputType([object])]
3636
[CmdletBinding(DefaultParameterSetName = 'List')]
3737
param(
3838
# The numeric identifier of a specific invoice.

tests/Connect-DomeneshopAccount.Tests.ps1

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,4 +102,11 @@ Describe 'Connect-DomeneshopAccount' {
102102

103103
Should -Invoke Set-Context -Times 0 -Exactly
104104
}
105+
106+
It 'rejects a whitespace-only context name' {
107+
{ Connect-DomeneshopAccount -Token 'token' -Secret 'secret' -Context ' ' } |
108+
Should -Throw '*Context name cannot be empty or whitespace*'
109+
110+
Should -Invoke Set-Context -Times 0 -Exactly
111+
}
105112
}

0 commit comments

Comments
 (0)