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

adding warning if pat detects in git url while creation of job #40337

Merged
merged 3 commits into from
Apr 3, 2025

Conversation

jayesh-tanna
Copy link
Member

@jayesh-tanna jayesh-tanna commented Apr 2, 2025

Description

Please add an informative description that covers that changes made by the pull request and link all relevant issues.

If an SDK is being regenerated based on a new swagger spec, a link to the pull request containing these swagger spec changes has been included above.

All SDK Contribution checklist:

  • The pull request does not introduce [breaking changes]
  • CHANGELOG is updated for new features, bug fixes or other significant changes.
  • I have read the contribution guidelines.

General Guidelines and Best Practices

  • Title of the pull request is clear and informative.
  • There are a small number of commits, each of which have an informative message. This means that previously merged commits do not appear in the history of the PR. For more information on cleaning up the commits in your PR, see this page.

Testing Guidelines

  • Pull request includes test coverage for the included changes.

@Copilot Copilot bot review requested due to automatic review settings April 2, 2025 11:56
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This pull request introduces functionality to detect a PAT token in Git repository URLs during job creation and removes sensitive Git-related properties if a PAT token is detected.

  • Added a helper function (has_pat_token) to detect PAT tokens in Git URLs.
  • Updated job operations to remove Git properties when a PAT token is present.
  • Added corresponding unit tests and updated the changelog to reflect these changes.

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.

File Description
tests/job_common/unittests/test_job_ops_helper.py Added unit tests for the new has_pat_token function.
azure/ai/ml/operations/_job_ops_helper.py Added the has_pat_token helper function to detect PAT tokens in URLs.
azure/ai/ml/operations/_job_operations.py Integrated has_pat_token to remove Git properties if a PAT token is detected.
CHANGELOG.md Documented the removal of Git-related properties for PAT-containing URLs.

@azure-sdk
Copy link
Collaborator

API change check

APIView has identified API level changes in this PR and created following API reviews.

azure-ai-ml

@jayesh-tanna jayesh-tanna merged commit 87b4e46 into Azure:main Apr 3, 2025
21 checks passed
@pdhotems pdhotems self-requested a review April 3, 2025 06:40
nik1097 pushed a commit to nik1097/azure-sdk-for-python that referenced this pull request Apr 5, 2025
…#40337)

* adding warning if pat detects in git url while creation of job

* adding test cases

* applying black formatter
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.

5 participants