Remove entries in the authentication cache using the user as a key

@param req
@param res
969803
private void removeEntryFromAuthCacheForUser(HttpServletRequest req, HttpServletResponse res) {
        getAuthCacheService();
        if (authCacheService == null) {
            return;
        }
        String user = req.getRemoteUser();
        if (user == null) {
            Principal p = req.getUserPrincipal();
            if (p != null)
                user = p.getName();
        }
        if (user != null) {
            if (collabUtils != null) {
                String realm = collabUtils.getUserRegistryRealm(securityServiceRef);
                if (!user.contains(realm + ":")) {
                    user = realm + ":" + user;
                }
            }
            authCacheService.remove(user);
        }
    }
385924
function (req, res) {
    var oauthQueryStateToken = req.query.state;
    var oauthCookieStateToken = req.cookies.oauthStateToken;

    if (!oauthQueryStateToken || (!oauthCookieStateToken)) {
      return false;
    } else if (oauthQueryStateToken !== oauthCookieStateToken) {
      return false;
    }

    res.clearCookie('oauthStateToken');

    return true;
  }
148997
public static void removeFromCache(String imageUri, ImageMemoryCache memoryCache) {
		List<String> keysToRemove = new ArrayList<String>();
		for (String key : memoryCache.getKeySet()) {
			if (key.startsWith(imageUri)) {
				keysToRemove.add(key);
			}
		}
		for (String keyToRemove : keysToRemove) {
			memoryCache.removeObjectFromCache(keyToRemove);
		}
	}
769079
private void removeAllRelatedFromCache(String userName)
   {
      cache.remove(userName, CacheType.USER_PROFILE);
      cache.remove(CacheHandler.USER_PREFIX + userName, CacheType.MEMBERSHIP);
   }
620864
def remove(self, entry):
        """"""
        try:
            list = self.cache[entry.key]
            list.remove(entry)
        except:
            pass
811933
public static void removeEntryFromSSLContextMap(String keyStorePath) {
        if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
            Tr.debug(tc, "removeEntryFromSSLContextMap: " + new Object[] { keyStorePath });

        List<SSLConfig> removeList = new ArrayList<SSLConfig>();

        for (Entry<SSLConfig, SSLContext> entry : sslContextCacheJAVAX.entrySet()) {
            SSLConfig cachedConfig = entry.getKey();

            if (cachedConfig != null) {
                String ksPropValue = cachedConfig.getProperty(Constants.SSLPROP_KEY_STORE, null);
                boolean ksFileBased = Boolean.parseBoolean(cachedConfig.getProperty(Constants.SSLPROP_KEY_STORE_FILE_BASED));
                String tsPropValue = cachedConfig.getProperty(Constants.SSLPROP_TRUST_STORE, null);
                boolean tsFileBased = Boolean.parseBoolean(cachedConfig.getProperty(Constants.SSLPROP_TRUST_STORE_FILE_BASED));

                if ((ksPropValue != null && keyStorePath.equals(WSKeyStore.getCannonicalPath(ksPropValue, ksFileBased))) ||
                    (tsPropValue != null && keyStorePath.equals(WSKeyStore.getCannonicalPath(tsPropValue, tsFileBased)))) {
                    removeList.add(cachedConfig);
                }
            }
        }
        if (!removeList.isEmpty()) {
            for (SSLConfig removeEntry : removeList) {
                if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
                    Tr.debug(tc, "removing from sslContext cache: " + removeEntry.toString());

                sslContextCacheJAVAX.remove(removeEntry);
            }
        }
    }
1001689
public void clearCredentials() {
        storage.remove(KEY_ACCESS_TOKEN);
        storage.remove(KEY_REFRESH_TOKEN);
        storage.remove(KEY_ID_TOKEN);
        storage.remove(KEY_TOKEN_TYPE);
        storage.remove(KEY_EXPIRES_AT);
        storage.remove(KEY_SCOPE);
    }
1314549
protected void removeInvalidLogins(String userName, String remoteAddress) {

        if (m_maxBadAttempts < 0) {
            // invalid login storage is disabled
            return;
        }

        String key = createStorageKey(userName, remoteAddress);
        // just remove the user from the storage
        m_storage.remove(key);
    }
1178379
def clear(self):
        """"""

        r = self._h._http_resource(
            method='DELETE',
            resource=('user', 'keys'),
        )

        return r.ok
848775
public void invalidateLookupCacheEntries(Set<ChannelID> channelIDs) {
		for (ChannelID id : channelIDs) {
			this.receiverCache.remove(id);
		}
	}
566981
function remove(req, res, next) {
  var params = {
    appId: req.params.id
  };

  forms.deleteAppReferences(req.connectionOptions, params, formsResultHandlers(constants.resultTypes.formProjects, req, next));
}
653393
private void removeEntryFromAuthCacheForToken(HttpServletRequest req, HttpServletResponse res, WebAppSecurityConfig config) {
        getAuthCacheService();
        if (authCacheService == null) {
            return;
        }

        Cookie[] cookies = req.getCookies();
        if (cookies != null) {
            String cookieValues[] = null;
            cookieValues = CookieHelper.getCookieValues(cookies, ssoCookieHelper.getSSOCookiename());
            if ((cookieValues == null || cookieValues.length == 0) &&
                !SSOAuthenticator.DEFAULT_SSO_COOKIE_NAME.equalsIgnoreCase(ssoCookieHelper.getSSOCookiename())) {
                cookieValues = CookieHelper.getCookieValues(cookies, SSOAuthenticator.DEFAULT_SSO_COOKIE_NAME);
            }
            if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
                Tr.debug(tc, "Cookie size: ", cookieValues == null ? "<null>" : cookieValues.length);
            if (cookieValues != null && cookieValues.length > 0) {
                for (int n = 0; n < cookieValues.length; n++) {
                    String val = cookieValues[n];
                    if (val != null && val.length() > 0) {
                        try {
                            authCacheService.remove(val);
                            //Add token to the logged out cache if enabled
                            if (config.isTrackLoggedOutSSOCookiesEnabled())
                                addToLoggedOutTokenCache(val);
                        } catch (Exception e) {
                            String user = req.getRemoteUser();
                            if (user == null) {
                                Principal p = req.getUserPrincipal();
                                if (p != null)
                                    user = p.getName();
                            }
                            Tr.warning(tc, "AUTHENTICATE_CACHE_REMOVAL_EXCEPTION", user, e.toString());
                        }
                    }
                }
            }
        }
    }
684654
public void evictFromDiskCache(final ImageRequest imageRequest) {
    CacheKey cacheKey = mCacheKeyFactory.getEncodedCacheKey(imageRequest, null);
    mMainBufferedDiskCache.remove(cacheKey);
    mSmallImageBufferedDiskCache.remove(cacheKey);
  }
67408
public void clear(String cacheKey) {
        ValueCacheKey key = getRequestCacheKey(cacheKey);
        if (key != null) {
            ConcurrentHashMap<ValueCacheKey, HystrixCachedObservable<?>> cacheInstance = requestVariableForCache.get(concurrencyStrategy);
            if (cacheInstance == null) {
                throw new IllegalStateException("Request caching is not available. Maybe you need to initialize the HystrixRequestContext?");
            }

            /* remove this cache key */
            cacheInstance.remove(key);
        }
    }
679828
@PreAuthorize(SpringEvalExpressions.HAS_AUTH_SYSTEM_ADMIN)
    @Override
    public ResponseEntity<Collection<String>> invalidateCaches() {
        final Collection<String> cacheNames = cacheManager.getCacheNames();
        LOGGER.info("Invalidating caches {}", cacheNames);
        cacheNames.forEach(cacheName -> cacheManager.getCache(cacheName).clear());
        return ResponseEntity.ok(cacheNames);
    }
904763
@ManagedOperation
    public void remove(K key, boolean synchronous) {
        try {
            disp.callRemoteMethods(null, new MethodCall(REMOVE, key),
                                   new RequestOptions(synchronous? ResponseMode.GET_ALL : ResponseMode.GET_NONE, call_timeout));
            if(l1_cache != null)
                l1_cache.remove(key);
        }
        catch(Throwable t) {
            if(log.isWarnEnabled())
                log.warn("remove() failed", t);
        }
    }
36915
function remove(req, res, next) {
  var params = {"_id": req.params.id};

  logger.debug("Middleware Submissions Remove ", {params: params});
  forms.deleteSubmission(req.connectionOptions, params, submissionsHandler(constants.resultTypes.submissions, req, next));
}