Gets an agent key for session management.

        Side effect of setting a new proxy if one is sent along,
        and initializing the provider session map if agent key has
        not been seen before
161269
def _get_agent_key(self, proxy=None):
        
        if self._proxy is None:
            self._proxy = proxy
        if self._proxy is not None and self._proxy.has_effective_agent():
            agent_key = self._proxy.get_effective_agent_id()
        else:
            agent_key = None
        if agent_key not in self._provider_sessions:
            self._provider_sessions[agent_key] = dict()
        return agent_key
269539
public synchronized ServiceAgent getServiceAgent() {
    if (this.keyAgent == null) {
      if (isService) {
        this.serviceAgent =
            new ServiceAgent(
                this.serviceName,
                this.projectId,
                this.sslEnabled,
                this.nfvoIp,
                this.nfvoPort,
                this.version,
                this.serviceKey);
      } else {
        this.serviceAgent =
            new ServiceAgent(
                this.username,
                this.password,
                this.projectId,
                this.sslEnabled,
                this.nfvoIp,
                this.nfvoPort,
                this.version);
      }
    }
    return this.serviceAgent;
  }
168851
def proxy_manager_for(self, proxy, **proxy_kwargs):
        """"""
        try:
            proxy_kwargs['ssl_version'] = ssl.PROTOCOL_TLS
        except AttributeError:
            proxy_kwargs['ssl_version'] = ssl.PROTOCOL_SSLv23
        return super(SSLAdapter, self).proxy_manager_for(proxy, **proxy_kwargs)
1356730
public AgentRoster getAgentRoster() throws NotConnectedException, InterruptedException {
        if (agentRoster == null) {
            agentRoster = new AgentRoster(connection, workgroupJID);
        }

        // This might be the first time the user has asked for the roster. If so, we
        // want to wait up to 2 seconds for the server to send back the list of agents.
        // This behavior shields API users from having to worry about the fact that the
        // operation is asynchronous, although they'll still have to listen for changes
        // to the roster.
        int elapsed = 0;
        while (!agentRoster.rosterInitialized && elapsed <= 2000) {
            try {
                Thread.sleep(500);
            }
            catch (Exception e) {
                // Ignore
            }
            elapsed += 500;
        }
        return agentRoster;
    }
643249
def get_web_auth_session_key_username(self, url, token=""):
        

        if url in self.web_auth_tokens.keys():
            token = self.web_auth_tokens[url]
        else:
            # This will raise a WSError if token is blank or unauthorized
            token = token

        request = _Request(self.network, "auth.getSession", {"token": token})

        # default action is that a request is signed only when
        # a session key is provided.
        request.sign_it()

        doc = request.execute()

        session_key = doc.getElementsByTagName("key")[0].firstChild.data
        username = doc.getElementsByTagName("name")[0].firstChild.data
        return session_key, username
273291
def _get_client_and_key(url, user, password, verbose=0):
    '''
    
    '''
    session = {}
    session['client'] = six.moves.xmlrpc_client.Server(url, verbose=verbose, use_datetime=True)
    session['key'] = session['client'].auth.login(user, password)

    return session
553979
def get_key(key_name, region=None, key=None, keyid=None, profile=None):
    '''
    
    '''
    conn = _get_conn(region=region, key=key, keyid=keyid, profile=profile)

    try:
        key = conn.get_key_pair(key_name)
        log.debug("the key to return is : %s", key)
        if key is None:
            return False
        return key.name, key.fingerprint
    except boto.exception.BotoServerError as e:
        log.debug(e)
        return False
1295280
def get_session_key(
        user,
        password,
        url='https://localhost:8089',
        verify=False,
        ssl_options=None):
    
    servercontent = requests.post(
        '{}/services/auth/login'.format(
            url),
        headers={},
        verify=False,
        data={
            'username': user,
            'password': password
        })
    get_session_key = parseString(
        servercontent.text).getElementsByTagName(
            'sessionKey')[0].childNodes[0].nodeValue
    return get_session_key
