Skip to content

Conversation

@LauraWitulskiMorales
Copy link
Contributor

No description provided.

@LauraWitulskiMorales
Copy link
Contributor Author

Fixes placement issue from #384

@LauraWitulskiMorales
Copy link
Contributor Author

Ticket reference

serverless.yml Outdated
ModeBlock: true
Override: false
ContentSecurityPolicy:
ContentSecurityPolicy: "default-src 'self'; style-src 'self' 'unsafe-inline'; font-src 'self' data:; img-src 'self' ${env:IMAGE_SERVICE_URL} ${env:AVATAR_URL} ${env:AVATAR_BUCKET_URL}; connect-src 'self' ${env:BACKEND_URL_WITHOUT_HTTPS}"
Copy link
Member

Choose a reason for hiding this comment

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

Loading the image 'data:image/svg+xml;base64,....' violates the following Content Security Policy directive: "img-src 'self' https://api.dicebear.com https://wiki.sinnerschrader.com/rest/cas/1.0/avatar/server/ https://s2-staging-lara-avatar-bucket.s3.eu-central-1.amazonaws.com". The action has been blocked.

I think we need to add data: for img-src, too

serverless.yml Outdated
ModeBlock: true
Override: false
ContentSecurityPolicy:
ContentSecurityPolicy: "default-src 'self'; style-src 'self' 'unsafe-inline'; font-src 'self' data:; img-src 'self' ${env:IMAGE_SERVICE_URL} ${env:AVATAR_URL} ${env:AVATAR_BUCKET_URL} data:; connect-src 'self' ${env:BACKEND_URL_WITHOUT_HTTPS}"
Copy link
Member

Choose a reason for hiding this comment

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

use-token-refresh-link.ts:34 Connecting to 'https://api.staging.lara.sinnerschrader.com/backend/oauth/token' violates the following Content Security Policy directive: "connect-src 'self' https://api.staging.lara.sinnerschrader.com/backend https://login.microsoftonline.com". The action has been blocked.

--> I think we actually need to get the https://api.staging.lara.sinnerschrader.com/ URL. it seems like BACKEND_URL_WITHOUT_HTTPS is with /backend 👎

Copy link
Member

Choose a reason for hiding this comment

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

We could introduce "BACKEND_DOMAIN_NAME" and set it like here:

echo "BACKEND_URL_WITHOUT_HTTPS=$(echo ${{ secrets.BACKEND_URL }} | sed 's/^https:\/\///')" >> $GITHUB_ENV

-->

echo "BACKEND_DOMAIN_NAME=$(echo ${{ secrets.BACKEND_URL }} | sed 's/\backend//')" >> $GITHUB_ENV

(Also make sure to add it to the .env.example)

@LauraWitulskiMorales LauraWitulskiMorales merged commit f88acf6 into main Dec 11, 2025
10 checks passed
@LauraWitulskiMorales LauraWitulskiMorales deleted the fix/csp-header branch December 11, 2025 17:17
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.

3 participants