diff --git a/.github/actions/build-docker-image/action.yml b/.github/actions/build-docker-image/action.yml
deleted file mode 100644
index 4ad9c709d..000000000
--- a/.github/actions/build-docker-image/action.yml
+++ /dev/null
@@ -1,29 +0,0 @@
-name: build-docker-image
-description: build a docker image
-
-inputs:
- context:
- description: 'Docker build context'
- required: true
- tag:
- description: 'Docker image name'
- required: true
-
-runs:
- using: "composite"
- steps:
- - name: Checkout repository
- uses: actions/checkout@v2
-
- - name: Build Docker Image
- shell: bash
- run: |
- docker build ${{ inputs.context }} --file ${{ inputs.context }}/Dockerfile --tag ${{ inputs.tag }}:$GITHUB_SHA
- docker save ${{ inputs.tag }}:$GITHUB_SHA | gzip > ${{ inputs.tag }}-image.tar.gz
-
- - name: Upload artifact
- uses: actions/upload-artifact@v2
- with:
- name: ${{ inputs.tag }}-image
- path: ./${{ inputs.tag }}-image.tar.gz
- retention-days: 1
\ No newline at end of file
diff --git a/.github/actions/release-docker-image/action.yml b/.github/actions/release-docker-image/action.yml
deleted file mode 100644
index ba94cd959..000000000
--- a/.github/actions/release-docker-image/action.yml
+++ /dev/null
@@ -1,41 +0,0 @@
-name: release-docker-image
-description: release a docker image to the github registry
-
-inputs:
- username:
- description: 'GitHub username'
- required: true
- password:
- description: 'GitHub password'
- required: true
- image:
- description: 'Docker image'
- required: true
-
-runs:
- using: "composite"
- steps:
- - name: Checkout repository
- uses: actions/checkout@v2
-
- - name: Login to GitHub Container Registry
- shell: bash
- run: echo "${{ inputs.password }}" | docker login https://ghcr.io -u ${{ inputs.username }} --password-stdin
-
- - name: Download artifact
- uses: actions/download-artifact@v2
- with:
- name: ${{ inputs.image }}-image
-
- - name: Push to GitHub Container Registry
- shell: bash
- run: |
- IMAGE_ID=ghcr.io/learnlib/alex/${{ inputs.image }}
- BRANCH=${GITHUB_REF#"refs/heads/"}
- VERSION=unstable
-
- docker load < ${{ inputs.image }}-image.tar.gz
- docker tag ${{ inputs.image }}:$GITHUB_SHA $IMAGE_ID:$VERSION
- docker push $IMAGE_ID:$VERSION
- docker tag ${{ inputs.image }}:$GITHUB_SHA $IMAGE_ID:$GITHUB_SHA
- docker push $IMAGE_ID:$GITHUB_SHA
diff --git a/.github/settings.xml b/.github/settings.xml
deleted file mode 100644
index 605000ef2..000000000
--- a/.github/settings.xml
+++ /dev/null
@@ -1,14 +0,0 @@
-
-
- false
-
-
-
- ossrh
- ${env.OSSRH_TOKEN_USERNAME}
- ${env.OSSRH_TOKEN_PASSWORD}
-
-
-
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
deleted file mode 100644
index 10b7befa4..000000000
--- a/.github/workflows/ci.yml
+++ /dev/null
@@ -1,286 +0,0 @@
-name: CI
-
-on:
- push:
- branches:
- - main
- pull_request:
- branches:
- - main
-
-permissions:
- contents: write
-
-jobs:
- build-backend:
- runs-on: ubuntu-latest
- steps:
- - uses: actions/checkout@v2
- - name: Set up JDK 17
- uses: actions/setup-java@v1
- with:
- java-version: 17
- - name: Cache local Maven repository
- uses: actions/cache@v2
- with:
- path: ~/.m2/repository
- key: ${{ runner.os }}-maven-build-${{ hashFiles('**/pom.xml') }}
- restore-keys: |
- ${{ runner.os }}-maven-build-
- - name: Build with Maven
- run: mvn clean install -DskipTests package --file ./backend/pom.xml
-
- lint-backend:
- needs: build-backend
- runs-on: ubuntu-latest
- steps:
- - uses: actions/checkout@v2
- - uses: actions/setup-java@v1
- with:
- java-version: 17
- - name: Cache local Maven repository
- uses: actions/cache@v2
- with:
- path: ~/.m2/repository
- key: ${{ runner.os }}-maven-lint-${{ hashFiles('**/pom.xml') }}
- restore-keys: |
- ${{ runner.os }}-maven-lint-
- - name: Lint Java Code
- run: mvn checkstyle:checkstyle -Pcode-analysis --file ./backend/pom.xml
-
- analyse-backend:
- needs: build-backend
- runs-on: ubuntu-latest
- steps:
- - uses: actions/checkout@v2
- - uses: actions/setup-java@v1
- with:
- java-version: 17
- - name: Cache local Maven repository
- uses: actions/cache@v2
- with:
- path: ~/.m2/repository
- key: ${{ runner.os }}-maven-analyse-${{ hashFiles('**/pom.xml') }}
- restore-keys: |
- ${{ runner.os }}-maven-analyse-
- - name: Analyse Java Code for bugs
- run: mvn install -DskipTests --file ./backend/pom.xml && mvn spotbugs:check -Pcode-analysis --file ./backend/pom.xml
-
- test-unit-backend:
- needs: [lint-backend, analyse-backend]
- runs-on: ubuntu-latest
- steps:
- - uses: actions/checkout@v2
- - name: Set up JDK 17
- uses: actions/setup-java@v1
- with:
- java-version: 17
- - name: Cache local Maven repository
- uses: actions/cache@v2
- with:
- path: ~/.m2/repository
- key: ${{ runner.os }}-maven-test-unit-${{ hashFiles('**/pom.xml') }}
- restore-keys: |
- ${{ runner.os }}-maven-test-unit-
- - name: Run unit tests with Maven
- run: mvn clean test --file ./backend/pom.xml
-
- test-integration-backend:
- needs: test-unit-backend
- runs-on: ubuntu-latest
- steps:
- - uses: actions/checkout@v2
- - name: Set up JDK 17
- uses: actions/setup-java@v1
- with:
- java-version: 17
- - name: Cache local Maven repository
- uses: actions/cache@v2
- with:
- path: ~/.m2/repository
- key: ${{ runner.os }}-maven-test-integration-${{ hashFiles('**/pom.xml') }}
- restore-keys: |
- ${{ runner.os }}-maven-test-integration-
- - name: Run integration tests with Maven
- run: mvn clean verify -Dsurefire.skip=true --file ./backend/pom.xml
-
- package-backend:
- needs: test-integration-backend
- runs-on: ubuntu-latest
- if: github.event_name == 'push'
- steps:
- - uses: actions/checkout@v2
- - name: Build the Docker image for the backend
- uses: ./.github/actions/build-docker-image
- with:
- context: ./backend
- tag: alex-backend
-
- lint-frontend:
- runs-on: ubuntu-latest
- steps:
- - uses: actions/checkout@v2
- - name: Lint TypeScript code
- uses: actions/setup-node@v2
- with:
- node-version: '16'
- - run: cd ./frontend && npm ci && npm run lint
-
- test-unit-frontend:
- needs: lint-frontend
- runs-on: ubuntu-latest
- steps:
- - uses: actions/checkout@v2
- - name: Run Angular unit tests
- uses: actions/setup-node@v2
- with:
- node-version: '16'
- - run: cd ./frontend && npm ci && npm run test -- --no-watch --no-progress --browsers=ChromeHeadlessCI
-
- package-frontend:
- needs: test-unit-frontend
- runs-on: ubuntu-latest
- if: github.event_name == 'push'
- steps:
- - uses: actions/checkout@v2
- - name: Build the Docker image for the frontend
- uses: ./.github/actions/build-docker-image
- with:
- context: ./frontend
- tag: alex-frontend
-
- lint-cli:
- runs-on: ubuntu-latest
- steps:
- - uses: actions/checkout@v2
- - name: Lint CI TypeScript code
- uses: actions/setup-node@v2
- with:
- node-version: '16'
- - run: cd ./cli && npm ci && npm run lint
-
- package-cli:
- needs: lint-cli
- runs-on: ubuntu-latest
- if: github.event_name == 'push'
- steps:
- - uses: actions/checkout@v2
- - name: Build the Docker image for the CLI
- uses: ./.github/actions/build-docker-image
- with:
- context: ./cli
- tag: alex-cli
-
- build-docs:
- runs-on: ubuntu-latest
- steps:
- - uses: actions/checkout@v2
- - name: Build docs
- uses: actions/setup-node@v2
- with:
- node-version: '16'
- - run: cd ./docs && npm install -g npm && npm ci && npm run build
- - name: Upload docs
- uses: actions/upload-artifact@v3
- with:
- name: docs
- path: ./docs/.vuepress/dist/
-
- package-docs:
- needs: build-docs
- runs-on: ubuntu-latest
- if: github.event_name == 'push'
- steps:
- - uses: actions/checkout@v2
- - name: Build the Docker image for the docs
- uses: ./.github/actions/build-docker-image
- with:
- context: ./docs
- tag: alex-docs
-
- release-images:
- needs:
- - package-frontend
- - package-backend
- - package-cli
- - package-docs
- runs-on: ubuntu-latest
- if: github.event_name == 'push'
- steps:
- - uses: actions/checkout@v2
- - name: Release frontend
- uses: ./.github/actions/release-docker-image
- with:
- username: ${{ github.actor }}
- password: ${{ secrets.CR_PAT }}
- image: alex-frontend
- - name: Release backend
- uses: ./.github/actions/release-docker-image
- with:
- username: ${{ github.actor }}
- password: ${{ secrets.CR_PAT }}
- image: alex-backend
- - name: Release CLI
- uses: ./.github/actions/release-docker-image
- with:
- username: ${{ github.actor }}
- password: ${{ secrets.CR_PAT }}
- image: alex-cli
- - name: Release docs
- uses: ./.github/actions/release-docker-image
- with:
- username: ${{ github.actor }}
- password: ${{ secrets.CR_PAT }}
- image: alex-docs
-
- release-packages:
- needs:
- - package-frontend
- - package-backend
- - package-cli
- - package-docs
- runs-on: ubuntu-latest
- if: github.event_name == 'push'
- steps:
- - name: Checkout
- uses: actions/checkout@v2
- - name: Set up JDK 17
- uses: actions/setup-java@v1
- with:
- java-version: 17
- - name: Set up cache
- uses: actions/cache@v2
- with:
- path: |
- ~/.m2
- !~/.m2/repository/de/learnlib/alex
- key: cache-deploy-${{ hashFiles('backend/**/pom.xml') }}
- restore-keys: cache-deploy-
- - name: Run Maven
- env: # make secrets available as environment variables
- OSSRH_TOKEN_USERNAME: ${{ secrets.OSSRH_TOKEN_USERNAME }}
- OSSRH_TOKEN_PASSWORD: ${{ secrets.OSSRH_TOKEN_PASSWORD }}
- run: cd backend && mvn -B -s $GITHUB_WORKSPACE/.github/settings.xml install deploy -DskipTests
-
- pages:
- needs:
- - package-frontend
- - package-backend
- - package-cli
- - package-docs
- runs-on: ubuntu-latest
- if: github.event_name == 'push'
- steps:
- - name: Checkout repo
- uses: actions/checkout@v3
- - name: Create book directory
- run: cd website && mkdir book
- - name: Download docs
- uses: actions/download-artifact@v3
- with:
- name: docs
- path: ./website/book
- - name: Publish pages
- uses: JamesIves/github-pages-deploy-action@v4
- with:
- folder: website
\ No newline at end of file
diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml
deleted file mode 100644
index 1385cf2f9..000000000
--- a/.github/workflows/release.yml
+++ /dev/null
@@ -1,47 +0,0 @@
-name: Release
-
-on:
- workflow_dispatch:
- inputs:
- version:
- description: 'The version of the release'
- required: true
-
-jobs:
- release-cli-to-npm:
- runs-on: ubuntu-latest
- steps:
- - name: Checkout repository
- uses: actions/checkout@v2
-
- - name: Setup NodeJS
- uses: actions/setup-node@v1
- with:
- node-version: 16
- registry-url: https://registry.npmjs.org/
-
- - name: Publish CLI
- run: cd cli && npm ci && npm publish
- env:
- NODE_AUTH_TOKEN: ${{secrets.npm_token}}
-
- tag-docker-images:
- runs-on: ubuntu-latest
- steps:
- - name: Login to GitHub Container Registry
- run: echo "${{ secrets.CR_PAT }}" | docker login https://ghcr.io -u ${{ github.actor }} --password-stdin
-
- - name: Tag latest images with release version
- run: |
- VERSION="@@@${{github.event.inputs.version}}@@@"
- IMAGES="alex-frontend alex-backend alex-cli alex-docs"
-
- for img in $IMAGES
- do
- echo "ghcr.io/learnlib/alex/$img:$VERSION"
- docker pull "ghcr.io/learnlib/alex/$img:unstable"
- docker tag "ghcr.io/learnlib/alex/$img:unstable" "ghcr.io/learnlib/alex/$img:$VERSION"
- docker tag "ghcr.io/learnlib/alex/$img:unstable" "ghcr.io/learnlib/alex/$img:latest"
- docker push "ghcr.io/learnlib/alex/$img:$VERSION"
- docker push "ghcr.io/learnlib/alex/$img:latest"
- done
diff --git a/.gitignore b/.gitignore
deleted file mode 100644
index 651b64255..000000000
--- a/.gitignore
+++ /dev/null
@@ -1,29 +0,0 @@
-# IntelliJ
-.idea
-*.iml
-
-# Java
-main/logs
-target
-*.class
-hs_err_pid*
-
-# log files
-backend/logs
-backend/debug.log
-
-# JavaScript
-cli/src/main/javascript/node_modules
-frontend/src/main/javascript/node_modules
-frontend/src/main/javascript/dist
-frontend/src/main/javascript/test/coverage
-frontend/src/main/javascript/npm-debug\.log
-
-# helm value files
-infrastructure/helm-chart/values-temp.yml
-infrastructure/helm-chart/values-temp.yaml
-infrastructure/helm-chart/secrets.yml
-infrastructure/helm-chart/secrets.yaml
-
-# uploaded files
-main/uploads
diff --git a/.nojekyll b/.nojekyll
new file mode 100644
index 000000000..8b1378917
--- /dev/null
+++ b/.nojekyll
@@ -0,0 +1 @@
+
diff --git a/.resources/code-style-intellij.xml b/.resources/code-style-intellij.xml
deleted file mode 100644
index 11085a77f..000000000
--- a/.resources/code-style-intellij.xml
+++ /dev/null
@@ -1,59 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/.resources/images/favicon.png b/.resources/images/favicon.png
deleted file mode 100644
index 729b9472c..000000000
Binary files a/.resources/images/favicon.png and /dev/null differ
diff --git a/.resources/images/favicon.psd b/.resources/images/favicon.psd
deleted file mode 100644
index 60512bd27..000000000
Binary files a/.resources/images/favicon.psd and /dev/null differ
diff --git a/CHANGELOG.md b/CHANGELOG.md
deleted file mode 100644
index ef9329b37..000000000
--- a/CHANGELOG.md
+++ /dev/null
@@ -1,328 +0,0 @@
-# Changelog
-
-## ALEX 3.0.0
-
-### Breaking Changes
-
-* Due to the removal of the unique name constraint for symbols, project files created with previous releases are not compatible with this release.
-* Due to the CLI overhaul, the CLI got a new API with is not compatible with previous releases.
-
-### Fixes
-
-* Fix issue with JSON path evaluation that returns a JSON object
-* Fix issue with local usage of ALEX with the Chrome image
-
-### Features
-
-* Make ALEX Kubernetes ready:
- * Added Helm chart to `infratructure/helm`.
- * Added Skaffold pipeline for local Kubernetes development.
-* Symbol names must not be unique in the project.
- Instead, symbol names must be unique within a symbol group.
-* CLI overhaul: new API.
-* Allow Webhooks to have custom HTTP headers.
-* Add validation widget for learner setups.
-* Allow to send PATCH requests via an action.
-
-### Changes
-
-* Symbols and tests cannot be exported and imported separately anymore.
-* Update to Selenium 4
-* Remove support for Internet Explorer and HTML Unit
-
-## ALEX 2.1.1
-
-### Fixes
-
-* Fix bug where test cases could not be executed.
-* Fix bug where tests could not be saved when pre steps have changed.
-
-## ALEX 2.1.0
-
-### Breaking Changes
-
-* Use Docker for development and production versions of ALEX.
- The standalone build is no longer supported.
-* Due to the previous point, the web drivers have been removed.
- It is only possible to set the URL to a Selenium Hub.
-
-### Features
-
-* See which symbols and tests are used by other users in a project
-* Export formula suites while exporting a project
-* Export learner setups while exporting a project
-* Automated model checking of learned models
- * Associate LTL formula suites with a learner setup
-
-## ALEX 2.0.0
-
-### Fixes
-
-* Scoping issues with variables
-
-### Improvements
-
-* Add Flyway support
-* Migrate frontend to Angular 8
-* Server-side import and export
-* Add stack trace for failed tests
-* Abort test processes more quickly
-* Show symbol references
-* Support for Java 11
-
-### Features
-
-* Project environments: create environments and environment variables
-* New actions:
- * Drag and drop operations
- * goto-like jumps
- * waiting for a script
-* Update a test suite during test generation
-* Extend "switch to" action for handling windows
-* Import and export for projects
-* Specify default test configurations
-* Multiple pre and post steps for test cases
-* Queue test and learning processes
-* Save learning setups
-* Collaboration for projects
-
-## ALEX 1.7.2
-
-### Fixes
-
-* Generate test case from model
-* Add cookie to request action
-
-## ALEX 1.7.1
-
-### Fixes
-
-* Fix model not displayed in testing view
-
-## ALEX 1.7.0
-
-### Breaking Changes
-
-* Removed the HTML Element Picker.
- The picker only really worked in Chrome and then only in some selected use cases, i.e. static pages.
- Due to these restrictions we decided to remove it completely.
-* Removed xvfb option.
- The option was introduced when major browsers did not have a headless mode.
- Since the option only worked on Linux systems and all major browsers have such a mode, the option has been removed.
-
-### Features
-
-* Basic LTL-based model checking using [LTSmin](https://ltsmin.utwente.nl/).
-* Compatibility with Java > 8.
-* Add action to set a variable by HTTP status.
-* Improved parallelisation support for learning processes.
-* Permanently delete symbols instead of just hiding them.
- This only works if a symbol is not referenced by some other entity.
-* Symbol groups can have the same name when they don't share the parent group.
-* New events for when symbols are deleted permanently.
-* New model checker related events.
-* The JWT expires after 7 days.
-
-### Fixes
-
-* Test results are ordered properly.
-* Fix resuming learning processes with new input symbols.
-
-
-## ALEX 1.6.1
-
-### Fixes
-
-* Fix issues with HTML Element Picker
-
-
-## ALEX 1.6.0
-
-### Breaking Changes
-
-* Symbols have to be migrated to the new version.
- Please use the migration script `src/main/resources/migration/1.6.0/migrate-symbols-1.5.0-to-1.6.0.js` via:
-
- `node migrate-symbols-1.5.0-to-1.6.0.js ./symbols-from-1.5.0.json ./symbols-for-1.6.0.json`
-
-* Tests have to be migrated to the new version.
- Please use the migration script `src/main/resources/migration/1.6.0/migrate-tests-1.5.0-to-1.6.0.js` via:
-
- `node migrate-tests-1.5.0-to-1.6.0.js ./tests-from-1.5.0.json ./tests-for-1.6.0.json`
-
-### Features
-
-* Symbols can be composed of other symbols.
-* Symbols can be parameterized in learning experiments.
-* Connect ALEX to a MySQL database.
- See the README for instructions.
-* Generate test suites from discrimination tree based learners (TTT, Discrimination Tree).
-* Use test cases in test suites as equivalence oracle.
-* Added support for Internet Explorer
-* Execute JavaScript asynchronously
-* Symbol parameters can be *public* or *private*.
- If a parameter is public, its value can be set by the user while configuring a testing or learning process.
- If it is private, its value cannot be set manually, but is resolved by the value in the global data context.
-
-
-## ALEX 1.5.1
-
-This release only contains some bug fixes.
-
-
-## ALEX 1.5.0
-
-### Breaking Changes
-
-* Symbols and tests that have been exported with v.1.4.0 and lower can not be imported directly.
- Apply the new export format and for each symbol in an exported JSON file add the properties `inputs` and `outputs` so that the resulting file looks like:
-
- ```JSON
- {
- "version": "1.4.0",
- "type": "symbols",
- "symbols": [
- {
- "name": "symbol",
- ...,
- "inputs": [],
- "outputs": []
- },
- ...
- ]
- }
- ```
-
-### Bug Fixes
-
-* Resuming a learning process should now work as expected.
-* Various smaller fixes.
-
-### Features
-
-* The results of test executions are saved in reports.
-* Added webhooks to notify external applications about changes.
-* Reuse the browser instance for membership queries.
- A hard reset with a new browser instance can be achieved with a new action.
-* New actions:
- * Refresh and restart the browser window.
- * Click on a arbitrary element with a given visible text.
- * Check if an element, e.g. a checkbox, radio button or option is selected.
- * Set variable to HTTP response body.
-* Parameterized symbols: symbols now have dynamic inputs and outputs.
- Values for inputs can be set by a user for modelling tests.
-* Symbols and symbol groups can be nested in a tree like structure.
-* Named project URLs.
-* Download uploaded files.
-* Learner results can be cloned.
-* Import and export symbol groups.
-
-### Further Comments
-
-* The CLI for ALEX is now a standalone NPM package and can be installed via `npm install alex-cli`
-
-
-## ALEX 1.4.0
-
-### Breaking Changes
-
-* Symbol abbreviations have been removed. To use old exported symbol sets, remove the *abbreviation* property manually
-from the JSON file.
-
-* The HTML Element Picker does not work as before. In order to use it properly, make sure you start your browser with
-disabled CORS rules or use a plugin. See the [user documentation](http://learnlib.github.io/alex/book/1.4.0/) for
-detailed instructions.
-
-### Features
-
-* Define a default web driver to execute tests in
-* Immediately stop learning instead of waiting for the current iteration to finish
-* Support for native headless web driver support for Chrome and Firefox
-* Action recorder - Record a sequence of actions for a symbol in the Element Picker
-* Extended testing capability - Save and execute test cases without starting a learning process
-* Calculate the difference between two models
-* Added Safari driver
-* New actions:
- * Wait for a text to appear
- * Wait for the value of an elements attribute
- * Interact with alert, prompt and confirm dialogs
- * Validate JSON against a JSON schema
-
-See the [user documentation](http://learnlib.github.io/alex/book/1.4.0/) for more details.
-
-## ALEX 1.3.0
-
-### Breaking Changes
-
-* The execute symbol action is no longer supported
-
-### Features
-
-* Possibility to resume old learning experiments
-
-## ALEX v1.2.1
-
-### Breaking Changes
-
-* Actions that deal with web elements have to be updated:
-
- ```
- node: {selector: '...', type: 'CSS|XPATH'}
- ```
-
-### Features
-
-* New actions:
- * Set a variable by node count
- * Set a variable by regex
-* Switch between XPath and CSS selectors in actions
-* Experimental parallel test execution support
-
-## ALEX v1.2
-
-### Features
-
-* New actions:
- * Press special keys like enter, ctrl, etc.
- * Check the value of an elements attribute
-* New equivalence oracle: hypothesis
-* Test symbols without starting a learning process
-* Support for the edge driver
-
-## ALEX v1.1.2
-
-### Breaking Changes
-
-* Dropped support for IE web driver
-* Firefox and Chrome drivers are not supported by default any longer.
- Instead, you have specify the paths to the driver executables.
-
-### Bug Fixes
-
-* Fixed the parsing of JSON paths in various REST actions.
-
-### Features
-
-* New action: Move mouse
-* Click action supports double click
-
-## ALEX v1.1 (and hidden ALEX v1.1.1)
-
-### Bug Fixes
-
-* Allow symbol groups to be edited via the frontend again
-* Properly close connectors after finished learning
-* ALEX v1.1.1 fixed a problem with the fonts.
-
-### Features
-
-* New action: Execute JavaScript
-* GoTo action and Call action support Basic HTTP authentication
-* Export and import projects
-* New REST endpoint: rest/users/batch/{ids} to delete multiple users at once
-* Additional visual enhancements
-
-### Other
-
-* Updated frontend and backend dependencies
-* Removed requirement to have grunt and grunt-cli installed globally
diff --git a/LICENSE.txt b/LICENSE.txt
deleted file mode 100644
index c0f365ff7..000000000
--- a/LICENSE.txt
+++ /dev/null
@@ -1,191 +0,0 @@
-
- Apache License
- Version 2.0, January 2004
- http://www.apache.org/licenses/
-
-TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
-1. Definitions.
-
- "License" shall mean the terms and conditions for use, reproduction,
- and distribution as defined by Sections 1 through 9 of this document.
-
- "Licensor" shall mean the copyright owner or entity authorized by
- the copyright owner that is granting the License.
-
- "Legal Entity" shall mean the union of the acting entity and all
- other entities that control, are controlled by, or are under common
- control with that entity. For the purposes of this definition,
- "control" means (i) the power, direct or indirect, to cause the
- direction or management of such entity, whether by contract or
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
- outstanding shares, or (iii) beneficial ownership of such entity.
-
- "You" (or "Your") shall mean an individual or Legal Entity
- exercising permissions granted by this License.
-
- "Source" form shall mean the preferred form for making modifications,
- including but not limited to software source code, documentation
- source, and configuration files.
-
- "Object" form shall mean any form resulting from mechanical
- transformation or translation of a Source form, including but
- not limited to compiled object code, generated documentation,
- and conversions to other media types.
-
- "Work" shall mean the work of authorship, whether in Source or
- Object form, made available under the License, as indicated by a
- copyright notice that is included in or attached to the work
- (an example is provided in the Appendix below).
-
- "Derivative Works" shall mean any work, whether in Source or Object
- form, that is based on (or derived from) the Work and for which the
- editorial revisions, annotations, elaborations, or other modifications
- represent, as a whole, an original work of authorship. For the purposes
- of this License, Derivative Works shall not include works that remain
- separable from, or merely link (or bind by name) to the interfaces of,
- the Work and Derivative Works thereof.
-
- "Contribution" shall mean any work of authorship, including
- the original version of the Work and any modifications or additions
- to that Work or Derivative Works thereof, that is intentionally
- submitted to Licensor for inclusion in the Work by the copyright owner
- or by an individual or Legal Entity authorized to submit on behalf of
- the copyright owner. For the purposes of this definition, "submitted"
- means any form of electronic, verbal, or written communication sent
- to the Licensor or its representatives, including but not limited to
- communication on electronic mailing lists, source code control systems,
- and issue tracking systems that are managed by, or on behalf of, the
- Licensor for the purpose of discussing and improving the Work, but
- excluding communication that is conspicuously marked or otherwise
- designated in writing by the copyright owner as "Not a Contribution."
-
- "Contributor" shall mean Licensor and any individual or Legal Entity
- on behalf of whom a Contribution has been received by Licensor and
- subsequently incorporated within the Work.
-
-2. Grant of Copyright License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- copyright license to reproduce, prepare Derivative Works of,
- publicly display, publicly perform, sublicense, and distribute the
- Work and such Derivative Works in Source or Object form.
-
-3. Grant of Patent License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- (except as stated in this section) patent license to make, have made,
- use, offer to sell, sell, import, and otherwise transfer the Work,
- where such license applies only to those patent claims licensable
- by such Contributor that are necessarily infringed by their
- Contribution(s) alone or by combination of their Contribution(s)
- with the Work to which such Contribution(s) was submitted. If You
- institute patent litigation against any entity (including a
- cross-claim or counterclaim in a lawsuit) alleging that the Work
- or a Contribution incorporated within the Work constitutes direct
- or contributory patent infringement, then any patent licenses
- granted to You under this License for that Work shall terminate
- as of the date such litigation is filed.
-
-4. Redistribution. You may reproduce and distribute copies of the
- Work or Derivative Works thereof in any medium, with or without
- modifications, and in Source or Object form, provided that You
- meet the following conditions:
-
- (a) You must give any other recipients of the Work or
- Derivative Works a copy of this License; and
-
- (b) You must cause any modified files to carry prominent notices
- stating that You changed the files; and
-
- (c) You must retain, in the Source form of any Derivative Works
- that You distribute, all copyright, patent, trademark, and
- attribution notices from the Source form of the Work,
- excluding those notices that do not pertain to any part of
- the Derivative Works; and
-
- (d) If the Work includes a "NOTICE" text file as part of its
- distribution, then any Derivative Works that You distribute must
- include a readable copy of the attribution notices contained
- within such NOTICE file, excluding those notices that do not
- pertain to any part of the Derivative Works, in at least one
- of the following places: within a NOTICE text file distributed
- as part of the Derivative Works; within the Source form or
- documentation, if provided along with the Derivative Works; or,
- within a display generated by the Derivative Works, if and
- wherever such third-party notices normally appear. The contents
- of the NOTICE file are for informational purposes only and
- do not modify the License. You may add Your own attribution
- notices within Derivative Works that You distribute, alongside
- or as an addendum to the NOTICE text from the Work, provided
- that such additional attribution notices cannot be construed
- as modifying the License.
-
- You may add Your own copyright statement to Your modifications and
- may provide additional or different license terms and conditions
- for use, reproduction, or distribution of Your modifications, or
- for any such Derivative Works as a whole, provided Your use,
- reproduction, and distribution of the Work otherwise complies with
- the conditions stated in this License.
-
-5. Submission of Contributions. Unless You explicitly state otherwise,
- any Contribution intentionally submitted for inclusion in the Work
- by You to the Licensor shall be under the terms and conditions of
- this License, without any additional terms or conditions.
- Notwithstanding the above, nothing herein shall supersede or modify
- the terms of any separate license agreement you may have executed
- with Licensor regarding such Contributions.
-
-6. Trademarks. This License does not grant permission to use the trade
- names, trademarks, service marks, or product names of the Licensor,
- except as required for reasonable and customary use in describing the
- origin of the Work and reproducing the content of the NOTICE file.
-
-7. Disclaimer of Warranty. Unless required by applicable law or
- agreed to in writing, Licensor provides the Work (and each
- Contributor provides its Contributions) on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- implied, including, without limitation, any warranties or conditions
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
- PARTICULAR PURPOSE. You are solely responsible for determining the
- appropriateness of using or redistributing the Work and assume any
- risks associated with Your exercise of permissions under this License.
-
-8. Limitation of Liability. In no event and under no legal theory,
- whether in tort (including negligence), contract, or otherwise,
- unless required by applicable law (such as deliberate and grossly
- negligent acts) or agreed to in writing, shall any Contributor be
- liable to You for damages, including any direct, indirect, special,
- incidental, or consequential damages of any character arising as a
- result of this License or out of the use or inability to use the
- Work (including but not limited to damages for loss of goodwill,
- work stoppage, computer failure or malfunction, or any and all
- other commercial damages or losses), even if such Contributor
- has been advised of the possibility of such damages.
-
-9. Accepting Warranty or Additional Liability. While redistributing
- the Work or Derivative Works thereof, You may choose to offer,
- and charge a fee for, acceptance of support, warranty, indemnity,
- or other liability obligations and/or rights consistent with this
- License. However, in accepting such obligations, You may act only
- on Your own behalf and on Your sole responsibility, not on behalf
- of any other Contributor, and only if You agree to indemnify,
- defend, and hold each Contributor harmless for any liability
- incurred by, or claims asserted against, such Contributor by reason
- of your accepting any such warranty or additional liability.
-
-END OF TERMS AND CONDITIONS
-
-Copyright 2015 - 2020 TU Dortmund
-
-Licensed under the Apache License, Version 2.0 (the "License");
-you may not use this file except in compliance with the License.
-You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing, software
-distributed under the License is distributed on an "AS IS" BASIS,
-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-See the License for the specific language governing permissions and
-limitations under the License.
diff --git a/README.md b/README.md
deleted file mode 100644
index 6d4069178..000000000
--- a/README.md
+++ /dev/null
@@ -1,29 +0,0 @@
-
-
-
-
-
-
-
-# ALEX
-
-Automata Learning EXperience (ALEX) is a Web application that allows you run automated tests on web
-applications and JSON-based APIs using active automata learning.
-
-Users model [Selenium][selenium]- or HTTP-based test inputs for their application, which are used to automatically infer
-an automaton model (a [Mealy machine][mealy]), which represents the behavior of the web application.
-
-## Documentation
-
-* [User manual](https://learnlib.github.io/alex/book/)
-* [Installation](https://learnlib.github.io/alex/book/contents/getting-started/installation/)
-* [Examples](https://learnlib.github.io/alex/book/contents/examples/todomvc/)
-* [Developer docs](https://learnlib.github.io/alex/book/contents/dev-docs/development/)
-
-## Background
-
-* [Active automata learning](https://scholar.google.de/scholar?hl=de&q=active+automata+learning)
-* [ALEX: Mixed-Mode Learning of Web Applications at Ease](https://link.springer.com/chapter/10.1007/978-3-319-47169-3_51)
-
-[mealy]: https://en.wikipedia.org/wiki/Mealy_machine
-[selenium]: https://www.seleniumhq.org/
diff --git a/website/assets/favicons/android-chrome-192x192.png b/assets/favicons/android-chrome-192x192.png
similarity index 100%
rename from website/assets/favicons/android-chrome-192x192.png
rename to assets/favicons/android-chrome-192x192.png
diff --git a/website/assets/favicons/android-chrome-512x512.png b/assets/favicons/android-chrome-512x512.png
similarity index 100%
rename from website/assets/favicons/android-chrome-512x512.png
rename to assets/favicons/android-chrome-512x512.png
diff --git a/website/assets/favicons/apple-touch-icon.png b/assets/favicons/apple-touch-icon.png
similarity index 100%
rename from website/assets/favicons/apple-touch-icon.png
rename to assets/favicons/apple-touch-icon.png
diff --git a/website/assets/favicons/browserconfig.xml b/assets/favicons/browserconfig.xml
similarity index 100%
rename from website/assets/favicons/browserconfig.xml
rename to assets/favicons/browserconfig.xml
diff --git a/website/assets/favicons/favicon-16x16.png b/assets/favicons/favicon-16x16.png
similarity index 100%
rename from website/assets/favicons/favicon-16x16.png
rename to assets/favicons/favicon-16x16.png
diff --git a/website/assets/favicons/favicon-32x32.png b/assets/favicons/favicon-32x32.png
similarity index 100%
rename from website/assets/favicons/favicon-32x32.png
rename to assets/favicons/favicon-32x32.png
diff --git a/website/assets/favicons/favicon.ico b/assets/favicons/favicon.ico
similarity index 100%
rename from website/assets/favicons/favicon.ico
rename to assets/favicons/favicon.ico
diff --git a/website/assets/favicons/mstile-150x150.png b/assets/favicons/mstile-150x150.png
similarity index 100%
rename from website/assets/favicons/mstile-150x150.png
rename to assets/favicons/mstile-150x150.png
diff --git a/website/assets/favicons/safari-pinned-tab.svg b/assets/favicons/safari-pinned-tab.svg
similarity index 100%
rename from website/assets/favicons/safari-pinned-tab.svg
rename to assets/favicons/safari-pinned-tab.svg
diff --git a/website/assets/favicons/site.webmanifest b/assets/favicons/site.webmanifest
similarity index 100%
rename from website/assets/favicons/site.webmanifest
rename to assets/favicons/site.webmanifest
diff --git a/website/assets/images/background.jpg b/assets/images/background.jpg
similarity index 100%
rename from website/assets/images/background.jpg
rename to assets/images/background.jpg
diff --git a/website/assets/images/features-1.png b/assets/images/features-1.png
similarity index 100%
rename from website/assets/images/features-1.png
rename to assets/images/features-1.png
diff --git a/website/assets/images/features-2.png b/assets/images/features-2.png
similarity index 100%
rename from website/assets/images/features-2.png
rename to assets/images/features-2.png
diff --git a/website/assets/images/features-3.png b/assets/images/features-3.png
similarity index 100%
rename from website/assets/images/features-3.png
rename to assets/images/features-3.png
diff --git a/docs/assets/logo.png b/assets/images/logo.png
similarity index 100%
rename from docs/assets/logo.png
rename to assets/images/logo.png
diff --git a/website/assets/js/bootstrap.bundle.min.js b/assets/js/bootstrap.bundle.min.js
similarity index 100%
rename from website/assets/js/bootstrap.bundle.min.js
rename to assets/js/bootstrap.bundle.min.js
diff --git a/website/assets/styles/bootstrap.min.css b/assets/styles/bootstrap.min.css
similarity index 100%
rename from website/assets/styles/bootstrap.min.css
rename to assets/styles/bootstrap.min.css
diff --git a/website/assets/styles/style.css b/assets/styles/style.css
similarity index 100%
rename from website/assets/styles/style.css
rename to assets/styles/style.css
diff --git a/backend/Dockerfile b/backend/Dockerfile
deleted file mode 100644
index 6eee7018c..000000000
--- a/backend/Dockerfile
+++ /dev/null
@@ -1,31 +0,0 @@
-FROM docker.io/library/maven:3.8-openjdk-17-slim as builder-backend
-RUN mkdir -p /backend
-WORKDIR /backend
-COPY ./pom.xml /backend/pom.xml
-RUN mvn verify -DskipTests
-COPY . /backend
-RUN mvn install package -DskipTests
-
-FROM docker.io/library/debian:buster-slim as builder-ltsmin
-RUN mkdir -p /ltsmin
-WORKDIR /ltsmin
-RUN apt-get update -qq && apt-get upgrade -qq && apt-get install -qq wget
-RUN wget https://github.com/utwente-fmt/ltsmin/releases/download/v3.0.2/ltsmin-v3.0.2-linux.tgz
-RUN tar -xzf ltsmin-v3.0.2-linux.tgz
-RUN mv v3.0.2 ltsmin
-
-FROM docker.io/library/openjdk:17-slim
-COPY --from=builder-backend /backend/target/ALEX-3.0.0-exec.jar /usr/share/java/alex/alex.jar
-COPY --from=builder-ltsmin /ltsmin/ltsmin /opt/ltsmin
-WORKDIR /var/lib/alex
-
-EXPOSE 8000
-
-CMD java -jar /usr/share/java/alex/alex.jar \
- --ltsmin.path=/opt/ltsmin/bin \
- --spring.datasource.url="jdbc:postgresql://${DATABASE_HOST}:${DATABASE_PORT}/${DATABASE_NAME}" \
- --spring.datasource.username="${DATABASE_USER}" \
- --spring.datasource.password="${DATABASE_PASSWORD}" \
- --selenium.grid.host="${GRID_HOST}" \
- --selenium.grid.port="${GRID_PORT}" \
- --runtime="${RUNTIME}"
diff --git a/backend/pom.xml b/backend/pom.xml
deleted file mode 100644
index 91adb9fe7..000000000
--- a/backend/pom.xml
+++ /dev/null
@@ -1,646 +0,0 @@
-
-
-
-
- 4.0.0
-
-
- 3.2.1
-
-
-
-
- central
- Maven Repository Switchboard
- default
- https://repo.maven.apache.org/maven2/
-
- false
-
-
-
-
- sonatype-nexus-snapshots
- Sonatype Nexus Snapshots
- https://oss.sonatype.org/content/repositories/snapshots
-
- false
-
-
- true
-
-
-
-
-
- https://github.com/LearnLib/alex.git
- HEAD
-
-
-
- GitHub
- https://github.com/LearnLib/alex/issues
-
-
- GitHub Actions
- https://github.com/LearnLib/alex/actions
-
-
-
- ossrh
- https://oss.sonatype.org/service/local/staging/deploy/maven2/
-
-
- ossrh
- https://oss.sonatype.org/content/repositories/snapshots
- false
-
-
-
- alex-backend
- jar
-
- Automata Learning Experience (ALEX)
- 3.0.0
- de.learnlib.alex
-
-
- A web application for interring Mealy machines of Web applications via active automata learning.
-
-
-
-
- de.learnlib.alex.AlexApp
- UTF-8
- UTF-8
- 17
- 17
-
-
- 3.8.0
- 3.1.1
- 3.0.0-M5
- 3.0.0-M5
- 3.2.2
- 2.7
- 4.3.0
- 3.1.0
- 2.10.4
- 3.0.0-M5
- 3.0.0-M5
- 0.8.2
- 3.1.2
- 8.41
- 4.5.3.0
- 4.5.3
-
-
- 2.7.9
- 0.15.0
- 0.10.0
- 4.8.1
- 0.7.0
- 1.11.0
- 1.4.01
- 1.15.3
- 2.6.0
- 42.6.0
- 2.14.2
- 5.7.0
- 2.23.0
- 2.35
- 2.2.10
- 2.4.0-b180830.0359
- 8.4.3
- 3.0.3
- 1.16.3
- 2.14.0
- 4.0.3
- 2.8.0
- 1.10.0
-
- false
-
-
-
-
- Apache License, Version 2.0
- http://www.apache.org/licenses/LICENSE-2.0
- manual
-
-
-
-
-
- Alexander Bainczyk
- alexander.bainczyk@tu-dortmund.de
-
-
- Marco Krumrey
- marco.krumrey@tu-dortmund.de
-
-
-
-
- Oliver Bauer
- oliver.bauer@tu-dortmund.de
-
-
- Dr. Johannes Neubauer
- johannes.neubauer@tu-dortmund.de
-
-
- Malte Isberner
- malte.isberner@tu-dortmund.de
-
-
- Prof. Dr. Bernhard Steffen
- bernhard.steffen@tu-dortmund.de
-
-
- Philipp Koch
- philipp.koch@tu-dortmund.de
-
-
- Alexander Schieweck
- alexander.schieweck@tu-dortmund.de
-
-
-
- Chair for Programming Systems at TU Dortmund University, Germany
- http://ls5-www.cs.tu-dortmund.de/
-
-
-
-
-
-
- com.google.guava
- guava
- 31.1-jre
-
-
-
-
- org.springframework.boot
- spring-boot-starter-web
- ${spring-boot.version}
-
-
- org.springframework.boot
- spring-boot-starter-security
- ${spring-boot.version}
-
-
- org.springframework.boot
- spring-boot-starter-tomcat
- ${spring-boot.version}
- provided
-
-
- org.springframework.boot
- spring-boot-starter-data-jpa
- ${spring-boot.version}
-
-
- org.springframework.boot
- spring-boot-starter-validation
- ${spring-boot.version}
-
-
- org.springframework.boot
- spring-boot-starter-websocket
- ${spring-boot.version}
-
-
- org.springframework.boot
- spring-boot-starter-jersey
- ${spring-boot.version}
-
-
- jersey-bean-validation
- org.glassfish.jersey.ext
-
-
- bean-validator
- org.glassfish.hk2.external
-
-
-
-
- org.springframework.boot
- spring-boot-devtools
- ${spring-boot.version}
-
-
-
-
- org.glassfish.jersey.media
- jersey-media-multipart
- ${jersey.version}
-
-
- com.fasterxml.jackson.datatype
- jackson-datatype-hibernate5
- ${jackson-datatype.version}
-
-
- com.fasterxml.jackson.module
- jackson-module-jaxb-annotations
- ${jackson-datatype.version}
-
-
- com.fasterxml.jackson.datatype
- jackson-datatype-jsr310
- ${jackson-datatype.version}
-
-
-
-
- org.postgresql
- postgresql
- ${postgresql.version}
- runtime
-
-
- com.vladmihalcea
- hibernate-types-52
- ${hibernate-types-52.version}
-
-
- org.flywaydb
- flyway-core
- ${flyway.version}
-
-
-
-
- com.github.java-json-tools
- json-schema-validator
- ${json-schema-validator.version}
-
-
- commons-io
- commons-io
- ${commons-io.version}
-
-
- org.apache.commons
- commons-text
- ${commons-text.version}
-
-
-
-
- javax.xml.bind
- jaxb-api
- ${jaxb.version}
-
-
-
-
- org.bitbucket.b_c
- jose4j
- ${jose4j.version}
-
-
-
-
- org.apache.shiro
- shiro-core
- ${shiro.version}
-
-
-
-
- org.jsoup
- jsoup
- ${jsoup.version}
-
-
-
-
- com.jayway.jsonpath
- json-path
- ${json-path.version}
-
-
-
-
- io.reactivex.rxjava3
- rxjava
- ${rxjava.version}
-
-
-
-
- net.automatalib.distribution
- automata-distribution
- ${automatalib.version}
- pom
-
-
-
-
- de.learnlib.distribution
- learnlib-distribution
- ${learnlib.version}
- pom
-
-
-
-
- org.seleniumhq.selenium
- selenium-java
- ${selenium.version}
-
-
-
- xml-apis
- xml-apis
- ${xml-apis.version}
-
-
-
-
- org.springframework.boot
- spring-boot-starter-test
- ${spring-boot.version}
-
-
- org.junit.jupiter
- junit-jupiter-engine
-
-
-
-
- org.junit.jupiter
- junit-jupiter-engine
- ${junit.version}
- test
-
-
- org.junit.jupiter
- junit-jupiter-params
- ${junit.version}
- test
-
-
- org.mockito
- mockito-core
- ${mockito.version}
- test
-
-
- org.mockito
- mockito-junit-jupiter
- ${mockito.version}
- test
-
-
- org.testcontainers
- junit-jupiter
- ${testcontainers.version}
- test
-
-
- org.testcontainers
- postgresql
- ${testcontainers.version}
- test
-
-
- org.awaitility
- awaitility
- ${awaitility.version}
- test
-
-
-
-
-
- ALEX-${project.version}
-
-
-
- org.springframework.boot
- spring-boot-maven-plugin
- ${spring-boot.version}
-
- de.learnlib.alex.AlexApp
- false
- false
-
-
-
-
- repackage
-
-
- exec
-
-
-
-
-
-
-
- org.apache.maven.plugins
- maven-surefire-plugin
- ${surefire-plugin.version}
-
- ${surefire.skip}
-
-
- java.util.logging.manager
- org.apache.logging.log4j.jul.LogManager
-
-
-
-
-
-
-
- org.apache.maven.plugins
- maven-failsafe-plugin
- ${failsafe-plugin.version}
-
-
-
- java.util.logging.manager
- org.apache.logging.log4j.LogManager
-
-
- ${project.build.outputDirectory}
-
- **/integrationtests/websocket/**/*.java
- **/integrationtests/resources/LearnerResourceIT.java
-
-
-
-
-
- integration-test
- verify
-
-
-
-
-
-
- org.apache.maven.plugins
- maven-compiler-plugin
- ${compiler-plugin.version}
-
-
-
- org.apache.maven.plugins
- maven-dependency-plugin
- ${dependency-plugin.version}
-
-
-
- org.eluder.coveralls
- coveralls-maven-plugin
- ${coveralls-plugin.version}
-
-
- javax.xml.bind
- jaxb-api
- 2.4.0-b180830.0359
-
-
-
-
-
-
- org.codehaus.mojo
- versions-maven-plugin
- ${versions-plugin.version}
-
-
-
-
- org.apache.maven.plugins
- maven-assembly-plugin
-
-
- jar-with-dependencies
-
-
-
-
- make-assembly
- package
-
- single
-
-
-
-
-
-
-
-
-
- code-analysis
-
-
-
-
-
- org.jacoco
- jacoco-maven-plugin
- ${jacoco-plugin.version}
-
-
- pre-unit-test
-
- prepare-agent
-
-
-
- post-unit-test
-
- report
-
-
-
-
-
-
-
- com.github.spotbugs
- spotbugs-maven-plugin
- ${maven-spotbugs.version}
-
- Max
- Low
- false
-
-
-
- com.github.spotbugs
- spotbugs
- ${spotbugs.version}
-
-
-
-
-
-
- org.apache.maven.plugins
- maven-checkstyle-plugin
- ${maven-checkstyle.version}
-
-
- com.puppycrawl.tools
- checkstyle
- ${checkstyle.version}
-
-
-
- src/main/resources/checkstyle.xml
- src/main/resources/checkstyle-suppressions.xml
- UTF-8
- true
- false
- false
- false
-
-
-
- verify
- verify
-
- check
-
-
- true
- 50
-
-
-
-
-
-
-
-
-
-
diff --git a/backend/src/main/java/de/learnlib/alex/AlexApp.java b/backend/src/main/java/de/learnlib/alex/AlexApp.java
deleted file mode 100644
index 926258b3f..000000000
--- a/backend/src/main/java/de/learnlib/alex/AlexApp.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * Copyright 2015 - 2022 TU Dortmund
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package de.learnlib.alex;
-
-import org.springframework.boot.SpringApplication;
-import org.springframework.boot.autoconfigure.SpringBootApplication;
-import org.springframework.boot.web.servlet.support.SpringBootServletInitializer;
-import org.springframework.scheduling.annotation.EnableScheduling;
-import org.springframework.transaction.annotation.EnableTransactionManagement;
-
-/**
- * The entry point to ALEX.
- */
-@SpringBootApplication
-@EnableTransactionManagement
-@EnableScheduling
-public class AlexApp extends SpringBootServletInitializer {
-
- /**
- * Starts the standalone version of ALEX.
- *
- * @param args
- * Additional commandline parameters.
- */
- public static void main(String[] args) {
- SpringApplication.run(AlexApp.class, args);
- }
-}
-
diff --git a/backend/src/main/java/de/learnlib/alex/AlexComponent.java b/backend/src/main/java/de/learnlib/alex/AlexComponent.java
deleted file mode 100644
index 6e5a0f959..000000000
--- a/backend/src/main/java/de/learnlib/alex/AlexComponent.java
+++ /dev/null
@@ -1,193 +0,0 @@
-/*
- * Copyright 2015 - 2022 TU Dortmund
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package de.learnlib.alex;
-
-import de.learnlib.alex.auth.dao.UserDAO;
-import de.learnlib.alex.auth.entities.User;
-import de.learnlib.alex.auth.entities.UserRole;
-import de.learnlib.alex.learning.dao.LearnerResultDAO;
-import de.learnlib.alex.settings.dao.SettingsDAO;
-import de.learnlib.alex.settings.entities.DriverSettings;
-import de.learnlib.alex.settings.entities.Settings;
-import de.learnlib.alex.testing.dao.TestReportDAO;
-import java.io.IOException;
-import java.net.URL;
-import java.nio.file.Files;
-import java.nio.file.Paths;
-import javax.annotation.PostConstruct;
-import javax.validation.ValidationException;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.beans.factory.annotation.Value;
-import org.springframework.context.annotation.Bean;
-import org.springframework.core.env.Environment;
-import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
-import org.springframework.security.crypto.password.PasswordEncoder;
-import org.springframework.stereotype.Component;
-import org.springframework.transaction.annotation.Transactional;
-import org.springframework.web.cors.CorsConfiguration;
-import org.springframework.web.cors.CorsConfigurationSource;
-import org.springframework.web.cors.UrlBasedCorsConfigurationSource;
-
-@Component
-public class AlexComponent {
-
- private final Environment env;
- private final UserDAO userDAO;
- private final SettingsDAO settingsDAO;
- private final TestReportDAO testReportDAO;
- private final LearnerResultDAO learnerResultDAO;
-
- @Value("${runtime}")
- String runtime;
-
- @Autowired
- public AlexComponent(Environment env,
- UserDAO userDAO,
- SettingsDAO settingsDAO,
- TestReportDAO testReportDAO,
- LearnerResultDAO learnerResultDAO) {
- this.env = env;
- this.userDAO = userDAO;
- this.settingsDAO = settingsDAO;
- this.testReportDAO = testReportDAO;
- this.learnerResultDAO = learnerResultDAO;
- }
-
- /**
- * Create an admin at the start of th ALEX if no admin is currently in the DB.
- */
- @PostConstruct
- @Transactional(rollbackFor = Exception.class)
- public void createDefaultAdmin() {
- if (userDAO.getAllByRole(UserRole.ADMIN).size() == 0) {
- User admin = new User();
- admin.setEmail(env.getProperty("alex.admin.email"));
- admin.setUsername(env.getProperty("alex.admin.username"));
- admin.setRole(UserRole.ADMIN);
- admin.setPassword(new BCryptPasswordEncoder().encode(env.getProperty("alex.admin.password")));
- userDAO.create(admin);
- }
- }
-
- @PostConstruct
- public void abortActiveTestReports() {
- testReportDAO.abortActiveTestReports();
- }
-
- @PostConstruct
- public void abortActiveLearnerResults() {
- learnerResultDAO.abortActiveLearnerResults();
- }
-
- @PostConstruct
- public void configureLtsMin() {
- final String ltsminBinDir = env.getProperty("ltsmin.path");
- if (ltsminBinDir != null && !ltsminBinDir.trim().equals("")) {
- if (!Files.isDirectory(Paths.get(ltsminBinDir))) {
- System.err.println("Cannot find directory for ltsmin binaries.");
- System.exit(0);
- } else {
- System.setProperty("automatalib.ltsmin.path", ltsminBinDir);
- }
- }
- }
-
- @PostConstruct
- public void createSystemFilesDirectory() {
- try {
- final var path = env.getProperty("alex.filesRootDir");
- final var systemPath = Paths.get(path, "system");
- if (Files.notExists(systemPath)) {
- Files.createDirectories(systemPath);
- }
- } catch (IOException e) {
- System.err.println("Failed to initialize system files directory.");
- System.exit(0);
- }
- }
-
- /**
- * Initialize system properties and create the settings object if needed.
- */
- @PostConstruct
- @Transactional
- public void initializeSettings() {
- var settings = settingsDAO.get();
-
- // create settings for the first time
- if (settings == null) {
- try {
- settings = new Settings();
- final var remoteDriverURL = getWebdriverUrl();
- final var driverSettings = new DriverSettings();
- driverSettings.setRemote(remoteDriverURL);
- settings.setDriverSettings(driverSettings);
- settingsDAO.create(settings);
- } catch (ValidationException e) {
- e.printStackTrace();
- System.exit(0);
- }
- }
-
- try {
- settings.setRuntime(runtime);
- settingsDAO.update(settings);
-
- final var remoteDriverUrl = getWebdriverUrl();
- if (!remoteDriverUrl.isEmpty()) {
- new URL(remoteDriverUrl);
- settings.getDriverSettings().setRemote(remoteDriverUrl);
- settingsDAO.update(settings);
- }
- } catch (Exception e) {
- e.printStackTrace();
- System.exit(0);
- }
- }
-
- @Bean
- public PasswordEncoder encoder() {
- return new BCryptPasswordEncoder();
- }
-
- /**
- * Allow requests from a all origins.
- *
- * @return The bean.
- */
- @Bean
- public CorsConfigurationSource corsConfigurationSource() {
- final CorsConfiguration config = new CorsConfiguration();
- config.setAllowCredentials(true);
- config.addAllowedOriginPattern("*");
- config.addAllowedHeader("*");
- config.addAllowedMethod("*");
-
- final UrlBasedCorsConfigurationSource source = new UrlBasedCorsConfigurationSource();
- source.registerCorsConfiguration("/**", config);
-
- return source;
- }
-
- private String getWebdriverUrl() {
- return "http://"
- + env.getProperty("selenium.grid.host", "")
- + ":"
- + env.getProperty("selenium.grid.port", "")
- + "/wd/hub";
- }
-}
diff --git a/backend/src/main/java/de/learnlib/alex/JacksonConfiguration.java b/backend/src/main/java/de/learnlib/alex/JacksonConfiguration.java
deleted file mode 100644
index 266d99661..000000000
--- a/backend/src/main/java/de/learnlib/alex/JacksonConfiguration.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- * Copyright 2015 - 2022 TU Dortmund
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package de.learnlib.alex;
-
-import com.fasterxml.jackson.databind.ObjectMapper;
-import com.fasterxml.jackson.datatype.hibernate5.Hibernate5Module;
-import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule;
-import org.springframework.context.annotation.Bean;
-import org.springframework.context.annotation.Configuration;
-
-/**
- * Jersey Provide to customise the Jackson ObjectMapper.
- */
-@Configuration
-public class JacksonConfiguration {
-
- /**
- * Default constructor, which creates the ObjectMapper and add the custom modules.
- */
- @Bean
- public ObjectMapper objectMapper() {
- final var hibernate5Module = new Hibernate5Module();
- hibernate5Module.configure(Hibernate5Module.Feature.USE_TRANSIENT_ANNOTATION, false);
-
- final var javaTimeModule = new JavaTimeModule();
-
- final var mapper = new ObjectMapper();
- mapper.registerModule(hibernate5Module);
- mapper.registerModule(javaTimeModule);
- return mapper;
- }
-}
diff --git a/backend/src/main/java/de/learnlib/alex/RedirectConfig.java b/backend/src/main/java/de/learnlib/alex/RedirectConfig.java
deleted file mode 100644
index 247782e56..000000000
--- a/backend/src/main/java/de/learnlib/alex/RedirectConfig.java
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- * Copyright 2015 - 2022 TU Dortmund
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package de.learnlib.alex;
-
-import org.springframework.context.annotation.Configuration;
-import org.springframework.web.servlet.config.annotation.ViewControllerRegistry;
-import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
-
-@Configuration
-public class RedirectConfig implements WebMvcConfigurer {
-
- @Override
- public void addViewControllers(ViewControllerRegistry reg) {
- redirect(reg, "/app/**", "/login", "/logout", "/error");
- }
-
- private void redirect(ViewControllerRegistry reg, String... routes) {
- for (int i = 0; i < routes.length; i++) {
- reg.addViewController(routes[i]).setViewName("forward:/index.html");
- }
- }
-}
diff --git a/backend/src/main/java/de/learnlib/alex/auth/dao/UserDAO.java b/backend/src/main/java/de/learnlib/alex/auth/dao/UserDAO.java
deleted file mode 100644
index 402e2542d..000000000
--- a/backend/src/main/java/de/learnlib/alex/auth/dao/UserDAO.java
+++ /dev/null
@@ -1,198 +0,0 @@
-/*
- * Copyright 2015 - 2022 TU Dortmund
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package de.learnlib.alex.auth.dao;
-
-import de.learnlib.alex.auth.entities.UpdateMaxAllowedProcessesInput;
-import de.learnlib.alex.auth.entities.User;
-import de.learnlib.alex.auth.entities.UserRole;
-import de.learnlib.alex.auth.repositories.UserRepository;
-import de.learnlib.alex.common.exceptions.NotFoundException;
-import de.learnlib.alex.data.dao.FileDAO;
-import de.learnlib.alex.data.dao.ProjectDAO;
-import de.learnlib.alex.data.entities.Project;
-import de.learnlib.alex.data.repositories.ProjectRepository;
-import de.learnlib.alex.websocket.services.WebSocketService;
-import java.io.IOException;
-import java.util.List;
-import javax.persistence.EntityManager;
-import javax.validation.ValidationException;
-import org.hibernate.validator.internal.constraintvalidators.hv.EmailValidator;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.context.annotation.Lazy;
-import org.springframework.stereotype.Service;
-import org.springframework.transaction.annotation.Transactional;
-
-/**
- * Implementation of a UserDAO using Hibernate.
- */
-@Service
-@Transactional(rollbackFor = Exception.class)
-public class UserDAO {
-
- private static final Logger logger = LoggerFactory.getLogger(UserDAO.class);
-
- private static final int MAX_USERNAME_LENGTH = 32;
-
- private final UserRepository userRepository;
- private final FileDAO fileDAO;
- private final ProjectDAO projectDAO;
- private final ProjectRepository projectRepository;
- private final WebSocketService webSocketService;
- private final EntityManager entityManager;
-
- @Autowired
- public UserDAO(
- UserRepository userRepository,
- FileDAO fileDAO,
- ProjectDAO projectDAO,
- ProjectRepository projectRepository,
- @Lazy WebSocketService webSocketService,
- EntityManager entityManager
- ) {
- this.userRepository = userRepository;
- this.fileDAO = fileDAO;
- this.projectDAO = projectDAO;
- this.projectRepository = projectRepository;
- this.webSocketService = webSocketService;
- this.entityManager = entityManager;
- }
-
- public User create(User newUser) {
- if (userRepository.findOneByEmail(newUser.getEmail()).isPresent()) {
- throw new ValidationException("A user with the email already exists");
- }
-
- if (userRepository.findOneByUsername(newUser.getUsername()).isPresent()) {
- throw new ValidationException("A user with this username already exists");
- }
-
- if (!new EmailValidator().isValid(newUser.getEmail(), null)) {
- throw new ValidationException("The email is not valid");
- }
-
- if (newUser.getUsername().length() > MAX_USERNAME_LENGTH
- || !newUser.getUsername().matches("^[a-zA-Z][a-zA-Z0-9]*$")) {
- throw new ValidationException("The username is not valid!");
- }
-
- return userRepository.save(newUser);
- }
-
- public List getAll() {
- return userRepository.findAll();
- }
-
- public List getAllByRole(UserRole role) {
- return userRepository.findByRole(role);
- }
-
- public User getByID(Long id) throws NotFoundException {
- return userRepository.findById(id).orElseThrow(() ->
- new NotFoundException("Could not find the user with the ID " + id + ".")
- );
- }
-
- public User getByEmail(String email) {
- return userRepository.findOneByEmail(email).orElseThrow(() ->
- new NotFoundException("Could not find the user with the email '" + email + "'!")
- );
- }
-
- public User getByUsername(String username) {
- return userRepository.findOneByUsername(username).orElseThrow(() ->
- new NotFoundException("Could not find the user with username'" + username + "'!")
- );
- }
-
- public User update(User user) {
- return userRepository.save(user);
- }
-
- public void delete(User authUser, Long id) {
- delete(authUser, getByID(id));
- }
-
- public void delete(User authUser, List userIds) {
- final List users = userRepository.findAllByIdIn(userIds);
- if (users.size() != userIds.size()) {
- throw new NotFoundException("At least one user could not be found.");
- }
-
- for (User user : users) {
- delete(authUser, user);
- entityManager.flush();
- }
- }
-
- public User updateMaxAllowedProcesses(User user, UpdateMaxAllowedProcessesInput input) {
- final var userInDB = userRepository.findById(user.getId())
- .orElseThrow(() -> new NotFoundException("The user could not be found."));
-
- userInDB.setMaxAllowedProcesses(input.maxAllowedProcesses);
-
- return userRepository.save(userInDB);
- }
-
- private void delete(User authUser, User user) {
- // make sure there is at least one registered admin
- if (user.getRole().equals(UserRole.ADMIN)) {
- List admins = userRepository.findByRole(UserRole.ADMIN);
-
- if (admins.size() == 1) {
- throw new NotFoundException("There has to be at least one admin left");
- }
- }
-
- // remove user from all projects in which he is a member
- for (final Project project : user.getProjectsMember()) {
- project.getMembers().removeIf(u -> u.getId().equals(user.getId()));
- projectRepository.save(project);
- }
-
- // remove user from all projects in which he is an owner
- for (final Project project : user.getProjectsOwner()) {
- project.getOwners().removeIf(u -> u.getId().equals(user.getId()));
- projectRepository.save(project);
-
- //remove the project if there is none owner left
- if (project.getOwners().isEmpty()) {
-
- projectDAO.delete(authUser, project.getId());
- try {
- fileDAO.deleteProjectDirectory(user, project.getId());
- } catch (IOException e) {
- logger.info("The project has been deleted, the user directory, however, not.");
- }
- }
- }
-
- userRepository.delete(user);
-
- //close all active webSocketSessions of user and lift all corresponding locks
- webSocketService.closeAllUserSessions(user.getId());
-
- // delete the user directory
- try {
- fileDAO.deleteUserDirectory(user);
- } catch (IOException e) {
- logger.info("The user has been deleted, the user directory, however, not.");
- }
- }
-
-}
diff --git a/backend/src/main/java/de/learnlib/alex/auth/entities/JsonWebToken.java b/backend/src/main/java/de/learnlib/alex/auth/entities/JsonWebToken.java
deleted file mode 100644
index d91035bf2..000000000
--- a/backend/src/main/java/de/learnlib/alex/auth/entities/JsonWebToken.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * Copyright 2015 - 2022 TU Dortmund
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package de.learnlib.alex.auth.entities;
-
-public class JsonWebToken {
-
- private String token;
-
- public JsonWebToken() {
- }
-
- public JsonWebToken(String token) {
- this.token = token;
- }
-
- public String getToken() {
- return token;
- }
-
- public void setToken(String token) {
- this.token = token;
- }
-}
diff --git a/backend/src/main/java/de/learnlib/alex/auth/entities/UpdateEmailInput.java b/backend/src/main/java/de/learnlib/alex/auth/entities/UpdateEmailInput.java
deleted file mode 100644
index 1424ebc5e..000000000
--- a/backend/src/main/java/de/learnlib/alex/auth/entities/UpdateEmailInput.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * Copyright 2015 - 2022 TU Dortmund
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package de.learnlib.alex.auth.entities;
-
-import javax.validation.constraints.Email;
-import javax.validation.constraints.NotBlank;
-
-public class UpdateEmailInput {
-
- @NotBlank(message = "The email must not be blank.")
- @Email(message = "The value is not a valid email.")
- private String email;
-
- public String getEmail() {
- return email;
- }
-
- public void setEmail(String email) {
- this.email = email;
- }
-}
diff --git a/backend/src/main/java/de/learnlib/alex/auth/entities/UpdateMaxAllowedProcessesInput.java b/backend/src/main/java/de/learnlib/alex/auth/entities/UpdateMaxAllowedProcessesInput.java
deleted file mode 100644
index 0e242bf4f..000000000
--- a/backend/src/main/java/de/learnlib/alex/auth/entities/UpdateMaxAllowedProcessesInput.java
+++ /dev/null
@@ -1,25 +0,0 @@
-/*
- * Copyright 2015 - 2022 TU Dortmund
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package de.learnlib.alex.auth.entities;
-
-import javax.validation.constraints.Min;
-
-public class UpdateMaxAllowedProcessesInput {
-
- @Min(value = 1, message = "The number of allowed processes has to be greater than 0.")
- public int maxAllowedProcesses = 1;
-}
diff --git a/backend/src/main/java/de/learnlib/alex/auth/entities/UpdatePasswordInput.java b/backend/src/main/java/de/learnlib/alex/auth/entities/UpdatePasswordInput.java
deleted file mode 100644
index fbc49ffa6..000000000
--- a/backend/src/main/java/de/learnlib/alex/auth/entities/UpdatePasswordInput.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- * Copyright 2015 - 2022 TU Dortmund
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package de.learnlib.alex.auth.entities;
-
-import javax.validation.constraints.NotBlank;
-
-public class UpdatePasswordInput {
-
- @NotBlank(message = "The new password must not be empty.")
- private String newPassword;
-
- @NotBlank(message = "The old password must not be empty.")
- private String oldPassword;
-
- public String getNewPassword() {
- return newPassword;
- }
-
- public void setNewPassword(String newPassword) {
- this.newPassword = newPassword;
- }
-
- public String getOldPassword() {
- return oldPassword;
- }
-
- public void setOldPassword(String oldPassword) {
- this.oldPassword = oldPassword;
- }
-}
diff --git a/backend/src/main/java/de/learnlib/alex/auth/entities/UpdateRoleInput.java b/backend/src/main/java/de/learnlib/alex/auth/entities/UpdateRoleInput.java
deleted file mode 100644
index 660316c01..000000000
--- a/backend/src/main/java/de/learnlib/alex/auth/entities/UpdateRoleInput.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * Copyright 2015 - 2022 TU Dortmund
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package de.learnlib.alex.auth.entities;
-
-import javax.validation.constraints.NotNull;
-
-public class UpdateRoleInput {
-
- @NotNull(message = "The role must not be null.")
- private UserRole role;
-
- public UserRole getRole() {
- return role;
- }
-
- public void setRole(UserRole role) {
- this.role = role;
- }
-}
diff --git a/backend/src/main/java/de/learnlib/alex/auth/entities/UpdateUsernameInput.java b/backend/src/main/java/de/learnlib/alex/auth/entities/UpdateUsernameInput.java
deleted file mode 100644
index c6f68f8a8..000000000
--- a/backend/src/main/java/de/learnlib/alex/auth/entities/UpdateUsernameInput.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * Copyright 2015 - 2022 TU Dortmund
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package de.learnlib.alex.auth.entities;
-
-import de.learnlib.alex.auth.rest.UserResource;
-import javax.validation.constraints.NotBlank;
-import javax.validation.constraints.Pattern;
-import javax.validation.constraints.Size;
-
-public class UpdateUsernameInput {
-
- @NotBlank(message = "The username must not be blank.")
- @Pattern(
- regexp = "^[a-zA-Z][a-zA-Z0-9]*$",
- message = "The username must start with a letter followed by letters or numbers."
- )
- @Size(
- min = 1,
- max = UserResource.MAX_USERNAME_LENGTH,
- message = "The username can only contain " + UserResource.MAX_USERNAME_LENGTH + " characters."
- )
- private String username;
-
- public String getUsername() {
- return username;
- }
-
- public void setUsername(String username) {
- this.username = username;
- }
-}
diff --git a/backend/src/main/java/de/learnlib/alex/auth/entities/User.java b/backend/src/main/java/de/learnlib/alex/auth/entities/User.java
deleted file mode 100644
index 8c478a907..000000000
--- a/backend/src/main/java/de/learnlib/alex/auth/entities/User.java
+++ /dev/null
@@ -1,214 +0,0 @@
-/*
- * Copyright 2015 - 2022 TU Dortmund
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package de.learnlib.alex.auth.entities;
-
-import com.fasterxml.jackson.annotation.JsonIgnore;
-import de.learnlib.alex.data.entities.Project;
-import de.learnlib.alex.webhooks.entities.Webhook;
-import java.io.Serializable;
-import java.util.ArrayList;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Objects;
-import java.util.Set;
-import javax.persistence.Column;
-import javax.persistence.Entity;
-import javax.persistence.GeneratedValue;
-import javax.persistence.GenerationType;
-import javax.persistence.Id;
-import javax.persistence.ManyToMany;
-import javax.persistence.OneToMany;
-import javax.persistence.Table;
-import javax.validation.constraints.Email;
-import javax.validation.constraints.Min;
-import javax.validation.constraints.NotBlank;
-import org.hibernate.annotations.Cascade;
-
-/**
- * The model for a user.
- */
-@Entity
-@Table(name = "user", schema = "public")
-public class User implements Serializable {
-
- /** Auto generated id for saving it into the db. */
- private static final long serialVersionUID = -3567360676364330143L;
-
- /** The unique id of the user. */
- @Id
- @GeneratedValue(strategy = GenerationType.IDENTITY)
- private Long id;
-
- /** The username of the user. */
- @Column(unique = true)
- private String username;
-
- /** The email address of the user he uses to login. */
- @NotBlank
- @Email
- @Column(unique = true)
- private String email;
-
- /** The hash of the users password. */
- @NotBlank
- private String password;
-
- /** The role of the user. */
- private UserRole role;
-
- /** The set of projects in which the user is an owner. */
- @ManyToMany(mappedBy = "owners")
- @JsonIgnore
- private Set projectsOwner;
-
- /** The set of projects in which the user is a member. */
- @ManyToMany(mappedBy = "members")
- @JsonIgnore
- private Set projectsMember;
-
- /** The list of webhooks. */
- @OneToMany(mappedBy = "user")
- @Cascade({org.hibernate.annotations.CascadeType.SAVE_UPDATE, org.hibernate.annotations.CascadeType.REMOVE})
- @JsonIgnore
- private List webhooks;
-
- @Min(value = 1, message = "The number of allowed processes has to be greater than 0.")
- private int maxAllowedProcesses;
-
- /**
- * Default constructor that gives the user the role of "registered".
- */
- public User() {
- this.projectsOwner = new HashSet<>();
- this.projectsMember = new HashSet<>();
- this.webhooks = new ArrayList<>();
- this.role = UserRole.REGISTERED;
- this.maxAllowedProcesses = 1;
- }
-
- /**
- * Constructor that sets a specific ID and gives the user the role of "registered".
- *
- * @param id
- * The ID of the User.
- */
- public User(Long id) {
- this();
- this.id = id;
- }
-
- public Long getId() {
- return id;
- }
-
- public void setId(Long id) {
- this.id = id;
- }
-
- public String getUsername() {
- return username;
- }
-
- public void setUsername(String username) {
- this.username = username;
- }
-
- public String getEmail() {
- return email;
- }
-
- public void setEmail(String email) {
- this.email = email;
- }
-
- public UserRole getRole() {
- return role;
- }
-
- public void setRole(UserRole role) {
- this.role = role;
- }
-
- public Set getProjectsOwner() {
- return projectsOwner;
- }
-
- public void setProjectsOwner(Set projectsOwner) {
- this.projectsOwner = projectsOwner;
- }
-
- public Set getProjectsMember() {
- return projectsMember;
- }
-
- public void setProjectsMember(Set projectsMember) {
- this.projectsMember = projectsMember;
- }
-
- @JsonIgnore
- public String getPassword() {
- return password;
- }
-
- @JsonIgnore
- public void setPassword(String password) {
- this.password = password;
- }
-
- public List getWebhooks() {
- return webhooks;
- }
-
- public void setWebhooks(List webhooks) {
- this.webhooks = webhooks;
- }
-
- public void setMaxAllowedProcesses(int maxAllowedProcesses) {
- this.maxAllowedProcesses = maxAllowedProcesses;
- }
-
- public int getMaxAllowedProcesses() {
- return this.maxAllowedProcesses;
- }
-
- @Override
- public boolean equals(Object o) {
- if (this == o) {
- return true;
- }
- if (!(o instanceof User)) {
- return false;
- }
- User user = (User) o;
- return Objects.equals(id, user.getId());
- }
-
- @Override
- public int hashCode() {
- return Objects.hash(id);
- }
-
- @Override
- public String toString() {
- return "User{"
- + "id=" + id
- + ", username='" + username + '\''
- + ", email='" + email + '\''
- + ", role=" + role
- + '}';
- }
-}
diff --git a/backend/src/main/java/de/learnlib/alex/auth/entities/UserRole.java b/backend/src/main/java/de/learnlib/alex/auth/entities/UserRole.java
deleted file mode 100644
index d332de3db..000000000
--- a/backend/src/main/java/de/learnlib/alex/auth/entities/UserRole.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * Copyright 2015 - 2022 TU Dortmund
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package de.learnlib.alex.auth.entities;
-
-/**
- * Enumeration for User roles.
- */
-public enum UserRole {
-
- ANONYMOUS,
-
- /**
- * User is default registered user.
- */
- REGISTERED,
-
- /**
- * User is administrator with higher privileges.
- */
- ADMIN
-}
diff --git a/backend/src/main/java/de/learnlib/alex/auth/events/UserEvent.java b/backend/src/main/java/de/learnlib/alex/auth/events/UserEvent.java
deleted file mode 100644
index 37d00f786..000000000
--- a/backend/src/main/java/de/learnlib/alex/auth/events/UserEvent.java
+++ /dev/null
@@ -1,67 +0,0 @@
-/*
- * Copyright 2015 - 2022 TU Dortmund
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package de.learnlib.alex.auth.events;
-
-import de.learnlib.alex.auth.entities.User;
-import de.learnlib.alex.webhooks.entities.Event;
-import de.learnlib.alex.webhooks.entities.EventType;
-
-/** Events for users. */
-public class UserEvent {
-
- /** Event for when the subscribing user is deleted. */
- public static class Deleted extends Event {
-
- /**
- * Constructor.
- *
- * @param id
- * The id of the user that has been deleted.
- */
- public Deleted(Long id) {
- super(id, EventType.USER_DELETED);
- }
- }
-
- /** Event for when the credentials of the subscribing have changed. */
- public static class CredentialsUpdated extends Event {
-
- /**
- * Constructor.
- *
- * @param id
- * The id of the user whose credentials have changed.
- */
- public CredentialsUpdated(Long id) {
- super(id, EventType.USER_CREDENTIALS_UPDATED);
- }
- }
-
- /** Event for when the role of the subscribing user has changed. */
- public static class RoleUpdated extends Event {
-
- /**
- * Constructor.
- *
- * @param user
- * The user whose role has changed.
- */
- public RoleUpdated(User user) {
- super(user, EventType.USER_ROLE_UPDATED);
- }
- }
-}
diff --git a/backend/src/main/java/de/learnlib/alex/auth/inputs/CreateUserInput.java b/backend/src/main/java/de/learnlib/alex/auth/inputs/CreateUserInput.java
deleted file mode 100644
index fad459b82..000000000
--- a/backend/src/main/java/de/learnlib/alex/auth/inputs/CreateUserInput.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * Copyright 2015 - 2022 TU Dortmund
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package de.learnlib.alex.auth.inputs;
-
-import javax.validation.constraints.Email;
-import javax.validation.constraints.NotEmpty;
-
-public class CreateUserInput {
-
- @NotEmpty
- public String username;
-
- @Email
- @NotEmpty
- public String email;
-
- @NotEmpty
- public String password;
-}
diff --git a/backend/src/main/java/de/learnlib/alex/auth/inputs/LoginInput.java b/backend/src/main/java/de/learnlib/alex/auth/inputs/LoginInput.java
deleted file mode 100644
index b81c36f3b..000000000
--- a/backend/src/main/java/de/learnlib/alex/auth/inputs/LoginInput.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * Copyright 2015 - 2022 TU Dortmund
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package de.learnlib.alex.auth.inputs;
-
-import javax.validation.constraints.NotEmpty;
-
-public class LoginInput {
-
- @NotEmpty
- public String email;
-
- @NotEmpty
- public String password;
-}
diff --git a/backend/src/main/java/de/learnlib/alex/auth/repositories/UserRepository.java b/backend/src/main/java/de/learnlib/alex/auth/repositories/UserRepository.java
deleted file mode 100644
index 30a09a009..000000000
--- a/backend/src/main/java/de/learnlib/alex/auth/repositories/UserRepository.java
+++ /dev/null
@@ -1,67 +0,0 @@
-/*
- * Copyright 2015 - 2022 TU Dortmund
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package de.learnlib.alex.auth.repositories;
-
-import de.learnlib.alex.auth.entities.User;
-import de.learnlib.alex.auth.entities.UserRole;
-import java.util.List;
-import java.util.Optional;
-import org.springframework.data.jpa.repository.JpaRepository;
-import org.springframework.stereotype.Repository;
-
-/**
- * Repository to persist Users.
- */
-@Repository
-public interface UserRepository extends JpaRepository {
-
- /**
- * Find all users by their role.
- *
- * @param role
- * The role to look for.
- * @return All users with that role.
- */
- List findByRole(UserRole role);
-
- /**
- * Find a User by its email.
- *
- * @param email
- * The email to look for.
- * @return The users with that email or null.
- */
- Optional findOneByEmail(String email);
-
- /**
- * Find a User by its username.
- *
- * @param username
- * The username to look for.
- * @return The users with that username or null.
- */
- Optional findOneByUsername(String username);
-
- /**
- * Find multiple users by IDs.
- *
- * @param userIds
- * The IDs of the users to get.
- * @return The matching users.
- */
- List findAllByIdIn(List userIds);
-}
diff --git a/backend/src/main/java/de/learnlib/alex/auth/rest/UserResource.java b/backend/src/main/java/de/learnlib/alex/auth/rest/UserResource.java
deleted file mode 100644
index 70dd35e30..000000000
--- a/backend/src/main/java/de/learnlib/alex/auth/rest/UserResource.java
+++ /dev/null
@@ -1,492 +0,0 @@
-/*
- * Copyright 2015 - 2022 TU Dortmund
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package de.learnlib.alex.auth.rest;
-
-import de.learnlib.alex.auth.dao.UserDAO;
-import de.learnlib.alex.auth.entities.JsonWebToken;
-import de.learnlib.alex.auth.entities.UpdateEmailInput;
-import de.learnlib.alex.auth.entities.UpdateMaxAllowedProcessesInput;
-import de.learnlib.alex.auth.entities.UpdatePasswordInput;
-import de.learnlib.alex.auth.entities.UpdateRoleInput;
-import de.learnlib.alex.auth.entities.UpdateUsernameInput;
-import de.learnlib.alex.auth.entities.User;
-import de.learnlib.alex.auth.entities.UserRole;
-import de.learnlib.alex.auth.events.UserEvent;
-import de.learnlib.alex.auth.inputs.CreateUserInput;
-import de.learnlib.alex.auth.inputs.LoginInput;
-import de.learnlib.alex.common.exceptions.ForbiddenOperationException;
-import de.learnlib.alex.common.exceptions.NotFoundException;
-import de.learnlib.alex.security.AuthContext;
-import de.learnlib.alex.security.JwtHelper;
-import de.learnlib.alex.settings.dao.SettingsDAO;
-import de.learnlib.alex.settings.entities.Settings;
-import de.learnlib.alex.webhooks.services.WebhookService;
-import java.util.ArrayList;
-import java.util.List;
-import javax.validation.ValidationException;
-import javax.ws.rs.core.MediaType;
-import org.apache.shiro.authz.UnauthorizedException;
-import org.hibernate.validator.internal.constraintvalidators.hv.EmailValidator;
-import org.jose4j.lang.JoseException;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.http.HttpStatus;
-import org.springframework.http.ResponseEntity;
-import org.springframework.security.crypto.password.PasswordEncoder;
-import org.springframework.validation.annotation.Validated;
-import org.springframework.web.bind.annotation.DeleteMapping;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.PathVariable;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.PutMapping;
-import org.springframework.web.bind.annotation.RequestBody;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RequestParam;
-import org.springframework.web.bind.annotation.RestController;
-
-/**
- * REST resource to handle users.
- */
-@RestController
-@RequestMapping("/rest/users")
-public class UserResource {
-
- public static final int MAX_USERNAME_LENGTH = 32;
-
- private final AuthContext authContext;
- private final UserDAO userDAO;
- private final WebhookService webhookService;
- private final SettingsDAO settingsDAO;
- private final PasswordEncoder passwordEncoder;
-
- @Autowired
- public UserResource(
- AuthContext authContext,
- UserDAO userDAO,
- WebhookService webhookService,
- SettingsDAO settingsDAO,
- PasswordEncoder passwordEncoder
- ) {
- this.authContext = authContext;
- this.userDAO = userDAO;
- this.webhookService = webhookService;
- this.settingsDAO = settingsDAO;
- this.passwordEncoder = passwordEncoder;
- }
-
- /**
- * Creates a new user.
- *
- * @param input
- * The user to create
- * @return The created user (enhanced with information form the DB); an error message on failure.
- */
- @PostMapping(
- consumes = MediaType.APPLICATION_JSON,
- produces = MediaType.APPLICATION_JSON
- )
- public ResponseEntity create(@RequestBody CreateUserInput input) {
- final User user = authContext.getUser();
-
- if (!new EmailValidator().isValid(input.email, null)) {
- throw new ValidationException("The email is not valid");
- }
-
- if (input.username.length() > MAX_USERNAME_LENGTH || !input.username.matches("^[a-zA-Z][a-zA-Z0-9]*$")) {
- throw new ValidationException("The username is not valid!");
- }
-
- if (usernameIsAlreadyTaken(input.username)) {
- throw new ValidationException("The username is already taken!");
- }
-
- final Settings settings = settingsDAO.get();
-
- final var newUser = new User();
- newUser.setEmail(input.email);
- newUser.setUsername(input.username);
- newUser.setPassword(passwordEncoder.encode(input.password));
- newUser.setRole(UserRole.REGISTERED);
-
- if (user.getId() == null) { // anonymous registration
- if (!settings.isAllowUserRegistration()) {
- throw new ForbiddenOperationException("Public user registration is not allowed.");
- }
- userDAO.create(newUser);
- return ResponseEntity.status(HttpStatus.CREATED).body(newUser);
- } else {
- if (user.getRole().equals(UserRole.REGISTERED)) {
- throw new UnauthorizedException("You are not allowed to create new accounts.");
- } else {
- userDAO.create(newUser);
- return ResponseEntity.status(HttpStatus.CREATED).body(newUser);
- }
- }
- }
-
- /**
- * Get the account information about one user. This only works for your own account or if you are an administrator.
- *
- * @param userId
- * The ID of the user.
- * @return Detailed information about the user.
- */
- @GetMapping(
- value = "/{id}",
- produces = MediaType.APPLICATION_JSON
- )
- public ResponseEntity get(@PathVariable("id") Long userId) {
- final User user = authContext.getUser();
- if (!user.getRole().equals(UserRole.ADMIN) && !user.getId().equals(userId)) {
- throw new ForbiddenOperationException("You are not allowed to get this information.");
- }
-
- final User userById = userDAO.getByID(userId);
- return ResponseEntity.ok(userById);
- }
-
- /**
- * Get the account information about multiple users.
- *
- * @param userIds
- * The ids of the users.
- * @return Detailed information about the users.
- */
- @GetMapping(
- value = "/batch/{ids}",
- produces = MediaType.APPLICATION_JSON
- )
- public ResponseEntity> getManyUsers(@PathVariable("ids") List userIds) {
- final List users = new ArrayList<>();
- for (Long id : userIds) {
- users.add(userDAO.getByID(id));
- }
-
- return ResponseEntity.ok(users);
- }
-
- /**
- * Get all users. This is only allowed for admins.
- *
- * @return A list of all users. This list can be empty.
- */
- @GetMapping(
- produces = MediaType.APPLICATION_JSON
- )
- public ResponseEntity> getAll() {
- final List users = userDAO.getAll();
- return ResponseEntity.ok(users);
- }
-
- @GetMapping(
- value = "/search",
- produces = MediaType.APPLICATION_JSON
- )
- public ResponseEntity> getByUsernameOrEmail(@RequestParam("searchterm") String term) {
- final List users = new ArrayList<>();
- try {
- if (term.contains("@")) {
- users.add(userDAO.getByEmail(term));
- } else {
- users.add(userDAO.getByUsername(term));
- }
- } catch (NotFoundException ignored) {
- }
- return ResponseEntity.ok(users);
- }
-
- @PutMapping(
- value = "/{id}/processes",
- consumes = MediaType.APPLICATION_JSON,
- produces = MediaType.APPLICATION_JSON
- )
- public ResponseEntity changeMaxAllowedProcesses(
- @PathVariable("id") Long userId,
- @Validated @RequestBody UpdateMaxAllowedProcessesInput input
- ) {
- final var user = authContext.getUser();
- final var updatedUser = userDAO.updateMaxAllowedProcesses(user, input);
- return ResponseEntity.ok(updatedUser);
- }
-
-
- /**
- * Changes the password of the user.
- *
- * @param userId
- * The id of the user
- * @param input
- * The pair of oldPassword and newPassword as json
- * @return The updated user.
- */
- @PutMapping(
- value = "/{id}/password",
- consumes = MediaType.APPLICATION_JSON,
- produces = MediaType.APPLICATION_JSON
- )
- public ResponseEntity changePassword(
- @PathVariable("id") Long userId,
- @Validated @RequestBody UpdatePasswordInput input
- ) {
- final var user = authContext.getUser();
- if (!user.getId().equals(userId)) {
- throw new ForbiddenOperationException("You are not allowed to do this.");
- }
-
- final var realUser = userDAO.getByID(userId);
- if (!passwordEncoder.matches(input.getOldPassword(), realUser.getPassword())) {
- throw new ValidationException("Please provide your old password!");
- }
-
- realUser.setPassword(passwordEncoder.encode(input.getNewPassword()));
-
- final var updatedUser = userDAO.update(realUser);
-
- webhookService.fireEvent(user, new UserEvent.CredentialsUpdated(userId));
- return ResponseEntity.ok(updatedUser);
- }
-
- /**
- * Changes the email of the user. This can only be invoked for your own account or if you are an administrator.
- * Please also note: Your new email must not be your current one and no other user should already have this email.
- *
- * @param userId
- * The id of the user
- * @param input
- * The input with the new email.
- * @return The updated user.
- */
- @PutMapping(
- value = "/{id}/email",
- consumes = MediaType.APPLICATION_JSON,
- produces = MediaType.APPLICATION_JSON
- )
- public ResponseEntity changeEmail(
- @PathVariable("id") Long userId,
- @Validated @RequestBody UpdateEmailInput input
- ) {
- final User user = authContext.getUser();
-
- if (!user.getId().equals(userId) && !user.getRole().equals(UserRole.ADMIN)) {
- throw new UnauthorizedException("You are not allowed to do this.");
- }
-
- if (emailIsAlreadyTaken(input.getEmail())) {
- throw new ValidationException("The email is already taken!");
- }
-
- final var realUser = userDAO.getByID(userId);
- realUser.setEmail(input.getEmail());
-
- final var updatedUser = userDAO.update(realUser);
-
- webhookService.fireEvent(user, new UserEvent.CredentialsUpdated(userId));
- return ResponseEntity.ok(updatedUser);
- }
-
- /**
- * Changes the username of the user. This can only be invoked if you are an administrator.
- * Your new username must not be your current one and no other user should already have this username.
- *
- * @param userId
- * The id of the user.
- * @param input
- * The input with a new username.
- * @return The updated user.
- */
- @PutMapping(
- value = "/{id}/username",
- consumes = MediaType.APPLICATION_JSON,
- produces = MediaType.APPLICATION_JSON
- )
- public ResponseEntity changeUsername(
- @PathVariable("id") Long userId,
- @Validated @RequestBody UpdateUsernameInput input
- ) {
- final var user = authContext.getUser();
-
- if (!user.getRole().equals(UserRole.ADMIN)) {
- throw new ForbiddenOperationException("You are not allowed to do this.");
- } else if (usernameIsAlreadyTaken(input.getUsername())) {
- throw new ValidationException("The username is already taken!");
- }
-
- final var userInDB = userDAO.getByID(userId);
- userInDB.setUsername(input.getUsername());
-
- final var updatedUser = userDAO.update(userInDB);
-
- webhookService.fireEvent(user, new UserEvent.CredentialsUpdated(userId));
- return ResponseEntity.ok(updatedUser);
- }
-
- /**
- * Update the role of a user.
- *
- * @param userId
- * The ID of the user to update.
- * @param input
- * The input with the new role.
- * @return The updated user.
- */
- @PutMapping(
- value = "/{id}/role",
- consumes = MediaType.APPLICATION_JSON,
- produces = MediaType.APPLICATION_JSON
- )
- public ResponseEntity changeRole(
- @PathVariable("id") Long userId,
- @Validated @RequestBody UpdateRoleInput input
- ) {
- final User user = authContext.getUser();
- final User userToUpdate = userDAO.getByID(userId);
-
- switch (input.getRole()) {
- case ADMIN:
- userToUpdate.setRole(input.getRole());
- break;
- case REGISTERED:
- // if the admin wants to revoke his own rights
- // -> take care that always one admin is in the system
- if (user.getId().equals(userId)) {
- final List admins = userDAO.getAllByRole(UserRole.ADMIN);
- if (admins.size() == 1) {
- throw new ValidationException("The only admin left cannot take away his own admin rights!");
- }
- }
- userToUpdate.setRole(UserRole.REGISTERED);
- break;
- default:
- throw new ValidationException("Cannot update role.");
- }
-
- final var updatedUser = userDAO.update(userToUpdate);
- webhookService.fireEvent(user, new UserEvent.RoleUpdated(updatedUser));
- return ResponseEntity.ok(updatedUser);
- }
-
- /**
- * Delete an user. This is only allowed for your own account or if you are an administrator.
- *
- * @param userId
- * The ID of the user to delete.
- * @return Nothing if the user was deleted.
- */
- @DeleteMapping(
- value = "/{id}",
- produces = MediaType.APPLICATION_JSON
- )
- public ResponseEntity delete(@PathVariable("id") Long userId) {
- final User user = authContext.getUser();
-
- if (!user.getId().equals(userId) && !user.getRole().equals(UserRole.ADMIN)) {
- throw new ForbiddenOperationException("You are not allowed to delete this user.");
- }
-
- // the event is not fired if we do it after the user is deleted in the next line
- // since all webhooks registered to the user are deleted as well.
- webhookService.fireEvent(new User(userId), new UserEvent.Deleted(userId));
- userDAO.delete(user, userId);
-
- return ResponseEntity.noContent().build();
- }
-
- /**
- * Deletes multiples users. An admin cannot delete himself.
- *
- * @param ids
- * The ids of the user to delete.
- * @return Nothing if the users have been deleted.
- */
- @DeleteMapping(
- value = "/batch/{ids}",
- produces = MediaType.APPLICATION_JSON
- )
- public ResponseEntity delete(@PathVariable("ids") List ids) {
- final User user = authContext.getUser();
-
- if (ids.contains(user.getId())) {
- throw new IllegalArgumentException("You cannot delete your own account this way.");
- }
-
- userDAO.delete(user, ids);
-
- ids.forEach(id -> webhookService.fireEvent(new User(id), new UserEvent.Deleted(id)));
- return ResponseEntity.noContent().build();
- }
-
- /**
- * Logs in a user by generating a unique JWT for him that needs to be send in every request.
- *
- * @param input
- * The user to login
- * @return If the user was successfully logged in: a JSON Object with the authentication token as only field.
- */
- @PostMapping(
- value = "/login",
- consumes = MediaType.APPLICATION_JSON,
- produces = MediaType.APPLICATION_JSON
- )
- public ResponseEntity login(@Validated @RequestBody LoginInput input) {
- try {
- final var user = userDAO.getByEmail(input.email);
-
- if (!passwordEncoder.matches(input.password, user.getPassword())) {
- throw new IllegalArgumentException("Please provide your correct password!");
- }
-
- final var jwt = new JsonWebToken(JwtHelper.generateJWT(user));
-
- return ResponseEntity.ok(jwt);
- } catch (JoseException e) {
- throw new UnauthorizedException();
- }
- }
-
- /**
- * Get the current logged in user.
- *
- * @return The user.
- */
- @GetMapping(
- value = "/myself",
- produces = MediaType.APPLICATION_JSON
- )
- public ResponseEntity myself() {
- final User user = authContext.getUser();
-
- final User myself = userDAO.getByID(user.getId());
- return ResponseEntity.ok(myself);
- }
-
- private boolean usernameIsAlreadyTaken(String username) {
- try {
- userDAO.getByUsername(username);
- return true;
- } catch (NotFoundException e) {
- return false;
- }
- }
-
- private boolean emailIsAlreadyTaken(String email) {
- try {
- userDAO.getByEmail(email);
- return true;
- } catch (NotFoundException e) {
- return false;
- }
- }
-}
diff --git a/backend/src/main/java/de/learnlib/alex/common/Constants.java b/backend/src/main/java/de/learnlib/alex/common/Constants.java
deleted file mode 100644
index f91c21e84..000000000
--- a/backend/src/main/java/de/learnlib/alex/common/Constants.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * Copyright 2015 - 2022 TU Dortmund
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package de.learnlib.alex.common;
-
-import java.time.format.DateTimeFormatter;
-
-public class Constants {
-
- public static final DateTimeFormatter DATE_TIME_FORMATTER = DateTimeFormatter.ofPattern("yyyy-MM-dd'T'HH:mm:ss.SSSxxx");
-
- private Constants() {
- throw new UnsupportedOperationException("The class cannot be instantiated.");
- }
-}
diff --git a/backend/src/main/java/de/learnlib/alex/common/exceptions/EntityLockedException.java b/backend/src/main/java/de/learnlib/alex/common/exceptions/EntityLockedException.java
deleted file mode 100644
index 83eefeacd..000000000
--- a/backend/src/main/java/de/learnlib/alex/common/exceptions/EntityLockedException.java
+++ /dev/null
@@ -1,24 +0,0 @@
-/*
- * Copyright 2015 - 2022 TU Dortmund
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package de.learnlib.alex.common.exceptions;
-
-public class EntityLockedException extends RuntimeException {
-
- public EntityLockedException(String s) {
- super(s);
- }
-}
diff --git a/backend/src/main/java/de/learnlib/alex/common/exceptions/ForbiddenOperationException.java b/backend/src/main/java/de/learnlib/alex/common/exceptions/ForbiddenOperationException.java
deleted file mode 100644
index 61cf5e749..000000000
--- a/backend/src/main/java/de/learnlib/alex/common/exceptions/ForbiddenOperationException.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- * Copyright 2015 - 2022 TU Dortmund
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package de.learnlib.alex.common.exceptions;
-
-public class ForbiddenOperationException extends RuntimeException {
-
- public ForbiddenOperationException() {
- }
-
- public ForbiddenOperationException(String message) {
- super(message);
- }
-
- public ForbiddenOperationException(String message, Throwable cause) {
- super(message, cause);
- }
-}
diff --git a/backend/src/main/java/de/learnlib/alex/common/exceptions/LearnerInterruptedException.java b/backend/src/main/java/de/learnlib/alex/common/exceptions/LearnerInterruptedException.java
deleted file mode 100644
index 598a00e91..000000000
--- a/backend/src/main/java/de/learnlib/alex/common/exceptions/LearnerInterruptedException.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- * Copyright 2015 - 2022 TU Dortmund
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package de.learnlib.alex.common.exceptions;
-
-/** Exception that is thrown if the user interrupts a learning process. */
-public class LearnerInterruptedException extends RuntimeException {
-
- /**
- * Constructor.
- *
- * @param s
- * The message.
- */
- public LearnerInterruptedException(String s) {
- super(s);
- }
-}
diff --git a/backend/src/main/java/de/learnlib/alex/common/exceptions/NotFoundException.java b/backend/src/main/java/de/learnlib/alex/common/exceptions/NotFoundException.java
deleted file mode 100644
index f7a9216b4..000000000
--- a/backend/src/main/java/de/learnlib/alex/common/exceptions/NotFoundException.java
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
- * Copyright 2015 - 2022 TU Dortmund
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package de.learnlib.alex.common.exceptions;
-
-/**
- * An alternative to the default NotFoundException.
- */
-public class NotFoundException extends RuntimeException {
-
- /** Constructor. */
- public NotFoundException() {
- }
-
- /**
- * Constructor.
- *
- * @param message
- * The message of the exception.
- */
- public NotFoundException(String message) {
- super(message);
- }
-
- /**
- * Constructor.
- *
- * @param message
- * The message of the exception.
- * @param cause
- * The cause of the exception.
- */
- public NotFoundException(String message, Throwable cause) {
- super(message, cause);
- }
-}
diff --git a/backend/src/main/java/de/learnlib/alex/common/exceptions/ResourcesExhaustedException.java b/backend/src/main/java/de/learnlib/alex/common/exceptions/ResourcesExhaustedException.java
deleted file mode 100644
index 57a6ce425..000000000
--- a/backend/src/main/java/de/learnlib/alex/common/exceptions/ResourcesExhaustedException.java
+++ /dev/null
@@ -1,24 +0,0 @@
-/*
- * Copyright 2015 - 2020 TU Dortmund
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package de.learnlib.alex.common.exceptions;
-
-public class ResourcesExhaustedException extends RuntimeException {
-
- public ResourcesExhaustedException(String s) {
- super(s);
- }
-}
diff --git a/backend/src/main/java/de/learnlib/alex/common/exceptions/RestException.java b/backend/src/main/java/de/learnlib/alex/common/exceptions/RestException.java
deleted file mode 100644
index 3692c7bcc..000000000
--- a/backend/src/main/java/de/learnlib/alex/common/exceptions/RestException.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * Copyright 2015 - 2022 TU Dortmund
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package de.learnlib.alex.common.exceptions;
-
-import org.springframework.http.HttpStatus;
-
-public class RestException extends RuntimeException {
-
- private HttpStatus status;
-
- public RestException(HttpStatus status, String message) {
- super(message);
- this.status = status;
- }
-
- public HttpStatus getStatus() {
- return status;
- }
-}
diff --git a/backend/src/main/java/de/learnlib/alex/common/exceptions/RestExceptionHandler.java b/backend/src/main/java/de/learnlib/alex/common/exceptions/RestExceptionHandler.java
deleted file mode 100644
index d443a76e4..000000000
--- a/backend/src/main/java/de/learnlib/alex/common/exceptions/RestExceptionHandler.java
+++ /dev/null
@@ -1,151 +0,0 @@
-/*
- * Copyright 2015 - 2022 TU Dortmund
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package de.learnlib.alex.common.exceptions;
-
-import de.learnlib.alex.common.utils.RestError;
-import de.learnlib.alex.learning.exceptions.LearnerException;
-import java.util.List;
-import java.util.stream.Collectors;
-import javax.persistence.EntityNotFoundException;
-import javax.validation.ConstraintViolationException;
-import javax.validation.ValidationException;
-import javax.ws.rs.InternalServerErrorException;
-import org.apache.shiro.authz.UnauthorizedException;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.springframework.core.NestedExceptionUtils;
-import org.springframework.core.annotation.Order;
-import org.springframework.dao.DataIntegrityViolationException;
-import org.springframework.http.HttpStatus;
-import org.springframework.http.ResponseEntity;
-import org.springframework.transaction.TransactionSystemException;
-import org.springframework.web.bind.annotation.ControllerAdvice;
-import org.springframework.web.bind.annotation.ExceptionHandler;
-import org.springframework.web.servlet.mvc.method.annotation.ResponseEntityExceptionHandler;
-
-/**
- * ExceptionMapper that will catch all {@link DataIntegrityViolationException}s thrown by the REST resources.
- */
-@Order
-@ControllerAdvice
-public class RestExceptionHandler extends ResponseEntityExceptionHandler {
-
- private static final Logger logger = LoggerFactory.getLogger(RestExceptionHandler.class);
-
- @ExceptionHandler(DataIntegrityViolationException.class)
- protected ResponseEntity