Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UserRADIUS: Add/Set/Remove functions and tests #262

Merged
merged 25 commits into from
Sep 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 43 additions & 0 deletions PowerFGT/Private/Confirm.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -386,6 +386,49 @@ Function Confirm-FGTInterface {
$true
}

Function Confirm-FGTUserRADIUS {

Param (
[Parameter (Mandatory = $true)]
[object]$argument
)

#Check if it looks like a RADIUS Server element

if ( -not ( $argument | get-member -name name -Membertype Properties)) {
throw "Element specified does not contain a name property."
}
if ( -not ( $argument | get-member -name server -Membertype Properties)) {
throw "Element specified does not contain a server property."
}
if ( -not ( $argument | get-member -name secret -Membertype Properties)) {
throw "Element specified does not contain a secret property."
}
if ( -not ( $argument | get-member -name secondary-server -Membertype Properties)) {
throw "Element specified does not contain a secondary-server property."
}
if ( -not ( $argument | get-member -name secondary-secret -Membertype Properties)) {
throw "Element specified does not contain a secondary-secret property."
}
if ( -not ( $argument | get-member -name tertiary-server -Membertype Properties)) {
throw "Element specified does not contain a tertiary-server property."
}
if ( -not ( $argument | get-member -name tertiary-secret -Membertype Properties)) {
throw "Element specified does not contain a tertiary-secret property."
}
if ( -not ( $argument | get-member -name timeout -Membertype Properties)) {
throw "Element specified does not contain a timeout property."
}
if ( -not ( $argument | get-member -name nas-ip -Membertype Properties)) {
throw "Element specified does not contain a nas-ip property."
}
if ( -not ( $argument | get-member -name auth-type -Membertype Properties)) {
throw "Element specified does not contain an auth-type property."
}

$true
}

Function Confirm-FGTVpnIpsecPhase1Interface {

Param (
Expand Down
Loading