Skip to content

Commit

Permalink
auth_db: exported www_authenticate_method() to kemi
Browse files Browse the repository at this point in the history
  • Loading branch information
miconda committed Apr 28, 2023
1 parent f16ba6d commit f27d15b
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/modules/auth_db/auth_db_mod.c
Expand Up @@ -452,6 +452,11 @@ static sr_kemi_t sr_kemi_auth_db_exports[] = {
{ SR_KEMIP_STR, SR_KEMIP_STR, SR_KEMIP_INT,
SR_KEMIP_NONE, SR_KEMIP_NONE, SR_KEMIP_NONE }
},
{ str_init("auth_db"), str_init("www_authenticate_method"),
SR_KEMIP_INT, ki_www_authenticate_method,
{ SR_KEMIP_STR, SR_KEMIP_STR, SR_KEMIP_STR,
SR_KEMIP_NONE, SR_KEMIP_NONE, SR_KEMIP_NONE }
},

{ {0, 0}, {0, 0}, 0, NULL, { 0, 0, 0, 0, 0, 0 } }
};
Expand Down
5 changes: 5 additions & 0 deletions src/modules/auth_db/authorize.c
Expand Up @@ -444,6 +444,11 @@ int www_authenticate2(struct sip_msg* _m, char* _realm, char* _table, char *_met
&smethod);
}

int ki_www_authenticate_method(sip_msg_t *msg, str *realm, str *table, str *method)
{
return digest_authenticate(msg, realm, table, HDR_AUTHORIZATION_T, method);
}

/**
*
*/
Expand Down
2 changes: 2 additions & 0 deletions src/modules/auth_db/authorize.h
Expand Up @@ -46,6 +46,8 @@ int proxy_authenticate(struct sip_msg* _msg, char* _realm, char* _table);
int www_authenticate(struct sip_msg* _msg, char* _realm, char* _table);
int www_authenticate2(struct sip_msg* _msg, char* _realm, char* _table, char *_method);

int ki_www_authenticate_method(sip_msg_t *msg, str *realm, str *table, str *method);

/*
* Authenticate using WWW/Proxy-Authorize header field
*/
Expand Down

0 comments on commit f27d15b

Please sign in to comment.