requirement Pending

User tests: Successful: Unsuccessful:

avatar elkuku
elkuku
9 May 2013

User management

This will add the possibility to authenticate a user with his/her GitHub account using oAuth authentication.

Testing login

In order to test the login feature in your local environment you will need to create an application key and secret for your (local) JTrackerApplication instance:

  • Sail to your account on GitHub ⇒ "Edit your Profile".
  • Go to "Applications" - "Developer applications" and "Register new application"
  • Fill in some name and some main url. Those will be presented to the user when authorizing the application.
  • Fill in a domain for callback URL. This must match the domain the application is running. This may be http://localhost or a virtual host.
  • Hit "Save" and copy the client_id and client_secret.
  • Edit config.json and fill in the client_id and client_secret.
  • Install as usual.
  • Sail to your localhosts JTracker installation and click on "Login with GitHub"
  • On the first attempt you will be redirected to GitHub where you have to confirm the access by your application.

Session management

Is provided by the session subsystem from the Symfony2 HttpFoundation Component

Access control

The User class has a method authorize() that is meant to be used by some ACL system for authorizing a given "action" for the logged in user.
Currently there is a config setting called "acl.admin_users" that holds a comma separated list of usernames with "admin permissions" - as a first step.

Config editor

There is a "system component" that currently displays a config editor using simple text fields where you can fill in the values.
Saving is not provided yet. When hitting the save button the config is written to the screen where you might copy&paste it ;)
If you are on PHP < 5.4 there will be only a "compressed" version of the JSON string (a "pretty print" function could be written).
TBH - I only wrote this because it requires very little code and at some point we (or whoever uses a JSON based config file) might think about an UI for editing.

New "routes"

  • users - A users list
  • user - The currently logged in user (profile view)
  • user/123 - The user with id 123
  • config - Edit configuration.

This is still very rough and only provides the very basic functionality. There are also some commits that doesn't really belong here (Travis and Jenkins toying) so if we cherry pick or even just copy the relevant files - that would be OK.

avatar elkuku elkuku - open - 9 May 2013
avatar elkuku elkuku - open - 9 May 2013
avatar b2z
b2z - comment - 9 May 2013

Wow! Great job! Just one question - HTML dir should be in uppercase?

avatar AmyStephen
AmyStephen - comment - 9 May 2013

You're an animal, @elkuku -- impressive work, always.

avatar elkuku
elkuku - comment - 11 May 2013

Thanks for your kind words @AmyStephen and @b2z

  • HTML
    Well... I think we all know that it is "technically" correct as XML, CSS, PHP etc..
    It was first used in J!, then replaced by Html (I can't remember why) and lately impossible using an autoloader based on CamelCaps classes.
    So I thought it could be nice to try how it looks like now. I am not entirely sure about it and if anybody feels bad - let's change it ;)

Honestly - I only have a nerdy answer (like those guys from BBT would say): "Because we can" :smile:

avatar mbabker
mbabker - comment - 11 May 2013

This can't be merged anymore (probably because of the CLI merge).

I'd leave the Jenkins stuff out of this (I don't know if we'll hook into it or not), but the Travis stuff is fine. Fix that up and I say we just merge it and work out any other issues later on.

avatar elkuku
elkuku - comment - 12 May 2013

Should be good now ;)

avatar - close - 12 May 2013
avatar mbabker mbabker - reference | 27079b9 - 12 May 13
avatar mbabker mbabker - merge - 12 May 2013
avatar mbabker mbabker - close - 12 May 2013

Add a Comment

Login with GitHub to post a comment