Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Passkey #7] FIRUser startPasskeyEnrollmentWithName:completion: & finalizePasskeyEnrollmentWithPlatformCredential:completion: implementation #11991

Merged
merged 3 commits into from
Oct 24, 2023

Conversation

Xiaoshouzi-gh
Copy link
Contributor

  • Implemented startPasskeyEnrollmentWithName:completion: public API
  • Implemented finalizePasskeyEnrollmentWithPlatformCredential:completion: implementation public API
  • Added public data type PasskeyInfo
  • Added relative unit tests

Future PR
Test cases that need "expires_in" changes in first for finalizePasskeyEnrollmentWithPlatformCredential:completion: on both provided passkey name and not provided passkey name.

@google-oss-bot
Copy link

2 Warnings
⚠️ Did you forget to add a changelog entry? (Add #no-changelog to the PR description to silence this warning.)
⚠️ New public headers were added, did you remember to add them to the umbrella header?

Generated by 🚫 Danger

@github-actions
Copy link
Contributor

github-actions bot commented Oct 24, 2023

Apple API Diff Report

Commit: 60876c1
Last updated: Tue Oct 24 13:47 PDT 2023
View workflow logs & download artifacts


FirebaseAuth

Classes

[ADDED] FIRPasskeyInfo
[ADDED] FIRPasskeyInfo
Swift:
+  class PasskeyInfo : NSObject
+    var name : String { get }
+    var credentialID : String { get }
Objective-C:
+  @interface FIRPasskeyInfo : NSObject
+    @property ( nonatomic , readonly ) NSString * _Nonnull name ;
+    @property ( nonatomic , readonly ) NSString * _Nonnull credentialID ;
FIRUser
[ADDED] enrolledPasskeys
Swift:
+  var enrolledPasskeys : [ PasskeyInfo ] { get }
Objective-C:
+  @property ( nonatomic , readonly ) API_UNAVAILABLE ( watchos ) NSArray < FIRPasskeyInfo *> * enrolledPasskeys ;
[ADDED] -startPasskeyEnrollmentWithName:completion:
Swift:
+  func startPasskeyEnrollment ( with name : String ?) async throws -> ASAuthorizationPlatformPublicKeyCredentialRegistrationRequest
Objective-C:
+  - ( void ) startPasskeyEnrollmentWithName :( nullable NSString * ) name completion : ( nullable void ( ^ )( ASAuthorizationPlatformPublicKeyCredentialRegistrationRequest * _Nullable , NSError * _Nullable )) completion ;
[ADDED] -finalizePasskeyEnrollmentWithPlatformCredential:completion:
Swift:
+  func finalizePasskeyEnrollment ( with platformCredential : ASAuthorizationPlatformPublicKeyCredentialRegistration ) async throws -> AuthDataResult
Objective-C:
+  - ( void ) finalizePasskeyEnrollmentWithPlatformCredential : ( nonnull ASAuthorizationPlatformPublicKeyCredentialRegistration * ) platformCredential completion : ( nullable void ( ^ )( FIRAuthDataResult * _Nullable , NSError * _Nullable )) completion ;

@Xiaoshouzi-gh Xiaoshouzi-gh changed the base branch from master to passkey-main October 24, 2023 17:48
@Xiaoshouzi-gh Xiaoshouzi-gh marked this pull request as ready for review October 24, 2023 18:47
FirebaseAuth/Sources/Backend/RPC/Proto/FIRPasskeyInfo.m Outdated Show resolved Hide resolved
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we need this file?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I needed to use the initWithDictionary method that was inherited from . However I don't want to expose this in the public data type.

FirebaseAuth/Sources/User/FIRUser.m Show resolved Hide resolved
#import "FIRUserInfo.h"

@class FIRAuthTokenResult;
@class FIRPhoneAuthCredential;
@class FIRUserProfileChangeRequest;
@class FIRUserMetadata;
@protocol FIRAuthUIDelegate;
#if TARGET_OS_IOS || TARGET_OS_TV || TARGET_OS_OSX || TARGET_OS_MACCATALYST
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should TARGET_OS_VISION be included here or excluded via availability in the header?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

visionOS is supported on 1.0+ beta, do you think we should include it here?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, we're striving to provide build support for Firebase for visionOS and community supported functionality.

Note other examples of the usage of TARGET_OS_VISION so that it builds both on Xcode 14 and Xcode 15.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you Paul. Will address this in a different PR for all occurance. tracking ticket b/307595519

@Xiaoshouzi-gh Xiaoshouzi-gh merged commit 16ef4bf into passkey-main Oct 24, 2023
45 checks passed
@Xiaoshouzi-gh Xiaoshouzi-gh deleted the passkey-user-change branch October 24, 2023 22:54
@firebase firebase locked and limited conversation to collaborators Nov 24, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants