<feed xmlns='http://www.w3.org/2005/Atom'>
<title>freeipa.git/ipaserver/rpcserver.py, branch 4084</title>
<subtitle>Unnamed repository; edit this file 'description' to name the repository.</subtitle>
<link rel='alternate' type='text/html' href='https://fedorapeople.org/cgit/mkosek/public_git/freeipa.git/'/>
<entry>
<title>Convert remaining backend code to LDAPEntry API.</title>
<updated>2013-12-16T13:44:19+00:00</updated>
<author>
<name>Jan Cholasta</name>
<email>jcholast@redhat.com</email>
</author>
<published>2013-10-31T16:53:44+00:00</published>
<link rel='alternate' type='text/html' href='https://fedorapeople.org/cgit/mkosek/public_git/freeipa.git/commit/?id=bc3f3381c6bf0b4941889b775025a60f56318551'/>
<id>bc3f3381c6bf0b4941889b775025a60f56318551</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Add server/protocol type to rpcserver logs</title>
<updated>2013-11-26T15:59:59+00:00</updated>
<author>
<name>Petr Viktorin</name>
<email>pviktori@redhat.com</email>
</author>
<published>2013-04-17T10:19:15+00:00</published>
<link rel='alternate' type='text/html' href='https://fedorapeople.org/cgit/mkosek/public_git/freeipa.git/commit/?id=73b8047b2298d347475a5c8d9f1853052ddced57'/>
<id>73b8047b2298d347475a5c8d9f1853052ddced57</id>
<content type='text'>
Add the server class name, such as [xmlserver] or [jsonserver_kerb] to
the server logs. This will allow easier debugging of problems specific
to a protocol or server class.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Add the server class name, such as [xmlserver] or [jsonserver_kerb] to
the server logs. This will allow easier debugging of problems specific
to a protocol or server class.
</pre>
</div>
</content>
</entry>
<entry>
<title>Make jsonserver_kerb start a cookie-based session</title>
<updated>2013-11-26T15:59:59+00:00</updated>
<author>
<name>Petr Viktorin</name>
<email>pviktori@redhat.com</email>
</author>
<published>2013-04-15T14:41:25+00:00</published>
<link rel='alternate' type='text/html' href='https://fedorapeople.org/cgit/mkosek/public_git/freeipa.git/commit/?id=6839d8334ead3613068c5a031b32d7dd34219a9f'/>
<id>6839d8334ead3613068c5a031b32d7dd34219a9f</id>
<content type='text'>
Part of the work for: https://fedorahosted.org/freeipa/ticket/3299
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Part of the work for: https://fedorahosted.org/freeipa/ticket/3299
</pre>
</div>
</content>
</entry>
<entry>
<title>Switch client to JSON-RPC</title>
<updated>2013-11-26T15:59:59+00:00</updated>
<author>
<name>Petr Viktorin</name>
<email>pviktori@redhat.com</email>
</author>
<published>2012-12-19T09:25:24+00:00</published>
<link rel='alternate' type='text/html' href='https://fedorapeople.org/cgit/mkosek/public_git/freeipa.git/commit/?id=1e836d2d0c8916f5b8a352cc8395048f1147554d'/>
<id>1e836d2d0c8916f5b8a352cc8395048f1147554d</id>
<content type='text'>
Modify ipalib.rpc to support JSON-RPC in addition to XML-RPC.
This is done by subclassing and extending xmlrpclib, because
our existing code relies on xmlrpclib internals.

The URI to use is given in the new jsonrpc_uri env variable. When
it is not given, it is generated from xmlrpc_uri by replacing
/xml with /json.

The rpc_json_uri env variable existed before, but was unused,
undocumented and not set the install scripts.
This patch removes it in favor of jsonrpc_uri (for consistency
with xmlrpc_uri).

Add the rpc_protocol env variable to control the protocol
IPA uses. rpc_protocol defaults to 'jsonrpc', but may be changed
to 'xmlrpc'.
Make backend.Executioner and tests use the backend specified by
rpc_protocol.

For compatibility with unwrap_xml, decoding JSON now gives tuples
instead of lists.

Design: http://freeipa.org/page/V3/JSON-RPC
Ticket: https://fedorahosted.org/freeipa/ticket/3299
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Modify ipalib.rpc to support JSON-RPC in addition to XML-RPC.
This is done by subclassing and extending xmlrpclib, because
our existing code relies on xmlrpclib internals.

The URI to use is given in the new jsonrpc_uri env variable. When
it is not given, it is generated from xmlrpc_uri by replacing
/xml with /json.

The rpc_json_uri env variable existed before, but was unused,
undocumented and not set the install scripts.
This patch removes it in favor of jsonrpc_uri (for consistency
with xmlrpc_uri).

