Check if a given service identifier should be sent a logout request.
325882
def logout_allowed(service):
    """"""
    if hasattr(settings, 'MAMA_CAS_SERVICES'):
        return _is_allowed('logout_allowed', service)

    if hasattr(settings, 'MAMA_CAS_ENABLE_SINGLE_SIGN_OUT'):
        warnings.warn(
            'The MAMA_CAS_ENABLE_SINGLE_SIGN_OUT setting is deprecated. SLO '
            'should be configured using MAMA_CAS_SERVICES.', DeprecationWarning)
    return getattr(settings, 'MAMA_CAS_ENABLE_SINGLE_SIGN_OUT', False)
1060377
private boolean isRequestURLEqualsExitPageHost(HttpServletRequest req, String logoutURLhost) {
        boolean acceptURL = false;
        try {
            if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
                Tr.debug(tc, "about to attempt matching the logout exit url with the domain of the request.");
            StringBuffer requestURLString = req.getRequestURL();
            URL requestURL = new URL(new String(requestURLString));
            String requestURLhost = requestURL.getHost();
            if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
                Tr.debug(tc, " host of the request url is: " + requestURLhost + " and the host of the logout URL is: " + logoutURLhost);
            if (logoutURLhost != null && requestURLhost != null && logoutURLhost.equalsIgnoreCase(requestURLhost)) {
                acceptURL = true;
            }
        } catch (MalformedURLException e) {
            if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
                Tr.debug(tc, "caught Exception trying to form request URL object: " + e.getMessage());
            }
        }
        return acceptURL;
    }
1345499
@FFDCIgnore({ UnknownHostException.class })
    protected boolean verifyLogoutURL(HttpServletRequest req, String exitPage) {
        boolean acceptURL = false;
        boolean allowLogoutPageRedirectToAnyHost = webAppSecurityConfig.getAllowLogoutPageRedirectToAnyHost();
        if (exitPage != null && !exitPage.equals("logon.jsp") && !allowLogoutPageRedirectToAnyHost) {
            String logoutURLHost = null;
            try {
                InetAddress thisHost = InetAddress.getLocalHost();
                if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
                    Tr.debug(tc, "return from getLocalHost: " + thisHost);
                String shortName = thisHost.getHostName();
                String ipAddress = thisHost.getHostAddress();
                String hostFullName = (ipAddress == null ? shortName : InetAddress.getByName(ipAddress).getHostName());
                try {
                    URI logoutURL = new URI(exitPage);
                    logoutURLHost = logoutURL.getHost();
                    if (tc.isDebugEnabled())
                        Tr.debug(tc, "domain for exitPage url: " + logoutURLHost);
                    if (!logoutURL.isAbsolute()) {
                        /*
                         * If exitPage starts with "//" , it is a NetworkPath. We need to valid its target host.
                         * While the specification for network paths is preceded by exactly 2 slashes("//"), browsers will
                         * generally redirect network paths with 2 or more preceding slashes. Thus, we need to try to obtain the hostname
                         * utilizing only 2 preceding slashes.
                         */
                        if (tc.isDebugEnabled())
                            Tr.debug(tc, "URI " + exitPage + " is not absolute.");
                        String exitPageTrimmed = exitPage.trim();
                        if (exitPageTrimmed.startsWith("//")) {
                            if (tc.isDebugEnabled())
                                Tr.debug(tc, "URI " + exitPageTrimmed + " will be processed as a Network-Path." +
                                             " SendRedirect() defines a Network-Path as starting with // ");
                            char[] exitPageCharArr = exitPageTrimmed.toCharArray();
                            for (int i = 0; i < exitPageCharArr.length; i++) {
                                if (exitPageCharArr[i] != '/') {
                                    URI uri = new URI(exitPageTrimmed.substring(i - 2));
                                    //Set hostname for further checks.
                                    logoutURLHost = uri.getHost();
                                    if (logoutURLHost == null) {
                                        if (tc.isDebugEnabled())
                                            Tr.debug(tc, "SDK indicates " + exitPageTrimmed + " Network-Path does not contain a valid hostname.");
                                    } else {
                                        if (tc.isDebugEnabled())
                                            Tr.debug(tc, "SDK indicates " + exitPageTrimmed + " Network-Path contains a valid hostname," + logoutURLHost);
                                    }
                                    break;
                                }
                            }
                        } else {
                            //accept a relative URIs that are not Network-Path's
                            acceptURL = true;
                        }
                    }
                } catch (URISyntaxException urise) {
                    //The URI is invalid and will not be redirected to.
                    if (tc.isDebugEnabled())
                        Tr.debug(tc, "caught URISyntaxException getting urI for exitPage: " + urise.getMessage());
                    acceptURL = false;
                }
                if (logoutURLHost != null && acceptURL == false) {
                    acceptURL = isRedirectHostTheSameAsLocalHost(exitPage, logoutURLHost, hostFullName, shortName, ipAddress);
                    if (acceptURL)
                        return acceptURL;

                    acceptURL = isLogoutPageMatchDomainNameList(exitPage, logoutURLHost, webAppSecurityConfig.getLogoutPageRedirectDomainList());
                }
            } catch (UnknownHostException e) {
                if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
                    Tr.debug(tc, "caught an unknown exception: " + e.getMessage());
                acceptURL = false;
            }
            if (!acceptURL && logoutURLHost != null)
                acceptURL = isRequestURLEqualsExitPageHost(req, logoutURLHost);
        } else {
            if (exitPage != null) {
                acceptURL = true;
            }
        }
        if (!acceptURL) {
            Tr.error(tc, "SEC_FORM_LOGOUTEXITPAGE_INVALID", new Object[] { req.getRequestURL(), req.getParameter("logoutExitPage") });
        }
        return acceptURL;
    }
