Hi,
I'm developing a Custom UI plugin through Forge for Confluence Cloud.
When I attempt to make some rest call from plugin to Confluence I get:
Refused to connect to 'https://<environment>.atlassian.net/wiki/rest/api/template/page' because it violates the following Content Security Policy directive: "connect-src 'self'".
Do you have any idea of what problem could be?

App.js
import React, { Component } from 'react';
//import { invoke } from '@forge/bridge';
import {ExcelRenderer} from 'react-excel-renderer';
import axios from 'axios';
class App extends Component {
constructor(props) {
super(props);
this.state = { cols: null, rows: null };
}
/*useEffect(() => {
invoke('getText', { example: 'my-invoke-variable' }).then(setData);
}, []);*/
componentDidMount() {
console.log(' COMPONENT DID MOUNT START');
{ headers: { Authorization: 'Basic <API TOKEN ENCODED BASE 64>',
Accept: 'application/json',
'Content-Security-Policy': 'script-src skyoffermanagement.atlassian.net'} })
.then(response => {
console.log(
`Response: ${response.status} ${response.statusText}`
);
console.log(response.text());
})
.catch(err => console.error(err));
}
fileHandler = (event) => {
let fileObj = event.target.files[0];
ExcelRenderer(fileObj, (err, resp) => {
if(err)console.log(err);
else{
console.log('ExcelRender response: ', resp);
for( let i=1; i < resp.rows.length; i++){
}
}
});
}
render(){
return (
<div>
<input type="file" onChange={this.fileHandler.bind(this)} style={{"padding":"10px"}} />
</div>
);
}
}
export default App;
manifest.ymlmodules:
macro:
- key: excel-proposal
resource: main
resolver:
function: resolver
title: excel-proposal
description: Component to upload excel proposal
function:
- key: resolver
handler: index.handler
resources:
- key: main
path: static/fe/build
app:
id: ari:cloud:ecosystem::app/cd8b9860-3f91-4012-89a7-b6b8d20e37c3
permissions:
scopes:
- 'read:confluence-content.summary'
content:
scripts:
- 'unsafe-inline'
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.