Add the rpc_protocol env variable to control the protocol
IPA uses. rpc_protocol defaults to 'jsonrpc', but may be changed
to 'xmlrpc'.
Make backend.Executioner and tests use the backend specified by
rpc_protocol.

For compatibility with unwrap_xml, decoding JSON now gives tuples
instead of lists.

Design: http://freeipa.org/page/V3/JSON-RPC
Ticket: https://fedorahosted.org/freeipa/ticket/3299
</pre>
</div>
</content>
</entry>
<entry>
<title>Show human-readable error name in error dialog title</title>
<updated>2013-08-26T11:05:36+00:00</updated>
<author>
<name>Petr Vobornik</name>
<email>pvoborni@redhat.com</email>
</author>
<published>2013-08-22T11:48:44+00:00</published>
<link rel='alternate' type='text/html' href='https://fedorapeople.org/cgit/mkosek/public_git/freeipa.git/commit/?id=34342b9a972a3a454b979dc64d0a510c5af24894'/>
<id>34342b9a972a3a454b979dc64d0a510c5af24894</id>
<content type='text'>
Fixes RPC server's JSON encoding of exception's name.

It allows to show the name in Web UI's error dialog title.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Fixes RPC server's JSON encoding of exception's name.

It allows to show the name in Web UI's error dialog title.
</pre>
</div>
</content>
</entry>
<entry>
<title>Return the correct Content-type on negotiated XML-RPC requests.</title>
<updated>2013-07-15T13:36:46+00:00</updated>
<author>
<name>Rob Crittenden</name>
<email>rcritten@redhat.com</email>
</author>
<published>2013-07-11T20:46:34+00:00</published>
<link rel='alternate' type='text/html' href='https://fedorapeople.org/cgit/mkosek/public_git/freeipa.git/commit/?id=689399fce930fb9d28ca81dfffbad411d12186e3'/>
<id>689399fce930fb9d28ca81dfffbad411d12186e3</id>
<content type='text'>
https://fedorahosted.org/freeipa/ticket/3745
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
https://fedorahosted.org/freeipa/ticket/3745
</pre>
</div>
</content>
</entry>
<entry>
<title>Add client capabilities, enable messages</title>
<updated>2013-02-21T15:26:09+00:00</updated>
<author>
<name>Petr Viktorin</name>
<email>pviktori@redhat.com</email>
</author>
<published>2012-12-07T15:54:07+00:00</published>
<link rel='alternate' type='text/html' href='https://fedorapeople.org/cgit/mkosek/public_git/freeipa.git/commit/?id=24bca144a8049cea8683afd699d2e0e158b5f164'/>
<id>24bca144a8049cea8683afd699d2e0e158b5f164</id>
<content type='text'>
The API version the client sends can now be used to check what the client
expects or is capable of.

All version tests IPA does will be be named and listed in one module,
ipalib.capabilities, which includes a function to test a specific capability
against an API version.
Similarly to Python's __future__ module, capabilities.py also serves as
documentation of backwards-incompatible changes to the API.

The first capability to be defined is "messages". Recent enough clients can
accept a list of warnings or other info under the "messages" key in the
result dict.

