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

Git DataSource requires authentication for HTTP #13358

Closed
alehaa opened this issue Aug 3, 2023 · 5 comments · Fixed by #13475
Closed

Git DataSource requires authentication for HTTP #13358

alehaa opened this issue Aug 3, 2023 · 5 comments · Fixed by #13475
Assignees
Labels
status: accepted This issue has been accepted for implementation type: bug A confirmed report of unexpected behavior in the application

Comments

@alehaa
Copy link
Contributor

alehaa commented Aug 3, 2023

NetBox version

v3.5.7

Python version

3.8

Steps to Reproduce

  1. Create public Git Repository at GitLab.com or choose an existing one
  2. Add git DataSource with HTTP / HTTPS URL
  3. Sync DataSource

Expected Behavior

Sync job finishes status 'Completed'.

Observed Behavior

Sync job finishes status 'Error'. Log states:

ERROR:root:Fetching remote data failed (HTTPUnauthorized): No valid credentials provided

@alehaa alehaa added the type: bug A confirmed report of unexpected behavior in the application label Aug 3, 2023
@alehaa
Copy link
Contributor Author

alehaa commented Aug 3, 2023

To resolve this issue, a simple check in data_backends.py is required, to only set username and password, if arguments passed are not empty. Tested this and seems to work. I can supply a patch / PR for this.

@abhi1693
Copy link
Member

abhi1693 commented Aug 3, 2023

Thank you for opening a bug report. I was unable to reproduce the reported behavior on NetBox v3.5.7. Please re-confirm the reported behavior on the current stable release and adjust your post above as necessary. Remember to provide detailed steps that someone else can follow using a clean installation of NetBox to reproduce the issue. Remember to include the steps taken to create any initial objects or other data.

@abhi1693 abhi1693 added the status: revisions needed This issue requires additional information to be actionable label Aug 3, 2023
@alehaa
Copy link
Contributor Author

alehaa commented Aug 3, 2023

Indeed I can't reproduce this with GitHub repositories. However, when using GitLab as source, jobs fail. I used v3.5.7 and a public GitLab repository for testing.

Seems like GitLab won't ignore empty HTTP Basic authentication.

@alehaa
Copy link
Contributor Author

alehaa commented Aug 15, 2023

@abhi1693 did you already have a chance to confirm this bug report? Would love to contribute a patch to only set authentication headers when user input is provided. If I understand contribution policy correctly, I'm not allowed to file a PR before this issue is assigned to me.

@abhi1693 abhi1693 added status: accepted This issue has been accepted for implementation and removed status: revisions needed This issue requires additional information to be actionable labels Aug 15, 2023
@abhi1693
Copy link
Member

@alehaa I was able to reproduce your issue. You can go ahead and submit a PR

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 14, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
status: accepted This issue has been accepted for implementation type: bug A confirmed report of unexpected behavior in the application
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants