From 650ebd670adeec4eb8a266c1e93018201e548c45 Mon Sep 17 00:00:00 2001 From: Ed Date: Mon, 23 Sep 2024 06:15:52 -0400 Subject: [PATCH 1/3] Bump checklist container to rockylinux:8 --- .github/workflows/run-int-dev-checklist.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/run-int-dev-checklist.yml b/.github/workflows/run-int-dev-checklist.yml index ffa86d7..80e76bd 100644 --- a/.github/workflows/run-int-dev-checklist.yml +++ b/.github/workflows/run-int-dev-checklist.yml @@ -7,7 +7,7 @@ on: jobs: run-integration-development-checklist: runs-on: ubuntu-latest - container: 'centos:7' + container: 'rockylinux:8' steps: - uses: actions/checkout@v2 From 08494a4d949e156eca8ae2cf48a1411b5ad5ea9c Mon Sep 17 00:00:00 2001 From: Ed Date: Mon, 23 Sep 2024 06:16:32 -0400 Subject: [PATCH 2/3] Add App URL option --- README.md | 8 ++++++-- config/config.js | 14 ++++++++++++-- config/config.json | 24 +++++++++++++++++++++--- integration.js | 5 +++-- templates/confluence-block.hbs | 8 ++++---- 5 files changed, 46 insertions(+), 13 deletions(-) diff --git a/README.md b/README.md index f882b65..19f0644 100644 --- a/README.md +++ b/README.md @@ -6,9 +6,9 @@ The Polarity Confluence integration allows Polarity to search Confluence to retu ## Confluence Integration Options -### Confluence URL +### Confluence Base/API URL -Your Confluence Base Url to include the schema (i.e., https://) and port if required. +Your Confluence Base/API Url to include the schema (i.e., https://) and port if required. For example: @@ -16,6 +16,10 @@ For example: https://mycompany.atlassian.net/wiki ``` +### Confluence Application URL + +URL used to access your Confluence web application instance. Leave blank if your Application URL is the same as your Base/API URL. Confluence Cloud users can leave this option blank. This option must be set to "Lock and show option for all users" or "User provides option value". + ### Confluence Version Select the version of Confluence you are authenticating to. diff --git a/config/config.js b/config/config.js index 7a90811..0751742 100644 --- a/config/config.js +++ b/config/config.js @@ -22,7 +22,7 @@ module.exports = { * @optional */ description: 'Lookup Confluence pages by keywords or phrases', - entityTypes: ['*'], + entityTypes: ['IPv4', 'IPv6', 'IPv4CIDR', 'MD5', 'SHA1', 'SHA256', 'url', 'domain', 'email', 'cve'], // customTypes: [ // { // key: 'possiblyDefangedUrl', @@ -75,7 +75,7 @@ module.exports = { ca: '', // An HTTP proxy to be used. Supports proxy Auth with Basic Auth, identical to support for // the url parameter (by embedding the auth info in the uri) - proxy: "" + proxy: '' }, /** * Options that are displayed to the user/admin in the Polarity integration user-interface. Should be structured @@ -95,6 +95,16 @@ module.exports = { userCanEdit: false, adminOnly: true }, + { + key: 'appUrl', + name: 'Confluence Application URL', + description: + 'URL used to access your Confluence web application instance. Leave blank if your Application URL is the same as your API URL. Confluence Cloud users can leave this option blank. This option must be set to "Lock and show option for all users" or "User provides option value".', + default: '', + type: 'text', + userCanEdit: false, + adminOnly: false + }, { key: 'confluenceType', name: 'Confluence Version', diff --git a/config/config.json b/config/config.json index d366e50..299dc62 100644 --- a/config/config.json +++ b/config/config.json @@ -1,10 +1,18 @@ { - "polarityIntegrationUuid": "c2e3f2a0-cce1-11ed-aeee-075d3490155d", "name": "Confluence", "acronym": "CONF", "description": "Lookup Confluence pages by keywords or phrases", "entityTypes": [ - "*" + "IPv4", + "IPv6", + "IPv4CIDR", + "MD5", + "SHA1", + "SHA256", + "url", + "domain", + "email", + "cve" ], "defaultColor": "light-gray", "styles": [ @@ -38,6 +46,15 @@ "userCanEdit": false, "adminOnly": true }, + { + "key": "appUrl", + "name": "Confluence Application URL", + "description": "URL used to access your Confluence web application instance. Leave blank if your Application URL is the same as your API URL. Confluence Cloud users can leave this option blank. This option must be set to \"Lock and show option for all users\" or \"User provides option value\".", + "default": "", + "type": "text", + "userCanEdit": false, + "adminOnly": false + }, { "key": "confluenceType", "name": "Confluence Version", @@ -142,5 +159,6 @@ "userCanEdit": false, "adminOnly": true } - ] + ], + "polarityIntegrationUuid": "c2e3f2a0-cce1-11ed-aeee-075d3490155d" } \ No newline at end of file diff --git a/integration.js b/integration.js index 8d2757a..4bcd829 100644 --- a/integration.js +++ b/integration.js @@ -183,6 +183,7 @@ function _lookupEntity(entityObj, options, cb) { let pageData = []; let spaceData = []; + let appUrl = options.appUrl.length > 0 ? options.appUrl : options.baseUrl; options.baseUrl = options.baseUrl.endsWith('/') ? options.baseUrl.slice(0, -1) : options.baseUrl; let uri = `${options.baseUrl}/rest/api/search`; let url = options.baseUrl; @@ -286,14 +287,14 @@ function _lookupEntity(entityObj, options, cb) { summary: getSummaryTags(spaceData, pageData, blogData, attachments, options), // Data that you want to pass back to the notification window details block details: { - url: url, + appUrl: appUrl, space: spaceData, page: pageData, blog: blogData, attachments: attachments, totalSize: body.totalSize, size: body.size, - searchLink: `${options.baseUrl}/search?text=${cql}`, + searchLink: `${appUrl}/search?text=${cql}`, searchTypesString: getSearchTypesString(options) } } diff --git a/templates/confluence-block.hbs b/templates/confluence-block.hbs index a582931..ba3c21f 100644 --- a/templates/confluence-block.hbs +++ b/templates/confluence-block.hbs @@ -16,7 +16,7 @@ {{#each data.space as |space|}} {{#if space.space.name}}
- +