GET list of requirements for a given UID/Public key

    :param client: Client to connect to the api
    :param search: UID or public key
    :return:
543427
async def requirements(client: Client, search: str) -> dict:
    
    return await client.get(MODULE + '/requirements/%s' % search, schema=REQUIREMENTS_SCHEMA)
311151
def get_api_required_params(self):
        
        result = self.required_params
        if type(result) != list:
            raise ValueError(
                '{}.required_params should return list'.format(
                    self.__class__.__name__
                )
            )
        return result
183929
def has_required_params(self):
        '''
        
        '''
        return self.consumer_key and\
                self.consumer_secret and\
                self.resource_link_id and\
                self.launch_url
438697
def client_id(self, client):
        

        params = {
            "name": client
        }

        response = self._get(url.clients, params=params)
        self._check_response(response, 200)
        return self._create_response(response).get("client_id")
545738
protected String getBridgeJsonRefinementSearch(String clientKey) {
    Request request = new Request();
    request.setIncludedNavigations(includedNavigations);
    request.setExcludedNavigations(excludedNavigations);
    request.setClientKey(clientKey);
    request.setCollection(collection);
    request.setArea(area);
    request.setRefinementQuery(query);
    request.setWildcardSearchEnabled(isWildcardSearchEnabled());
    request.setSecuredPayload(securedPayload);
    if (CollectionUtils.isNotEmpty(sort)) {
      for (Sort s : sort) {
        request.setSort(convertSort(s));
      }
    }
    request.setMatchStrategy(convertPartialMatchStrategy(matchStrategy));
    return requestToJson(request);
  }
934532
def search_certificate(self, hash):
        
        c = CensysCertificates(api_id=self.__uid, api_secret=self.__api_key)
        return c.view(hash)
737934
def check_key(request):
    '''
        
    '''
    api_objs = list(Api.objects.filter(name=request.POST['api']))
    if not api_objs:
        return HttpResponseBadRequest('Must specify valid API')

    # check the signature
    if get_signature(request.POST, api_objs[0].signing_key) != request.POST['signature']:
        return HttpResponseBadRequest('bad signature')

    get_object_or_404(Key, key=request.POST['key'], status='A')

    return HttpResponse('OK')
378090
def keys(self, id=None, search=None):
        
        if self._keys is None:
            self._keys = {}
            self._list_keys()

        if id:
            return [self._keys[key_id] for key_id in self._keys.keys()
                    if id == self._keys[key_id].id]
        elif search:
            return [self._keys[key_id] for key_id in self._keys.keys()
                    if (search in self._keys[key_id].id) or (search in self._keys[key_id].name)]
        else:
            return [self._keys[key_id] for key_id in self._keys.keys()]
123401
def get_client(self, client_id):
        
        self.assert_has_permission('clients.read')

        uri = self.uri + '/oauth/clients/' + client_id
        headers = self.get_authorization_headers()
        response = requests.get(uri, headers=headers)
        if response.status_code == 200:
            return response.json()
        else:
            # Not found but don't raise
            return
1054999
async def list(cls, user_id: Union[int, str] = None,
                   is_active: bool = None,
                   fields: Iterable[str] = None) -> Sequence[dict]:
        '''
        
        '''
        if fields is None:
            fields = (
                'access_key', 'secret_key',
                'is_active', 'is_admin',
            )
        if user_id is None:
            q = 'query($is_active: Boolean) {' \
                '  keypairs(is_active: $is_active) {' \
                '    $fields' \
                '  }' \
                '}'
        else:
            uid_type = 'Int!' if isinstance(user_id, int) else 'String!'
            q = 'query($user_id: {0}, $is_active: Boolean) {{'.format(uid_type) + \
                '  keypairs(user_id: $user_id, is_active: $is_active) {' \
                '    $fields' \
                '  }' \
                '}'
        q = q.replace('$fields', ' '.join(fields))
        variables = {
            'is_active': is_active,
        }
        if user_id is not None:
            variables['user_id'] = user_id
        rqst = Request(cls.session, 'POST', '/admin/graphql')
        rqst.set_json({
            'query': q,
            'variables': variables,
        })
        async with rqst.fetch() as resp:
            data = await resp.json()
            return data['keypairs']
