An API for sending payrolls to the employee's account on the corporate website. Built with Java and Spring Framework.
The following role model is used.
Anonymous | User | Accountant | Administrator | Auditor | |
---|---|---|---|---|---|
POST api/auth/signup | + | + | + | + | + |
POST api/auth/changepass | + | + | + | - | |
GET api/empl/payment | - | + | + | - | - |
POST api/acct/payments | - | - | + | - | - |
PUT api/acct/payments | - | - | + | - | - |
GET api/admin/user | - | - | - | + | - |
DELETE api/admin/user | - | - | - | + | - |
PUT api/admin/user/role | - | - | - | + | - |
PUT api/admin/user/access | - | - | - | + | - |
GET api/security/events | - | - | - | - | + |
The following information security events are logged.
Description | Event |
---|---|
A user has been successfully registered | CREATE_USER |
A user has changed the password successfully | CHANGE_PASSWORD |
A user is trying to access a resource without access rights | ACCESS_DENIED |
Failed authentication | LOGIN_FAILED |
A role is granted to a user | GRANT_ROLE |
A role has been revoked | REMOVE_ROLE |
The Administrator has locked the user | LOCK_USER |
The Administrator has unlocked a user | UNLOCK_USER |
The Administrator has deleted a user | DELETE_USER |
A user has been blocked on suspicion of a brute force attack | BRUTE_FORCE |
The security events are stored with the fields below:
{
"date": "<date>",
"action": "<event_name from table>",
"subject": "<The user who performed the action>",
"object": "<The object on which the action was performed>",
"path": "<api>"
}
Available to unauthorized users for registration and accepts data in the JSON format:
{
"name": "<String value, not empty>",
"lastname": "<String value, not empty>",
"email": "<String value, not empty>",
"password": "<String value, not empty>"
}
Changes password of the authenticated user. Accepts the following JSON body:
{
"new_password": "<String value, not empty>"
}
Gives access to the payroll of an employee. Accepts optional period parameter .
Uploads payrolls. Accepts the following JSON body:
[
{
"employee": "<user email>",
"period": "<mm-YYYY>",
"salary": <Long>
},
{
"employee": "<user1 email>",
"period": "<mm-YYYY>",
"salary": <Long>
},
...
{
"employee": "<userN email>",
"period": "<mm-YYYY>",
"salary": <Long>
}
]
Changes the salary of a specific user. The following JSON data is accepted:
{
"employee": "<user email>",
"period": "<mm-YYYY>",
"salary": <Long>
}
Obtains information about all users.
Deletes user specified by {user email}.
Sets the roles. The following JSON body is accepted:
{
"user": "<String value, not empty>",
"role": "<User role>",
"operation": "<[GRANT, REMOVE]>"
}
Locks and unlocks users. The following JSON body is accepted:
{
"user": "<String value, not empty>",
"operation": "<[LOCK, UNLOCK]>"
}
Responds with an array of objects representing the security events of the service sorted in ascending order by ID.