Skip to content

[v11] Deprecate OAuthProvider API get credential API that uses string provider ID #13097

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

Merged
merged 13 commits into from
Jun 14, 2024

Conversation

ncooke3
Copy link
Member

@ncooke3 ncooke3 commented Jun 7, 2024

  • Requires API review

Process:

  1. Decorate existing ObjC API with @available(swift, introduced: 100.0) to make it ObjC-only and replace String types in ObjC-only API with NSString. This has the following result:
Screenshot 2024-06-14 at 12 25 14 PM
  1. Copy the ObjC-only API and remove the @available(swift, introduced: 100.0) attribute, the @objc(...) decorator, and swap the NSString types for String. This should leave the current Swift API. Mark it deprecated (see PR diff for example deprecation comment).
  2. Add new signature, swapping the providerID: String for providerID: AuthProviderID
  3. I looked over the newly added Swift API and there was an opportunity to consolidate two API into one by using a param with default value. See commit diff in ed6370f

No changes are needed to ObjC API tests:

FIROAuthCredential *c = [FIROAuthProvider credentialWithProviderID:@"id" accessToken:@"token"];
c = [FIROAuthProvider credentialWithProviderID:@"id"
IDToken:@"idToken"
accessToken:@"accessToken"];
c = [FIROAuthProvider credentialWithProviderID:@"id" IDToken:@"idtoken" rawNonce:@"nonce"];
c = [FIROAuthProvider credentialWithProviderID:@"id"
IDToken:@"token"
rawNonce:@"nonce"
accessToken:@"accessToken"];

Decisions:

  1. Add docs to ObjC-only API and new Swift API, and don't add docs for the deprecated Swift API

@google-oss-bot
Copy link

1 Warning
⚠️ Did you forget to add a changelog entry? (Add #no-changelog to the PR description to silence this warning.)

Generated by 🚫 Danger

@ncooke3 ncooke3 requested a review from paulb777 June 14, 2024 16:28
@ncooke3 ncooke3 marked this pull request as ready for review June 14, 2024 16:33
@ncooke3 ncooke3 changed the title Demo ObjC-only legacy API and string literal initializer [v11] Deprecate OAuthProvider API get credential API that uses string provider ID Jun 14, 2024
@ncooke3
Copy link
Member Author

ncooke3 commented Jun 14, 2024

The "get credential" API are done. I was going to break up the migration into smaller PRs since the providerID: String is used in many places right now.

@ncooke3 ncooke3 merged commit 5bd8304 into pb-auth-providerID Jun 14, 2024
49 of 50 checks passed
@ncooke3 ncooke3 deleted the nc/auth-providerID branch June 14, 2024 18:11
@firebase firebase locked and limited conversation to collaborators Jul 15, 2024
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.

3 participants