HopsworksRMAppSecurityActions extends AbstractSecurityActions implements RMAppSecurityActions { @Override public void invalidateJWT(String signingKeyName) throws URISyntaxException, IOException, GeneralSecurityException { if (!jwtConfigured) { jwtNotConfigured("invalidateJWT"); } CloseableHttpResponse response = null; try { URI invalidateURI = new URI(jwtInvalidatePath.getPath() + signingKeyName); HttpDelete request = new HttpDelete(invalidateURI); response = doJSONCall(request, "Hopsworks could to invalidate JWT signing key " + signingKeyName); } finally { if (response != null) { response.close(); } } } HopsworksRMAppSecurityActions(); @Override X509SecurityHandler.CertificateBundle sign(PKCS10CertificationRequest csr); @Override int revoke(String certificateIdentifier); @Override String generateJWT(JWTSecurityHandler.JWTMaterialParameter jwtParameter); @Override String renewJWT(JWTSecurityHandler.JWTMaterialParameter jwtParameter); @Override void invalidateJWT(String signingKeyName); static final String REVOKE_CERT_ID_PARAM; }
@Test public void testInvalidateJWT() throws Exception { String signingKeyName = "lala"; RMAppSecurityActions actor = (RMAppSecurityActions) HopsSecurityActionsFactory.getInstance().getActor(conf, conf.get(YarnConfiguration.HOPS_RM_SECURITY_ACTOR_KEY, YarnConfiguration.HOPS_RM_SECURITY_ACTOR_DEFAULT)); actor.invalidateJWT(signingKeyName); }