[Freeipa-devel] [PATCHES] 0104-0106 Provide means of displaying warning and informational messages on clients

Martin Kosek mkosek at redhat.com
Thu Dec 13 15:43:32 UTC 2012


On 12/13/2012 10:59 AM, Petr Viktorin wrote:
> It's time to give this to another set of eyes :)
> 
> Design document: http://freeipa.org/page/V3/Messages
> Ticket: https://fedorahosted.org/freeipa/ticket/2732
> 
> More info is in commit messages.
> 
> 
> Because of https://fedorahosted.org/freeipa/ticket/3294, I needed to change the
> design document: when the client doesn't send the API version, it is assumed
> it's at a version before capabilities were introduced (i.e. 2.47).
> The client still gets a warning if the version is missing. Except for those
> commands where IPA didn't send a version -- ping, cert-show, etc. -- the
> warning wouldn't pass validation on old clients. (I'm assuming that our client
> is so far the only one that validates so strictly.)

I did a basic test of this patch and also quickly read through the patches and
besides nitpicks (like unused inspect module in
tests/test_ipalib/test_messages.py in patch 0105) I did not find any obvious
errors in the Python code.

However, this patch breaks WebUI badly, I did not even get to a log in screen.
Cooperation with Petr Vobornik will be needed. In my case, I got blank screen
and Javascript error:

TypeError: IPA.messages.dialogs is undefined
https://vm-037.idm.lab.bos.redhat.com/ipa/ui/ipa.js
Line 1460

I assume this is related to the Internal Error that was returned in the JSON call

{
    "error": null,
    "id": null,
    "principal": "admin at IDM.LAB.BOS.REDHAT.COM",
    "result": {
        "count": 5,
        "results": [
            {
                "error": "an internal error has occurred",
                "error_code": 903,
                "error_name": "InternalError"
            },
            {
...

This can be reproduced with:

# curl -v -H "Content-Type:application/json" -H
"referer:https://`hostname`/ipa" -H "Accept:applicaton/json" --negotiate -u :
--cacert /etc/ipa/ca.crt -d
'{"method":"i18n_messages","params":[[],{}],"id":0}' -X POST
https://`hostname`/ipa/json

I am also not sure I like the requirement of a specific version option to be
always passed. I would prefer that missing version option would mean "I use the
most recent version of API" instead - it would make the custom JSONRPC/XMLRPC
calls easier to use.

But since the version option was not being sent for some commands, we may not
have a choice anyway if we do not want to break old clients in case we add some
capabilities to these commands.

Martin




More information about the Freeipa-devel mailing list