Giter Club home page Giter Club logo

asp's People

Contributors

de-jcup avatar rbioteau avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

asp's Issues

Move test applications to integration-test

Situation

Newer IDE variants do separate between src/main/java and src/test/java and do not accept application starts from there.
For example: we cannot start e.g. AspClientTestMain.java from eclipse IDE.

Wanted

Inside IDE the test applications shall be startable again.

Solution

Move the "*TestMain" applications to integration test src/main/java

Release 1.3.1

Release issue.

After this release has been done, ASP parts will become available at

Why another release when no code has changed?

Reason: The jars will be now signed and the upload and build process will change. So technically they have changed at least by signature.... Providing here also a 1.3.0 would lead to inconsequent change management. So a "hotfix" version was necessary.

Upgrade used asciidoctorj, diagram and pdf variants

Asciidoctor has much newer versions which should be integrated in next ASP server.

Will change dependencies to:

compile group: 'org.asciidoctor', name: 'asciidoctorj', version: '2.2.0'
compile group: 'org.asciidoctor', name: 'asciidoctorj-pdf', version: '1.5.2'
compile group: 'org.asciidoctor', name: 'asciidoctorj-diagram', version: '2.0.1'

Avoid deprecated parts from AsciidoctorJ

Situation

We currently use Options.asMap() - but this is deprecated

Wanted

Remove the deprecated usage - because newer releases could remove the method or change the (internal) behaviour

Solution

  • introduce additional attributes parameters for communication protocol
  • provide own builder in client api which can be used (e.g. inside eclipse asciidoctor editor)

Encrypted client-server communication

Complete client-server communication shall be encrypted.

Server will return on startup a secret-key inside console log. This key must be used by client(s) wanting to communicate with server. All communication will be encrypted.

This will protect data, but also prevent #10, because if a decryption fails on client side this can only happen because of communicate with an unknown ASP server.

Provide ASP libraries at maven central

Situation

Because of the bintray sundown the asp libraries are no longer available as a gradle or maven dependency.

Wanted

ASP shall be available as a gradle or maven dependency.

Solution

Provide a deployment to maven cenral

Concepts documentation

Convert *.adoc files by using ASP

image

PlantUML code:

component Client as client
component "ASP server" as aspServer
aspServer <- Alice  :start (1)
client <- Alice
aspServer <- client : connect, define path to asciidoctor file to render (2)
aspServer -> client :delivers path to output (e.g.PDF/HTML..) (3)

gradlew fullintegrationtest does fail

currently ./gradlew fullintegrationtest does fail


de.jcup.asp.server.asciidoctorj.launcher.ExternalProcessAsciidoctorJServerLauncherIntTest > server_launch_by_jar FAILED
    de.jcup.asp.core.LaunchException at ExternalProcessAsciidoctorJServerLauncherIntTest.java:58

de.jcup.asp.server.asciidoctorj.launcher.ExternalProcessAsciidoctorJServerLauncherIntTest > long_running_action_like_convert_file_to_pdf_can_be_canceled FAILED
    de.jcup.asp.core.LaunchException at ExternalProcessAsciidoctorJServerLauncherIntTest.java:65

Coderay syntax highlighting no longer working

Situation

When rendering source code with ASP 1.4.0 the asciidoctor output does no longer contain syntax highlighting

Wanted

Shall work again

Analyze

The problem is, that with the #45 the sent json content differs now between options and attributes :

{
  "version" : "0.0.0",
  "command" : "convert_file",
  "source_filepath" : "/somewhere/example1.adoc",
  "options" : {
    "backend" : "pdf"
  },
  "attributes" : {
    "source-highlighter" : "coderay",
    "coderay-css" : "style"
  }
}

formerly the options element did contain the attribute element. The ASP server 1.4.0 version does still use the old structure ando so no attributes are used.

Solution

open

Upgrade asciidoctor version + pdf + diagram