If a JSON client does not send the API version, it is assumed this is a testing
client (e.g. curl from the command line). Such a client "has" all capabilities,
but it will always receive a warning mentioning that forward compatibility
is not guaranteed.
If a XML client does not send the API version, it is assumed it uses the API
version before capabilities were introduced. (This is to keep backwards
compatibility with clients containing bug https://fedorahosted.org/freeipa/ticket/3294)

Whenever a capability is added, the API version must be incremented.
To ensure that, capabilities are written to API.txt and checked by
`makeapi --validate`.

Design page: http://freeipa.org/page/V3/Messages
Ticket: https://fedorahosted.org/freeipa/ticket/2732
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The API version the client sends can now be used to check what the client
expects or is capable of.

All version tests IPA does will be be named and listed in one module,
ipalib.capabilities, which includes a function to test a specific capability
against an API version.
Similarly to Python's __future__ module, capabilities.py also serves as
documentation of backwards-incompatible changes to the API.

The first capability to be defined is "messages". Recent enough clients can
accept a list of warnings or other info under the "messages" key in the
result dict.

If a JSON client does not send the API version, it is assumed this is a testing
client (e.g. curl from the command line). Such a client "has" all capabilities,
but it will always receive a warning mentioning that forward compatibility
is not guaranteed.
If a XML client does not send the API version, it is assumed it uses the API
version before capabilities were introduced. (This is to keep backwards
compatibility with clients containing bug https://fedorahosted.org/freeipa/ticket/3294)

Whenever a capability is added, the API version must be incremented.
To ensure that, capabilities are written to API.txt and checked by
`makeapi --validate`.

Design page: http://freeipa.org/page/V3/Messages
Ticket: https://fedorahosted.org/freeipa/ticket/2732
</pre>
</div>
</content>
</entry>
<entry>
<title>Drop ipapython.compat.</title>
<updated>2013-02-01T14:16:06+00:00</updated>
<author>
<name>Jan Cholasta</name>
<email>jcholast@redhat.com</email>
</author>
<published>2013-01-08T15:11:05+00:00</published>
<link rel='alternate' type='text/html' href='https://fedorapeople.org/cgit/mkosek/public_git/freeipa.git/commit/?id=c1735e1c80c9ec515f4a30cd212b7e331d7e2a83'/>
<id>c1735e1c80c9ec515f4a30cd212b7e331d7e2a83</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Compliant client side session cookie behavior</title>
<updated>2012-12-10T17:45:09+00:00</updated>
<author>
<name>John Dennis</name>
<email>jdennis@redhat.com</email>
</author>
<published>2012-12-04T23:20:17+00:00</published>
<link rel='alternate' type='text/html' href='https://fedorapeople.org/cgit/mkosek/public_git/freeipa.git/commit/?id=9269e5d6ddc85716d2b03c7763cf4b8e1ca67cad'/>
<id>9269e5d6ddc85716d2b03c7763cf4b8e1ca67cad</id>
<content type='text'>
In summary this patch does:

* Follow the defined rules for cookies when:

  - receiving a cookie (process the attributes)

  - storing a cookie (store cookie + attributes)

  - sending a cookie

    + validate the cookie domain against the request URL

    + validate the cookie path against the request URL

    + validate the cookie expiration

    + if valid then send only the cookie, no attribtues

* Modifies how a request URL is stored during a XMLRPC
  request/response sequence.

* Refactors a bit of the request/response logic to allow for making
  the decision whether to send a session cookie instead of full
  Kerberous auth easier.

* The server now includes expiration information in the session cookie
  it sends to the client. The server always had the information
  available to prevent using an expired session cookie. Now that
  expiration timestamp is returned to the client as well and now the
  client will not send an expired session cookie back to the server.

* Adds a new module and unit test for cookies (see below)

Formerly we were always returning the session cookie no matter what
the domain or path was in the URL. We were also sending the cookie
attributes which are for the client only (used to determine if to
return a cookie). The attributes are not meant to be sent to the
server and the previous behavior was a protocol violation. We also
were not checking the cookie expiration.

Cookie library issues:

We need a library to create, parse, manipulate and format cookies both
in a client context and a server context. Core Python has two cookie
libraries, Cookie.py and cookielib.py. Why did we add a new cookie
module instead of using either of these two core Python libaries?

Cookie.py is designed for server side generation but can be used to
parse cookies on the client. It's the library we were using in the
server. However when I tried to use it in the client I discovered it
has some serious bugs. There are 7 defined cookie elements, it fails
to correctly parse 3 of the 7 elements which makes it unusable because
we depend on those elements. Since Cookie.py was designed for server
side cookie processing it's not hard to understand how fails to
correctly parse a cookie because that's a client side need. (Cookie.py
also has an awkward baroque API and is missing some useful
functionality we would have to build on top of it).

cookielib.py is designed for client side. It's fully featured and obeys
all the RFC's. It would be great to use however it's tightly coupled
with another core library, urllib2.py. The http request and response
objects must be urllib2 objects. But we don't use urllib2, rather we use
httplib because xmlrpclib uses httplib. I don't see a reason why a
cookie library should be so tightly coupled to a protocol library, but
it is and that means we can't use it (I tried to just pick some isolated
entrypoints for our use but I kept hitting interaction/dependency problems).

I decided to solve the cookie library problems by writing a minimal
cookie library that does what we need and no more than that. It is a
new module in ipapython shared by both client and server and comes
with a new unit test. The module has plenty of documentation, no need
to repeat it here.

Request URL issues:

We also had problems in rpc.py whereby information from the request
which is needed when we process the response is not available. Most
important was the requesting URL. It turns out that the way the class
and object relationships are structured it's impossible to get this
information. Someone else must have run into the same issue because
there was a routine called reconstruct_url() which attempted to
recreate the request URL from other available
information. Unfortunately reconstruct_url() was not callable from
inside the response handler. So I decided to store the information in
the thread context and when the request is received extract it from
the thread context. It's perhaps not an ideal solution but we do
similar things elsewhere so at least it's consistent. I removed the
reconstruct_url() function because the exact information is now in the
context and trying to apply heuristics to recreate the url is probably
not robust.

Ticket https://fedorahosted.org/freeipa/ticket/3022
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
In summary this patch does:

