Commit Graph

125 Commits

Author SHA1 Message Date
Robert von Burg 65992ce0eb [Minor] changed logger for logged in system user 2015-08-11 13:44:56 +02:00
Robert von Burg 21d640e081 [Minor] fixed broken test
- the test has changed because default encoding is now UTF-8 instead of
utf-8
2015-07-09 19:31:46 +02:00
Robert von Burg d9dc5261e7 [Minor] fixed broken test
- the test has changed because default encoding is now UTF-8 instead of
utf-8
2015-07-09 19:29:45 +02:00
Robert von Burg 0c7315b713 [Major] SystemUserAction is now a normal privilege
which is added as follows:
<Privilege name="ch.eitchnet.privilege.handler.SystemUserAction" 
    policy="DefaultPrivilege">
  <Allow>ch.eitchnet.privilege.test.model.TestSystemUserAction</Allow>
  <Deny>ch.eitchnet.privilege.test.model.TestSystemUserActionDeny</Deny>
</Privilege>
2015-06-03 23:25:30 +02:00
Robert von Burg 4c6434f475 [Major] Setting user password, locale and state are now separate privs 2015-04-05 00:13:16 +02:00
Robert von Burg 2607bbef3f [Bugfix] fixed bug where stream was not configured correctly 2015-03-18 20:40:10 +01:00
Robert von Burg 3f7636428d [Minor] added JavaDoc to new policies 2015-03-18 20:11:45 +01:00
Robert von Burg 2076675ca5 [Minor] fixed broken tests 2015-03-17 21:47:22 +01:00
Robert von Burg e076ced839 [New] Added UsernameFromCertificatePrivilege policy 2015-03-15 11:03:37 +01:00
Robert von Burg 6ccb4425cc [New] changed session ID to be a UUID 2015-03-15 11:03:23 +01:00
Robert von Burg c2f4d7468b [Major] changed Certificate to use Date and not long 2015-03-14 21:22:20 +01:00
Robert von Burg 9870513beb [New] Added new param "privilegeConflictResolution"
- privilegeConflictResolution is used to configure how conflicts of
privileges on multiple roles are handled.
- Implemented is STRICT where if a privilege with the same name exists
on a role used by the same user occurs, then an exception is thrown.
- Next is MERGE where if a conflict occurs, then the privileges are
merged: allAllowed overrides, allow and deny list are merged
2015-03-14 00:18:59 +01:00
Robert von Burg 7ff8ba6779 [Bugfix] Fixed bad parsing of Allow on multiple privileges per Role 2015-03-12 18:31:14 +01:00
Robert von Burg fa40671b8c [Major] removed the need for a role PrivilegeAdmin - now use privileges
- this solves the situation where a user might be allowed to add a user
with a specific role, but not change a role and other such use cases

Now there are privileges for every use case with two new
PrivilegePolicies:
- RoleAccessPrivilege
- UserAccessPrivilege
both of these policies expect a ch.eitchnet.utils.collections.Tuple as
privilege value. The Tuple is a simple wrapper for two values: first and
second. Each privilege has its own requirement on the actual values

Special privilege actions:
- PrivilegeAction -> privilege vlaue: String
  - Persist (required Allow)
  - Reload (required Allow)
  - GetPolicies (required Allow)

Role specific privileges:
- PrivilegeGetRole -> privilege value: Tuple(null, newRole)
- PrivilegeAddRole -> privilege value: Tuple(null, newRole)
- PrivilegeRemoveRole -> privilege value: Tuple(null, newRole)
- PrivilegeModifyRole -> privilege value: Tuple(oldRole, newRole)

Use specific privileges:
- PrivilegeGetUser -> privilege value: Tuple(null, newUser)
- PrivilegeAddUser -> privilege value: Tuple(null, newUser)
- PrivilegeRemoveUser -> privilege value: Tuple(null, newUser)
- PrivilegeModifyUser -> privilege value: Tuple(oldUser, newUser)
  - NOTE: without modifying roles, only fields and properties!
- PrivilegeAddRoleToUser -> privilege value: Tuple(oldUser, roleName)
- PrivilegeRemoveRoleFromUser -> privilege value: Tuple(oldUser,
	roleName)
