Showing posts with label Open Source. Show all posts
Showing posts with label Open Source. Show all posts

Friday, December 14, 2007

v.03 The Good, The Bad, And The Ugly

The Good... v.03 is complete.
The Bad... I have to give back the school laptop.
The Ugly... My code.

Contribs:
Helped out Shomar Dejonge with his Litmus project. Gave him some code to login to litmus via JS.
Assisted Simon Jung on his project by running his server code on my home box.

l8r.

(Expect a more detailed post in the following week.)

Sunday, November 18, 2007

XPCOM Lab

I just stepped through the XPCOM Lab ever so carefully but still ended up with a broken XPCOM component.

My FirstXpcom.cpp file is a verbatim the one from the wiki (cut n paste action) however it still bunks out at line 26 (in the constructor) with the following error:
/home/cozby/MozillaBuild/mozilla/extensions/firstxpcom/src/FirstXpcom.cpp: In constructor ‘FirstXpcom::FirstXpcom()’:
/home/cozby/MozillaBuild/mozilla/extensions/firstxpcom/src/FirstXpcom.cpp:26: error: no matching function for call to ‘nsString_external::Assign(const char [21])’
../../../dist/include/xpcom/nsStringAPI.h:124: note: candidates are: void nsAString::Assign(const nsAString&)
../../../dist/include/xpcom/nsStringAPI.h:128: note: void nsAString::Assign(const PRUnichar*, PRUint32)
../../../dist/include/xpcom/nsStringAPI.h:132: note: void nsAString::Assign(PRUnichar)
make[2]: *** [FirstXpcom.o] Error 1
make[2]: Leaving directory `/home/cozby/MozillaBuild/build/extensions/firstxpcom/src'
make[1]: *** [libs] Error 2
make[1]: Leaving directory `/home/cozby/MozillaBuild/build/extensions/firstxpcom'
make: *** [default] Error 2

OK I lied, its slightly different from the wiki, the one on the wiki has a stray 'L' character in the constructor, so I removed that (I did try it with and without the mysterious 'L' though). The busted goods ---> http://pastebin.mozilla.org/244779

Ideas, suggestions, donations?

*UPDATE*
Thanks Dave making it 'AssignLiteral' did the trick.
I screen you screen we all screen for...

Tuesday, November 06, 2007

Shoot First Ask Questions Later v0.2

Good news, I've been able to login to my OP via JS and establish a session. So now when you login to your favourite OpenID supported site and are redirected for authentication you no longer have to login to your OP because a session was previously established.

Nothing incredibly ground breaking but definitely a big step in the right direction. From this I can now try and capture the redirect and prompt a user from chrome which information they're willing to part with (IE. Email, First/Last name, Address, etc)...

This is currently handled via your OP's website, as shown below.Next I'm going to be making some UI additions to the preferences window to allow for some OpenID settings. Things like your OpenID and the URL along with your username/password to your OpenID provider.

