Currently, it uses an endpoint similar to OpenID Connect UserInfo but with some differences. The endpoint does not require the "openid" scope for example. There is an ongoing effort to replace the OAuth 2.0 authorization server with a more standard compliant one which would break the endpoint (since it would require the "openid" scope). It is currently not possible to request the "openid" scope to future-proof since Spring would act differently if that scope is present and assume full OpenID Connect. That leads to requiring an id token to have been issued which the current authorization server does not do.
To get around this the implementation is changed to use a standard compliant Token Introspection endpoint to get access to the subject of the access token (which is the only part that's necessary right now). Since the endpoint is standard compliant it will work with any future authorization server.
It may be necessary to run `docker compose up --build` to get the latest version of the Toker containers.
Reviewed-on: #141
Reviewed-by: Nico Athanassiadis <nico@dsv.su.se>
Co-authored-by: Andreas Svanberg <andreass@dsv.su.se>
Co-committed-by: Andreas Svanberg <andreass@dsv.su.se>
The new version has upgraded `json-smart` so the override is no longer necessary.
## How to test
1. Log in and click around as different users
2. Enable Daisy integration (both `DEV` and `DAISY-INTEGRATION` Maven profiles)
3. Go to "Admin / Users / Import" and import someone (verify JSON parsing)
Reviewed-on: #140
Reviewed-by: Nico Athanassiadis <nico@dsv.su.se>
Co-authored-by: Andreas Svanberg <andreass@dsv.su.se>
Co-committed-by: Andreas Svanberg <andreass@dsv.su.se>
So far no rules are activated and it just puts the infrastructure in place.
Rules can be added in separately after discussion among the developers,
along with fixing any violations of the rules.
Co-authored-by: Nico Athanassiadis <nico@dsv.su.se>
Reviewed-on: #138
Reviewed-by: Nico Athanassiadis <nico@dsv.su.se>
Co-authored-by: Andreas Svanberg <andreass@dsv.su.se>
Co-committed-by: Andreas Svanberg <andreass@dsv.su.se>
Allows deleting (your own) forum replies.
Fixes#90
## How to test
1. Log in as `eric@example.com` (supervisor) or as `sture@example.com` (author)
2. Open the forum in project "Putting the it in supervising"
3. Create a new thread
4. Post some replies as the different users
5. Delete the replies
Co-authored-by: Nico Athanassiadis <nico@dsv.su.se>
Reviewed-on: #137
Reviewed-by: Nico Athanassiadis <nico@dsv.su.se>
Co-authored-by: Andreas Svanberg <andreass@dsv.su.se>
Co-committed-by: Andreas Svanberg <andreass@dsv.su.se>
Allows a way to solve #119
Reviewed-on: #134
Reviewed-by: Nico Athanassiadis <nico@dsv.su.se>
Co-authored-by: Andreas Svanberg <andreass@dsv.su.se>
Co-committed-by: Andreas Svanberg <andreass@dsv.su.se>
Fixes#129
## How to test
1. Log in as `evan@example.com`
2. Go to "My groups"
3. Click "Create new group"
4. Select some projects but do *not* fill in the "Title"
5. Click save
6. Error message should be presented
7. Project selection should be maintained
Co-authored-by: Nico Athanassiadis <nico@dsv.su.se>
Reviewed-on: #133
Reviewed-by: Nico Athanassiadis <nico@dsv.su.se>
Co-authored-by: Andreas Svanberg <andreass@dsv.su.se>
Co-committed-by: Andreas Svanberg <andreass@dsv.su.se>
The seemingly unused library `jersey-hk2` that got removed in #118 is used, if present, internally by the Jersey client to find and register Jackson modules (such as those that provide `java.time` support).
## How to test
1. Turn on the `DAISY-INTEGRATION` Maven profile (alongside `DEV`)
2. Configure some projects and their authors to have a Daisy connection
3. Log in as the supervisor
4. Go to the "Finishing up" tab in the project
5. See that it works compared to `develop` branch
Reviewed-on: #132
Reviewed-by: Nico Athanassiadis <nico@dsv.su.se>
Co-authored-by: Andreas Svanberg <andreass@dsv.su.se>
Co-committed-by: Andreas Svanberg <andreass@dsv.su.se>
Read #119 for context first
When authors select supervisor ideas during an open application period they are only allowed to select ideas corresponding to their degree type classification. This limitation can be lifted by giving the author an exemption for "Project type limitation" on the corresponding application period. However, this limitation is still enforced for any potential partner *even if* the have been given the same exemption. This change makes it so the exemption applies to any selected partner as well and not just the author selecting the supervisor idea.
## How to test
1. Log in as `oskar@example.com`
2. Go to "Ideas / My ideas" page
3. Click "Select from available ideas" on the application period "Supervisor ideas"
4. Open the one available idea
5. Try to select it with "Johan Student" as a partner
6. Log in as admin
7. Go to "Match / Application periods"
8. Click "Edit exemptions" on the "Supervisor ideas" period
9. Give "Johan Student" an exemption to "Project type limitation"
10. Repeat steps 1-5
Reviewed-on: #128
Reviewed-by: Nico Athanassiadis <nico@dsv.su.se>
Co-authored-by: Andreas Svanberg <andreass@dsv.su.se>
Co-committed-by: Andreas Svanberg <andreass@dsv.su.se>
The research area column show the string "null" instead of being an empty cell for projects without a research area. This has been fixed everywhere and not just on the project export.
The reviewer column showed weird technical details (`User#toString()`) instead of the reviewers name.
## How to test
1. On `develop` branch
2. Log in as the default admin
3. Go to "Project management / Projects"
4. Click "Excel export" under the table
5. Open the file and see
6. Repeat 1-5 on this branch
Co-authored-by: Nico Athanassiadis <nico@dsv.su.se>
Reviewed-on: #126
Reviewed-by: Nico Athanassiadis <nico@dsv.su.se>
Co-authored-by: Andreas Svanberg <andreass@dsv.su.se>
Co-committed-by: Andreas Svanberg <andreass@dsv.su.se>
Fixes#94Fixes#93
## How to test
1. Log in as the default admin
2. Go to "Project management / Projects"
3. Click "Download as Excel" under the table
4. See that it's still a valid Excel-file
Reviewed-on: #125
Reviewed-by: Nico Athanassiadis <nico@dsv.su.se>
Co-authored-by: Andreas Svanberg <andreass@dsv.su.se>
Co-committed-by: Andreas Svanberg <andreass@dsv.su.se>
Since SciPro is now a Spring Boot-based application it is counter-productive to manage our own dependency versions.
* They could conflict with what Spring Boot assumes
* All libraries that are managed by Spring Boot are tested to work together
QueryDSL and JPA version properties are left in because they're needed for annotation processors (they can't be dependency managed).
Co-authored-by: Nico Athanassiadis <nico@dsv.su.se>
Reviewed-on: #124
Reviewed-by: Nico Athanassiadis <nico@dsv.su.se>
Co-authored-by: Andreas Svanberg <andreass@dsv.su.se>
Co-committed-by: Andreas Svanberg <andreass@dsv.su.se>
The main problem was that the supervisor did not get enough information about each project, mainly who the authors were, when selecting them in the dropdown.
To remedy this, the dropdown has been completely replaced with a checkbox based approach showing the title as well as project type, authors, and start date for each project. The projects are sorted first by start date (descending) and then title, based on the assumptions that newly created projects are the most relevant when setting up groups.
In addition extra "quick buttons" have been added in an effort to reduce the number of clicks required to accomplish varying tasks.
Fixes#89
## How to test
1. Log in as `evan@example.com`
2. Go to "My groups"
3. Click "Create new group"
Co-authored-by: Nico Athanassiadis <nico@dsv.su.se>
Reviewed-on: #123
Reviewed-by: Nico Athanassiadis <nico@dsv.su.se>
Co-authored-by: Andreas Svanberg <andreass@dsv.su.se>
Co-committed-by: Andreas Svanberg <andreass@dsv.su.se>
Fixes#36
## How to test
1. (Optional) Log in as `sid@example.com` and submit an opposition report
1. Go to the tab "Opposition & Active participation"
2. Open the opposition "Putting the it in supervising" on the right
3. Submit the report
2. Log in as `eric@example.com`
3. Go to the final seminar in the "Putting the it in supervising" project (or follow the notification if you did step 1)
4. Request improvements
5. Log in as `sid@example.com`
6. Follow the notification to submit the new opposition report
Click the "Re-run all jobs" button (top right) on https://gitea.dsv.su.se/DMC/scipro/actions/runs/457 to reset the database. It takes a few minutes.
Reviewed-on: #78
Reviewed-by: Nico Athanassiadis <nico@dsv.su.se>
Co-authored-by: Andreas Svanberg <andreass@dsv.su.se>
Co-committed-by: Andreas Svanberg <andreass@dsv.su.se>
Since there is no populator yet Spring fails when trying to inject since it does not support empty collections. Mark the dependency as optional until we have at least one populator at which point we can simply the code again.
Reviewed-on: #122
Reviewed-by: Nico Athanassiadis <nico@dsv.su.se>
Co-authored-by: Andreas Svanberg <andreass@dsv.su.se>
Co-committed-by: Andreas Svanberg <andreass@dsv.su.se>
Currently there is only one class used to add test data; [`DataInitializer`](b9f7dd5a49/core/src/main/java/se/su/dsv/scipro/DataInitializer.java). That class is already very large and causes a lot of merge conflicts when multiple changes are in the pipeline as noted by #109.
This change makes it possible to have multiple classes adding test data so that each change adds its own class and thus there are no conflicts. It also has the benefit of making each class smaller and more self-contained for testing a specific feature.
Some additional infrastructure was added in the form of the `BaseData` and `Factory` (naming improvements notwithstanding) interfaces to help each class add its own test data and re-use common data.
Finally all test data related classes have been moved to their own module so they can be properly excluded when building for production but are included by default while developing.
Fixes#109
## Future work
* Add a mechanism to work with date and time.
Many processes (and therefore service method implementations) rely on the time between certain events. For example a final seminar must be scheduled a set amount of days in advance. In the ideal world, the test data is populated using these service methods to more accurately represent an achievable real world state. Therefore there must be a way to manipulate time when adding test data.
* Add more methods to the `Factory` interface as we discover more common steps that many populators must take.
* Add more base data available through the `BaseData` interface as we discover more common data that many populators need
Care must be taken that this data is final and useful in its base state since populators will rely on that state.
Co-authored-by: Nico Athanassiadis <nico@dsv.su.se>
Reviewed-on: #112
Reviewed-by: Nico Athanassiadis <nico@dsv.su.se>
Co-authored-by: Andreas Svanberg <andreass@dsv.su.se>
Co-committed-by: Andreas Svanberg <andreass@dsv.su.se>
Fixes#68
## How to test
1. Log in as admin
2. Go to "Match / Application periods"
3. Click the edit icon (6th column)
4. Click "Save"
Co-authored-by: Nico Athanassiadis <nico@dsv.su.se>
Reviewed-on: #117
Reviewed-by: Nico Athanassiadis <nico@dsv.su.se>
Co-authored-by: Andreas Svanberg <andreass@dsv.su.se>
Co-committed-by: Andreas Svanberg <andreass@dsv.su.se>
When re-deploying the application, or restarting Tomcat, it will attempt to serialize the active sessions to prevent users from getting logged out and losing in-progess work. This requires that all attributes that are stored in the session implement `java.io.Serializable`. Spring stores the entire security context in the session which includes a reference to the principal, and that principal may be of type "WicketControlledPrincipal" and it must therefore be serializable.
## How to test
1. Be on the `develop` branch
2. Make sure session preservation is turned on (in IntelliJ check "Preserve sessions across restarts and redeploys", or read https://tomcat.apache.org/tomcat-10.0-doc/config/manager.html#Persistence_Across_Restarts)
3. Log in as the default admin `dev@localhost`
4. Switch to "Sture Student" under "Admin / Users / Switch user"
5. Restart Tomcat
6. Refresh page and you'll be prompted to log in again
7. Switch to this branch and repeat step 1-6
Reviewed-on: #121
Reviewed-by: Nico Athanassiadis <nico@dsv.su.se>
Co-authored-by: Andreas Svanberg <andreass@dsv.su.se>
Co-committed-by: Andreas Svanberg <andreass@dsv.su.se>
They display old hard-coded text that does not reflect the current template.
Fixes#97
Co-authored-by: Andreas Svanberg <andreass@dsv.su.se>
Reviewed-on: #98
Reviewed-by: Andreas Svanberg <andreass@dsv.su.se>
Co-authored-by: Tom Zhao <tom.zhao@dsv.su.se>
Co-committed-by: Tom Zhao <tom.zhao@dsv.su.se>
Previously when we wanted to change supervisor we had to make two calls against the daisy api.
A DELETE and a POST, this was brittle because if one of the calls failed we didn't have a good way of handling that.
This could leave the application in a state where a project could end up with 2 different supervisors.
This caused side effects and forced us to manually go into the databases and clean up the errors.
Now the daisy api is updated and we only need to do a POST to change the supervisor. See further documentation here
[POST /thesis/{id}/contributor](https://apitest.dsv.su.se/resource_Theses.html#resource_Theses_postContributor_id_projectParticipant_POST)
### IMPORTANT: Release needs to be synced with Daisy API
Reviewed-on: #114
Reviewed-by: Andreas Svanberg <andreass@dsv.su.se>
Co-authored-by: Nico Athanassiadis <nico@dsv.su.se>
Co-committed-by: Nico Athanassiadis <nico@dsv.su.se>
The overriding should be removed once Spring Security updates its dependencies.
Fixes#104
## How to test
1. Run `mvnw install org.owasp:dependency-check-maven:12.1.0:check --fail-at-end -DnvdApiDelay=60000 -DskipTests -DfailBuildOnCVSS=7`
2. Wait a very long time (can be sped up be [requesting an NVD API key](https://nvd.nist.gov/developers/request-an-api-key) and adding `-DnvdApiKey=<key>`
3. Check the build succeeds
Reviewed-on: #116
Reviewed-by: Nico Athanassiadis <nico@dsv.su.se>
Co-authored-by: Andreas Svanberg <andreass@dsv.su.se>
Co-committed-by: Andreas Svanberg <andreass@dsv.su.se>
Fixes#62
## How to test
1. Log in as admin
2. Go to "Admin / Match / Application periods"
3. Click "Edit exemptions" on the period
4. Add the same exemption twice to "Sture Student"
Reviewed-on: #115
Reviewed-by: Nico Athanassiadis <nico@dsv.su.se>
Co-authored-by: Andreas Svanberg <andreass@dsv.su.se>
Co-committed-by: Andreas Svanberg <andreass@dsv.su.se>
Previously if an author resubmitted their final thesis to the supervisor fora re-submission to the examiner the date of submission was the first submitted final thesis. And the status text only showed "Waiting for grading". This caused a lot of confusion for the authors when the dates and status of the final thesis was divergent from their perceived view of dates and changes.
Fixes#79
Reviewed-on: #113
Reviewed-by: Andreas Svanberg <andreass@dsv.su.se>
Co-authored-by: Nico Athanassiadis <nico@dsv.su.se>
Co-committed-by: Nico Athanassiadis <nico@dsv.su.se>
Fixes#67
Reviewed-on: #96
Reviewed-by: Andreas Svanberg <andreass@dsv.su.se>
Co-authored-by: Tom Zhao <tom.zhao@dsv.su.se>
Co-committed-by: Tom Zhao <tom.zhao@dsv.su.se>
Before, after scheduling a first meeting, they had to refresh the entire page to show the information in the table.
Fixes#82
Reviewed-on: #105
Reviewed-by: Nico Athanassiadis <nico@dsv.su.se>
Previously deadline was only visible at the Reviewer start page, tab 'Rough draft approvals'.
Now the deadline is also shown when you go to the detail page of a rough draft.
Fixes issue #99
Reviewed-on: #106
Reviewed-by: Andreas Svanberg <andreass@dsv.su.se>
Co-authored-by: Nico Athanassiadis <nico@dsv.su.se>
Co-committed-by: Nico Athanassiadis <nico@dsv.su.se>
Fixes#48
The `getReflectionText` method was calling `getString` when no reflection has been submitted. This is not a relevant case for the editing form since it can not be accessed when there is no reflection. Inlined the method call and removed the non-submitted case, the default will be an empty string.
## How to test
1. Log in as a supervisor
2. Open a project that has a Daisy connection (`identifier`is non-null on the `Project`)
3. Go to the "Finishing up" tab
4. Go to the tab for the author with no reflection submitted
5. See that no warning is logged
Co-authored-by: Nico Athanassiadis <nico@dsv.su.se>
Reviewed-on: #101
Reviewed-by: Nico Athanassiadis <nico@dsv.su.se>
Co-authored-by: Andreas Svanberg <andreass@dsv.su.se>
Co-committed-by: Andreas Svanberg <andreass@dsv.su.se>
The updated versions should fix CVE-2024-45801.
Was forced to update spring-boot 3.4.1 to be able to use the latest version of springdoc as per the
springdoc compability matrix.
The compability matrix can be found [here](https://springdoc.org/#what-is-the-compatibility-matrix-of-springdoc-openapi-with-spring-boot)
fixes issue #80
Reviewed-on: #91
Reviewed-by: Andreas Svanberg <andreass@dsv.su.se>
Co-authored-by: Nico Athanassiadis <nico@dsv.su.se>
Co-committed-by: Nico Athanassiadis <nico@dsv.su.se>
Require authors to fill in background, literature, method, problem, and interests when submitting an idea.
Fixes#37
## How to test
1. Navigate to https://scipro-student-idea-form-required-fields.branch.dsv.su.se/
2. Log in as `stig@example.com`
3. Go to "Ideas" / "My ideas"
4. Attempt to submit an idea without either of background, literature, method, problem, or interests
Co-authored-by: Nico Athanassiadis <nico@dsv.su.se>
Reviewed-on: #72
Reviewed-by: Nico Athanassiadis <nico@dsv.su.se>
Co-authored-by: Andreas Svanberg <andreass@dsv.su.se>
Co-committed-by: Andreas Svanberg <andreass@dsv.su.se>
Fixes#73
In daisy.xsd there are two datatypes, one is called STATUS and another one is called Status. Since Windows file system is case insensitive, file STATUS.java and Status.java are considered as same name. This makes build on Windows impossible.
Solution: in XJC binding file, rename Status.java to Status2.java (the Status2.java belongs to Examination is endpoint/resource which is not used by Scipro).
Other small improvments:
- package name 'se.su.dsv.scipro.daisyExternal' is renamed to 'se.su.dsv.scipro.daisyexternal'.
- single import statements are applied.
Reviewed-on: #74
Reviewed-by: Andreas Svanberg <andreass@dsv.su.se>
Co-authored-by: Tom Zhao <tom.zhao@dsv.su.se>
Co-committed-by: Tom Zhao <tom.zhao@dsv.su.se>
Reviewed-on: #76
Reviewed-by: Tom Zhao <tom.zhao@dsv.su.se>
Co-authored-by: Andreas Svanberg <andreass@dsv.su.se>
Co-committed-by: Andreas Svanberg <andreass@dsv.su.se>
Reviewed-on: #70
Reviewed-by: Tom Zhao <tom.zhao@dsv.su.se>
Co-authored-by: Andreas Svanberg <andreass@dsv.su.se>
Co-committed-by: Andreas Svanberg <andreass@dsv.su.se>
https://nvd.nist.gov/vuln/detail/CVE-2024-49203https://github.com/querydsl/querydsl/issues/3757
Basically if you allow untrusted user input to be used in the "ORDER BY" clause you can be vulnerable to SQL injection.
I believe this is nonsense and akin to saying every Java application has a security vulnerability because JDBC allows you to execute arbitrary SQL if you do not properly use PreparedStatement with parameters over a string-concatenated Statement.
Even if this is considered a valid vulnerability we do not, currently, allow untrusted user input to be used in the "ORDER BY" clause.
Fixes#45
Reviewed-on: https://gitea.dsv.su.se/DMC/scipro/pulls/71
Reviewed-by: Tom Zhao <tom.zhao@dsv.su.se>
Co-authored-by: Andreas Svanberg <andreass@dsv.su.se>
Co-committed-by: Andreas Svanberg <andreass@dsv.su.se>
Fix#63
**Requirements**
On supervisor's start page, a overview of the projects being supervised is shown as a table. One of columns is a flag and on clicking action the browser is redirected to forum page of that project.
Two improvements were asked:
1. If there is unread messages, show a tooltip if mouse is placed over the flag.
2. A number is shown to indicate number of unread messages.
**How to test**
1. Go to https://scipro-3470-forum-msg-ui-improvement.branch.dsv.su.se/
2. Log in as `eric@example.com`
3. Go to the project overview
4. Write something in the forum
5. Mark as unread (click the flag)
6. Go back to overview
Co-authored-by: Andreas Svanberg <andreass@dsv.su.se>
Reviewed-on: #61
Reviewed-by: Andreas Svanberg <andreass@dsv.su.se>
Fix#64
Reviewed-on: #65
Reviewed-by: Andreas Svanberg <andreass@dsv.su.se>
Co-authored-by: Tom Zhao <tom.zhao@dsv.su.se>
Co-committed-by: Tom Zhao <tom.zhao@dsv.su.se>
Click link and see that system is working. Log in using the principal `admin@example.com`. Change something in the deployed system. Re-run the action. See that the database has reset.
**Major change** Added OAuth 2 login so no longer need modified web.xml with filter. Run `docker compose up` to start the local OAuth 2 authorization server to log in. Use the custom ticket form and enter the username you want to log in as in the "Principal" field.
Squashed all migrations since there are faulty ones that can't be applied to an empty database.
Reviewed-on: #15
Reviewed-by: Tom Zhao <tom.zhao@dsv.su.se>
Co-authored-by: Andreas Svanberg <andreass@dsv.su.se>
Co-committed-by: Andreas Svanberg <andreass@dsv.su.se>