fix(organizations): add REST endpoint for branding logo upload signing - #231
Merged
Merged
Conversation
…logo upload signing The shipped django-s3direct signing view (POST /s3direct/get_upload_params/) is a plain Django view authenticated only by session cookie, so the JWT-only frontend SPA always gets AnonymousUser there and is refused with a 403 on every branding logo upload. Add OrganizationBrandingLogoUploadParamsView, mirroring users/views.py's profile-picture-upload-params endpoint and reusing organizations/branding_logo.py::sign_branding_logo_upload, which already backs the equivalent GraphQL mutation.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #231 +/- ##
==========================================
+ Coverage 87.41% 87.42% +0.01%
==========================================
Files 254 254
Lines 21735 21769 +34
Branches 2446 2447 +1
==========================================
+ Hits 19000 19032 +32
- Misses 1944 1945 +1
- Partials 791 792 +1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. |
hugobessa
approved these changes
Aug 6, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
django-s3directsigning view (POST /s3direct/get_upload_params/) is a plain Django view authenticated only by session cookie, never reachable by DRF'sJWTAuthentication— so the JWT-only SPA always hit it asAnonymousUser.OrganizationBrandingLogoUploadParamsView(POST /branding/logo-upload-params/), the REST sibling of the existing GraphQLcreate_branding_logo_uploadmutation, reusingorganizations.branding_logo.sign_branding_logo_uploadfor the actual signing.organizations.permissions.check_branding_read_eligibility, reused by both this view andOrganizationBrandingView.get.schema.yml.See
.vinta-ai-workflows/handoffs/2026-08-06-branding-logo-upload-403.mdandai-plans/2026-08-04-ORGANIZATION_AUTH_BRANDING_SPEC.md/ai-plans/2026-08-04-ORGANIZATION_AUTH_BRANDING_IMPLEMENTATION_PLAN.mdfor full context.Test plan
organizations/tests/test_branding_logo_upload_params.py: happy path, no-slug-org still admitted, non-admin/parented-org/unentitled-org 403s, unauthenticated 401, bad content-type/oversized-file 400s, multi-org-admin-without-header 400 (provesTenantScopedViewMixinis wired).ruff check/ruff format --checkclean.mypyclean on touched files.makemigrations --check— no changes needed (no model change).