Skip to content

Commit b3e9c62

Browse files
Merge pull request #73 from okta/dev
Release 1.3.0
2 parents ad9c2dd + f0f0ed1 commit b3e9c62

36 files changed

+848
-212
lines changed

OktaAuthNative.xcodeproj/project.pbxproj

+21-21
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@
77
objects = {
88

99
/* Begin PBXBuildFile section */
10+
2F32C9D8229417DA003A6768 /* OktaAuthStatusUnauthenticatedTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2F32C9D7229417DA003A6768 /* OktaAuthStatusUnauthenticatedTests.swift */; };
11+
2F32C9DA229422CF003A6768 /* TypesTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2F32C9D9229422CF003A6768 /* TypesTests.swift */; };
12+
2F32C9DC2295419E003A6768 /* AuthStateTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2F32C9DB2295419E003A6768 /* AuthStateTests.swift */; };
1013
2F7C3B782268AF1E00A62FD4 /* OktaModelsTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2F7C3B6E2268AF1500A62FD4 /* OktaModelsTests.swift */; };
1114
2F7C3B792268AF2400A62FD4 /* OktaAPITests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2F7C3B702268AF1500A62FD4 /* OktaAPITests.swift */; };
1215
2F7C3B7A2268AF2800A62FD4 /* OktaAPIRequestTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2F7C3B712268AF1500A62FD4 /* OktaAPIRequestTests.swift */; };
@@ -44,9 +47,7 @@
4447
2F8155A52271F352009FA6C5 /* OktaAuthStatusLockedOutTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2F8155A42271F352009FA6C5 /* OktaAuthStatusLockedOutTests.swift */; };
4548
2F8155A72271F6DC009FA6C5 /* OktaAuthStatePasswordResetTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2F8155A62271F6DC009FA6C5 /* OktaAuthStatePasswordResetTests.swift */; };
4649
2F8D79F421D6601600CFDF12 /* README.md in Resources */ = {isa = PBXBuildFile; fileRef = 2F8D79F321D6601600CFDF12 /* README.md */; };
47-
2FF5C85221D1078E00EECA75 /* PrimaryAuthResponse in Resources */ = {isa = PBXBuildFile; fileRef = 2FF5C85121D1078E00EECA75 /* PrimaryAuthResponse */; };
4850
2FF5C85921D3A9E700EECA75 /* OperationNotAllowedError in Resources */ = {isa = PBXBuildFile; fileRef = 2FF5C85721D3A9E200EECA75 /* OperationNotAllowedError */; };
49-
2FF5C85C21D3B04D00EECA75 /* PrimaryAuthFactorsResponse in Resources */ = {isa = PBXBuildFile; fileRef = 2FF5C85A21D3AEEC00EECA75 /* PrimaryAuthFactorsResponse */; };
5051
2FF5C85E21D3B15000EECA75 /* AuthenticationFailedError in Resources */ = {isa = PBXBuildFile; fileRef = 2FF5C85D21D3B15000EECA75 /* AuthenticationFailedError */; };
5152
A12F4FF92238311A00DB9147 /* OktaAuthSdk.swift in Sources */ = {isa = PBXBuildFile; fileRef = A12F4FF82238311A00DB9147 /* OktaAuthSdk.swift */; };
5253
A12F4FFA2238311A00DB9147 /* OktaAuthSdk.swift in Sources */ = {isa = PBXBuildFile; fileRef = A12F4FF82238311A00DB9147 /* OktaAuthSdk.swift */; };
@@ -122,9 +123,8 @@
122123
A1E7469F2283819700C48A28 /* MFA_ENROLL_ACTIVATE_CALL in Resources */ = {isa = PBXBuildFile; fileRef = A1E7469E2283819700C48A28 /* MFA_ENROLL_ACTIVATE_CALL */; };
123124
A1E746A0228381D400C48A28 /* MFA_ENROLL_ACTIVATE_CALL in Resources */ = {isa = PBXBuildFile; fileRef = A1E7469E2283819700C48A28 /* MFA_ENROLL_ACTIVATE_CALL */; };
124125
A1E746A22283830F00C48A28 /* OktaFactorOtherTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = A1E746A12283830F00C48A28 /* OktaFactorOtherTests.swift */; };
125-
A1F9E5922298729100924F7A /* MFA_ENROLL_ACTIVATE_TOTP in Resources */ = {isa = PBXBuildFile; fileRef = A1F9E5912298729100924F7A /* MFA_ENROLL_ACTIVATE_TOTP */; };
126-
A1F9E594229888BC00924F7A /* SUCCESS_UNLOCK in Resources */ = {isa = PBXBuildFile; fileRef = A1F9E593229888BC00924F7A /* SUCCESS_UNLOCK */; };
127-
A1F9E5962298895600924F7A /* OktaAuthStatusSuccessTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = A1F9E5952298895500924F7A /* OktaAuthStatusSuccessTests.swift */; };
126+
A1F9E599229DD7A400924F7A /* MFA_ENROLL_ACTIVATE_TOTP in Resources */ = {isa = PBXBuildFile; fileRef = A1F9E597229DD7A400924F7A /* MFA_ENROLL_ACTIVATE_TOTP */; };
127+
A1F9E59A229DD7A400924F7A /* SUCCESS_UNLOCK in Resources */ = {isa = PBXBuildFile; fileRef = A1F9E598229DD7A400924F7A /* SUCCESS_UNLOCK */; };
128128
A1FCB12F220A458F0026F522 /* OktaAPIMock.swift in Sources */ = {isa = PBXBuildFile; fileRef = A1FCB12E220A458F0026F522 /* OktaAPIMock.swift */; };
129129
FA4ED9A021C1499200A065A1 /* OktaAuth_iOS.h in Headers */ = {isa = PBXBuildFile; fileRef = FA4ED99E21C1499200A065A1 /* OktaAuth_iOS.h */; settings = {ATTRIBUTES = (Public, ); }; };
130130
FA4ED9AA21C2895B00A065A1 /* OktaError.swift in Sources */ = {isa = PBXBuildFile; fileRef = FA4ED9A921C2895B00A065A1 /* OktaError.swift */; };
@@ -142,6 +142,9 @@
142142
/* End PBXContainerItemProxy section */
143143