Right now my code only supports one OP (http://www.myopenid.com).

Word.

Saturday, October 27, 2007

FSAUCE Round Up

If there was a theme to this years FSOSS I would have to say it was community. All the talks I
attended emphasized how important this element is in creating and sustaining good software.

The first talk I attended was with Jay Goldman and David Crow on Usability and User Experience. I really dug this talk. I've always felt that the UX element in software development is often overlooked in the development process. However I think this is changing, developers and companies are realizing the importance of good functional design and what it could do for them. Their slides on the evolution of the Word toolbar were great, its really no surprise that half the features requested by users already existed for more than one version. Jay and David also touched on the importance of community. Getting feedback from users and involving them in the design process (to a degree) and what great effects this has.

This was the main theme in Beltzner's talk (Product and User Design in Open Communities). Another great talk on design and the involvement of community. I'm not sure if I got this right but I reckon Beltzner said something along the lines of 'its not consistent design thats important but a consistent user experience' and that kicked around in my head for awhile.
I also found it interesting when he spoke on community compromise and how so many projects drive themselves into the ground by not saying 'no'. The options always there, you don't always have to do what the community wants and that most of these battles are a result of people becoming emotionally invested in their ideas.

The next talk I hit was the Facebook talk. Now I was really keen on hearing what these chaps had to say about building on FB and using it as platform, etc. Unfortunately thats not what we got. Instead we got a pseudo technical talk on scaling 1000's of servers using their Thrift framework. This stuffs interesting but not really applicable to me. I'm not even on one server let alone a thousand servers. I did come out appreciating the FB family a little more though, finding out that a lot of their stuff is under the BSD license and how 'open' conscious they were was a nice surprise (I always thought they were evil - still kinda do).

Overall I had a great time, kudos to Dave, Chris, Cathy, and all the Hulka Maniacs involved in executing such a massive gig so smoothly.

Monday, October 22, 2007

What a mess...

OpenID is a mess! Half of the supposed OpenID supported sites are busted. I've been going to OiD sites and monitoring the Request/Response conversation and I can barely get into half of the sites I've tried, or when I do get authenticated they make me register an account with them and associate my OiD with the account!?# WTF! What's the point of this thing? It so far has done nothing helpful, if anything it has lengthened the login process. I've only got into one site smoothly (toodledo.com) and that was only with my myopenid.com account and not my Sxipper account?

I wrote a little httpObserver to monitor what kind of info is being passed to and from my OP and the site I'm trying to login to. Every thing works accept for obtaining the responseStatus. I have no clue why, its getting me twisted. I need this info to look out for authentication responses. Below is some traffic dump (for the curious).

Topic:http-on-modify-requestURI:https://www.mixx.com/login Req.Method:POST
Status Code:0
Topic:http-on-modify-requestURI:http://www.myopenid.com/server?openid.mode=checkid_setup&openid.return_to=https%3A%2F%2Fwww.mixx.com%2Fopenid_login%3Fopen_id_complete%3D1%26nonce%3Dv3igUyzl%26nonce%3Dv3igUyzl&openid.trust_root=https%3A%2F%2Fwww.mixx.com%2F&openid.identity=http%3A%2F%2Fwugunz.myopenid.com%2F&openid.assoc_handle=%7BHMAC-SHA1%7D%7B470bb41e%7D%7Bmp0eyQ%3D%3D%7D Req.Method:GET
Status Code:0
Topic:http-on-modify-requestURI:https://www.myopenid.com/trust?request_id=0ab21b60 Req.Method:GET
Status Code:0
Topic:http-on-modify-requestURI:https://www.myopenid.com/trust_submit Req.Method:POST
Status Code:0
Topic:http-on-modify-requestURI:https://www.mixx.com/openid_login?open_id_complete=1&nonce=v3igUyzl&nonce=v3igUyzl&openid.assoc_handle=%7BHMAC-SHA1%7D%7B470bb41e%7D%7Bmp0eyQ%3D%3D%7D&openid.identity=http%3A%2F%2Fwugunz.myopenid.com%2F&openid.mode=id_res&openid.op_endpoint=http%3A%2F%2Fwww.myopenid.com%2Fserver&openid.response_nonce=2007-10-23T00%3A01%3A53ZvtuXjA&openid.return_to=https%3A%2F%2Fwww.mixx.com%2Fopenid_login%3Fopen_id_complete%3D1%26nonce%3Dv3igUyzl%26nonce%3Dv3igUyzl&openid.sig=4i3IeUkNkcyaw9VweBkgCV8He%2Bk%3D&openid.signed=assoc_handle%2Cidentity%2Cmode%2Cop_endpoint%2Cresponse_nonce%2Creturn_to%2Csigned Req.Method:GET
Status Code:0


Back to work, more constructive posts will follow... I hope. I needed to vent.

Wednesday, October 10, 2007

OpenID[ea]


Change of plans.
My previous idea of capturing OpenID request by making the browser an OP is out of the question. Its just not possible, the protocol doesn't allow for it (what if you're behind a router?)

Right.

So now the deal is I'm going to make an extension that acts as an OP manager and a liaison between the user and their OPs. Getting around the current authentication paradigm OpenID poses - authentication via redirection. My efforts are to push the authentication process client side. I also have to keep this as light weight and seemless as possible, as to not suggest to users that this is an external extension (even though it is) but instead give the illusion that its native to the browsers functionality.

You might be thinking well this is already done. Well yes and no, Sxipper does a good job of this but it also does 23809849209832 other things and is UI intensive (you should try it out its pretty nifty) and Beltzner pointed me to an extension called Appalachian that handles OP managing but still suffers from the authentication via redirection issue. That leaves some middle ground for this extension. I'll be posting whatever developments I make. At the moment I'm combing through Sxipper and Appalachian code to get and idea of how things are done.

Over'n out.

Monday, October 01, 2007

Project Goods

Alright so I've been chipping away at this OpenID thing and I think I know how all this voodoo works.

I could give you the lengthy detailed version of how OpenID works but I'm hungry, so this will be brief like underwear.

A user goes to ilovelemurs.com and is asked to sign in with their OpenID, which is a URI that resembles something like example.com. example.com is any site that acts as an Identity Provider(it doesn't have to be, but I'm not getting into that). ilovelemurs.com then verifies that the user does indeed belong to/owns example.com and lets you in. I will post a purrrty diagram and a more detailed version of how this works later.

