Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Cherokee: users

Handler and Validation

 

 

Cherokee users RSS feed   Index | Next | Previous | View Threaded


skinkie at xs4all

Jun 5, 2008, 7:55 AM

Post #1 of 3 (294 views)
Permalink
Handler and Validation

Hi,


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.


If this is only possible using a validator, would it be possible to set
this validation only on a POST/PUT request?


Stefan
_______________________________________________
Cherokee mailing list
Cherokee[at]cherokee-project.com
http://cherokee-project.com/cgi-bin/mailman/listinfo/cherokee


alvaro at gnu

Jun 5, 2008, 8:19 AM

Post #2 of 3 (273 views)
Permalink
Re: Handler and Validation [In reply to]

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).

> 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?

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.

--
Greetings, alo.
http://www.alobbs.com/

_______________________________________________
Cherokee mailing list
Cherokee[at]cherokee-project.com
http://cherokee-project.com/cgi-bin/mailman/listinfo/cherokee


skinkie at xs4all

Jun 5, 2008, 8:30 AM

Post #3 of 3 (278 views)
Permalink
Re: Handler and Validation [In reply to]

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
_______________________________________________
Cherokee mailing list
Cherokee[at]cherokee-project.com
http://cherokee-project.com/cgi-bin/mailman/listinfo/cherokee

Cherokee users RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact lists@gossamer-threads.com
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.