matin / garth

Garmin SSO auth + Connect Python client
MIT License
307 stars 23 forks source link

feat: dump `oauth1_token.json oauth2_token.json` together, and dump them as string #4

Closed yihong0618 closed 1 year ago

yihong0618 commented 1 year ago

Thanks for your repo~ For some repos like https://github.com/yihong0618/running_page we use GitHub Actions secret to daily sync the data, so maybe we can make this token something like base64 it to a string, and save it in the secret, we can load them from method like garth.resume_from_string(str)

I can open a PR to support it

matin commented 1 year ago

Love what you're building!

Would a JSON serialized string be sufficient?

I was thinking we could add Client.dumps() and Client.loads(tokens). That way we have symmetry with the current Client.dump() and Client.load() methods.

yihong0618 commented 1 year ago

I wonder for GitHub Actions base64 string is better, will open one PR, let us discuss there later?