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

[SDP-1247] Prepare code for API-only usage by reorganizing the reCaptcha and MFA sections in the handlers they're being used #499

Merged
merged 10 commits into from
Jan 23, 2025

Conversation

marcelosalloum
Copy link
Collaborator

@marcelosalloum marcelosalloum commented Jan 7, 2025

What

Prepare code for API-only usage by reorganizing the reCaptcha and MFA sections in the handlers they're being used.

Why

Since the MFA and reCAPTCHA enforcers were being used in different places for different handlers, it wasn't easy to modularize their usage. By streamlining their usage, the code becomes easier to adapt and make it optional.

Further work

Add a way to bypass them through IP filering.

Checklist

PR Structure

  • This PR has a reasonably narrow scope (if not, break it down into smaller PRs).
  • This PR title and description are clear enough for anyone to review it.
  • This PR does not mix refactoring changes with feature changes (split into two PRs otherwise).

Thoroughness

  • This PR adds tests for the new functionality or fixes.
  • This PR contains the link to the Jira ticket it addresses.

Configs and Secrets

  • No new CONFIG variables are required -OR- the new required ones were added to the helmchart's values.yaml file.
  • No new CONFIG variables are required -OR- the new required ones were added to the deployments (pr-preview, dev, demo, prd).
  • No new SECRETS variables are required -OR- the new required ones were mentioned in the helmchart's values.yaml file.
  • No new SECRETS variables are required -OR- the new required ones were added to the deployments (pr-preview secrets, dev secrets, demo secrets, prd secrets).

Release

  • This is not a breaking change.
  • This is ready for production.. If your PR is not ready for production, please consider opening additional complementary PRs using this one as the base. Only merge this into develop or main after it's ready for production!

Deployment

  • Does the deployment work after merging?

@marcelosalloum marcelosalloum self-assigned this Jan 7, 2025
@marcelosalloum marcelosalloum temporarily deployed to Receiver Registration - E2E Integration Tests (Stellar) January 7, 2025 00:15 — with GitHub Actions Inactive
@marcelosalloum marcelosalloum temporarily deployed to Anchor Integration Tests January 7, 2025 00:15 — with GitHub Actions Inactive
@marcelosalloum marcelosalloum marked this pull request as draft January 7, 2025 01:06
@marcelosalloum marcelosalloum temporarily deployed to Receiver Registration - E2E Integration Tests (Stellar) January 13, 2025 19:04 — with GitHub Actions Inactive
@marcelosalloum marcelosalloum temporarily deployed to Anchor Integration Tests January 13, 2025 19:04 — with GitHub Actions Inactive
@marcelosalloum marcelosalloum temporarily deployed to Anchor Integration Tests January 13, 2025 20:17 — with GitHub Actions Inactive
@marcelosalloum marcelosalloum temporarily deployed to Receiver Registration - E2E Integration Tests (Stellar) January 13, 2025 20:17 — with GitHub Actions Inactive
@marcelosalloum marcelosalloum temporarily deployed to Receiver Registration - E2E Integration Tests (Stellar) January 13, 2025 20:51 — with GitHub Actions Inactive
@marcelosalloum marcelosalloum temporarily deployed to Anchor Integration Tests January 13, 2025 20:51 — with GitHub Actions Inactive
@marcelosalloum marcelosalloum temporarily deployed to Anchor Integration Tests January 13, 2025 21:28 — with GitHub Actions Inactive
@marcelosalloum marcelosalloum temporarily deployed to Receiver Registration - E2E Integration Tests (Stellar) January 13, 2025 21:28 — with GitHub Actions Inactive
@marcelosalloum marcelosalloum temporarily deployed to Anchor Integration Tests January 14, 2025 00:54 — with GitHub Actions Inactive
@marcelosalloum marcelosalloum temporarily deployed to Receiver Registration - E2E Integration Tests (Stellar) January 14, 2025 00:54 — with GitHub Actions Inactive
@marcelosalloum marcelosalloum temporarily deployed to Receiver Registration - E2E Integration Tests (Stellar) January 14, 2025 00:55 — with GitHub Actions Inactive
@marcelosalloum marcelosalloum temporarily deployed to Anchor Integration Tests January 14, 2025 00:55 — with GitHub Actions Inactive
@marcelosalloum marcelosalloum changed the title [SDP-1247] Allow API-only usage by allowing the reCAPTCHA and MFA to be bypassed based on the user role [SDP-1247] Prepare code for API-only usage by reorganizing the reCaptcha and MFA sections in the handlers they're being used Jan 14, 2025
@stellar-jenkins
Copy link

Something went wrong with PR preview build please check

@marcelosalloum marcelosalloum marked this pull request as ready for review January 21, 2025 21:06
@marcelosalloum marcelosalloum temporarily deployed to Anchor Integration Tests January 21, 2025 21:06 — with GitHub Actions Inactive
@marcelosalloum marcelosalloum temporarily deployed to Receiver Registration - E2E Integration Tests (Stellar) January 21, 2025 21:06 — with GitHub Actions Inactive
@marcelosalloum marcelosalloum temporarily deployed to Receiver Registration - E2E Integration Tests (Stellar) January 23, 2025 21:09 — with GitHub Actions Inactive
@marcelosalloum marcelosalloum temporarily deployed to Anchor Integration Tests January 23, 2025 21:09 — with GitHub Actions Inactive
Copy link
Collaborator

@marwen-abid marwen-abid left a comment

Choose a reason for hiding this comment

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

LGTM! Great refactor

internal/serve/httphandler/profile_handler.go Show resolved Hide resolved
@marcelosalloum marcelosalloum merged commit 958e873 into develop Jan 23, 2025
13 checks passed
@marcelosalloum marcelosalloum deleted the feat/SDP-1247-api-role branch January 23, 2025 23:16
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