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 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/package-lock.json b/package-lock.json index 9997fb4..87e50bf 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "Confluence", - "version": "3.3.1", + "version": "3.4.0", "lockfileVersion": 1, "requires": true, "dependencies": { @@ -26,9 +26,9 @@ } }, "@postman/tunnel-agent": { - "version": "0.6.3", - "resolved": "https://registry.npmjs.org/@postman/tunnel-agent/-/tunnel-agent-0.6.3.tgz", - "integrity": "sha512-k57fzmAZ2PJGxfOA4SGR05ejorHbVAa/84Hxh/2nAztjNXc4ZjOm9NUIk6/Z6LCrBvJZqjRZbN8e/nROVUPVdg==", + "version": "0.6.4", + "resolved": "https://registry.npmjs.org/@postman/tunnel-agent/-/tunnel-agent-0.6.4.tgz", + "integrity": "sha512-CJJlq8V7rNKhAw4sBfjixKpJW00SHqebqNUQKxMoepgeWZIbdPcD+rguRcivGhS4N12PymDcKgUgSD4rVC+RjQ==", "requires": { "safe-buffer": "^5.0.1" } @@ -58,9 +58,9 @@ "integrity": "sha512-NfJ4UzBCcQGLDlQq7nHxH+tv3kyZ0hHQqF5BO6J7tNJeP5do1llPr8dZ8zHonfhAu0PHAdMkSo+8o0wxg9lZWw==" }, "async": { - "version": "3.2.4", - "resolved": "https://registry.npmjs.org/async/-/async-3.2.4.tgz", - "integrity": "sha512-iAB+JbDEGXhyIUavoDl9WP/Jj106Kz9DEn1DPgYw5ruDn0e3Wgi3sKFm55sASdGBNOQB8F59d9qQ7deqrHA8wQ==" + "version": "3.2.6", + "resolved": "https://registry.npmjs.org/async/-/async-3.2.6.tgz", + "integrity": "sha512-htCUDlxyyCLMgaM3xXg0C0LW2xqfuQ6p05pCEIsXuyQ+a1koYKTuBMzRNwmybfLgvJDMd0r1LTn4+E0Ti6C2AA==" }, "asynckit": { "version": "0.4.0", @@ -73,9 +73,9 @@ "integrity": "sha512-08kcGqnYf/YmjoRhfxyu+CLxBjUtHLXLXX/vUfx9l2LYzG3c1m61nrpyFUZI6zeS+Li/wWMMidD9KgrqtGq3mA==" }, "aws4": { - "version": "1.12.0", - "resolved": "https://registry.npmjs.org/aws4/-/aws4-1.12.0.tgz", - "integrity": "sha512-NmWvPnx0F1SfrQbYwOi7OeaNGokp9XhzNioJ/CSBs8Qa4vxug81mhJEAVZwxXuBmYB5KDRfMq/F3RR0BIU7sWg==" + "version": "1.13.2", + "resolved": "https://registry.npmjs.org/aws4/-/aws4-1.13.2.tgz", + "integrity": "sha512-lHe62zvbTB5eEABUVi/AwVh0ZKY9rMMDhmm+eeyuuUQbQ3+J+fONVQOZyj+DdrvD4BY33uYniyRJ4UJIaSKAfw==" }, "base64-js": { "version": "1.5.1", @@ -270,13 +270,13 @@ "integrity": "sha512-7EAHlyLHI56VEIdK57uwHdHKIaAGbnXPiw0yWbarQZOKaKpvUIgW0jWRVLiatnM+XXlSwsanIBH/hzGMJulMow==" }, "postman-request": { - "version": "2.88.1-postman.33", - "resolved": "https://registry.npmjs.org/postman-request/-/postman-request-2.88.1-postman.33.tgz", - "integrity": "sha512-uL9sCML4gPH6Z4hreDWbeinKU0p0Ke261nU7OvII95NU22HN6Dk7T/SaVPaj6T4TsQqGKIFw6/woLZnH7ugFNA==", + "version": "2.88.1-postman.40", + "resolved": "https://registry.npmjs.org/postman-request/-/postman-request-2.88.1-postman.40.tgz", + "integrity": "sha512-uE4AiIqhjtHKp4pj9ei7fkdfNXEX9IqDBlK1plGAQne6y79UUlrTdtYLhwXoO0AMOvqyl9Ar+BU6Eo6P/MPgfg==", "requires": { "@postman/form-data": "~3.1.1", "@postman/tough-cookie": "~4.1.3-postman.1", - "@postman/tunnel-agent": "^0.6.3", + "@postman/tunnel-agent": "^0.6.4", "aws-sign2": "~0.7.0", "aws4": "^1.12.0", "brotli": "^1.3.3", @@ -304,9 +304,9 @@ "integrity": "sha512-E/ZsdU4HLs/68gYzgGTkMicWTLPdAftJLfJFlLUAAKZGkStNU72sZjT66SnMDVOfOWY/YAoiD7Jxa9iHvngcag==" }, "punycode": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.0.tgz", - "integrity": "sha512-rRV+zQD8tVFys26lAGR9WUuS4iUAngJScM+ZRSKtvl5tKeZ2t5bvdNFdNHBW9FWR4guGHlgmsZ1G7BSm2wTbuA==" + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.1.tgz", + "integrity": "sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==" }, "qs": { "version": "6.5.3", @@ -334,9 +334,9 @@ "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==" }, "sshpk": { - "version": "1.17.0", - "resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.17.0.tgz", - "integrity": "sha512-/9HIEs1ZXGhSPE8X6Ccm7Nam1z8KcoCqPdI7ecm1N33EzAetWahvQWVqLZtaZQ+IDKX4IyA2o0gBzqIMkAagHQ==", + "version": "1.18.0", + "resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.18.0.tgz", + "integrity": "sha512-2p2KJZTSqQ/I3+HX42EpYOa2l3f8Erv8MWKsy2I9uf4wA7yFIkXRffYdsx86y6z4vHtV8u7g+pPlr8/4ouAxsQ==", "requires": { "asn1": "~0.2.3", "assert-plus": "^1.0.0", diff --git a/package.json b/package.json index 9ebf33a..e5e5a32 100644 --- a/package.json +++ b/package.json @@ -1,11 +1,11 @@ { "name": "Confluence", - "version": "3.3.1", + "version": "3.4.0", "main": "./integration.js", "private": true, "dependencies": { - "async": "^3.2.4", + "async": "^3.2.6", "lodash": "^4.17.21", - "postman-request": "^2.88.1-postman.33" + "postman-request": "^2.88.1-postman.40" } } 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}}
-
{{space.space.name}}
+
{{space.space.name}}
{{space.resultGlobalContainer.title}}
Updated: {{moment-format space.lastModified "YYYY-MM-DD" timeZone=timezone}}
@@ -33,7 +33,7 @@ {{#each data.page as |page|}} {{#if page.content.title}}
- +