borisdiakur / marked

Confluence macro plugin which renders remote Markdown.
https://marketplace.atlassian.com/plugins/com.borisdiakur.marked
BSD 3-Clause "New" or "Revised" License
46 stars 21 forks source link

Error rendering macro 'marked' : org/pegdown/PegDownProcessor #2

Closed wveeken closed 8 years ago

wveeken commented 8 years ago

I am trying to display a very simple .md file from our SVN repo. My credentials are included in the URL (i.e. http://username:password@repo-url), which I assume should work. However, the macro gives this error: "Error rendering macro 'marked' : org/pegdown/PegDownProcessor". I installed the macro through the marketplace, by the way. I am on Confluence 5.9.4 (Server).

borisdiakur commented 8 years ago

💩 This one’s confirmed for the newest version (1.0.2). Sorry for the inconvenience. I’ll have a look at it as soon as I can.

wveeken commented 8 years ago

No worries. Hope you find a solution quickly, because this macro would be tremendously useful. :)

borisdiakur commented 8 years ago

@wveeken Please try to update the plugin to version 1.0.3. I tested it on a local confluence instance and it works now.

wveeken commented 8 years ago

@borisdiakur, I get a 401 (unauthorized access) error now, but I know the credentials are correct. I can copy and paste the URL to my browser address bar and it works fine. Does the macro modify the URL behind the scenes in some way?

borisdiakur commented 8 years ago

No, it doesn’t. You can read the source here: https://github.com/borisdiakur/marked/blob/fix_%232/src/main/java/com/borisdiakur/marked/MarkedMacro.java#L70 Has this worked before for you? Maybe you can authenticate against your SVN repository host and receive a token you can use. I don’t know which host you use, but here are some docs by assembla.com just as an example: https://api-doc.assembla.com/content/authentication.html

borisdiakur commented 8 years ago

Just some thoughts: Since the plugin receives the basic auth credentials in the clear, I could also parse the url string and use them for instance as follows: http://stackoverflow.com/a/5137446/601466 That would be kind of a new feature. But using basic auth like this is not really secure. Using a token is always better since you can set specific permissions (read permission would totally suffice in this case) and revoke it at any time.

wveeken commented 8 years ago

We're going to look into it on this end @borisdiakur. Thanks for your help so far!

borisdiakur commented 8 years ago

I’m closing this one since the original error was due to a corrupt release build. If you find any problems with marked please open a new issue.

wveeken commented 8 years ago

Hi @borisdiakur, let me know if I need to create a new issue for this, but it still doesn't work. Even though I prefix the URL with my credentials as described in an earlier post, the SVN log shows that the request comes in with the credentials removed:

10.224.64.21 - - [31/Aug/2016:16:46:01 +0200] "GET ////remote_markdown.md HTTP/1.1" 401 734 "-" "Java/1.8.0_65"

When I copy and paste the URL into my browser address bar, everything works fine and the log shows that the credentials are included.

Created new issue https://github.com/borisdiakur/marked/issues/3

borisdiakur commented 8 years ago

@wveeken Yes, please open a new issue. You can call it ”Add support for basic auth” or whatever and I’ll see when I can spare a little time for it.