383073
def search_related(self, request):
        logger.debug("Cache Search Request")
        if self.cache.is_empty() is True:
            logger.debug("Empty Cache")
            return None

        
        result = []
        items = list(self.cache.cache.items())

        for key, item in items:
            element = self.cache.get(item.key)
            logger.debug("Element : {elm}".format(elm=str(element)))

            if request.proxy_uri == element.uri:
                result.append(item)

        return result
1023792
def getAPIKey(self, keyID=None):
        
        kcfg = self.getKeyConfig(keyID)
        if 'key' not in kcfg:
            raise ConfigException('invalid config: missing api key')
        return kcfg['key']
578379
async def get_ssh_key(self, raw_ssh=False):
        
        key_facade = client.KeyManagerFacade.from_connection(self.connection())
        entity = {'tag': tag.model(self.info.uuid)}
        entities = client.Entities([entity])
        return await key_facade.ListKeys(entities, raw_ssh)
687919
async def get(self, public_key):
		
		# Sign-verifying functional
		if settings.SIGNATURE_VERIFICATION:
			super().verify()

		page = self.get_query_argument("page", 1)

		cids = await self.account.getuserscontent(public_key=public_key)

		logging.debug("\n\n Users cids")
		logging.debug(cids)
		
		if isinstance(cids, dict):
			if "error" in cids.keys():
				self.set_status(cids["error"])
				self.write(cids)
				raise tornado.web.Finish

		container = []

		for coinid in cids:

			logging.debug("\n [] -- coinid")
			logging.debug(coinid)

			#if list(cids.keys()).index(coinid) == len(cids) - 1:
			#	paginator = Paginator(coinid=coinid, page=page, 
			#		limit=(settings.LIMIT//len(cids))+(settings.LIMIT%len(cids)), cids=cids)
			#else:
			#paginator = Paginator(coinid=coinid, page=page, 
			#						limit=settings.LIMIT // len(cids), cids=cids)

			if coinid in settings.bridges.keys():
				logging.debug(" -- Coinid in ")
				logging.debug(settings.bridges.keys())
				self.account.blockchain.setendpoint(settings.bridges[coinid])

				contents = await self.account.blockchain.getuserscontent(
												cids=json.dumps(cids[coinid]))
				logging.debug("\n\n -- Contents")
				logging.debug(contents)
				if isinstance(contents, dict):
					if "error" in contents.keys():
						continue
				container.extend(contents)

				logging.debug("\n\n -- Container 1")


				logging.debug("\n\n -- Container 2")
				logging.debug(container)

		response = {
			"profiles":json.dumps(container),
			}
		try:
			response.update(paginator.get_pages())
		except:
			pass
	
		self.write(json.dumps(response))
779089
def get_public_key(self, key_id, is_search_embedded=False):
        """"""
        if isinstance(key_id, int):
            return self._public_keys[key_id]

        for item in self._public_keys:
            if item.get_id() == key_id:
                return item

        if is_search_embedded:
            for authentication in self._authentications:
                if authentication.get_public_key_id() == key_id:
                    return authentication.get_public_key()
        return None
1161869
def SearchClients(query=None, context=None):
  """"""

  args = client_pb2.ApiSearchClientsArgs(query=query)

  items = context.SendIteratorRequest("SearchClients", args)
  return utils.MapItemsIterator(lambda data: Client(data=data, context=context),
                                items)
702297
def query_clients(self):
        

        try:
            data = self.call("clients", {'client': 'None'})
            if len(data) > 0:
                return pd.DataFrame(data).drop(
                    ['commandLine',
                     'processId'],
                    axis=1
                )
            else:
                return pd.DataFrame(
                    None,
                    columns=[
                        'id',
                        'name',
                        'windowsTitle',
                        'accountInfo',
                        'status'
                    ]
                )
        except Exception as e:
            return False, e