525294
Key getPublicKey(String trustedAlias, String trustStoreRef, String signatureAlgorithm)
			throws KeyStoreServiceException, KeyException {
		Key signingKey = getPublicKeyFromKeystore(trustedAlias, trustStoreRef, signatureAlgorithm);
		if (tc.isDebugEnabled()) {
			Tr.debug(tc, "Trusted alias: " + trustedAlias + ", Truststore: " + trustStoreRef);
			Tr.debug(tc, "RSAPublicKey: " + (signingKey instanceof RSAPublicKey));
		}
		if (signingKey != null && !(signingKey instanceof RSAPublicKey)) {
			signingKey = null;
		}
		return signingKey;
	}
1249043
public synchronized IGenericSessionManager getSessionManager(Object registryKey) {
        if (com.ibm.ejs.ras.TraceComponent.isAnyTracingEnabled() && LoggingUtil.SESSION_LOGGER_CORE.isLoggable(Level.FINE)) {
            LoggingUtil.SESSION_LOGGER_CORE.entering(methodClassName, methodNames[GET_SESSION_MANAGER], "registryKey= " + registryKey);
        }
        IGenericSessionManager sessionManager = (IGenericSessionManager) _genericSessionManagers.get(registryKey);
        if (com.ibm.ejs.ras.TraceComponent.isAnyTracingEnabled() && LoggingUtil.SESSION_LOGGER_CORE.isLoggable(Level.FINE)) {
            LoggingUtil.SESSION_LOGGER_CORE.exiting(methodClassName, methodNames[GET_SESSION_MANAGER], "sessionManager= " + sessionManager);
        }
        return sessionManager;
    }
1039215
public byte[] getUserSessionKey ( CIFSContext tc, byte[] chlng ) {
        byte[] key = new byte[16];
        try {
            getUserSessionKey(tc, chlng, key, 0);
        }
        catch ( Exception ex ) {
            log.error("Failed to get session key", ex);
        }
        return key;
    }
286169
public String getSessionKey() throws LimesurveyRCException {
        // Use the saved key if isn't expired
        if (!key.isEmpty() && ZonedDateTime.now().isBefore(keyExpiration)) {
            return key;
        }

        // Get session key and save it with an expiration set to 1 minute before the expiration date
        LsApiBody.LsApiParams params = new LsApiBody.LsApiParams();
        params.setUsername(user);
        params.setPassword(password);
        JsonElement result = callRC(new LsApiBody("get_session_key", params));
        key = result.getAsString();
        keyExpiration = ZonedDateTime.now().plusSeconds(keyTimeout - 60);

        return key;
    }
978015
def get_common_session_key(self, premaster_secret):
        
        k_1 = self.hash(premaster_secret, b'\x00\x00\x00\x00', as_bytes=True)
        k_2 = self.hash(premaster_secret, b'\x00\x00\x00\x01', as_bytes=True)
        return k_1 + k_2
1086360
private RSAPublicKey getKeyForUser(String userName) throws KeyNotFoundException {
    RSAPublicKey key = null;
    for (final KeyProvider keyProvider : keyProviders) {
      try {
        key = keyProvider.getKey(userName);
        break;
      } catch (KeyNotFoundException e) {
        // that's fine, try the next provider
      }
    }

    if (key == null) {
      throw new KeyNotFoundException();
    }

    return key;
  }
616886
public IExternalAccess getAgentsExternalAccess(String agent_name) {

        return cmsService.getExternalAccess(getAgentID(agent_name)).get(
                new ThreadSuspendable());
    }
937895
def get_session(self, key):
        
        # a SimpleSession:
        session = self.session_handler.do_get_session(key)
        if (session):
            return self.create_exposed_session(session, key)
        else:
            return None
302365
function Session_getAgentByID(id) {
  for (var i=0; i<this.channels.length; i++) {
    var agents = this.channels[i].getAgents()
    for (var j=0; j<agents.length; j++) {
      var agent = agents[j]
      if (agent.info.id == id) return agent
    }
  }
}