Skip to content

Commit

Permalink
KNOX-2661 - Consolidated HTTP methods in TokenResource (apache#494)
Browse files Browse the repository at this point in the history
  • Loading branch information
smolnar82 authored Sep 15, 2021
1 parent 9518b43 commit eb82cd9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
import javax.inject.Singleton;
import javax.servlet.ServletContext;
import javax.servlet.http.HttpServletRequest;
import javax.ws.rs.DELETE;
import javax.ws.rs.GET;
import javax.ws.rs.POST;
import javax.ws.rs.PUT;
Expand Down Expand Up @@ -405,7 +406,7 @@ public Response getTokenStateServiceStatus() {
return Response.status(Response.Status.OK).entity(JsonUtils.renderAsJsonString(tokenStateServiceStatusMap)).build();
}

@POST
@PUT
@Path(RENEW_PATH)
@Produces({APPLICATION_JSON})
public Response renew(String token) {
Expand Down Expand Up @@ -474,7 +475,7 @@ public Response renew(String token) {
return resp;
}

@POST
@DELETE
@Path(REVOKE_PATH)
@Produces({APPLICATION_JSON})
public Response revoke(String token) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ export class TokenManagementService {
revokeToken(tokenId: string) {
let xheaders = new HttpHeaders();
xheaders = this.addJsonHeaders(xheaders);
return this.http.post(this.revokeKnoxTokenUrl, tokenId, {headers: xheaders, responseType: 'text'})
return this.http.request('DELETE', this.revokeKnoxTokenUrl, {headers: xheaders, body: tokenId, responseType: 'text'})
.toPromise()
.then(response => response)
.catch((err: HttpErrorResponse) => {
Expand Down

0 comments on commit eb82cd9

Please sign in to comment.