craftamap / pluploader

A simple plugin uploader for atlassian server tools written in python
Apache License 2.0
11 stars 1 forks source link

Support private license tokens for cloud #65

Closed EugenMayer closed 3 years ago

EugenMayer commented 3 years ago

During development one would not only need a custom plugin descriptor but also a private access token from the marketplace to license the app. It would be cool if we could add this.

Since we already automate this all, i'am happy to share the snippet. It's ruby DSL in this case, but it wont amtter

    say_status 'ok', 'Activating private access token...'
    options = {
        body: {
            pluginKey: pluginKey,
            state: "ACTIVE_SUBSCRIPTION",
            token: @credentials_cloud_instance['token']
        }.to_json,
        basic_auth: {
            username: @credentials_cloud_instance['admin_user'],
            password: @credentials_cloud_instance['api_key']
        },
        headers: {
            'Content-Type' => 'application/vnd.atl.plugins+json',
        },
    }
    uri = URI.join(@cloud_domain, '/wiki/rest/plugins/1.0/license-tokens')
   HTTParty.post(uri, options)

Seems to be fairly easy to integrate into the current workflow

craftamap commented 3 years ago

Hey @EugenMayer ,

this looks like a great addition to the pluploader license workflow. I will add this, no promises on dates though, as I work on this in my freetime, mostly.

EugenMayer commented 3 years ago

Sure, iam not blocked or anything - we have this automated using our tools already. I just would like to slowly merge efforts :) Take your time