Closed deitch closed 1 year ago
Fixes #10
FYI, I tested it manually against a samba instance
Anything else needed for this, beyond fixing those tests? And any good suggestions how?
Hey @deitch. It's just been a very busy time at work. I'll be sure to review the PR this week.
OK, I restructured the server Authenticate()
, and it handles anonymous correctly now. I checked, it only is used as part of ntlm_test.go
, and that, in turn, is in internal/
, so we are covered from all possible use cases. We might want to think about making it public at some point, but that is beyond this PR.
Ready for your review.
This looks good @deitch. Just one minor nitpick to address, and then I'll bring it in.
I tested the anonymous authentication against a local Samba server and it worked perfectly. After we merge this in, I'd like to add a test for it to the GitHub workflow.
What nitpick is that? I didn't see any other comment 🤷♂️
Oops. I forgot to submit the review.
This PR adds support for anonymous auth, i.e. no provision of username and password. Of course, if the requested share does not allow it, it will return an auth error, which it should. If connecting to a share that allows anonymous access, it will work.
While doing so, I moved the Unmarshaling of the challenge message into its own function and struct. I needed it to make the
Authenticate()
function clearer to read, to figure out why something wasn't working. Once I figured it out, I left it there. If it bothers you, I can put it back to how it was before.I extended the test
TestClientServer()
inntlm_test.go
. However, it appears thats.Authenticate()
calls the server authentication directly, and our server does not know how to handle anonymous clients. So that is not a great test. I also am not sure how to update the server correctly to do this. Help would be appreciated.