Skip to content

Add auth_protocol support to SambaHook for Kerberos authentication #29590#64643

Open
haseebmalik18 wants to merge 8 commits into
apache:mainfrom
haseebmalik18:fix-samba-kerberos-auth
Open

Add auth_protocol support to SambaHook for Kerberos authentication #29590#64643
haseebmalik18 wants to merge 8 commits into
apache:mainfrom
haseebmalik18:fix-samba-kerberos-auth

Conversation

@haseebmalik18

Copy link
Copy Markdown
Contributor

Add auth_protocol parameter to SambaHook to support Kerberos, NTLM, and negotiate authentication. Previously the hook always used username/password auth, ignoring the {"auth": "kerberos"} connection extra, which caused SpnegoError failures for Kerberos-configured connections.

closes: #29590

Comment thread providers/samba/src/airflow/providers/samba/hooks/samba.py Outdated
@eladkal eladkal requested a review from dabla April 3, 2026 07:55
@haseebmalik18 haseebmalik18 force-pushed the fix-samba-kerberos-auth branch 5 times, most recently from ddc0ba7 to 39ab77c Compare April 6, 2026 22:57
@haseebmalik18 haseebmalik18 reopened this Apr 6, 2026
@kaxil kaxil requested a review from Copilot April 10, 2026 19:55

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

Adds configurable auth_protocol support to SambaHook to enable Kerberos / NTLM / negotiate auth selection and fixes prior behavior where Kerberos-configured connections were ignored.

Changes:

  • Introduces auth_protocol handling in SambaHook, including validation and an optional Kerberos dependency check.
  • Adds unit tests covering Kerberos (including legacy extra={"auth": "kerberos"}), NTLM, invalid protocol handling, and missing dependency behavior.
  • Exposes auth_protocol in the Airflow connection UI and adds a kerberos extra dependency group for the provider.

Reviewed changes

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

File Description
providers/samba/src/airflow/providers/samba/hooks/samba.py Implements auth_protocol parsing/validation, Kerberos dependency guard, passes protocol through to smbclient, and adds UI widget.
providers/samba/tests/unit/samba/hooks/test_samba.py Expands tests to cover new auth protocol behaviors and error cases.
providers/samba/pyproject.toml Adds kerberos optional dependency group intended to support Kerberos auth.

Comment thread providers/samba/src/airflow/providers/samba/hooks/samba.py Outdated
Comment thread providers/samba/pyproject.toml
Comment thread providers/samba/tests/unit/samba/hooks/test_samba.py
Comment thread providers/samba/src/airflow/providers/samba/hooks/samba.py
@haseebmalik18 haseebmalik18 force-pushed the fix-samba-kerberos-auth branch 2 times, most recently from 3fe70e0 to 43d0ca3 Compare April 11, 2026 20:48
@haseebmalik18 haseebmalik18 reopened this Apr 12, 2026
@haseebmalik18 haseebmalik18 requested a review from eladkal April 19, 2026 00:18
@potiuk potiuk marked this pull request as draft April 22, 2026 19:31
@potiuk potiuk closed this May 5, 2026
@potiuk potiuk reopened this Jun 25, 2026
@potiuk potiuk marked this pull request as ready for review June 25, 2026 08:44
@potiuk

potiuk commented Jun 25, 2026

Copy link
Copy Markdown
Member

Sorry - we missed that there is an open question to us - > and the triage process closed it. Can you re-open and ping me again if you are still not completely put-off by that @haseebmalik18 ?

@github-actions

github-actions Bot commented Jun 26, 2026

Copy link
Copy Markdown
Contributor

uv.lock on main just moved via #68780 ("Bump zeep from 4.3.2 to 4.3.3"), commit e6c1ae6 and this PR currently conflicts.

Quickest fix:

git fetch upstream main && git rebase upstream/main
rm uv.lock && uv lock
git add uv.lock && git rebase --continue
git push --force-with-lease

Automated nudge — ignore if you're not ready to rebase. This comment is updated in place on future uv.lock bumps.

@haseebmalik18 haseebmalik18 force-pushed the fix-samba-kerberos-auth branch from 25269bb to fd2ea1f Compare June 27, 2026 03:40
@haseebmalik18

Copy link
Copy Markdown
Contributor Author

@potiuk ready for review, failing tests unrelated to PR

Comment thread providers/samba/src/airflow/providers/samba/hooks/samba.py
@haseebmalik18 haseebmalik18 requested a review from dabla June 30, 2026 03:12
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.

Airflow SambaHook authentication issue with SpnegoError and Kerberos

5 participants