Skip to content

Conversation

@martindstone
Copy link
Contributor

Background

Confluence plugin had a hardcoded URL, marketplace plugins need to work without being recompiled.

This PR

Removed the hardcoded URL and added code to get the URL from a plugin config entity; added instructions to create the plugin config entity if it's not found.

Checklists

Security

  • Security impact of change has been considered
  • Code follows company security practices and guidelines

if (!context?.apiBaseUrl) {
return;
}
const getConfluencePluginConfig = async (): Promise<void> => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think in the long run we'll want to add an abstraction into @cortexapps/plugin-core to retrieve configuration bundles, but for our PoC I think this works, just adding the comment for posterity.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

agreed, ideally we would have some boilerplate to show if various things went horribly wrong


### Set your Confluence credentials

If you are using username and password authentication, type them in to a text editor with a colon (`:`) between them. If you are using SSO, use an API token in place of the password. To create an API token in Confluence by clicking on Security > Create and manage API tokens > Create API token. Once you have your text in your text editor like `myusername@example.com:MySecretPassWordOrToken`, you need to base64 encode it. You can do this using an online tool like [this](https://www.base64encode.org). You will add the base64 encoded value to Cortex as a secret. Copy the base64 encoded value. In Cortex, click on Settings > Secrets > Add secret. In Secret name, type `confluence_secret`, paste the base64 encoded secret into Secret value, and click on Create secret.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nitpick, typo, should be: "To create an API tolein in Confluence, click on Security > Create"


### Set your Confluence credentials

If you are using username and password authentication, type them in to a text editor with a colon (`:`) between them. If you are using SSO, use an API token in place of the password. To create an API token in Confluence by clicking on Security > Create and manage API tokens > Create API token. Once you have your text in your text editor like `myusername@example.com:MySecretPassWordOrToken`, you need to base64 encode it. You can do this using an online tool like [this](https://www.base64encode.org). You will add the base64 encoded value to Cortex as a secret. Copy the base64 encoded value. In Cortex, click on Settings > Secrets > Add secret. In Secret name, type `confluence_secret`, paste the base64 encoded secret into Secret value, and click on Create secret.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, depending on the version and tenant type of Confluence, they may not have an ability to create the API Keys from Confluence Settings and instead will need to navigate to Profile Menu (upper right) -> Account -> Security -> API Tokens. We could provide both, and then link to Atlassian Docs: https://support.atlassian.com/atlassian-account/docs/manage-api-tokens-for-your-atlassian-account/

Copy link
Contributor

@jreock jreock left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@jreock jreock merged commit b78f809 into master Nov 19, 2024
2 checks passed
@jreock jreock deleted the fix-confluence-plugin branch November 19, 2024 14:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants