Skip to content

Commit

Permalink
UserLDAP: Add/Set/Remove functions and tests (#259)
Browse files Browse the repository at this point in the history
for LDAP Server

Co-authored-by: Cédric Moreau <[email protected]>
  • Loading branch information
CedricMoreau and Cédric Moreau authored Sep 13, 2024
1 parent cad2384 commit a5a3506
Show file tree
Hide file tree
Showing 4 changed files with 884 additions and 0 deletions.
49 changes: 49 additions & 0 deletions PowerFGT/Private/Confirm.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,55 @@ Function Confirm-FGTFirewallProxyPolicy {

}

Function Confirm-FGTUserLDAP {

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

#Check if it looks like a LDAP 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 secondary-server -Membertype Properties)) {
throw "Element specified does not contain a secondary-server 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 server-identity-check -Membertype Properties)) {
throw "Element specified does not contain a server-identity-check property."
}
if ( -not ( $argument | get-member -name source-ip -Membertype Properties)) {
throw "Element specified does not contain a source-ip property."
}
if ( -not ( $argument | get-member -name cnid -Membertype Properties)) {
throw "Element specified does not contain a cnid property."
}
if ( -not ( $argument | get-member -name dn -Membertype Properties)) {
throw "Element specified does not contain a dn property."
}
if ( -not ( $argument | get-member -name type -Membertype Properties)) {
throw "Element specified does not contain a type property."
}
if ( -not ( $argument | get-member -name username -Membertype Properties)) {
throw "Element specified does not contain an username property."
}
if ( -not ( $argument | get-member -name password -Membertype Properties)) {
throw "Element specified does not contain a password property."
}
if ( -not ( $argument | get-member -name secure -Membertype Properties)) {
throw "Element specified does not contain a secure property."
}
if ( -not ( $argument | get-member -name port -Membertype Properties)) {
throw "Element specified does not contain a port property."
}

$true
}

Function Confirm-FGTVip {

Param (
Expand Down
Loading

0 comments on commit a5a3506

Please sign in to comment.