-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add writing managed accounts feature in terraform provider
- Loading branch information
1 parent
cddb485
commit 87c0cbd
Showing
5 changed files
with
572 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,6 +5,7 @@ import ( | |
"time" | ||
|
||
"github.com/BeyondTrust/go-client-library-passwordsafe/api/authentication" | ||
"github.com/BeyondTrust/go-client-library-passwordsafe/api/entities" | ||
logging "github.com/BeyondTrust/go-client-library-passwordsafe/api/logging" | ||
managed_accounts "github.com/BeyondTrust/go-client-library-passwordsafe/api/managed_account" | ||
"github.com/BeyondTrust/go-client-library-passwordsafe/api/secrets" | ||
|
@@ -112,6 +113,51 @@ func main() { | |
// WARNING: Do not log secrets in production code, the following log statement logs test secrets for testing purposes: | ||
zapLogger.Warn(fmt.Sprintf("%v", gotManagedAccount)) | ||
|
||
account := entities.AccountDetails{ | ||
AccountName: "ManagedAccountTest", | ||
Password: "Passw0rd101!*", | ||
DomainName: "exampleDomain", | ||
UserPrincipalName: "[email protected]", | ||
SAMAccountName: "samAccount", | ||
DistinguishedName: "CN=example,CN=Users,DC=domain,DC=com", | ||
PrivateKey: "privateKey", | ||
Passphrase: "passphrase", | ||
PasswordFallbackFlag: true, | ||
LoginAccountFlag: false, | ||
Description: "Sample account for testing", | ||
ApiEnabled: true, | ||
ReleaseNotificationEmail: "[email protected]", | ||
ChangeServicesFlag: false, | ||
RestartServicesFlag: false, | ||
ChangeTasksFlag: true, | ||
MaxReleaseDuration: 300000, | ||
ISAReleaseDuration: 180, | ||
MaxConcurrentRequests: 5, | ||
AutoManagementFlag: false, | ||
DSSAutoManagementFlag: false, | ||
CheckPasswordFlag: true, | ||
ResetPasswordOnMismatchFlag: false, | ||
ChangePasswordAfterAnyReleaseFlag: true, | ||
ChangeFrequencyDays: 1, | ||
ChangeTime: "", | ||
NextChangeDate: "2023-12-01", | ||
UseOwnCredentials: true, | ||
ChangeWindowsAutoLogonFlag: true, | ||
ChangeComPlusFlag: false, | ||
ObjectID: "uniqueObjectID", | ||
} | ||
|
||
// creating a managed account in system_integration_test system. | ||
createResponse, err := manageAccountObj.ManageAccountCreateFlow("system_integration_test", account) | ||
|
||
if err != nil { | ||
zapLogger.Error(fmt.Sprintf(" %v", err)) | ||
return | ||
} | ||
|
||
// WARNING: created managed account name. | ||
zapLogger.Warn(fmt.Sprintf("Created Managed Account: %v", createResponse.AccountName)) | ||
|
||
// signing out | ||
_ = authenticate.SignOut() | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.