Мое приложение интегрировано в аутентификацию auth2.0. но есть некоторые требования, которым необходимо, чтобы конечная точка была открыта для доступа к данным.
Это написано на Java Spring. с аннотацией, такой как @apiOperation, @HasPermission, @Timed, @ ApiResponses
@Timed
@GET
@Path("/asset/{id}/document/{documentId}")
@ApiOperation(notes = "download_document", httpMethod = "GET", value = "Document - Download an asset document", response = HttpServletRequest.class)
@HasPermission(permission = "ams:asset:get")
@ApiResponses({
@ApiResponse(code = 200, message = "Successful"),
@ApiResponse(code = 404, message = "Asset/Document Not Found"),
@ApiResponse(code = 401, message = "Unauthorized"),
@ApiResponse(code = 500, message = "Server Error")
})
@UnitOfWork
@ValidClientIdRequired
public Response downloadDocument(@ApiParam(value = "id") @PathParam("id") @NotNull int id,
@ApiParam(value = "documentId") @PathParam("documentId") @NotNull int documentId) throws IOException {
// some code here
return Response.ok(stream, MediaType.APPLICATION_OCTET_STREAM).
header("Access-Control-Expose-Headers", "x-file-type").
header("content-disposition", "attachment; filename = \"" + document.getName() + "\"").
header("x-file-type",fileType).build();
}
Я хочу изменить этот API, так как для этого требуется прямой вход в систему, мы можем получить доступ к данным.