Add new OAuth1 credential requirements for Twitter

This commit is contained in:
Maurice Parker 2020-04-14 10:15:24 -05:00
parent 4a7a27e695
commit 266c28d9be
4 changed files with 5 additions and 2 deletions

View File

@ -61,6 +61,9 @@ public extension URLRequest {
case .oauthAccessToken:
let auth = "OAuth \(credentials.secret)"
setValue(auth, forHTTPHeaderField: "Authorization")
case .oauthAccessTokenSecret:
assertionFailure("Token secrets are used by OAuth1. Did you mean to use `OAuthSwift` instead of a URLRequest?")
break
case .oauthRefreshToken:
// While both access and refresh tokens are credentials, it seems the `Credentials` cases
// enumerates how the identity of the user can be proved rather than

View File

@ -22,6 +22,7 @@ public enum CredentialsType: String {
case readerBasic = "readerBasic"
case readerAPIKey = "readerAPIKey"
case oauthAccessToken = "oauthAccessToken"
case oauthAccessTokenSecret = "oauthAccessTokenSecret"
case oauthRefreshToken = "oauthRefreshToken"
}

View File

@ -2,7 +2,7 @@
%{
import os
secrets = ['FEED_WRANGLER_KEY', 'MERCURY_CLIENT_ID', 'MERCURY_CLIENT_SECRET', 'FEEDLY_CLIENT_ID', 'FEEDLY_CLIENT_SECRET']
secrets = ['FEED_WRANGLER_KEY', 'MERCURY_CLIENT_ID', 'MERCURY_CLIENT_SECRET', 'FEEDLY_CLIENT_ID', 'FEEDLY_CLIENT_SECRET', 'TWITTER_CONSUMER_KEY', 'TWITTER_CONSUMER_SECRET']
def chunks(seq, size):
return (seq[i:(i + size)] for i in range(0, len(seq), size))

View File

@ -20,5 +20,4 @@ extension TwitterFeedProvider: ExtensionPoint {
return ExtensionPointIdentifer.twitter(username)
}
}