Documentation
Upgrade atlassian-connect-play-java
If you are creating a new atlassian-connect-play-java (AC Play) add-on, then all you need to do is follow the instructions in the
readme of AC Play.
If you have an existing Connect add-on using AC Play 0.6.x, follow these steps to update.
Upgrade AC Play
In your project/Build.scala file, change the AC Play dependency to
"com.atlassian.connect" % "ac-play-java_2.10" % "0.7.0-BETA7"
Play 2.2
In version 0.6.4 of AC Play was upgraded to version 2.2. The following changes are required:
- edit
project/build.properties. Change the contents tosbt.version=0.13.0 If you have used JsonNode and related classes then you'll need to make the following updates as Play has changed the implementation that it uses
a. Change all the imports to
import com.fasterxml.jackson.databind.*;b. Drop the "get" from all the property access. e.g.
jsonNode.getFieldNames() -> jsonNode.fieldNames()- Consult the Play 2.2 Migration Guide
JSON Descriptor
Rename
atlassian-plugin.xmltoatlassian-connect.jsonper our migration guidea. make sure you remove any
&characters from the url as it is required in xml but breaks in json b. Permissions need to be migrated to scopes c. You must have the lifecycleinstalledevent registered to/installedUpdate your
Applicationclass to invoke theACController's json descriptor method. The end result should look something like:
private static Supplier descriptor()
{
return new Supplier()
{
@Override
public Result get()
{
return AcController.descriptor();
}
};
}
JWT
The JWT authentication mechanism is covered in detail in the authentication documentation.
- Make sure that you specify
jwtas the authentication mechanism in your descriptor. e.g."authentication": { "type": "jwt" } - add a new database evolution file with the following contents
alter table ac_host add column sharedSecret varchar(512); - Anywhere that you have used
@CheckValidOAuthRequestchange it to@AuthenticateJwtRequest.@AuthenticateJwtRequest public Result index() throws Exception { ... }
Troubleshooting
To simplify debugging we recommend that you increase the logging levels of the atlassian connect modules.
logger.ac=TRACE
Similarly it is recommended to increase the logging level of the jwt components in the host product. e.g.
logger.com.atlassian.jwt=TRACE