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

The /account path for the account MFE conflicts with a URL #14

Closed
felipemontoya opened this issue Dec 9, 2024 · 4 comments
Closed

The /account path for the account MFE conflicts with a URL #14

felipemontoya opened this issue Dec 9, 2024 · 4 comments
Assignees

Comments

@felipemontoya
Copy link
Member

When configuring the accounts MFE in the /accounts path, we clash the following url config:

https://github.com/openedx/edx-platform/blob/master/openedx/core/djangoapps/user_authn/urls.py#L11

Basically /account/finish_auth is forwarded to react instead of the user_authn views.

Found this in the configuration of bluenose/mumbasa. Reported there as issue #73

@DonatoBD DonatoBD self-assigned this Dec 12, 2024
@DonatoBD
Copy link
Contributor

Refinement

  1. Verificar en la instancia demo de redwood (o en la de zach) el comportamiento de ese error reportado
  2. Crear un Pr agregando la ruta al patch del caddyfile en el plugin de mfe-extension
  3. Hacer bump version de mfe-extension
  4. Actualizar mfe-extension de los clientes que estan en redwood

Contexto extra: esto solo ocurre cuando hosteamos mfes por path, por eso anteriormente estos cambios solo se aplicaban con un tutor plugin dentro del manifiesto por la cantidad tan pequenia de instancias que teniamos con mfe activos. Ahora estos ajustes se agregan a nuestro plugin de mfe-extension para que cualquier persona pueda hostear mfe por path y no tenga dicho problema

@DonatoBD
Copy link
Contributor

Efectivamente, esto sigue pasando en redwood, aprovechando que estaba revisando este caso, corrí este script, en un pod de lms y en uno de cms, para verificar que otra url entra en conflicto con los MFEs por path

from django.urls import get_resolver

def find_urls_containing(urlpatterns, search_term, base_path=""):
    matching_urls = []
    for pattern in urlpatterns:
        full_path = base_path + str(pattern.pattern)
        if hasattr(pattern, "url_patterns"):  # If the pattern has nested URL patterns
            matching_urls.extend(
                find_urls_containing(pattern.url_patterns, search_term, full_path)
            )
        else:
            if full_path.startswith(search_term):
            # if search_term in full_path:
                matching_urls.append(full_path)
    return matching_urls

search_terms = [
    "account",
    "authn",
    "communications",
    "discussions",
    "gradebook",
    "learner-dashboard",
    "learning",
    "ora-grading",
    "profile",
    "course-authoring"
    ]  # List of substrings to check if the URL starts with

resolver = get_resolver()  # Get the root URL resolver

all_matching_urls = []
for search_term in search_terms:
    matching_urls = find_urls_containing(resolver.url_patterns, search_term)
    all_matching_urls.extend(matching_urls)

if all_matching_urls:
    print(f"URLs starting with any of {search_terms}:")
    for url in all_matching_urls:
        print(f" - {url}")
else:
    print(f"No URLs found starting with any of {search_terms}.")

Solo dieron conflicto estas urls, así que podríamos decir que no hace falta agregar más excepciones

  • account/settings
  • account/password
  • account/finish_auth

Este es el PR que agrega la ruta de /account/finish_auth, mañana actualizo a los clientes que tengan este problema (olive+)

@DonatoBD
Copy link
Contributor

Entornos actualizados:

  • bluenose/mombasa
  • caboffice/esbjerg
  • achille-lauro/accra
  • alfaro/guayaquil
  • oneida/bentos
  • albacore/seward

@felipemontoya
Copy link
Member Author

Thanks, I tested the fix in one of the links that where reported initially and it is working now.

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

No branches or pull requests

2 participants