Skip to content

Commit

Permalink
UserRADIUS: Add/Set/Remove functions and tests (#262)
Browse files Browse the repository at this point in the history

---------

Co-authored-by: Cédric Moreau <[email protected]>
  • Loading branch information
CedricMoreau and Cédric Moreau authored Sep 17, 2024
1 parent 430e268 commit a12a88c
Show file tree
Hide file tree
Showing 4 changed files with 833 additions and 0 deletions.
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

0 comments on commit a12a88c

Please sign in to comment.