2015-03-12 17:32:06 +01:00
Robert von Burg a3d76d4cd8 [Major] allow user to change their own locale incl. auto persist 2015-03-08 21:44:21 +01:00
Robert von Burg 5ef43eaebe [Major] All methods in PrivilegeHandler now return a value after op
- also fixed JAXB (un)marshalling of list values on UserRep and RoleRep
2015-03-08 20:51:10 +01:00
Robert von Burg eeb3356372 [Minor] fixed broken test 2015-03-08 13:39:27 +01:00
Robert von Burg 5940a345d4 [Major] refactoring Privilege
- All reps are now JAXB enabled
- replaced addOrReplace with add and repalace methods
- added some more tests
2015-03-08 13:38:15 +01:00
Robert von Burg 811423eee6 [Bugfix] fixed not adding firstname and last name to sys user cert 2015-02-09 00:35:01 +01:00
Robert von Burg 87239afa2a [New] added certificate.getUserRoles() 2014-12-31 16:38:00 +01:00
Robert von Burg 67271d611e [New] Added Certificate.getLastAccess() and
PrivilegeHandler.checkPassword()
2014-09-27 12:23:38 +02:00
Robert von Burg aa16887d67 [New] Added new Certificate.getProperty()-method 2014-09-26 18:23:23 +02:00
Robert von Burg e3dab98b3f [Minor] code cleanup 2014-09-14 12:19:34 +02:00
Robert von Burg 901c2c86f2 [New] added PrivilegeContext.getFlatAllowList()
This allows to query all the allows which can be used to define which
UIs and buttons to show on a client
2014-09-08 13:35:02 +02:00
Robert von Burg bb949f38af [Minor] Added check for user's referencing inexistant oles 2014-08-22 22:28:33 +02:00
Robert von Burg d2faed1d2e [Major] added firstname and lastname to certificate
Also renamed model attribute from surname to lastname
2014-08-22 20:36:18 +02:00
Robert von Burg b47d3e3dcd [Minor] firstname and lastname are not required for SYSTEM users 2014-08-22 18:54:10 +02:00
Robert von Burg 32c2c43fbd [New] added Certificate.sessionDataMap for mutable session information 2014-08-04 00:44:09 +02:00
Robert von Burg 2e1412de93 [Major] Removed the use of a ThreadLocal for the PrivilegeContext
ThreadLocals are bad idea when ClassLoaders come into play, so removing
the need makes Privilege better usable in different contexts.
2014-04-15 19:18:11 +02:00
Robert von Burg 58b742d5d9 [Minor] using Deque instead of Stack 2014-02-01 13:47:04 +01:00
Robert von Burg 5e6423c443 [Bugfix] fixed NPE when Certificate is created with null properties 2014-01-28 22:19:15 +01:00
Robert von Burg 4627f59a80 [Minor] properties are read-only on Certificate 2014-01-28 22:07:04 +01:00
Robert von Burg 11f53cb272 [Minor] removed the use of the authPass in the certificate 2013-12-29 23:12:37 +01:00
Robert von Burg bab1e4b119 [Bugfix] fixed a bug where the role were not properly read from XML
Added tests for reading the model from XML
2013-12-28 12:16:48 +01:00
Robert von Burg 5d59a52eeb [Minor] Throwing explicit exception system user tries to login
Further enforcing that a system user may not have a password
2013-12-28 10:55:58 +01:00
Robert von Burg 3727d3545f [Minor] cleaned up all compiler warnings 2013-12-25 14:37:22 +01:00
Robert von Burg 15a245d94e [Minor] added new initialization to PrivilegeInitializationHelper
Configuration can now be parsed and then passed to an initialization
method
2013-12-25 13:10:58 +01:00
Robert von Burg 85db07a002 [Minor] fixed issue where eclipse couldn't validate log4j.xml 2013-12-25 11:55:55 +01:00
Robert von Burg 744920a62b [Minor] removed use of deprecated JUnit classes 2013-12-24 02:42:29 +01:00
Robert von Burg 036c725a52 [Project] Changed all licence references to Apache License 2.0 2013-12-15 13:38:29 +01:00
Robert von Burg a8b0f37834 [Minor] Changed exceptions to contain cause and code clean up 2013-11-16 01:08:27 +01:00
Robert von Burg f2fd1233d9 [Minor] renamed validateIsPrivilegeAdmin to assertIsPrivilegeAdmin 2013-10-28 22:00:33 +01:00
Robert von Burg 31c6acec6c [Minor] fixed failing test due to different formatting of xml writing 2013-09-15 21:57:42 +02:00
Robert von Burg 874acc5828 fixed wrong namespace in PrivilegeModel.xsd 2013-08-12 17:00:05 +02:00
Robert von Burg c4e6c5e65d Refactored InitializationHelper so it can take an InputStream
Also renamed it to PrivilegeInitializationHelper
2013-08-12 11:04:42 +02:00
Robert von Burg d7f10a731f [Minor] fixed compiler warnings
fixed multiple compiler warnings about broken JavaDocs and pom which was
still set to Java 1.6, now changed to 1.7
2013-08-08 00:32:39 +02:00
Robert von Burg 6eb34ff532 [Minor] fixed problem with build on mvn cli
The problem was due to a naming problem with the PrivilegeMessages class
and property bundle having the same name and being in the same package.
Moved the properties file now to the resources directory
2013-04-19 21:33:18 +02:00
Robert von Burg 93022ba559 [Major] major rewrite of the privilege validation.
Now the PrivilegeContext object is central and once the user logged in,
this object is bound to a ThreadLocal. From then there is no further
need to interact with the PrivilegeHandler - this allows for
authenticated users to get a remote copy of the PrivilegeContext so that
on a remote client, the user can check for permissions, without having
to do the round trip to the server.

A code review of this change would be good, but preliminary tests show
that it works. A test should now be implemented to check if getting a
remote copy also allows for authorization.
2013-04-09 07:33:32 +02:00
Robert von Burg 9261494667 [Minor] cleaned up doc and implemented missing toString() and equals()
A number classes had JavaDocs with @see parameters on overriding
methods. This was changed so that they were removed, as they are not
needed.

In some classes the toString() methods were missing, as well as equals()
and hashcode() they were now added
2013-03-26 19:42:17 +01:00
Robert von Burg 44cb148036 [Minor] code cleanup
- cleaned up JavaDoc for some classes
- changed equals() to not use instanceOf but class==class
- set some fields private which were package scope
2013-03-24 12:23:29 +01:00