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

🐛Fixes invalid invitation links #7057

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

pcrespov
Copy link
Member

@pcrespov pcrespov commented Jan 17, 2025

What do these changes do?

The issue arises in the latest Pydantic version, where HttpUrl automatically appends a trailing / to URLs that consist only of an origin (i.e., without a path).

Example:

>>> from pydantic import HttpUrl

>>> HttpUrl("http://origin")  # Without trailing `/`
HttpUrl('http://origin/')

>>> HttpUrl("http://origin/")  # With trailing `/`
HttpUrl('http://origin/')

However, when a path is included in the URL, Pydantic preserves the given format:

>>> HttpUrl("http://origin/path/")
HttpUrl('http://origin/path/')

>>> HttpUrl("http://origin/path")
HttpUrl('http://origin/path')

This behavior change affects cases where a strict distinction between "http://origin" and "http://origin/" is necessary.

Related issue/s

How to test

  • driving test
cd services/invitations
make install-dev
 make test-dev-unit
  • manual test @odeimaiz @YuryHrytsuk
    • login with a PO user
    • go to PO center and create an invitation link
    • make sure link generaged does not contain double // at the end.

Dev-ops

None

@pcrespov pcrespov added the a:invitations invitations service label Jan 17, 2025
@pcrespov pcrespov self-assigned this Jan 17, 2025
@pcrespov pcrespov added this to the Singularity milestone Jan 17, 2025
@pcrespov pcrespov enabled auto-merge (squash) January 17, 2025 18:12
Copy link
Member

@odeimaiz odeimaiz left a comment

Choose a reason for hiding this comment

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

thanks!

@pcrespov pcrespov force-pushed the is7055/fix-invitation-double-slash branch from 7ed892e to a6c800e Compare January 17, 2025 22:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
a:invitations invitations service
Projects
None yet
Development

Successfully merging this pull request may close these issues.

s4l-lite invitation links do not work
2 participants