feat(upload): add voided.host uploaders with shared config and settings UI#480
Open
Lixqa wants to merge 1 commit into
Open
feat(upload): add voided.host uploaders with shared config and settings UI#480Lixqa wants to merge 1 commit into
Lixqa wants to merge 1 commit into
Conversation
Not up to standards ⛔🔴 Issues
|
| Category | Results |
|---|---|
| Compatibility | 4 medium |
| BestPractice | 7 medium |
| ErrorProne | 20 critical 1 high |
| Security | 2 critical 2 high |
| CodeStyle | 3 minor |
| Complexity | 5 medium |
🟢 Metrics 100 complexity · 8 duplication
Metric Results Complexity 100 Duplication 8
NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.
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.
Preface
SnapX did not have a built-in voided.host destination. voided.host supports image, text, and file uploads through one shared upload key, so adding it means implementing shared upload logic rather than three unrelated uploaders.
This change adds voided.host as a first-class SnapX uploader with encrypted config, AOT-friendly JSON parsing, and Avalonia settings UI.
Description of Change
Adds voided.host as a built-in uploader for image, text, and file destinations.
Core (SnapX.Core):
UI (SnapX.Avalonia):
Uploads use multipart requests to api.voided.host with Authorization header auth, optional guest mode, and structured JSON error handling.
Possible Alternatives
Separate settings pages per destination type: rejected because voided.host uses one upload key for images, pastes, and files. Three pages would duplicate the same controls.
Single uploader class for all three types: rejected to stay consistent with SnapX's existing pattern of separate image, text, and file services, while sharing logic through VoidedHostMultipartUploader.
Implementation Details
Upload logic lives in VoidedHostMultipartUploader, which all three uploaders delegate to with different API URLs:
Image: https://api.voided.host/v2/images
Text: https://api.voided.host/v2/pastes
File: https://api.voided.host/v2/files
Multipart fields use p=snapx, v=1, and a timestamp. Guest mode is enabled when VoidedHostUseGuest is true and a guest API key is present in the build.
Settings are grouped under Universal uploaders because the configuration is destination-agnostic. voided.host still appears separately in the image, text, and file destination pickers when choosing where to upload.
Notes
Tested on