Posts

Showing posts from 2012

Maven buildtime and version creation

When you are building a brand new application, it is usually the time, to challenge the old principles and to conserve the good ones while replacing the rest.

My latest challenge was ... providing visible time of build and version of web application build with Maven. If you are now thinking "bah, that is just easy", you are right, because it is. But my path towards the solution presented in this post was not as easy and straightforward as I would have imagined, so I am presenting one hopefully simple instruction how to do it.

Ldap security for JAMWiki

My last post was dedicated to using LDAP as security back end for Jenkins-CI. Now I would like to present a process of enabling the same security for my favourite wiki implementation ... JAMWiki. This post refers to version 1.2.0. I believe that it is a shame, that this is not well documented. There is a commented-out section in config xml (WEB-INF/applicationContext-security.xml), but it does not work out of the box as I have hoped for and it's modification is not an easy task for someone not familiar with spring security. That is why I wrote this post.

What I wanted to achieve was to connect the JAMWiki's security (users and roles) to my LDAP, that was presented in my last post. As it is always easier to manage users on the same place. This process is described on JAMWiki's web, but it is certainly not in a copy-paste form and it took me quite some time to modify into working piece of code.

Ldap security for Jenkins CI

Image
I recently deployed Jenkins CI on my personal server. The hardest question was what security solution should I use. As title of this post may have suggested I have chosen to use the infrastructure I already have ... LDAP. Now I would like to describe, how easy this configuration is and how it works.

My LDAP structure My base dn is dc=effy,dc=cz. And it contains two organizationUnits ... ou=people (to hold users) and ou=groups (to hold user roles). Groups (Roles) are presented by objectClass groupOfNames, they are identified by cn. People (Users) are of objectClass inetOrgPerson, thus identified by uid.

Performance of the string switch statement

Image
One of the new Java 7 features is possibility to use String values in switch statements. Proper usage of this can be found for example in oracle tutorials.
But what i wanted to know is how fast is that. Is the new way faster, than a series of if-else statements, or is it slower?

Password hashing in Java

I was recently asked to provide db based user authentication for a relatively application, which user primarily ldap user authentication. This nearly backdoor-looking feature is only for a handful of users which made it ideal for experimentation. I could have stored user passwords as plain-text and nobody else would ever know, but the one person that would know matters the most, me.

Almost every application uses passwords for user autentization. Although in complex environment, you don't usually want users to have different password for every application, there are situations that needs different approach. And in those times, security shouldn't be taken lightly. Whether you are writing small intranet application, or full scale internet application, you should always protect your user's accounts, because a lot of studies suggest that majority of users use the same password for everything, so for these users, when one application falls, they all fall. That is the rea…