220553
def logout(client):
    
    if not client.session_id:
        client.request_session()

    concierge_request_header = client.construct_concierge_header(
        url=("http://membersuite.com/contracts/IConciergeAPIService/"
             "Logout"))

    logout_result = client.client.service.Logout(
        _soapheaders=[concierge_request_header])

    result = logout_result["body"]["LogoutResult"]

    if result["SessionID"] is None:  # Success!
        client.session_id = None
    else:  # Failure . . .
        raise LogoutError(result=result)
1108880
private String getValidLogoutExitPage(HttpServletRequest req) {

        boolean valid = false;
        String exitPage = req.getParameter("logoutExitPage");
        if (exitPage != null && exitPage.length() != 0) {
            boolean logoutExitURLaccepted = verifyLogoutURL(req, exitPage);
            if (logoutExitURLaccepted) {
                exitPage = removeFirstSlash(exitPage);
                exitPage = compatibilityExitPage(req, exitPage);
                valid = true;
            }
        }
        return valid == true ? exitPage : null;
    }
325672
def logout(self, api_version="v2.0"):
        

        cur_ctlr = self._parent_class.controller

        url = str(cur_ctlr) + "/{}/api/logout".format(api_version)

        api_logger.debug("URL = %s", url)
        return self._parent_class.rest_call(url, "get")
479214
public static boolean isValidServiceId(String name) {
        return name != null && name.length() > 0 && SERVICE_ID_REGEX.matcher(name).matches() && Character.isLetter(name.charAt(0));
    }
1140466
def logout(self):
        
        from flask_login import logout_user, current_user
        if not current_user.is_authenticated:
            return True

        # logout otherwise
        user = current_user
        events.logout_event.send(user)
        logout_user()

        # notify principal
        app = current_app._get_current_object()
        identity_changed.send(app, identity=AnonymousIdentity())

        return True
725715
def get_logout_url(service):
    """"""
    for backend in _get_backends():
        try:
            return backend.get_logout_url(service)
        except AttributeError:
            raise NotImplementedError("%s.%s.get_logout_url() not implemented" % (
                backend.__class__.__module__, backend.__class__.__name__)
            )
    return None
229240
def getService(self, serviceIdentifier):
        
        if serviceIdentifier in self._services:
            return self._services[serviceIdentifier]
        else:
            message = "Application - getService() - " \
                      "Service with identifier {} does not exist." \
                      .format(serviceIdentifier)
            raise Exception(message)
699781
def request_sign_out(self, session=requests):
        
        if logout_allowed(self.service):
            request = SingleSignOutRequest(context={'ticket': self})
            url = get_logout_url(self.service) or self.service
            session.post(url, data={'logoutRequest': request.render_content()})
            logger.info("Single sign-out request sent to %s" % url)
1276154
def logout(context, request):
    """"""

    @request.after
    def forget(response):
        request.app.forget_identity(response, request)

    return {
        'status': 'success'
    }
1225495
def do_IDENT(self, service_name: str, source: list, *args, **kwargs) -> None:
        
        self.logger.info(' IDENT %s as %s', service_name, source)
        self.messaging._address_map[service_name] = source
66912
function _logout (cookieName, cookieDomain) {
  return (req, res) => {
    const cookies = new Cookies(req, res)
    cookies.set(cookieName, null, { domain: cookieDomain })
    cookies.set(cookieName + '_sign', null, { domain: cookieDomain })
    // case where the cookies were set before assigning domain
    if (cookies.get(cookieName)) {
      cookies.set(cookieName, null)
      cookies.set(cookieName + '_sign', null)
    }
    res.status(204).send()
  }
}
852684
def _logout(self, reset=True):
        """"""
        url = '{base}/client/auth/logout'.format(base=self.base_url)
        response = self._session.get(url, params=self._parameters)
        if response.ok:
            if reset:
                self._reset()
            return True
        else:
            return False
21611
def logout(self, verbose=False):
        '''
        
        '''
        url = '{}/{}'.format(self.rest_url, 'logout')
        response = self.__auth_req_post(url, verbose=verbose)
        self.headers['X-Opsview-Token'] = None
        return response
560509
function checkServices(servicesJson) {
	//console.log(util.inspect(servicesJson))
	for (serviceId in servicesJson) {
		service=servicesJson[serviceId]
		if (service.uuid === blueRadiosService) {
			console.log('BlueRadios service UUID found!')
			//check for characteristics?
			return true;
		}
	}
}