Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Authentication by handing it over to garth #114

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

flyingflo
Copy link
Contributor

For #113

Use garth for auth and api

Replaces the login dance and api calls,
and fixes the broken login.

Tokens are long-lived and can be stored,
thus username and password are optional.

TODO:

  • Token storage options
  • Tests
  • Cleanup

Replaces the login dance and api calls,
and fixes the broken login.

Tokens are long-lived and can be stored,
thus username and password are optional.

The token store is currently hardcoded
and insecure.
@petergardfjall
Copy link
Owner

petergardfjall commented Feb 12, 2024

Thanks for showing an interest in the tool.

I already turned down a PR to integrate with garth, and I still feel the same way about using a library that downloads credentials (whose?) from some S3 bucket. (see #104 (comment) for more details).

I might reconsider but I would prefer another way, if possible.

@@ -268,8 +148,8 @@ def _fetch_activity_ids_and_ts(self, start_index, max_limit=100):
:rtype: tuples of (int, datetime)
"""
log.debug("fetching activities %d through %d ...", start_index, start_index + max_limit - 1)
response = self.session.get(
"https://connect.garmin.com/activitylist-service/activities/search/activities",
response = self.gc.get(
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@flyingflo you can also use self.gc.connectapi()

response = self.session.get(
"https://connect.garmin.com/activitylist-service/activities/search/activities",
response = self.gc.get(
"connectapi", "/activitylist-service/activities/search/activities", api=True,
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some time between November 1 and today, this API call is now returning an empty list instead of my activity IDs (so I falsely have zero activities instead of almost a thousand)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants