Skip to content

feat: Add EventBridge webhook endpoint for OSS events with configurab…#14

Merged
daflyinbed merged 2 commits intomainfrom
event_bridge
Jan 18, 2026
Merged

feat: Add EventBridge webhook endpoint for OSS events with configurab…#14
daflyinbed merged 2 commits intomainfrom
event_bridge

Conversation

@daflyinbed
Copy link
Collaborator

…le CDN refresh

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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.

Copy link
Contributor

Copilot AI commented Jan 18, 2026

@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 daflyinbed merged commit f780135 into main Jan 18, 2026
2 checks passed
@daflyinbed daflyinbed deleted the event_bridge branch January 19, 2026 06:17
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
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.

2 participants