Atlassian Connect Tooling
Provides authentication & utility methods for Atlassian Connect apps running on Express or solutions with a compatible
API like Firebase Cloud Functions.
Motivation
Atlassian Connect is a development framework for extending Atlassian cloud products. Operating a Connect app requires
the constant adaption of new security standards and authentication mechanisms provided by Atlassian.
There are two official libraries that automatically comply with new requirements (Atlassian Connect Spring Boot and
Atlassian Connect Express).
Atlassian Connect Express comes along with a whole development setup and is a bit biased on what databases to use. As we
are using our own backend (GCP) and our Atlassian Connect functionality is just a single piece within a larger
application we could not use this framework as a whole.
Unfortunately Atlassian Connect Express does not export reusable functionality if you have just Express in use. Most
methods within their package require an (unstable to mock) addon
object that is based on the configuration of the
SDK.
This package provides reusable helper methods if you run Atlassian Connect on Express or solutions with a compatible
API like Firebase Cloud Functions.
Features
Composable Install and Uninstall lifecycle hook middleware function
Atlassian announced changes to their Install- and Uninstall-lifecycle hook requirements. From 29th October 2021 these
requests are decrypted asymmetrically.
See announcement
and documentation
.
This packages exports composeAtlassianConnectInstallationMiddleware
to get a middleware function that handles all
this authentication stuff.
Example usage with Express
import {composeAtlassianConnectInstallationMiddleware} from "@seibert/atlassian-connect-tooling";
const installAuthentication = composeAtlassianConnectInstallationMiddleware({baseUrl: "https://example.com"});
app.post('/lifecycle/installed/', [installAuthentication], async (req: Request, res: Response) => {
await handleInstall(req.body);
res.send();
});
app.post('/lifecycle/uninstalled/', [installAuthentication], async (req: Request, res: Response) => {
await handleUninstall(req.body);
res.send();
});
Example usage with Next.js
Express middlewares can be used with Next.js using a wrapper function. See their Connect/Express middleware support documentation
.