Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support uploading screenshots #10

Open
shiraji opened this issue Jan 8, 2017 · 2 comments
Open

Support uploading screenshots #10

shiraji opened this issue Jan 8, 2017 · 2 comments

Comments

@shiraji
Copy link

shiraji commented Jan 8, 2017

Hi,

This might be wrong place to open this issue, but I'm not sure here or https://github.com/JetBrains/gradle-intellij-plugin for this issue.

I want to upload screenshots of the plugins using gradle-intellij-plugin.

What I did

I add a method for uploading screenshots

    @Multipart
    @POST("/plugin/uploadScreenshot")
    fun uploadScreenshot(@Part("userName") username: TypedString, @Part("password") password: TypedString,
                         @Part("pluginId") pluginId: TypedString, @Part("channel") channel: TypedString?,
                         @Part("file") file: TypedFile): Response // I don't think parameter name `file` is correct. It should be `files[0]`

This gave me 400 error saying Parameter csrfToken must be defined.

Here is the source code. https://github.com/shiraji/plugin-repository-rest-client/tree/upload_screenshots

Question

Could you tell me how I can upload screenshots without csrf token? like what uploading plugin module did.

Thanks in advance.

@shiraji shiraji changed the title Supporting uploading screenshots Support uploading screenshots Jan 8, 2017
@mikhailvink
Copy link
Member

Hi,

Uploading screenshots without the CSRF token via the REST API is not possible at this moment and will require some implementation from our side which we are ready to make, but the question is - what behavior would you expect from uploadScreenshot if there are existing screenshots for the plugin? Options are: remove all current screenshots and upload new ones; add new screenshots to existing ones; replace existing if the name is the same + upload new ones; some other scenario?

Thanks!

@shiraji
Copy link
Author

shiraji commented Feb 7, 2017

Either way is fine (if you guys give us a doc 😉 ). If it's possible, I would like to have 2 features.

  • replace existing if the name is the same + upload new ones
  • delete all screenshots (only deleting is fine, since developer could upload new screenshots using above feature.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants