foxcpp / maddy

✉️ Composable all-in-one mail server.
https://maddy.email
GNU General Public License v3.0
5k stars 240 forks source link

internal/auth: Add native NetAuth authentication integration. #532

Closed the-maldridge closed 1 year ago

the-maldridge commented 2 years ago

NetAuth is an easy to deploy and manage organizational source of truth for identity and group management. This commit adds support for maddy to ask NetAuth about authentication using the native protocol.

There are problems that I haven't figured out yet, mostly that config parsing doesn't seem to actually work in my patch, but the auth works fine. NetAuth expects usernames to be *nix compatible so it pretends to accept emails and then strips the domain component off. This appeared to be the most straightforward way to make this integration work.

I think ultimately I'd like to hide this behind a build flag, but for now I'm opening this to get feedback for why the config parsing doesn't work.

codecov-commenter commented 2 years ago

Codecov Report

Merging #532 (86d3d89) into master (1463886) will decrease coverage by 0.28%. The diff coverage is 8.06%.

@@            Coverage Diff             @@
##           master     #532      +/-   ##
==========================================
- Coverage   52.89%   52.61%   -0.29%     
==========================================
  Files         126      127       +1     
  Lines       12931    12999      +68     
==========================================
- Hits         6840     6839       -1     
- Misses       5453     5520      +67     
- Partials      638      640       +2     
Flag Coverage Δ
integration 33.93% <8.06%> (-0.17%) :arrow_down:
unit 54.31% <ø> (-0.07%) :arrow_down:

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
maddy.go 46.32% <ø> (ø)
internal/auth/netauth/netauth.go 8.06% <8.06%> (ø)
internal/table/file.go 60.86% <0.00%> (-4.35%) :arrow_down:
internal/auth/ldap/ldap.go 2.46% <0.00%> (-0.08%) :arrow_down:

:mega: We’re building smart automated test selection to slash your CI/CD build times. Learn more

the-maldridge commented 1 year ago

@foxcpp anything else?

foxcpp commented 1 year ago

GitHub is a mess. Merged manually into dev as c102d62.

foxcpp commented 1 year ago

Thanks for your work!