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 RegisterLdap, UpdateLdap and UpdateLdapAuthnType methods #3057

Closed
abonat opened this issue Mar 7, 2023 · 1 comment · Fixed by #3058
Closed

Comments

@abonat
Copy link

abonat commented Mar 7, 2023

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

So:
Need to in the proper way

Looking into the details (the solution):

The structures like:

  • RegisterLdapRequestType,
  • RegisterLdapResponse,
  • SsoAdminIdentitySourceManagementServiceAuthenticationCredentails
  • UpdateLdapRequestType,
  • UpdateLdapAuthnTypeRequestType,
  • UpdateLdapAuthnTypeResponse

do not exist in govmomi - https://github.com/vmware/govmomi/blob/master/ssoadmin/types/types.go

The methods like:

  • RegisterLdap
  • UpdateLdap
  • UpdateLdapAuthnType

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 read their details.

So my 'Charles' tool said the current Powershell implementation of the same does it with these soap methods.
And this web debugging proxy also shows the structures of the requests.

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

abo@mitac:~/Code/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      CLOUD
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    CLOUD7
corp.lozzz    ldap://powershell.corp.local:389  ActiveDirectory  corp.lozzz     corp.lozzz
corp.localz   ldap://powershell.corp.local:389  ActiveDirectory  corp.localz     CLOUD5
corp.locasss  ldap://powershell.corp.local:389  ActiveDirectory  corp.locasss
abo@mitac:~/Code/govmomi/govc$
abo@mitac:~/Code/govmomi/govc$ go run . sso.idp.ldap.update -FriendlyName  CLOUD55 -UserBaseDn DC=corp,DC=local -GroupBaseDn DC=corp,DC=local -PrimaryUrl ldap://powershell.corp.local:389 -AuthUsername administrator@corp.local -AuthPassword *** corp.test
abo@mitac:~/Code/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      CLOUD
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    CLOUD7
corp.lozzz    ldap://powershell.corp.local:389  ActiveDirectory  corp.lozzz     corp.lozzz
corp.localz   ldap://powershell.corp.local:389  ActiveDirectory  corp.localz     CLOUD5
corp.test     ldap://powershell.corp.local:389  ActiveDirectory  corp.test
corp.locasss  ldap://powershell.corp.local:389  ActiveDirectory  corp.locasss

As json, it looks like:

{
        "Name": "corp.test",
        "Domains": [
          {
            "Name": "corp.test",
            "Alias": ""
          }
        ],
        "Type": "ActiveDirectory",
        "Details": {
          "FriendlyName": " CLOUD55",
          "UserBaseDn": "DC=corp,DC=local",
          "GroupBaseDn": "DC=corp,DC=local",
          "PrimaryURL": "ldap://powershell.corp.local:389",
          "FailoverURL": ""
        },
        "AuthenticationDetails": {
          "AuthenticationType": "PASSWORD",
          "Username": "administrator@corp.local"
        }
      },

The PR will be also provided.

@github-actions
Copy link
Contributor

github-actions bot commented Mar 7, 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 Mar 7, 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
Development

Successfully merging a pull request may close this issue.

1 participant