mirror of
https://github.com/GMWalletApp/epusdt.git
synced 2026-07-07 02:06:16 +00:00
3f071e6c01
- Rewrite Solana scanner: stateless scan with processed-signature cache, query wallet + USDT ATA + USDC ATA addresses to cover all SPL transfers - Add network field to transaction_lock (4-tuple unique index) and order flow - Add wallet management endpoints (add/list/get/status/delete) with token auth - Add network info to Telegram payment notification - Add USDC hint to test script GMPay prompt - Add API docs and Solana scanning docs
25 lines
698 B
Go
25 lines
698 B
Go
package middleware
|
|
|
|
import (
|
|
"github.com/assimon/luuu/config"
|
|
"github.com/assimon/luuu/util/constant"
|
|
"github.com/labstack/echo/v4"
|
|
)
|
|
|
|
// CheckApiToken validates the Authorization header against the configured api_auth_token.
|
|
// Use this for management APIs (GET/POST) where body-based signature is not practical.
|
|
func CheckApiToken() echo.MiddlewareFunc {
|
|
return func(next echo.HandlerFunc) echo.HandlerFunc {
|
|
return func(ctx echo.Context) error {
|
|
token := ctx.Request().Header.Get("Authorization")
|
|
if token == "" {
|
|
token = ctx.QueryParam("api_token")
|
|
}
|
|
if token == "" || token != config.GetApiAuthToken() {
|
|
return constant.SignatureErr
|
|
}
|
|
return next(ctx)
|
|
}
|
|
}
|
|
}
|