diff options
author | Lilli <lilli@janrain.com> | 2010-02-10 11:32:49 -0800 |
---|---|---|
committer | Lilli <lilli@janrain.com> | 2010-02-10 11:32:49 -0800 |
commit | 4bda4445ee8c3167cd64089eefeadac32019f607 (patch) | |
tree | bf60f993c8cd7a54404938fb566f2dfc7a6ba38b /examples/detect.php | |
parent | 7bc8f2a17c7ca36f0e4238d9b3c97c6006ee3092 (diff) | |
download | php-openid-4bda4445ee8c3167cd64089eefeadac32019f607.zip php-openid-4bda4445ee8c3167cd64089eefeadac32019f607.tar.gz php-openid-4bda4445ee8c3167cd64089eefeadac32019f607.tar.bz2 |
Added the following patch from the dev@openidenabled.com mailing list:
http://lists.openidenabled.com/pipermail/dev/attachments/20080221/f087874e/attachment.obj
Original Messages:
Ryan Patterson cgamesplay at cgamesplay.com
Thu Feb 21 10:57:56 PST 2008
OpenIDStore for PEAR::MDB2
"On Thu, Feb 21, 2008 at 10:24 AM, Thomas Harning
<thomas.harning at trustbearer.com> wrote:
> Shortening the URLs to 255 chars has some ugly problems since the spec states
> that the max Server URL can technically be up to 2047 bytes (per OpenID 1.1-Appendix D)
Ah, I glanced at the spec but didn't see anything.
> One option for databases that can't have a key large enough is using a prefix-based key...
> I know MySQL supports this, but I'm not so sure on others.
This is what the current SQLStore implementation does. I've modified
the patch to add specific SQL for mysql backends, but use MDB2's
generic table creation for other stores. The test cases in the patch
pass for MDB2 using MySQL, but I'd like to verify that it works with
PostgreSQL.
--
Regards,
Ryan Patterson <mailto:cgamesplay at cgamesplay.com>"
Thomas Harning thomas.harning at trustbearer.com
Thu Feb 21 07:24:02 PST 2008
OpenIDStore for PEAR::MDB2
"Ryan Patterson wrote:
> I've created an Auth_OpenID_OpenIDStore implementation that utilizes
> PEAR::MDB2 instead of PEAR::DB, called Auth_OpenID_MDB2Store. The
> advantages to this store are that it supports all database back ends
> that PEAR::MDB2 supports, and does not require the user to know which
> database back end is being used when instantiating the store. Because
> of the complete database abstraction, the entire store is
> approximately 350 lines shorter than the SQLStore family.
>
> As a note to users planning to test this store: the table schema is
> incompatible with the other SQLStores. Specifically, the length of
> server URLs has been shortened to 255 characters to allow cross-RDBMS
> compatibility, and the field types have been changed to NOT NULL. You
> may safely delete your associations and nonces tables with no
> consequences.
Shortening the URLs to 255 chars has some ugly problems since the spec states
that the max Server URL can technically be up to 2047 bytes (per OpenID 1.1-Appendix D)
One option for databases that can't have a key large enough is using a prefix-based key...
I know MySQL supports this, but I'm not so sure on others.
Another option would be to use a unique value as the primary key and use some ugly
mechanics so that you can store a 20 byte sha1 in a non-unique index and the server URL
not in an index.
The basic select would be SELECT * FROM Sites WHERE URLHash = ? AND URL = ?;
The URLHash would narrow it down to likely one, where URL would clobber potential
collisions and keep the data around if needed...
--
Thomas Harning @ TrustBearer Labs (http://www.trustbearer.com)
Secure OpenID: https://openid.trustbearer.com/harningt
3201 Stellhorn Road 260-399-1656
Fort Wayne, IN 46815"
OpenIDStore for PEAR::MDB2
Ryan Patterson cgamesplay at cgamesplay.com
Thu Feb 21 07:19:02 PST 2008
"I've created an Auth_OpenID_OpenIDStore implementation that utilizes
PEAR::MDB2 instead of PEAR::DB, called Auth_OpenID_MDB2Store. The
advantages to this store are that it supports all database back ends
that PEAR::MDB2 supports, and does not require the user to know which
database back end is being used when instantiating the store. Because
of the complete database abstraction, the entire store is
approximately 350 lines shorter than the SQLStore family.
As a note to users planning to test this store: the table schema is
incompatible with the other SQLStores. Specifically, the length of
server URLs has been shortened to 255 characters to allow cross-RDBMS
compatibility, and the field types have been changed to NOT NULL. You
may safely delete your associations and nonces tables with no
consequences.
A test case has been added that tests the MDB2 store with a MySQL
backend. I would appreciate it if someone capable could modify the
test case and test it using PostgreSQL, to ensure that the database
abstraction I've used is correct.
--
Regards,
Ryan Patterson <mailto:cgamesplay at cgamesplay.com>"
All of the patch's hunks were applied successfully.
Diffstat (limited to 'examples/detect.php')
0 files changed, 0 insertions, 0 deletions