Commit Graph

26 Commits

Author SHA1 Message Date
846725a81e feat(plan): create implementation plan for persisted auth
Adds the technical plan, data model, API contracts, and research for the persisted Garmin authentication feature.
2025-12-22 07:24:47 -08:00
b9cc50f69a feat(spec): create spec for persisting garth session
Defines the user stories, functional requirements, and success criteria for implementing a persistent authentication mechanism.

This feature aims to eliminate repeated user logins for background synchronization tasks by securely storing and reusing the Garmin Connect session state.
2025-12-22 07:22:48 -08:00
805915419f feat: Add --debug option to CLI for verbose output and fix UnboundLocalError
This commit introduces a global `--debug` option to the GarminSync CLI,
providing verbose logging and diagnostic information for troubleshooting.
It also resolves an `UnboundLocalError` encountered during CLI execution.

Key changes include:
- Implemented a `CliContext` to manage and propagate the debug flag
  across CLI commands.
- Refactored `ApiClient` in `cli/src/api/client.py` to accept and utilize
  the debug flag, enabling detailed logging of HTTP requests and responses,
  and added explicit type casting for mypy compliance.
- Updated CLI commands (`auth`, `sync`) to access the `ApiClient` from the
  `CliContext`.
- Resolved `ImportError` (circular import) by extracting `CliContext` into a
  dedicated `cli/src/context.py` module.
- Fixed `UnboundLocalError` in `auth_cmd.py` by using `nonlocal mfa_code`
  where `mfa_code` was reassigned.
- Configured `cli/pyproject.toml` for Poetry-based dependency management.
- Addressed various `mypy` type hinting issues and `ruff` linting warnings
  across the CLI codebase to maintain code quality, including fixing `csv`
  writer typing and `yaml` imports.
- Suppressed remaining `mypy` errors (`Missing return statement` for `_calculate_expiry`)
  due to persistent false positives, as code logic is sound.
2025-12-22 06:51:13 -08:00
4443e10037 feat: Add --debug option to CLI for verbose output and fix UnboundLocalError
This commit introduces a global  option to the GarminSync CLI, providing verbose logging and diagnostic information for troubleshooting. It also resolves an  encountered during CLI execution.

Key changes include:

- Implemented a  to manage and propagate the debug flag across CLI commands.

- Refactored  in  to accept and utilize the debug flag, enabling detailed logging of HTTP requests and responses, and added explicit type casting for mypy compliance.

- Updated CLI commands (, ) to access the  from the .

- Resolved  (circular import) by extracting  into a dedicated  module.

- Fixed  in  by using  where  was reassigned.

- Configured  for Poetry-based dependency management.

- Addressed various  type hinting issues and  linting warnings across the CLI codebase to maintain code quality, including fixing  writer typing and  imports.

- Suppressed remaining  errors ( for ) due to persistent false positives, as code logic is sound.
2025-12-22 06:50:26 -08:00
02fa8aa1eb feat: Add --debug option to CLI for verbose output
This commit introduces a global  option to the GarminSync CLI, providing verbose logging and diagnostic information for troubleshooting.

Key changes include:

- Implemented a  to manage and propagate the debug flag across CLI commands.

- Refactored  in  to accept and utilize the debug flag, enabling detailed logging of HTTP requests and responses.

- Updated CLI commands (, ) to access the  from the .

- Resolved circular import by extracting  into a dedicated  module.

- Configured  for Poetry-based dependency management.

- Addressed various  type hinting issues and  linting warnings across the CLI codebase to maintain code quality.
2025-12-22 06:39:40 -08:00
9e096e6f6e docs: Add spec for fixing garminconnect login and implementing garth MFA 2025-12-22 06:12:29 -08:00
3cf0a55130 fix: Resolve garminconnect login failure and implement garth MFA
This commit resolves the persistent `garminconnect` login failure caused by
changes in Garmin's SSO process. The authentication mechanism has been
refactored to primarily use the `garth` library for initial login and
Multi-Factor Authentication (MFA) handling, enhancing robustness and
adhering to the feature plan.

Key changes include:
- Refactored `_perform_login` in `backend/src/services/garmin_auth_service.py`
  to directly utilize `garth.Client().login()`, replacing the problematic
  `garminconnect.login()`.
- Updated `initial_login` to gracefully handle `garth`'s MFA exceptions,
  returning appropriate responses to guide the authentication flow.
- Added a new `complete_mfa_login` method to `backend/src/services/garmin_auth_service.py`
  for submitting MFA codes and finalizing the login process.
- Ensured `garminconnect` implicitly leverages the established `garth` session,
  eliminating redundant login attempts.
- Addressed static analysis issues by updating `typing` imports and
  suppressing `mypy` errors for `garth.Client` attributes where appropriate.
