gokrb5 icon indicating copy to clipboard operation
gokrb5 copied to clipboard

fix(gokrb5.config): do not panic on auth_to_local*

Open matchaxnb opened this issue 5 months ago • 0 comments

auth_to_local* directives are still not supported, but that's not a good reason to panic when we encounter them. Now we will just explicitly ignore them.

Also improve error reporting in general when we encounter incomplete parser situations. Now, if we are in an unhandled parser situation, we will return an explicit error instead of panicking on an IndexError.

Previous situation: passing an "auth_to_local" directive caused a Panic when doing v := strings.TrimSpace(p[1]) Now we are just explicitly saying we do not support that which is objectively better.

When we encounter an unsupported configuration directive and the parser reaches an incorrect state, we will report the error and output the config. There's a good chance that the latest configuration directive put is the unsupported one. This way, we can easily fix such mistakes when they come in issues.

matchaxnb avatar Sep 20 '24 11:09 matchaxnb