Dev (#7) * Require Parameter, not blank and constraint utility functions * App exceptions * App Constants * Added plugin for Input validation, No Arg constructor config for JPA Entities * Pagination support entities Renamed Page Size Constants.kt * Refactored DAOs, made description optional on devices and groups * Implemented CRUD and getAll with pagination support for the Device.kt entity. Tested and linted. * Merge fix * Controller and services of the endpoints: -GET /devices/{id}/processed-stream -GET /devices/{id}/stats -DELETE /groups/{id} -PUT /groups/{id} -GET /groups/{id}/devices -PUT /groups/{id}/devices Refactored some DAOs. Added documentation and service tests. * small fix on typo * removed expanded from GET /groups/{id}/devices * fixed typo in processed stream output dto. Removed id from expanded processed stream dto since the device already comes with it. * Added User and Auth endpoints * Added an Authentication Annotation that allows to receive userID on the arguments of the handler * Lint * build.gradle.kts - Added hypersistence dependency that allows PgsqlEnum support for Hibernate JPA New Endpoints: - PUT /devices/{id}/processing-state. Implemented to match the api documentation for this endpoint. Changed db schema to integrate this feature. Changed api default path to /api/v1 to support api versioning. Changed default page to 0 to match the JPA api for pagination. Added pgsql as dialect. Added query format for sql. All DeviceService.kt methods are properly tested. * Merge fix * Added @Authentication to necessary endpoints. GET /groups/{id} Endpoint. Added Expandable DeviceGroup. Coverage 100% on UserService. * started device group integration tests * POST /groups/ Endpoint. * Changed the return of the POST /devices endpoint to return only the IDOutputDTO; Added @Generated to DeviceGroup DAO id; Added integration tests for the DeviceGroup Controller; Creation of an utils file for the integrations tests regarding requests; Fixed DevicesGroupRepository interface query findDevicesByGroupID with pagination; Added postgres database service to CI; * fixed workflow database url sintaxe. * tried to fix ci to use the db create_schema * remove inits from the CI service. * added again postgres init db args with only -U * trying to fix CI * trying to fix CI * trying to fix CI * trying to fix CI * trying to fix CI * Added ErrorHandler with @ControllerAdvice. Added Exceptions and its mapping to Problem * Fixed tests to pass in case of ProblemDetail return. * Fixed HTTP status on GET /devices/{id}/stats. Fixed MetricRepository findAllByDeviceID to Device type. Device Controller tests. * Added more handlers for exceptions User Related Exceptions are now thrown, User Controller Tests for all endpoints * ProcessedStream integrations tests * when updating devices on a group it, now it will throw an exception if a device is not found, Tests for it User related DTOs separated from I/O Entities and DAOs Added missing @Valid on Controllers Added missing @Authentication on ProcessedStreamController * Added an annotation constraint validator to verify if a parameter is Not Blank with support for nullable types, because the @NotBlank does not support it. * Tests for GET /groups/{id}, POST /groups, PUT /groups/{id} Fix: When updating a group receiving a description with "" will save the description as null on the DB * Update README.md to have a tests passing badge. Can only be confirmed if pushed to github * Added support for user roles. Fixed the tests to run take in account the authorization level/user role. * Login now invalidates the previous session and creates a new one. Removed Nullable from User email. Added UserRoles table * Fixed merge confilcts. - Blank group descriptions are allowed. - Added device operations integrations tests. - Refactored some variable names for readability purposes. - Added any() at matchers.kt. A workaround to use mockito in kotlin. - Moved the whole database schema to the root of the main repository. - Added regex to the stream url. Fixed and added tests accordingly. - Updating the processing state of a device to the same is allowed, but doesn't reflect any changes. - Added thread pool configuration for the api. - Added rabbitmq config properties to the application.properties file. * Added authorization tests Changed ProcessedStreamOutputDto schema, from streamUrl property name to processedStreamUrl * changed schema to test resources * (SQL)Changed OWNER role to ADMIN role * Changed OWNER role to ADMIN role Added RabbitMQ communication when updating instance state * Action refactor. Changed processed stream url column name. * Now deserializing with unknown properties gives error. Changed Metrics repository to grab metrics by id only, not the full device. * Added utility functions to support sending server-sent events from coroutines. * Device State update requires confirmation from the ack_queue Added an SSE to listen for a device state change Added a Message Receiver from the Response Queue Added a remove action for the InstanceMessage Added a flag to mark a device for deletion Added Tests to ensure the correct deletion of a device * Added an init function to add the default admin user to the db if it does not exist * Added a rabbit listener to delete devices when it receives a message from the device delete queue. * completeDeviceState and completeDeviceDeletion tests * (SQL)Added a flag to delete an Instance * Now deserializing with unknown properties gives error. Changed Metrics repository to grab metrics by id only, not the full device. * Removed Cookie from userRegister as now to the register there must be a user with at least the Moderator Role * Fix Register Test Added support for rabbitmq to CI * Added handler to Update User info (names and password) * Changed group devices update from PUT to POST for adding and DELETE for removal. Added an endpoint to get all the groups. Added expansion support do groups. Tests. * Fixed rtsp url regex. Fixed some tests. Fixed list to pagination function isLast condition. * added cors mapping to app config * on UpdateUser, now the updater user now requires a role above the updated user. Get users endpoint * refactored device deletion to support multiple deletes * Added people count sse * Tweaks: Mapped InvalidToken Exception to 401 Changed Docs URI to the current one Removed Unused utils Made so the admin user is created on api startup. Changed Delete Ack Message Schema to the same as the Update State Since they have the same schema in the instance manager. * Removed userID link from device. Changed package names. Added delete user endpoint * Added Dockerfile * Lint Fix * Lint Fix Added Dockerfile --------- Co-authored-by: costalapada <franciscocosta.py@gmail.com> Co-authored-by: Teo <teo_pienescu@hotmail.com> Co-authored-by: Francisco Costa <64478921+franciscocostalap@users.noreply.github.com>