We will update dependencies:

   // https://mvnrepository.com/artifact/org.asciidoctor/asciidoctorj
    asciidoctorj_version = "2.5.3"
    
    // https://mvnrepository.com/artifact/org.asciidoctor/asciidoctorj-pdf
    asciidoctorj_pdf_version = "1.6.2"
    
    // https://mvnrepository.com/artifact/org.asciidoctor/asciidoctorj-pdf
    asciidoctorj_diagram_version = "2.2.1"

Find and use a minimal json lib for client and server

Problem

The key value approach is okay for single values, but when it comes up to lists or maps the approach does not really work (or to cumbersome).

So JSON would be the simplest and proven way to contain communication data.

But... dependencies shall be small and we need a fast library, so ...

TODO

  • Find a library being small, fast and is ready for production
  • Integrate it and replace key value approach

Security-ASP as man-in-the middle malware deployment ?

Risk estimation

Current Situation

  • there is always a client TCP/IP connection to an ASP server and always trusted.
  • the communication is not encrypted, but plain json
  • But Server IP is always only loopback address, ports can differ
  • Client accepts only ASP connections from/to loopback address, so localhost...

What could a Hacker do with ASP?

  • Kill the process of the real ASP server instance
  • Create a fake server ASP, or an adapted ASP server, but create a control server
  • The control server could create and deploy an exploited PDF or HTML

When could a Hacker do this with ASP?

  • Hacker must have already access to local machine
  • Must have the right to kill the origin process
  • Must have the possiblity to create a server process for necessary port on loop back address

If the hacker is able to do the steps described above, he/she is already having access to system.

What would be the "benefit" for an hacker to have access to ASP

Exploit PDF and deliver by ASP:

One potential target: Attacker has normal user/developer rights available but no admin rights. A malware PDF could be a delivered by fake ASP server to client caller and have

  • either rights of the caller (not really a "hack benefit")
  • maybe gain more user rights (priviledge escalation) by using an HTML or PDF exploit delivered...

Provide first version

Provide a first version which will include

  • api client (java)
  • server,
    • shall provide possibility to convert a local asciidoc file into PDF or HTML by a client call
      Result shall be either contain file path to render result or error message
    • shall have a warmup phase, so when first call to server will not be slow

Kind of communciation between client and server

  • synchron
  • sequential, no parallel work: just one client call per time, others will wait

Protocol:

  • just simple tcp communication by lines (ending with \n) and key=value data transfer
  • this will be full encapsulated in client, so caller does not bother with this

UTF-8 characters are not decoded properly

It leads to errors when using an eclipse workspace at a location containing such characters (eg: é)

The issue comes from the request/response encryption that only support ISO-8859-1 charset. To avoid this issue I've made a PR suggesting to escape non ISO-8859-1 characters with their unicodes using Apache commons-text StringEscapeUtils escapeJava and unescapeJava method.

Client sends always Version 0.0.0 to server

Situation

The client does always send "0.0.0" as version.

Example:

{
  "version" : "0.0.0",
  "command" : "convert_file",
  "source_filepath" : "/somewhere/example1.adoc",
  "options" : {
    "backend" : "pdf"
  },
  "attributes" : {
    "source-highlighter" : "coderay",
    "coderay-css" : "style"
  }
}

Wanted

Version of client shall be send.

Solution

The version is fetched from MANIFEST.MF - but the version is currently only injected by gradle for dist jars.
Must be injected in all jars by gradle build.

Provide asciidoctorj API dependencies at compile time

Situation

Inside V1.4.0 the new Option builder API was introduced and the origin "just map" was removed inside ASPClient
Inside de-jcup/eclipse-asciidoctor-editor#371 the for asciidoctor editor plugin build is being changed from gradle (+manual parts) to full automated maven tycho.

The tycho build does currently work with asp 1.3.1 but ... the asciidoctorj dependencies are missing.
The changes done for 1.4.0 shall not be applied inside the maven-tycho branch but inside master branch.

So... as long as maven tycho branch is still under development, we rely on the API in 1.3.1 way.

Wanted

Having a version based on 1.3.1 but with compile dependencies to asciidoctorj api parts.

Solution

Provide Version 1.3.2 based on 1.3.1 without the changes done in 1.4.0 and publish it on maven central

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.