staticView macros - unusable due to egress decisions

Dear Atlassian-team,

as we unfortunately missed the EAP phase we now jumped on the preview phase of RFC-136 and have to conclude that it is unusable for use mainly because you violate your own statements.

@mtalebi said

“Because staticView stores and returns pure ADF, external links are handled exactly the same way Confluence handles external links in any other ADF content. Since there is no app runtime or iframe loaded in the browser when the static view renders, the macro itself cannot make egress calls or execute client-side scripts. Therefore, Forge app egress rules do not apply to the rendered static view.”

However this does not seem to be true. URLs in the static output must match the app’s egress permissions (fetch.backend), otherwise links are removed (based on my tests). Our users can add any link to a citation (just as any user can add any link to a page in the editor), so we can’t declare the domains up front, and allowing all domains for backend fetch is not an option. Could plain links (link marks / <a href>) be exempt from the egress check, or could link domains be declared separately without granting network access?

Thank you

Andreas

Hi @andreas1,

Thanks for reaching out, and am sorry to hear your experience with Forge Static Macros.

I was a part of the team that implemented Forge Static Macros and can offer you some insight. As other partners pointed out in their RFC responses, allowing arbitrary URLs in the staticView response would introduce an inconsistency with the broader platform posture for egress. Therefore, the staticView responses have the same CSP enforcement applied as though the content was rendered dynamically in a Forge UI iframe.

We realise that we’ve been a little heavy handed on this by completely stripping the links rather than adopting the behaviour exhibited by Forge iframes

The fetch.client list declares which external sources are allowed for an app’s connect-src policy. Additionally, links included in the fetch.client list do not display the external link warning popup when opened with router.navigate.

Note that this applies to both the UI Kit Link component, and @forge/bridge router for custom UI, where:

  1. Navigation to domains declared in fetch.client is allowed without warning
  2. Navigation to sites not declared in fetch.client results in a popup warning prior to navigation

We’re discussing how to resolve this for Forge Static Macros. Thanks for raising it with us.

Just as a sidenote, declaring * for fetch.client either in your manifest or via customer managed egress would unblock you in the short term.

Cheers,

Mitch

Dear @MitchMcCue

thank you for your quick answer and that you consider it.

It feels strange to add * as egress just for links - but good to know that it would work.

I’m not sure whether my my experience fully matches you description:

  • In staticView macros links not covered by egress are removed => no pop-up
  • In UI Kit (what we used before) links are shown and if the user accepts the “Opening external page” popup he/he can proceed.

Best regards

Andreas

Yep that’s correct, staticView macros are currently stripping all links that aren’t covered by egress.

We’re looking into making the behaviour consistent with Forge UI dynamic renders, which is:

  1. If the link is covered by fetch.client definition (in manifest or customer managed dynamic egress), allow direct navigation
  2. If the link is not covered by fetch.client definition (in manifest or customer managed dynamic egress), allow navigation after the user has accepted the “Opening external page” popup

Cheers,

Mitch