[Cherokee] Handler and Validation
Stefan de Konink
skinkie at xs4all.nl
Thu Jun 5 17:30:58 CEST 2008
Alvaro Lopez Ortega schreef:
> On 5 Jun 2008, at 16:55, Stefan de Konink wrote:
>
>> I would like to get access of the validation information inside a
>> handler. I guess for this to work I should initialize the validator
>> functions.
>>
>> The actual authentication is not (yet) important, I just want to get
>> access to the username and provided password.
>
> The authentication information will be in the connection structure:
> cherokee_connection_t. You can access it by using HANDLER_CONN(handler).
printf("\nuser: %s\n", conn->realm_ref);
returns: (null)
if (conn->validator != NULL) {
printf("\nuser: %s\n", conn->validator->user);
}
I guess I need to do something with the validator object?
I try to do the authentication with bla:bla at 127.0.0.1.
>> If this is only possible using a validator, would it be possible to set
>> this validation only on a POST/PUT request?
>
> I haven't done that before.. I would have to test it out. Anyway, why
> would you do that? Isn't it a little bit weird?
No not really, any user can get the documents, but updates to them are
for authenticated users only.
> You could perform the validation within the handler, that's for sure.
> Although, I still think that would be -at least- a very unusual thing to
> do.
That is a thing I agree on, but for now I cannot check if the get
request even has authentication because Cherokee doesn't give me any
data :\ I might do something wrong though.
Stefan
More information about the Cherokee
mailing list