Skip to content
This repository was archived by the owner on Feb 5, 2025. It is now read-only.

Commit ae4c5a0

Browse files
authored
Depend on WordPressKit 11.0 and declare some URL properties as URL (#827)
2 parents 8422cde + 8822874 commit ae4c5a0

15 files changed

+38
-46
lines changed

CHANGELOG.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ _None._
3434

3535
### Breaking Changes
3636

37-
_None._
37+
- Declare URL properties in `WordPressAuthenticatorConfiguration` as `URL`, instead of `String`. [#827]
3838

3939
### New Features
4040

@@ -46,8 +46,7 @@ _None._
4646

4747
### Internal Changes
4848

49-
- Relax WordPressKit dependency to `~> 9.0` [#824]
50-
- Depend on WordPressKit 10.0.0 [#826]
49+
- Change WordPressKit dependency version [#824, #826, #827]
5150

5251
## 8.0.1
5352

Demo/AuthenticatorDemo/ViewController+WordPressAuthenticator.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@ extension ViewController {
1212
wpcomClientId: APICredentials.client,
1313
wpcomSecret: APICredentials.secret,
1414
wpcomScheme: "wordpress-authenticator-ios-demo",
15-
wpcomTermsOfServiceURL: "https://wordpress.com/tos/",
16-
wpcomBaseURL: "https://wordpress.com",
17-
wpcomAPIBaseURL: "https://public-api.wordpress.com/",
15+
wpcomTermsOfServiceURL: URL(string: "https://wordpress.com/tos/")!,
16+
wpcomBaseURL: URL(string: "https://wordpress.com")!,
17+
wpcomAPIBaseURL: URL(string: "https://public-api.wordpress.com/")!,
1818
googleLoginClientId: APICredentials.googleLoginClientId,
1919
googleLoginServerClientId: APICredentials.googleLoginServerClientId,
2020
googleLoginScheme: APICredentials.googleLoginSchemeId,

Podfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ def wordpress_authenticator_pods
2828
## These should match the version requirement from the podspec.
2929
pod 'Gridicons', '~> 1.0'
3030
pod 'WordPressUI', '~> 1.7-beta'
31-
pod 'WordPressKit', '~> 10.0'
31+
pod 'WordPressKit', '~> 11.0'
3232
pod 'WordPressShared', '~> 2.1-beta'
3333

3434
third_party_pods

Podfile.lock

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,10 @@ PODS:
1313
- Gridicons (~> 1.0)
1414
- "NSURL+IDN (= 0.4)"
1515
- SVProgressHUD (~> 2.2.5)
16-
- WordPressKit (~> 10.0)
16+
- WordPressKit (~> 11.0)
1717
- WordPressShared (~> 2.1-beta)
1818
- WordPressUI (~> 1.7-beta)
19-
- WordPressKit (10.0.0):
19+
- WordPressKit (11.0.0):
2020
- Alamofire (~> 4.8.0)
2121
- NSObject-SafeExpectations (~> 0.0.4)
2222
- UIDeviceIdentifier (~> 2.0)
@@ -35,7 +35,7 @@ DEPENDENCIES:
3535
- SVProgressHUD (= 2.2.5)
3636
- SwiftLint (~> 0.49)
3737
- WordPressAuthenticator (from `.`)
38-
- WordPressKit (~> 10.0)
38+
- WordPressKit (~> 11.0)
3939
- WordPressShared (~> 2.1-beta)
4040
- WordPressUI (~> 1.7-beta)
4141

@@ -71,12 +71,12 @@ SPEC CHECKSUMS:
7171
SVProgressHUD: 1428aafac632c1f86f62aa4243ec12008d7a51d6
7272
SwiftLint: c1de071d9d08c8aba837545f6254315bc900e211
7373
UIDeviceIdentifier: 442b65b4ff1832d4ca9c2a157815cb29ad981b17
74-
WordPressAuthenticator: 34fd67adc5569963af1cfd71b5ad7446d7b79b09
75-
WordPressKit: dec055e14413d6674c3f44e86391015da6d0e754
74+
WordPressAuthenticator: fc248b29f4070e5de3520702532eeb0c390476ff
75+
WordPressKit: c9ec8dd6ea731af5a2d7cadb9944b67be716d63e
7676
WordPressShared: 87f3ee89b0a3e83106106f13a8b71605fb8eb6d2
7777
WordPressUI: a491454affda3b0fb812812e637dc5e8f8f6bd06
7878
wpxmlrpc: 68db063041e85d186db21f674adf08d9c70627fd
7979

80-
PODFILE CHECKSUM: 415362dc6847c42b46cb67776a65fddd8c091cd1
80+
PODFILE CHECKSUM: 9dc67ad3b7985a633faef0b6b516c80f41513c7c
8181

8282
COCOAPODS: 1.14.3

WordPressAuthenticator.podspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,6 @@ Pod::Spec.new do |s|
4040
# Use a loose restriction that allows both production and beta versions, up to the next major version.
4141
# If you want to update which of these is used, specify it in the host app.
4242
s.dependency 'WordPressUI', '~> 1.7-beta'
43-
s.dependency 'WordPressKit', '~> 10.0'
43+
s.dependency 'WordPressKit', '~> 11.0'
4444
s.dependency 'WordPressShared', '~> 2.1-beta'
4545
end

WordPressAuthenticator/Authenticator/WordPressAuthenticatorConfiguration.swift

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,21 +18,21 @@ public struct WordPressAuthenticatorConfiguration {
1818

1919
/// WordPress.com Terms of Service URL
2020
///
21-
let wpcomTermsOfServiceURL: String
21+
let wpcomTermsOfServiceURL: URL
2222

2323
/// WordPress.com Base URL for OAuth
2424
///
25-
let wpcomBaseURL: String
25+
let wpcomBaseURL: URL
2626

2727
/// WordPress.com API Base URL
2828
///
29-
let wpcomAPIBaseURL: String
29+
let wpcomAPIBaseURL: URL
3030

3131
/// The URL of a webpage which has details about What is WordPress.com?.
3232
///
3333
/// Displayed in the WordPress.com login page. The button/link will not be displayed if this value is nil.
3434
///
35-
let whatIsWPComURL: String?
35+
let whatIsWPComURL: URL?
3636

3737
/// GoogleLogin Client ID
3838
///
@@ -179,10 +179,10 @@ public struct WordPressAuthenticatorConfiguration {
179179
public init (wpcomClientId: String,
180180
wpcomSecret: String,
181181
wpcomScheme: String,
182-
wpcomTermsOfServiceURL: String,
183-
wpcomBaseURL: String = WordPressComOAuthClient.WordPressComOAuthDefaultBaseUrl,
184-
wpcomAPIBaseURL: String = WordPressComOAuthClient.WordPressComOAuthDefaultApiBaseUrl,
185-
whatIsWPComURL: String? = nil,
182+
wpcomTermsOfServiceURL: URL,
183+
wpcomBaseURL: URL = WordPressComOAuthClient.WordPressComOAuthDefaultBaseURL,
184+
wpcomAPIBaseURL: URL = WordPressComOAuthClient.WordPressComOAuthDefaultApiBaseURL,
185+
whatIsWPComURL: URL? = nil,
186186
googleLoginClientId: String,
187187
googleLoginServerClientId: String,
188188
googleLoginScheme: String,

WordPressAuthenticator/Services/SignupService.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ private extension SignupService {
108108
var anonymousAPI: WordPressComRestApi {
109109
return WordPressComRestApi(oAuthToken: nil,
110110
userAgent: configuration.userAgent,
111-
baseUrlString: configuration.wpcomAPIBaseURL)
111+
baseURL: configuration.wpcomAPIBaseURL)
112112
}
113113

114114
var configuration: WordPressAuthenticatorConfiguration {

WordPressAuthenticator/Services/WordPressComAccountService.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ public class WordPressComAccountService {
3131
failure: @escaping (Error) -> Void) {
3232
let loggedAPI = WordPressComRestApi(oAuthToken: wpcomAuthToken,
3333
userAgent: configuration.userAgent,
34-
baseUrlString: configuration.wpcomAPIBaseURL)
34+
baseURL: configuration.wpcomAPIBaseURL)
3535
let remote = AccountServiceRemoteREST(wordPressComRestApi: loggedAPI)
3636

3737
remote.connectToSocialService(serviceName,
@@ -83,7 +83,7 @@ public class WordPressComAccountService {
8383
private var anonymousAPI: WordPressComRestApi {
8484
return WordPressComRestApi(oAuthToken: nil,
8585
userAgent: configuration.userAgent,
86-
baseUrlString: configuration.wpcomAPIBaseURL)
86+
baseURL: configuration.wpcomAPIBaseURL)
8787
}
8888

8989
/// Returns the current WordPressAuthenticatorConfiguration Instance.

WordPressAuthenticator/Services/WordPressComBlogService.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ class WordPressComBlogService {
1010
private var anonymousAPI: WordPressComRestApi {
1111
let userAgent = WordPressAuthenticator.shared.configuration.userAgent
1212
let baseUrl = WordPressAuthenticator.shared.configuration.wpcomAPIBaseURL
13-
return WordPressComRestApi(oAuthToken: nil, userAgent: userAgent, baseUrlString: baseUrl)
13+
return WordPressComRestApi(oAuthToken: nil, userAgent: userAgent, baseURL: baseUrl)
1414
}
1515

1616
/// Retrieves the WordPressComSiteInfo instance associated to a WordPress.com Site Address.

WordPressAuthenticator/Services/WordPressComOAuthClientFacade.swift

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,12 @@ import WordPressKit
66
private let client: WordPressComOAuthClient
77

88
@objc required public init(client: String, secret: String) {
9-
self.client = WordPressComOAuthClient(clientID: client,
10-
secret: secret,
11-
wordPressComBaseUrl: WordPressAuthenticator.shared.configuration.wpcomBaseURL,
12-
wordPressComApiBaseUrl: WordPressAuthenticator.shared.configuration.wpcomAPIBaseURL)
9+
self.client = WordPressComOAuthClient(
10+
clientID: client,
11+
secret: secret,
12+
wordPressComBaseURL: WordPressAuthenticator.shared.configuration.wpcomBaseURL,
13+
wordPressComApiBaseURL: WordPressAuthenticator.shared.configuration.wpcomAPIBaseURL
14+
)
1315
}
1416

1517
public func authenticate(

0 commit comments

Comments
 (0)