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

Extend govc functionality with Get(Update)LocalPasswordPolicy methods #2975

Closed
abonat opened this issue Oct 21, 2022 · 1 comment · Fixed by #2976
Closed

Extend govc functionality with Get(Update)LocalPasswordPolicy methods #2975

abonat opened this issue Oct 21, 2022 · 1 comment · Fixed by #2976

Comments

@abonat
Copy link

abonat commented Oct 21, 2022

As an Ansible developer, I want Ansible modules to read/update the state when doing vCenter's local SSO Password Policy configuration. The Ansible module can use govc and should read, update, confirm the operation when updates local SSO Password Policy.

So:
Need to extend govc functionality with GetLocalPasswordPolicy and UpdateLocalPasswordPolicy methods in the proper way

Looking into the details (the solution):

The structure does exist in govmomi - https://github.com/vmware/govmomi/blob/master/ssoadmin/types/types.go#L318

The request and response types are also defined:
https://github.com/vmware/govmomi/blob/master/ssoadmin/types/types.go#L1219
https://github.com/vmware/govmomi/blob/master/ssoadmin/types/types.go#L1903

The methods are defined in ssoadmin:
https://github.com/vmware/govmomi/blob/master/ssoadmin/methods/methods.go#L886
https://github.com/vmware/govmomi/blob/master/ssoadmin/methods/methods.go#L1614

And the methods are missing from ssoadmin client - https://github.com/vmware/govmomi/blob/master/ssoadmin/client.go
The work to achieve the new commands is similar to #2946
The difference is that a complete new commands for govc must be created:
sso.lpp.get , sso.lpp.update - to update and set the Local Password Policy

After some coding, right now I have:

abo@vinkel:~/Code/govmomi/govc$ go run . sso.lpp.get
Description: SSS
MinLength: 0
MaxLength: 1
MinAlphabeticCount: 0
MinUppercaseCount: 0
MinLowercaseCount: 0
MinNumericCount: 0
MinSpecialCharCount: 0
MaxIdenticalAdjacentCharacters: 1
ProhibitedPreviousPasswordsCount: 1
PasswordLifetimeDays: 666
abo@vinkel:~/Code/govmomi/govc$ go run . sso.lpp.update -PasswordLifetimeDays 0
abo@vinkel:~/Code/govmomi/govc$ go run . sso.lpp.get | grep PasswordLifetimeDays
PasswordLifetimeDays: 0
@github-actions
Copy link
Contributor

Howdy 🖐   abonat ! Thank you for your interest in this project. We value your feedback and will respond soon.

If you want to contribute to this project, please make yourself familiar with the CONTRIBUTION guidelines.

abonat pushed a commit to abonat/govmomi that referenced this issue Oct 21, 2022
abonat pushed a commit to abonat/govmomi that referenced this issue Nov 16, 2022
abonat pushed a commit to abonat/govmomi that referenced this issue Nov 18, 2022
abonat pushed a commit to abonat/govmomi that referenced this issue Nov 18, 2022
priyanka19-98 pushed a commit to priyanka19-98/govmomi that referenced this issue Jan 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant