ServiceStack/ServiceStack — pull request #838 by shelakel (2013-10-06 18:21:02+00:00)
Title: Decoupled dependency on UserAuth/UserAuthProvider for simpler authentication/authorization implementations

Hi,

The reason for this pull request is due to the inflexibility in extending the current authentication/authorization implemention.

Some use cases addressed:
* Interfaces for UserAuth/UserAuthProvider allow for explicit implementations to hide non system essential members.
* OrmLiteAuthRepository can now load/persist additional 'row level' columns for querying purposes due to how OrmLite works which is ideal for simple extensions (such as adding login-attempt limiting, is active, additional fields for RegisterService) without requiring re-implementation of entire repositories/services.
* Previously it was necessary to reimplement the OrmLiteAuthRepository if you wanted to use it for non default tables (UserAuth, UserAuthProvider) - now with custom UserAuth/UserAuthProvider implementations with [Alias] it's not necessary anymore and any services/providers now dependent on the IAuthRepository will automatically load/persist to the new tables.

Overall the change impact is minimal (ex. no changes were necessary for the different AuthProvider implementations). In exchange the existing functionality has become much more flexible.

The only 'breaking change' is that the IUserAuthRepository had to be split up into a IAuthRepository (used by the providers, services, repositories etc.) and the IUserAuthRepository (used by OrmLiteAuthRepository, RedisAuthRepository, RegisterService).

This means that during configuration of the container, instead of:
container.Register(new OrmLiteAuthRepository());

It is now necessary to register both dependencies:
//OrmLiteAuthRepository uses default UserAuth/UserAuthProvider
container.Register(new OrmLiteAuthRepository());
container.Register>(new OrmLiteAuthRepository());

Hopefully these changes are meaningful enough to warrant them. Feel free to use them as a baseline if these changes are not to satisfaction.

Keep up the good work :)

Kind regards,
Shelakel