feat: Add EventBridge webhook endpoint for OSS events with configurab…#14
Merged
daflyinbed merged 2 commits intomainfrom Jan 18, 2026
Merged
feat: Add EventBridge webhook endpoint for OSS events with configurab…#14daflyinbed merged 2 commits intomainfrom
daflyinbed merged 2 commits intomainfrom
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This pull request adds an EventBridge webhook endpoint to handle Aliyun OSS (Object Storage Service) events with automatic CDN refresh functionality, while simultaneously removing the PostgreSQL database dependency to simplify the application architecture.
Changes:
- Added Aliyun EventBridge webhook endpoint with JWT authentication for OSS events that triggers automatic CDN cache refresh
- Removed PostgreSQL database dependency and all related code (repository layer, migrations, health check)
- Implemented Aliyun CDN API client with ACS3-HMAC-SHA256 signature support
Reviewed changes
Copilot reviewed 20 out of 21 changed files in this pull request and generated 10 comments.
Show a summary per file
| File | Description |
|---|---|
| src/routes/aliyun_handlers.rs | New webhook handler for OSS events with EventBridge authentication and CDN refresh |
| src/aliyun/signature.rs | Aliyun OpenAPI V3 signature implementation with comprehensive tests |
| src/aliyun/cdn.rs | CDN API client for RefreshObjectCaches operation |
| src/aliyun/mod.rs | Module exports for Aliyun integration |
| src/config.rs | Added AliyunConfig, removed DatabaseConfig |
| src/state.rs | Removed PostgreSQL repository, added Aliyun config to app state |
| src/routes/mod.rs | Restructured router to separate public and protected routes, added EventBridge security scheme |
| src/auth.rs | Updated JWT validation to skip required spec claims validation |
| src/error.rs | Improved error logging with structured fields, removed sqlx error conversion |
| src/tracing.rs | Updated module whitelist from "my_axum_template" to "janus" |
| src/routes/bilibili_handlers.rs | Improved logging with structured fields |
| src/routes/misc_handlers.rs | Removed database-dependent health check endpoint |
| src/repository.rs | Deleted entire repository layer |
| Cargo.toml | Removed sqlx dependency, added serde_urlencoded, hmac, sha2, percent-encoding |
| example.toml | Added Aliyun configuration, removed database configuration |
| docker-compose.yaml | Removed PostgreSQL service |
| migrations/ | Deleted all migration files |
| .env | Removed database environment variables |
Comments suppressed due to low confidence (1)
src/error.rs:47
- The error response body only includes a generic "code": 1 field without including the error message. This makes it difficult for API consumers to understand what went wrong. While the error is logged server-side, the client receives no useful information. Consider including a sanitized error message in the response body, or at minimum a "message" field with a generic error description based on the error type.
let body = json!({
"code": 1,
});
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Contributor
|
@daflyinbed I've opened a new pull request, #15, to work on those changes. Once the pull request is ready, I'll request review from you. |
daflyinbed
added a commit
that referenced
this pull request
Jan 19, 2026
…le CDN refresh (#14) * feat: Add EventBridge webhook endpoint for OSS events with configurable CDN refresh * update
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.
…le CDN refresh