You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
If you use origin like "https://user:token@mygitlab.com" (it is a common case in ci, f.e. gitlab), you will get the same links in your Changelog.
Expected behavior
Credentials should't appear in the Changelog
in my fork i made that fix
providers.py
class ProviderRefParser(ABC):
"""A base class for specific providers reference parsers."""
url: str
namespace: str
project: str
REF: ClassVar[dict[str, RefDef]] = {}
def __init__(self, namespace: str, project: str, url: str | None = None):
"""Initialization method.
Arguments:
namespace: The Bitbucket namespace.
project: The Bitbucket project.
url: The Bitbucket URL.
"""
self.namespace: str = namespace
self.project: str = project
- self.url: str = url or self.url+ self.url: str = self.clean_url(url or self.url)
...
+ @staticmethod+ def clean_url(url: str) -> str:+ """Clean the http URL from tokens.++ Arguments:+ url: The URL to clean.++ Returns:+ The cleaned URL.+ """+ if url.startswith(('http://', 'https://')):+ protocol, remaining = url.split("://", 1)+ parts = remaining.split("@")+ if len(parts) > 1:+ return f"{protocol}://{parts[-1]}"+ return url
The text was updated successfully, but these errors were encountered:
Hello, thanks for the report. That is similar to #50.
Instead of parsing GitHub tokens like we do now, which works for GitHub only, we could indeed simply parse the URL to remove the credentials part 👍 Fixed in v2.3.1!
Describe the bug
If you use origin like "https://user:token@mygitlab.com" (it is a common case in ci, f.e. gitlab), you will get the same links in your Changelog.
Expected behavior
Credentials should't appear in the Changelog
in my fork i made that fix
providers.py
The text was updated successfully, but these errors were encountered: