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

Create/Update tenant with ReCAPTCHA Config #1586

Merged
merged 14 commits into from
Mar 7, 2022
Merged

Conversation

Xiaoshouzi-gh
Copy link
Contributor

Support reCaptcha config /create update on tenants.
- Updated reCaptcha config type align with backend API.
- Support create and update tenants with reCaptcha config.
- Added reCaptcha unit tests on tenants.

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.

API Changes

  • At this time we cannot accept changes that affect the public API. If you'd like to help
    us make Firebase APIs better, please propose your change in an issue so that we
    can discuss it together.

 - Updated reCaptcha config type align with backend API.
 - Support create and update tenants with reCaptcha config.
 - Added reCaptcha unit tests on tenants.
Copy link

@renkelvin renkelvin left a comment

Choose a reason for hiding this comment

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

Looks good to me. Please add Lahiru for approval.

src/auth/tenant.ts Outdated Show resolved Hide resolved
test/unit/auth/tenant.spec.ts Outdated Show resolved Hide resolved
@Xiaoshouzi-gh Xiaoshouzi-gh marked this pull request as ready for review March 4, 2022 18:25
Copy link
Member

@lahirumaramba lahirumaramba left a comment

Choose a reason for hiding this comment

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

Thank you, Liubin!
I added some comments and questions. Didn't get a chance to dive into unit tests. I will take another look later. Thanks!

src/auth/auth-config.ts Outdated Show resolved Hide resolved
src/auth/auth-config.ts Outdated Show resolved Hide resolved
src/auth/auth-config.ts Outdated Show resolved Hide resolved
src/auth/auth-config.ts Show resolved Hide resolved
src/auth/auth-config.ts Outdated Show resolved Hide resolved
src/auth/auth-config.ts Show resolved Hide resolved
src/auth/auth-config.ts Show resolved Hide resolved
src/auth/tenant.ts Show resolved Hide resolved
src/auth/tenant.ts Show resolved Hide resolved
src/auth/tenant.ts Show resolved Hide resolved
Major updates - Removed ManagedRuleAuth class and move the validation to recaptchaAuthConfig object.
@Xiaoshouzi-gh
Copy link
Contributor Author

Thank you, Liubin! I added some comments and questions. Didn't get a chance to dive into unit tests. I will take another look later. Thanks!

Thank you @lahirumaramba for the review. Addressed majority comments. Resolved the trivial changes and left comments on the ones needed.

Copy link
Member

@lahirumaramba lahirumaramba left a comment

Choose a reason for hiding this comment

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

Thank you! Just a few nits but otherwise LGTM!

'"RecaptchaConfig.emailPasswordEnforcementState" must be either "OFF", "AUDIT" or "ENFORCE".',
);
}
}
Copy link
Member

Choose a reason for hiding this comment

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

The SDK shouldn't allow empty strings in the request to the BE service so this error technically should not occur (from the backend). I felt like the check is redundant because you check for a restricted set of strings here regardless. Not a big issue so I will leave it up to you to decide the best path here.

src/auth/auth-config.ts Outdated Show resolved Hide resolved
src/auth/auth-config.ts Outdated Show resolved Hide resolved
src/auth/tenant.ts Outdated Show resolved Hide resolved
src/auth/tenant.ts Show resolved Hide resolved
src/auth/tenant.ts Outdated Show resolved Hide resolved
Xiaoshouzi-gh and others added 5 commits March 7, 2022 13:15
Co-authored-by: Lahiru Maramba <llahiru@gmail.com>
Co-authored-by: Lahiru Maramba <llahiru@gmail.com>
Co-authored-by: Lahiru Maramba <llahiru@gmail.com>
Co-authored-by: Lahiru Maramba <llahiru@gmail.com>
@Xiaoshouzi-gh Xiaoshouzi-gh merged commit 0d1a56f into recaptcha Mar 7, 2022
@Xiaoshouzi-gh Xiaoshouzi-gh deleted the recaptcha-tenant branch March 7, 2022 22:00
Xiaoshouzi-gh added a commit that referenced this pull request Mar 2, 2023
* Support reCaptcha config /create update on tenants.
 - Support create and update tenants with reCaptcha config.
 - Added reCaptcha unit tests on tenants operations.
Xiaoshouzi-gh added a commit that referenced this pull request Mar 30, 2023
* Support reCaptcha config /create update on tenants.
 - Support create and update tenants with reCaptcha config.
 - Added reCaptcha unit tests on tenants operations.
Xiaoshouzi-gh added a commit that referenced this pull request Apr 11, 2023
* Support reCaptcha config /create update on tenants.
 - Support create and update tenants with reCaptcha config.
 - Added reCaptcha unit tests on tenants operations.
Xiaoshouzi-gh added a commit that referenced this pull request Apr 12, 2023
* Support reCaptcha config /create update on tenants.
 - Support create and update tenants with reCaptcha config.
 - Added reCaptcha unit tests on tenants operations.
Xiaoshouzi-gh added a commit that referenced this pull request Apr 12, 2023
reCAPTCHA support

* Defined reCAPTCHA config. (#1574)
 - Added reCAPTCHA protection states.
 - Added reCAPTCHA action rule.
 - Added reCAPTCHA key config.

* Create/Update tenant with ReCAPTCHA Config (#1586)

* Support reCaptcha config /create update on tenants.
 - Support create and update tenants with reCaptcha config.
 - Added reCaptcha unit tests on tenants operations.

* Project config - Recaptcha config (#1595)

* Recaptcha config changes in project config.
- Implemented getProjectConfig.
- Implemented updateProjectConfig.
- Updated error code.
- Add Term of Service consents.

* Recapcha integ test (#1599)

* Added integ test for Project Config and Tenants update on reCAPTCHA config

* Account defender support for reCAPTCHA (#1616)

* Support use_account_defender add-on feature for reCAPTCHA config.
* Added integration test for account defender feature.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants