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

Include a reference to AuthInternal in MultiFactorSessionImpl. #6594

Merged
merged 2 commits into from Sep 12, 2022

Conversation

prameshj
Copy link
Contributor

This is needed for TOTP support where the function to generate TOTP Secret (by invoking startEnrollment API) needs the Auth reference, but rather than pass in a parameter, we can derive it from the multiFactorSession that is already passed in as a param. This simplifies the TOTP enrollment API for the developer, by requiring one less parameter.

The usage for auth can be seen in this WIP change - mfa-totp...mfa-totp-prameshj#diff-e9ae122839df9e758f95dd35db60444dd51b73a319b02a9ef36b747dc9889fbaR81

Hey there! So you want to contribute to a Firebase SDK?
Before you file this pull request, please read these guidelines:

Discussion

  • Read the contribution guidelines (CONTRIBUTING.md).
  • If this has been discussed in an issue, make sure to link to the issue here.
    If not, go file an issue about this before creating a pull request to discuss.

Testing

  • Make sure all existing tests in the repository pass after your change.
  • If you fixed a bug or added a feature, add a new test to cover your code.

Added new unit tests.

@changeset-bot
Copy link

changeset-bot bot commented Sep 12, 2022

🦋 Changeset detected

Latest commit: ec9be42

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 3 packages
Name Type
@firebase/auth Patch
@firebase/auth-compat Patch
firebase Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

This is needed for TOTP support where the function to generate TOTP Secret (by invoking startEnrollment API) needs the Auth reference, but rather than pass in a parameter, we can derive it from the multiFactorSession that is already passed in as a param. This simplifies the API for the developer, by requiring one less paramter.
@google-oss-bot
Copy link
Contributor

google-oss-bot commented Sep 12, 2022

Size Report 1

Affected Products

  • @firebase/auth

    TypeBase (7c0c640)Merge (4ee7722)Diff
    browser155 kB155 kB+45 B (+0.0%)
    cordova183 kB183 kB+45 B (+0.0%)
    esm5203 kB203 kB+45 B (+0.0%)
    main148 kB148 kB+45 B (+0.0%)
    module155 kB155 kB+45 B (+0.0%)
    react-native168 kB168 kB+45 B (+0.0%)
  • @firebase/auth/cordova

    TypeBase (7c0c640)Merge (4ee7722)Diff
    browser183 kB183 kB+45 B (+0.0%)
    module183 kB183 kB+45 B (+0.0%)
  • @firebase/auth/internal

    TypeBase (7c0c640)Merge (4ee7722)Diff
    browser166 kB166 kB+45 B (+0.0%)
    esm5216 kB216 kB+45 B (+0.0%)
    main184 kB184 kB+45 B (+0.0%)
    module166 kB166 kB+45 B (+0.0%)
  • @firebase/auth/react-native

    TypeBase (7c0c640)Merge (4ee7722)Diff
    browser168 kB168 kB+45 B (+0.0%)
    module168 kB168 kB+45 B (+0.0%)
  • firebase

    TypeBase (7c0c640)Merge (4ee7722)Diff
    firebase-auth-compat.js125 kB125 kB+33 B (+0.0%)
    firebase-auth-cordova.js137 kB137 kB+33 B (+0.0%)
    firebase-auth-react-native.js148 kB148 kB+33 B (+0.0%)
    firebase-auth.js116 kB116 kB+33 B (+0.0%)
    firebase-compat.js738 kB738 kB+33 B (+0.0%)

Test Logs

  1. https://storage.googleapis.com/firebase-sdk-metric-reports/wegLAzWnpx.html

@google-oss-bot
Copy link
Contributor

google-oss-bot commented Sep 12, 2022

Size Analysis Report 1

Affected Products

  • @firebase/auth

    • getMultiFactorResolver

      Size

      TypeBase (7c0c640)Merge (4ee7722)Diff
      size34.1 kB34.1 kB+18 B (+0.1%)
      size-with-ext-deps53.9 kB53.9 kB+18 B (+0.0%)
    • multiFactor

      Size

      TypeBase (7c0c640)Merge (4ee7722)Diff
      size33.6 kB33.6 kB+33 B (+0.1%)
      size-with-ext-deps53.4 kB53.4 kB+33 B (+0.1%)

Test Logs

  1. https://storage.googleapis.com/firebase-sdk-metric-reports/EMilvuwN8f.html

@prameshj prameshj merged commit e06d906 into master Sep 12, 2022
@prameshj prameshj deleted the mfasession-auth branch September 12, 2022 19:53
@@ -31,11 +32,19 @@ interface SerializedMultiFactorSession {
export class MultiFactorSessionImpl implements MultiFactorSession {
private constructor(
readonly type: MultiFactorSessionType,
readonly credential: string
readonly credential: string,
readonly auth?: AuthInternal
Copy link
Contributor

Choose a reason for hiding this comment

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

Wondering if this change need to be documented somewhere or any proto files need to be changed as we added a new param

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is an implementation detail, a developer will not directly interact with this field, hence it is not documented.

Copy link
Contributor

Choose a reason for hiding this comment

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

What about internal customers?

@google-oss-bot google-oss-bot mentioned this pull request Sep 14, 2022
bhparijat pushed a commit that referenced this pull request Sep 23, 2022
* Include a reference to AuthInternal in MultiFactorSessionImpl.

This is needed for TOTP support where the function to generate TOTP Secret (by invoking startEnrollment API) needs the Auth reference, but rather than pass in a parameter, we can derive it from the multiFactorSession that is already passed in as a param. This simplifies the API for the developer, by requiring one less paramter.

* Added changeset.
@firebase firebase locked and limited conversation to collaborators Oct 13, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants