Skip to content

Encode GitLab credentials in clone URLs#22173

Open
dfgvaetyj3456356-hash wants to merge 3 commits into
PrefectHQ:mainfrom
dfgvaetyj3456356-hash:security/encode-gitlab-credentials
Open

Encode GitLab credentials in clone URLs#22173
dfgvaetyj3456356-hash wants to merge 3 commits into
PrefectHQ:mainfrom
dfgvaetyj3456356-hash:security/encode-gitlab-credentials

Conversation

@dfgvaetyj3456356-hash

Copy link
Copy Markdown

Summary

  • URL-encode GitLab credential components before embedding them in HTTPS clone URLs
  • route GitLabRepository clone URL formatting through GitLabCredentials.format_git_credentials() so the repository block gets the same credential handling as the credential helper
  • add regression coverage for personal access tokens, deploy tokens, already-prefixed tokens, and repository clone command construction

Validation

python -m py_compile src\integrations\prefect-gitlab\prefect_gitlab\credentials.py src\integrations\prefect-gitlab\prefect_gitlab\repositories.py src\integrations\prefect-gitlab\tests\test_credentials.py src\integrations\prefect-gitlab\tests\test_repositories.py
git diff --check -- src/integrations/prefect-gitlab/prefect_gitlab/credentials.py src/integrations/prefect-gitlab/prefect_gitlab/repositories.py src/integrations/prefect-gitlab/tests/test_credentials.py src/integrations/prefect-gitlab/tests/test_repositories.py
PREFECT_TEST_MODE=1 python -m pytest src\integrations\prefect-gitlab\tests\test_credentials.py src\integrations\prefect-gitlab\tests\test_repositories.py -q

Result: 20 passed.

@github-actions

Copy link
Copy Markdown
Contributor

This pull request is stale because it has been open 14 days with no activity. To keep this pull request open remove stale label or comment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant