larry icon indicating copy to clipboard operation
larry copied to clipboard

Migrate to twitter oauth2.0 [fixes the previous merge conflict]

Open Shubhcoder opened this issue 3 years ago • 0 comments

Fixes the issue #45

Detailed overview of the changes being made:-

  • publisher/twitter/oauth2/ --> The files inside this are handling all the oauth2 flow related stuffs.
    Like authorizing app, authenticating requests, regenerating tokens, etc. Using the package, golang.org/x/oauth2.

  • publisher/twitter/publisher.go --> Removed dependency of dghubble/oauth1, dghubble/twitter package and added our own inbuilt oauth2 handler for twitter.
    Also, changed the working of the function to monitor tweets for exceeding length(to help in testing).

  • publisher/twitter/publisher_test.go --> Commented two test functions for now. As, they are using empty/invalid id and secret for generating config that will result into failed authentication. Have to think for other work around.

  • PublishersAndProviders.md --> Added steps to generate twitter client id and secret.

  • README.md --> Added the information for authorization steps that the user needs to perform while running the bot.

  • img/ --> New folder, it contains images to help visualize the above steps for better understanding and assistance.

  • cmd/larry/main.go --> Changes to integrate with the updated authorization flow.

  • publisher/twitter/oauth2/test_files --> This folder contains file required while testing oauth2 package.

  • docker-compose.yml --> Removed the variables which are not required anymore.

cc: @ezeoleaf

Shubhcoder avatar Jul 08 '22 17:07 Shubhcoder