Mailing List Archive

Re: svn commit: r1909409 - in /httpd/httpd/trunk: CHANGES docs/manual/developer/new_api_2_6.xml include/ap_mmn.h include/http_request.h include/mod_auth.h server/request.c
On 4/25/23 7:35 PM, minfrin@apache.org wrote:
> Author: minfrin
> Date: Tue Apr 25 17:35:08 2023
> New Revision: 1909409
>
> URL: http://svn.apache.org/viewvc?rev=1909409&view=rev
> Log:
> core: Add the token_checker hook, that allows authentication to take
> place using mechanisms other than username/password, such as bearer
> tokens.
>
> Modified:
> httpd/httpd/trunk/CHANGES
> httpd/httpd/trunk/docs/manual/developer/new_api_2_6.xml
> httpd/httpd/trunk/include/ap_mmn.h
> httpd/httpd/trunk/include/http_request.h
> httpd/httpd/trunk/include/mod_auth.h
> httpd/httpd/trunk/server/request.c
>

> URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/include/http_request.h?rev=1909409&r1=1909408&r2=1909409&view=diff
> ==============================================================================
> --- httpd/httpd/trunk/include/http_request.h (original)
> +++ httpd/httpd/trunk/include/http_request.h Tue Apr 25 17:35:08 2023

