Skip to content
This repository has been archived by the owner on Jun 30, 2023. It is now read-only.

Commit

Permalink
Merge pull request #118 from mironal/fix-oauth1-name
Browse files Browse the repository at this point in the history
fix name OAuth 1.0a
  • Loading branch information
mironal committed Mar 31, 2022
2 parents 4295402 + ae87cbd commit d6086ac
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions Sources/TwitterAPIKit/AuthAPI/AuthAPI.swift
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
public typealias TwitterAuthAPI =
TwitterAuthAPIResource
& OAuth11aAPI
& OAuth10aAPI
& OAuth20API

public protocol TwitterAuthAPIResource {
var oauth11a: OAuth11aAPI { get }
var oauth10a: OAuth10aAPI { get }
var oauth20: OAuth20API { get }
}

extension TwitterAPIKit.TwitterAuthAPIImpl: TwitterAuthAPIResource {
var oauth11a: OAuth11aAPI { return self }
var oauth10a: OAuth10aAPI { return self }
var oauth20: OAuth20API { return self }
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import Foundation

public protocol OAuth11aAPI {
public protocol OAuth10aAPI {
/// https://developer.twitter.com/en/docs/authentication/api-reference/request_token
func postOAuthRequestTokenData(
_ request: PostOAuthRequestTokenRequestV1
Expand Down Expand Up @@ -33,7 +33,7 @@ public protocol OAuth11aAPI {
) -> TwitterAPISessionJSONTask
}

extension TwitterAPIKit.TwitterAuthAPIImpl: OAuth11aAPI {
extension TwitterAPIKit.TwitterAuthAPIImpl: OAuth10aAPI {
public func postOAuthRequestTokenData(
_ request: PostOAuthRequestTokenRequestV1
) -> TwitterAPISessionDataTask {
Expand Down
4 changes: 2 additions & 2 deletions Tests/TwitterAPIKitTests/AuthAPI/TwitterAuthAPITests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class TwitterAuthAPITests: XCTestCase {
}

func testMakeOAuthAuthorizeURL() throws {
let url = client.oauth11a.makeOAuthAuthorizeURL(
let url = client.oauth10a.makeOAuthAuthorizeURL(
.init(oauthToken: "token", forceLogin: true, screenName: "name")
)
XCTAssertEqual(
Expand All @@ -31,7 +31,7 @@ class TwitterAuthAPITests: XCTestCase {
}

func testMakeOAuthAuthenticateURL() throws {
let url = client.oauth11a.makeOAuthAuthenticateURL(
let url = client.oauth10a.makeOAuthAuthenticateURL(
.init(oauthToken: "token", forceLogin: true, screenName: "name")
)
XCTAssertEqual(
Expand Down

0 comments on commit d6086ac

Please sign in to comment.