I just noticed an edge case when it doesn’t work. This happens when users haven’t selected an avatar image. In these cases Jira renders user’s Avatars like this:
I find the missing avatar image my app can’t render:
So it seems the https//i1.wp.com/ url needs to be whitelisted in the same way ‘http://gravatar.com/’ was added to the img-src part of the CSP on the atlassian side - for this to work.
Hey @bjornbrynjar, I’m trying to work out where the i1.wp.com URL comes from but I can’t seem to find in the Atlaskit Avatar code where that would come from. Does it get passed through in the ...props part of your code perhaps?
What is worse is that in Safari browsers the Avatar isn’t displayed at all when this happens, only the tooltip shows on mouse-over:
I am considering @pauls workaround but it doesn’t make sense opening up access to all images on these servers.
Because the purpose of CSP is to restrict access to only what is needed by the app and I don’t want users to have to accept “exchanging data” with all of the following services when going through the “Allow access” - prompt.
@danielwinterw or @kchan can you look into this?
This is similar to this issue resolved previously and it seems the solution is to whitelist all URLs necessary, so the ‘@atlaskit/avatar’ component works as expected for all Forge apps - rather than adding these URLs to every app manifest’?
From a security perspective, I think it doesn’t make sense to add the following URLs to every Forge app manifest using “@atlaskit/avatar” package, as it seems to be the only solution currently available: