Retrieves the status of a Cadmium site into a {@link Status} Object.

@param site The site uri of the Cadmium site to get the status from.
@param token The Github API token used for authenticating the request.
@return
@throws Exception
339616
public static Status getSiteStatus(String site, String token) throws Exception {
    HttpClient client = httpClient();
    
    HttpGet get = new HttpGet(site + StatusCommand.JERSEY_ENDPOINT);
    addAuthHeader(token, get);
    
    HttpResponse response = client.execute(get);
    HttpEntity entity = response.getEntity();
    if(entity.getContentType().getValue().equals(MediaType.APPLICATION_JSON)) { 
      String responseContent = EntityUtils.toString(entity);            
      return new Gson().fromJson(responseContent, new TypeToken<Status>() {}.getType());
    }
    return null;
  }
378470
private Claims getClaimsFromToken(String token) {
        Claims claims;
        try {
            claims = Jwts.parser()
                    .setSigningKey(jwtProperties.getSecret())
                    .parseClaimsJws(token)
                    .getBody();
        } catch (Exception e) {
            log.error("get claims from jwt token error : {}", e.getMessage());
            claims = null;
        }
        return claims;
    }
448714
public Element requestSecurityTokenResponse(final String appliesTo) throws Exception {
        val action = isSecureConv ? namespace + "/RST/SCT" : null;
        return requestSecurityTokenResponse(appliesTo, action, "/Issue", null);
    }
806725
@RequestMapping(value = "/site/**")
	public Object site(HttpServletRequest req, HttpServletResponse resp, AuthorizationEngine ap,
			PsnRuleEngine psnEngine, @RequestHeader(value = "X-Url-Prefix", required = false) String urlPrefix) {
		String path = req.getServletPath().substring(5);

		try {
			Branch branch = getBranch(ap, getContextRoot(req));
			if (branch == null) {
				return pageNotFound;
			}

			if (branch.isStatic()) { // 静态分支，直接返回要访问的资源
				if (path.equals("/cfg.cfg")) // 不允许访问cfg.cfg
					path = "";

				return returnFile(branch, path);
			} else {
				Page page = branch.findPage(path, ap);
				if (page == null)
					return pageNotFound;

				if (page.getLink() != null)
					return "redirect:" + page.getLink();

				if (page.isStatic()) {
					if (path.equals(page.getFullPath() + "cfg.cfg")) // 不允许访问cfg.cfg
						return pageNotFound;

					return returnFile(branch, path.replace(page.getFullPath(), page.getFullDir()));
				} else {
					SiteContext sc = new SiteContext(req, page, urlPrefix);
					req.setAttribute(SiteContext.SITE_CONTEXT_KEY, sc);
					req.setAttribute(PAGE_PATH, sc.getPageUrl(page.getFullPath()));
					req.setAttribute(PAGE_DATA, page.getDataMap());
					if (page.isExpand() && !page.getFullPath().equals(path) && path.startsWith(page.getFullPath()))
						req.setAttribute(PATH_EXPAND, path.substring(page.getFullPath().length()));

					return isSpringBoot ? "/WEB-INF/templates/" + page.getPsnTemplate(psnEngine) + ".jsp"
							: "/WEB-INF/site/template/" + page.getPsnTemplate(psnEngine) + ".jsp";
				}
			}
		} catch (Exception e) {
			return pageNotFound;
		}
	}
77024
public boolean hasParameters(String site) {
		SiteParameters siteParameters = siteParamsMap.get(site);
		if (siteParameters == null) {
			return false;
		}
		return siteParameters.hasParams();
	}
323583
public String extractJwtFromTokenEndpointResponse(Page response) throws Exception {
        JsonReader reader = Json.createReader(new StringReader(WebResponseUtils.getResponseText(response)));
        JsonObject jsonResponse = reader.readObject();
        return jsonResponse.getString("token");
    }
