Given the http app list of a website, return what should be in the secure version
774246
def secured_apps_copy(self, apps):
        
        return [[app_name, path] for app_name, path in apps if
                app_name not in (self.LETSENCRYPT_VERIFY_APP_NAME,)]
803873
function() {
      var UA = navigator.userAgent
      var browser
      var version
      var verOffset
      var nameOffset

      if ((verOffset = UA.indexOf('Opera')) > -1) {
        browser = 'Opera'
        version = UA.substring(verOffset + 6)
        if ((verOffset = UA.indexOf('Version')) > -1) {
          version = UA.substring(verOffset + 8)
        }
      } else if ((verOffset = UA.indexOf('MSIE')) > -1) {
        browser = 'Internet Explorer'
        version = UA.substring(verOffset + 5)
      } else if ((verOffset = UA.indexOf('Chrome')) > -1) {
        browser = 'Chrome'
        version = UA.substring(verOffset + 7)
      } else if ((verOffset = UA.indexOf('Safari')) > -1) {
        browser = 'Safari'
        version = UA.substring(verOffset + 7)
        if ((verOffset = UA.indexOf('Version')) > -1) {
          version = UA.substring(verOffset + 8)
        }
      } else if ((verOffset = UA.indexOf('Firefox')) > -1) {
        browser = 'Firefox'
        version = UA.substring(verOffset + 8)
      } else if (UA.indexOf('Trident/') > -1) {
        browser = 'Internet Explorer'
        version = UA.substring(UA.indexOf('rv:') + 3)
      } else if ((nameOffset = UA.lastIndexOf(' ') + 1) < (verOffset = UA.lastIndexOf('/'))) {
        browser = UA.substring(nameOffset, verOffset)
        version = UA.substring(verOffset + 1)
        if (browser.toLowerCase() == browser.toUpperCase()) {
          browser = navigator.appName
        }
      }

      return {
        browser: browser,
        version: version,
      }
    }
509407
def package_list(cls, options=None):
        
        options = options or {}
        try:
            return cls.safe_call('cert.package.list', options)
        except UsageError as err:
            if err.code == 150020:
                return []
            raise
740809
def SecurityCheck(func):
  """"""

  def Wrapper(request, *args, **kwargs):
    """Wrapping function."""
    if WEBAUTH_MANAGER is None:
      raise RuntimeError("Attempt to initialize before WEBAUTH_MANAGER set.")
    return WEBAUTH_MANAGER.SecurityCheck(func, request, *args, **kwargs)

  return Wrapper
227579
def hash_prefix_list_checksum(self, threat_list):
        """"""
        q = '''SELECT value FROM hash_prefix
                WHERE threat_type=? AND platform_type=? AND threat_entry_type=?
                ORDER BY value
        '''
        params = [threat_list.threat_type, threat_list.platform_type, threat_list.threat_entry_type]
        with self.get_cursor() as dbc:
            dbc.execute(q, params)
            all_hashes = b''.join(bytes(h[0]) for h in dbc.fetchall())
            checksum = hashlib.sha256(all_hashes).digest()
        return checksum
715847
def check_security_settings():
    """"""
    in_production = not (current_app.debug or current_app.testing)
    secure = current_app.config.get('SESSION_COOKIE_SECURE')
    if in_production and not secure:
        current_app.logger.warning(
            "SESSION_COOKIE_SECURE setting must be set to True to prevent the "
            "session cookie from being leaked over an insecure channel."
        )
883771
private SecurityMetadata getSecurityMetadata(WebAppConfig webAppConfig) {
        WebModuleMetaData wmmd = ((WebAppConfigExtended) webAppConfig).getMetaData();
        return (SecurityMetadata) wmmd.getSecurityMetaData();
    }
176518
function list(appName, callback) {
    var uri = format('/%s/apps/%s/config/', deis.version, appName);
    commons.get(uri, function onListResponse(err, result) {
      callback(err, result ? result.values : null);
    });
  }
