// PrivilegeKeyList returns a list of available privilege keys for the selected server,
// including their type and group IDs.
432884
func (s *ServerMethods) PrivilegeKeyList() ([]*PrivilegeKey, error) {
	var keys []*PrivilegeKey
	if _, err := s.ExecCmd(NewCmd("privilegekeylist").WithResponse(&keys)); err != nil {
		return nil, err
	}

	return keys, nil
}
98741
func (cs *CryptoService) ListAllKeys() map[string]data.RoleName {
	res := make(map[string]data.RoleName)
	for _, ks := range cs.keyStores {
		for k, r := range ks.ListKeys() {
			res[k] = r.Role // keys are content addressed so don't care about overwrites
		}
	}
	return res
}
172802
func (s *DomainsService) ListDelegationSignerRecords(accountID string, domainIdentifier string, options *ListOptions) (*delegationSignerRecordsResponse, error) {
	path := versioned(delegationSignerRecordPath(accountID, domainIdentifier, 0))
	dsRecordsResponse := &delegationSignerRecordsResponse{}

	path, err := addURLQueryOptions(path, options)
	if err != nil {
		return nil, err
	}

	resp, err := s.client.get(path, dsRecordsResponse)
	if err != nil {
		return nil, err
	}

	dsRecordsResponse.HttpResponse = resp
	return dsRecordsResponse, nil
}
663932
func (api *KeyManagerAPI) ListKeys(arg params.ListSSHKeys) (params.StringsResults, error) {
	if len(arg.Entities.Entities) == 0 {
		return params.StringsResults{}, nil
	}
	results := make([]params.StringsResult, len(arg.Entities.Entities))

	// For now, authorised keys are global, common to all users.
	var keyInfo []string
	cfg, configErr := api.model.ModelConfig()
	if configErr == nil {
		keys := ssh.SplitAuthorisedKeys(cfg.AuthorizedKeys())
		keyInfo = parseKeys(keys, arg.Mode)
	}

	for i, entity := range arg.Entities.Entities {
		// NOTE: entity.Tag isn't a tag, but a username.
		if err := api.checkCanRead(entity.Tag); err != nil {
			results[i].Error = common.ServerError(err)
			continue
		}
		// All keys are global, no need to look up the user.
		if configErr == nil {
			results[i].Result = keyInfo
		}
		results[i].Error = common.ServerError(configErr)
	}
	return params.StringsResults{Results: results}, nil
}
536326
func (k *KeyPairsClient) List(ctx context.Context, orgID *identity.ID) (*Keypairs, error) {
	query := &url.Values{}
	if orgID != nil {
		query.Set("org_id", orgID.String())
	}

	var resp []ClaimedKeyPair
	err := k.client.RoundTrip(ctx, "GET", "/keypairs", query, nil, &resp)
	if err != nil {
		return nil, err
	}

	kp := NewKeypairs()
	err = kp.Add(resp...)
	if err != nil {
		return nil, err
	}

	return kp, nil
}
542716
func (r *repository) pubKeyListForRotation(role data.RoleName, serverManaged bool, newKeys []string) (pubKeyList data.KeyList, err error) {
	var pubKey data.PublicKey

	// If server manages the key being rotated, request a rotation and return the new key
	if serverManaged {
		remote := r.getRemoteStore()
		pubKey, err = rotateRemoteKey(role, remote)
		pubKeyList = make(data.KeyList, 0, 1)
		pubKeyList = append(pubKeyList, pubKey)
		if err != nil {
			return nil, fmt.Errorf("unable to rotate remote key: %s", err)
		}
		return pubKeyList, nil
	}

	// If no new keys are passed in, we generate one
	if len(newKeys) == 0 {
		pubKeyList = make(data.KeyList, 0, 1)
		pubKey, err = r.GetCryptoService().Create(role, r.gun, data.ECDSAKey)
		pubKeyList = append(pubKeyList, pubKey)
	}
	if err != nil {
		return nil, fmt.Errorf("unable to generate key: %s", err)
	}

	// If a list of keys to rotate to are provided, we add those
	if len(newKeys) > 0 {
		pubKeyList = make(data.KeyList, 0, len(newKeys))
		for _, keyID := range newKeys {
			pubKey = r.GetCryptoService().GetKey(keyID)
			if pubKey == nil {
				return nil, fmt.Errorf("unable to find key: %s", keyID)
			}
			pubKeyList = append(pubKeyList, pubKey)
		}
	}

	// Convert to certs (for root keys)
	if pubKeyList, err = r.pubKeysToCerts(role, pubKeyList); err != nil {
		return nil, err
	}

	return pubKeyList, nil
}
901465
func (sc *serverConn) authList() (string, error) {
	m := &msg{
		header: header{
			Op: opAuthList,
		},
	}

	err := sc.sendRecv(m)
	return m.val, err
}
114514
func (c *identities) List(opts v1.ListOptions) (result *user.IdentityList, err error) {
	var timeout time.Duration
	if opts.TimeoutSeconds != nil {
		timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
	}
	result = &user.IdentityList{}
	err = c.client.Get().
		Resource("identities").
		VersionedParams(&opts, scheme.ParameterCodec).
		Timeout(timeout).
		Do().
		Into(result)
	return
}
384956
func (api *KeyAPI) List(ctx context.Context) ([]coreiface.Key, error) {
	keys, err := api.repo.Keystore().List()
	if err != nil {
		return nil, err
	}

	sort.Strings(keys)

	out := make([]coreiface.Key, len(keys)+1)
	out[0] = &key{"self", api.identity}

	for n, k := range keys {
		privKey, err := api.repo.Keystore().Get(k)
		if err != nil {
			return nil, err
		}

		pubKey := privKey.GetPublic()

		pid, err := peer.IDFromPublicKey(pubKey)
		if err != nil {
			return nil, err
		}

		out[n+1] = &key{k, pid}
	}
	return out, nil
}
1160700
func (h Secretservice) List() (map[string]string, error) {
	credsLabelC := C.CString(credentials.CredsLabel)
	defer C.free(unsafe.Pointer(credsLabelC))

	var pathsC **C.char
	defer C.free(unsafe.Pointer(pathsC))
	var acctsC **C.char
	defer C.free(unsafe.Pointer(acctsC))
	var listLenC C.uint
	err := C.list(credsLabelC, &pathsC, &acctsC, &listLenC)
	if err != nil {
		defer C.g_error_free(err)
		return nil, errors.New("Error from list function in secretservice_linux.c likely due to error in secretservice library")
	}
	defer C.freeListData(&pathsC, listLenC)
	defer C.freeListData(&acctsC, listLenC)

	resp := make(map[string]string)

	listLen := int(listLenC)
	if listLen == 0 {
		return resp, nil
	}
	// The maximum capacity of the following two slices is limited to (2^29)-1 to remain compatible
	// with 32-bit platforms. The size of a `*C.char` (a pointer) is 4 Byte on a 32-bit system
	// and (2^29)*4 == math.MaxInt32 + 1. -- See issue golang/go#13656
	pathTmp := (*[(1 << 29) - 1]*C.char)(unsafe.Pointer(pathsC))[:listLen:listLen]
	acctTmp := (*[(1 << 29) - 1]*C.char)(unsafe.Pointer(acctsC))[:listLen:listLen]
	for i := 0; i < listLen; i++ {
		resp[C.GoString(pathTmp[i])] = C.GoString(acctTmp[i])
	}

	return resp, nil
}
206653
func (kl KeyList) UseableKeys() KeyList {
	nkl := make(KeyList, 0, len(kl))
	for _, k := range kl {
		if !k.IsUseable() {
			continue
		}
		nkl = append(nkl, k)
	}
	sort.Sort(nkl)
	return nkl
}
533384
func Convert_v1_RoleBindingList_To_authorization_RoleBindingList(in *v1.RoleBindingList, out *authorization.RoleBindingList, s conversion.Scope) error {
	return autoConvert_v1_RoleBindingList_To_authorization_RoleBindingList(in, out, s)
}
710224
func (c *Client) KeyList(lr *ListRange) ([]Key, error) {
	req, err := c.NewRequest("GET", "/account/keys", nil, nil)
	if err != nil {
		return nil, err
	}

	if lr != nil {
		lr.SetHeader(req)
	}

	var keysRes []Key
	return keysRes, c.DoReq(req, &keysRes)
}
1054211
func (ac *AuthorizationCache) List(userInfo user.Info, selector labels.Selector) (*corev1.NamespaceList, error) {
	keys := sets.String{}
	user := userInfo.GetName()
	groups := userInfo.GetGroups()

	obj, exists, _ := ac.userSubjectRecordStore.GetByKey(user)
	if exists {
		subjectRecord := obj.(*subjectRecord)
		keys.Insert(subjectRecord.namespaces.List()...)
	}

	for _, group := range groups {
		obj, exists, _ := ac.groupSubjectRecordStore.GetByKey(group)
		if exists {
			subjectRecord := obj.(*subjectRecord)
			keys.Insert(subjectRecord.namespaces.List()...)
		}
	}

	allowedNamespaces, err := scope.ScopesToVisibleNamespaces(userInfo.GetExtra()[authorizationapi.ScopesKey], ac.clusterRoleLister, true)
	if err != nil {
		return nil, err
	}

	namespaceList := &corev1.NamespaceList{}
	for _, key := range keys.List() {
		namespace, err := ac.namespaceLister.Get(key)
		if apierrors.IsNotFound(err) {
			continue
		}
		if err != nil {
			return nil, err
		}
		// only match selected labels
		if !selector.Matches(labels.Set(namespace.Labels)) {
			continue
		}
		if allowedNamespaces.Has("*") || allowedNamespaces.Has(namespace.Name) {
			namespaceList.Items = append(namespaceList.Items, *namespace)
		}
	}
	return namespaceList, nil
}
1219545
func (api *API) ListServerPrivateNetworks(server_id string) ([]Identity, error) {
	result := []Identity{}
	url := createUrl(api, serverPathSegment, server_id, "private_networks")
	err := api.Client.Get(url, &result, http.StatusOK)
	if err != nil {
		return nil, err
	}
	return result, nil
}
982867
func (g *GPG) ListPrivateKeyIDs(context.Context) ([]string, error) {
	if g.secring == nil {
		return nil, fmt.Errorf("secring is not initialized")
	}
	return listKeyIDs(g.secring), nil
}
831998
func (c *coreDNS) list(key string) ([]SrvRecord, error) {
	ctx, cancel := context.WithTimeout(context.Background(), defaultContextTimeout)
	r, err := c.etcdClient.Get(ctx, key, etcd.WithPrefix())
	defer cancel()
	if err != nil {
		return nil, err
	}
	if r.Count == 0 {
		key = strings.TrimSuffix(key, etcdPathSeparator)
		r, err = c.etcdClient.Get(ctx, key)
		if err != nil {
			return nil, err
		}
		if r.Count == 0 {
			return nil, ErrNoEntriesFound
		}
	}

	var srvRecords []SrvRecord
	for _, n := range r.Kvs {
		var srvRecord SrvRecord
		if err = json.Unmarshal([]byte(n.Value), &srvRecord); err != nil {
			return nil, err
		}
		srvRecord.Key = strings.TrimPrefix(string(n.Key), key)
		srvRecord.Key = strings.TrimSuffix(srvRecord.Key, srvRecord.Host)

		// Skip non-bucket entry like for a key
		// /skydns/net/miniocloud/10.0.0.1 that may exist as
		// dns entry for the server (rather than the bucket
		// itself).
		if srvRecord.Key == "" {
			continue
		}

		srvRecord.Key = msgUnPath(srvRecord.Key)
		srvRecords = append(srvRecords, srvRecord)

	}
	if len(srvRecords) == 0 {
		return nil, ErrNoEntriesFound
	}
	sort.Slice(srvRecords, func(i int, j int) bool {
		return srvRecords[i].Key < srvRecords[j].Key
	})
	return srvRecords, nil
}