-
Notifications
You must be signed in to change notification settings - Fork 75
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: abarreiro <abarreiro@vmware.com>
- Loading branch information
abarreiro
committed
Dec 20, 2024
1 parent
150245e
commit 3214e60
Showing
2 changed files
with
86 additions
and
35 deletions.
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 |
---|---|---|
@@ -0,0 +1,51 @@ | ||
/* | ||
* Copyright 2020 VMware, Inc. All rights reserved. Licensed under the Apache v2 License. | ||
*/ | ||
|
||
package govcd | ||
|
||
import ( | ||
"fmt" | ||
"github.com/vmware/go-vcloud-director/v3/types/v56" | ||
) | ||
|
||
// TmLdapConfigure configures LDAP for the Tenant Manager "System" organization | ||
func (vcdClient *VCDClient) TmLdapConfigure(settings *types.OrgLdapSettingsType) (*types.OrgLdapSettingsType, error) { | ||
if !vcdClient.Client.IsTm() { | ||
return nil, fmt.Errorf("this method is only supported in TM") | ||
} | ||
return nil, nil | ||
} | ||
|
||
// LdapConfigure configures LDAP for the given organization | ||
func (org *TmOrg) LdapConfigure(settings *types.OrgLdapSettingsType) (*types.OrgLdapSettingsType, error) { | ||
return nil, nil | ||
} | ||
|
||
// LdapDisable wraps LdapConfigure to disable LDAP configuration for the "System" organization | ||
func (vcdClient *VCDClient) LdapDisable() error { | ||
if !vcdClient.Client.IsTm() { | ||
return fmt.Errorf("this method is only supported in TM") | ||
} | ||
_, err := vcdClient.TmLdapConfigure(&types.OrgLdapSettingsType{OrgLdapMode: types.LdapModeNone}) | ||
return err | ||
} | ||
|
||
// LdapDisable wraps LdapConfigure to disable LDAP configuration for the given organization | ||
func (org *TmOrg) LdapDisable() error { | ||
_, err := org.LdapConfigure(&types.OrgLdapSettingsType{OrgLdapMode: types.LdapModeNone}) | ||
return err | ||
} | ||
|
||
// GetLdapConfiguration retrieves LDAP configuration structure for the "System" organization | ||
func (vcdClient *VCDClient) GetLdapConfiguration() (*types.OrgLdapSettingsType, error) { | ||
if !vcdClient.Client.IsTm() { | ||
return nil, fmt.Errorf("this method is only supported in TM") | ||
} | ||
return nil, nil | ||
} | ||
|
||
// GetLdapConfiguration retrieves LDAP configuration structure of the given organization | ||
func (org *TmOrg) GetLdapConfiguration() (*types.OrgLdapSettingsType, error) { | ||
return nil, nil | ||
} |
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