318763
function(site, file) {
			if (!site) {
				var d = new Deferred();
				d.resolve(false);
				return d;
			}
			return this.getURLOnSite(site, file).then(function(url) {
				return url !== null;
			});
		}
732644
public static wisite_accessmethod_binding[] get(nitro_service service, String sitepath) throws Exception{
		wisite_accessmethod_binding obj = new wisite_accessmethod_binding();
		obj.set_sitepath(sitepath);
		wisite_accessmethod_binding response[] = (wisite_accessmethod_binding[]) obj.get_resources(service);
		return response;
	}
1106838
public General getGeneral() throws Exception {
    Map<String, Object> siteinfo = wiki.getSiteInfo();
    String xml = (String) siteinfo.get("xml");
    Api api = super.fromXML(xml);
    General result = api.getQuery().getGeneral();
    return result;
  }
387694
public HttpSessionTokensSet getHttpSessionTokensSetForContext(Context context){
		//TODO: Proper implementation. Hack for now
		for (Entry<String, HttpSessionTokensSet> e : this.sessionTokens.entrySet()) {
			String siteName = e.getKey();
			siteName = "http://" + siteName;
			if (context.isInContext(siteName))
				return e.getValue();
		}
		return null;
	}
574306
@GET
    @Path("/validate/{token}")
    @Produces(MediaType.APPLICATION_JSON)
    public Response validateAccount(@PathParam("token") String token) {
        try{
            if (authServerLogic.validateAccount(token)) {
                return Response.ok().build();
            } else {
                return Response.status(Status.NOT_FOUND).build();
            }
        }catch (ServerDAO.DAOException e) {
            return fromDAOExpection(e);
        }
    }
857591
@RequirePOST
    public HttpResponse doSiteConfigure(@QueryParameter String site) throws IOException {
        Jenkins hudson = Jenkins.getInstance();
        hudson.checkPermission(CONFIGURE_UPDATECENTER);
        UpdateCenter uc = hudson.getUpdateCenter();
        PersistedList<UpdateSite> sites = uc.getSites();
        for (UpdateSite s : sites) {
            if (s.getId().equals(UpdateCenter.ID_DEFAULT))
                sites.remove(s);
        }
        sites.add(new UpdateSite(UpdateCenter.ID_DEFAULT, site));

        return new HttpRedirect("advanced");
    }
568548
def get_site_by_id(self, id):
        
        response = self._session.get(BASE_URL_TSQUARE + '/site/{}.json'.format(id))
        response.raise_for_status()
        site_data = response.json()
        return TSquareSite(**site_data)
1180254
void getTokensFromTokenEndpoint() throws SocialLoginException {
        try {
            tokens = getTokensUsingAuthzCode();
        } catch (Exception e) {
            throw createExceptionAndLogMessage(e, "AUTH_CODE_ERROR_GETTING_TOKENS", new Object[] { socialConfig.getUniqueId(), e.getLocalizedMessage() });
        }
    }
1373643
def get_token(self, code, headers=None, **kwargs):
        
        self._check_configuration("site", "token_url", "redirect_uri",
                                  "client_id", "client_secret")
        url = "%s%s" % (self.site, quote(self.token_url))
        data = {
            'redirect_uri': self.redirect_uri,
            'client_id': self.client_id,
            'client_secret': self.client_secret,
            'code': code,
        }
        data.update(kwargs)

        return self._make_request(url, data=data, headers=headers)
1173467
public boolean isAccessible(Env<AttrContext> env, Type site, Symbol sym) {
        return isAccessible(env, site, sym, false);
    }
937982
protected Object getAttribute(Token token) {
        Object object = null;
        if (activity.getProcessResult() != null) {
            object = activity.getProcessResult().getResultValue(token.getName());
        }
        if (object == null && activity.getRequestAdapter() != null) {
            object = activity.getRequestAdapter().getAttribute(token.getName());
        }
        if (object != null && token.getGetterName() != null) {
            object = getBeanProperty(object, token.getGetterName());
        }
        return (object != null ? object : token.getDefaultValue());
    }