Get a scan's credential list. It return dictionary with
        the corresponding credential for a given target.
978884
def get_credentials(self, scan_id, target):
        
        if target:
            for item in self.scans_table[scan_id]['targets']:
                if target == item[0]:
                    return item[2]
1254370
def certs(self):
        """"""
        return dict([(a, e) for a, e in self.entries.items()
                     if isinstance(e, TrustedCertEntry)])
1098329
def possible_target_profiles(nickname, server, all_profiles_dict,
                             org_vm, autonomous=True, output='path'):
    
    assert output in ['path', 'name']
    profiles_in_svr = get_profiles_in_svr(nickname, server,
                                          all_profiles_dict,
                                          org_vm)
    # list of possible autonomous profiles for testing
    possible_profiles = []

    for profile_inst in profiles_in_svr:
        profile_org_name = profile_name(org_vm, profile_inst, short=True)
        if autonomous:
            if all_profiles_dict[profile_org_name].type == 'autonomous':
                possible_profiles.append(profile_inst)
        else:
            if not all_profiles_dict[profile_org_name].type == 'component':
                possible_profiles.append(profile_inst)

    if output == 'path':
        possible_profiles = [inst.path for inst in possible_profiles]
    elif output == 'name':
        possible_profiles = [profile_name(org_vm, inst)
                             for inst in possible_profiles]

    return possible_profiles
971019
def Credentials(self):
		

		return(clc.v2.API.Call('GET','servers/%s/%s/credentials' % (self.alias,self.name),session=self.session))
1088392
def cert_from_instance(instance):
    
    if instance.signature:
        if instance.signature.key_info:
            return cert_from_key_info(instance.signature.key_info,
                                      ignore_age=True)
    return []
1209986
def list_scans(self, source_id=None):
        
        if source_id:
            target_url = self.client.get_url('SCAN', 'GET', 'multi', {'source_id': source_id})
        else:
            target_url = self.client.get_ulr('SCAN', 'GET', 'all')
        return base.Query(self.client.get_manager(Scan), target_url)
235554
def cli(env, identifier):
    """"""

    mgr = SoftLayer.ObjectStorageManager(env.client)
    credential_list = mgr.list_credential(identifier)
    table = formatting.Table(['id', 'password', 'username', 'type_name'])

    for credential in credential_list:
        table.add_row([
            credential['id'],
            credential['password'],
            credential['username'],
            credential['type']['name']
        ])

    env.fout(table)
562671
def get_cert_profile_kwargs(name=None):
    """"""

    if name is None:
        name = ca_settings.CA_DEFAULT_PROFILE

    profile = deepcopy(ca_settings.CA_PROFILES[name])
    kwargs = {
        'cn_in_san': profile['cn_in_san'],
        'subject': get_default_subject(name=name),
    }

    key_usage = profile.get('keyUsage')
    if key_usage and key_usage.get('value'):
        kwargs['key_usage'] = KeyUsage(key_usage)
    ext_key_usage = profile.get('extendedKeyUsage')
    if ext_key_usage and ext_key_usage.get('value'):
        kwargs['extended_key_usage'] = ExtendedKeyUsage(ext_key_usage)
    tls_feature = profile.get('TLSFeature')
    if tls_feature and tls_feature.get('value'):
        kwargs['tls_feature'] = TLSFeature(tls_feature)
    if profile.get('ocsp_no_check'):
        kwargs['ocsp_no_check'] = profile['ocsp_no_check']

    return kwargs
1184652
def _find_credentials(host):
    '''
    
    '''
    user_names = [__pillar__['proxy'].get('username', 'root')]
    passwords = __pillar__['proxy']['passwords']
    for user in user_names:
        for password in passwords:
            try:
                # Try to authenticate with the given user/password combination
                ret = salt.modules.vsphere.system_info(host=host,
                                                       username=user,
                                                       password=password)
            except SaltSystemExit:
                # If we can't authenticate, continue on to try the next password.
                continue
            # If we have data returned from above, we've successfully authenticated.
            if ret:
                return user, password
    # We've reached the end of the list without successfully authenticating.
    raise SaltSystemExit('Cannot complete login due to an incorrect user name or password.')
109074
def get_ports(self, scan_id, target):
        
        if target:
            for item in self.scans_table[scan_id]['targets']:
                if target == item[0]:
                    return item[1]

        return self.scans_table[scan_id]['targets'][0][1]
733595
def get_proficiencies(self):
        
        if self.retrieved:
            raise errors.IllegalState('List has already been retrieved.')
        self.retrieved = True
        return objects.ProficiencyList(self._results, runtime=self._runtime)
947196
def _get_credentials(server=None,
                     username=None,
                     password=None):
    '''
    
    '''
    jira_cfg = __salt__['config.merge']('jira', default={})
    if not server:
        server = jira_cfg.get('server')
    if not username:
        username = jira_cfg.get('username')
    if not password:
        password = jira_cfg.get('password')
    return server, username, password
1313801
def getCert(username, password,
            certHost=_SERVER,
            certfile=None,
            certQuery=_PROXY):
    """"""

    if certfile is None:
        certfile = tempfile.NamedTemporaryFile()

    # Add the username and password.
    # If we knew the realm, we could use it instead of ``None``.
    password_mgr = urllib2.HTTPPasswordMgrWithDefaultRealm()
    top_level_url = "http://" + certHost
    logging.debug(top_level_url)
    password_mgr.add_password(None, top_level_url, username, password)
    handler = urllib2.HTTPBasicAuthHandler(password_mgr)
    logging.debug(str(handler))
    # create "opener" (OpenerDirector instance)
    opener = urllib2.build_opener(handler)

    # Install the opener.   
    urllib2.install_opener(opener)

    # buuld the url that with 'GET' a certificat using user_id/password info
    url = "http://" + certHost + certQuery
    logging.debug(url)

    r = None
    try:
        r = opener.open(url)
    except urllib2.HTTPError as e:
        logging.debug(url)
        logging.debug(str(e))
        return False

    logging.debug(str(r))

    if r is not None:
        while True:
            buf = r.read()
            logging.debug(buf)
            if not buf:
                break
            certfile.write(buf)
        r.close()

    return certfile
359150
async def certifiers_of(client: Client, search: str) -> dict:
    
    return await client.get(MODULE + '/certifiers-of/%s' % search, schema=CERTIFICATIONS_SCHEMA)
842408
def credentials_lists(self):
        
        if self._credentials_lists is None:
            self._credentials_lists = CredentialListList(self._version, trunk_sid=self._solution['sid'], )
        return self._credentials_lists
678347
def _to_dict(self):
        """"""
        _dict = {}
        if hasattr(self, 'credentials') and self.credentials is not None:
            _dict['credentials'] = [x._to_dict() for x in self.credentials]
        return _dict
1028363
def getCredentials():
    ''' 
        
    '''
    logger = logging.getLogger("osrframework.utils")
    # Dictionary of lists:
    #     {'Twitter': {cred1, cred2, ...}}
    creds = {} 
    try:
        credsTuples = c_creds.returnListOfCreds()

        for cTuple in credsTuples:
            plat, user, password = cTuple

            c = Credential(user, password)

            if plat not in creds.keys():
                creds[plat] = [c]
            else:
                creds[plat] = creds[plat].append(c)
        logger.info(str(len(credsTuples)) + " credentials have been loaded.")    
        return creds
    except Exception, e:
        logger.error("WARNING. Something happened when loading credentials.")
        logger.error(str(e))        
        logger.debug("No credentials were loaded.")    
    return {}