-
-
Notifications
You must be signed in to change notification settings - Fork 88
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
RFC: Fix go-mastodon authentication flows #196
Conversation
Oh, cool. |
Codecov ReportAttention: Patch coverage is
❗ Your organization needs to install the Codecov GitHub app to enable full functionality.
Additional details and impacted files@@ Coverage Diff @@
## master #196 +/- ##
==========================================
- Coverage 87.51% 78.29% -9.23%
==========================================
Files 15 19 +4
Lines 1354 1617 +263
==========================================
+ Hits 1185 1266 +81
- Misses 125 298 +173
- Partials 44 53 +9 ☔ View full report in Codecov by Sentry. |
Sorry, could you please fix confict? |
Update authentication flow to be aligned with mastodon documentation Refactor authetnication to be more explicit and easier to understand Add working examples for each authentication method Update Documenation Deprectaed client methods: Authenticate(), AuthenticateApp(), AuthenticateToken(), authenticate() New client methods: GetAppAccessToken(), GetUserAccessToken(), getAccessToken()
@mattn Done! :) |
Thank you |
Looks like the latest release v0.0.9 has been tagged before this got merged. Am I right assuming that the examples in the repo now reflect a state that is incompatible with the latest version v0.0.9? If yes, this could lead to more confusion. Anything speaking against a v0.0.10 release? |
yeah something weird happend .. but I think if you do |
at this point go-mastodon authentication is quite confusing and not aligned with the mastodon documentation, causing confusion and misunderstandings about the package usage. Existing methods are not descriptive of what exactly is happening thus making it hard to understand how credentials should be used in general, specially around the exchange between an authorization code and an access token.
This PR aims to fix #194 and most likely the potential causes of #154
And the purposed solution marks the existing methods as DEPRECATED and creates new ones thus avoiding breaking changes with previous versions of this package.
in the issue #194 I've mentioned about returning the value of the access token, however for consistency I have decided to not do it, and opted to keep a similar approach to the original approach and instead documented how users can export the credentials for using them at a later stage.
This pr also updates the package documentation by adding a directory with different working examples.
Code snippets were removed from the README and instead added links to mastodon documentation and to the working examples so users can try them for themselves in a quicker way.
Any comments or suggestions are highly appreciated.