@@ -47,6 +47,13 @@ public protocol URLAuthenticationChallengeSender : NSObjectProtocol {
47
47
to indicate when it's done.
48
48
*/
49
49
open class URLAuthenticationChallenge : NSObject , NSSecureCoding {
50
+
51
+ private let _protectionSpace : URLProtectionSpace
52
+ private let _proposedCredential : URLCredential ?
53
+ private let _previousFailureCount : Int
54
+ private let _failureResponse : URLResponse ?
55
+ private let _error : Error ?
56
+ private let _sender : URLAuthenticationChallengeSender
50
57
51
58
static public var supportsSecureCoding : Bool {
52
59
return true
@@ -72,7 +79,12 @@ open class URLAuthenticationChallenge : NSObject, NSSecureCoding {
72
79
@result An authentication challenge initialized with the specified parameters
73
80
*/
74
81
public init ( protectionSpace space: URLProtectionSpace , proposedCredential credential: URLCredential ? , previousFailureCount: Int , failureResponse response: URLResponse ? , error: Error ? , sender: URLAuthenticationChallengeSender ) {
75
- NSUnimplemented ( )
82
+ self . _protectionSpace = space
83
+ self . _proposedCredential = credential
84
+ self . _previousFailureCount = previousFailureCount
85
+ self . _failureResponse = response
86
+ self . _error = error
87
+ self . _sender = sender
76
88
}
77
89
78
90
@@ -85,7 +97,12 @@ open class URLAuthenticationChallenge : NSObject, NSSecureCoding {
85
97
one type of authentication challenge to look like another type.
86
98
*/
87
99
public init ( authenticationChallenge challenge: URLAuthenticationChallenge , sender: URLAuthenticationChallengeSender ) {
88
- NSUnimplemented ( )
100
+ self . _protectionSpace = challenge. protectionSpace
101
+ self . _proposedCredential = challenge. proposedCredential
102
+ self . _previousFailureCount = challenge. previousFailureCount
103
+ self . _failureResponse = challenge. failureResponse
104
+ self . _error = challenge. error
105
+ self . _sender = sender
89
106
}
90
107
91
108
@@ -96,7 +113,7 @@ open class URLAuthenticationChallenge : NSObject, NSSecureCoding {
96
113
*/
97
114
/*@NSCopying*/ open var protectionSpace : URLProtectionSpace {
98
115
get {
99
- NSUnimplemented ( )
116
+ return _protectionSpace
100
117
}
101
118
}
102
119
@@ -115,7 +132,7 @@ open class URLAuthenticationChallenge : NSObject, NSSecureCoding {
115
132
*/
116
133
/*@NSCopying*/ open var proposedCredential : URLCredential ? {
117
134
get {
118
- NSUnimplemented ( )
135
+ return _proposedCredential
119
136
}
120
137
}
121
138
@@ -127,7 +144,7 @@ open class URLAuthenticationChallenge : NSObject, NSSecureCoding {
127
144
*/
128
145
open var previousFailureCount : Int {
129
146
get {
130
- NSUnimplemented ( )
147
+ return _previousFailureCount
131
148
}
132
149
}
133
150
@@ -143,7 +160,7 @@ open class URLAuthenticationChallenge : NSObject, NSSecureCoding {
143
160
*/
144
161
/*@NSCopying*/ open var failureResponse : URLResponse ? {
145
162
get {
146
- NSUnimplemented ( )
163
+ return _failureResponse
147
164
}
148
165
}
149
166
@@ -158,7 +175,7 @@ open class URLAuthenticationChallenge : NSObject, NSSecureCoding {
158
175
*/
159
176
/*@NSCopying*/ open var error : Error ? {
160
177
get {
161
- NSUnimplemented ( )
178
+ return _error
162
179
}
163
180
}
164
181
@@ -171,7 +188,7 @@ open class URLAuthenticationChallenge : NSObject, NSSecureCoding {
171
188
*/
172
189
open var sender : URLAuthenticationChallengeSender ? {
173
190
get {
174
- NSUnimplemented ( )
191
+ return _sender
175
192
}
176
193
}
177
194
}
0 commit comments