feat(auth, docs): add SDK guides and local password support for management

- Added extensive SDK usage guides for `cliproxy`, `sdk/access`, and watcher integration.
- Introduced `--password` flag for specifying local management access passwords.
- Enhanced management API with local password checks to secure localhost requests.
- Updated documentation to reflect the new password functionality.
This commit is contained in:
Luis Pater
2025-09-25 11:32:14 +08:00
parent f5dc380b63
commit a4767fdd8e
13 changed files with 1111 additions and 32 deletions

View File

@@ -21,10 +21,12 @@ import (
// Parameters:
// - cfg: The application configuration
// - configPath: The path to the configuration file
func StartService(cfg *config.Config, configPath string) {
// - localPassword: Optional password accepted for local management requests
func StartService(cfg *config.Config, configPath string, localPassword string) {
service, err := cliproxy.NewBuilder().
WithConfig(cfg).
WithConfigPath(configPath).
WithLocalManagementPassword(localPassword).
Build()
if err != nil {
log.Fatalf("failed to build proxy service: %v", err)