Where is macro configuration data stored?

Hi,

I am currently developing a new Confluence application using ACE. The application has a Dynamic Content Macro with a couple of fields that a user can use to configure their application. Once finished inputting their details, the application is rendered on the page.

In my application I am using saveMacro() to save the macro configuration data, like so:

AP.confluence.saveMacro(formattedData, 'Macro body')
AP.confluence.closeMacroEditor()

My question is, where is the data actually stored? And is it secure? I can’t see anywhere that documents this, but I may have missed it

I have a database configured for my application, and the details in my config.json. like the following:

"production": {
    "port": "$PORT",
    "errorTemplate": true,
    "localBaseUrl": "$APPLICATION_URL",
    "store": {
        "type": "postgres",
        "url": "$DATABASE_URL"
    },

When I run queries against my database, all I can see is a “AddonSettings” table with no configuration data. A follow-up question would be, why do I need to setup my own database if the configuration data is not stored there.

Hi @daraleonard :wave:

The confluence macro data is saved in the Confluence database and is made available to your app as context variables in your descriptor or using the AP.confluence.getMacroData() javascript method

In terms of security, this is probably the most secure way to store user data, as it is directly stored in the Confluence database and both security, reliability and availability (incl. backup & restore) is therefor Atlassian responsibility within the shared responsibility model.

Now with regard to the need to have your own database: if you do not intend to store installation lifecycle event payload data, there is no need to have a database.

Hope this helps!

Thanks @remie , that helps a lot.

That’s not super clear from the documentation so thanks for the clarification.

1 Like