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

govc: extend the functionality with GetDefaultDomains and SetDefaultDomains methods (idp package) #3023

Closed
abonat opened this issue Jan 5, 2023 · 1 comment · Fixed by #3025

Comments

@abonat
Copy link

abonat commented Jan 5, 2023

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

So:
Need to extend govc functionality with GetDefaultDomains and SetDefaultDomains methods in the proper way

Looking into the details (the solution):

The structure does not exist in govmomi - https://github.com/vmware/govmomi/blob/master/ssoadmin/types/types.go
The request and response types are also undefined.
The methods are undefined - https://github.com/vmware/govmomi/blob/master/ssoadmin/methods/methods.go
The methods are missing from ssoadmin client - https://github.com/vmware/govmomi/blob/master/ssoadmin/client.go

Currently there is only sso/idp/ls.go which lists SSO identity provider sources and it's all about the written functionality connected the identity provider sources topic.

So my 'Charles' tool said the current Powershell implementation of the same does it with IdS_getDefaultDomains and IdS_setDefaultDomains soap methods.

An then can define the missing code here, so:
I achieved:

abo@mitac:~/Code/AAA/govmomi/govc$ go run . sso.idp.default.ls
Default identity provider source(s): corp.lozzz
abo@mitac:~/Code/AAA/govmomi/govc$ go run . sso.idp.ls
Name          Server URL                        Type             Domain         Alias
-             -                                 System Domain    vsphere.local  
-             -                                 Local OS         dafak          
corp.local    ldap://powershell.corp.local:389  ActiveDirectory  corp.local     SAPHEC
corp.locala   ldap://powershell.corp.local:389  ActiveDirectory  corp.locala    
corp.localo   ldap://powershell.corp.local:389  ActiveDirectory  corp.localo    
corp.localzz  ldap://powershell.corp.local:389  ActiveDirectory  corp.localzz   SAPHEC7
corp.lozzz    ldap://powershell.corp.local:389  ActiveDirectory  corp.lozzz     corp.lozzz
corp.localz   ldap://powershell.corp.local:389  ActiveDirectory  corp.localz    SAPHEC5
abo@mitac:~/Code/AAA/govmomi/govc$ go run . sso.idp.default.update corp.local
abo@mitac:~/Code/AAA/govmomi/govc$ go run . sso.idp.default.ls
Default identity provider source(s): corp.local
abo@mitac:~/Code/AAA/govmomi/govc$ go run . sso.idp.default.update corp.local
abo@mitac:~/Code/AAA/govmomi/govc$ go run . sso.idp.default.update corpppp
/tmp/go-build2717430019/b001/exe/govc: ServerFaultCode: Domain 'Identity Provider 'corpppp' does not exist.' does not exist.
exit status 1

The PR will be also provided.

@github-actions
Copy link
Contributor

github-actions bot commented Jan 5, 2023

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 Jan 5, 2023
abonat pushed a commit to abonat/govmomi that referenced this issue Jan 5, 2023
abonat pushed a commit to abonat/govmomi that referenced this issue Jan 5, 2023
abonat pushed a commit to abonat/govmomi that referenced this issue Jan 5, 2023
abonat pushed a commit to abonat/govmomi that referenced this issue Jan 5, 2023
abonat pushed a commit to abonat/govmomi that referenced this issue Jan 9, 2023
abonat pushed a commit to abonat/govmomi that referenced this issue Jan 9, 2023
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
1 participant