What I have to do is make Firefox act/function like example.com (to my knowledge).
I have to somehow make the browser handle the authentication request from consumer sites (sites that support OpenID) and chop out that middle man.


This will be tricky, as I have to somehow make the browser handle GET/POST request like a web server. In-fact the only way I know how to achieve this, is to actually embed a web server into my extension (I'm not even sure if thats possible for security reason).
I'm eyeing this sweet little 4k java web server I found here for the job. If I can get this thing going and implement single user OpenID support on top of it, then I'm rollin'. If for reasons I can't go this route, well then I'm not sure how I can do this? Suggestions?

Wednesday, September 19, 2007

Patching And Building Extensions

This is a quick lil' run through on how to apply a patch and build an extension.

Applying a pizzzatch
Pre-condition: Before starting this I'm assuming you have already checked out the code from cvs.

1) Download the patch, this may seem straight forward but I actually tripped on this. The patches
I were applying are https://bugzilla.mozilla.org/show_bug.cgi?id=393881, you must open each attachment in the
browser and then go to file->save as and that will save it as a .patch. Not knowing how any of this
works thought the attachment was going to be a straight forward .cpp file. So when confronted with a bunch of C++ code and then some, I got twisted.

2) Go into the path that contains the file you're about to patch and run the following command
patch -p0 -i /the/path/to/your/patch'/you/just/downloaded/
Doing so will patch the appropriate files. I got the following output when I did the above.

cozbymac:~/Documents/development/MozillaBuildStuff/mozilla/extensions/metrics cozby$ patch -p0 -i ~/Documents/development/MozillaBuildStuff/patches/metrics-places-update-01.patch
patching file src/nsProfileCollector.cpp
cozbymac:~/Documents/development/MozillaBuildStuff/mozilla/extensions/metrics cozby$ patch -p0 -i ~/Documents/development/MozillaBuildStuff/patches/metrics-places-update-02.patch
patching file install.rdf
patching file src/nsProfileCollector.cpp
Hunk #6 succeeded at 779 (offset -5 lines).
patching file src/nsProfileCollector.h
patching file src/nsUICommandCollector.cpp

3) Super, now thats all patched up I need to make sure the extension I want gets built. So I needed to add the following line to my .mozconfig file
ac_add_options --enable-extensions=metrics
in my case I'm building the metrics extension, if you want to build something replace metrics with the name of the extension.

4) Build. make -f client.mk build
5) Wait...
6) It worked!

UPDATE:
Thanks to Dave, I now know a much much easier way to build extensions. Instead of building World every time, you can just go into your objdir/extension/some_extension/ and type 'make'.
Thats it... it'll build just the extension and place the .xpi accordingly. EPIC.

Tuesday, September 18, 2007

Minefield == Gran Paradiso - wha?


The name of the game - building Firefox on Mac OS X 10.4.
First up, making sure my build environment is accordance with
http://developer.mozilla.org/en/docs/Mac_OS_X_Build_Prerequisites#Software_Requirements
Was already rolling with Fink so I decided to go down that route, only to be stumped with the following error:

checking for libIDL - version >= 0.6.3... no
*** The libIDL-config script installed by libIDL could not be found
*** If libIDL was installed in PREFIX, make sure PREFIX/bin is in
*** your path, or set the LIBIDL_CONFIG environment variable to the
*** full path to libIDL-config.
checking for pkg-config... no
*** The pkg-config script could not be found. Make sure it is
*** in your path, or set the PKG_CONFIG environment variable
*** to the full path to pkg-config.
*** Or see http://www.freedesktop.org/software/pkgconfig to get pkg-config.
configure: error: Library requirements (libIDL-2.0 >= 0.8.0) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them.
*** Fix above errors and then restart with "make -f client.mk build"
make[2]: *** [configure] Error 1
make[1]: *** [/Users/cozby/Documents/development/MozillaBuildStuff/mozilla/../build/ppc/Makefile] Error 2
make: *** [build] Error 2


After mucking around with environment variables and still no cigar outcomes, I decided to ask Ben for some advice. He told me to ditch Fink and get with MacPorts (all the cool kids were using it). I did just that and my build proceeded smoothly. However there was some confusion as to what Firefox 3 aka Gran Paradiso was and what Minefield was. I thought I'd have some Gran Paradiso branded browser but instead got Minefield. The skinny is since Firefox 3 is based off the current trunk aka Minefield, it is in fact Firefox 3 sans the Gran Paradiso branding. Long story short - all is good.

Apologies to all the action fiends, no real epic build battles took place, everything was pretty vanilla (ice).