extractToken(tokenData.getToken());
extractToken(tokenData.getToken());
extractToken(tokenData.getToken());
@Override public Void call() throws Exception { ClientResponse response = resource().path("ws").path("v1").path("cluster") .path("delegation-token") .header(yarnTokenHeader, tmpToken.getToken()) .accept(contentType).delete(ClientResponse.class); assertEquals(Status.OK, response.getClientResponseStatus()); assertTokenCancelled(tmpToken.getToken()); return null; } });
@Override public Void call() throws Exception { ClientResponse response = resource().path("ws").path("v1").path("cluster") .path("delegation-token") .header(yarnTokenHeader, tmpToken.getToken()) .accept(contentType).delete(ClientResponse.class); assertResponseStatusCode(Status.OK, response.getStatusInfo()); assertTokenCancelled(tmpToken.getToken()); return null; } });
@Override public Void call() throws Exception { ClientResponse response = resource().path("ws").path("v1").path("cluster") .path("delegation-token") .header(yarnTokenHeader, tmpToken2.getToken()) .accept(contentType).delete(ClientResponse.class); assertEquals(Status.FORBIDDEN, response.getClientResponseStatus()); assertValidRMToken(tmpToken2.getToken()); return null; } });
@Override public Void call() throws Exception { ClientResponse response = resource().path("ws").path("v1").path("cluster") .path("delegation-token") .header(yarnTokenHeader, tmpToken2.getToken()) .accept(contentType).delete(ClientResponse.class); assertResponseStatusCode(Status.FORBIDDEN, response.getStatusInfo()); assertValidRMToken(tmpToken2.getToken()); return null; } });
@Override public DelegationToken call() throws Exception { String body = generateRenewTokenBody(mediaType, responseToken.getToken()); ClientResponse response = resource().path("ws").path("v1").path("cluster") .path("delegation-token").path("expiration") .header(yarnTokenHeader, responseToken.getToken()) .accept(contentType).entity(body, mediaType) .post(ClientResponse.class); assertEquals(Status.FORBIDDEN, response.getClientResponseStatus()); return null; } });
@Override public Void call() throws Exception { ClientResponse response = resource().path("ws").path("v1").path("cluster") .path("delegation-token").accept(contentType) .entity(body, mediaType).post(ClientResponse.class); assertResponseStatusCode(Status.OK, response.getStatusInfo()); DelegationToken tok = getDelegationTokenFromResponse(response); assertFalse(tok.getToken().isEmpty()); Token<RMDelegationTokenIdentifier> token = new Token<RMDelegationTokenIdentifier>(); token.decodeFromUrlString(tok.getToken()); assertEquals(renewer, token.decodeIdentifier().getRenewer().toString()); assertValidRMToken(tok.getToken()); DelegationToken dtoken = new DelegationToken(); response = resource().path("ws").path("v1").path("cluster") .path("delegation-token").accept(contentType) .entity(dtoken, mediaType).post(ClientResponse.class); assertResponseStatusCode(Status.OK, response.getStatusInfo()); tok = getDelegationTokenFromResponse(response); assertFalse(tok.getToken().isEmpty()); token = new Token<RMDelegationTokenIdentifier>(); token.decodeFromUrlString(tok.getToken()); assertEquals("", token.decodeIdentifier().getRenewer().toString()); assertValidRMToken(tok.getToken()); return null; } });
@Override public Void call() throws Exception { ClientResponse response = resource().path("ws").path("v1").path("cluster") .path("delegation-token").accept(contentType) .entity(body, mediaType).post(ClientResponse.class); assertEquals(Status.OK, response.getClientResponseStatus()); DelegationToken tok = getDelegationTokenFromResponse(response); assertFalse(tok.getToken().isEmpty()); Token<RMDelegationTokenIdentifier> token = new Token<RMDelegationTokenIdentifier>(); token.decodeFromUrlString(tok.getToken()); assertEquals(renewer, token.decodeIdentifier().getRenewer().toString()); assertValidRMToken(tok.getToken()); DelegationToken dtoken = new DelegationToken(); response = resource().path("ws").path("v1").path("cluster") .path("delegation-token").accept(contentType) .entity(dtoken, mediaType).post(ClientResponse.class); assertEquals(Status.OK, response.getClientResponseStatus()); tok = getDelegationTokenFromResponse(response); assertFalse(tok.getToken().isEmpty()); token = new Token<RMDelegationTokenIdentifier>(); token.decodeFromUrlString(tok.getToken()); assertEquals("", token.decodeIdentifier().getRenewer().toString()); assertValidRMToken(tok.getToken()); return null; } });
@Override public DelegationToken call() throws Exception { String body = generateRenewTokenBody(mediaType, responseToken.getToken()); ClientResponse response = resource().path("ws").path("v1").path("cluster") .path("delegation-token").path("expiration") .header(yarnTokenHeader, responseToken.getToken()) .accept(contentType).entity(body, mediaType) .post(ClientResponse.class); assertResponseStatusCode(Status.FORBIDDEN, response.getStatusInfo()); return null; } });
@Override public DelegationToken call() throws Exception { ClientResponse response = resource().path("ws").path("v1").path("cluster") .path("delegation-token").accept(contentType) .entity(dummyToken, mediaType).post(ClientResponse.class); assertResponseStatusCode(Status.OK, response.getStatusInfo()); DelegationToken tok = getDelegationTokenFromResponse(response); assertFalse(tok.getToken().isEmpty()); String body = generateRenewTokenBody(mediaType, tok.getToken()); response = resource().path("ws").path("v1").path("cluster") .path("delegation-token").path("expiration") .header(yarnTokenHeader, tok.getToken()) .accept(contentType).entity(body, mediaType) .post(ClientResponse.class); assertResponseStatusCode(Status.FORBIDDEN, response.getStatusInfo()); return tok; } });
@Override public DelegationToken call() throws Exception { ClientResponse response = resource().path("ws").path("v1").path("cluster") .path("delegation-token").accept(contentType) .entity(dummyToken, mediaType).post(ClientResponse.class); assertEquals(Status.OK, response.getClientResponseStatus()); DelegationToken tok = getDelegationTokenFromResponse(response); assertFalse(tok.getToken().isEmpty()); String body = generateRenewTokenBody(mediaType, tok.getToken()); response = resource().path("ws").path("v1").path("cluster") .path("delegation-token").path("expiration") .header(yarnTokenHeader, tok.getToken()) .accept(contentType).entity(body, mediaType) .post(ClientResponse.class); assertEquals(Status.FORBIDDEN, response.getClientResponseStatus()); return tok; } });
assertValidRMToken(responseToken.getToken()); String body = generateRenewTokenBody(mediaType, responseToken.getToken()); ClientResponse response = resource().path("ws").path("v1").path("cluster") .path("delegation-token").path("expiration") .header(yarnTokenHeader, responseToken.getToken()) .accept(contentType).entity(body, mediaType) .post(ClientResponse.class); resource().path("ws").path("v1").path("cluster") .path("delegation-token").path("expiration") .header(yarnTokenHeader, responseToken.getToken()) .accept(contentType).entity(body, mediaType) .post(ClientResponse.class);
assertValidRMToken(responseToken.getToken()); String body = generateRenewTokenBody(mediaType, responseToken.getToken()); ClientResponse response = resource().path("ws").path("v1").path("cluster") .path("delegation-token").path("expiration") .header(yarnTokenHeader, responseToken.getToken()) .accept(contentType).entity(body, mediaType) .post(ClientResponse.class); resource().path("ws").path("v1").path("cluster") .path("delegation-token").path("expiration") .header(yarnTokenHeader, responseToken.getToken()) .accept(contentType).entity(body, mediaType) .post(ClientResponse.class);
@Override public Void call() throws Exception { ClientResponse response = resource().path("ws").path("v1").path("cluster") .path("delegation-token") .header(yarnTokenHeader, tmpToken.getToken()).accept(contentType) .delete(ClientResponse.class); assertEquals(Status.OK, response.getClientResponseStatus()); response = resource().path("ws").path("v1").path("cluster") .path("delegation-token") .header(yarnTokenHeader, tmpToken.getToken()).accept(contentType) .delete(ClientResponse.class); assertEquals(Status.BAD_REQUEST, response.getClientResponseStatus()); return null; } });
@Override public Void call() throws Exception { ClientResponse response = resource().path("ws").path("v1").path("cluster") .path("delegation-token") .header(yarnTokenHeader, tmpToken.getToken()).accept(contentType) .delete(ClientResponse.class); assertResponseStatusCode(Status.OK, response.getStatusInfo()); response = resource().path("ws").path("v1").path("cluster") .path("delegation-token") .header(yarnTokenHeader, tmpToken.getToken()).accept(contentType) .delete(ClientResponse.class); assertResponseStatusCode(Status.BAD_REQUEST, response.getStatusInfo()); return null; } });
@Override public Void call() throws Exception { ClientResponse response = resource().path("ws").path("v1").path("cluster") .path("delegation-token").accept(contentType) .entity(dtoken, mediaType).post(ClientResponse.class); assertResponseStatusCode(Status.OK, response.getStatusInfo()); DelegationToken tok = getDelegationTokenFromResponse(response); response = resource().path("ws").path("v1").path("cluster") .path("delegation-token") .header(yarnTokenHeader, tok.getToken()).accept(contentType) .delete(ClientResponse.class); assertResponseStatusCode(Status.OK, response.getStatusInfo()); assertTokenCancelled(tok.getToken()); return null; } });
@Override public Void call() throws Exception { ClientResponse response = resource().path("ws").path("v1").path("cluster") .path("delegation-token").accept(contentType) .entity(dtoken, mediaType).post(ClientResponse.class); assertEquals(Status.OK, response.getClientResponseStatus()); DelegationToken tok = getDelegationTokenFromResponse(response); response = resource().path("ws").path("v1").path("cluster") .path("delegation-token") .header(yarnTokenHeader, tok.getToken()).accept(contentType) .delete(ClientResponse.class); assertEquals(Status.OK, response.getClientResponseStatus()); assertTokenCancelled(tok.getToken()); return null; } });