144144
/* Begin PBXFileReference section */
145+
2F32C9D7229417DA003A6768 /* OktaAuthStatusUnauthenticatedTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = OktaAuthStatusUnauthenticatedTests.swift; sourceTree = "<group>"; };
146+
2F32C9D9229422CF003A6768 /* TypesTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TypesTests.swift; sourceTree = "<group>"; };
147+
2F32C9DB2295419E003A6768 /* AuthStateTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AuthStateTests.swift; sourceTree = "<group>"; };
145148
2F7C3B6E2268AF1500A62FD4 /* OktaModelsTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = OktaModelsTests.swift; sourceTree = "<group>"; };
146149
2F7C3B702268AF1500A62FD4 /* OktaAPITests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = OktaAPITests.swift; sourceTree = "<group>"; };
147150
2F7C3B712268AF1500A62FD4 /* OktaAPIRequestTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = OktaAPIRequestTests.swift; sourceTree = "<group>"; };
@@ -179,9 +182,7 @@
179182
2F8155A42271F352009FA6C5 /* OktaAuthStatusLockedOutTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = OktaAuthStatusLockedOutTests.swift; sourceTree = "<group>"; };
180183
2F8155A62271F6DC009FA6C5 /* OktaAuthStatePasswordResetTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = OktaAuthStatePasswordResetTests.swift; sourceTree = "<group>"; };
181184
2F8D79F321D6601600CFDF12 /* README.md */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = net.daringfireball.markdown; path = README.md; sourceTree = "<group>"; };
182-
2FF5C85121D1078E00EECA75 /* PrimaryAuthResponse */ = {isa = PBXFileReference; explicitFileType = text.json; path = PrimaryAuthResponse; sourceTree = "<group>"; };
183185
2FF5C85721D3A9E200EECA75 /* OperationNotAllowedError */ = {isa = PBXFileReference; explicitFileType = text.json; path = OperationNotAllowedError; sourceTree = "<group>"; };
184-
2FF5C85A21D3AEEC00EECA75 /* PrimaryAuthFactorsResponse */ = {isa = PBXFileReference; explicitFileType = text.json; path = PrimaryAuthFactorsResponse; sourceTree = "<group>"; };
185186
2FF5C85D21D3B15000EECA75 /* AuthenticationFailedError */ = {isa = PBXFileReference; lastKnownFileType = text; path = AuthenticationFailedError; sourceTree = "<group>"; };
186187
A12F4FF82238311A00DB9147 /* OktaAuthSdk.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = OktaAuthSdk.swift; sourceTree = "<group>"; };
187188
A151096B2281FD3F009AF8EB /* OktaAuthStatusPasswordWarningTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = OktaAuthStatusPasswordWarningTests.swift; sourceTree = "<group>"; };
@@ -225,9 +226,8 @@
225226
A1E7469C22837E7400C48A28 /* OktaFactorCallTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = OktaFactorCallTests.swift; sourceTree = "<group>"; };
226227
A1E7469E2283819700C48A28 /* MFA_ENROLL_ACTIVATE_CALL */ = {isa = PBXFileReference; lastKnownFileType = text; path = MFA_ENROLL_ACTIVATE_CALL; sourceTree = "<group>"; };
227228
A1E746A12283830F00C48A28 /* OktaFactorOtherTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = OktaFactorOtherTests.swift; sourceTree = "<group>"; };
228-
A1F9E5912298729100924F7A /* MFA_ENROLL_ACTIVATE_TOTP */ = {isa = PBXFileReference; lastKnownFileType = text; path = MFA_ENROLL_ACTIVATE_TOTP; sourceTree = "<group>"; };
229-
A1F9E593229888BC00924F7A /* SUCCESS_UNLOCK */ = {isa = PBXFileReference; lastKnownFileType = text; path = SUCCESS_UNLOCK; sourceTree = "<group>"; };
230-
A1F9E5952298895500924F7A /* OktaAuthStatusSuccessTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = OktaAuthStatusSuccessTests.swift; sourceTree = "<group>"; };
229+
A1F9E597229DD7A400924F7A /* MFA_ENROLL_ACTIVATE_TOTP */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = MFA_ENROLL_ACTIVATE_TOTP; sourceTree = "<group>"; };
230+
A1F9E598229DD7A400924F7A /* SUCCESS_UNLOCK */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = SUCCESS_UNLOCK; sourceTree = "<group>"; };
231231
A1FCB12E220A458F0026F522 /* OktaAPIMock.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = OktaAPIMock.swift; sourceTree = "<group>"; };
232232
FA4ED99B21C1499200A065A1 /* OktaAuthNative.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = OktaAuthNative.framework; sourceTree = BUILT_PRODUCTS_DIR; };
233233
FA4ED99E21C1499200A065A1 /* OktaAuth_iOS.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = OktaAuth_iOS.h; sourceTree = "<group>"; };
@@ -276,6 +276,8 @@
276276
isa = PBXGroup;
277277
children = (
278278
2F7C3B6E2268AF1500A62FD4 /* OktaModelsTests.swift */,
279+
2F32C9D9229422CF003A6768 /* TypesTests.swift */,
280+
2F32C9DB2295419E003A6768 /* AuthStateTests.swift */,
279281
);
280282
path = DomainObjects;
281283
sourceTree = "<group>";
@@ -304,7 +306,7 @@
304306
A151096B2281FD3F009AF8EB /* OktaAuthStatusPasswordWarningTests.swift */,
305307
A1E746432282050F00C48A28 /* OktaAuthStatusRecoveryChallengeTests.swift */,
306308
A1E746472282359B00C48A28 /* OktaAuthStatusRecoveryTests.swift */,
307-
A1F9E5952298895500924F7A /* OktaAuthStatusSuccessTests.swift */,
309+
2F32C9D7229417DA003A6768 /* OktaAuthStatusUnauthenticatedTests.swift */,
308310
);
309311
path = Statuses;
310312
sourceTree = "<group>";
@@ -320,9 +322,8 @@
320322
2FF5C85021D1076100EECA75 /* Resources */ = {
321323
isa = PBXGroup;
322324
children = (
323-
A1671552227BA90700E7801D /* Unknown_State_And_FactorResult */,
324-
2FF5C85121D1078E00EECA75 /* PrimaryAuthResponse */,
325-
2FF5C85A21D3AEEC00EECA75 /* PrimaryAuthFactorsResponse */,
325+
A1F9E597229DD7A400924F7A /* MFA_ENROLL_ACTIVATE_TOTP */,
326+
A1F9E598229DD7A400924F7A /* SUCCESS_UNLOCK */,
326327
2FF5C85721D3A9E200EECA75 /* OperationNotAllowedError */,
327328
2FF5C85D21D3B15000EECA75 /* AuthenticationFailedError */,
328329
2F7C3B812268CE3A00A62FD4 /* MFA_ENROLL_NotEnrolled */,
@@ -343,8 +344,7 @@
343344
A1E74645228207A800C48A28 /* RECOVERY_CHALLENGE_EMAIL */,
344345
A1E7465522834B9800C48A28 /* Questions */,
345346
A1E7469E2283819700C48A28 /* MFA_ENROLL_ACTIVATE_CALL */,
346-
A1F9E5912298729100924F7A /* MFA_ENROLL_ACTIVATE_TOTP */,
347-
A1F9E593229888BC00924F7A /* SUCCESS_UNLOCK */,
347+
A1671552227BA90700E7801D /* Unknown_State_And_FactorResult */,
348348
);
349349
path = Resources;
350350
sourceTree = "<group>";
@@ -579,12 +579,13 @@
579579
buildActionMask = 2147483647;
580580
files = (
581581
A1E746A0228381D400C48A28 /* MFA_ENROLL_ACTIVATE_CALL in Resources */,
582+
A1F9E599229DD7A400924F7A /* MFA_ENROLL_ACTIVATE_TOTP in Resources */,
582583
A1E74657228355FA00C48A28 /* Questions in Resources */,
583584
2F8155952270B85B009FA6C5 /* RECOVERY in Resources */,
584585
A1C06F16221E0037005E8369 /* PASSWORD_WARN in Resources */,
586+
A1F9E59A229DD7A400924F7A /* SUCCESS_UNLOCK in Resources */,
585587
2F8155992270B8AB009FA6C5 /* PASSWORD_RESET in Resources */,
586588
A1C06F14221DFFD8005E8369 /* PASSWORD_EXPIRED in Resources */,
587-
2FF5C85C21D3B04D00EECA75 /* PrimaryAuthFactorsResponse in Resources */,
588589
2F8155972270B878009FA6C5 /* RECOVERY_CHALLENGE_SMS in Resources */,
589590
2F7C3BC2226DED2300A62FD4 /* MFA_ENROLL_ACTIVATE_Push in Resources */,
590591
2F7C3BC4226DED2300A62FD4 /* MFA_CHALLENGE_SMS in Resources */,
@@ -593,14 +594,11 @@
593594
2F8155932270B740009FA6C5 /* LOCKED_OUT in Resources */,
594595
2F7C3BBF226DED2300A62FD4 /* MFA_ENROLL_NotEnrolled in Resources */,
595596
2FF5C85921D3A9E700EECA75 /* OperationNotAllowedError in Resources */,
596-
A1F9E594229888BC00924F7A /* SUCCESS_UNLOCK in Resources */,
597597
A1671554227BA90700E7801D /* Unknown_State_And_FactorResult in Resources */,
598598
2F7C3BC0226DED2300A62FD4 /* MFA_ENROLL_PartiallyEnrolled in Resources */,
599599
2F7C3BC1226DED2300A62FD4 /* MFA_ENROLL_ACTIVATE_SMS in Resources */,
600600
2F7C3BC5226DED2300A62FD4 /* MFA_CHALLENGE_TOTP in Resources */,
601601
2F7C3BBE226DED1E00A62FD4 /* MFA_CHALLENGE_WAITING_PUSH in Resources */,
602-
2FF5C85221D1078E00EECA75 /* PrimaryAuthResponse in Resources */,
603-
A1F9E5922298729100924F7A /* MFA_ENROLL_ACTIVATE_TOTP in Resources */,
604602
A1E74646228207A800C48A28 /* RECOVERY_CHALLENGE_EMAIL in Resources */,
605603
2F7C3BBD226DED1B00A62FD4 /* SUCCESS in Resources */,
606604
);
@@ -659,9 +657,11 @@
659657
A151096D2281FD3F009AF8EB /* OktaAuthStatusPasswordWarningTests.swift in Sources */,
660658
A1920FDF22615B2E007D50D2 /* OktaModels.swift in Sources */,
661659
A1920FC422615A97007D50D2 /* OktaAuthStatus.swift in Sources */,
660+
2F32C9DC2295419E003A6768 /* AuthStateTests.swift in Sources */,
662661
A1920FB522615A97007D50D2 /* OktaAuthStatusResponseHandler.swift in Sources */,
663662
2F8155A32271EEC1009FA6C5 /* OktaAuthStatusPasswordExpiredTests.swift in Sources */,
664663
2F7C3BBA226DE40200A62FD4 /* TestResponse.swift in Sources */,
664+
2F32C9D8229417DA003A6768 /* OktaAuthStatusUnauthenticatedTests.swift in Sources */,
665665
A1920FD922615AE5007D50D2 /* OktaAPIRequest.swift in Sources */,
666666
2F7C3BD0226F459C00A62FD4 /* OktaFactorTestCase.swift in Sources */,
667667
A1920FE522615B2E007D50D2 /* Types.swift in Sources */,
@@ -673,7 +673,6 @@
673673
A1E746A22283830F00C48A28 /* OktaFactorOtherTests.swift in Sources */,
674674
A1920FC122615A97007D50D2 /* OktaAuthStatusPasswordWarning.swift in Sources */,
675675
A1920FA622615A97007D50D2 /* OktaAuthStatusRecoveryChallenge.swift in Sources */,
676-
A1F9E5962298895600924F7A /* OktaAuthStatusSuccessTests.swift in Sources */,
677676
2F7C3B7E2268B83400A62FD4 /* OktaFactorPushTests.swift in Sources */,
678677
A1E746482282359B00C48A28 /* OktaAuthStatusRecoveryTests.swift in Sources */,
679678
2F7C3B7A2268AF2800A62FD4 /* OktaAPIRequestTests.swift in Sources */,
@@ -684,6 +683,7 @@
684683
2F7C3BCB226F40C800A62FD4 /* OktaFactorTotpTests.swift in Sources */,
685684
2F7C3BC9226F40BA00A62FD4 /* OktaFactorSmsTests.swift in Sources */,
686685
A1920FAF22615A97007D50D2 /* OktaAuthStatusUnauthenticated.swift in Sources */,
686+
2F32C9DA229422CF003A6768 /* TypesTests.swift in Sources */,
687687
2F81558F22708B23009FA6C5 /* OktaAuthStatusResponseHandlerMock.swift in Sources */,
688688
A1920F95225E8478007D50D2 /* OktaFactorOther.swift in Sources */,
689689
A183359A2239A86D007C6175 /* OktaError.swift in Sources */,

OktaAuthSdk.podspec

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Pod::Spec.new do |s|
22
s.name = 'OktaAuthSdk'
3-
s.version = '1.2.0'
3+
s.version = '1.3.0'
44
s.summary = 'SDK for Okta native authentication.'
55
s.description = <<-DESC
66
Integrate your native app with Okta.

README.md

+7
Original file line numberDiff line numberDiff line change
@@ -83,12 +83,19 @@ If you do not already have a **Developer Edition Account**, you can create one a
8383

8484
## Getting started
8585

86+
### CocoaPods
8687
This SDK is available through [CocoaPods](http://cocoapods.org). To install it, simply add the following line to your Podfile:
8788

8889
```ruby
8990
pod "OktaAuthSdk"
9091
```
9192

93+
### Carthage
94+
To integrate this SDK into your Xcode project using [Carthage](https://github.com/Carthage/Carthage), specify it in your Cartfile:
95+
```ruby
96+
github "okta/okta-auth-swift"
97+
```
98+
9299
## Usage guide
93100

94101
The Authentication SDK helps you build the following flows using your own UI elements:

Source/DomainObjects/AuthState.swift

+4-3
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ public enum AuthStatus {
2929
}
3030

3131
public extension AuthStatus {
32-
public init(raw: String) {
32+
init(raw: String) {
3333
switch raw {
3434
case "UNAUTHENTICATED":
3535
self = .unauthenticated
@@ -60,7 +60,7 @@ public extension AuthStatus {
6060
}
6161
}
6262

63-
public var rawValue: String {
63+
var rawValue: String {
6464
switch self {
6565
case .unauthenticated:
6666
return "UNAUTHENTICATED"
@@ -91,7 +91,8 @@ public extension AuthStatus {
9191
}
9292
}
9393

94-
public var description: String {
94+
@available(swift, deprecated: 1.2, obsoleted: 2.0, message: "This will be removed in v2.0. Please use rawValue instead.")
95+
var description: String {
9596
switch self {
9697
case .unauthenticated:
9798
return "Unauthenticated"

Source/DomainObjects/OktaModels.swift

+3-5
Original file line numberDiff line numberDiff line change
@@ -328,7 +328,7 @@ public struct EmbeddedResponse: Codable {
328328
}
329329

330330
public extension OktaAPISuccessResponse.FactorResult {
331-
public init(raw: String) {
331+
init(raw: String) {
332332
switch raw {
333333
case "SUCCESS":
334334
self = .success
@@ -354,9 +354,7 @@ public extension OktaAPISuccessResponse.FactorResult {
354354
self = .unknown(raw)
355355
}
356356
}
357-
}
358357

359-
public extension OktaAPISuccessResponse.FactorResult {
360358
var rawValue: String {
361359
switch self {
362360
case .success:
@@ -401,7 +399,7 @@ extension OktaAPISuccessResponse.FactorResult : Codable {
401399
}
402400

403401
public extension OktaAPISuccessResponse.RecoveryType {
404-
public init(raw: String) {
402+
init(raw: String) {
405403
switch raw {
406404
case "PASSWORD":
407405
self = .password
@@ -442,7 +440,7 @@ extension OktaAPISuccessResponse.RecoveryType : Codable {
442440
}
443441

444442
public extension EmbeddedResponse.AuthenticationObject.AuthProtocol {
445-
public init(raw: String) {
443+
init(raw: String) {
446444
switch raw {
447445
case "SAML2.0":
448446
self = .saml_2_0

Source/DomainObjects/Types.swift

+11-10
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ public enum FactorType {
2727
}
2828

2929
public extension FactorType {
30-
public init(raw: String) {
30+
init(raw: String) {
3131
switch raw {
3232
case "question":
3333
self = .question
@@ -43,7 +43,7 @@ public extension FactorType {
4343
self = .token
4444
case "token:hardware":
4545
self = .tokenHardware
46-
case "web":
46+
case "web", "Web":
4747
self = .web
4848
case "u2f":
4949
self = .u2f
@@ -73,17 +73,18 @@ public extension FactorType {
7373
case .tokenHardware:
7474
return "token:hardware"
7575
case .web:
76-
return "Web"
76+
return "web"
7777
case .u2f:
7878
return "u2f"
7979
case .email:
8080
return "email"
81-
case .unknown(_):
82-
return "unknown"
81+
case .unknown(let raw):
82+
return raw
8383
}
8484
}
8585
}
8686

87+
@available(swift, deprecated: 1.2, obsoleted: 2.0, message: "This will be removed in v2.0. Please use rawValue instead.")
8788
public extension FactorType {
8889
var description: String {
8990
switch self {
@@ -107,8 +108,8 @@ public extension FactorType {
107108
return "U2F"
108109
case .email:
109110
return "Email"
110-
case .unknown(_):
111-
return "unknown"
111+
case .unknown(let raw):
112+
return raw
112113
}
113114
}
114115
}
@@ -140,7 +141,7 @@ public enum FactorProvider {
140141
}
141142

142143
public extension FactorProvider {
143-
public init(raw: String) {
144+
init(raw: String) {
144145
switch raw {
145146
case "OKTA":
146147
self = .okta
@@ -179,8 +180,8 @@ public extension FactorProvider {
179180
return "DUO"
180181
case .fido:
181182
return "FIDO"
182-
case .unknown(_):
183-
return "unknown"
183+
case .unknown(let raw):
184+
return raw
184185
}
185186
}
186187
}

Source/Info.plist

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
<key>CFBundlePackageType</key>
1818
<string>FMWK</string>
1919
<key>CFBundleShortVersionString</key>
20-
<string>1.2.0</string>
20+
<string>1.3.0</string>
2121
<key>CFBundleVersion</key>
2222
<string>$(CURRENT_PROJECT_VERSION)</string>
2323
</dict>

Source/OktaError.swift

+4
Original file line numberDiff line numberDiff line change
@@ -64,4 +64,8 @@ public extension OktaError {
6464
return "Invalid parameters"
6565
}
6666
}
67+
68+
var localizedDescription: String {
69+
return NSLocalizedString(self.description, comment: "")
70+
}
6771
}

0 commit comments

Comments
 (0)