Comments (5)
@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
-
add flag licenceState to Tenant entity (smallint) + constants for statuses
STATUS_UNKNOWN (default)
STATUS_ACTIVE
STATUS_EXPIRED -
in Listener/LicenceListener if system get "lic" field - update licence status in Tenant entity
-
add console command CheckLicenceCommand, it get all tenants and update states using code like
$tenant = $this->getContainer()->get("doctrine")->getManager()->find("AtlassianConnectBundle:Tenant",1);
$jwtRequest = new JWTRequest($tenant);
var_dump($jwtRequest->get("/rest/atlassian-connect/latest/addons/".$tenant->getAddonKey()));
SAMPLE REST RESPONSE
array(5) {
["key"]=>
string(33) "...skipped..."
["version"]=>
string(8) "1.0.0-AC"
["state"]=>
string(7) "ENABLED"
["host"]=>
array(2) {
["product"]=>
string(4) "JIRA"
["contacts"]=>
array(1) {
[0]=>
array(2) {
["name"]=>
string(6) "Andrew"
["email"]=>
string(21) "...skipped..."
}
}
}
["links"]=>
array(2) {
["marketplace"]=>
array(1) {
[0]=>
array(1) {
["href"]=>
string(75) "...skipped..."
}
}
["self"]=>
array(1) {
[0]=>
array(1) {
["href"]=>
string(94) "...skipped..."
}
}
}
}
What do you think about such an implementation?
from atlassian-connect-bundle.
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
from atlassian-connect-bundle.
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.
from atlassian-connect-bundle.
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?
from atlassian-connect-bundle.
@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.
from atlassian-connect-bundle.
Related Issues (18)
- Tests HOT 3
- Add new tag HOT 1
- ACT_AS_USER scope HOT 8
- Configure SensioLabs checker HOT 2
- Do not use Router::getRouteCollection() HOT 1
- Error installing the bundle on Symfony 4.2 with Flex HOT 5
- Missing documentation about authentication and scope HOT 1
- Branch strategy and Symfony compatibility HOT 1
- [4.0] Remove Legacy Authenticator when guards are not available
- [4.0] Move to PHP CS Fixer
- [4.0] Use typed properties
- Remove dev / prod config split
- [4.0] Use static analysis tool
- [4.0] Add upgrade guide
- Use firebase/jwt version 6
- Security vulnerability HOT 3
- Easy extend HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from atlassian-connect-bundle.