Skip to content

Commit 8cf60af

Browse files
Arc-2030 convert markdown to html (#23)
Co-authored-by: Michel Boudreau <[email protected]>
1 parent d734153 commit 8cf60af

19 files changed

+283
-96
lines changed

package.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,12 @@
2222
},
2323
"dependencies": {
2424
"@commonify/lowdb": "^3.0.0",
25+
"@types/marked": "^4.0.8",
2526
"atlassian-jwt": "^2.0.2",
2627
"express": "^4.18.2",
2728
"lodash": "^4.17.21",
29+
"marked": "^4.2.12",
30+
"sanitize-html": "^2.10.0",
2831
"squirrelly": "^8.0.8",
2932
"uuid": "^9.0.0"
3033
},

src/content/api-requests.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
### Making API requests
1+
# Making API requests
22

33
If you need to make API requests, this can be easily achieved via any HTTP client library or API designed
44
for making API requests. The key to successfully making API requests from your Connect add-on is ensuring
55
you create a JWT token, based on the `sharedSecret`, and include this token in your header. Please refer
66
to our documentation for more information on
77
[JWTs for Connect app](https://developer.atlassian.com/cloud/jira/platform/understanding-jwt-for-connect-apps/).
88

9-
#### Jira and Confluence REST APIs
9+
## Jira and Confluence REST APIs
1010
Both [Jira](https://developer.atlassian.com/cloud/jira/software/rest/intro/#introduction)
1111
and [Confluence](https://developer.atlassian.com/cloud/confluence/using-the-rest-api/) provide an extensive
1212
REST API to build add-ons.

src/content/authentication.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
### Auth with JWT and Storage
1+
# Auth with JWT and Storage
22

33
Atlassian Connect authenticates apps using JWT tokens. At installation time, the Connect app and the Atlassian host
44
product exchange a security context containing an installation secret used to create and validate JWT tokens for use
@@ -12,7 +12,7 @@ were altered in transit (integrity).
1212

1313
- **_JWT requires installed lifecycle event:_** For veritification of the JWT token to work, you need to have included the lifecycle event `installed` in your app descriptor.
1414

15-
#### How to leverage Atlassian Connect's authentication feature:
15+
## How to leverage Atlassian Connect's authentication feature:
1616

1717
1. Declare that the app uses JWT as the authentication mechanism in the app descriptor e.g.
1818
```
@@ -27,7 +27,7 @@ were altered in transit (integrity).
2727
> If you have no security on your endpoints you have the option to set the authentication type to 'none' in your app descriptor. However, we strongly recommend you do not do this and instead set the type to 'jwt' as referenced above.
2828
2929

30-
#### Installation handshake
30+
### Installation handshake
3131

3232
When an administrator installs the app in an Atlassian cloud instance, Connect initiates an "installation handshake" - a way for
3333
the Atlassian application and the app to exchange keys stored on both sides for future API calls.
@@ -40,7 +40,7 @@ contained in this security context include:
4040

4141
> **_NOTE:_** The installation handshake only occurs when you are using the optional [lifecycle event](https://developer.atlassian.com/platform/forge/events-reference/life-cycle/) `installed`.
4242
43-
#### Signing of the Lifecycle Callbacks
43+
### Signing of the Lifecycle Callbacks
4444

4545
When JWT authentication is used the lifecycle callbacks are signed using a shared secret.
4646

@@ -51,7 +51,7 @@ When JWT authentication is used the lifecycle callbacks are signed using a share
5151
| Uninstall, Enable and Disable | The shared secret sent in the preceding `installed` callback. |
5252
| First install after being uninstalled | The shared secret sent in the preceding installed callback. This allows apps to allow the new installation to access previous tenant data (if any exists). A valid signature demonstrates that the sender is in possession of the shared secret from when the old tenant data was accessed. |
5353

54-
#### Authentication how-to
54+
### Authentication how-to
5555

5656
**Creating the app descriptor**
5757

@@ -82,7 +82,7 @@ For example:
8282
8383
**Installation data**
8484
When the app is installed, the Atlassian application invokes a callback endpoint exposed by the app. The request
85-
contains a payload with important tenant information that you will need to store in your app in order to sign
85+
contains a payload with important tenant information that you will need to store in your app in order to sign
8686
and verify future requests e.g.
8787

8888
```
@@ -129,7 +129,7 @@ These steps must be executed before processing the request, and the request must
129129
For more details on how to decode and validate a JWT token, see [Decoding and Verifying a JWT Token](https://developer.atlassian.com/cloud/bitbucket/understanding-jwt-for-apps/#decoding-and-verifying-a-jwt-token),
130130
which also provides a comprehensive list of claims supported by Atlassian products that you need to validate.
131131

132-
#### Atlassian JWT libraries
132+
### Atlassian JWT libraries
133133

134134
In this sample app, we use the [atlassian-jwt](https://www.npmjs.com/package/atlassian-jwt) library to create a middleware
135135
called `connectIframeJWTMiddleware`, which decodes the JWT token from Jira, verifies it and sets the `clientKey` in `res.locals`.
@@ -142,10 +142,10 @@ The tenant (Jira site) for each instance of the app is recognized based on this
142142
- verify the query string hash
143143
- save the jiraTenant to `res.locals` to be used later if all verifications pass
144144

145-
#### Customer Specific Storage
145+
## Customer Specific Storage
146146

147147
When it comes to storing data for your authenticated Connect add-on, you have a couple of options:
148148
- use the [add-on properties REST API](https://developer.atlassian.com/cloud/confluence/app-properties-api/)
149149
- storing data with entity properties
150150
- [Jira](https://developer.atlassian.com/cloud/jira/platform/storing-data-with-entity-properties/)
151-
- [Confluence](https://developer.atlassian.com/cloud/confluence/confluence-entity-properties/)
151+
- [Confluence](https://developer.atlassian.com/cloud/confluence/confluence-entity-properties/)

src/content/config.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
### Atlassian Connect JSON
1+
# Atlassian Connect JSON
22

33
When you create a Connect app you'll need to include an app descriptor JSON file. This is what you'll use to
44
provide information to Atlassian about your application, also known as an add-on. In this sample app you'll find
@@ -37,6 +37,6 @@ more detail in **Lifecycle Events**
3737
[Confluence](https://marketplace.atlassian.com/apps/1215092/web-fragment-finder-for-confluence?hosting=cloud&tab=overview)
3838
- `name`: a human-readable name for the page
3939

40-
Please refer to our [documentation](https://developer.atlassian.com/cloud/jira/platform/connect-app-descriptor/#authentication)
40+
Please see below for the app descriptor used in this example. Additionally, refer to our [documentation](https://developer.atlassian.com/cloud/jira/platform/connect-app-descriptor/#authentication)
4141
for more Connect app description information.
4242

src/content/connect-js.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
### Connect JavaScript API
1+
# Connect JavaScript API
22

33
Connect apps extend Jira and Confluence by adding a custom iframe into the products' web pages. This iframe instance is
44
on a different domain or hostname from the parent page and so is a
@@ -14,8 +14,6 @@ iframe to interact with the underlying platform APIs.
1414

1515
> **_iframes and 3rd party cookies:_** Since the app is sandboxed in an iframe, and most browsers are now blocking 3rd party cookies, you shouldn't rely on cookies within your app.
1616
17-
#### How to use the Connect JS API
18-
1917
You'll need to include the following in any JS file you wish to have access to the API:
2018

2119
```

src/content/introduction.md

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,17 @@
1-
### Introduction
1+
# Introduction
22

33
Welcome to the Node.js Connect sample app! This sample app has been built to help you and your team get up-and-running faster
44
by providing examples of the key features, functionality and things you'll need to create a
55
[Connect](https://developer.atlassian.com/cloud/bitbucket/faqs/#:~:text=Atlassian%20Connect%20is%20a%20distributed,wherever%2C%20whenever%2C%20and%20however)
66
app. In this sample app you'll find information about the following:
77

8-
- **Atlassian Connect JSON**: what it is, an example of an Atlassian Connect JSON file, and a link to where you can get more information
9-
- **Lifecycle Events**: outline of what lifecycle events are supported, an example of how to use them, and a link to documentation
10-
- **Connect Modules**: we'll explain how you can use these modules to extend to functionality of the Jira platform or a Jira application
11-
- **Auth with JWT and Storage**: this section will provide information about the iFrame (where your app will render), verification, and the JWT library
12-
- **Making Jira API requests**: we'll provide some examples and give you a link to documentation
13-
- **Connect JS library**: what it is, why you need it
14-
- **How to list your app in Marketplace**: we'll give you a rundown of how to get your app into our Marketplace
8+
- [**Atlassian Connect JSON**](/acn-config): what it is, an example of an Atlassian Connect JSON file, and a link to where you can get more information
9+
- [**Lifecycle Events**](/acn-lifecycle-events): outline of what lifecycle events are supported, an example of how to use them, and a link to documentation
10+
- [**Webhooks**](/acn-logs-webhooks): you'll get an overview of what needs to be included when working with webhooks and find links on how to register webhooks,
11+
and what webhooks are available.
12+
- [**Connect Modules**](/acn-modules): we'll explain how you can use these modules to extend to functionality of the Jira platform or a Jira application
13+
- [**Auth with JWT and Storage**](/acn-authentication): this section will provide information about the iFrame (where your app will render), verification, and the JWT library
14+
- [**Making Jira API requests**](/acn-api-requests): we'll provide some examples and give you a link to documentation
15+
- [**Connect JS library**](/acn-js-library): what it is and why you need it
16+
- [**How to list your app in Marketplace**](/acn-marketplace): we'll give you a rundown of how to get your app into our Marketplace
1517

src/content/lifecycle-events.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
### Lifecycle Events
1+
# Lifecycle Events
22

33
As outlined in **Atlassian Connect JSON**, lifecycle events allow an app to register callbacks for events that occur
44
in the lifecycle of an installation. These include:
@@ -12,7 +12,7 @@ in the lifecycle of an installation. These include:
1212
}
1313
```
1414

15-
#### A brief overview of the 4 lifecycle events
15+
## A brief overview of the 4 lifecycle events
1616
- `installed`: the installed lifecycle callback is an integral part of the installation process of an app, whereas the
1717
remaining lifecycle events are essentially webhooks. This event is triggered when an app is installed or upgraded,
1818
you rotate your shared secret, the baseUrl is changed (site rename), or after a site import. This is the only lifecycle
@@ -24,7 +24,7 @@ or upgrade. This event will not be triggered for any other type of installed lif
2424

2525
For more information on lifecycle events, please refer to our [documentation](https://developer.atlassian.com/cloud/jira/platform/connect-app-descriptor/#lifecycle).
2626

27-
#### Validating installation lifecycle requests
27+
## Validating installation lifecycle requests
2828
An installation secret will be exchanged every time your app is installed or updated. To secure this key exchange
2929
process, the `install` and `uninstall` lifecycle events include JWT tokens in the Authorization header. This JWT token
3030
will be signed with a private key using the RS256(RSA-SHA256) algorithm.
@@ -33,4 +33,4 @@ To retrieve the publicKey, make a request to the CDN with the kid parameter supp
3333
example, `https://connect-install-keys.atlassian.com/kid`
3434

3535
The best way to see how JWT tokens work with your lifecycle events is to use the [Connect inspector](http://go.atlassian.com/connect-inspector)
36-
to create a temporary app, install it in your cloud development environment and watch the lifecycle events.
36+
to create a temporary app, install it in your cloud development environment and watch the lifecycle events.

src/content/marketplace.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
### Marketplace
1+
# Marketplace
22

33
Congratulations! You've finished building your app and unleash it into the wild. But before it goes public you'll need to
44
ensure you meet our [approval guidelines](https://developer.atlassian.com/platform/marketplace/app-approval-guidelines/).

src/content/modules.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
### Connect Modules for Jira
1+
# Connect Modules for Jira
22

33
As mentioned in our **Introduction**, modules can be used to extend the functionality of the Jira/Confluence platform or a Jira/Confluence
44
application. They are commonly used to extend the user interface by adding links, panels, or pages, or to extend
@@ -23,9 +23,9 @@ To use a Connect module you can either declare it in your app descriptor e.g.
2323
or, for some modules, you can register them dynamically using the
2424
[REST API](https://developer.atlassian.com/cloud/jira/platform/dynamic-modules).
2525

26-
#### iframes
26+
## iframes
2727

28-
Atlassian Connect creates an iframe, which it reuses across modules, and passes information to the app using query parameters in
28+
Atlassian Connect creates an iframe, which it reuses across modules, and passes information to the app using query parameters in
2929
the iframe URL. Here is a simplified example of this:
3030

3131
```
@@ -36,7 +36,7 @@ the iframe URL. Here is a simplified example of this:
3636

3737
Please refer to our documentation for information about [Opting in to cacheable iframes](https://developer.atlassian.com/cloud/confluence/cacheable-app-iframes-for-connect-apps/#opting-in-to-cacheable-iframes).
3838

39-
#### Jira modules
39+
## Jira modules
4040

4141
For Jira, there are 2 types of modules:
4242
- **basic iFrames** these include [location-based modules](https://developer.atlassian.com/cloud/jira/platform/about-connect-modules-for-jira/#location-based-modules),
@@ -47,15 +47,15 @@ these allow you to extend specific Jira features such as the issue tab panel and
4747
items.
4848

4949
Please refer to our documentation for more information on [Jira modules](https://developer.atlassian.com/cloud/jira/platform/about-connect-modules-for-jira/.
50-
51-
#### Connect modules
50+
Connect modules
51+
##
5252

5353
Connect modules allow Connect apps to extend the Confluence user interface, create custom Macros or content, handle event
5454
listening (webhooks), and even run scripts or other code. For more information, please refer to our
5555
[Confluence modules](https://developer.atlassian.com/cloud/confluence/about-connect-modules-for-confluence/#add-modules-to-your-connect-app)
5656
documentation.
5757

58-
#### A Module Example
58+
## A Module Example
5959

6060
One module that you may find valuable is the [Security Information module](https://developer.atlassian.com/cloud/jira/platform/modules/security-information/).
6161
This module makes it possible to turn unplanned vulnerabilities into planned and tracked work.

src/content/webhooks.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
### Webhooks
1+
# Webhooks
22

33
A webhook is an HTTP request, triggered by an event in a source system and sent to a destination system, often with a
44
payload of data. Webhooks are automated, in other words they are automatically sent out when their event is fired in the
@@ -12,11 +12,13 @@ use the HTTPS protocol. There is a limit of 5 redirects per url.
1212
- the **scope** of the webhook (optional): for example either "all issues" or a limited set of issues specified by JQL
1313
("project = TEST and fixVersion = future")
1414

15-
#### Registering a webhook
15+
## Registering a webhook
1616
Webhooks can be manually created in
1717
[Jira administration](https://support.atlassian.com/jira-cloud-administration/docs/manage-webhooks/), via
1818
[registered by]() `/rest/webhooks/1.0/webhook`, or by declaring a
1919
[webhook module](https://developer.atlassian.com/cloud/jira/platform/modules/webhook/) in the app description.
2020

2121
For more information about webhooks, and for a full list of available webhooks, please refer to our
22-
[documentation](https://developer.atlassian.com/cloud/jira/platform/webhooks/#registering-a-webhook-using-the-jira-rest-api--other-integrations-).
22+
[documentation](https://developer.atlassian.com/cloud/jira/platform/webhooks/#registering-a-webhook-using-the-jira-rest-api--other-integrations-).
23+
24+
## Example logs:

0 commit comments

Comments
 (0)