Proposal for an API cahnge for 0.30.
Joe Orton
joe at manyfish.co.uk
Thu Nov 12 11:33:04 EST 2009
On Wed, Nov 11, 2009 at 09:44:11AM +0100, Kai Sommerfeld wrote:
> Hi all,
>
> I need access to the authentication protocol name in neon's
> authentication callback function.
>
> Therefeore, I'd like to propose the attached API change for neon 0.30.0.
>
> Any opinions? Especially, for realising this without an API change
> which would be the better approach, I guess...?
Yeah, I've wanted something like this a few times.
I think it'd be better to do it without breaking API. What I'd suggest
is an interface like:
enum ne_auth_mode {
NE_AMODE_SERVER = 0,
NE_AMODE_PROXY
};
typedef int (*ne_auth_any_creds)(void *userdata, const char *protoname,
unsigned protocol, enum ne_auth_mode mode,
const char *realm, int attempt,
char *username, char *password);
void ne_add_any_auth(ne_session *sess, unsigned protocol,
ne_auth_any_creds creds, void *userdata);
which otherwise works like ne_add_*_auth() but can be used for handling
both server and proxy auth credentials callbacks. The callback type
would work like the existing creds callback, except it also gets passed
the protocol name, code, and a proxy/server auth mode flag.
What do you reckon? Could also add a flags parameter to allow the
caller to select whether the callback should be used for server and/or
proxy auth as well.
Regards, Joe
More information about the neon
mailing list