* Follow the defined rules for cookies when:

  - receiving a cookie (process the attributes)

  - storing a cookie (store cookie + attributes)

  - sending a cookie

    + validate the cookie domain against the request URL

    + validate the cookie path against the request URL

    + validate the cookie expiration

    + if valid then send only the cookie, no attribtues

* Modifies how a request URL is stored during a XMLRPC
  request/response sequence.

* Refactors a bit of the request/response logic to allow for making
  the decision whether to send a session cookie instead of full
  Kerberous auth easier.

* The server now includes expiration information in the session cookie
  it sends to the client. The server always had the information
  available to prevent using an expired session cookie. Now that
  expiration timestamp is returned to the client as well and now the
  client will not send an expired session cookie back to the server.

* Adds a new module and unit test for cookies (see below)

Formerly we were always returning the session cookie no matter what
the domain or path was in the URL. We were also sending the cookie
attributes which are for the client only (used to determine if to
return a cookie). The attributes are not meant to be sent to the
server and the previous behavior was a protocol violation. We also
were not checking the cookie expiration.

Cookie library issues:

We need a library to create, parse, manipulate and format cookies both
in a client context and a server context. Core Python has two cookie
libraries, Cookie.py and cookielib.py. Why did we add a new cookie
module instead of using either of these two core Python libaries?

Cookie.py is designed for server side generation but can be used to
parse cookies on the client. It's the library we were using in the
server. However when I tried to use it in the client I discovered it
has some serious bugs. There are 7 defined cookie elements, it fails
to correctly parse 3 of the 7 elements which makes it unusable because
we depend on those elements. Since Cookie.py was designed for server
side cookie processing it's not hard to understand how fails to
correctly parse a cookie because that's a client side need. (Cookie.py
also has an awkward baroque API and is missing some useful
functionality we would have to build on top of it).

cookielib.py is designed for client side. It's fully featured and obeys
all the RFC's. It would be great to use however it's tightly coupled
with another core library, urllib2.py. The http request and response
objects must be urllib2 objects. But we don't use urllib2, rather we use
httplib because xmlrpclib uses httplib. I don't see a reason why a
cookie library should be so tightly coupled to a protocol library, but
it is and that means we can't use it (I tried to just pick some isolated
entrypoints for our use but I kept hitting interaction/dependency problems).

I decided to solve the cookie library problems by writing a minimal
cookie library that does what we need and no more than that. It is a
new module in ipapython shared by both client and server and comes
with a new unit test. The module has plenty of documentation, no need
to repeat it here.

Request URL issues:

We also had problems in rpc.py whereby information from the request
which is needed when we process the response is not available. Most
important was the requesting URL. It turns out that the way the class
and object relationships are structured it's impossible to get this
information. Someone else must have run into the same issue because
there was a routine called reconstruct_url() which attempted to
recreate the request URL from other available
information. Unfortunately reconstruct_url() was not callable from
inside the response handler. So I decided to store the information in
the thread context and when the request is received extract it from
the thread context. It's perhaps not an ideal solution but we do
similar things elsewhere so at least it's consistent. I removed the
reconstruct_url() function because the exact information is now in the
context and trying to apply heuristics to recreate the url is probably
not robust.

Ticket https://fedorahosted.org/freeipa/ticket/3022
</pre>
</div>
</content>
</entry>
<entry>
<title>Add detection for users from trusted/invalid realms</title>
<updated>2012-12-06T15:34:23+00:00</updated>
<author>
<name>Tomas Babej</name>
<email>tbabej@redhat.com</email>
</author>
<published>2012-11-15T10:21:16+00:00</published>
<link rel='alternate' type='text/html' href='https://fedorapeople.org/cgit/mkosek/public_git/freeipa.git/commit/?id=0292ebd1e5603a5daabf274b40fb4e10f096ea1c'/>
<id>0292ebd1e5603a5daabf274b40fb4e10f096ea1c</id>
<content type='text'>
When user from other realm than FreeIPA's tries to use Web UI
(login via forms-based auth or with valid trusted realm ticket),
the 401 Unauthorized error with X-Ipa-Rejection-Reason=denied
is returned.

Also, the support for usernames of the form user@SERVER.REALM
or user@server.realm was added.

https://fedorahosted.org/freeipa/ticket/3252
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
When user from other realm than FreeIPA's tries to use Web UI
(login via forms-based auth or with valid trusted realm ticket),
the 401 Unauthorized error with X-Ipa-Rejection-Reason=denied
is returned.

Also, the support for usernames of the form user@SERVER.REALM
or user@server.realm was added.

https://fedorahosted.org/freeipa/ticket/3252
</pre>
</div>
</content>
</entry>
</feed>