> @@ -516,6 +529,24 @@ AP_DECLARE(void) ap_hook_check_access_ex
> const char * const *aszSucc,
> int nOrder, int type);
>
> +/**
> + * Register a hook function that will analyze the request headers, extract
> + * any tokens, and apply and metadata contained in the tokens or keyed against
> + * the tokens to the request record.
> + * @param pf A token_checker hook function
> + * @param aszPre A NULL-terminated array of strings that name modules whose
> + * hooks should precede this one
> + * @param aszSucc A NULL-terminated array of strings that name modules whose
> + * hooks should succeed this one
> + * @param nOrder An integer determining order before honouring aszPre and
> + * aszSucc (for example, HOOK_MIDDLE)
> + * @param type Internal request processing mode, either
> + * AP_AUTH_INTERNAL_PER_URI or AP_AUTH_INTERNAL_PER_CONF
> + */> +AP_DECLARE(void) ap_hook_check_autht(ap_HOOK_check_user_id_t *pf,

Isn't the above a copy and past error and should be ap_HOOK_token_checker_t instead?

> + const char * const *aszPre,
> + const char * const *aszSucc,
> + int nOrder, int type);
>
> /**
> * Register a hook function that will analyze the request headers,
>

> Modified: httpd/httpd/trunk/server/request.c
> URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/server/request.c?rev=1909409&r1=1909408&r2=1909409&view=diff
> ==============================================================================
> --- httpd/httpd/trunk/server/request.c (original)
> +++ httpd/httpd/trunk/server/request.c Tue Apr 25 17:35:08 2023

> @@ -2217,6 +2234,18 @@ AP_DECLARE(void) ap_hook_check_access_ex
> ap_hook_access_checker_ex(pf, aszPre, aszSucc, nOrder);
> }
>
> +AP_DECLARE(void) ap_hook_check_autht(ap_HOOK_check_user_id_t *pf,

Isn't the above a copy and past error and should be ap_HOOK_token_checker_t instead?


> + const char * const *aszPre,
> + const char * const *aszSucc,
> + int nOrder, int type)
> +{
> + if ((type & AP_AUTH_INTERNAL_MASK) == AP_AUTH_INTERNAL_PER_CONF) {
> + ++auth_internal_per_conf_hooks;
> + }
> +
> + ap_hook_token_checker(pf, aszPre, aszSucc, nOrder);
> +}
> +
> AP_DECLARE(void) ap_hook_check_authn(ap_HOOK_check_user_id_t *pf,
> const char * const *aszPre,
> const char * const *aszSucc,
>
>
>

Regards

RĂ¼diger
Re: svn commit: r1909409 - in /httpd/httpd/trunk: CHANGES docs/manual/developer/new_api_2_6.xml include/ap_mmn.h include/http_request.h include/mod_auth.h server/request.c [ In reply to ]
On 5/5/23 12:28 PM, Ruediger Pluem wrote:
>
>
> On 4/25/23 7:35 PM, minfrin@apache.org wrote:
>> Author: minfrin
>> Date: Tue Apr 25 17:35:08 2023
>> New Revision: 1909409
>>
>> URL: http://svn.apache.org/viewvc?rev=1909409&view=rev
>> Log:
>> core: Add the token_checker hook, that allows authentication to take
>> place using mechanisms other than username/password, such as bearer
>> tokens.
>>
>> Modified:
>> httpd/httpd/trunk/CHANGES
>> httpd/httpd/trunk/docs/manual/developer/new_api_2_6.xml
>> httpd/httpd/trunk/include/ap_mmn.h
>> httpd/httpd/trunk/include/http_request.h
>> httpd/httpd/trunk/include/mod_auth.h
>> httpd/httpd/trunk/server/request.c
>>
>
>> URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/include/http_request.h?rev=1909409&r1=1909408&r2=1909409&view=diff
>> ==============================================================================
>> --- httpd/httpd/trunk/include/http_request.h (original)
>> +++ httpd/httpd/trunk/include/http_request.h Tue Apr 25 17:35:08 2023
>
>> @@ -516,6 +529,24 @@ AP_DECLARE(void) ap_hook_check_access_ex
>> const char * const *aszSucc,
>> int nOrder, int type);
>>
>> +/**
>> + * Register a hook function that will analyze the request headers, extract
>> + * any tokens, and apply and metadata contained in the tokens or keyed against
>> + * the tokens to the request record.
>> + * @param pf A token_checker hook function
>> + * @param aszPre A NULL-terminated array of strings that name modules whose
>> + * hooks should precede this one
>> + * @param aszSucc A NULL-terminated array of strings that name modules whose
>> + * hooks should succeed this one
>> + * @param nOrder An integer determining order before honouring aszPre and
>> + * aszSucc (for example, HOOK_MIDDLE)
>> + * @param type Internal request processing mode, either
>> + * AP_AUTH_INTERNAL_PER_URI or AP_AUTH_INTERNAL_PER_CONF
>> + */> +AP_DECLARE(void) ap_hook_check_autht(ap_HOOK_check_user_id_t *pf,
>
> Isn't the above a copy and past error and should be ap_HOOK_token_checker_t instead?
>
>> + const char * const *aszPre,
>> + const char * const *aszSucc,
>> + int nOrder, int type);
>>
>> /**
>> * Register a hook function that will analyze the request headers,
>>
>
>> Modified: httpd/httpd/trunk/server/request.c
>> URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/server/request.c?rev=1909409&r1=1909408&r2=1909409&view=diff
>> ==============================================================================
>> --- httpd/httpd/trunk/server/request.c (original)
>> +++ httpd/httpd/trunk/server/request.c Tue Apr 25 17:35:08 2023
>
>> @@ -2217,6 +2234,18 @@ AP_DECLARE(void) ap_hook_check_access_ex
>> ap_hook_access_checker_ex(pf, aszPre, aszSucc, nOrder);
>> }
>>
>> +AP_DECLARE(void) ap_hook_check_autht(ap_HOOK_check_user_id_t *pf,
>
> Isn't the above a copy and past error and should be ap_HOOK_token_checker_t instead?
>
>
>> + const char * const *aszPre,
>> + const char * const *aszSucc,
>> + int nOrder, int type)
>> +{
>> + if ((type & AP_AUTH_INTERNAL_MASK) == AP_AUTH_INTERNAL_PER_CONF) {
>> + ++auth_internal_per_conf_hooks;
>> + }
>> +
>> + ap_hook_token_checker(pf, aszPre, aszSucc, nOrder);
>> +}
>> +
>> AP_DECLARE(void) ap_hook_check_authn(ap_HOOK_check_user_id_t *pf,
>> const char * const *aszPre,
>> const char * const *aszSucc,
>>
>>
>>

Fixed in r1910324.

Regards

RĂ¼diger