コード例 #1
0
ファイル: syncgroups.go プロジェクト: frankie95667/origin
func getOpenShiftGroupListerMapper(host string, info OpenShiftGroupNameRestrictions) (interfaces.LDAPGroupListerNameMapper, error) {
	if len(info.GetWhitelist()) != 0 {
		return syncgroups.NewOpenShiftGroupLister(info.GetWhitelist(), info.GetBlacklist(), host, info.GetClient()), nil
	} else {
		return syncgroups.NewAllOpenShiftGroupLister(info.GetBlacklist(), host, info.GetClient()), nil
	}
}
コード例 #2
0
ファイル: syncgroups.go プロジェクト: Waxolunist/origin
func (o *SyncGroupsOptions) GetOpenShiftGroupListerMapper(host string) (interfaces.LDAPGroupListerNameMapper, error) {
	if o.Source != GroupSyncSourceOpenShift {
		return nil, errors.New("openshift is not a valid group source for this config")
	}

	if len(o.Whitelist) != 0 {
		return syncgroups.NewOpenShiftGroupLister(o.Whitelist, o.Blacklist, host, o.GroupInterface), nil
	}

	return syncgroups.NewAllOpenShiftGroupLister(o.Blacklist, host, o.GroupInterface), nil
}
コード例 #3
0
ファイル: syncgroups.go プロジェクト: dwdunn/origin
func (o *SyncGroupsOptions) GetGroupLister(syncBuilder SyncBuilder, clientConfig *ldaputil.LDAPClientConfig) (interfaces.LDAPGroupLister, error) {
	// if we have a whitelist, it trumps alls
	if len(o.WhitelistContents) != 0 {
		if o.Source == GroupSyncSourceOpenShift {
			return syncgroups.NewOpenShiftWhitelistGroupLister(o.WhitelistContents, o.GroupInterface), nil
		}
		return syncgroups.NewLDAPWhitelistGroupLister(o.WhitelistContents), nil
	}

	// openshift as a listing source works the same for all schemas
	if o.Source == GroupSyncSourceOpenShift {
		return syncgroups.NewAllOpenShiftGroupLister(clientConfig.Host, o.GroupInterface), nil
	}

	return syncBuilder.GetGroupLister()
}