Skip to content

Commit

Permalink
UserTACACS: Get/Add/Set/Remove functions and tests (#263)
Browse files Browse the repository at this point in the history
  • Loading branch information
CedricMoreau committed Sep 16, 2024
1 parent da0d68b commit 9227b39
Show file tree
Hide file tree
Showing 4 changed files with 933 additions and 0 deletions.
42 changes: 42 additions & 0 deletions PowerFGT/Private/Confirm.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -481,6 +481,48 @@ Function Confirm-FGTUserLocal {

}

Function Confirm-FGTUserTACACS {

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

#Check if it looks like a TACACS 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 key -Membertype Properties)) {
throw "Element specified does not contain a key 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-key -Membertype Properties)) {
throw "Element specified does not contain a secondary-key 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-key -Membertype Properties)) {
throw "Element specified does not contain a tertiary-key property."
}
if ( -not ( $argument | get-member -name port -Membertype Properties)) {
throw "Element specified does not contain a port property."
}
if ( -not ( $argument | get-member -name authorization -Membertype Properties)) {
throw "Element specified does not contain a authorization property."
}
if ( -not ( $argument | get-member -name authen-type -Membertype Properties)) {
throw "Element specified does not contain a authen-type property."
}

$true
}
Function Confirm-FGTUserGroup {

Param (
Expand Down
Loading

0 comments on commit 9227b39

Please sign in to comment.