Route callback
Displays the credential overview page
495201
public function listCredential()
    {
        $this->actionListCredential();
        $this->setTitleListCredential();
        $this->setBreadcrumbListCredential();
        $this->setFilterListCredential();
        $this->setPagerListCredential();

        $this->setData('credentials', $this->getListCredential());
        $this->setData('handlers', $this->credential->getHandlers());
        $this->outputListCredential();
    }
302029
function (req, callback) {
    var params = req.body
    var clientId = params.client_id
    var clientSecret = params.client_secret

    // missing credentials
    if (!clientId || !clientSecret) {
      return callback(new AuthorizationError({
        error: 'unauthorized_client',
        error_description: 'Missing client credentials',
        statusCode: 400
      }))
    }

    Client.get(clientId, function (err, client) {
      if (err) { return callback(err) }

      // Unknown client
      if (!client) {
        return callback(new AuthorizationError({
          error: 'unauthorized_client',
          error_description: 'Unknown client identifier',
          statusCode: 401
        }))
      }

      // Mismatching secret
      if (client.client_secret !== clientSecret) {
        return callback(new AuthorizationError({
          error: 'unauthorized_client',
          error_description: 'Mismatching client secret',
          statusCode: 401
        }))
      }

      callback(null, client)
    })
  }
1022525
function addAuthenticationRoutes(router) {
  const authRouter = express.Router();

  authRouter.use(require('body-parser').json({ strict: true, type: 'application/json', limit: '50mb' }));
  authRouter.use(require('body-parser').text({ type: 'text/*' }));
  amphoraAuth.addRoutes(authRouter);
  router.use('/_users', authRouter);
}
1308471
function(context, args, stack) {
		if (context.env.data.isServer)
			return;
		firstPass(args[0], context, stack); // traverse client template with frstPass
	}
424095
def credential_file(file=nil)
      unless file.nil?
        dsl_options[:credential_file]=file
        dsl_options.merge!(Ec2.load_keys_from_credential_file(file))
      else
        fetch(:credential_file)
      end
    end
1006803
private void getCredentials() {
        jcrService.getUserName(new BaseCallback<String>() {
            @Override
            public void onSuccess(String name) {
                showMainForm(name);
            }
        });
    }
616916
function authRoute(seneca, options, context, method, route, middleware, auth) {
  const opts = {
    failureRedirect: route.auth.fail,
    successRedirect: route.auth.pass
  }

  const routeArgs = [route.path]
    .concat([auth.authenticate(route.auth.strategy, opts)])
    .concat(middleware)
    .concat([
      (request, reply, next) => {
        handleRoute(seneca, options, request, reply, route, next)
      }
    ])

  context[method].apply(context, routeArgs)
}
659541
def _get_route_info(self, request):
        """"""
        resolve_match = resolve(request.path)

        app_name = resolve_match.app_name    # The application namespace for the URL pattern that matches the URL.
        namespace = resolve_match.namespace  # The instance namespace for the URL pattern that matches the URL.
        url_name = resolve_match.url_name    # The name of the URL pattern that matches the URL.
        view_name = resolve_match.view_name  # Name of the view that matches the URL, incl. namespace if there's one.

        return {
            "app_name": app_name or None,
            "namespace": namespace or None,
            "url_name": url_name or None,
            "view_name": view_name or None,
        }
1243897
public function overviewAction()
    {
        $roles = array();

        foreach ($this->acl->getRolePrivileges() as $role => $privileges) {
            $roles[$role][$this->_('Role')]    = $role;
            $roles[$role][$this->_('Parents')] = $privileges[\MUtil_Acl::PARENTS]   ? implode(', ', $privileges[\MUtil_Acl::PARENTS])   : null;
            $roles[$role][$this->_('Allowed')] = $privileges[\Zend_Acl::TYPE_ALLOW] ? implode(', ', $privileges[\Zend_Acl::TYPE_ALLOW]) : null;
            //$roles[$role][$this->_('Denied')]  = $privileges[\Zend_Acl::TYPE_DENY]  ? implode(', ', $privileges[\Zend_Acl::TYPE_DENY])  : null;
            $roles[$role][$this->_('Inherited')] = $privileges[\MUtil_Acl::INHERITED][\Zend_Acl::TYPE_ALLOW] ? implode(', ', $privileges[\MUtil_Acl::INHERITED][\Zend_Acl::TYPE_ALLOW]) : null;
            //$roles[$role][$this->_('Parent denied')]  = $privileges[\MUtil_Acl::INHERITED][\Zend_Acl::TYPE_DENY]  ? implode(', ', $privileges[\MUtil_Acl::INHERITED][\Zend_Acl::TYPE_DENY])  : null;
        }
        ksort($roles);

        $this->html->h2($this->_('Project role overview'));

        $this->_showTable($this->_('Roles'), $roles, true);
    }
1253435
def server_show(server_id, profile=None, **kwargs):
    '''
    
    '''
    conn = _auth(profile, **kwargs)
    return conn.server_show(server_id)
430500
def refresh_oauth_credential(self):
        """"""
        credential = self.session.oauth2credential

        if credential.is_stale():
            refresh_session = refresh_access_token(credential)
            self.session = refresh_session
