Thursday, October 29, 2015

Is it a duck?

Last week, I was so happy. I had a working webclient for pwd! My integration test script allowed me to start a web server (using lighttpd).

Enters Travis CI. This useful tool reminded me that integration tests are not enough. I had broken my unit tests. Not good!

OK, let's fix that. I thought it would be fast. It was not (indeed, it is not over).

I needed to work quite a lot this week. Eiffel allows "expanded classes"; that is, value object classes. That is very useful but almost as easily testable as singletons.

I kept those classes… as simple façades. The release code automatically wires the façade with its underlying implementation. The test code, on the other hand, allows to set a test implementation; in other words, a mock.

Of course, faster said than done. There were two bugs in Liberty Eiffel; I had to fix them.

I also worked a lot on Liberty's mocker tool and library to give it new possibilities.

That done, I began by generating mocks and preparing my scenarii. I also split the tests for better legibility.

The work is still ongoing.

My last words are for Eiffel afficionados, based on my freshest experience.

I had lost the idea that Liberty Eiffel's insert keyword (equivalent to ECMA's ugly inherit {NONE}), brought a whole interface to the class. Not what I wanted.

So, my advice: you should not insert a class if you don’t want to expose its features in your interface. Use an attribute instead. Using export {} is an alternate solution, albeit not pretty because you'd need to also insert ANY to keep valid export clauses for standard features.

If it’s not a duck, it should not quack.

Happy hacking!

Thursday, October 22, 2015

Web access

At last the web client implementation of pwd works!

It means that very soon I will be able to query my passwords database using web access. (Of course, the zone is a private SSL zone with credentials access).

Next steps: a bit of HTML prettiness, and more features as announced previously.

Thursday, October 15, 2015

Moods and features

One month without posting.

One month during which I quit my previous job, moved near to Paris, and started something new.

One month during which I had to think a bit about my open-source future.

I played with the idea of stepping away from Eiffel. Well, I cannot. Eiffel, and particularly Liberty Eiffel, is in my blood.

On the other hand, I really need new features for pwd.

The feature #1 one being a secure web access, to avoid having to resort to ssh from the office, while still being able to get my passwords.

The infrastructure is already there. I have my own server, with an nginx server, and a pam-protected private area (URL not disclosed, obviously).

The feature #2 is the ability to add data to each key:
  • user name
  • url
  • tags
Compounded with this feature, I will need to change the internal format to something more flexible. Certainly JSON.

So that's my new aim. Enhancing pwd. And go on hacking, anyhow.

I guess I am back online.

Thursday, September 10, 2015

New home address

Cadrature du code is changing its home URL. It is still hosted by Blogger but it is now accessible using my own domain name.

So from now on, this blog should be accessed through http://cadrature.cadrian.net

Of cource, Blogger's address stays available.

Wednesday, September 9, 2015

Gate's channels

This blog entry is not really structured. I write it at the same time that I read and modify Gate's source to introduce the channels (see my previous entry).

While working on Gate's code, I found an interesting thing.
The whole client-server communication is centralized on the "server" side, which implements… The server itself, of course, but also a "proxy" that is able to talk with it.

Great! It means that extracting the communication protocol itself will only involve changes in the server package. No shotgun surgery in the whole project.

The currently implemented protocol is go's RPC client, which works via HTTP. Not a bad choice; but I really would like to propose at least one alternate implementation, using ZMQ.

So the first thing is: move the current implementation out of the server implementation (which should concentrate on just implementing server stuff, not protocol), and out of its proxy implementation.

Well… the role of the proxy is only to send things to the server; but I like the symmetry, similar to ISO's stack: one layer talks to its counterpart at the same level. Hence, the server talks with its proxy, and each one should contain a "channel" object; each channel object should be able to talk to another channel object.


Now committing, pushing, publishing… and going to bed :-)

Thursday, September 3, 2015

Reading Gate's code

I needed to read again Gate's code to see how much Pwd diverged from it. Remember: Gate was a Pwd port, written some time ago, but not really maintained; whereas Pwd continued to evolve.

The most striking differences are:
  • Pwd supports named pipes and low-level sockets as client-server channels. (There was also a ZMQ attempt, not finished.) On the other hand, Gate only supports RPC on HTTP. I need to extract the "channels" behaviour, maybe with another naming since "channel" is a native Go concept. Then, I may want to implement a ZMQ "channel".
  • Pwd started to support a web interface, never finished. Gate could use one, too — but only if I intend to finish it (i.e. not now).
Otherwise, the porting was quite fidel to the original. Maybe too much; the server start and synchronization method uses the same kind of algorithm: start the server process, and try to open a socket until it answers and abort if it takes too long. Not pretty! That's why I want to use ZMQ instead: it should better hide those gory details.

To be continued…

Cad reboot

Holidays are over.

Now is time to start again that blog in earnest.

I plan to post at least once a week. To do so, I need to tighten a bit the topic. This blog is about my pet projects; but I own quite a lot of those. I intend to focus on one project for the moment.

The chosen project is: Gate, a port of Pwd to golang.

A few reasons:
  • It is written in Go, and I need to update my skill in that language, because I am interested in knowing more than one OO language and culture.
  • Eiffel, and especially Liberty Eiffel, is as good as dead. I still dream of reviving it — although I love the language, I am afraid that won't happen; in the last few years, nobody has taken time to build the needed community (me included, mea maxima culpa).
  • I need a more solid design, and I intend to rewrite Gate with that aim in mind
  • I need to write blog posts and that is a good opportunity :-)

So, if you are interested in some language learning and some (useful) software building… Stay tuned.

Merry hacking!