Skip to content

Feat/add delete /api/v1/profile ( issues 579, 855, 898, 919)#973

Merged
Yunusabdul38 merged 6 commits into
Agora-Events:mainfrom
D-Ochuko:feat/Add-DELETE-/api/v1/profile-(-Issues-579,-855,-898,-919)
Jun 27, 2026
Merged

Feat/add delete /api/v1/profile ( issues 579, 855, 898, 919)#973
Yunusabdul38 merged 6 commits into
Agora-Events:mainfrom
D-Ochuko:feat/Add-DELETE-/api/v1/profile-(-Issues-579,-855,-898,-919)

Conversation

@D-Ochuko

Copy link
Copy Markdown
Contributor

Summary
Adds DELETE /api/v1/profile endpoint for GDPR-compliant organizer profile removal
Adds exponential back-off with a 300-second cap to the Soroban RPC listener to reduce log flood and node pressure during outages
Hardens image_url validation on event creation with a 2048-character length cap and explicit test coverage for data URIs
Adds contract tests verifying that ScannerAuthorized and ScannerRevoked events include the organizer's address in authorized_by / revoked_by
Changes per issue
#579 — DELETE /api/v1/profile

server/src/handlers/profile.rs: new delete_profile handler — executes DELETE FROM organizer_profiles WHERE address = $1, returns 204 on success, 404 if row not found, invalidates Redis cache
server/src/routes/mod.rs: imports delete_profile, registers it on the DELETE / slot of profile_routes
#855 — Soroban listener exponential back-off

server/src/handlers/soroban_listener.rs: adds MAX_BACKOFF constant (300 s), tracks current_backoff in the listener loop — first failure sleeps POLL_INTERVAL, each subsequent consecutive failure doubles the delay up to MAX_BACKOFF, resets to POLL_INTERVAL on the first successful poll; adds test_backoff_sequence_doubles_and_caps
#898 — image_url HTTPS validation

server/src/handlers/events.rs: extracts inline validation into validate_image_url(url: &str) -> Result<(), AppError>, adds a 2048-character length guard; updates create_event to call the function; refactors existing tests to use the function and adds test_image_url_data_uri_rejected, test_image_url_exceeds_max_length_rejected, test_image_url_exactly_max_length_accepted
#919 — Scanner event organizer address tests

contract/contracts/event_registry/src/issue_tests.rs: adds test_authorize_scanner_event_includes_authorized_by and test_revoke_scanner_event_includes_revoked_by — each verifies the correct topic is emitted and constructs the event struct with the organizer address field to confirm it compiles and holds the right value
Test plan
cargo test -p agora-server — profile, listener, and events unit tests pass
cargo test -p event-registry — new scanner event tests and existing issue tests pass
DELETE /api/v1/profile with valid JWT returns 204; with no existing profile returns 404; without JWT returns 401
Soroban listener logs show increasing retry delays during RPC outage and reset on recovery
POST /api/v1/events with image_url: "data:image/png;base64,..." returns 400; with a URL longer than 2048 chars returns 400; with a valid https:// URL succeeds
Closes #579
Closes #855
Closes #898
Closes #919

@vercel

vercel Bot commented Jun 27, 2026

Copy link
Copy Markdown

@D-Ochuko is attempting to deploy a commit to the oseh-svg's projects Team on Vercel.

A member of the Team first needs to authorize it.

@drips-wave

drips-wave Bot commented Jun 27, 2026

Copy link
Copy Markdown

@D-Ochuko Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@Yunusabdul38 Yunusabdul38 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM

@Yunusabdul38
Yunusabdul38 merged commit b4c7572 into Agora-Events:main Jun 27, 2026
2 of 6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment