mirror of
https://github.com/yusing/godoxy.git
synced 2026-04-09 18:33:36 +02:00
feat(api): enhance API handler to support unauthenticated local access
- Updated NewHandler function to accept a requireAuth parameter for authentication control. - Introduced a new local API server that allows unauthenticated access when LocalAPIHTTPAddr is set. - Adjusted server startup logic to handle both authenticated and unauthenticated API routes.
This commit is contained in:
@@ -30,6 +30,11 @@ var (
|
||||
APIHTTPPort,
|
||||
APIHTTPURL = env.GetAddrEnv("API_ADDR", "127.0.0.1:8888", "http")
|
||||
|
||||
LocalAPIHTTPAddr,
|
||||
LocalAPIHTTPHost,
|
||||
LocalAPIHTTPPort,
|
||||
LocalAPIHTTPURL = env.GetAddrEnv("LOCAL_API_ADDR", "", "http")
|
||||
|
||||
APIJWTSecure = env.GetEnvBool("API_JWT_SECURE", true)
|
||||
APIJWTSecret = decodeJWTKey(env.GetEnvString("API_JWT_SECRET", ""))
|
||||
APIJWTTokenTTL = env.GetEnvDuation("API_JWT_TOKEN_TTL", 24*time.Hour)
|
||||
|
||||
Reference in New Issue
Block a user