745401
def authentication_url(self):
        """"""
        params = {
            'client_id': self.client_id,
            'response_type': self.type,
            'redirect_uri': self.callback_url
        }
        return AUTHENTICATION_URL + "?" + urlencode(params)
639418
function getUserProfile(key, steamID, callback) {
  var steam = new SteamWebAPI({ apiKey: key, format: 'json' });

  steam.getPlayerSummaries({
    steamids: [ steamID ],
    callback: function(err, result) {
      if(err) {
        return callback(err);
      }

      var profile = {
        provider: 'steam',
        _json: result.response.players[0],
        id: result.response.players[0].steamid,
        displayName: result.response.players[0].personaname,
        photos: [{
          value: result.response.players[0].avatar
        }, {
          value: result.response.players[0].avatarmedium
        }, {
          value: result.response.players[0].avatarfull
        }]
      };

      callback(null, profile);
    }
  });
}
601008
function(credentials){
      var socialLogin = false;
      if (credentials == undefined){
        credentials = {
          userid: $('#login_email').val(),
          password: $('#login_password').val()
        };
      } else if (typeof credentials === 'string'){
        socialLogin = true;
      }

      // Alter the UI to indicate that the login request is pending
      $('#login_button').attr('value', 'Logging in...');
      $('#register_button, #or').hide();

      var login = socialLogin ? cm.loginSocial.bind(cm) : cm.login.bind(cm);

      function loginError(msg){
        $('#login_button').attr('value', 'Login');
        $('#register_button, #or').show();
        todo.error('login', msg);
      }

      // Run CloudMine login request.
      login(credentials)
        .on('success', function(data){
          var services = data.profile.__services__;
          if(services){
            console.log("linked services:", services);
            data.profile.__services__.forEach(function(service){
              $('a.auth.' + service).hide();
            });
          }
          todo.process_login(data);
        })
        .on('unauthorized', function(data){
          loginError(data.errors[0]);
        })
        .on('error', function(data){
          loginError(data.errors ? data.errors[0] : "Error Logging in");
        })
    }
822231
public void collectRouteStats(String route, int statusCode) {

        // increments 200, 301, 401, 503, etc. status counters
        final String preciseStatusString = String.format("status_%d", statusCode);
        NamedCountingMonitor preciseStatus = namedStatusMap.get(preciseStatusString);
        if (preciseStatus == null) {
            preciseStatus = new NamedCountingMonitor(preciseStatusString);
            NamedCountingMonitor found = namedStatusMap.putIfAbsent(preciseStatusString, preciseStatus);
            if (found != null) preciseStatus = found;
            else MonitorRegistry.getInstance().registerObject(preciseStatus);
        }
        preciseStatus.increment();

        // increments 2xx, 3xx, 4xx, 5xx status counters
        final String summaryStatusString = String.format("status_%dxx", statusCode / 100);
        NamedCountingMonitor summaryStatus = namedStatusMap.get(summaryStatusString);
        if (summaryStatus == null) {
            summaryStatus = new NamedCountingMonitor(summaryStatusString);
            NamedCountingMonitor found = namedStatusMap.putIfAbsent(summaryStatusString, summaryStatus);
            if (found != null) summaryStatus = found;
            else MonitorRegistry.getInstance().registerObject(summaryStatus);
        }
        summaryStatus.increment();

        // increments route and status counter
        if (route == null) route = "ROUTE_NOT_FOUND";
        route = route.replace("/", "_");
        ConcurrentHashMap<Integer, RouteStatusCodeMonitor> statsMap = routeStatusMap.get(route);
        if (statsMap == null) {
            statsMap = new ConcurrentHashMap<Integer, RouteStatusCodeMonitor>();
            routeStatusMap.putIfAbsent(route, statsMap);
        }
        RouteStatusCodeMonitor sd = statsMap.get(statusCode);
        if (sd == null) {
            //don't register only 404 status codes (these are garbage endpoints)
            if (statusCode == 404) {
                if (statsMap.size() == 0) {
                    return;
                }
            }

            sd = new RouteStatusCodeMonitor(route, statusCode);
            RouteStatusCodeMonitor sd1 = statsMap.putIfAbsent(statusCode, sd);
            if (sd1 != null) {
                sd = sd1;
            } else {
                MonitorRegistry.getInstance().registerObject(sd);
            }
        }
        sd.update();
    }
875383
function describeRoute(route) {
		var host = route.Host;
		var domain = route.DomainName;
		var apps = route.Apps;
		var appsNum = route.Apps.length;

		var strResult = "\n" + host + "\t" + domain;

		if(appsNum != 0){
			strResult += "\t" + route.Apps[0].Name;
			if(appsNum > 1){
				for(var i = 1; i < appsNum; i++){
					strResult += ", " + route.Apps[i].Name;
				}
			}
		}
		return strResult;
	}
472036
function renderPage(uri, req, res, hrStart) {
  const locals = res.locals,
    extension = getExtension(req),
    renderer = findRenderer(extension);

  // Add request route params, request query params
  // and the request extension to the locals object
  locals.params = req.params;
  locals.query = req.query;
  locals.extension = extension;

  // look up page alias' component instance
  return getDBObject(uri)
    .then(formDataFromLayout(locals, uri))
    .then(data => {
      logTime(hrStart, uri);
      return data;
    })
    .then(({ data, options }) => renderer.render(data, options, res))
    .catch(responses.handleError(res));
}