Source/WebKit/ChangeLog

 12021-01-07 Jiewen Tan <jiewen_tan@apple.com>
 2
 3 [WebAuthn] Adopt new UI for the update flow
 4 https://bugs.webkit.org/show_bug.cgi?id=219713
 5 <rdar://problem/72154988>
 6
 7 Reviewed by NOBODY (OOPS!).
 8
 9 Covered by manual tests.
 10
 11 * Platform/spi/Cocoa/AuthenticationServicesCoreSPI.h:
 12 (NS_ERROR_ENUM):
 13 * UIProcess/WebAuthentication/Cocoa/AuthenticatorPresenterCoordinator.mm:
 14 (WebKit::AuthenticatorPresenterCoordinator::updatePresenter):
 15
1162021-01-07 Jiewen Tan <jiewen_tan@apple.com>
217
318 Unreviewed, a build fix after r271221

Source/WebKit/Platform/spi/Cocoa/AuthenticationServicesCoreSPI.h

@@NS_ASSUME_NONNULL_BEGIN
7272- (void)presentAuthorizationWithContext:(ASCAuthorizationPresentationContext *)context completionHandler:(void (^)(id<ASCCredentialProtocol> _Nullable, NSError * _Nullable))completionHandler;
7373- (void)updateInterfaceWithLoginChoices:(NSArray<id <ASCLoginChoiceProtocol>> *)loginChoices;
7474- (void)presentPINEntryInterface;
 75- (void)updateInterfaceForUserVisibleError:(NSError *)userVisibleError;
7576- (void)dismissWithError:(nullable NSError *)error;
7677
7778@property (nonatomic, weak) id <ASCAuthorizationPresenterDelegate> delegate;

@@typedef NS_ERROR_ENUM(ASCAuthorizationErrorDomain, ASCAuthorizationError) {
167168 ASCAuthorizationErrorFailed,
168169 ASCAuthorizationErrorUserCanceled,
169170 ASCAuthorizationErrorPINRequired,
 171 ASCAuthorizationErrorMultipleNFCTagsPresent,
 172 ASCAuthorizationErrorNoCredentialsFound,
 173 ASCAuthorizationErrorLAError,
 174 ASCAuthorizationErrorLAExcludeCredentialsMatched,
170175};
171176
172177extern NSString * const ASCPINValidationResultKey;

Source/WebKit/UIProcess/WebAuthentication/Cocoa/AuthenticatorPresenterCoordinator.mm

@@void AuthenticatorPresenterCoordinator::updatePresenter(WebAuthenticationStatus
109109 m_credentialRequestHandler(nil, error.get());
110110 break;
111111 }
 112 case WebAuthenticationStatus::MultipleNFCTagsPresent: {
 113 auto error = adoptNS([[NSError alloc] initWithDomain:ASCAuthorizationErrorDomain code:ASCAuthorizationErrorMultipleNFCTagsPresent userInfo:nil]);
 114 [m_presenter updateInterfaceForUserVisibleError:error.get()];
 115 break;
 116 }
 117 case WebAuthenticationStatus::NoCredentialsFound:
 118 case WebAuthenticationStatus::LANoCredential: {
 119 auto error = adoptNS([[NSError alloc] initWithDomain:ASCAuthorizationErrorDomain code:ASCAuthorizationErrorNoCredentialsFound userInfo:nil]);
 120 [m_presenter updateInterfaceForUserVisibleError:error.get()];
 121 break;
 122 }
 123 case WebAuthenticationStatus::LAError: {
 124 auto error = adoptNS([[NSError alloc] initWithDomain:ASCAuthorizationErrorDomain code:ASCAuthorizationErrorLAError userInfo:nil]);
 125 [m_presenter updateInterfaceForUserVisibleError:error.get()];
 126 break;
 127 }
 128 case WebAuthenticationStatus::LAExcludeCredentialsMatched: {
 129 auto error = adoptNS([[NSError alloc] initWithDomain:ASCAuthorizationErrorDomain code:ASCAuthorizationErrorLAExcludeCredentialsMatched userInfo:nil]);
 130 [m_presenter updateInterfaceForUserVisibleError:error.get()];
 131 break;
 132 }
112133 default:
113  // FIXME(219713): Adopt new UI for the update flow.
 134 ASSERT_NOT_REACHED();
114135 break;
115136 }
116137#endif // HAVE(ASC_AUTH_UI)