Commit Graph

12 Commits

  • Fixed: #607
    refactor(config): re-export internal configuration types for SDK consumers
  • refactor(auth): replace TokenRecord with coreauth.Auth and migrate TokenStore to coreauth.Store
    - Replaced `TokenRecord` with `coreauth.Auth` for centralized and consistent authentication data structures.
    - Migrated `TokenStore` interface to `coreauth.Store` for alignment with core CLIProxy authentication.
    - Updated related login methods, token persistence logic, and file storage handling to use the new `coreauth.Auth` model.
  • refactor(access): centralize configaccess.Register and remove redundant calls
    - Added centralized `configaccess.Register` invocation in `server` initialization.
    - Removed duplicate `Register` calls from `reconcile.go` and `builder.go`.
    - Simplified logic by removing unnecessary `nil` checks in provider entry collection.
  • refactor(access): migrate config-api-key provider to internal package
    - Moved `config-api-key` provider logic from SDK to the internal `config_access` package.
    - Updated provider registration and initialization to ensure proper management via `Register` function.
    - Removed redundant `config-api-key` documentation, simplifying configuration examples.
    - Adjusted related imports and reconciliations for seamless integration with the new structure.
  • refactor(access): migrate to SDKConfig for authentication and provider management
    - Replaced `config.Config` with `SDKConfig` in authentication and provider logic for consistency with SDK changes.
    - Updated provider registration, reconciliation, and build functions to align with the `SDKConfig` structure.
    - Refactored related imports and handlers to support the new configuration approach.
    - Improved clarity and reduced redundancy in API key synchronization and provider initialization.
  • 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.
  • refactor(auth): replace FileStore with FileTokenStore for unified token persistence
    - Removed `FileStore` in favor of the new `FileTokenStore`.
    - Centralized auth JSON handling and token operations through `FileTokenStore`.
    - Updated all components to utilize `FileTokenStore` for consistent storage operations.
    - Introduced `SetBaseDir` and directory locking mechanisms for flexible configurations.
    - Enhanced metadata management, including path resolution and deep JSON comparisons.
  • chore(docs): add and refine package-level comments across modules
    - Added detailed package-level comments to improve documentation coverage.
    - Clarified parameter descriptions, return types, and functionality of exported methods across packages.
    - Enhanced overall code readability and API documentation consistency.
  • feat(auth): introduce auth.providers for flexible authentication configuration
    - Replaced legacy `api-keys` field with `auth.providers` in configuration, supporting multiple authentication providers including `config-api-key`.
    - Added synchronization to maintain compatibility with legacy `api-keys`.
    - Updated core components like request handling and middleware to use the new provider system.
    - Enhanced management API endpoints for seamless integration with `auth.providers`.