114182
function(serviceName) {
    var regex = RegExp('(http|https)(://)([^\/]+)(/)('+serviceName+').*'),
      services = appEnv.getServices(),
      theList = [];

    for (var service in services) {
      if (services[service].hasOwnProperty('credentials')) {
        if (services[service].credentials.hasOwnProperty('url')) {
          if (services[service].credentials.url.search(regex) === 0) {
            var newCandidate = {};
            var v = services[service];
            newCandidate.name = v.name ? v.name : '';
            newCandidate.label = v.label ? v.label : '';
            newCandidate.url = v.credentials.url ?
                                    v.credentials.url : '';
            newCandidate.username = v.credentials.username ?
                                        v.credentials.username : '';
            newCandidate.password = v.credentials.password ?
                                        v.credentials.password : '';
            theList = theList.concat(newCandidate);
          }
        }
      }
    }
    return theList;
  }
682502
protected function checkHttps() {
    if (strstr($this->drushStatus['uri'], 'https')) {
      if (!$this->getExecutor()->execute('curl -cacert ' . $this->drushStatus['uri'])->run()->wasSuccessful()) {
        $this->logProblem(__FUNCTION__, [
          "The SSL certificate for your local site appears to be invalid for {$this->drushStatus['uri']}.",
        ], 'error');
      }
    }
  }
238495
def website_exists_as_secure(self, website):
        "
        if website['https']:
            logger.info("website %s is already secured, skip" % website['name'])
            return website
        # changes in these fields are ignored
        for other in self._websites:
            if other['id'] == website['id']:
                continue
            if other['name'] == website['name'] and other['https']:
                return other
        return None
779432
static function IsSecureHttp()
	{
		return ( CLib::IsArrayWithKeys( $_SERVER, 'HTTPS' ) &&
			CLib::IsExistingString( $_SERVER[ 'HTTPS' ] ) &&
			(
				0 == strcasecmp( 'ON', $_SERVER[ 'HTTPS' ] ) ||
				0 == strcasecmp( '1', $_SERVER[ 'HTTPS' ] )
			) );
	}
1040846
def security(self):
        
        url = self._url + "/security"
        return _Security(url=url,
                         securityHandler=self._securityHandler,
                         proxy_url=self._proxy_url,
                         proxy_port=self._proxy_port)
1063867
def clean_security_hash(self):
        """"""
        security_hash_dict = {
            'content_type': self.data.get("content_type", ""),
            'object_pk': self.data.get("object_pk", ""),
            'timestamp': self.data.get("timestamp", ""),
        }
        expected_hash = self.generate_security_hash(**security_hash_dict)
        actual_hash = self.cleaned_data["security_hash"]
        if not constant_time_compare(expected_hash, actual_hash):
            raise forms.ValidationError("Security hash check failed.")
        return actual_hash
65770
private static function secure() {
	if (\alsvanzelf\fem\CLI) {
		return;
	}
	
	header_remove('X-Powered-By');
	
	ini_set('session.use_trans_sid',    0);
	ini_set('session.use_only_cookies', 1);
	ini_set('session.cookie_httponly',  1);
	ini_set('session.use_strict_mode',  1); // @note this is only effective from 5.5.2
	ini_set('session.entropy_file',     '/dev/urandom');
}
1043659
def app_list(**kwargs):
    
    ctx = Context(**kwargs)
    ctx.execute_action('app:list', **{
        'storage': ctx.repo.create_secure_service('storage'),
    })
831030
function () {
    return function (req, res, next) {
      var apphost = config.url.host,
          outputHost = undefsafe(config, 'security.preview'),
          host = req.header('Host', ''),
          offset = host.indexOf(apphost);

      if (host === outputHost) {
        offset = host.indexOf(outputHost);
      }

      if (offset > 0) {
        // Slice the host from the subdomain and subtract 1 for
        // trailing . on the subdomain.
        req.subdomain = host.slice(0, offset - 1);
      }
      next();
    };
  }