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

UserTACACS: Get/Add/Set/Remove functions and tests #263

Merged
merged 18 commits into from
Sep 16, 2024
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