Open thecatontheflat opened 9 years ago
Hey @zhil
does atlassian connect have hook for licence activation/deactivation?
I think I was referring to connect_addon_disabled
and connect_addon_enabled
hooks.
we do not get "lic" flag in _GET request
Most likely you're not getting lic
param in the query, because you don't set license enabled in your descriptor. Could you confirm it is not the case?
Regarding storing the license in the Tenant — I am not sure about this, because I would like to rely on the request data. If you need to double-check the license status — you should request a license
end-point
@thecatontheflat
I think I was referring to connect_addon_disabled and connect_addon_enabled hooks.
well, as I understand, enabling/disabling licence is actually not the same, as licence expiration. But I will test it more
Most likely you're not getting lic param in the query, because you don't set license enabled in your descriptor. Could you confirm it is not the case?
Its not the case. Jira simply doesnt set that flag for webhooks.
Regarding storing the license in the Tenant — I am not sure about this, because I would like to rely on the request data. If you need to double-check the license status — you should request a license
We get a lot of webhook calls, checking licence each time is not a solution. It should be either updated by hook or checked from cron. Anyway, licence state should be stored somewhere, tenant entity looks like logical location.
Ah, I didn't get it at first that the flag is missing in the webhook.
Yeah, in this case I think your proposal would work.
I suggest to store licenseEnabled
as nullable boolean instead of having 3 states there. NULL would stand for the unknown.
What do you think?
@thecatontheflat I will need to do some tests and check if enabled/disabled is the same as expired/active. If its the same - nullable boolean licenseEnabled would work If its not the same - probably I will add some flag like status with const null = unknown STATUS_ACTIVE STATUS_EXPIRED STATUS_DISABLED
because expired and disabled states plugin could handle in different ways.
@thecatontheflat just wonder - does atlassian connect have hook for licence activation/deactivation?
Right now we use this bundle for cloud application and we do not get "lic" flag in _GET request. As a solution I propose such a way
1) add flag licenceState to Tenant entity (smallint) + constants for statuses STATUS_UNKNOWN (default) STATUS_ACTIVE STATUS_EXPIRED
2) in Listener/LicenceListener if system get "lic" field - update licence status in Tenant entity
3) add console command CheckLicenceCommand, it get all tenants and update states using code like
SAMPLE REST RESPONSE
What do you think about such an implementation?