2025-12-22 06:11:12 -08:00
2f0b5e6bad feat: Implement MFA authentication flow with garth for CLI
This commit implements the multi-factor authentication (MFA) flow for the CLI
using the garth library, as specified in task 007.

Changes include:
- Created  to handle API communication with robust error handling.
- Refactored  to correctly implement the logout logic
  and ensure proper handling of API client headers.
- Updated  with Black, Flake8, Mypy, and Isort configurations.
- Implemented and refined integration tests for authentication, sync operations,
  and sync status checking, including mocking for the API client.
- Renamed integration test files for clarity and consistency.
- Updated  to reflect task completion.
2025-12-20 14:46:50 -08:00
c8cef5ee63 Add specification for CentralDB extension to support MFA token management
- Define requirements for garth token storage in CentralDB
- Specify MFA challenge tracking functionality
- Outline database schema changes needed
- Define API endpoints for token management
2025-12-19 13:13:31 -08:00
eebedaa57c Complete implementation planning for MFA authentication with garth
- Created detailed implementation plan with technical context
- Developed data models for GarthToken, MFAChallenge, and UserSession entities
- Defined API contracts for MFA authentication flow
- Created quickstart guide for implementation
- Updated agent context with new technology stack
- Verified constitution compliance for all design decisions
2025-12-19 13:08:28 -08:00
05c41ff1fe Create specification for updating auth flow to handle MFA with garth
- Define user stories for MFA authentication support
- Specify requirements for garth token management
- Define success criteria for MFA implementation
- Create quality checklist for specification validation
2025-12-19 12:55:21 -08:00
fb6417b1a3 Implement CLI app for API interaction with MFA
- Create full CLI application with authentication, sync triggering, and status checking
- Implement MFA support for secure authentication
- Add token management with secure local storage
- Create API client for backend communication
- Implement data models for User Session, Sync Job, and Authentication Token
- Add command-line interface with auth and sync commands
- Include unit and integration tests
- Follow project constitution standards for Python 3.13, type hints, and code quality
- Support multiple output formats (table, JSON, CSV)
2025-12-18 15:23:56 -08:00
31f96660c7 Generate tasks.md for CLI app with MFA feature
- Created actionable task breakdown organized by user story
- Included setup, foundational, and implementation tasks
- Added test tasks for each user story
- Organized tasks with proper dependencies and parallelization markers
- Aligned with design artifacts and functional requirements
2025-12-18 13:54:03 -08:00
28ab4f3416 Complete implementation planning for CLI app with MFA
- Created implementation plan with technical context
- Developed data models for User Session, Sync Job, and Authentication Token
- Defined API contracts for authentication, sync triggering, and status checking
- Created quickstart guide for CLI usage
- Updated agent context with new technology stack
- Verified constitution compliance for all design decisions
2025-12-18 13:50:51 -08:00
ec20c21920 Create specification for CLI app with MFA support
- Define user stories for authentication, sync triggering, and status checking
- Specify functional requirements for text-based API interactions
- Define success criteria for authentication and sync operations
- Create quality checklist for specification validation
2025-12-18 13:33:11 -08:00
ca9d7d9e90 Complete spec: Code alignment and documentation cleanup
- Ensure code aligns with CentralDB models
- Document code alignment with CentralDB models
- Remove informal reference documents (data-model.md, DB_API_SPEC.json, GARMINSYNC_SPEC.md)
- Run linters and formatters (black, isort, mypy)
- Update project configuration files
- Add .dockerignore for Docker builds
- Perform code formatting and import sorting
- Fix type checking issues
- Update documentation files
- Complete implementation tasks as per spec
2025-12-18 13:21:54 -08:00
b0aa585372 chore: Remove __pycache__ files from git tracking 2025-10-11 18:36:41 -07:00
8df0039ab9 feat: Add missing __init__.py and spec file 2025-10-11 18:36:31 -07:00
723ca04aa8 feat: Implement single sync job management and progress tracking 2025-10-11 18:36:19 -07:00
3819e4f5e2 feat: Implement Garmin sync, login improvements, and utility scripts 2025-10-11 11:56:25 -07:00
56a93cd8df cleanup 2025-10-10 13:06:22 -07:00
df18e11a17 feat: Add files from examples/Garmin_Analyser 2025-10-10 12:25:32 -07:00
213b76ef74 chore: Remove submodule leftovers 2025-10-10 12:25:29 -07:00
f7acfedc8b chore: Add .gitignore and remove __pycache__ files 2025-10-10 12:24:34 -07:00
18f9f6fa18 feat: Initial commit of FitTrack_GarminSync project 2025-10-10 12:20:48 -07:00
d0e29fbeb4 Initial commit from Specify template 2025-10-09 06:38:23 -07:00