diff --git a/.circleci/config.yml b/.circleci/config.yml
index a0658a7878e..31e8987335e 100644
--- a/.circleci/config.yml
+++ b/.circleci/config.yml
@@ -43,8 +43,7 @@ jobs:
export FRONTEND_ORG=$(grep 'frontend\.groupId' pom.xml | sed 's///g' | sed 's|||' | tr -d '[:blank:]' | cut -d. -f3) && \
git clone https://github.com/$FRONTEND_ORG/cbioportal-frontend.git && \
cd cbioportal-frontend && \
- git fetch --tags && \
- git checkout demo-rfc72
+ git fetch --tags
- persist_to_workspace:
root: /tmp/repos
paths:
diff --git a/.github/workflows/integration-test.yml b/.github/workflows/integration-test.yml
index eb1ddd60dee..3accb07566c 100644
--- a/.github/workflows/integration-test.yml
+++ b/.github/workflows/integration-test.yml
@@ -10,15 +10,9 @@ jobs:
PORTAL_INFO_DIR: /home/runner/work/cbioportal/cbioportal/portalInfo
steps:
- name: 'Checkout cbioportal repo'
- uses: actions/checkout@v2
+ uses: actions/checkout@v4
with:
path: ./cbioportal
- - name: 'Install python requirements'
- working-directory: ./cbioportal
- run: |
- sudo apt-get install python3-setuptools && \
- pip3 install -U wheel && \
- pip3 install -r ./requirements.txt
- name: 'Set up JDK 21'
uses: oracle-actions/setup-java@v1
with:
@@ -52,11 +46,7 @@ jobs:
sed 's|spring.datasource.url=.*|spring.datasource.url=jdbc:mysql://cbioportal-database:3306/cbioportal?useSSL=false|' | \
sed 's|spring.datasource.username=.*|spring.datasource.username=cbio_user|' | \
sed 's|spring.datasource.password=.*|spring.datasource.password=somepassword|' \
- > application.properties && \
- echo "db.user=cbio_user" >> application.properties && \
- echo "db.password=somepassword" >> application.properties && \
- echo "db.connection_string=jdbc:mysql://cbioportal-database:3306/cbioportal?useSSL=false" >> application.properties && \
- echo "db.driver=com.mysql.jdbc.Driver" >> application.properties
+ > application.properties
- name: 'Copy cgds.sql file into Docker Compose'
run: cp ./cbioportal/src/main/resources/db-scripts/cgds.sql ./cbioportal-docker-compose/data/.
- name: 'Dump Properties'
@@ -65,7 +55,7 @@ jobs:
- name: 'Start cbioportal-docker-compose'
working-directory: ./cbioportal-docker-compose
run: |
- export DOCKER_IMAGE_CBIOPORTAL=cbioportal/cbioportal:demo-rfc72-squash && docker-compose -f docker-compose.yml -f $PORTAL_SOURCE_DIR/test/integration/docker-compose-localbuild.yml up -d
+ docker-compose -f docker-compose.yml -f $PORTAL_SOURCE_DIR/test/integration/docker-compose-localbuild.yml up -d
- name: 'Wait for cbioportal to initialize ...'
id: startup
uses: nev7n/wait_for_response@v1
diff --git a/.github/workflows/security-integration-test.yml b/.github/workflows/security-integration-test.yml
new file mode 100644
index 00000000000..5fd20693a50
--- /dev/null
+++ b/.github/workflows/security-integration-test.yml
@@ -0,0 +1,36 @@
+name: Security integration tests
+on: [push, pull_request]
+jobs:
+ build:
+ name: Security integration tests
+ runs-on: ubuntu-latest
+ env:
+ PORTAL_SOURCE_DIR: /home/runner/work/cbioportal/cbioportal/cbioportal
+ PORTAL_COMPOSE_DIR: /home/runner/work/cbioportal/cbioportal/cbioportal-docker-compose
+ PORTAL_INFO_DIR: /home/runner/work/cbioportal/cbioportal/portalInfo
+ steps:
+ - name: 'Checkout cbioportal repo'
+ uses: actions/checkout@v2
+ with:
+ path: ./cbioportal
+ - name: 'Set up JDK 21'
+ uses: oracle-actions/setup-java@v1
+ with:
+ website: oracle.com
+ release: 21
+ - name: 'Cache Maven packages'
+ uses: actions/cache@v1
+ with:
+ path: ~/.m2
+ key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
+ restore-keys: ${{ runner.os }}-m2
+ - name: 'Download Chrome'
+ uses: browser-actions/setup-chrome@latest
+ - name: 'Copy Application.Properties'
+ working-directory: ./cbioportal
+ run: |
+ cp src/main/resources/application.properties.EXAMPLE src/main/resources/application.properties
+ - name: 'Run integration tests'
+ working-directory: ./cbioportal
+ run: |
+ mvn verify -Pintegration-test
diff --git a/.github/workflows/sonarcloud.yml b/.github/workflows/sonarcloud.yml
index bc6dc12004f..a87c052d155 100644
--- a/.github/workflows/sonarcloud.yml
+++ b/.github/workflows/sonarcloud.yml
@@ -34,6 +34,17 @@ jobs:
cp src/main/resources/application.properties.EXAMPLE src/main/resources/application.properties
- name: Build and analyze
env:
- SONAR_TOKEN: de1b5cc660cd210dde840f492c371da6cc801763
+ SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- run: mvn -DskipTests clean install verify org.sonarsource.scanner.maven:sonar-maven-plugin:sonar
+ run: mvn clean install verify org.sonarsource.scanner.maven:sonar-maven-plugin:sonar
+ - name: 'Add host.testcontainers.internal to /etc/hosts'
+ run: |
+ echo "127.0.0.1 host.testcontainers.internal" | sudo tee -a /etc/hosts
+ - name: 'Run integration tests'
+ run: |
+ mvn verify -Pintegration-test
+ - name: Code Coverage
+ env:
+ SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+ run: mvn sonar:sonar -Pcoverage
diff --git a/.github/workflows/validate-data.yml b/.github/workflows/validate-data.yml
deleted file mode 100644
index 80fc0e1818f..00000000000
--- a/.github/workflows/validate-data.yml
+++ /dev/null
@@ -1,27 +0,0 @@
-name: Python validator
-on: [push, pull_request]
-jobs:
- build:
- name: Validate Data
- runs-on: ubuntu-latest
- steps:
- - name: 'Checkout cbioportal repo'
- uses: actions/checkout@v2
- with:
- path: ./cbioportal
- - name: 'Checkout core module'
- uses: actions/checkout@v4
- with:
- path: ./cbioportal/core
- repository: cBioPortal/cbioportal-core
- - name: 'Validate tests'
- working-directory: ./cbioportal
- run: |
- docker run -v ${PWD}:/cbioportal python:3.6 /bin/sh -c '
- cd /cbioportal &&
- pip install -r requirements.txt &&
- export PYTHONPATH=/cbioportal/core/src/main/resources/scripts &&
- cd /cbioportal/core/src/test/scripts/ &&
- python unit_tests_validate_data.py &&
- python system_tests_validate_data.py &&
- python system_tests_validate_studies.py'
\ No newline at end of file
diff --git a/.gitignore b/.gitignore
index 4dda110d9ac..c2b81971328 100644
--- a/.gitignore
+++ b/.gitignore
@@ -73,7 +73,7 @@ portal/src/main/webapp/WEB-INF/logback.xml
!src/main/resource/*.EXAMPLE
firehose-importer/reference_data/gene_info
portal.properties
-application.properties
+src/main/resources/application.properties
importer.properties
log4j.properties
build.properties
@@ -103,7 +103,6 @@ package.json
*.tramp_history
pom.version.*
pom.xml.*
-pom.xml.*
Dockerfile.local
.factorypath
.retype
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index eb6807413ce..9d7f9299368 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -146,9 +146,8 @@ New features:
### Devops
New features:
-- Does the configuration style follow the config guidelines? That is compile
- (Maven) config goes in the appriopriate `pom.xml` (root, `scripts/`, `portal/`, `core/`).
- Runtime (Spring) goes in `portal.properties`. Default values should be in `GlobalProperties.java`.
+- Does the configuration style follow the config guidelines? That is compile.
+- Runtime (Spring) goes in `application.properties`. Default values should be in `GlobalProperties.java`.
- Non-stable configuration should be done through war overlays.
- Is the configuration tested as part of the CI tests? It's not a necessity but be
aware that untested configuration will be tough to maintain.
diff --git a/README.md b/README.md
index afdcf952879..b9ff0081131 100644
--- a/README.md
+++ b/README.md
@@ -26,11 +26,9 @@ If you want to run the cBioPortal web app from the command line please follow th
docker compose -f docker-compose.yml -f open-ports.yml up
```
This should open the ports. Now we are ready to run the cBioPortal web app locally. You can compile the backend code with:
+
```
-export JAVA_HOME=/Library/Java/JavaVirtualMachines/temurin-11.jdk/Contents/Home/ && mvn -DskipTests clean install
-```
-Note: change `JAVA_HOME` to point to a JDK 11 version. If everything compiles correctly you can then run the app like this:
-```
+
java -Xms2g -Xmx4g \
-Dauthenticate=noauthsessionservice \
-Dsession.service.url=http://localhost:5000/api/sessions/my_portal/ \
@@ -47,6 +45,7 @@ java -Xms2g -Xmx4g \
-cp "$PWD:$PWD/BOOT-INF/lib/*" \
org.cbioportal.PortalApplication
```
+
The app should now show up at http://localhost:8080.
#### Deploy your development image inside Docker Compose
@@ -86,6 +85,7 @@ You can then use a JAVA IDE to connect to that port. E.g. in [VSCode](https://co
```
## 🌳 Branch Information
+
| | main branch | upcoming release branch | later release candidate branch |
| --- | --- | --- | --- |
| Branch name | [`master`](https://github.com/cBioPortal/cbioportal/tree/master) | -- | [`rc`](https://github.com/cBioPortal/cbioportal/tree/rc) |
diff --git a/SECURITY.md b/SECURITY.md
new file mode 100644
index 00000000000..2fa4168533b
--- /dev/null
+++ b/SECURITY.md
@@ -0,0 +1,26 @@
+# Security Policy
+
+## Supported Versions
+
+We release security releases for the following versions:
+
+| Version | Supported |
+| ------- | ------------------ |
+| 6.x | :white_check_mark: |
+| 5.x | :white_check_mark: |
+| < 5.0 | :x: |
+
+## Reporting a Vulnerability
+If there are any vulnerabilities, don't hesitate to report them.
+
+Use the private contact address cbioportal@cbioportal.org to report the fix.
+
+Describe the vulnerability.
+
+If you have a fix, that is most welcome -- please attach or summarize it in your message!
+
+We will evaluate the vulnerability and, if necessary, release a fix or mitigating steps to address it. We will contact you to let you know the outcome, and will credit you in the report.
+
+Please do not disclose the vulnerability publicly until a fix is released!
+
+Once we have either a) published a fix, or b) declined to address the vulnerability for whatever reason, you are free to publicly disclose it.
diff --git a/dev/.env b/dev/.env
new file mode 100644
index 00000000000..697e7299524
--- /dev/null
+++ b/dev/.env
@@ -0,0 +1,4 @@
+DOCKER_IMAGE_SESSION_SERVICE=cbioportal/session-service:0.6.1
+DOCKER_IMAGE_MYSQL=mysql:8.1.0
+DOCKER_IMAGE_KEYCLOAK=quay.io/keycloak/keycloak:23.0
+DOCKER_IMAGE_MONGODB=mongo:4.2
\ No newline at end of file
diff --git a/dev/README.md b/dev/README.md
new file mode 100644
index 00000000000..c23cce72e2e
--- /dev/null
+++ b/dev/README.md
@@ -0,0 +1,58 @@
+# Tools for development
+
+In this folder is some additional configuration that can be useful for local development. None of this should be deployed directly to production
+
+# Set up keycloak for cBioPortal >v6
+
+Requirements:
+- System runs docker (including docker compose)
+
+ 1. Run from the root of the repository:
+
+```
+cd dev
+docker compose up -d
+```
+
+2. (Option 1) Apply SAML2 configuration to _security.properties_ in cBioPortal:
+
+```properties
+authenticate=saml
+spring.security.saml2.relyingparty.registration.keycloak.assertingparty.metadata-uri=http://localhost:8084/realms/cbio/protocol/saml/descriptor
+spring.security.saml2.relyingparty.registration.keycloak.assertingparty.entity-id=http://localhost:8084/realms/cbio
+spring.security.saml2.relyingparty.registration.keycloak.entity-id=cbioportal
+spring.security.saml2.relyingparty.registration.keycloak.signing.credentials[0].certificate-location=classpath:/dev/security/signing-cert.pem
+spring.security.saml2.relyingparty.registration.keycloak.signing.credentials[0].private-key-location=classpath:/dev/security/signing-key.pem
+```
+
+3. (Option 2) Apply OIDC configuration to _security.properties_ in cBioPortal:
+
+```properties
+authenticate=oauth2
+spring.security.oauth2.client.registration.keycloak.redirect-uri=http://localhost:8080/login/oauth2/code/keycloak
+spring.security.oauth2.client.registration.keycloak.client-name=cbioportal_oauth2
+spring.security.oauth2.client.registration.keycloak.client-id=cbioportal_oauth2
+spring.security.oauth2.client.registration.keycloak.client-secret=client_secret
+spring.security.oauth2.client.registration.keycloak.authorization-grant-type=authorization_code
+spring.security.oauth2.client.registration.keycloak.client-authentication-method=client_secret_post
+spring.security.oauth2.client.registration.keycloak.scope=openid,email,roles
+spring.security.oauth2.client.provider.keycloak.issuer-uri=http://localhost:8084/realms/cbio
+spring.security.oauth2.client.provider.keycloak.user-name-attribute=email
+```
+
+4. Set the following in _application.properties_:
+
+```properties
+persistence.cache_type=no-cache
+session.service.url=http://localhost:5000/api/sessions/my_portal/
+
+spring.datasource.url=jdbc:mysql://localhost:3306/cbioportal?useSSL=false&allowPublicKeyRetrieval=true
+spring.datasource.username=cbio_user
+spring.datasource.password=somepassword
+spring.jpa.database-platform=org.hibernate.dialect.MySQL5InnoDBDialect
+spring.datasource.driver-class-name=com.mysql.jdbc.Driver
+```
+
+4. Start cBioPortal application on port 8080. The login credentials are `testuser:P@assword1`.
+
+⚠️ Warning: Do not use this directly for production use as it takes several shortcuts to get a quick keycloak instance up.
diff --git a/dev/docker-compose.yml b/dev/docker-compose.yml
new file mode 100644
index 00000000000..3a4d72b47b6
--- /dev/null
+++ b/dev/docker-compose.yml
@@ -0,0 +1,57 @@
+version: '3'
+
+services:
+ cbioportal-database:
+ restart: unless-stopped
+ image: ${DOCKER_IMAGE_MYSQL}
+ container_name: cbioportal-database
+ environment:
+ MYSQL_DATABASE: cbioportal
+ MYSQL_USER: cbio_user
+ MYSQL_PASSWORD: somepassword
+ MYSQL_ROOT_PASSWORD: somepassword
+ volumes:
+ - $PWD/../src/main/resources/db-scripts/cgds.sql:/docker-entrypoint-initdb.d/cgds.sql:ro
+ - $PWD/../src/test/resources/seed_mini.sql:/docker-entrypoint-initdb.d/seed.sql:ro
+ ports:
+ - 3306:3306
+ cbioportal-session:
+ restart: unless-stopped
+ image: ${DOCKER_IMAGE_SESSION_SERVICE}
+ container_name: cbioportal-session
+ environment:
+ SERVER_PORT: 5000
+ JAVA_OPTS: -Dspring.data.mongodb.uri=mongodb://cbioportal-session-database:27017/session-service
+ depends_on:
+ - cbioportal-session-database
+ ports:
+ - 5000:5000
+ networks:
+ - cbio-net
+ cbioportal-session-database:
+ restart: unless-stopped
+ image: ${DOCKER_IMAGE_MONGODB}
+ container_name: cbioportal-session-database
+ environment:
+ MONGO_INITDB_DATABASE: session-service
+ networks:
+ - cbio-net
+ keycloak:
+ restart: unless-stopped
+ container_name: keycloak
+ image: ${DOCKER_IMAGE_KEYCLOAK}
+ volumes:
+ - $PWD/../src/main/resources/dev/security/keycloak-configuration-generated.json:/opt/keycloak/data/import/realm.json:ro
+ environment:
+ - KC_HOSTNAME=localhost
+ - KC_DB_USERNAME=keycloak
+ - KC_DB_PASSWORD=password
+ - KC_DB_DATABASE=keycloak
+ - KEYCLOAK_ADMIN=admin
+ - KEYCLOAK_ADMIN_PASSWORD=admin
+ ports:
+ - 8084:8080
+ command: start-dev --import-realm
+
+networks:
+ cbio-net:
\ No newline at end of file
diff --git a/docker/web-and-data/Dockerfile b/docker/web-and-data/Dockerfile
index 5252f98b4d9..b1021c6db08 100644
--- a/docker/web-and-data/Dockerfile
+++ b/docker/web-and-data/Dockerfile
@@ -45,15 +45,14 @@ RUN apt-get update; apt-get install -y --no-install-recommends \
RUN mkdir -p /cbioportal
#Download core files
-RUN wget https://github.com/cBioPortal/cbioportal-core/releases/download/1.0.4/core-1.0.4.jar -P core/ ; cd core ; jar -xf core-1.0.4.jar scripts/ ; chmod -R a+x scripts/ ; cd ..;
+RUN wget https://github.com/cBioPortal/cbioportal-core/releases/download/1.0.6/core-1.0.6.jar -P core/ ; cd core ; jar -xf core-1.0.6.jar scripts/ requirements.txt ; chmod -R a+x scripts/ ; cd ..;
COPY --from=build /cbioportal/src/main/resources/db-scripts /cbioportal/db-scripts
-COPY --from=build /cbioportal/requirements.txt /cbioportal/requirements.txt
# install build and runtime dependencies
# ignore update failure980[1298[01 w2308s
-RUN pip3 install -r /cbioportal/requirements.txt
+RUN pip3 install -r /core/requirements.txt
# add importer scripts to PATH for easy running in containers
RUN find /core/scripts/ -type f -executable \! -name '*.pl' -print0 | xargs -0 -- ln -st /usr/local/bin
@@ -75,4 +74,4 @@ COPY --from=build ${DEPENDENCY}/BOOT-INF/classes $PORTAL_WEB_HOME/
# add entrypoint
COPY --from=build /cbioportal/docker/web-and-data/docker-entrypoint.sh /usr/local/bin/
ENTRYPOINT ["docker-entrypoint.sh"]
-CMD ["sh", "-c", "java $(echo $JAVA_OPTS) -cp /cbioportal-webapp:/cbioportal-webapp/lib/* org.cbioportal.PortalApplication $(echo $WEBAPP_OPTS)"]
\ No newline at end of file
+CMD ["sh", "-c", "java $(echo $JAVA_OPTS) -cp /cbioportal-webapp:/cbioportal-webapp/lib/* org.cbioportal.PortalApplication $(echo $WEBAPP_OPTS)"]
diff --git a/docker/web-and-data/docker-entrypoint.sh b/docker/web-and-data/docker-entrypoint.sh
index 5c78c46ac53..a0cd507d5b7 100755
--- a/docker/web-and-data/docker-entrypoint.sh
+++ b/docker/web-and-data/docker-entrypoint.sh
@@ -14,7 +14,7 @@ _is_sourced() {
}
parse_db_params_from_command_line() {
- echo $@ | sed 's/-D/\n-D/g' | grep -- '-Ddb' | sed 's/-D//g' | grep db.
+ echo $@ | sed 's/-D/\n-D/g' | grep -- '-Dspring' | sed 's/-D//g' | grep db.
}
parse_db_params_from_config_and_command_line() {
@@ -23,7 +23,7 @@ parse_db_params_from_config_and_command_line() {
else
PROPERTIES_FILE=$BAKED_IN_WAR_CONFIG_FILE
fi
- for param in db.host db.user db.portal_db_name db.password db.connection_string; do
+ for param in db.host spring.datasource.username db.portal_db_name spring.datasource.password spring.datasource.url; do
if $(parse_db_params_from_command_line $@ | grep -q $param); then
prop=$(parse_db_params_from_command_line $@ | grep "^$param" || [[ $? == 1 ]])
else
@@ -32,8 +32,12 @@ parse_db_params_from_config_and_command_line() {
if [[ -n "$prop" ]]
then
# Replace dot in parameter name with underscore.
- prop=$(sed "s/^db\./db_/" <<< $prop)
- if [[ $param == db.connection_string ]]
+ #prop=$(sed "s/\([^=]*\)\./\1_/g" <<< "$prop")
+ before_equal_sign="${prop%%=*}"
+ after_equal_sign="${prop#*=}"
+ updated_before_equal_sign="${before_equal_sign//./_}"
+ prop="${updated_before_equal_sign}=${after_equal_sign}"
+ if [[ $param == spring.datasource.url ]]
then
# Remove the parameters (?...) from the connection URL.
echo $(sed -r "s/^([^=]+)=([^\?]+).*/\1=\2/" <<< $prop)
@@ -64,7 +68,7 @@ check_db_connection() {
echo "----------------------------------------------------------------------------------------------------------------"
echo "-- Connection error:"
echo "-- You try to connect to the database using the deprecated 'db.host', 'db.portal_db_name' and 'db.use_ssl' properties."
- echo "-- Please remove these properties and use the 'db.connection_string' property instead. See https://docs.cbioportal.org/deployment/customization/portal.properties-reference/"
+ echo "-- Please remove these properties and use the 'db.connection_string' property instead. See https://docs.cbioportal.org/deployment/customization/application.properties-reference/"
echo "-- for assistance on building a valid connection string."
echo "------------------------------------------------------------f---------------------------------------------------"
exit 1
@@ -74,6 +78,11 @@ check_db_connection() {
then
eval "$(parse_connection_string $db_connection_string)"
fi
+
+ if [[ -n $spring_datasource_url ]]
+ then
+ eval "$(parse_connection_string $spring_datasource_url)"
+ fi
if [ -z ${db_port+x} ] # is $db_port unset?
then
@@ -84,11 +93,11 @@ check_db_connection() {
fi
fi
- while ! mysqladmin ping -s -h$(echo ${db_host} | cut -d: -f1) -P${db_port} -u${db_user} -p${db_password};
+ while ! mysqladmin ping -s -h$(echo ${db_host} | cut -d: -f1) -P${db_port} -u${spring_datasource_username} -p${spring_datasource_password};
do
sleep 5s;
if [ -n "$SHOW_DEBUG_INFO" ] && [ "$SHOW_DEBUG_INFO" != "false" ]; then
- echo mysqladmin ping -s -h$(echo ${db_host} | cut -d: -f1) -P${db_port} -u${db_user} -p${db_password}
+ echo mysqladmin ping -s -h$(echo ${db_host} | cut -d: -f1) -P${db_port} -u${spring_datasource_username} -p${spring_datasource_password}
fi
echo "Database not available yet (first time can take a few minutes to load seed database)... Attempting reconnect..."
done
@@ -102,7 +111,7 @@ migrate_db() {
if [[ -f $CUSTOM_PROPERTIES_FILE ]]; then
python3 /core/scripts/migrate_db.py -y -p $CUSTOM_PROPERTIES_FILE -s /cbioportal/db-scripts/migration.sql
else
- python3 /core/migrate_db.py -y -p <(parse_db_params_from_config_and_command_line $POTENTIAL_DB_PARAMS) -s /cbioportal/db-scripts/migration.sql
+ python3 /core/scripts/migrate_db.py -y -p <(parse_db_params_from_config_and_command_line $POTENTIAL_DB_PARAMS) -s /cbioportal/db-scripts/migration.sql
fi
}
@@ -128,7 +137,7 @@ _main() {
echo "Running Migrate DB Script"
# Custom logic to handle the case when "org.cbioportal.PortalApplication" is present
# Parse database config. Use command line parameters (e.g. -Ddb.host) if
- # available, otherwise use portal.properties
+ # available, otherwise use application.properties
if [ -n "$SHOW_DEBUG_INFO" ] && [ "$SHOW_DEBUG_INFO" != "false" ]; then
echo "Using database config:"
parse_db_params_from_config_and_command_line $@
diff --git a/docs/404.md b/docs/404.md
index 254789fc310..2179e87d107 100644
--- a/docs/404.md
+++ b/docs/404.md
@@ -32,7 +32,8 @@ window.redirectMap = {
"2.2-authorization-and-authentication/authenticating-and-authorizing-users-via-keycloak":"deployment/authorization-and-authentication/authenticating-and-authorizing-users-via-keycloak",
"2.2-authorization-and-authentication/authenticating-users-via-tokens":"deployment/authorization-and-authentication/authenticating-users-via-tokens",
"2.3-customization/customizing-your-instance-of-cbioportal":"deployment/customization/customizing-your-instance-of-cbioportal",
- "2.3-customization/portal.properties-reference":"deployment/customization/portal.properties-reference",
+ "2.3-customization/portal.properties-reference":"deployment/customization/application.properties-reference/",
+ "deployment/customization/portal.properties-reference":"deployment/customization/application.properties-reference/",
"2.3-customization/caching":"deployment/customization/caching",
"2.3-customization/layout":"deployment/customization/studyview/#how-does-the-study-view-organize-the-charts",
"2.3-customization/priority":"deployment/customization/studyview/#study-view-customization-with-priority-data",
diff --git a/docs/Architecture-Overview.md b/docs/Architecture-Overview.md
index fa6d01c2f2f..8f54bc36ddd 100644
--- a/docs/Architecture-Overview.md
+++ b/docs/Architecture-Overview.md
@@ -74,7 +74,7 @@ relevance of variants (or biomarker alterations) in cancer. For information on
how to deploy this service yourself see:
https://github.com/griffithlab/civic-server. It is also possible to disable
showing CIVIC in cBioPortal by setting `show.civic=false` in the
-`portal.properties` (See [portal.properties reference](/deployment/customization/portal.properties-Reference.md#civic-integration)).
+`application.properties` (See [application.properties reference](/deployment/customization/application.properties-Reference.md#civic-integration)).
### Genome Nexus
[Genome Nexus](https://www.genomenexus.org) is a comprehensive one-stop
diff --git a/docs/File-Formats.md b/docs/File-Formats.md
index 797ed1b0505..0c7c1d7eb84 100644
--- a/docs/File-Formats.md
+++ b/docs/File-Formats.md
@@ -47,7 +47,7 @@ This file contains metadata about the cancer study. The file contains the follow
7. **groups (Optional)**: When using an authenticating cBioPortal, lists the user-groups that are allowed access to this study. Multiple groups are separated with a semicolon ";". The study will be invisible to users not in _at least one_ of the listed groups, as if it wasn't loaded at all. e.g., "PUBLIC;GDAC;SU2C-PI3K". see [User-Authorization](/deployment/authorization-and-authentication/User-Authorization.md) for more information on groups
8. **add_global_case_list (Optional)**: set to 'true' if you would like the "All samples" case list to be generated automatically for you. See also [Case lists](#case-lists).
9. **tags_file (Optional)**: the file name containing custom study tags for the [study tags](#study-tags-file).
-10. **reference_genome (Optional)**: the study reference genome (e.g. `hg19`, `hg38`). Without specifying this property, the study will be assigned to the reference genome specified in `portal.properties` (property `ucsc.build`).
+10. **reference_genome (Optional)**: the study reference genome (e.g. `hg19`, `hg38`). Without specifying this property, the study will be assigned to the reference genome specified in `application.properties` (property `ucsc.build`).
### Example
An example meta_study.txt file would be:
@@ -403,7 +403,7 @@ All genes referenced in the custom driver annotation file must be present in the
The `cbp_driver` column flags the mutation as either driver or passenger. In cBioPortal, passenger mutations are also known as variants of unknown significance (VUS). The `cbp_driver_tiers` column assigns an annotation tier to the mutation, such as "Driver", "Highly actionable" or "Potential drug target". When a tier is selected, mutations with that annotation are highlighted as driver. Both types of custom annotations contain a second column with the suffix `_annotation`, to add a description. This is displayed in the tooltip that appears when hovering over the sample's custom annotation icon in the OncoPrint view.
-You can learn more about configuring these annotations in the [portal.properties documentation](/deployment/customization/portal.properties-Reference.md#custom-annotation-of-driver-and-passenger-mutations). When properly configured, the customized annotations appear in the "Mutation Color" menu of the OncoPrint view: \
+You can learn more about configuring these annotations in the [application.properties documentation](/deployment/customization/application.properties-Reference.md#custom-annotation-of-driver-and-passenger-mutations). When properly configured, the customized annotations appear in the "Mutation Color" menu of the OncoPrint view: \
![schreenshot mutation color menu](images/screenshot-mutation-color-menu.png)
### Example
@@ -769,7 +769,7 @@ It is possible to manually add columns for defining custom driver annotations. T
The `cbp_driver` column flags the mutation as either driver or passenger. In cBioPortal, passenger mutations are also known as variants of unknown significance (VUS). The `cbp_driver_tiers` column assigns an annotation tier to the mutation, such as "Driver", "Highly actionable" or "Potential drug target". When a tier is selected, mutations with that annotation are highlighted as driver. Both types of custom annotations contain a second column with the suffix `_annotation`, to add a description. This is displayed in the tooltip that appears when hovering over the sample's custom annotation icon in the OncoPrint view.
-You can learn more about configuring these annotations in the [portal.properties documentation](/deployment/customization/portal.properties-Reference.md#custom-annotation-of-driver-and-passenger-mutations). When properly configured, the customized annotations appear in the "Mutation Color" menu of the OncoPrint view: \
+You can learn more about configuring these annotations in the [application.properties documentation](/deployment/customization/application.properties-Reference.md#custom-annotation-of-driver-and-passenger-mutations). When properly configured, the customized annotations appear in the "Mutation Color" menu of the OncoPrint view: \
![schreenshot mutation color menu](/images/screenshot-mutation-color-menu.png)
### Adding your own mutation annotation columns
diff --git a/docs/Hardware-Requirements.md b/docs/Hardware-Requirements.md
index 11523c1520a..4746fef4c20 100644
--- a/docs/Hardware-Requirements.md
+++ b/docs/Hardware-Requirements.md
@@ -22,4 +22,4 @@ Another possible consideration is caching. The portal can cache responses to
requests so that repeated database queries are avoided. On the public cBioPortal
deployment we enable this cache and allocate 1GB of additional RAM and 4GB of
additional disk space for caching. For directions on configuring caching, see
-[Ehcache Settings](/deployment/customization/portal.properties-Reference.md#cache-settings)
+[Ehcache Settings](/deployment/customization/application.properties-Reference.md#cache-settings)
diff --git a/docs/Import-Gene-Panels.md b/docs/Import-Gene-Panels.md
index 4ecbd393f04..6fdaa6fc6f3 100644
--- a/docs/Import-Gene-Panels.md
+++ b/docs/Import-Gene-Panels.md
@@ -30,7 +30,7 @@ cd /core/src/main/scripts
```
After loading gene panels into the database, please restart Tomcat or call the `/api/cache` endpoint with a `DELETE` http-request
-(see [here](/deployment/customization/portal.properties-Reference.md#cache-settings) for more information) so that the
+(see [here](/deployment/customization/application.properties-Reference.md#cache-settings) for more information) so that the
validator can retrieve gene panel information from the cBioPortal API.
#### Update existing gene panel
diff --git a/docs/Import-Gene-Sets.md b/docs/Import-Gene-Sets.md
index 6a778897b2d..f6e0b7ed0bb 100644
--- a/docs/Import-Gene-Sets.md
+++ b/docs/Import-Gene-Sets.md
@@ -31,7 +31,7 @@ Note: This removes existing gene set, gene set hierarchy and gene set genetic pr
```
4. Restart Tomcat if you have it running or call the `/api/cache` endpoint with a `DELETE` http-request
- (see [here](/deployment/customization/portal.properties-Reference.md#evict-caches-with-the-apicache-endpoint) for more information).
+ (see [here](/deployment/customization/application.properties-Reference.md#evict-caches-with-the-apicache-endpoint) for more information).
5. Import study (replace argument after `-u` with local cBioPortal and `-html` with preferred location for html report):
diff --git a/docs/Import-Study-Using-Docker.md b/docs/Import-Study-Using-Docker.md
index 5770bd22764..4b350ba6422 100644
--- a/docs/Import-Study-Using-Docker.md
+++ b/docs/Import-Study-Using-Docker.md
@@ -1,7 +1,7 @@
# Import Study Using Docker
:warning: Every time you add/remove/overwrite a study please restart tomcat (or the Docker container), or
-call the `/api/cache` endpoint with a `DELETE` http-request (see [here](/deployment/customization/portal.properties-Reference.md#evict-caches-with-the-apicache-endpoint) for more information).
+call the `/api/cache` endpoint with a `DELETE` http-request (see [here](/deployment/customization/application.properties-Reference.md#evict-caches-with-the-apicache-endpoint) for more information).
## Adding a Study
diff --git a/docs/Inter-Repository-Dependencies.md b/docs/Inter-Repository-Dependencies.md
new file mode 100644
index 00000000000..7ac1dc38270
--- /dev/null
+++ b/docs/Inter-Repository-Dependencies.md
@@ -0,0 +1,72 @@
+# Inter-Repository Dependencies
+
+## cbioportal-core Repository
+
+[cbioportal-core](https://github.com/cBioPortal/cbioportal-core) is dependent on
+[cbioportal](https://github.com/cBioPortal/cbioportal).
+This can be seen in its [pom.xml](https://github.com/cBioPortal/cbioportal-core/blob/main/pom.xml).
+By removing the dependency and attempting to build cbioportal-core, errors are reported. This
+document captures a summary of the reported errors. This analysis was done at the time of release
+v6.0.0.
+
+cbioportal-core now primarily provides import functionality, which is mainly located
+in the packages:
+- [org.mskcc.cbio.portal.dao](https://github.com/cBioPortal/cbioportal-core/tree/main/src/main/java/org/mskcc/cbio/portal/dao)
+- [org.mskcc.cbio.portal.model](https://github.com/cBioPortal/cbioportal-core/tree/main/src/main/java/org/mskcc/cbio/portal/model)
+- [org.mskcc.cbio.portal.scripts](https://github.com/cBioPortal/cbioportal-core/tree/main/src/main/java/org/mskcc/cbio/portal/scripts)
+
+### Dependencies in cbioportal-core import functionality
+
+Code in cbioportal which is referenced directly by code in cbioportal-core consists of three
+enum class definitions.
+
+- cbioportal class [ResourceType](https://github.com/cBioPortal/cbioportal/blob/master/src/main/java/org/cbioportal/model/ResourceType.java) is imported by cbioportal-core class [ResourceDefinition](https://github.com/cBioPortal/cbioportal-core/blob/main/src/main/java/org/mskcc/cbio/portal/model/ResourceDefinition.java). This provides enum constants {STUDY, SAMPLE, PATIENT}.
+- cbioportal class [EntityType](https://github.com/cBioPortal/cbioportal/blob/master/src/main/java/org/cbioportal/model/EntityType.java) is imported by cbioportal-core class [ImportTabDelimData](https://github.com/cBioPortal/cbioportal-core/blob/main/src/main/java/org/mskcc/cbio/portal/scripts/ImportTabDelimData.java). This provides enum constants {GENE, GENESET, PHOSPHOPROTEIN, GENERIC_ASSAY}.
+- cbioportal class [CNA](https://github.com/cBioPortal/cbioportal/blob/master/src/main/java/org/cbioportal/model/CNA.java) is imported by cbioportal-core class [CnaEvent](https://github.com/cBioPortal/cbioportal-core/blob/main/src/main/java/org/mskcc/cbio/portal/model/CnaEvent.java). This provides enum constants {AMP, GAIN, DIPLOID, HETLOSS, HOMDEL}.
+
+The cbioportal-core import functionality code also relies on several packaged libraries in cbioportal.
+
+cbioportal packaged library org.apache.commons.commons-collections4 (version 4.4) is used by these cbioportal-core classes:
+- [DaoPatient](https://github.com/cBioPortal/cbioportal-core/blob/main/src/main/java/org/mskcc/cbio/portal/dao/DaoPatient.java)
+- [ImportClinicalData](https://github.com/cBioPortal/cbioportal-core/blob/main/src/main/java/org/mskcc/cbio/portal/scripts/ImportClinicalData.java)
+
+cbioportal packaged library org.slf4j.slf4j-api (latest version) is used by these cbioportal-core classes:
+- [JdbcUtil](https://github.com/cBioPortal/cbioportal-core/blob/main/src/main/java/org/mskcc/cbio/portal/dao/JdbcUtil.java)
+- [ProgressMonitor](https://github.com/cBioPortal/cbioportal-core/blob/main/src/main/java/org/mskcc/cbio/portal/util/ProgressMonitor.java)
+- [Patient](https://github.com/cBioPortal/cbioportal-core/blob/main/src/main/java/org/mskcc/cbio/portal/model/Patient.java)
+- [AccessControlImpl](https://github.com/cBioPortal/cbioportal-core/blob/main/src/main/java/org/mskcc/cbio/portal/util/internal/AccessControlImpl.java)
+
+cbioportal packaged library org.springframework.security.spring-security.core (latest compatible version)
+and other related such as org.springframework.security.spring-security.web are used in these cbioportal-core classes:
+- [AccessControl](https://github.com/cBioPortal/cbioportal-core/blob/main/src/main/java/org/mskcc/cbio/portal/util/AccessControl.java)
+- [DaoCancerStudy](https://github.com/cBioPortal/cbioportal-core/blob/main/src/main/java/org/mskcc/cbio/portal/dao/DaoCancerStudy.java) (transitive dependency through AccessControl)
+
+### Other dependencies in cbioportal-core
+
+There are other (non-import) cbioportal-core uses of libraries packaged in cbioportal.
+
+cbioportal packaged libraries jakarta.servlet jakarta.servlet.http (ServletConfig, HttpServlet, ServletException, HttpServletRequest, HttpServletResponse} are used by these cbioportal-core classes:
+- [GetSurvivalDataJSON](https://github.com/cBioPortal/cbioportal-core/blob/main/src/main/java/org/mskcc/cbio/portal/servlet/GetSurvivalDataJSON.java)
+- [XDebug](https://github.com/cBioPortal/cbioportal-core/blob/main/src/main/java/org/mskcc/cbio/portal/util/XDebug.java)
+- [CalcCoExp](https://github.com/cBioPortal/cbioportal-core/blob/main/src/main/java/org/mskcc/cbio/portal/servlet/CalcCoExp.java)
+- [BioGeneServlet](https://github.com/cBioPortal/cbioportal-core/blob/main/src/main/java/org/mskcc/cbio/portal/servlet/BioGeneServlet.java)
+- [IGVLinkingJSON](https://github.com/cBioPortal/cbioportal-core/blob/main/src/main/java/org/mskcc/cbio/portal/servlet/IGVLinkingJSON.java)
+
+cbioportal packaged library org.json.simple / com.googlecode.json-simple.json-simple (version 1.1.1) is used by these cbioportal-core classes:
+- [CalcCoExp](https://github.com/cBioPortal/cbioportal-core/blob/main/src/main/java/org/mskcc/cbio/portal/servlet/CalcCoExp.java)
+- [GetSurvivalDataJSON](https://github.com/cBioPortal/cbioportal-core/blob/main/src/main/java/org/mskcc/cbio/portal/servlet/GetSurvivalDataJSON.java)
+- [IGVLinkingJSON](https://github.com/cBioPortal/cbioportal-core/blob/main/src/main/java/org/mskcc/cbio/portal/servlet/IGVLinkingJSON.java)
+- [GetClinicalData](https://github.com/cBioPortal/cbioportal-core/blob/main/src/main/java/org/mskcc/cbio/portal/web_api/GetClinicalData.java)
+
+cbioportal packaged library org.apache.commonsorg.apache.commons.commons-math3 (version 3.6.1) is used by this cbioportal-core class:
+- [CalcCoExp](https://github.com/cBioPortal/cbioportal-core/blob/main/src/main/java/org/mskcc/cbio/portal/servlet/CalcCoExp.java)
+
+cbioportal packaged library org.slf4j.slf4j-api (latest version) is used by this cbioportal-core class:
+- [AccessControlImpl](https://github.com/cBioPortal/cbioportal-core/blob/main/src/main/java/org/mskcc/cbio/portal/util/internal/AccessControlImpl.java) (transitive dependency through many servlets)
+
+cbioportal packaged library org.springframework.security.spring-security.core (latest compatible version)
+and other related such as org.springframework.security.spring-security.web are used in these cbioportal-core classes:
+- [AccessControl](https://github.com/cBioPortal/cbioportal-core/blob/main/src/main/java/org/mskcc/cbio/portal/util/AccessControl.java) (transitive dependency through many servlets)
+
+### Consequences
+When any of these dependencies are updated in cbioportal (or in the case of libraries, updated in a non-backwards-compatible way), the cbioportal-core repository should be built and tested using the updated dependencies and proper behavior of the import functionality should be tested. cbioportal-core should also be brought up to date by packaging the current version of cbioportal into cbioportal-core (in pom.xml).
diff --git a/docs/MSK-Maintenance.md b/docs/MSK-Maintenance.md
index 95542077e99..47f58653c24 100644
--- a/docs/MSK-Maintenance.md
+++ b/docs/MSK-Maintenance.md
@@ -61,10 +61,10 @@ Database needs to be updated one by one, we have four main databases: triage, pr
- SSH into pipeline server
- Checkout to the commit that contains the latest database scheme
- Check if property sets up correctly to the right database (triage)
- - `vi /data/portal-cron/git-repos/cbioportal/src/main/resources/portal.properties`
+ - `vi /data/portal-cron/git-repos/cbioportal/src/main/resources/application.properties`
- Move to directory
- `cd /data/portal-cron/git-repos/cbioportal`
- Run database migration using script:
- - `python3 core/src/main/scripts/migrate_db.py --properties-file src/main/resources/portal.properties --sql db-scripts/src/main/resources/migration.sql`
+ - `python3 core/src/main/scripts/migrate_db.py --properties-file src/main/resources/application.properties --sql db-scripts/src/main/resources/migration.sql`
- Monitor the DB migration process and look for possible errors
- Access database and verify the DB scheme is updated
diff --git a/docs/News-Genie.md b/docs/News-Genie.md
index 1986538ac4b..b406df988b1 100644
--- a/docs/News-Genie.md
+++ b/docs/News-Genie.md
@@ -1,4 +1,12 @@
# Genie News
+## April 3, 2024
+* **Public Release 15.1 of AACR Project GENIE:**
+ * The public release 15.1 version of AACR GENIE has 61 samples retracted that were present in AACR GENIE 15.0-public.
+ * More detailed information can be found in the [AACR GENIE release notes](https://www.synapse.org/#!Synapse:syn55234828) and the data releases page from [Sage Bionetworks](https://www.synapse.org/#!Synapse:syn55234548).
+## January 9, 2024
+* **Public Release 15.0 of AACR Project GENIE:**
+ * The first set of cancer genomic data aggregated through AACR Project Genomics Evidence Neoplasia Information Exchange (GENIE) was released to the global community in January 2017. The current release, GENIE 15.0-public now contains over 198,000 sequenced samples from over 172,000 patients, making the AACR Project GENIE registry among the largest fully public cancer genomic data sets.
+ * More detailed information can be found in the [AACR GENIE Data Guide](https://www.synapse.org/#!Synapse:syn7222066/wiki/409237). In addition to accessing the data via the cBioPortal, users can download the data directly from [Sage Bionetworks](http://synapse.org/genie). Users will need to create an account for either site and agree to the [terms of access](https://www.synapse.org/#!Synapse:syn50898929).
## November 9, 2023
* **Public Release 14.1 of AACR Project GENIE:**
* The public release 14.1 version of AACR GENIE has 10 samples retracted that were present in AACR GENIE 14.0-public.
diff --git a/docs/News.md b/docs/News.md
index 864d3058488..d3ee0877bf4 100644
--- a/docs/News.md
+++ b/docs/News.md
@@ -1,6 +1,74 @@
+## Apr 2, 2024
+* **Introducing the cBioPortal Newsletter!** Stay updated with the latest developments, insights, and community highlights of cBioPortal. Subscribe via [LinkedIn](https://www.linkedin.com/pulse/april-update-hello-cbioportal-community-cbioportal-22vle/) or [google groups](https://groups.google.com/g/cbioportal-news). We'll be sharing valuable updates every few months.
+
+## Mar 5, 2024
+* **Local Installations Feature**: Make representation of custom driver annotation configurable:
+ ![image](https://github.com/cBioPortal/cbioportal/assets/1334004/f67fd82f-1789-4427-9ca1-f17fc70c1a09)
+
+## Feb 7, 2024
+* **New feature**: The _Datasets Page_ now lists what studies have samples profiled for Structural Variants:
+
+ ![image](https://github.com/cBioPortal/cbioportal/assets/1334004/0e4e73e4-d9d8-417d-912c-710163480905)
+
+* **New Major Release**: **v6.0.0** includes a major repackaging of the backend software to improve the development experience. The backend has been upgraded to use Java Spring Boot v3.1.4. The CORE and MAF modules have been moved to new repositories. All other modules have been compacted into a single source repository. We have also updated the JVM to 21 and many libraries have been updated to address security and performance issues. See more information in the [v6.0.0 release notes](https://github.com/cBioPortal/cbioportal/releases/tag/v6.0.0).
+
+* **Local Installations Feature**: When mutational signature data is loaded, show COSMIC reference signatures on the _Patient View_:
+
+ ![image](https://github.com/cBioPortal/cbioportal/assets/1334004/10f73baa-d28c-4bb7-ad62-4751bd7f61cd)
+
+## Dec 29, 2023
+* **Added data** consisting of 5,120 samples from 13 studies:
+ * [Endometrial Cancer (MSK, Cancer Discovery 2023)](https://www.cbioportal.org/study/summary?id=ucec_ancestry_cds_msk_2023) *1882 samples*
+ * [Esophagogastric Cancer (MSK, J Natl Cancer Inst 2023)](https://www.cbioportal.org/study/summary?id=egc_msk_2023) *902 samples*
+ * [Diffuse Glioma (GLASS Consortium, 2022)](https://www.cbioportal.org/study/summary?id=difg_glass) *693 samples*
+ * [Bladder Cancer (MSK, Clin Cancer Res 2023)](https://www.cbioportal.org/study/summary?id=bladder_msk_2023) *526 samples*
+ * [Non-Small Cell Lung Cancer Brain Metastasis (MSK, Nat Commun 2023)](https://www.cbioportal.org/study/summary?id=bm_nsclc_mskcc_2023) *322 samples*
+ * [MSK Make-an-IMPACT Rare Cancers (MSK, Clin Cancer Res 2023)](https://www.cbioportal.org/study/summary?id=makeanimpact_ccr_2023) *184 samples*
+ * [Cervical Cancer (MSK, Clin Cancer Res 2023)](https://www.cbioportal.org/study/summary?id=cervix_msk_2023) *177 samples*
+ * [Mature T and NK Neoplasms (MSK, Blood Adv 2023)](https://www.cbioportal.org/study/summary?id=mtnn_msk_2022) *132 samples*
+ * [Hepatocellular Carcinoma (MSK, JCO Precis Oncol 2023)](https://www.cbioportal.org/study/summary?id=hcc_jcopo_msk_2023) *90 samples*
+ * [Sarcoma (MSK, J Pathol 2023)](https://www.cbioportal.org/study/summary?id=sarcoma_msk_2023) *82 samples*
+ * [Esophagogastric Cancer (MSK, Clin Cancer Res 2023)](https://www.cbioportal.org/study/summary?id=egc_trap_ccr_msk_2023) *64 samples*
+ * [Rhabdomyosarcomas (MSK, NPJ Precis Oncol 2023)](https://www.cbioportal.org/study/summary?id=soft_tissue_msk_2023) *42 samples*
+ * [Pediatric Rhabdomyosarcomas (MSK, JCO Precis Oncol 2023)](https://www.cbioportal.org/study/summary?id=rms_msk_2023) *24 samples*
+
+* **Gene Tables Update:** Updated tables of genes (main and alias), based on [Oct 1, 2023 HGNC release](http://ftp.ebi.ac.uk/pub/databases/genenames/hgnc/archive/monthly/tsv/). See seedDB release notes [here](https://github.com/cBioPortal/datahub/tree/master/seedDB#latest-seed-database-schema-2131) for details.
+
+## Dec 5, 2023
+* **New feature**: Filter by data types on the homepage:
+
+ ![image](https://github.com/cBioPortal/cbioportal/assets/1334004/cf6d5486-bfd7-4f69-add0-442dbb4d354a)
+* **New feature**: Change colors of tracks in Oncoprint:
+
+
+
+* **New feature**: Show alteration frequencies per group in OncoPrint. [Example: RTK-RAS alterations in Smokers vs Never Smokers Lung Cancer Cases in MSK-IMPACT Clinical Sequencing Cohort](https://bit.ly/3PwKsDJ)
+
+
+
+## Oct 17, 2023
+* **New feature**: Survival charts with landmark events and hazard ratios. [Example: TP53 in Lung Cancer Cases in MSK-IMPACT Clinical Sequencing Cohort](https://bit.ly/48QktxS)
+
+
+
+## Oct 3, 2023
+* **New feature**: New Structural Variants Tab on _Results View_. [Example: TMPRSS2 Structural Variants in MSK-IMPACT Clinical Sequencing Cohort](https://bit.ly/49FDhRk)
+
+
+
+## Sep 5, 2023
+* **New feature**: Add gene-specific CNA charts to show all levels of copy number alterations (including gain and hetloss) on _Study View_:
+
+
+
+## Aug 30, 2023
+* **Enhancement**: Exclude a patient from your selection directly from the _Patient View_:
+
+ ![image](https://github.com/cBioPortal/cbioportal/assets/1334004/501fe998-8408-48e3-a183-e27ab3ff3f28)
+
## Aug 21, 2023
* **Added data** consisting of 4,488 samples from 7 studies:
- * [Lung Adenocarcinoma Met Organotropism (MSK, Cancer Cell 2023)](https://www.cbioportal.org/study/summary?id=luad_mskcc_2023_met_organotropism) *2653 samples*
+ * [Lung Adenocarcinoma Met Organotropism (MSK, Cancer Cell 2023)](https://www.cbioportal.org/study/summary?id=luad_mskcc_2023_met_organotropism) *2653 samples*
* [Acute Myeloid Leukemia (OHSU, Cancer Cell 2022)](https://www.cbioportal.org/study/summary?id=aml_ohsu_2022) *942 samples*
* [Colon Cancer (Sidra-LUMC AC-ICAM, Nat Med 2023)](https://www.cbioportal.org/study/summary?id=coad_silu_2022) *348 samples*
* [Pediatric Neuroblastoma (MSK, Nat Genet 2023)](https://www.cbioportal.org/study/summary?id=nbl_msk_2023) *223 samples*
@@ -8,11 +76,12 @@
* [Bladder Cancer (Columbia University/MSK, Cell 2018)](https://www.cbioportal.org/study/summary?id=bladder_columbia_msk_2018) *130 samples*
* [Myoepithelial Carcinomas of Soft Tissue (WCM, CSH Molecular Case Studies 2022)](https://www.cbioportal.org/study/summary?id=stmyec_wcm_2022) *12 samples*
-* **Gene Tables Update** Updated tables of genes (main and alias), based on [Apr 1, 2023 HGNC release](http://ftp.ebi.ac.uk/pub/databases/genenames/hgnc/archive/monthly/tsv/). See seedDB release note [here](https://github.com/cBioPortal/datahub/tree/master/seedDB#latest-seed-database) for details.
+
+* **Gene Tables Update:** Updated tables of genes (main and alias), based on [Apr 1, 2023 HGNC release](http://ftp.ebi.ac.uk/pub/databases/genenames/hgnc/archive/monthly/tsv/). See seedDB release notes [here](https://github.com/cBioPortal/datahub/tree/master/seedDB#latest-seed-database) for details.
## Aug 1, 2023
* **Enhancement**: One-sided Fisher's exact tests were changed to be two-sided. The affected pages are:
- * Results View Page - Mutual Exclusivity Tab
+ * Results View Page - Mutual Exclusivity Tab
* Results View Page - Comparison Tab - Genomic Alterations Tab
* Comparison Page - Genomic Alterations Tab
* Comparison Page - Mutations Tab
@@ -21,12 +90,23 @@
Several users pointed out that using a one-sided test was incorrect for these comparisons. Please see discussions [here](https://github.com/cBioPortal/cbioportal/issues/9943) for more information.
+## Jul 18, 2023
+* **New Feature**: Add mutations table and two-sided exact p-value to comparison. [Example: AR mutations in Primary vs Metastatic Prostate Cancer samples in MSK-IMPACT Clinical Sequencing Cohort](https://www.cbioportal.org/comparison/mutations?sessionId=5cf89323e4b0ab413787436c&groupOrder=%5B%22Primary%22%2C%22Metastasis%22%5D&selectedGene=AR)
+
+
+
+
## May 2, 2023
* **New Feature**: The mutations tab now shows variant annotations from the [repository of Variant with Unexpected Effects (reVUE)](https://www.cancerrevue.org/).
+
+## Apr 25, 2023
+* **Local Installations Feature**: When custom driver annotations for structural variants are loaded, one can now filter by them in both the Oncoprint and the _Study View_.
+
## Apr 11, 2023
* **New Feature**: Disable autocommit and manually commit filters in study view. Manually commit filters can improve cBioPortal performance when query large dataset.
+
@@ -43,21 +123,23 @@
## Apr 4, 2023
* **New Feature**: Allow numeric data type for custom data charts.
+
This also allows to have numerical custom data after we query based on genes (custom data 2 in the image):
+
## Jan 10, 2023
-* **New Feature**: New Pathways tab on the Group Comparison view.
- [Example: Primary vs Metastasis samples in MSK-IMPACT Clinical Sequencing Cohort](https://www.cbioportal.org/comparison/pathways?comparisonId=61791fa92e3200072db9b64e&groupOrder=%5B%22Primary%22%2C%22Metastasis%22%5D)
+* **New Feature**: New Pathways tab on the Group Comparison view. [Example: Primary vs Metastasis samples in MSK-IMPACT Clinical Sequencing Cohort](https://www.cbioportal.org/comparison/pathways?comparisonId=61791fa92e3200072db9b64e&groupOrder=%5B%22Primary%22%2C%22Metastasis%22%5D)
+
## Dec 13, 2022
-* **New Feature**: New Mutations tab on the Group Comparison view.
- [Example: Primary vs Metastasis samples in MSK-IMPACT Clinical Sequencing Cohort](https://www.cbioportal.org/comparison/mutations?comparisonId=61791fa92e3200072db9b64e&groupOrder=%5B%22Primary%22%2C%22Metastasis%22%5D)
+* **New Feature**: New Mutations tab on the Group Comparison view. [Example: Primary vs Metastasis samples in MSK-IMPACT Clinical Sequencing Cohort](https://www.cbioportal.org/comparison/mutations?comparisonId=61791fa92e3200072db9b64e&groupOrder=%5B%22Primary%22%2C%22Metastasis%22%5D)
+
## Oct 12, 2022
@@ -74,7 +156,8 @@
* [Urothelial Carcinoma (BCAN/HCRN 2022)](http://www.cbioportal.org/study/summary?id=blca_bcan_hcrn_2022) *203 samples*
## Sep 6, 2022
-* **Enhancement**: Oncoprint can now save clinical tracks after login
+* **Enhancement**: Oncoprint can now save clinical tracks after login:
+
## Aug 11, 2022
@@ -90,15 +173,30 @@
* [Pan-cancer Analysis of Advanced and Metastatic Tumors (BCGSC, Nature Cancer 2020)](https://www.cbioportal.org/study/summary?id=pog570_bcgsc_2020) *570 samples*
* [Prostate Adenocarcinoma (MSK, Clin Cancer Res. 2022)](https://www.cbioportal.org/study/summary?id=prad_pik3r1_msk_2021) *1,417 samples*
+## Jun 7, 2022
+* **New Feature**: Add heatmap to plot options on _Comparison Page_. [Example: Primary vs Metastatic Prostate Cancer in MSK-IMPACT (2017)](https://www.cbioportal.org/comparison/clinical?sessionId=5cf89323e4b0ab413787436c)
+
+
+
## May 31, 2022
* **New Feature**: Added Quartiles, Median split and Generate bins options for bar charts on the study view page, where Generate bins allows user to define bin size and min value
-
+
+
+
## May 12, 2022
* **New Feature**: Show cohort alteration frequencies in pathways from [NDEx](https://www.ndexbio.org/iquery/) on the _Results View_. [Example: Glioblastoma signaling pathways in MSK-IMPACT (2017) cohort](https://bit.ly/3sE4UqD)
+## May 24, 2022
+* **New Feature**: Add Help buttons on various pages and tabs, including the homepage
+
+## May 10, 2022
+* **New Feature**: Use IGV for the genomic overview on the _Patient View_. [Example: Endometrial cancer patient in TCGA](https://www.cbioportal.org/patient?studyId=ucec_tcga_pub&caseId=TCGA-BK-A0CC)
+
+
+
## May 5, 2022
* **New Feature**: View mutations and copy number changes in the [Integrative Genomics Viewer (IGV)](https://igv.org/) on the _Patient View_. [Example: Endometrial cancer patient in TCGA](https://www.cbioportal.org/patient?studyId=ucec_tcga_pub&caseId=TCGA-BK-A0CC)
@@ -116,7 +214,7 @@
## Apr 20, 2022
* **Added data** consisting of 2,557 samples from 5 studies:
- * [Breast Cancer (HTAN, 2022)](https://www.cbioportal.org/study/summary?id=brca_hta9_htan_2022) *5 samples*
+ * [Breast Cancer (HTAN OHSU, 2022)](https://www.cbioportal.org/study/summary?id=brca_hta9_htan_2022) *5 samples*
* [Colorectal Cancer (MSK, 2022)](https://www.cbioportal.org/study/summary?id=crc_dd_2022) *47 samples*
* [Pediatric Pancan Tumors (MSK, 2022)](https://www.cbioportal.org/study/summary?id=mixed_kunga_msk_2022) *135 samples*
* [Sarcoma (MSK, 2022)](https://www.cbioportal.org/study/summary?id=sarcoma_mskcc_2022) *2,138 samples*
@@ -128,6 +226,32 @@
* Pan-can studies methylation addition: methylation profile (27k and 450k merged) are added to all 32 TCGA Pan-Can studies, in generic assay format. Data source: [GDC](https://gdc.cancer.gov/node/977). Example: search by gene or probe from dropdown, to add a chart in study view, a track in Oncoprint (single study query only), or plots in plots tab.
* Single cell (type fraction and phases) data (in generic assay format) is added to [Glioblastoma (CPTAC, Cell 2021)](https://www.cbioportal.org/study/summary?id=gbm_cptac_2021)
+* **New Feature** For the new HTAN OHSU study there is now also an integration with [Harvard LSP](https://labsyspharm.org/)'s [Minerva](https://www.cycif.org/software/minerva) for exploring multiplex imaging:
+
+
+
+
+## Mar 1, 2022
+* **New Documentation**:
+ * Add a [User Guide](https://docs.cbioportal.org/user-guide/)
+ * Add [Study View and Query How-to videos](https://docs.cbioportal.org/user-guide/overview/#how-to-videos)
+
+## Feb 8, 2022
+* **New Feature**: Create X vs Y violin plots in _Study View_ using any categorical and numerical clinical data:
+
+
+
+## Jan 19, 2022
+* **New Feature**: Numerical filters on the _Study View_ are now editable:
+
+
+* **New Feature**: In the annotation column choose between showing a single icon OncoKB icon or multiple (one for therapeutic, diagnostic and prognostic):
+
+
+
+## Jan 10, 2022
+* **New Documentation for Local cBioPortal Installations**:
+ * Explain how to use [Genome Nexus to annotate MAF files](https://docs.cbioportal.org/file-formats/#create-the-cbioportal-mutation-data-file-with-genome-nexus-with-a-minimal-maf-file)
## Jan 4, 2022
* **Added data** consisting of 27,447 samples from 10 studies:
@@ -142,6 +266,7 @@
* [MSK MetTropism (MSK, Cell 2021)](https://www.cbioportal.org/study/summary?id=msk_met_2021) *25,775 samples*
* [Cancer Therapy and Clonal Hematopoiesis (MSK, 2021)](https://www.cbioportal.org/study/summary?id=msk_ch_ped_2021) *657 samples*
+
* **Added TMB (nonsynonymous) scores** for all studies. [Example: new TMB field for study gbm_cptac_2021](https://www.cbioportal.org/study/clinicalData?id=gbm_cptac_2021)
(Details for the calculation can be found [HERE](https://github.com/cBioPortal/datahub-study-curation-tools/blob/master/tmb/calculate_tmb/Readme.md))
@@ -282,6 +407,7 @@
* **New Feature**: Display and compare generic assays, such as microbiome and treatment response, on the study view [Example: Prasinovirus microbiome signatures in TCGA](https://www.cbioportal.org/study?id=6000b6aae4b015b63e9d4d44)
+
* **New Feature**: The Plots tab on _Results View_ now allows you to group alterations by Driver and VUS [Example: POLE driver mutations vs VUSs against mutation counts in TCGA Colorectal Adenocarcinoma](https://bit.ly/3ssY9Gu)
diff --git a/docs/SUMMARY.md b/docs/SUMMARY.md
index ed759c38b23..5411d990a09 100644
--- a/docs/SUMMARY.md
+++ b/docs/SUMMARY.md
@@ -6,7 +6,7 @@
* [User Guide](user-guide/README.md)
* [New Users](user-guide/new-users.md)
* [Frequently Asked Questions](user-guide/faq.md)
- * [Overview of Resources](user-guide/overview.md)
+ * [Tutorials](user-guide/overview.md)
* [Page Specific Resources](user-guide/by-page.md)
* [OQL](user-guide/oql.md)
* [News](News.md)
@@ -33,8 +33,9 @@
* [Authenticating and Authorizing Users via Keycloak](deployment/authorization-and-authentication/Authenticating-and-Authorizing-Users-via-keycloak.md)
* [Authenticating Users via Tokens](deployment/authorization-and-authentication/Authenticating-Users-via-Tokens.md)
* [Customization]()
- * [Customizing your cBioPortal Instance via portal.properties](deployment/customization/Customizing-your-instance-of-cBioPortal.md)
- * [More portal.properties Settings](deployment/customization/portal.properties-Reference.md)
+ * [Customizing your cBioPortal Instance via application.properties](deployment/customization/Customizing-your-instance-of-cBioPortal.md)
+ * [More application.properties Settings](deployment/customization/application.properties-Reference.md)
+ * [Security Properties Settings](deployment/customization/security.properties-Reference.md)
* [Configuring Caching Behavior](deployment/customization/Caching.md)
* [How does the study view organize the charts](deployment/customization/Studyview.md)
* [Utilize priority setting from database to visualize charts](deployment/customization/Studyview.md)
diff --git a/docs/Support-multiple-reference-genomes.md.BK b/docs/Support-multiple-reference-genomes.md.BK
index 37f8ef56593..2f2f36e30f4 100644
--- a/docs/Support-multiple-reference-genomes.md.BK
+++ b/docs/Support-multiple-reference-genomes.md.BK
@@ -11,7 +11,7 @@ and migrate your database schema to the latest version. The migrartion script by
if your study is profiled by a reference geome other than a default genome value listed in your portal properties file.
**Important Note**
-* Add the following default values to your portal.properties file. Those default genome values will be used by the validation script when importing a new study.
+* Add the following default values to your application.properties file. Those default genome values will be used by the validation script when importing a new study.
```# species and genomic information
species=human
ncbi.build=GRCh37
diff --git a/docs/Updating-gene-and-gene_alias-tables.md b/docs/Updating-gene-and-gene_alias-tables.md
index 0b6f7c9a0d9..46e00489248 100644
--- a/docs/Updating-gene-and-gene_alias-tables.md
+++ b/docs/Updating-gene-and-gene_alias-tables.md
@@ -41,7 +41,7 @@ ALTER TABLE `geneset` AUTO_INCREMENT = 1;
```
4- Restart cBioPortal (restart webserver) or call the `/api/cache` endpoint with a `DELETE` http-request
-(see [here](/deployment/customization/portal.properties-Reference.md#evict-caches-with-the-apicache-endpoint) for more information)
+(see [here](/deployment/customization/application.properties-Reference.md#evict-caches-with-the-apicache-endpoint) for more information)
to clean-up any cached gene lists.
5- To import gene data type the following commands when in the folder `/core/src/main/scripts`:
diff --git a/docs/Updating-your-cBioPortal-installation.md b/docs/Updating-your-cBioPortal-installation.md
index 011c7a39fa5..6f4d4abc515 100644
--- a/docs/Updating-your-cBioPortal-installation.md
+++ b/docs/Updating-your-cBioPortal-installation.md
@@ -12,11 +12,11 @@ DB schema version expected by Portal: yyy
```
where `xxx` and `yyy` will be different version numbers.
-If you get `DB version expected by Portal: 0` (i.e. you are building the new release from source), you need to add a new property to your `portal.properties` file which is needed for this check.
+If you get `DB version expected by Portal: 0` (i.e. you are building the new release from source), you need to add a new property to your `application.properties` file which is needed for this check.
#### Step1
-In your `portal.properties` file (e.g. `/src/main/resources/portal.properties`) add the following property:
+In your `application.properties` file (e.g. `/src/main/resources/application.properties`) add the following property:
```
# this is the *expected* DB version (expected by the code). Don't set it manually, it is filled by maven:
db.version=${db.version}
@@ -28,7 +28,7 @@ Compile your code again. After restarting the webserver the page should now stat
## Running the migration script
-First, make sure you have the DB connection properties correctly set in your portal.properties file (see [DB connection settings here](/deployment/customization/portal.properties-Reference.md#database-settings)).
+First, make sure you have the DB connection properties correctly set in your application.properties file (see [DB connection settings here](/deployment/customization/application.properties-Reference.md#database-settings)).
**Dependencies:** the migration script is a Python script that depends on the `mysqlclient` library. If necessary, you can install it with the following commands (example for Ubuntu):
```console
@@ -70,4 +70,4 @@ etc
```
**Final step:** Restart your webserver or call the `/api/cache` endpoint with a `DELETE` http-request
-(see [here](/deployment/customization/portal.properties-Reference.md#evict-caches-with-the-apicache-endpoint) for more information).
+(see [here](/deployment/customization/application.properties-Reference.md#evict-caches-with-the-apicache-endpoint) for more information).
diff --git a/docs/Using-the-dataset-validator.md b/docs/Using-the-dataset-validator.md
index d44ff0d2505..70468db1fd4 100644
--- a/docs/Using-the-dataset-validator.md
+++ b/docs/Using-the-dataset-validator.md
@@ -776,7 +776,7 @@ cBioPortal is gradually introducing support for mouse. If you want to load mouse
As an example, the command for the mouse example using the three parameters is given:
```
-./validateData.py -s ../../../test/scripts/test_data/study_es_0/ -P ../../../../../src/main/resources/portal.properties -u http://localhost:8080 -v
+./validateData.py -s ../../../test/scripts/test_data/study_es_0/ -P ../../../../../src/main/resources/application.properties -u http://localhost:8080 -v
```
## Running the validator for multiple studies
diff --git a/docs/deployment/authorization-and-authentication/Authenticating-Users-via-SAML.md b/docs/deployment/authorization-and-authentication/Authenticating-Users-via-SAML.md
index ebcab3d5e51..45d53189b54 100644
--- a/docs/deployment/authorization-and-authentication/Authenticating-Users-via-SAML.md
+++ b/docs/deployment/authorization-and-authentication/Authenticating-Users-via-SAML.md
@@ -121,7 +121,7 @@ both keystore and secure-key. This seems to be an extra restriction by Tomcat.
## Modifying configuration
-Within portal.properties, make sure that:
+Within application.properties, make sure that:
app.name=cbioportal
@@ -197,7 +197,7 @@ Next, please read the Wiki page on [User Authorization](User-Authorization.md),
## Configuring the Login.html Page (not applicable to most external IDPs)
-The login page is configurable via the `portal.properties` properties `skin.authorization_message` and `skin.login.saml.registration_htm`.
+The login page is configurable via the `application.properties` properties `skin.authorization_message` and `skin.login.saml.registration_htm`.
For example in `skin.authorization_message` you can be set to something like this:
```
diff --git a/docs/deployment/authorization-and-authentication/Authenticating-Users-via-Tokens.md b/docs/deployment/authorization-and-authentication/Authenticating-Users-via-Tokens.md
index f5952fb122b..36d0899ca9f 100644
--- a/docs/deployment/authorization-and-authentication/Authenticating-Users-via-Tokens.md
+++ b/docs/deployment/authorization-and-authentication/Authenticating-Users-via-Tokens.md
@@ -37,7 +37,7 @@ A step-by-step guide to configure KeyCloak to provide OAuth2 client functionalit
### Modifying Configuration
-The following properties must be present in portal.properties in order to allow direct access to the cBioPortal web service when login is required:
+The following properties must be present in application.properties in order to allow direct access to the cBioPortal web service when login is required:
**Property**: dat.method (required)
diff --git a/docs/deployment/authorization-and-authentication/Authenticating-and-Authorizing-Users-via-keycloak.md b/docs/deployment/authorization-and-authentication/Authenticating-and-Authorizing-Users-via-keycloak.md
index 1a9271c4bcc..977fac3d971 100644
--- a/docs/deployment/authorization-and-authentication/Authenticating-and-Authorizing-Users-via-keycloak.md
+++ b/docs/deployment/authorization-and-authentication/Authenticating-and-Authorizing-Users-via-keycloak.md
@@ -129,7 +129,7 @@ should now see the certificate and no private key.
## Modifying configuration
-1. Within the portal.properties file , make sure that this line is present:
+1. Within the application.properties file , make sure that this line is present:
```
app.name=cbioportal
```
@@ -314,7 +314,7 @@ The step below were verified to work with Keycloak versions 4.8.3.Final and 8.0.
#### Credentials tab
-Select `Client Id and Secret`. Take notice of the value of _Secret_ the secret field. This secret should be added to `portal.properties` file of the cBioPortal backend.
+Select `Client Id and Secret`. Take notice of the value of _Secret_ the secret field. This secret should be added to `application.properties` file of the cBioPortal backend.
| parameter | value | comment |
| ------------- |:-------------:| -----:|
@@ -352,7 +352,7 @@ Enable _Full Scope_. This setting will include the user roles defined in the `cb
![](/images/previews/oauth2_client_5.png)
-3. Add these parameters to `portal.properties` of the cBioPortal backend.
+3. Add these parameters to `application.properties` of the cBioPortal backend.
| parameter | value | comment |
| ------------- |:-------------:| -----:|
@@ -380,7 +380,7 @@ Then, rebuild the WAR, redeploy, and try to authenticate again. Your log file w
If you're using the Docker container, mount the file instead with `-v ./logback.xml:/cbioportal-webapp/WEB-INF/classes/logback.xml`.
#### Determining jwtRolesPath for OAuth2 Token
-By default user-roles are extracted from path `resource_access::cbioportal::roles` in the JWT json. Changes to the configuration of roles at the realm and client level in Keycloak instance can alter this path and must be set acordingly with the `dat.oauth2.jwtRolesPath` property in the `portal.properties` file.
+By default user-roles are extracted from path `resource_access::cbioportal::roles` in the JWT json. Changes to the configuration of roles at the realm and client level in Keycloak instance can alter this path and must be set acordingly with the `dat.oauth2.jwtRolesPath` property in the `application.properties` file.
To check the the roles path, go into the `Client Scopes` tab inside KeyCloak. Enter the `Evaluate` section, select a test user, and click `Evaluate`. In the section below, select the `Generated Access Token` tab to examine the JWT structure.
@@ -405,5 +405,5 @@ A sample JWT might look like this:
"scope": "openid"
}
```
-The `jwtRolesPath` in this case would be `realm_access::roles`. Double check this against the `jwtRolesPath` value set in `portal.properties`.
+The `jwtRolesPath` in this case would be `realm_access::roles`. Double check this against the `jwtRolesPath` value set in `application.properties`.
diff --git a/docs/deployment/authorization-and-authentication/User-Authorization.md b/docs/deployment/authorization-and-authentication/User-Authorization.md
index 773fab95211..451dfbec6ca 100644
--- a/docs/deployment/authorization-and-authentication/User-Authorization.md
+++ b/docs/deployment/authorization-and-authentication/User-Authorization.md
@@ -73,7 +73,7 @@ The value in the EMAIL column should be the same email address contained in the
The value in the AUTHORITY column is made of two parts:
-* The first part is the name of your portal instance. This name should also match the `app.name` property found in the `portal.properties` file.
+* The first part is the name of your portal instance. This name should also match the `app.name` property found in the `application.properties` file.
* Following a colon delimiter, the second part is the [cancer_study_identifier](../../File-Formats.md#cancer-study) of the cancer study this user has rights to access.
**If the user has rights to all available cancer studies, a single entry with the keyword `app.name:` + "ALL" is sufficient (so e.g. "cbioportal:ALL").**
@@ -135,7 +135,7 @@ After **next login**, the user 'john.smith@gmail.com' will have access to these
## Configuring PUBLIC studies
-To enable a set of public studies that should be visible to all users, without the need to configure this for each user in the `authorities` and `users` tables, you can set the property `always_show_study_group` in **portal.properties** file. For example, you can set:
+To enable a set of public studies that should be visible to all users, without the need to configure this for each user in the `authorities` and `users` tables, you can set the property `always_show_study_group` in **application.properties** file. For example, you can set:
```
always_show_study_group=PUBLIC
diff --git a/docs/deployment/customization/Caching.md b/docs/deployment/customization/Caching.md
index e4b657673c7..8368a8c5780 100644
--- a/docs/deployment/customization/Caching.md
+++ b/docs/deployment/customization/Caching.md
@@ -10,8 +10,8 @@ if they have already been constructed. They would only be constructed for the in
The portal is configured to use Ehcache or Redis for backend caching. Ehcache supports a hybrid (disk + heap),
disk-only, and heap-only mode. Redis stores the cache in memory and periodically writes the updated data to disk. Cache
-configuration is specified inside `portal.properties`(more
-information [here](/deployment/customization/portal.properties-Reference.md#cache-settings)).
+configuration is specified inside `application.properties`(more
+information [here](/deployment/customization/application.properties-Reference.md#cache-settings)).
## Creating additional caches
@@ -100,7 +100,7 @@ be cached. Those might look like this example:
public String getDataFromClinicalDataRepository(String param) {}
```
-Additionally, new properties for setting cache sizes should be added to `portal.properties` and loaded into
+Additionally, new properties for setting cache sizes should be added to `application.properties` and loaded into
the [CustomEhcachingProvider](https://github.com/cBioPortal/cbioportal/blob/master/persistence/persistence-api/src/main/java/org/cbioportal/persistence/util/CustomEhcachingProvider.java)
. Alternatively, values may be hardcoded directly
inside [CustomEhcachingProvider](https://github.com/cBioPortal/cbioportal/blob/master/persistence/persistence-api/src/main/java/org/cbioportal/persistence/util/CustomEhcachingProvider.java)
@@ -122,7 +122,7 @@ whether a user has access to the data of a particular sample list or molecular p
By default, the user-authorization cache is implemented as a HashMap that is populated when cBioPortal is started. This
implementation allows for very fast response times of user-permission evaluation.
-The user-authorization cache can be delegated to the Spring-managed caching solution by setting the [cache.cache-map-utils.spring-managed](portal.properties-Reference.md#cache-settings)
+The user-authorization cache can be delegated to the Spring-managed caching solution by setting the [cache.cache-map-utils.spring-managed](application.properties-Reference.md#cache-settings)
to _true_. Depending on the implementation, this may add a delay to any data request that is caused by the additional consultation
of the external cache. This configuration should only be used where a central caching solution is required or no
instance/container-specific local caches are allowed. For example, cache eviction via the `api/cache` endpoint in a Kubernetes
@@ -142,7 +142,7 @@ eviction end point is that user-sessions remain undisturbed since the portal ins
cache eviction enpoint is disabled and can be enabled by setting `cache.endpoint.enabled` to _true_. The endpoint is
secured by a secret API key that can be customized with the `cache.endpoint.api-key` property. Caches are evicted by
making a DELETE request to the endoint while passing the API key in the `X-API-KEY` header. When using _curl_ use the
-following command (replace the API key for the value configured in _portal.properties_):
+following command (replace the API key for the value configured in _application.properties_):
```
curl -X DELETE http://my-portal-url.org/api/cache -H 'X-API-KEY: fd15f1ae-66f2-4b8a-8d54-fb899b03557e'
@@ -154,7 +154,7 @@ When a study is added, deleted or updated, a more selective cache eviction strat
cached data is evicted. This more selective cache eviction is triggered by calling the `/api/cache/{studyId}` endpoint
where _{studyId}_ is the _cancer_study_identifier_ stated in the meta-study.txt file. When using _curl_ use the
following command after update of a study with study identifier _my_cancer_study_ (replace the API key for the value
-configured in _portal.properties_):
+configured in _application.properties_):
```
curl -X DELETE http://my-portal-url.org/api/cache/my_cancer_study -H 'X-API-KEY: fd15f1ae-66f2-4b8a-8d54-fb899b03557e'
diff --git a/docs/deployment/customization/Customizing-your-instance-of-cBioPortal.md b/docs/deployment/customization/Customizing-your-instance-of-cBioPortal.md
index 51fbbc78f9f..0efd5c0254f 100644
--- a/docs/deployment/customization/Customizing-your-instance-of-cBioPortal.md
+++ b/docs/deployment/customization/Customizing-your-instance-of-cBioPortal.md
@@ -6,10 +6,10 @@ This page focuses on the skin properties, which allow you to
customize the web page cosmetics, such as custom images,
texts, which tabs are visible, etc.
Nearly all the skins properties have defaults, which can be overwritten by
-changing the `portal.properties` file located in `$PORTAL_HOME`--see
+changing the `application.properties` file located in `$PORTAL_HOME`--see
[the deployment manual](/deployment/deploy-without-docker/Deploying.md). If your cBioPortal instance
-does not yet contain a `portal.properties` file, you can copy
-`src/main/resources/portal.properties.EXAMPLE` and edit it.
+does not yet contain a `application.properties` file, you can copy
+`src/main/resources/application.properties.EXAMPLE` and edit it.
Below you can find the complete list of all the available skin properties.
@@ -278,19 +278,12 @@ If the download_group is present in user groups then download options are shown
false
true / false
-
+
google_analytics_profile_id
enables google analaytics tracking on your site
disabled
string
-
-
-
-
-
-
-
@@ -303,7 +296,7 @@ Creating you own local news/about or FAQ page involves three steps. For example,
1. Copy `/portal/src/main/webapp/content/news.html` to `news_XXXX.html`
2. Modify `news_XXXX.html` as needed.
-3. Edit the `portal.properties` file and change the `skin.documentation.news` property, giving it the name of your news HTML component.
+3. Edit the `application.properties` file and change the `skin.documentation.news` property, giving it the name of your news HTML component.
You may need to modify additional settings depending on whether you're e.g. using markdown pages. Please refer to the [cBioPortal Documentation](#cbioportal-documentation-settings) for more information.
diff --git a/docs/deployment/customization/portal.properties-Reference.md b/docs/deployment/customization/application.properties-Reference.md
similarity index 95%
rename from docs/deployment/customization/portal.properties-Reference.md
rename to docs/deployment/customization/application.properties-Reference.md
index aea31578dcc..f26ddac68bf 100644
--- a/docs/deployment/customization/portal.properties-Reference.md
+++ b/docs/deployment/customization/application.properties-Reference.md
@@ -1,6 +1,6 @@
-# More portal.properties Settings
+# More application.properties Settings
-This page describes the main properties within portal.properties.
+This page describes the main properties within application.properties.
## Database Settings
@@ -55,7 +55,7 @@ skin.show_about_tab=
The cross cancer study query default is a list of studies used when querying one or more genes and not specifying a specific study or list of studies. There are two ways in which the default cross cancer study list is used:
1. When using the linkout links without a study e.g. `/ln?q=TP53:MUT`. Those links are used mostly used to allow for easy linking to particular queries. One can't get those links using the cBioPortal user interface itself, they are only mentioned in the documentation of the Web API (https://www.cbioportal.org/webAPI).
-2. In the quick search when querying for a gene. Quick search is disabled by default. It is a beta feature. See the [quick search documentation](portal.properties-Reference.md#quick-search-beta).
+2. In the quick search when querying for a gene. Quick search is disabled by default. It is a beta feature. See the [quick search documentation](application.properties-Reference.md#quick-search-beta).
The configuration is set with the following if you have session service enabled:
@@ -84,7 +84,7 @@ Enable or disable the quick search with the following:
quick_search.enabled=true
```
-The default studies queried when searching for a single gene is defined with the `default_cross_cancer_study_session_id` or `default_cross_cancer_study_list` properties as described in the [cross cancer study query default section](portal.properties-Reference.md#cross-cancer-study-query-default).
+The default studies queried when searching for a single gene is defined with the `default_cross_cancer_study_session_id` or `default_cross_cancer_study_list` properties as described in the [cross cancer study query default section](application.properties-Reference.md#cross-cancer-study-query-default).
### Hide sections in the right navigation bar
@@ -226,6 +226,15 @@ skin.patient_view.copy_number_table.columns.show_on_init=
skin.patient_view.structural_variant_table.columns.show_on_init=
```
+### Default sort columns on Mutation, Copy-Number and Structural Variant Tables
+
+Define the column that are going to sort be default in the Mutation, Copy-Number and Structural Variant Tables on the Patient View and the Mutation Table in the Results View.
+Column name should be exactly the same as shown in tables.
+```
+skin.results_view.tables.default_sort_column=
+skin.patient_view.tables.default_sort_column=
+```
+
### Define custom sample type colors
Define the colors of custom sample types in the patient view using a json object with for each sample type a color:
```
@@ -335,7 +344,7 @@ google_analytics_profile_id
## Password Authentication
-The portal supports password authentication via Google+. Before you start you need to setup a google account that will own the authentication API. Follow https://developers.google.com/identity/sign-in/web/devconsole-project to get clientID and secret. Fill it in portal.properties:
+The portal supports password authentication via Google+. Before you start you need to setup a google account that will own the authentication API. Follow https://developers.google.com/identity/sign-in/web/devconsole-project to get clientID and secret. Fill it in application.properties:
```
googleplus.consumer.key=195047654890-499gl89hj65j8d2eorqe0jvjnfaxcln0.apps.googleusercontent.com
@@ -346,7 +355,7 @@ googleplus.consumer.secret=2jCfg4SPWdGfXF44WC588dK
To activate password authentication follow the [Deployment with authentication steps](/deployment/deploy-without-docker/Deploying.md#required-login) and set `authenticate=googleplus`.
-In addition, set this property in `portal.properties`:
+In addition, set this property in `application.properties`:
```
app.name=cbioportal
@@ -459,11 +468,13 @@ These data formats are described in the [cBioPortal MAF specifications](/File-Fo
**Enabling custom annotations in the OncoPrint**
-To enable functionality for one or both types of custom annotations, enter values for the following properties. These labels will appear in the OncoPrint's "Mutation color" menu.
+To enable functionality for one or both types of custom annotations, enter values for the following properties. These values will appear in the OncoPrint's "Mutation color" menu, Patient View's (mutation, CNA, SV) tables, Results View's mutation table, and Group Comparison View's mutation table.
```
-oncoprint.custom_driver_annotation.binary.menu_label=Custom driver annotation
-oncoprint.custom_driver_annotation.tiers.menu_label=Custom driver tiers
+oncoprint.custom_driver_annotation.binary.menu_label=Custom Driver
+oncoprint.custom_driver_annotation.binary.menu_description=Custom driver tiers
+oncoprint.custom_driver_annotation.tiers.menu_label=Custom Driver Tiers
+oncoprint.custom_driver_annotation.tiers.menu_description=Custom driver tiers
```
**Automatic selection of OncoKB, hotspots and custom annotations**
@@ -547,7 +558,7 @@ This gene set will add the following in the query box:
## Cache Settings
-cBioPortal is supported on the backend with Ehcache or Redis. These caches are configurable from within portal.properties through the following properties.
+cBioPortal is supported on the backend with Ehcache or Redis. These caches are configurable from within application.properties through the following properties.
The cache type is set using `persistence.cache_type`. Valid values are `no-cache`, `redis` (redis), `ehache-heap` (ehcache heap-only), `ehache-disk` (ehcache disk-only), and `ehache-hybrid` (ehcache disk + heap). By default, `persistence.cache_type` is set to `no-cache` which disables the cache. When the cache is disabled, no responses will be stored in the cache.
@@ -778,4 +789,12 @@ By default, the studies loaded into a local cBioPortal instance are organized ba
```
priority_studies=
```
-The value of this variable will create a custom category with studies on the top of the study selector view. The format for the string should be category1#study1a,study1b,study1c;category2#study2 (e.g., PanCancer Studies#msk_impact_2017), where the ``category`` can be any string and the ``study`` should be the study ID of the required uploaded study.
\ No newline at end of file
+The value of this variable will create a custom category with studies on the top of the study selector view. The format for the string should be category1#study1a,study1b,study1c;category2#study2 (e.g., PanCancer Studies#msk_impact_2017), where the ``category`` can be any string and the ``study`` should be the study ID of the required uploaded study.
+
+## Study Tag functionality
+Study Tags allow portal maintainers to define miscellaneous descriptive meta data to studies, which will be shown to users in tooltips and are also searchable. This feature
+is on by default but can be disabled using the following property.
+```
+//boolean
+enable_study_tags=true|false
+```
diff --git a/docs/deployment/customization/portal.properties--Reference.md b/docs/deployment/customization/portal.properties--Reference.md
new file mode 100644
index 00000000000..b9b41085a55
--- /dev/null
+++ b/docs/deployment/customization/portal.properties--Reference.md
@@ -0,0 +1 @@
+This file has been depreciated and information about customizing cBioPortal can be found in [application.properties documentation](/deployment/customization/application.properties-Reference.md).
\ No newline at end of file
diff --git a/docs/deployment/customization/security.properties-Reference.md b/docs/deployment/customization/security.properties-Reference.md
index 1eede866e94..c63b828ed23 100644
--- a/docs/deployment/customization/security.properties-Reference.md
+++ b/docs/deployment/customization/security.properties-Reference.md
@@ -11,12 +11,32 @@ The following are the properties for configuring authentication and authorizatio
authenticate=false
```
### OAUTH2
+#### NOTE for Custom Authorization (validate users via db)
+```properties
+authenticate=oauth2
+authorization=true
+```
#### Google OAuth2 Client/Login Configuration
#### Example of utilizing google client for oAuth2 (Authentication)
```properties
spring.security.oauth2.client.registration.google.clientId=
spring.security.oauth2.client.registration.google.clientSecret=
+spring.security.oauth2.client.provider.google.user-name-attribute=email
+```
+
+### Microsoft OAUTH2 Multi-tenant Client/Login Config
+#### Example with Utilizing AzureAD for oAuth2
+```properties
+spring.security.oauth2.client.registration.azure.authorization-grant-type=authorization_code
+spring.security.oauth2.client.registration.azure.client-id=
+spring.security.oauth2.client.registration.azure.clientSecret=
+spring.security.oauth2.client.provider.azure.user-name-attribute=email
+spring.security.oauth2.client.registration.azure.redirect-uri=http://localhost:8080/login/oauth2/code/azure
+spring.security.oauth2.client.provider.azure.authorization-uri=https://login.microsoftonline.com/common/oauth2/v2.0/authorize
+spring.security.oauth2.client.provider.azure.token-uri=https://login.microsoftonline.com/common/oauth2/v2.0/token
+spring.security.oauth2.client.provider.azure.jwk-set-uri=https://login.microsoftonline.com/common/discovery/v2.0/keys
+spring.security.oauth2.client.registration.azure.scope=openid,profile,email
```
#### Custom OAUTH2 Client Configuration
@@ -46,6 +66,10 @@ spring.security.oauth2.client.registration.cbio-idp.client-secret=
```
### SAML Configuration
+#### Example to generate cert and key
+```shell
+openssl req -newkey rsa:2048 -nodes -keyout local.key -x509 -days 365 -out local.crt
+```
```properties
@@ -86,6 +110,8 @@ dat.oauth2.accessTokenUri=/.../token
dat.oauth2.userAuthorizationUri=/.../auth
dat.oauth2.jwkUrl=/.../certs
dat.oauth2.redirectUri=/.../api/data-access-token/oauth2
+spring.security.oauth2.resourceserver.jwt.issuer-uri=http://localhost:8081/realms/cbioportal
+
```
### Authorization Configuration/Study View Settings
@@ -100,4 +126,12 @@ always_show_study_group=PUBLIC
filter_groups_by_appname=false
# Can disable authorization
security.method_authorization_enabled=true
+```
+
+### CORS Configuration
+To Enable CORS set the allowed-origins urls. (comma delimited list)
+To enable all origins use *
+```properties
+security.cors.allowed-origins=*
+##Or http://localhost:8080,http://localhost:8081
```
\ No newline at end of file
diff --git a/docs/deployment/deploy-without-docker/Build-from-Source.md b/docs/deployment/deploy-without-docker/Build-from-Source.md
index 82b5529ffde..52625640bd1 100644
--- a/docs/deployment/deploy-without-docker/Build-from-Source.md
+++ b/docs/deployment/deploy-without-docker/Build-from-Source.md
@@ -2,37 +2,10 @@
## Building with Maven
-While building, you must point the environment variable `PORTAL_HOME` to
-the root directory containing the portal source code.
-
-For example, run a command like the following if on macOS:
-```
-export PORTAL_HOME=/Users/ecerami/dev/cbioportal
-```
-
-To compile the cBioPortal source code, move into the source directory and
-run the following maven command:
+To compile the cBioPortal source code, move into the root directory and run the following maven command:
```
mvn -DskipTests clean install
```
-After this command completes, you will find a `cbioportal.war` file suitable
-for Apache Tomcat deployment in `portal/target/`. It is not neccessary to
-install Tomcat yourself, since a command line runnable version of Tomcat is
-provided as a dependency in `portal/target/dependency/webapp-runner.jar`.
-
-However, if you will be deploying to a standalone Tomcat installation, and
-if you have configured Tomcat to use the Redisson client for user session
-management, you should expect a clash between the Redisson client being
-used for session management and the Redisson client which is embedded in
-the cbioportal.war file for the optional "redis" persitence layer caching
-mode. In this case, you should avoid using the "redis" option for the portal
-property `persistence.cache_type` and you should prevent the Redisson
-client from being packaged in cbioportal.war by building with this command
-instead:
-
-##### alternative for standalone tomcat deployments which use redis session management
-```
-mvn -Dexclude-redisson -DskipTests clean install
-```
+Note: cBioPortal 6.X requires Java 21
diff --git a/docs/deployment/deploy-without-docker/Deploying.md b/docs/deployment/deploy-without-docker/Deploying.md
index 246a9952705..ad4363f9c45 100644
--- a/docs/deployment/deploy-without-docker/Deploying.md
+++ b/docs/deployment/deploy-without-docker/Deploying.md
@@ -1,131 +1,45 @@
# Deploying the Web Application
-## Prepare the global configuration file
+## Before running cbioportal backend
-The portal is configured using a global configuration file, `portal.properties`. An example file is available in the `src/main/resources` folder. Use it as a template to create your own:
+You will need to update the src/main/resources/applications.properties to include your DB connection information.
-```
-cd src/main/resources
-cp portal.properties.EXAMPLE $HOME/cbioportal/portal.properties
-```
-
-For more information about the `portal.properties` file, see the [reference](/deployment/customization/Customizing-your-instance-of-cBioPortal.md) page.
+The configuration defined in `application.properties` can also be passed as command line arguments. The priority of property loading is as follows:
-Several scripts of cBioPortal use this `portal.properties` file to get info like db connection parameters. You can indicate the folder where this file is with an environment variable:
-
-```
-export PORTAL_HOME=$HOME/cbioportal
-```
+1. `-D` command line parameters overrides all
+2. `src/main/resources/application.properties`
+3. `application.properties` supplied at compile time
+4. Defaults defined in code
-if your properties file is at `PORTAL_HOME/portal.properties`
+Note that the `authenticate` property is currently required to be set as a command line argument, it won't work when set in `application.properties` (See issue [#6109](https://github.com/cBioPortal/cbioportal/issues/6109)).
-## Run cBioPortal Session Service
+Some scripts require a `${PORTAL_HOME}/application.properties` file, so it is best to define the properties there.
-The cBioPortal app requires [session service](/Architecture-Overview.md#session-service). For instructions on how to run this without Docker see https://github.com/cBioPortal/session-service#run-without-docker. Once this is working, update the properties file:
+For more information about the `application.properties` file, see the [reference](/deployment/customization/Customizing-your-instance-of-cBioPortal.md) page.
-```bash
-# session-service url: http://[host]:[port]/[session_service_app]/api/sessions/[portal_instance]/
-# example session-service url: http://localhost:8080/session_service/api/sessions/public_portal/
-# see: https://github.com/cBioPortal/session-service
-session.service.url=
-```
## Run the cbioportal backend
-To run the app we use `webapp-runner`. It's a command line version of Tomcat provided by [Heroku](https://github.com/jsimone/webapp-runner). All parameters can be seen with:
+To run the backend execute the following commabd
```
-java -jar portal/target/dependency/webapp-runner.jar --help
+java -jar target/cbioportal-exec.jar
```
-This runs the app in the foreground. If a port is already in use it will raise an error mentioning that. To change the port use the `--port` flag.
+This runs the app in the foreground. If a port is already in use it will raise an error mentioning that. To change the port use the `--server.port` flag.
-There are three main ways to run the portal: without authentication, with optional login and with required login. All of them require the cBioPortal session service to be running.
-### Without authentication
-In this mode users are able to use the portal, but they won't be able to save their own virtual studies and groups. See the [optional login section](#optional-login) to enable this.
-
-```bash
-java \
- -jar \
- -Dauthenticate=noauthsessionservice \
- portal/target/dependency/webapp-runner.jar \
- portal/target/cbioportal.war
-```
-
-### Optional login
-
-In this mode users can see all the data in the portal, but to save their own groups and virtual studies they are required to log in. This will allow them to store user data in the session service. See the [tutorials](https://www.cbioportal.org/tutorials) section to read more about these features.
-
-```bash
-java \
- -jar \
- -Dauthenticate=social_auth_google,social_auth_microsoft \
- portal/target/dependency/webapp-runner.jar \
- portal/target/cbioportal.war
-```
-
-Google and Microsoft live are supported as optional login currently. Possible values for authenticate are
-
-```bash
--Dauthenticate=social_auth_google,social_auth_microsoft
--Dauthenticate=social_auth_google
--Dauthenticate=social_auth_microsoft
-```
+There are three main ways to run the portal: without authentication, with optional login, and with required login. All of them require the cBioPortal session service to be running.
-One needs to set the Google/Microsoft related configurations in the `portal.properties` file:
+### Without authentication
-```
-#For Google
-googleplus.consumer.key=
-googleplus.consumer.secret=
+In this mode users are able to use the portal, but they won't be able to save their own virtual studies and groups.
-#For Microsoft
-microsoftlive.consumer.key=
-microsoftlive.consumer.secret=
```
-
-See [Google's Sign in Documentation](https://developers.google.com/identity/sign-in/web/sign-in#before\_you\_begin) to obtain these values.
-
-See [Microsoft Sign in Documentation](https://docs.microsoft.com/en-us/azure/active-directory/develop/scenario-web-app-sign-user-app-registration) to obtain these values.
-
-### Required login
-
-```bash
-java \
- -Dauthenticate=CHOOSE_DESIRED_AUTHENTICATION_METHOD \
- -jar \
- portal/target/dependency/webapp-runner.jar \
- portal/target/cbioportal.war
+java -jar target/cbioportal-exec.jar -Dauthenticate=false
```
-Change `CHOOSE_DESIRED_AUTHENTICATION_METHOD` to one of `googleplus`, `saml`, `openid`, `ad`, `ldap`. The various methods of authentication are described in the [Authorization and Authentication](/deployment/authorization-and-authentication) section.
-
-### Property configuration
-
-The configuration defined in `portal.properties` can also be passed as command line arguments. The priority of property loading is as follows:
-
-1. `-D` command line parameters overrides all
-2. `${PORTAL_HOME}/portal.properties`
-3. `portal.properties` supplied at compile time
-4. Defaults defined in code
-
-Note that the `authenticate` property is currently required to be set as a command line argument, it won't work when set in `portal.properties` (See issue [#6109](https://github.com/cBioPortal/cbioportal/issues/6109)).
-
-Some scripts require a `${PORTAL_HOME}/portal.properties` file, so it is best to define the properties there.
-
-### Note for Tomcat Deployers
-
-Before we were using `webapp-runner`, our documentation recommended a system level installed Tomcat. In this case people might have been using `dbconnector=jndi` instead of the new default `dbconnector=dbcp`. There is a known issue where setting dbconnector in the properties file does not work ([#6148](https://github.com/cBioPortal/cbioportal/issues/6148)). It needs to be set as a command line argument. For Tomcat this means `CATALINA_OPT="-Ddbconnector=jndi"`.
-
-## Verify the Web Application
-
-Lastly, open a browser and go to:\
-[http://localhost:8080](http://localhost:8080)
-
-## Important
+### With authentication
-* Each time you modify any java code, you must recompile and redeploy the app.
-* Each time you modify any properties (see customization options), you must restart the app
-* Each time you add new data, you must restart the app or call the `/api/cache` endpoint with a `DELETE` http-request (see [here](/deployment/customization/portal.properties-Reference.md#evict-caches-with-the-apicache-endpoint) for more information).
+To configure the authentication and authorization please consult the [Authorization](./../authorization-and-authentication/User-Authorization.md) and [Authentication](./../authorization-and-authentication/Authenticating-and-Authorizing-Users-via-keycloak.md) Sections.
diff --git a/docs/deployment/deploy-without-docker/Import-the-Seed-Database.md b/docs/deployment/deploy-without-docker/Import-the-Seed-Database.md
index 8e2453a34a6..fdab0c8463e 100644
--- a/docs/deployment/deploy-without-docker/Import-the-Seed-Database.md
+++ b/docs/deployment/deploy-without-docker/Import-the-Seed-Database.md
@@ -39,11 +39,12 @@ After download, the files can be unzipped by entering the following command:
4. (optional : support for microRNA genomic profiles) Import constructed gene table records for microRNA genomic profiles. Currently, cBioPortal supports the combined display of copy number alterations (generally reported for microRNA precursors) and expression (generally reported for microRNA mature forms) by adding gene table records which represent the combination of microRNA precursor and microRNA mature form. Appropriate aliases are added to the gene_alias table so that both the name of the precursor and the name of the mature form are recognized references to the combination.
- After the code has been successfully configured and built, you can import the needed microRNA records by running the following command from the $PORTAL_HOME directory:
+This involves downloading the cBioPortal Core code located [here](https://github.com/cBioPortal/cbioportal-core).
+
+After the code has been successfully configured and built, you can import the needed microRNA records by running the following command from the cBioPortal core directory:
- ```
java -cp scripts/target/scripts-*.jar org.mskcc.cbio.portal.scripts.ImportGeneData -microrna core/src/main/resources/micrornas.tsv
- ```
+
**Important:** Please be aware of the version of the seed database. In the [README on datahub](https://github.com/cbioportal/datahub/blob/master/seedDB/README.md), we stated which version of cBioPortal is compatible with the current seed database.
diff --git a/docs/deployment/deploy-without-docker/Load-Sample-Cancer-Study.md b/docs/deployment/deploy-without-docker/Load-Sample-Cancer-Study.md
index b328c2953c3..37c653026de 100644
--- a/docs/deployment/deploy-without-docker/Load-Sample-Cancer-Study.md
+++ b/docs/deployment/deploy-without-docker/Load-Sample-Cancer-Study.md
@@ -4,13 +4,25 @@ Once you have confirmed that the cBioPortal server is installed,
you are ready to import data. Importing a sample study is recommended
to verify that everything is working correctly.
-The cBioPortal distribution includes a [small dummy study, `study_es_0`](https://github.com/cBioPortal/cbioportal/tree/master/core/src/test/scripts/test_data/study_es_0), which contains all datatypes supported by cBioPortal. This document describes how to import the prerequisites for the sample study and how to import the study itself.
+cBioPortal Core has a [small dummy study, `study_es_0`](https://https://github.com/cBioPortal/cbioportal-core/tree/main/src/test/scripts/test_data/study_es_0), which contains all datatypes supported by cBioPortal. This document describes how to import the prerequisites for the sample study and how to import the study itself.
+
+
+## Download and Build cBioPortal Core
+
+```
+ git clone https://github.com/cBioPortal/cbioportal-core.git
+ cd cbioportal-core
+ git checkout main
+ mvn -DskipTests clean install
+```
+
+
## Set the PORTAL_HOME environment variable
Most cBioPortal command-line tools, including the data loading pipeline,
expect the environment variable `$PORTAL_HOME` to point to a folder
-containing the `portal.properties` configuration file,
+containing the `application.properties` configuration file,
as explained during [the previous step](./Deploying.md).
Configure your shell to keep the variable set to the right folder.
@@ -26,13 +38,13 @@ export PORTAL_HOME=/Users/johndoe/cbioportal
The sample gene panel has to be imported before gene panel study data can be added to the database.
```
-cd /core/src/main/scripts
+cd cbioportal-core/src/main/resources/scripts
./importGenePanel.pl --data ../../test/scripts/test_data/study_es_0/data_gene_panel_testpanel1.txt
./importGenePanel.pl --data ../../test/scripts/test_data/study_es_0/data_gene_panel_testpanel2.txt
```
After loading gene panels into the database, please restart Tomcat or call the `/api/cache` endpoint with a `DELETE` http-request
-(see [here](/deployment/customization/portal.properties-Reference.md#evict-caches-with-the-apicache-endpoint) for more information)
+(see [here](/deployment/customization/application.properties-Reference.md#evict-caches-with-the-apicache-endpoint) for more information)
so that the validator can retrieve gene panel information from the cBioPortal API.
More details to load your own gene panel and gene set data can be found here: [Import Gene Panels](/Import-Gene-Panels.md).
@@ -44,7 +56,7 @@ First it's useful to validate the study `study_es_0`, to check if the data is fo
To do so, go to the importer folder:
```
-cd /core/src/main/scripts/importer
+cd cbioprtal-core/src/main/scripts/importer
```
and then run the following command:
@@ -64,7 +76,7 @@ Validation of study succeeded with warnings.
To import the sample study:
```
-cd /core/src/main/scripts/importer
+cd cbioportal-core/src/main/scripts/importer
```
and then run the following command:
@@ -81,4 +93,4 @@ Total time: 7742 ms
```
After loading the study data, please restart the app or call the `/api/cache` endpoint with a `DELETE` http-request
-(see [here](/deployment/customization/portal.properties-Reference.md#evict-caches-with-the-apicache-endpoint) for more information).
+(see [here](/deployment/customization/application.properties-Reference.md#evict-caches-with-the-apicache-endpoint) for more information).
diff --git a/docs/deployment/deploy-without-docker/Pre-Build-Steps.md b/docs/deployment/deploy-without-docker/Pre-Build-Steps.md
index b2a48bd78ca..dfb7cf2c7e9 100644
--- a/docs/deployment/deploy-without-docker/Pre-Build-Steps.md
+++ b/docs/deployment/deploy-without-docker/Pre-Build-Steps.md
@@ -5,6 +5,7 @@
Make sure that you have cloned the last code, and make sure you are on the `master` branch:
```
git clone https://github.com/cBioPortal/cbioportal.git
+ cd cbioportal
git checkout master
```
@@ -23,6 +24,17 @@ log config, which you can then override easily.
To modify the logging during tests the same EXAMPLE file can be copied to the relevant test resources folder.
+## Prepare the global configuration file
+
+The portal is configured using a global configuration file, `application.properties`. An example file is available in the `src/main/resources` folder. Use it as a template to create your own:
+
+```
+cd src/main/resources
+cp application.properties.EXAMPLE application.properties
+```
+
+For more information about the `application.properties` file, see the [reference](/deployment/customization/Customizing-your-instance-of-cBioPortal.md) page.
+
## Create the cBioPortal MySQL Databases and User
You must create a `cbioportal` database and a `cgds_test` database within MySQL, and a user account with rights to access both databases. This is done via the `mysql` shell.
@@ -42,13 +54,13 @@ You must create a `cbioportal` database and a `cgds_test` database within MySQL,
mysql> create database cgds_test;
Query OK, 1 row affected (0.00 sec)
- mysql> CREATE USER 'cbio_user'@'localhost' IDENTIFIED BY 'somepassword';
+ mysql> CREATE USER 'cbio'@'localhost' IDENTIFIED BY 'P@ssword1';
Query OK, 0 rows affected (0.00 sec)
- mysql> GRANT ALL ON cbioportal.* TO 'cbio_user'@'localhost';
+ mysql> GRANT ALL ON cbioportal.* TO 'cbio'@'localhost';
Query OK, 0 rows affected (0.00 sec)
- mysql> GRANT ALL ON cgds_test.* TO 'cbio_user'@'localhost';
+ mysql> GRANT ALL ON cgds_test.* TO 'cbio'@'localhost';
Query OK, 0 rows affected (0.00 sec)
mysql> flush privileges;
diff --git a/docs/deployment/deploy-without-docker/Software-Requirements.md b/docs/deployment/deploy-without-docker/Software-Requirements.md
index d6b2fed8815..813caad7366 100644
--- a/docs/deployment/deploy-without-docker/Software-Requirements.md
+++ b/docs/deployment/deploy-without-docker/Software-Requirements.md
@@ -16,13 +16,13 @@ The session service uses MongoDB 3.6.6
## Java
-As of this writing, the cBioPortal can be compiled and run from Java 11 and above. The software can be found and download from the [Oracle](https://www.oracle.com/us/technologies/java/overview/index.html) website.
+cBioPortal requires Java 12 and above. The software can be found and download from the [Oracle](https://www.oracle.com/us/technologies/java/overview/index.html) website.
On Ubuntu: ```sudo apt-get install default-jdk```
## Apache Maven
-The cBioPortal source code is an [Apache Maven](https://maven.apache.org/) driven project. The software needs to be downloaded and installed prior to building the application from source code. It can be found on the [Apache Maven](https://maven.apache.org/download.cgi) website. We are currently using version 3.5.4.
+The cBioPortal source code is an [Apache Maven](https://maven.apache.org/) driven project. The software needs to be downloaded and installed prior to building the application from source code. It can be found on the [Apache Maven](https://maven.apache.org/download.cgi) website. We are currently using version 3.9.5.
On Ubuntu: ```sudo apt-get install maven```
diff --git a/docs/deployment/docker/README.md b/docs/deployment/docker/README.md
index 384b27423f4..c485500e9cf 100644
--- a/docs/deployment/docker/README.md
+++ b/docs/deployment/docker/README.md
@@ -108,17 +108,17 @@ or
All public studies can be downloaded from https://www.cbioportal.org/datasets, or https://github.com/cBioPortal/datahub/. You can add any of them to the `./study` folder and import them. There's also a script (`./study/init.sh`) to download multiple studies. You can set `DATAHUB_STUDIES` to any public study id (e.g. `lgg_ucsf_2014`) and run `./init.sh`.
##### Notes on restarting
-To avoid having to restart one can alternatively hit an API endpoint. To do so, call the `/api/cache` endpoint with a `DELETE` http-request (see [here](/deployment/customization/portal.properties-Reference.md#evict-caches-with-the-apicache-endpoint) for more information):
+To avoid having to restart one can alternatively hit an API endpoint. To do so, call the `/api/cache` endpoint with a `DELETE` http-request (see [here](/deployment/customization/application.properties-Reference.md#evict-caches-with-the-apicache-endpoint) for more information):
```
curl -x DELETE -H "X-API-KEY: my-secret-api-key-value" http://localhost:8080/api/cache
```
-The value of the API key is configured in the _portal.properties_ file. You can visit http://localhost:8080 again and you should be able to see the new study.
+The value of the API key is configured in the _application.properties_ file. You can visit http://localhost:8080 again and you should be able to see the new study.
-#### Step 3 - Customize your portal.properties file ###
+#### Step 3 - Customize your application.properties file ###
-The properties file can be found in `./config/portal.properties`. Which was set up when running `init.sh`.
+The properties file can be found in `./config/application.properties`. Which was set up when running `init.sh`.
This properties file allows you to customize your instance of cBioPortal with e.g. custom logos, or point the cBioPortal container to e.g. use an external mysql database. See the [properties](/deployment/customization/Customizing-your-instance-of-cBioPortal.md) documentation for a comprehensive overview.
diff --git a/docs/deployment/integration-with-other-webservices/OncoKB-Data-Access.md b/docs/deployment/integration-with-other-webservices/OncoKB-Data-Access.md
index adda174d2a3..ee40a2bff47 100644
--- a/docs/deployment/integration-with-other-webservices/OncoKB-Data-Access.md
+++ b/docs/deployment/integration-with-other-webservices/OncoKB-Data-Access.md
@@ -9,7 +9,7 @@ If you want to include tumor type summary, therapeutic levels and more, please c
3. You can find your token in your [Account Settings](https://www.oncokb.org/account/settings) after login.
# Set up cBioPortal to include full OncoKB content
-Following properties can be edited in the `portal.properties` file or set in system variables if you are using docker.
+Following properties can be edited in the `application.properties` file or set in system variables if you are using docker.
- `show.oncokb` should be set to `true`
- `oncokb.token` should be set to a valid OncoKB access token value
- `oncokb.public_api.url` should be set to `https://www.oncokb.org/api/v1`
@@ -23,4 +23,4 @@ For TMB-H, a clinical attribute TMB_SCORE with value >=10 is required.
# Disable OncoKB Service
-Please set `show.oncokb` to `false` in `portal.properties` or in system variables if you are using docker.
+Please set `show.oncokb` to `false` in `application.properties` or in system variables if you are using docker.
diff --git a/docs/development/Deployment-Procedure.md b/docs/development/Deployment-Procedure.md
index 1aabe789247..c37eed94935 100644
--- a/docs/development/Deployment-Procedure.md
+++ b/docs/development/Deployment-Procedure.md
@@ -5,16 +5,12 @@ see e.g. [Deploying the web application](/deployment/deploy-without-docker/Deplo
Docker](/deployment/docker/).
We deploy the master branch of backend and the master branch of frontend to
-production. The public portal (https://www.cbioportal.org) runs on AWS inside
-kubernetes. The configuration can be found in the knowledgesystems repo:
+production. The public portal (https://www.cbioportal.org) runs on AWS EKS. The configuration
+can be found in the knowledgesystems repo:
https://github.com/knowledgesystems/knowledgesystems-k8s-deployment
-Other portals run at MSKCC on two internal machines called dashi and dashi2.
-Since we're running several apps in several tomcats internally the procedure
-for updating them is different from the public portal on AWS. The configuration
-is in the mercurial portal-configuration repo. To make changes, ask Ben for
-access.
+Other internal MSK portals run on AWS EKS as well.
The frontend and backend can be upgraded independently. We have the following
events that can require a new deployment:
@@ -40,7 +36,7 @@ This should be a URL pointing to netlify.
### Internal Portal Frontend URL
For the internally runnning portals the frontend.url is defined in the
-portal.properties file in the mercurial portal-configuration repo. If set up
+application.properties file in the mercurial portal-configuration repo. If set up
correctly, this should point to a file on both dashi and dashi2 that in turn
points to a netlify frontend URL. The reason we have a separate file with the
URL in it is that it allows us to update the frontend URL without redeploying
@@ -56,13 +52,12 @@ Once the backend repo has been tagged on github, a docker image gets build on Do
After that, if you have access to the kubernetes cluster you can change the image in the configuration of the kubernetes cluster:
-
-https://github.com/knowledgesystems/knowledgesystems-k8s-deployment/blob/master/cbioportal/cbioportal_spring_boot.yaml
+https://github.com/knowledgesystems/knowledgesystems-k8s-deployment/blob/master/public-eks/cbioportal-prod/cbioportal_spring_boot.yaml
point this line, to the new tag on docker hub e.g.:
```
-image: cbioportal/cbioportal:3.0.3-web-shenandoah
+image: cbioportal/cbioportal:6.0.2-web-shenandoah
```
Make sure it is an image with the postfix `-web-shenandoah`. This is the image that only has the web part of cBioPortal and uses the shenandoah garbage collector.
@@ -76,7 +71,7 @@ Also remove the `-Dfrontend.url` parameter such that the frontend version inside
Then running this command applies the changes to the cluster:
```
-kubectl apply -f cbioportal/cbioportal_spring_boot.yaml
+kubectl apply -f public-eks/cbioportal-prod/cbioportal_spring_boot.yaml
```
You can keep track of what's happening by looking at the pods:
@@ -109,71 +104,9 @@ Make sure to commit your changes to the knowledgesystems-k8s-deployment repo
and push them to the main repo, so that other people making changes to the
kubernetes config will be using the latest version.
-### Private Portal Backend Upgrade
-First update the frontend portal configuration to point to a new file. It's
-fine if this file does not exist yet, because if it doesn't the frontend
-bundled with the war will be used. We can later point the file to netlify, once
-we've determined everything looks ok.
-
-You can use this for loop to update the frontend url in all properties files
-(set it to a file that doesn't exist yet and give it a sensible name e.g. `frontend_url_version_x_y_z.txt`):
-
-```
-for f in $(grep frontend.url.runtime properties/*/portal.properties | grep -v beta | cut -d: -f1); do sed -i 's|frontend.url.runtime=/srv/www/msk-tomcat/frontend_url_version_2_0_0.txt|frontend.url.runtime=/srv/www/msk-tomcat/frontend_url_version_2_1_0.txt|g' $f; done
-```
-Same for triage-tomcat (agin set the correct file name)::
-
-```
- for f in $(grep frontend.url.runtime properties/*/portal.properties | grep -v beta | cut -d: -f1); do sed -i 's|frontend.url.runtime=/srv/www/triage-tomcat/frontend_url_version_2_0_0.txt|frontend.url.runtime=/srv/www/triage-tomcat/frontend_url_version_2_1_0.txt|g' $f; done
-```
-
-Make sure you see the frontend url file updated correctly:
-
-```
-hg diff
-```
-
-Then commit and push your changes to the mercurial repo:
-```
-hg commit -u username -m 'update frontend url files for new release'
-hg push
-```
-
-If you have your public key added for the relevant deploy scripts you should be able to deploy with the following command on dashi-dev:
-
-```
-# set PROJECT_CONFIG_HOME and PORTAL_HOME to your own directory
-unset PROJECT_VERSION && export PORTAL_HOME=/data/debruiji/git/cbioportal && export PORTAL_CONFIG_HOME=/data/debruiji/hg/portal-configuration && cd ${PORTAL_CONFIG_HOME}/buildwars && hg pull && hg update && export JAVA_HOME=/usr/lib/jvm/java-1.8.0-openjdk.x86_64 && bash buildproductionwars.sh master && bash ${PORTAL_CONFIG_HOME}/deploywars-remotely/deployproductionportals.sh
-```
-
-If you don't have a SSH key set up to run the deploy script ask Ino.
-
-If everything looks ok you can update the frontend url file to point to
-netlify. Log in to dashi and become msk-tomcat with `sudo su - msk-tomcat`.
-Then change the update script:
-
-```
-vi /data/cbio-portal-data/portal-configuration/deploy-scripts/updatefrontendurl.sh
-```
-to point `oldurlfile=/srv/www/msk-tomcat/frontend_url_version_2_0_0.txt` to the
-new frontend url file you supplied above.
-
-Then update the url like:
-
-```
-./updatefrontendurl.sh "https://frontend.cbioportal.org"
-```
-
-Do the same thing on dashi2.
-
-The last step is to modify the frontend url file for the triage portal. Log in to the pipelines machine, log in as triage-tomcat user: `sudo su - triage-tomcat`, and update the frontend url file there:
-
-```
-echo 'https://frontend.cbioportal.org' > /srv/www/triage-tomcat/frontend_url_version_2_1_0.txt
-```
## Upgrading Related Backend Components
-Backend upgrades involving the database schema, DAO classes, etc. require updates to databases and importers. CBioPortal has multiple databases (located both internally on pipelines and in AWS) backing different portals. Similarly there are multiple importers responsible for loading portal-specific data. Every database must be manually migrated on an individual basis; all importers/data fetchers can be updated simultaenously through an existing deployment script.
+Backend upgrades involving the database schema, DAO classes, etc. require updates to databases and importers. CBioPortal has multiple MySQL databases (all using AWS RDS) backing different portals. Similarly, there are multiple importers responsible for loading portal-specific data. Every database must be manually migrated on an individual basis; all importers/data fetchers can be updated simultaneously through an existing deployment script.
Before upgrading, make sure to turn off import jobs in the crontab and alert the backend pipelines team (Avery, Angelica, Rob, Manda).
diff --git a/docs/development/Release-Procedure.md b/docs/development/Release-Procedure.md
index cec9d32f48a..28e405fc48d 100644
--- a/docs/development/Release-Procedure.md
+++ b/docs/development/Release-Procedure.md
@@ -7,7 +7,7 @@ We have release procedures for the following scenarios:
## cBioPortal community release of code already in production
-We often run code in production that is not ready yet for use by the wider cBioPortal community. We deploy to production what's in the master branch of the backend repo and the frontend repo. Often times this is not a tagged release. At some point this code should be released for the wider community. These are the steps we follow:
+We often run code in production that is not ready yet for use by the wider cBioPortal community. The frontend gets deployed to production after every merge to master. The backend gets updated every Tuesday before our community call (occasionally more frequently too if issues are identified). We tag whatever is in the master and frontend repo and put a "Pre-Release" indication on it. After a month of stable usage in production, one of the tags will get the "latest" indication on the GitHub. These are the steps we follow to create a release:
1. Create a new frontend tag. The releases can be found here: https://github.com/cBioPortal/cbioportal-frontend/releases. A draft of the release notes are automatically generated by https://github.com/marketplace/actions/release-drafter. If there are pull requests in the `Changes` section i.e. they have not been labeled with one of the labels defined [here](https://github.com/cBioPortal/cbioportal-frontend/blob/master/.github/release-drafter.yml). Try to label them and trigger a rerun by committing something to the master branch. Alternatively you can manually put them in a particular section. Note that our goal is to have automated release notes, so it would be great if you could send a PR to update the [release-drafter.yml](https://github.com/cBioPortal/cbioportal-frontend/blob/master/.github/release-drafter.yml) in case you find certain PRs don't fit in a particular section or a section should be altered. Look at other release notes for inspiration: https://github.com/cBioPortal/cbioportal-frontend/releases. You can save your work as a draft if necessary.
2. Once the frontend code is tagged, create a pull request to the backend repo where the frontend version is incremented in `portal/pom.xml`:
@@ -26,6 +26,9 @@ We often run code in production that is not ready yet for use by the wider cBioP
then put them in the right sections following same style as other releases: https://github.com/cBioPortal/cbioportal-frontend/releases.
4. Create a news item with a link to your carefully crafted release notes. Highlight a few major changes that could be interesting to users of cBioPortal ideally with a screenshot similar to: https://github.com/cBioPortal/cbioportal/pull/6914/files?short\_path=6f95322#diff-6f953229832059bab3fe229d4af08b52 (in the files changed section, you can click on view rich diff to see the converted markdown).
+## Backend Hotfixes
+Occasionally there are bugs identified in the backend running in production. Creating an entire new release can be cumbersome so in this case, we create a new release branch instead. E.g. if the current release is `6.0.2`, the new branch would be `release-6.0.3`. Any fixes are then merged to this branch and if it looks good, they are deployed to production. On the following Tuesday whatever's in this `release-x` branch get merged to master and included in that Tuesday's release.
+
## Release with database migration
For releases with database migrations, we increase the MINOR number in MAJOR.MINOR.PATCH. For those releases we have a separate branch (see https://github.com/cBioPortal/cbioportal/blob/master/CONTRIBUTING.md#branches-within-cbioportal), which needs to be merged to master on both backend and frontend:
diff --git a/docs/development/feature-development-guide.md b/docs/development/feature-development-guide.md
index 2ef0acf99de..5a9ddcc75b2 100644
--- a/docs/development/feature-development-guide.md
+++ b/docs/development/feature-development-guide.md
@@ -4,9 +4,9 @@ This is a guide for developers that are implementing a new feature.
## Before Implementation
-As a first step it is important to determine how complex the proposed feature is. Incremental improvements on existing features are often easier to accomplish and require input from fewer people. Most minor changes can be submitted as a Pull Request. If the proposed feature would require one or more days of work it makes sense to connect on [slack](https://slack.cbioportal.org) to discuss the idea. For more complex new features that require weeks of work or more, it is best to get input from several people in the cBioPortal community, including people with a deep understanding of the cBioPortal product and its users as well as the engineers that write the software. In that case we often start out with a Request For Comments document that describes the feature in more detail, see [our list of RFCs ](RFC-List.md)for some examples. The community can then help guide the feature development in the right direction.
+As a first step it is important to determine how complex the proposed feature is. Incremental improvements on existing features are often easier to accomplish and require input from fewer people. Most minor changes can be submitted as a Pull Request. If the proposed feature would require one or more days of work it makes sense to connect on [slack](https://slack.cbioportal.org) to discuss the idea. For more complex new features that require weeks of work or more, it is best to get input from several people in the cBioPortal community, including people with a deep understanding of the cBioPortal product and its users as well as the engineers that write the software. In that case we often start out with a Request For Comments document that describes the feature in more detail, see [our list of RFCs ](../RFC-List.md)for some examples. The community can then help guide the feature development in the right direction.
-During this process you will most likely receive some pointers which part of the stack you will be editing (see [Architecture Overview](Architecture-Overview.md)). This will be helpful when actually starting your implementation and figuring out how to set up your development environment. For many features it is not necessary to understand all parts of the stack, so seeking out advice on this is highly recommended.
+During this process you will most likely receive some pointers which part of the stack you will be editing (see [Architecture Overview](../Architecture-Overview.md)). This will be helpful when actually starting your implementation and figuring out how to set up your development environment. For many features it is not necessary to understand all parts of the stack, so seeking out advice on this is highly recommended.
Before you start implementing a more complex feature, ideally many of these things are clear:
diff --git a/docs/mutation-data-transcript-annotation.md b/docs/mutation-data-transcript-annotation.md
index 8fb15021f00..f19cc74daa2 100644
--- a/docs/mutation-data-transcript-annotation.md
+++ b/docs/mutation-data-transcript-annotation.md
@@ -42,7 +42,7 @@ starting from scratch, since these are more up to date and correspond to transcr
clinical sequencing at MSKCC. The `uniprot` set of transcripts was constructed several years ago, but we are no longer
certain about the logic on how to reconstruct them hence they are not being kept up to date. One can see the
differences between the two in [this file](https://github.com/cBioPortal/cbioportal-frontend/files/9498680/genes_with_different_uniprot_mskcc_isoforms.txt). For the public cBioPortal (https:
-//www.cbioportal.org) and [datahub](https://github.com/cBioPortal/datahub/tree/master/public) we are using `mskcc`, for the GENIE cBioPortal (https://genie.cbioportal.org) we still use `uniprot`. As of cBioPortal v5 the default is `mskcc` for local installations. Prior to v5 it was `uniprot`. We recommend that people upgrading to v5 consider migrating to `mskcc` as well (see [migration guide](https://docs.cbioportal.org/migration-guide/) and [the properties reference docs](https://docs.cbioportal.org/deployment/customization/portal.properties-reference/#properties)).
+//www.cbioportal.org) and [datahub](https://github.com/cBioPortal/datahub/tree/master/public) we are using `mskcc`, for the GENIE cBioPortal (https://genie.cbioportal.org) we still use `uniprot`. As of cBioPortal v5 the default is `mskcc` for local installations. Prior to v5 it was `uniprot`. We recommend that people upgrading to v5 consider migrating to `mskcc` as well (see [migration guide](https://docs.cbioportal.org/migration-guide/) and [the properties reference docs](https://docs.cbioportal.org/deployment/customization/application.properties-reference/#properties)).
#### How default transcript assignment affects the Mutations Tab
@@ -52,7 +52,7 @@ protein position found in the cBioPortal database. For the [public cBioPortal](h
data in MAF format are annotated using [Genome Nexus](https://www.genomenexus.org) to add the gene and protein change
columns. This is then imported into the cBioPortal database. Whether you choose to use the set of `uniprot` or `mskcc`
transcripts, make sure to indicate it in the [Genome Nexus Annotation Pipeline](https://github.com/genome-nexus/genome-
-nexus-annotation-pipeline#maf-annotation)(`--isoform-override `) when annotating as well as in [the properties file](https://docs.cbioportal.org/deployment/customization/portal.properties-reference/#properties)
+nexus-annotation-pipeline#maf-annotation)(`--isoform-override `) when annotating as well as in [the properties file](https://docs.cbioportal.org/deployment/customization/application.properties-reference/#properties)
of cBioPortal. That way the [Mutations Tab](https://bit.ly/39hVtDd) will show the correct canonical
transcript. Note that whenever somebody uses the dropdown on the Mutations Tab to change the displayed transcript,
Genome Neuxs re-annotates all mutations on the fly. The browser sends over the genomic location (chrom,start,end,ref,
@@ -65,4 +65,4 @@ We are planning to move to a single set of default transcripts over time. Prior
facing portals and local installations. Our plan is to use `mskcc` everywhere and eventually we will most likely move to [MANE](https://www.ensembl.org/info/genome/genebuild/mane.html). MANE is only
available for grch38 and since most of our data is for grch37 this is currently not feasible. Whichever set of
transcripts you choose to use, make sure to indicate so in the [Genome Nexus Annotation Pipeline](https://github.com/genome-nexus/genome-nexus-annotation-pipeline#maf-annotation) (`--isoform-override `) and put the same
-set of transcripts in [the properties file](https://docs.cbioportal.org/deployment/customization/portal.properties-reference/#properties) of cBioPortal, such that the [Mutations Tab](https://bit.ly/39hVtDd) will show the correct canonical transcript (currently defaults to `mskcc`). The re-annotation of mutations only happens once a user clicks to change the transcript, which is why it's important that the protein change in the database is for the specific transcript displayed first.
+set of transcripts in [the properties file](https://docs.cbioportal.org/deployment/customization/application.properties-reference/#properties) of cBioPortal, such that the [Mutations Tab](https://bit.ly/39hVtDd) will show the correct canonical transcript (currently defaults to `mskcc`). The re-annotation of mutations only happens once a user clicks to change the transcript, which is why it's important that the protein change in the database is for the specific transcript displayed first.
diff --git a/docs/user-guide/overview.md b/docs/user-guide/overview.md
index ae18a16339e..6ff6f649d94 100644
--- a/docs/user-guide/overview.md
+++ b/docs/user-guide/overview.md
@@ -1,4 +1,4 @@
-## Overview of Resources
+## Tutorials
### Tutorial Slides
These tutorial slides contain annoted screenshots to walk you through using the cBioPortal site.
@@ -35,6 +35,7 @@ Short videos that show how to perform specific analyses or how to use specific p
* Onco Query Language [OQL](/user-guide/oql.md)
### Publications
+* de Bruijn et al. Cancer Research (2023) [PubMed](https://pubmed.ncbi.nlm.nih.gov/37668528/)
* Cerami et al. Cancer Discovery 2012 [PubMed](http://cancerdiscovery.aacrjournals.org/content/2/5/401.abstract)
* Gao et al. Science Signaling 2013 [PubMed](https://www.ncbi.nlm.nih.gov/pubmed/23550210)
diff --git a/docs/web-API-and-Clients.md b/docs/web-API-and-Clients.md
index 762f0da3649..5ce1ac34590 100644
--- a/docs/web-API-and-Clients.md
+++ b/docs/web-API-and-Clients.md
@@ -115,14 +115,17 @@ muts = cbioportal.mutations.getMutationsInMolecularProfileBySampleListIdUsingGET
For a portal that requires authentication one can use (see [Data Access Using Tokens](/deployment/authorization-and-authentication/Authenticating-Users-via-Tokens.md)):
```
-headers = {
- 'Authorization': 'Bearer 63efa81c-2490-4e15-9d1c-fb6e8e50e35d'
-}
-requestOptions = {
- 'headers': headers,
-}
+from bravado.client import SwaggerClient
+from bravado.requests_client import RequestsClient
+
+http_client = RequestsClient()
+http_client.set_api_key(
+ 'genie.cbioportal.org', 'Bearer ',
+ param_name='Authorization', param_in='header'
+)
+
cbioportal = SwaggerClient.from_url('https://genie.cbioportal.org/api/v2/api-docs',
- request_headers=headers,
+ http_client=http_client,
config={"validate_requests":False,
"validate_responses":False,
"validate_swagger_spec": False}
diff --git a/pom.xml b/pom.xml
index 575da41b367..0cc9b9c0110 100644
--- a/pom.xml
+++ b/pom.xml
@@ -12,31 +12,32 @@
org.cbioportalcbioportal
- 6.0.0-SNAPSHOT
+ 6.0.6-SNAPSHOTcBioPortal for Cancer Genomics
- 21
- 21
-
+ 21
+ 21
+ 21
+ 21
+ 21yyyyMMdd-HHmm${maven.build.timestamp}com.github.cbioportal
- v5.4.9
+ v6.0.5
-
+
2.13.11.1.6.RELEASE
-
2.12.5
- 5.1.48
+ 8.0.283.0.0UTF-8UTF-8
@@ -46,8 +47,17 @@
${project.groupId}:${project.artifactId}cbioportalhttps://sonarcloud.io
+ **src/test/**/*.*
+
+
+ 0.8.11
+ jacoco
+ reuseReports
+ java
+
+ ${project.basedir}/target/site/jacoco/jacoco.xml
+
-
com.mysql.jdbc.Driver
@@ -63,8 +73,8 @@
1.6.33.0.2
- 1.16.2
- 5.8.0
+ 1.19.4
+ 5.15.04.1.1
@@ -83,9 +93,11 @@
1.1.13.12.140.8.2
- 5.1.48
- 1.8.1
+ 8.0.33
+ 3.2.03.14.0
+ 4.17.0
+ 7.1.0
@@ -103,11 +115,11 @@
spring-boot-starter-testtest
-
- org.junit.vintage
- junit-vintage-engine
- test
-
+
+ org.junit.vintage
+ junit-vintage-engine
+ test
+ org.slf4jslf4j-api
@@ -178,10 +190,6 @@
jjwt-jackson${io-jsonwebtoken.version}
-
- org.springframework.boot
- spring-boot-starter-data-mongodb
- org.mongodbbson
@@ -239,6 +247,16 @@
org.springframework.securityspring-security-web
+
+ org.springframework.security
+ spring-security-jwt
+ 1.1.1.RELEASE
+
+
+ com.auth0
+ jwks-rsa
+ 0.22.1
+ mysqlmysql-connector-java
@@ -248,23 +266,17 @@
org.springframework.bootspring-boot-starter-thymeleaf
-
- com.github.dasniko
- testcontainers-keycloak
- ${dasniko-testcontainer-keycload.version}
- test
- org.springframework.securityspring-security-testtest
-
- org.seleniumhq.selenium
- selenium-chrome-driver
- ${selenium_chrome_driver.version}
- test
-
+
+ org.seleniumhq.selenium
+ selenium-java
+ ${selenium.version}
+ test
+ org.testcontainerstestcontainers
@@ -275,7 +287,24 @@
mysqltest
-
+
+ org.testcontainers
+ mockserver
+ test
+
+
+ org.mock-server
+ mockserver-client-java
+ ${mockserver.version}
+ test
+
+
+ com.github.dasniko
+ testcontainers-keycloak
+ ${dasniko-testcontainer-keycloak.version}
+ test
+
+ org.testcontainersseleniumtest
@@ -292,35 +321,52 @@
maven-simple0.1
-
-
- org.springframework.boot
- spring-boot-starter-oauth2-client
-
-
- org.springframework.boot
- spring-boot-starter-oauth2-resource-server
-
-
- org.springframework.security
- spring-security-saml2-service-provider
-
-
- org.springframework.session
- spring-session-data-redis
-
+
+
+ org.springframework.boot
+ spring-boot-starter-oauth2-client
+
+
+ org.springframework.boot
+ spring-boot-starter-oauth2-resource-server
+
+
+ org.springframework.security
+ spring-security-saml2-service-provider
+
+
+ org.springframework.session
+ spring-session-data-redis
+ org.springframework.bootspring-boot-starter-data-redis
-
- org.springframework.boot
- spring-boot-devtools
- runtime
- true
-
+
+ org.springframework.boot
+ spring-boot-devtools
+ runtime
+ true
+
+
+ io.sentry
+ sentry-spring-boot-starter-jakarta
+ ${sentry.version}
+
+
+
+
+ org.testcontainers
+ testcontainers-bom
+ ${testcontainers.version}
+ pom
+ import
+
+
+
+
cbioportal
@@ -380,13 +426,13 @@
org.springframework.bootspring-boot-maven-plugin
-
- repackage
-
- exec
-
-
-
+
+ repackage
+
+ exec
+
+
+
@@ -449,8 +495,60 @@
org.apache.maven.pluginsmaven-wrapper-plugin
+
+ org.jacoco
+ jacoco-maven-plugin
+ ${jacoco.version}
+
+
+ default-prepare-agent
+
+ prepare-agent
+
+
+
+ default-report
+
+ report
+
+
+
+ XML
+
+
+
+
+
-
+
+
+ org.apache.maven.plugins
+ maven-surefire-plugin
+
+ ${skipTests}
+
+ **/*IntegrationTest.java
+
+
+
+
+ maven-failsafe-plugin
+
+ ${skipITs}
+
+ **/*IntegrationTest.java
+
+
+
+
+
+ integration-test
+ verify
+
+
+
+
+
diff --git a/requirements.txt b/requirements.txt
deleted file mode 100644
index 5cd1f3ba8b7..00000000000
--- a/requirements.txt
+++ /dev/null
@@ -1,6 +0,0 @@
-requests==2.20.0
-markupsafe==2.0.1
-Jinja2==2.11.3
-mysqlclient==2.1.0
-PyYAML==6.0.1
-dsnparse==0.1.15
diff --git a/src/main/java/org/cbioportal/PortalApplication.java b/src/main/java/org/cbioportal/PortalApplication.java
index 5aded5fa465..97844cb926b 100644
--- a/src/main/java/org/cbioportal/PortalApplication.java
+++ b/src/main/java/org/cbioportal/PortalApplication.java
@@ -12,7 +12,7 @@
MongoDataAutoConfiguration.class
})
@PropertySources({
- @PropertySource(ignoreResourceNotFound = true, value = "classpath:portal.properties"),
+ @PropertySource(ignoreResourceNotFound = true, value = "classpath:application.properties"),
@PropertySource(ignoreResourceNotFound = true, value = "classpath:security.properties"),
@PropertySource(ignoreResourceNotFound = true, value = "classpath:maven.properties"),
@PropertySource(ignoreResourceNotFound = true, value = "classpath:git.properties")
diff --git a/src/main/java/org/cbioportal/WebAppConfig.java b/src/main/java/org/cbioportal/WebAppConfig.java
index 612884dad51..2ea3e019d65 100644
--- a/src/main/java/org/cbioportal/WebAppConfig.java
+++ b/src/main/java/org/cbioportal/WebAppConfig.java
@@ -1,10 +1,14 @@
package org.cbioportal;
+import java.util.List;
+
import org.cbioportal.web.util.InvolvedCancerStudyExtractorInterceptor;
+import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.HandlerInterceptor;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
+import org.springframework.web.servlet.config.annotation.PathMatchConfigurer;
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
import org.springframework.web.servlet.config.annotation.ViewControllerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
@@ -15,50 +19,68 @@
//@EnableAspectJAutoProxy // TODO no idea what this does; is this logging aspect still useful?
public class WebAppConfig implements WebMvcConfigurer {
- private static final String SINGLE_PAGE_APP_ROOT = "forward:/";
+ private static final String SINGLE_PAGE_APP_ROOT = "forward:/";
+
+ @Value("${springdoc.swagger-ui.path:/swagger-ui.html}")
+ private String swaggerRedirectUrl;
+
+ @Override
+ public void addResourceHandlers(ResourceHandlerRegistry registry) {
+ registry.addResourceHandler("/images/**").addResourceLocations("classpath:/webapp/images/");
+ registry.addResourceHandler("/reactapp/**").addResourceLocations("classpath:/reactapp/");
+ registry.addResourceHandler("/js/**").addResourceLocations("classpath:/js/");
+ }
+
+ @Override
+ public void addViewControllers(ViewControllerRegistry registry) {
+ registry.addRedirectViewController("/api", swaggerRedirectUrl);
+ registry.addRedirectViewController("/installations", "https://installationmap.netlify.app/");
+ registry.addRedirectViewController("/tutorials", "https://docs.cbioportal.org/user-guide/overview/#tutorial-slides");
+ registry.addRedirectViewController("/oql", "https://docs.cbioportal.org/user-guide/oql/");
+ registry.addRedirectViewController("/faq", "https://docs.cbioportal.org/user-guide/faq/");
+
+ List endpoints = List.of(
+ "/results/*",
+ "/results**",
+ "/patient/*",
+ "/patient**",
+ "/study/*",
+ "/study",
+ "/mutation_mapper/*",
+ "/mutation_mapper",
+ "/index.do/*",
+ "/case.do/*",
+ "/loading/*",
+ "/comparison",
+ "/comparison/*",
+ "/restore",
+ "/index.do**",
+ "/oncoprinter**",
+ "/encodedRedirect",
+ "/datasets**",
+ "/ln**",
+ "/webAPI**",
+ "/news**",
+ "/visualize**"
+ );
+
+ endpoints.forEach( route -> registry.addViewController(route).setViewName(SINGLE_PAGE_APP_ROOT));
+ }
- @Override
- public void addResourceHandlers(ResourceHandlerRegistry registry) {
- registry.addResourceHandler("/images/**").addResourceLocations("classpath:/webapp/images/");
- registry.addResourceHandler("/reactapp/**").addResourceLocations("classpath:/reactapp/");
- registry.addResourceHandler("/js/**").addResourceLocations("classpath:/js/");
- }
+ @Bean
+ public HandlerInterceptor involvedCancerStudyExtractorInterceptor() {
+ return new InvolvedCancerStudyExtractorInterceptor();
+ }
- @Override
- public void addViewControllers(ViewControllerRegistry registry) {
- registry.addRedirectViewController("/api", "/swagger-ui.html");
-
-
- // Redirects for single page app
- registry.addViewController("/results/*").setViewName(SINGLE_PAGE_APP_ROOT);
- registry.addViewController("/results**").setViewName(SINGLE_PAGE_APP_ROOT);
- registry.addViewController("/patient/*").setViewName(SINGLE_PAGE_APP_ROOT);
- registry.addViewController("/patient**").setViewName(SINGLE_PAGE_APP_ROOT);
- registry.addViewController("/study/*").setViewName(SINGLE_PAGE_APP_ROOT);
- registry.addViewController("/study").setViewName(SINGLE_PAGE_APP_ROOT);
- registry.addViewController("/mutation_mapper/*").setViewName(SINGLE_PAGE_APP_ROOT);
- registry.addViewController("/mutation_mapper").setViewName(SINGLE_PAGE_APP_ROOT);
- registry.addViewController("/index.do/*").setViewName(SINGLE_PAGE_APP_ROOT);
- registry.addViewController("/case.do/*").setViewName(SINGLE_PAGE_APP_ROOT);
- registry.addViewController("/loading/*").setViewName(SINGLE_PAGE_APP_ROOT);
- registry.addViewController("/comparison").setViewName(SINGLE_PAGE_APP_ROOT);
- registry.addViewController("/comparison/*").setViewName(SINGLE_PAGE_APP_ROOT);
- registry.addViewController("/restore").setViewName(SINGLE_PAGE_APP_ROOT);
- registry.addViewController("/index.do**").setViewName(SINGLE_PAGE_APP_ROOT);
- registry.addViewController("/oncoprinter**").setViewName(SINGLE_PAGE_APP_ROOT);
- registry.addViewController("/encodedRedirect").setViewName(SINGLE_PAGE_APP_ROOT);
- registry.addViewController("/datasets**").setViewName(SINGLE_PAGE_APP_ROOT);
+ @Override
+ public void addInterceptors(InterceptorRegistry registry) {
+ registry.addInterceptor(involvedCancerStudyExtractorInterceptor());
+ }
- }
-
- @Bean
- public HandlerInterceptor involvedCancerStudyExtractorInterceptor() {
- return new InvolvedCancerStudyExtractorInterceptor();
- }
+ @Override
+ public void configurePathMatch(PathMatchConfigurer configurer) {
+ // Adds support for trailing slash Matches
+ configurer.setUseTrailingSlashMatch(true);
+ }
- @Override
- public void addInterceptors(InterceptorRegistry registry) {
- registry.addInterceptor(involvedCancerStudyExtractorInterceptor());
- }
-
}
diff --git a/src/main/java/org/cbioportal/model/CancerStudy.java b/src/main/java/org/cbioportal/model/CancerStudy.java
index 48ed6103abb..8504a8bd55a 100644
--- a/src/main/java/org/cbioportal/model/CancerStudy.java
+++ b/src/main/java/org/cbioportal/model/CancerStudy.java
@@ -33,6 +33,7 @@ public class CancerStudy implements ReadPermission, Serializable {
private String referenceGenome;
private Boolean readPermission = true;
private Integer treatmentCount;
+ private Integer structuralVariantCount;
public Integer getCancerStudyId() {
return cancerStudyId;
@@ -239,4 +240,12 @@ public Integer getTreatmentCount() {
public void setTreatmentCount(Integer treatmentCount) {
this.treatmentCount = treatmentCount;
}
+
+ public Integer getStructuralVariantCount() {
+ return structuralVariantCount;
+ }
+
+ public void setStructuralVariantCount(Integer structuralVariantCount) {
+ this.structuralVariantCount = structuralVariantCount;
+ }
}
diff --git a/src/main/java/org/cbioportal/model/GenomicDataCount.java b/src/main/java/org/cbioportal/model/GenomicDataCount.java
index a9d8862f4d5..fcc8587c69c 100644
--- a/src/main/java/org/cbioportal/model/GenomicDataCount.java
+++ b/src/main/java/org/cbioportal/model/GenomicDataCount.java
@@ -8,6 +8,7 @@ public class GenomicDataCount implements Serializable {
private String label;
private String value;
private Integer count;
+ private Integer uniqueCount;
public String getLabel() {
return label;
@@ -33,16 +34,20 @@ public void setCount(Integer count) {
this.count = count;
}
+ public Integer getUniqueCount() { return uniqueCount; }
+
+ public void setUniqueCount(Integer uniqueCount) { this.uniqueCount = uniqueCount; }
+
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
GenomicDataCount that = (GenomicDataCount) o;
- return label.equals(that.label) && value.equals(that.value) && count.equals(that.count);
+ return Objects.equals(label, that.label) && Objects.equals(value, that.value) && Objects.equals(count, that.count) && Objects.equals(uniqueCount, that.uniqueCount);
}
@Override
public int hashCode() {
- return Objects.hash(label, value, count);
+ return Objects.hash(label, value, count, uniqueCount);
}
}
diff --git a/src/main/java/org/cbioportal/model/MutationFilterOption.java b/src/main/java/org/cbioportal/model/MutationFilterOption.java
new file mode 100644
index 00000000000..fd83da4f051
--- /dev/null
+++ b/src/main/java/org/cbioportal/model/MutationFilterOption.java
@@ -0,0 +1,18 @@
+package org.cbioportal.model;
+
+public enum MutationFilterOption {
+ MUTATED("Mutated"), // Samples that have mutations
+ NOT_MUTATED("Not Mutated"), // Samples that are profiled and not mutated
+ NOT_PROFILED("Not Profiled"), // Samples that are not profiled
+ ;
+
+ private final String selectedOption;
+
+ MutationFilterOption(String selectedOption) {
+ this.selectedOption = selectedOption;
+ }
+
+ public String getSelectedOption() {
+ return selectedOption;
+ }
+}
diff --git a/src/main/java/org/cbioportal/persistence/MutationRepository.java b/src/main/java/org/cbioportal/persistence/MutationRepository.java
index ac25c83f9ff..ffcef1b6f0c 100644
--- a/src/main/java/org/cbioportal/persistence/MutationRepository.java
+++ b/src/main/java/org/cbioportal/persistence/MutationRepository.java
@@ -1,6 +1,7 @@
package org.cbioportal.persistence;
import org.cbioportal.model.GeneFilterQuery;
+import org.cbioportal.model.GenomicDataCountItem;
import org.cbioportal.model.Mutation;
import org.cbioportal.model.MutationCountByPosition;
import org.cbioportal.model.meta.MutationMeta;
@@ -12,7 +13,7 @@ public interface MutationRepository {
@Cacheable(cacheResolver = "generalRepositoryCacheResolver", condition = "@cacheEnabledConfig.getEnabled()")
List getMutationsInMolecularProfileBySampleListId(String molecularProfileId, String sampleListId,
- List entrezGeneIds, Boolean snpOnly,
+ List entrezGeneIds, boolean snpOnly,
String projection, Integer pageSize, Integer pageNumber,
String sortBy, String direction);
@@ -43,7 +44,7 @@ MutationMeta getMetaMutationsInMultipleMolecularProfiles(List molecularP
@Cacheable(cacheResolver = "generalRepositoryCacheResolver", condition = "@cacheEnabledConfig.getEnabled()")
List fetchMutationsInMolecularProfile(String molecularProfileId, List sampleIds,
- List entrezGeneIds, Boolean snpOnly, String projection,
+ List entrezGeneIds, boolean snpOnly, String projection,
Integer pageSize, Integer pageNumber, String sortBy,
String direction);
@@ -54,4 +55,8 @@ MutationMeta fetchMetaMutationsInMolecularProfile(String molecularProfileId, Lis
@Cacheable(cacheResolver = "generalRepositoryCacheResolver", condition = "@cacheEnabledConfig.getEnabled()")
MutationCountByPosition getMutationCountByPosition(Integer entrezGeneId, Integer proteinPosStart,
Integer proteinPosEnd);
+
+ @Cacheable(cacheResolver = "generalRepositoryCacheResolver", condition = "@cacheEnabledConfig.getEnabled()")
+ GenomicDataCountItem getMutationCountsByType(List molecularProfileIds, List sampleIds,
+ List entrezGeneIds, String profileType);
}
diff --git a/src/main/java/org/cbioportal/persistence/cachemaputil/InactiveCacheMapUtil.java b/src/main/java/org/cbioportal/persistence/cachemaputil/InactiveCacheMapUtil.java
index 58d8d2d1744..8213ede2aaf 100644
--- a/src/main/java/org/cbioportal/persistence/cachemaputil/InactiveCacheMapUtil.java
+++ b/src/main/java/org/cbioportal/persistence/cachemaputil/InactiveCacheMapUtil.java
@@ -1,49 +1,20 @@
-/*
- * Copyright (c) 2018 - 2019 Memorial Sloan-Kettering Cancer Center.
- *
- * This library is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY, WITHOUT EVEN THE IMPLIED WARRANTY OF MERCHANTABILITY OR FITNESS
- * FOR A PARTICULAR PURPOSE. The software and documentation provided hereunder
- * is on an "as is" basis, and Memorial Sloan-Kettering Cancer Center has no
- * obligations to provide maintenance, support, updates, enhancements or
- * modifications. In no event shall Memorial Sloan-Kettering Cancer Center be
- * liable to any party for direct, indirect, special, incidental or
- * consequential damages, including lost profits, arising out of the use of this
- * software and its documentation, even if Memorial Sloan-Kettering Cancer
- * Center has been advised of the possibility of such damage.
- */
-
-/*
- * This file is part of cBioPortal.
- *
- * cBioPortal is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see .
- */
-
package org.cbioportal.persistence.cachemaputil;
-import java.util.Map;
import org.cbioportal.model.CancerStudy;
import org.cbioportal.model.MolecularProfile;
import org.cbioportal.model.SampleList;
+import org.springframework.boot.autoconfigure.condition.ConditionalOnExpression;
import org.springframework.stereotype.Component;
+import java.util.Map;
+
@Component
// This implementation of the CacheMapUtils is instantiated on portals where all uses can access any study.
+@ConditionalOnExpression("'false' eq '${authenticate}' or ('optional_oauth2' eq '${authenticate}' and 'true' ne '${security.method_authorization_enabled}')")
public class InactiveCacheMapUtil implements CacheMapUtil {
// Since user-permission evaluation is not needed when this bean is present, throw an error when it is accessed.
-
+
@Override
public Map getMolecularProfileMap() {
throw new RuntimeException("A CacheMapUtils method was called on a portal where studies are accessible to all users.");
@@ -65,4 +36,4 @@ public boolean hasCacheEnabled() {
return false;
}
-}
+}
\ No newline at end of file
diff --git a/src/main/java/org/cbioportal/persistence/cachemaputil/SpringManagedCacheMapUtil.java b/src/main/java/org/cbioportal/persistence/cachemaputil/SpringManagedCacheMapUtil.java
index 5eae44a6812..e58f04b6cf5 100644
--- a/src/main/java/org/cbioportal/persistence/cachemaputil/SpringManagedCacheMapUtil.java
+++ b/src/main/java/org/cbioportal/persistence/cachemaputil/SpringManagedCacheMapUtil.java
@@ -40,12 +40,17 @@
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
+import org.springframework.boot.autoconfigure.condition.ConditionalOnExpression;
+import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.cache.annotation.Cacheable;
+import org.springframework.stereotype.Component;
import java.util.Map;
-//@Component
+@Component
// Instantiate when user authorization is active and spring-managed implementation is needed
+@ConditionalOnExpression("{'oauth2','saml','saml_plus_basic'}.contains('${authenticate}') or ('optional_oauth2' eq '${authenticate}' and 'true' eq '${security.method_authorization_enabled}')")
+@ConditionalOnProperty(value = "cache.cache-map-utils.spring-managed", havingValue = "true")
public class SpringManagedCacheMapUtil implements CacheMapUtil {
private static final Logger LOG = LoggerFactory.getLogger(SpringManagedCacheMapUtil.class);
diff --git a/src/main/java/org/cbioportal/persistence/cachemaputil/StaticRefCacheMapUtil.java b/src/main/java/org/cbioportal/persistence/cachemaputil/StaticRefCacheMapUtil.java
index ce598fbbbd1..48d07e0bff1 100644
--- a/src/main/java/org/cbioportal/persistence/cachemaputil/StaticRefCacheMapUtil.java
+++ b/src/main/java/org/cbioportal/persistence/cachemaputil/StaticRefCacheMapUtil.java
@@ -39,12 +39,16 @@
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.boot.autoconfigure.condition.ConditionalOnExpression;
+import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.stereotype.Component;
import java.util.Map;
@Component
// Instantiate when user authorization is active and spring-managed implementation is not needed
+@ConditionalOnExpression("{'oauth2','saml','saml_plus_basic'}.contains('${authenticate}') or ('optional_oauth2' eq '${authenticate}' and 'true' eq '${security.method_authorization_enabled}')")
+@ConditionalOnProperty(value = "cache.cache-map-utils.spring-managed", havingValue = "false", matchIfMissing = true)
public class StaticRefCacheMapUtil implements CacheMapUtil {
private static final Logger LOG = LoggerFactory.getLogger(StaticRefCacheMapUtil.class);
@@ -62,7 +66,6 @@ public class StaticRefCacheMapUtil implements CacheMapUtil {
static Map molecularProfileCache;
static Map sampleListCache;
static Map cancerStudyCache;
- static Map genericAssayStableIdToMolecularProfileIdCache;
@PostConstruct
private void init() {
diff --git a/src/main/java/org/cbioportal/persistence/mybatis/MutationMapper.java b/src/main/java/org/cbioportal/persistence/mybatis/MutationMapper.java
index d65713ff952..26a26ddfad9 100644
--- a/src/main/java/org/cbioportal/persistence/mybatis/MutationMapper.java
+++ b/src/main/java/org/cbioportal/persistence/mybatis/MutationMapper.java
@@ -1,6 +1,7 @@
package org.cbioportal.persistence.mybatis;
import org.cbioportal.model.GeneFilterQuery;
+import org.cbioportal.model.GenomicDataCountItem;
import org.cbioportal.model.Mutation;
import org.cbioportal.model.MutationCountByPosition;
import org.cbioportal.model.meta.MutationMeta;
@@ -10,21 +11,21 @@
public interface MutationMapper {
List getMutationsBySampleListId(String molecularProfileId, String sampleListId, List entrezGeneIds,
- Boolean snpOnly, String projection, Integer limit, Integer offset,
+ boolean snpOnly, String projection, Integer limit, Integer offset,
String sortBy, String direction);
MutationMeta getMetaMutationsBySampleListId(String molecularProfileId, String sampleListId,
- List entrezGeneIds, Boolean snpOnly);
+ List entrezGeneIds, boolean snpOnly);
List getMutationsInMultipleMolecularProfiles(List molecularProfileIds, List sampleIds,
- List entrezGeneIds, Boolean snpOnly,
+ List entrezGeneIds, boolean snpOnly,
String projection, Integer limit,
Integer offset, String sortBy, String direction);
List getMutationsInMultipleMolecularProfilesByGeneQueries(List molecularProfileIds,
List sampleIds,
- Boolean snpOnly,
+ boolean snpOnly,
String projection,
Integer limit,
Integer offset,
@@ -33,12 +34,14 @@ List getMutationsInMultipleMolecularProfilesByGeneQueries(List
List geneQueries);
MutationMeta getMetaMutationsInMultipleMolecularProfiles(List molecularProfileIds, List sampleIds,
- List entrezGeneIds, Boolean snpOnly);
+ List entrezGeneIds, boolean snpOnly);
MutationMeta getMetaMutationsBySampleIds(String molecularProfileId, List sampleIds,
- List entrezGeneIds, Boolean snpOnly);
+ List entrezGeneIds, boolean snpOnly);
MutationCountByPosition getMutationCountByPosition(Integer entrezGeneId, Integer proteinPosStart,
Integer proteinPosEnd);
+ GenomicDataCountItem getMutationCountsByType(List molecularProfileIds, List sampleIds,
+ List entrezGeneIds, boolean snpOnly, String profileType);
}
diff --git a/src/main/java/org/cbioportal/persistence/mybatis/MutationMyBatisRepository.java b/src/main/java/org/cbioportal/persistence/mybatis/MutationMyBatisRepository.java
index 6adc902dd9e..f5eb82ac1fe 100644
--- a/src/main/java/org/cbioportal/persistence/mybatis/MutationMyBatisRepository.java
+++ b/src/main/java/org/cbioportal/persistence/mybatis/MutationMyBatisRepository.java
@@ -1,6 +1,7 @@
package org.cbioportal.persistence.mybatis;
import org.cbioportal.model.GeneFilterQuery;
+import org.cbioportal.model.GenomicDataCountItem;
import org.cbioportal.model.Mutation;
import org.cbioportal.model.MutationCountByPosition;
import org.cbioportal.model.meta.MutationMeta;
@@ -25,7 +26,7 @@ public class MutationMyBatisRepository implements MutationRepository {
@Override
public List getMutationsInMolecularProfileBySampleListId(String molecularProfileId, String sampleListId,
- List entrezGeneIds, Boolean snpOnly,
+ List entrezGeneIds, boolean snpOnly,
String projection, Integer pageSize,
Integer pageNumber, String sortBy,
String direction) {
@@ -38,7 +39,7 @@ public List getMutationsInMolecularProfileBySampleListId(String molecu
public MutationMeta getMetaMutationsInMolecularProfileBySampleListId(String molecularProfileId, String sampleListId,
List entrezGeneIds) {
- return mutationMapper.getMetaMutationsBySampleListId(molecularProfileId, sampleListId, entrezGeneIds, null);
+ return mutationMapper.getMetaMutationsBySampleListId(molecularProfileId, sampleListId, entrezGeneIds, false);
}
@Override
@@ -55,7 +56,7 @@ public List getMutationsInMultipleMolecularProfiles(List molec
Arrays.asList(entry.getKey()),
new ArrayList<>(entry.getValue()),
entrezGeneIds,
- null,
+ false,
projection,
pageSize,
offsetCalculator.calculate(pageSize, pageNumber),
@@ -83,7 +84,7 @@ public List getMutationsInMultipleMolecularProfilesByGeneQueries(List<
.flatMap(entry -> mutationMapper.getMutationsInMultipleMolecularProfilesByGeneQueries(
Arrays.asList(entry.getKey()),
new ArrayList<>(entry.getValue()),
- null,
+ false,
projection,
pageSize,
offsetCalculator.calculate(pageSize, pageNumber),
@@ -99,12 +100,12 @@ public MutationMeta getMetaMutationsInMultipleMolecularProfiles(List mol
List entrezGeneIds) {
return mutationMapper.getMetaMutationsInMultipleMolecularProfiles(molecularProfileIds, sampleIds, entrezGeneIds,
- null);
+ false);
}
@Override
public List fetchMutationsInMolecularProfile(String molecularProfileId, List sampleIds,
- List entrezGeneIds, Boolean snpOnly,
+ List entrezGeneIds, boolean snpOnly,
String projection, Integer pageSize, Integer pageNumber,
String sortBy, String direction) {
@@ -124,7 +125,7 @@ public List fetchMutationsInMolecularProfile(String molecularProfileId
public MutationMeta fetchMetaMutationsInMolecularProfile(String molecularProfileId, List sampleIds,
List entrezGeneIds) {
- return mutationMapper.getMetaMutationsBySampleIds(molecularProfileId, sampleIds, entrezGeneIds, null);
+ return mutationMapper.getMetaMutationsBySampleIds(molecularProfileId, sampleIds, entrezGeneIds, false);
}
@Override
@@ -134,4 +135,10 @@ public MutationCountByPosition getMutationCountByPosition(Integer entrezGeneId,
return mutationMapper.getMutationCountByPosition(entrezGeneId, proteinPosStart, proteinPosEnd);
}
+ @Override
+ public GenomicDataCountItem getMutationCountsByType(List molecularProfileIds, List sampleIds,
+ List entrezGeneIds, String profileType) {
+ return mutationMapper.getMutationCountsByType(molecularProfileIds, sampleIds, entrezGeneIds,
+ false, profileType);
+ }
}
diff --git a/src/main/java/org/cbioportal/persistence/mybatis/StudyMyBatisRepository.java b/src/main/java/org/cbioportal/persistence/mybatis/StudyMyBatisRepository.java
index 4821f500558..6a508a81439 100644
--- a/src/main/java/org/cbioportal/persistence/mybatis/StudyMyBatisRepository.java
+++ b/src/main/java/org/cbioportal/persistence/mybatis/StudyMyBatisRepository.java
@@ -8,6 +8,7 @@
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;
+import java.util.ArrayList;
import java.util.List;
@Repository
@@ -55,7 +56,9 @@ public CancerStudyTags getTags(String studyId) {
@Override
public List getTagsForMultipleStudies(List studyIds) {
-
+ if (studyIds == null || studyIds.isEmpty()) {
+ return new ArrayList<>();
+ }
return studyMapper.getTagsForMultipleStudies(studyIds);
}
}
diff --git a/src/main/java/org/cbioportal/persistence/mybatis/config/PersistenceConfig.java b/src/main/java/org/cbioportal/persistence/mybatis/config/PersistenceConfig.java
index 86a604875a5..933be27cc4a 100644
--- a/src/main/java/org/cbioportal/persistence/mybatis/config/PersistenceConfig.java
+++ b/src/main/java/org/cbioportal/persistence/mybatis/config/PersistenceConfig.java
@@ -1,17 +1,16 @@
package org.cbioportal.persistence.mybatis.config;
-import org.apache.ibatis.session.SqlSessionFactory;
import org.cbioportal.model.Sample;
import org.cbioportal.persistence.mybatis.typehandler.SampleTypeTypeHandler;
import org.mybatis.spring.SqlSessionFactoryBean;
import org.mybatis.spring.annotation.MapperScan;
import org.mybatis.spring.boot.autoconfigure.ConfigurationCustomizer;
+import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
-import org.springframework.core.io.Resource;
-import org.springframework.core.io.support.PathMatchingResourcePatternResolver;
import javax.sql.DataSource;
+import java.io.IOException;
@Configuration
@@ -32,14 +31,12 @@ public void customize(org.apache.ibatis.session.Configuration configuration) {
}
@Bean
- public SqlSessionFactoryBean sqlSessionFactory(DataSource dataSource) throws Exception {
+ public SqlSessionFactoryBean sqlSessionFactory(DataSource dataSource, ApplicationContext applicationContext) throws IOException {
SqlSessionFactoryBean sessionFactory = new SqlSessionFactoryBean();
sessionFactory.setDataSource(dataSource);
- // Specify the location of your mapper XML files in the 'mappers' directory
- Resource[] resources = new PathMatchingResourcePatternResolver()
- .getResources("classpath:org/cbioportal/persistence/mybatis/*.xml");
-
- sessionFactory.setMapperLocations(resources);
+ sessionFactory.setMapperLocations(
+ applicationContext.getResources("classpath:org/cbioportal/persistence/mybatis/*.xml")
+ );
sessionFactory.setTypeHandlers(new SampleTypeTypeHandler());
return sessionFactory;
}
diff --git a/src/main/java/org/cbioportal/properties/PortalProperties.java b/src/main/java/org/cbioportal/properties/PortalProperties.java
index fbb8f3a876f..298c343a7be 100644
--- a/src/main/java/org/cbioportal/properties/PortalProperties.java
+++ b/src/main/java/org/cbioportal/properties/PortalProperties.java
@@ -11,7 +11,7 @@
public class PortalProperties {
@AllowedValues(values = {"false", "saml", "oauth2",
- "optional_oauth2", "social_oauth"})
+ "optional_oauth2", "saml_plus_basic"})
private String authenticate;
public void setAuthenticate(String authenticate) {
diff --git a/src/main/java/org/cbioportal/proxy/ProxyController.java b/src/main/java/org/cbioportal/proxy/ProxyController.java
index 36e670c3ca9..00ad2e500b4 100644
--- a/src/main/java/org/cbioportal/proxy/ProxyController.java
+++ b/src/main/java/org/cbioportal/proxy/ProxyController.java
@@ -2,25 +2,36 @@
import jakarta.servlet.http.HttpServletRequest;
import org.apache.commons.lang3.StringUtils;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
+import org.cbioportal.proxy.util.CheckDarwinAccessUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
-import org.springframework.http.*;
+import org.springframework.http.HttpEntity;
+import org.springframework.http.HttpHeaders;
+import org.springframework.http.HttpMethod;
+import org.springframework.http.HttpStatus;
+import org.springframework.http.MediaType;
+import org.springframework.http.ResponseEntity;
import org.springframework.http.converter.StringHttpMessageConverter;
+import org.springframework.security.core.Authentication;
import org.springframework.util.ObjectUtils;
+import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseStatus;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;
-
-import java.io.*;
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileNotFoundException;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.UnsupportedEncodingException;
import java.net.URI;
import java.net.URISyntaxException;
import java.nio.charset.StandardCharsets;
import java.util.Properties;
+import java.util.regex.Pattern;
// TODO Consider creating separate DispatcherServlets as in the original web.xml
// See: https://stackoverflow.com/a/30686733/11651683
@@ -29,9 +40,6 @@
@RequestMapping("/proxy")
public class ProxyController {
private static final String DEFAULT_ONCOKB_URL = "https://public.api.oncokb.org/api/v1";
- private Properties properties;
-
- private Logger LOG = LoggerFactory.getLogger(ProxyController.class);
@Autowired
private Monkifier monkifier;
@@ -44,6 +52,19 @@ public class ProxyController {
@Value("${show.oncokb:false}")
private Boolean showOncokb;
+
+ @Value("${darwin.auth_url:}")
+ private String darwinAuthUrl;
+
+ @Value("${ddp.response_url:}")
+ private String ddpResponseUrl;
+
+ @Value("${cis.user:}")
+ private String cisUser;
+
+ @Value("${darwin.regex:Test}")
+ private String darwinRegex;
+
@RequestMapping("/**")
public String proxy(@RequestBody(required = false) String body, HttpMethod method, HttpServletRequest request)
@@ -53,7 +74,7 @@ public String proxy(@RequestBody(required = false) String body, HttpMethod metho
// TODO when reimplemeting different dispatcherservlets with different context roots
// reset this to 'String requestPathInfo = request.getPathInfo();'
String requestPathInfo = request.getPathInfo() == null? request.getServletPath() : request.getPathInfo();
-
+ requestPathInfo = requestPathInfo.replace("proxy/", "");
return exchangeData(body,
buildUri(requestPathInfo, request.getQueryString(), false),
method,
@@ -172,6 +193,13 @@ public String proxyOncokb(@RequestBody(required = false) String body, HttpMethod
httpHeaders,
String.class).getBody();
}
+
+ @GetMapping("/checkDarwinAccess")
+ public ResponseEntity checkDarwinAccess(HttpServletRequest request, Authentication authentication) {
+ String user = authentication != null ? authentication.getName(): "anonymousUser";
+ String darwinResponse = CheckDarwinAccessUtil.checkAccess(request, darwinAuthUrl, ddpResponseUrl, cisUser, Pattern.compile(darwinRegex), user);
+ return new ResponseEntity<>(darwinResponse, HttpStatus.OK);
+ }
private HttpHeaders initHeaders(HttpServletRequest request) {
HttpHeaders httpHeaders = new HttpHeaders();
diff --git a/src/main/java/org/cbioportal/proxy/util/CheckDarwinAccessUtil.java b/src/main/java/org/cbioportal/proxy/util/CheckDarwinAccessUtil.java
new file mode 100644
index 00000000000..be9dc2b1152
--- /dev/null
+++ b/src/main/java/org/cbioportal/proxy/util/CheckDarwinAccessUtil.java
@@ -0,0 +1,243 @@
+package org.cbioportal.proxy.util;
+
+import com.fasterxml.jackson.annotation.JsonAnyGetter;
+import com.fasterxml.jackson.annotation.JsonAnySetter;
+import com.fasterxml.jackson.annotation.JsonIgnore;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import jakarta.servlet.http.HttpServletRequest;
+import org.apache.commons.lang3.builder.ToStringBuilder;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.http.HttpEntity;
+import org.springframework.http.HttpHeaders;
+import org.springframework.http.HttpMethod;
+import org.springframework.http.MediaType;
+import org.springframework.http.ResponseEntity;
+import org.springframework.util.LinkedMultiValueMap;
+import org.springframework.web.client.RestTemplate;
+
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Objects;
+import java.util.regex.Pattern;
+
+public final class CheckDarwinAccessUtil {
+ private static final Logger logger = LoggerFactory.getLogger(CheckDarwinAccessUtil.class);
+
+ private static final String DDP_INFO_ENDPOINT = "/info";
+ public static final String SAMPLE_ID = "sample_id";
+ public static final String PATIENT_ID = "case_id";
+
+ private CheckDarwinAccessUtil() {
+ throw new IllegalStateException("Utility class");
+ }
+
+ public static String checkAccess(HttpServletRequest request, String darwinAuthUrl, String ddpResponseUrl, String cisUser, Pattern sampleIdRegex, String user) {
+ logger.debug("checkDarwinAccess Requested");
+ if (!existsDarwinProperties(darwinAuthUrl, ddpResponseUrl, cisUser, sampleIdRegex)) {
+ logger.debug("Darwin Properties do not exists");
+ return "";
+ }
+ // if sample id does not match regex or username matches cis username then return empty string
+ String userName = user.split("@")[0];
+ String darwinResponse = "";
+ try {
+ String[] sampleIds = request.getParameter(SAMPLE_ID).split(",");
+ if (sampleIdRegex.matcher(sampleIds[0]).find() && !cisUser.equals(userName)) {
+ String patientId = request.getParameter(PATIENT_ID);
+ darwinResponse = getResponse(userName, patientId, darwinAuthUrl, ddpResponseUrl);
+ }
+ } catch (NullPointerException ignored) {
+ logger.debug("Error Sending CheckDarwinAccess API");
+ }
+
+ return darwinResponse;
+ }
+
+ public static String getResponse(String userName, String patientId, String darwinAuthUrl, String ddpResponseUrl) {
+ RestTemplate restTemplate = new RestTemplate();
+ HttpEntity> requestEntity = getRequestEntity(userName, patientId);
+ ResponseEntity responseEntity = restTemplate.exchange(darwinAuthUrl, HttpMethod.POST, requestEntity, DarwinAccess.class);
+ String darwinResponse = Objects.requireNonNull(responseEntity.getBody()).getDarwinAuthResponse();
+ String deidentificationId = Objects.requireNonNull(responseEntity.getBody()).getDeidentificationId();
+ if (!darwinResponse.equals("valid")) {
+ return "";
+ }
+ if (deidentificationId.isEmpty()) {
+ return "";
+ }
+ // construct URL
+ return ddpResponseUrl + deidentificationId + DDP_INFO_ENDPOINT;
+ }
+
+ private static HttpEntity> getRequestEntity(String userName, String patientId) {
+ LinkedMultiValueMap map = new LinkedMultiValueMap<>();
+ map.add("p_userName", userName);
+ map.add("p_dmp_pid", patientId);
+ HttpHeaders headers = new HttpHeaders();
+ headers.setContentType(MediaType.APPLICATION_FORM_URLENCODED);
+ return new HttpEntity<>(map, headers);
+ }
+
+ public static boolean existsDarwinProperties(String darwinAuthUrl, String ddpResponseUrl, String cisUser, Pattern sampleIdRegex) {
+ return (!darwinAuthUrl.isEmpty() && !ddpResponseUrl.isEmpty() && !cisUser.isEmpty() && !sampleIdRegex.toString().isEmpty());
+ }
+
+
+ public static class DarwinAccess {
+ /**
+ * (Required)
+ **/
+ @JsonProperty("darwinAuthResponse")
+ private String darwinAuthResponse;
+ /**
+ * (Required)
+ **/
+ @JsonProperty("p_userName")
+ private String pUserName;
+ /**
+ * (Required)
+ **/
+ @JsonProperty("p_dmp_pid")
+ private String pDmpPid;
+ /**
+ * (Required)
+ **/
+ @JsonProperty("deidentification_id")
+ private String deidentificationId;
+
+ @JsonIgnore
+ private Map additionalProperties = new HashMap<>();
+
+ /**
+ * No args constructor for use in serialization
+ **/
+ public DarwinAccess() {
+ }
+
+ /**
+ *
+ **/
+ public DarwinAccess(String darwinAuthResponse, String pUserName, String pDmpPid, String deidentificationId) {
+ this.darwinAuthResponse = darwinAuthResponse;
+ this.pUserName = pUserName;
+ this.pDmpPid = pDmpPid;
+ this.deidentificationId = deidentificationId;
+ }
+
+ /**
+ * (Required)
+ *
+ * @return The darwinAuthResponse
+ **/
+ @JsonProperty("darwinAuthResponse")
+ public String getDarwinAuthResponse() {
+ return darwinAuthResponse;
+ }
+
+ /**
+ * (Required)
+ *
+ * @param darwinAuthResponse The Darwin authorization response
+ **/
+ @JsonProperty("darwinAuthResponse")
+ public void setDarwinAuthResponse(String darwinAuthResponse) {
+ this.darwinAuthResponse = darwinAuthResponse;
+ }
+
+ public DarwinAccess withDarwinAuthResponse(String darwinAuthResponse) {
+ this.darwinAuthResponse = darwinAuthResponse;
+ return this;
+ }
+
+ /**
+ * (Required)
+ *
+ * @return The p_userName
+ **/
+ @JsonProperty("p_userName")
+ public String getPUserName() {
+ return pUserName;
+ }
+
+ /**
+ * (Required)
+ *
+ * @param pUserName The p_userName
+ **/
+ @JsonProperty("p_userName")
+ public void setPUserName(String pUserName) {
+ this.pUserName = pUserName;
+ }
+
+ public DarwinAccess withPUserName(String pUserName) {
+ this.pUserName = pUserName;
+ return this;
+ }
+
+ /**
+ * (Required)
+ *
+ * @return The p_dmp_pid
+ **/
+ @JsonProperty("p_dmp_pid")
+ public String getPDmpPid() {
+ return pDmpPid;
+ }
+
+ /**
+ * (Required)
+ *
+ * @param pDmpPid The p_dmp_pid
+ **/
+ @JsonProperty("p_dmp_pid")
+ public void setPDmpPid(String pDmpPid) {
+ this.pDmpPid = pDmpPid;
+ }
+
+ /**
+ * (Required)
+ *
+ * @return The deidentification_id
+ **/
+ @JsonProperty("deidentification_id")
+ public String getDeidentificationId() {
+ return deidentificationId;
+ }
+
+ /**
+ * (Required)
+ *
+ * @param deidentificationId The deidentification_id
+ **/
+ @JsonProperty("deidentification_id")
+ public void setDeidentificationId(String deidentificationId) {
+ this.deidentificationId = deidentificationId;
+ }
+
+ public DarwinAccess withPDmpPid(String pDmpPid) {
+ this.pDmpPid = pDmpPid;
+ return this;
+ }
+
+ @Override
+ public String toString() {
+ return ToStringBuilder.reflectionToString(this);
+ }
+
+ @JsonAnyGetter
+ public Map getAdditionalProperties() {
+ return this.additionalProperties;
+ }
+
+ @JsonAnySetter
+ public void setAdditionalProperty(String name, Object value) {
+ this.additionalProperties.put(name, value);
+ }
+
+ public DarwinAccess withAdditionalProperty(String name, Object value) {
+ this.additionalProperties.put(name, value);
+ return this;
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/main/java/org/cbioportal/security/CancerStudyPermissionEvaluator.java b/src/main/java/org/cbioportal/security/CancerStudyPermissionEvaluator.java
index 7947c204e5d..e2d3c354581 100644
--- a/src/main/java/org/cbioportal/security/CancerStudyPermissionEvaluator.java
+++ b/src/main/java/org/cbioportal/security/CancerStudyPermissionEvaluator.java
@@ -283,7 +283,10 @@ private boolean hasAccessToCancerStudy(Authentication authentication, CancerStud
}
// check if user is in study groups
// performance now takes precedence over group accuracy (minimal risk to caching cancer study groups)
- Set groups = new HashSet(Arrays.asList(cancerStudy.getGroups().split(";")));
+ // need to filter out empty groups, this can cause issue if grantedAuthorities and groups both contain empty string
+ Set groups = Arrays.stream(cancerStudy.getGroups().split(";"))
+ .filter(g -> !g.isEmpty())
+ .collect(Collectors.toSet());
if (!Collections.disjoint(groups, grantedAuthorities)) {
if (log.isDebugEnabled()) {
log.debug("hasAccessToCancerStudy(), user has access by groups return true");
@@ -363,9 +366,11 @@ private boolean hasAccessToSampleLists(Authentication authentication, Collection
private Set getGrantedAuthorities(Authentication authentication) {
String appName = getAppName().toUpperCase();
+ // need to filter out empty authorities, this can cause issue if grantedAuthorities and groups both contain empty string
Set allAuthorities = AuthorityUtils.authorityListToSet(authentication.getAuthorities())
.stream()
.map(authority -> authority.replaceAll("^ROLE_", ""))
+ .filter(a -> !a.isEmpty())
.collect(Collectors.toSet());
Set grantedAuthorities = new HashSet<>();
if (filterGroupsByAppName()) {
diff --git a/src/main/java/org/cbioportal/security/CustomJwtGrantedAuthoritiesConverter.java b/src/main/java/org/cbioportal/security/CustomJwtGrantedAuthoritiesConverter.java
deleted file mode 100644
index 0d3f8f9b06c..00000000000
--- a/src/main/java/org/cbioportal/security/CustomJwtGrantedAuthoritiesConverter.java
+++ /dev/null
@@ -1,37 +0,0 @@
-package org.cbioportal.security;
-
-import org.cbioportal.security.util.GrantedAuthorityUtil;
-import org.cbioportal.security.util.ClaimRoleExtractorUtil;
-import org.springframework.core.convert.converter.Converter;
-import org.springframework.security.core.GrantedAuthority;
-import org.springframework.security.oauth2.jwt.Jwt;
-
-import java.util.Collection;
-import java.util.Objects;
-
-/**
- * Custom JWT GrantedAuthorities Converter to extract roles from JWT token.
- * Claims should equal resource_access:clientId:roles
- */
-public class CustomJwtGrantedAuthoritiesConverter implements Converter> {
- private static final String DEFAULT_CLIENT_ID = "cbioportal";
-
- private String jwtRolePathClientId;
-
- @Override
- public Collection convert(Jwt jwt) {
- return GrantedAuthorityUtil.generateGrantedAuthoritiesFromRoles(getAuthorities(jwt));
- }
-
- private Collection getAuthorities(Jwt jwt) {
- return ClaimRoleExtractorUtil.extractClientRoles(this.getJwtRolePathClientId(), jwt.getClaims());
- }
-
- private String getJwtRolePathClientId() {
- return Objects.isNull(jwtRolePathClientId) ? DEFAULT_CLIENT_ID : jwtRolePathClientId;
- }
-
- public void setClientId(String clientId) {
- this.jwtRolePathClientId = clientId;
- }
-}
diff --git a/src/main/java/org/cbioportal/security/basic/BasicRestfulAuthenticationSuccessHandler.java b/src/main/java/org/cbioportal/security/basic/BasicRestfulAuthenticationSuccessHandler.java
new file mode 100644
index 00000000000..9291f27abcd
--- /dev/null
+++ b/src/main/java/org/cbioportal/security/basic/BasicRestfulAuthenticationSuccessHandler.java
@@ -0,0 +1,36 @@
+package org.cbioportal.security.basic;
+
+import jakarta.servlet.http.HttpServletRequest;
+import jakarta.servlet.http.HttpServletResponse;
+import jakarta.servlet.http.HttpSession;
+import org.springframework.security.core.Authentication;
+import org.springframework.security.core.context.SecurityContext;
+import org.springframework.security.core.context.SecurityContextHolder;
+import org.springframework.security.core.context.SecurityContextHolderStrategy;
+import org.springframework.security.web.DefaultRedirectStrategy;
+import org.springframework.security.web.RedirectStrategy;
+import org.springframework.security.web.authentication.AuthenticationSuccessHandler;
+import org.springframework.security.web.context.HttpSessionSecurityContextRepository;
+import org.springframework.security.web.context.SecurityContextRepository;
+
+import java.io.IOException;
+
+public class BasicRestfulAuthenticationSuccessHandler implements AuthenticationSuccessHandler {
+
+ private final SecurityContextHolderStrategy securityContextHolderStrategy = SecurityContextHolder.getContextHolderStrategy();
+ private final SecurityContextRepository securityContextRepository = new HttpSessionSecurityContextRepository();
+ private final RedirectStrategy redirectStrategy = new DefaultRedirectStrategy();
+ @Override
+ public void onAuthenticationSuccess(HttpServletRequest request,
+ HttpServletResponse response, Authentication authentication) throws IOException {
+ HttpSession session = request.getSession(true);
+ session.setAttribute("user_id", request.getParameter("user_id"));
+ SecurityContext context = this.securityContextHolderStrategy.createEmptyContext();
+ context.setAuthentication(authentication);
+ this.securityContextHolderStrategy.setContext(context);
+ this.securityContextRepository.saveContext(context, request, response);
+ redirectStrategy.sendRedirect(request, response, "/restful_login");
+ }
+
+
+}
\ No newline at end of file
diff --git a/src/main/java/org/cbioportal/security/config/ApiSecurityConfig.java b/src/main/java/org/cbioportal/security/config/ApiSecurityConfig.java
new file mode 100644
index 00000000000..51f8e07e99d
--- /dev/null
+++ b/src/main/java/org/cbioportal/security/config/ApiSecurityConfig.java
@@ -0,0 +1,98 @@
+package org.cbioportal.security.config;
+
+import org.cbioportal.security.token.RestAuthenticationEntryPoint;
+import org.cbioportal.security.token.TokenAuthenticationFilter;
+import org.cbioportal.security.token.TokenAuthenticationSuccessHandler;
+import org.cbioportal.service.DataAccessTokenService;
+import org.cbioportal.utils.config.annotation.ConditionalOnProperty;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.http.HttpStatus;
+import org.springframework.lang.Nullable;
+import org.springframework.security.authentication.AuthenticationManager;
+import org.springframework.security.authentication.AuthenticationProvider;
+import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder;
+import org.springframework.security.config.annotation.web.builders.HttpSecurity;
+import org.springframework.security.config.annotation.web.configurers.AbstractHttpConfigurer;
+import org.springframework.security.web.SecurityFilterChain;
+import org.springframework.security.web.authentication.HttpStatusEntryPoint;
+import org.springframework.security.web.context.SecurityContextHolderFilter;
+import org.springframework.security.web.util.matcher.AntPathRequestMatcher;
+
+@Configuration
+@ConditionalOnProperty(name = "authenticate", havingValue = {"false", "noauthsessionservice", "optional_oauth2"}, isNot = true)
+public class ApiSecurityConfig {
+
+ // Add security filter chains that handle calls to the API endpoints.
+ // Different chains are added for the '/api' and legacy '/webservice.do' paths.
+ // Both are able to handle API tokens provided in the request.
+ // see: "Creating and Customizing Filter Chains" @ https://spring.io/guides/topicals/spring-security-architecture
+
+ @Bean
+ public SecurityFilterChain securityFilterChain(HttpSecurity http, @Nullable DataAccessTokenService tokenService) throws Exception {
+ http.csrf(AbstractHttpConfigurer::disable)
+ // This filter chain only grabs requests to the '/api' path.
+ .securityMatcher("/api/**", "/webservice.do")
+ .authorizeHttpRequests(authorize -> authorize
+ .requestMatchers(
+ "/api/swagger-resources/**",
+ "/api/swagger-ui.html",
+ "/api/health",
+ "/api/cache/**").permitAll()
+ .anyRequest().authenticated()
+ )
+ .sessionManagement(sessionManagement -> sessionManagement.sessionFixation().migrateSession())
+ .exceptionHandling(eh ->
+ eh.defaultAuthenticationEntryPointFor(
+ new HttpStatusEntryPoint(HttpStatus.UNAUTHORIZED), AntPathRequestMatcher.antMatcher("/api/**")
+ )
+ );
+ // When dat.method is not 'none' and a tokenService bean is present,
+ // the apiTokenAuthenticationFilter is added to the filter chain.
+ if (tokenService != null) {
+ http.apply(ApiTokenFilterDsl.tokenFilterDsl(tokenService));
+ }
+ return http.build();
+ }
+
+ @Autowired
+ public void buildAuthenticationManager(AuthenticationManagerBuilder authenticationManagerBuilder,
+ @Nullable AuthenticationProvider... authenticationProviders) {
+ if (authenticationProviders != null) {
+ for (AuthenticationProvider authenticationProvider : authenticationProviders) {
+ authenticationManagerBuilder.authenticationProvider(authenticationProvider);
+ }
+ }
+ }
+
+ @Bean
+ public RestAuthenticationEntryPoint restAuthenticationEntryPoint() {
+ return new RestAuthenticationEntryPoint();
+ }
+
+}
+
+
+class ApiTokenFilterDsl extends AbstractHttpConfigurer {
+
+ private final DataAccessTokenService tokenService;
+
+ public ApiTokenFilterDsl(DataAccessTokenService tokenService) {
+ this.tokenService = tokenService;
+ }
+
+ @Override
+ public void configure(HttpSecurity http) {
+ AuthenticationManager authenticationManager = http.getSharedObject(AuthenticationManager.class);
+ TokenAuthenticationSuccessHandler tokenAuthenticationSuccessHandler = new TokenAuthenticationSuccessHandler();
+ TokenAuthenticationFilter filter = new TokenAuthenticationFilter("/**", authenticationManager, tokenService);
+ filter.setAuthenticationSuccessHandler(tokenAuthenticationSuccessHandler);
+ http.addFilterAfter(filter, SecurityContextHolderFilter.class);
+ }
+
+ public static ApiTokenFilterDsl tokenFilterDsl(DataAccessTokenService tokenService) {
+ return new ApiTokenFilterDsl(tokenService);
+ }
+
+}
diff --git a/src/main/java/org/cbioportal/security/config/AutoconfigureExcludeConfig.java b/src/main/java/org/cbioportal/security/config/AutoconfigureExcludeConfig.java
new file mode 100644
index 00000000000..5c14beb51e6
--- /dev/null
+++ b/src/main/java/org/cbioportal/security/config/AutoconfigureExcludeConfig.java
@@ -0,0 +1,38 @@
+package org.cbioportal.security.config;
+
+import org.cbioportal.utils.config.annotation.ConditionalOnProperty;
+import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
+import org.springframework.boot.autoconfigure.condition.ConditionalOnExpression;
+import org.springframework.boot.autoconfigure.data.redis.RedisAutoConfiguration;
+import org.springframework.boot.autoconfigure.security.oauth2.client.servlet.OAuth2ClientAutoConfiguration;
+import org.springframework.boot.autoconfigure.security.saml2.Saml2RelyingPartyAutoConfiguration;
+import org.springframework.context.annotation.Configuration;
+
+// Conditionally disable autoconfguration for Spring Boot components.
+public class AutoconfigureExcludeConfig {
+
+ private AutoconfigureExcludeConfig() {}
+
+ @Configuration
+ @ConditionalOnProperty(name = "authenticate", havingValue = {"saml", "oauth2", "optional_oauth2","saml_plus_basic"}, isNot = true)
+ @EnableAutoConfiguration(exclude={OAuth2ClientAutoConfiguration.class, Saml2RelyingPartyAutoConfiguration.class})
+ public static class ExcludeAll {}
+
+ @Configuration
+ @ConditionalOnExpression("{'saml','saml_plus_basic'}.contains('${authenticate}')")
+ @EnableAutoConfiguration(exclude=OAuth2ClientAutoConfiguration.class)
+ public static class Saml {}
+
+ @Configuration
+ @ConditionalOnProperty(name = "authenticate", havingValue = "oauth2")
+ @EnableAutoConfiguration(exclude=Saml2RelyingPartyAutoConfiguration.class)
+ public static class OAuth2 {}
+
+ @Configuration
+ @ConditionalOnExpression(
+ "T(org.apache.commons.lang3.StringUtils).isEmpty('${spring.session.store-type:}')"
+ )
+ @EnableAutoConfiguration(exclude=RedisAutoConfiguration.class)
+ public static class Redis {}
+
+}
diff --git a/src/main/java/org/cbioportal/security/config/CorsConfig.java b/src/main/java/org/cbioportal/security/config/CorsConfig.java
new file mode 100644
index 00000000000..cd92394da49
--- /dev/null
+++ b/src/main/java/org/cbioportal/security/config/CorsConfig.java
@@ -0,0 +1,37 @@
+package org.cbioportal.security.config;
+
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;
+import org.springframework.web.cors.CorsConfiguration;
+import org.springframework.web.cors.CorsConfigurationSource;
+import org.springframework.web.cors.UrlBasedCorsConfigurationSource;
+
+import java.util.List;
+
+@Configuration
+@EnableWebSecurity
+public class CorsConfig {
+ @Value("${security.cors.allowed-origins:}")
+ private String allowedOrigins;
+
+ @Bean
+ CorsConfigurationSource corsConfigurationSource() {
+ List parsedAllowedOrigins = List.of(allowedOrigins.split(","));
+ UrlBasedCorsConfigurationSource source = new UrlBasedCorsConfigurationSource();
+ if ( parsedAllowedOrigins.isEmpty()) {
+ return source;
+ }
+
+ CorsConfiguration configuration = new CorsConfiguration();
+ configuration.setAllowedOrigins(parsedAllowedOrigins);
+ configuration.setAllowedMethods(List.of("GET","POST", "HEAD","OPTIONS"));
+ configuration.setAllowedHeaders(List.of("user-agent", "Origin", "Accept", "X-Requested-With","Content-Type",
+ "Access-Control-Request-Method","Access-Control-Request-Headers","Content-Encoding",
+ "X-Proxy-User-Agreement", "x-current-url"));
+ configuration.setExposedHeaders(List.of("total-count", "sample-count"));
+ source.registerCorsConfiguration("/**", configuration);
+ return source;
+ }
+}
diff --git a/src/main/java/org/cbioportal/security/config/CustomOAuth2AuthorizationConfig.java b/src/main/java/org/cbioportal/security/config/CustomOAuth2AuthorizationConfig.java
new file mode 100644
index 00000000000..7929fdce39f
--- /dev/null
+++ b/src/main/java/org/cbioportal/security/config/CustomOAuth2AuthorizationConfig.java
@@ -0,0 +1,78 @@
+package org.cbioportal.security.config;
+
+import org.cbioportal.model.User;
+import org.cbioportal.model.UserAuthorities;
+import org.cbioportal.persistence.SecurityRepository;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;
+import org.springframework.security.core.GrantedAuthority;
+import org.springframework.security.core.authority.AuthorityUtils;
+import org.springframework.security.oauth2.client.oidc.userinfo.OidcUserRequest;
+import org.springframework.security.oauth2.client.oidc.userinfo.OidcUserService;
+import org.springframework.security.oauth2.client.userinfo.OAuth2UserService;
+import org.springframework.security.oauth2.core.OAuth2AuthenticationException;
+import org.springframework.security.oauth2.core.oidc.user.DefaultOidcUser;
+import org.springframework.security.oauth2.core.oidc.user.OidcUser;
+
+import java.util.HashSet;
+import java.util.Objects;
+import java.util.Set;
+
+@Configuration
+@EnableWebSecurity
+@ConditionalOnProperty(value = "authorization", havingValue = "true")
+public class CustomOAuth2AuthorizationConfig {
+ Logger log = LoggerFactory.getLogger(CustomOAuth2AuthorizationConfig.class);
+
+ private final SecurityRepository securityRepository;
+
+ private static final String NAME_ATTRIBUTE_KEY = "email";
+
+ @Autowired
+ public CustomOAuth2AuthorizationConfig(SecurityRepository securityRepository) {
+ this.securityRepository = securityRepository;
+ }
+
+ @Bean
+ public OAuth2UserService oidcUserService() {
+ final OidcUserService delegate = new OidcUserService();
+
+ return userRequest -> {
+ log.debug("Custom OAuth2 Authorization Enabled");
+
+ // Delegate to the default implementation for loading a user
+ OidcUser oidcUser = delegate.loadUser(userRequest);
+
+ var authenticatedPortalUser = loadPortalUser(oidcUser.getEmail());
+ if (Objects.isNull(authenticatedPortalUser.cbioUser) || !authenticatedPortalUser.cbioUser.isEnabled()) {
+ log.debug("User: {} either not in db or not authorized", oidcUser.getEmail());
+ throw new OAuth2AuthenticationException("user not authorized");
+ }
+ Set mappedAuthorities = authenticatedPortalUser.authorities;
+ oidcUser = new DefaultOidcUser(mappedAuthorities, oidcUser.getIdToken(), oidcUser.getUserInfo(), NAME_ATTRIBUTE_KEY);
+ return oidcUser;
+ };
+ }
+
+ private AuthenticatedPortalUser loadPortalUser(String email) {
+ Set mappedAuthorities = new HashSet<>();
+ User cbioUser = securityRepository.getPortalUser(email);
+ if (!Objects.isNull(cbioUser)) {
+ UserAuthorities authorities = securityRepository.getPortalUserAuthorities(email);
+ if (!Objects.isNull(authorities)) {
+ mappedAuthorities.addAll(AuthorityUtils.createAuthorityList(authorities.getAuthorities()));
+ }
+ }
+ return new AuthenticatedPortalUser(cbioUser, mappedAuthorities);
+ }
+
+ record AuthenticatedPortalUser(User cbioUser, Set authorities) {
+
+ }
+
+}
\ No newline at end of file
diff --git a/src/main/java/org/cbioportal/security/config/MethodSecurityConfig.java b/src/main/java/org/cbioportal/security/config/MethodSecurityConfig.java
index f347bf832e9..1d9d6013568 100644
--- a/src/main/java/org/cbioportal/security/config/MethodSecurityConfig.java
+++ b/src/main/java/org/cbioportal/security/config/MethodSecurityConfig.java
@@ -3,10 +3,8 @@
import org.cbioportal.persistence.cachemaputil.CacheMapUtil;
import org.cbioportal.security.CancerStudyPermissionEvaluator;
import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.autoconfigure.condition.ConditionalOnExpression;
-import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.security.access.expression.method.DefaultMethodSecurityExpressionHandler;
@@ -15,9 +13,8 @@
@Configuration
@EnableMethodSecurity(prePostEnabled = true)
-@ConditionalOnExpression("{'oauth2','saml','optional_oauth2'}.contains('${authenticate}')")
-//TODO: Potentially Delete after import pipeline fixed
-@ConditionalOnProperty(name = "security.method_authorization_enabled", havingValue = "true")
+// We are allowing users to enable method_authorization if optional_oauth2 is selected
+@ConditionalOnExpression("{'oauth2','saml', 'saml_plus_basic'}.contains('${authenticate}') or ('optional_oauth2' eq '${authenticate}' and 'true' eq '${security.method_authorization_enabled}')")
public class MethodSecurityConfig {
@Value("${app.name:}")
private String appName;
@@ -28,7 +25,6 @@ public class MethodSecurityConfig {
@Value("${always_show_study_group:}")
private String alwaysShowCancerStudyGroup;
- @Qualifier("staticRefCacheMapUtil")
@Autowired
private CacheMapUtil cacheMapUtil;
diff --git a/src/main/java/org/cbioportal/security/config/NoSecurityConfig.java b/src/main/java/org/cbioportal/security/config/NoSecurityConfig.java
index 8e7741a81db..42f49c96cd3 100644
--- a/src/main/java/org/cbioportal/security/config/NoSecurityConfig.java
+++ b/src/main/java/org/cbioportal/security/config/NoSecurityConfig.java
@@ -3,6 +3,7 @@
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
+import org.springframework.security.config.Customizer;
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;
import org.springframework.security.config.annotation.web.configurers.AbstractHttpConfigurer;
@@ -14,11 +15,13 @@
public class NoSecurityConfig {
@Bean
public SecurityFilterChain filterChain(HttpSecurity http) throws Exception{
- return http.authorizeHttpRequests(auth -> auth
+ return http
+ .cors(Customizer.withDefaults())
+ .csrf(AbstractHttpConfigurer::disable)
+ .authorizeHttpRequests(auth -> auth
.requestMatchers("/").permitAll()
.anyRequest().permitAll()
)
- .csrf(AbstractHttpConfigurer::disable)
.build();
}
}
\ No newline at end of file
diff --git a/src/main/java/org/cbioportal/security/config/OAuth2SecurityConfig.java b/src/main/java/org/cbioportal/security/config/OAuth2SecurityConfig.java
index 4a8801029a0..c13c5226586 100644
--- a/src/main/java/org/cbioportal/security/config/OAuth2SecurityConfig.java
+++ b/src/main/java/org/cbioportal/security/config/OAuth2SecurityConfig.java
@@ -1,110 +1,113 @@
package org.cbioportal.security.config;
-import org.cbioportal.security.CustomJwtGrantedAuthoritiesConverter;
import org.cbioportal.security.util.ClaimRoleExtractorUtil;
import org.cbioportal.security.util.GrantedAuthorityUtil;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.boot.autoconfigure.security.SecurityProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.core.annotation.Order;
-import org.springframework.http.HttpStatus;
import org.springframework.security.config.Customizer;
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
-import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;
import org.springframework.security.config.annotation.web.configurers.AbstractHttpConfigurer;
-import org.springframework.security.config.annotation.web.configurers.oauth2.server.resource.OAuth2ResourceServerConfigurer;
import org.springframework.security.core.GrantedAuthority;
+import org.springframework.security.core.authority.SimpleGrantedAuthority;
import org.springframework.security.core.authority.mapping.GrantedAuthoritiesMapper;
+import org.springframework.security.oauth2.client.oidc.web.logout.OidcClientInitiatedLogoutSuccessHandler;
+import org.springframework.security.oauth2.client.registration.ClientRegistrationRepository;
import org.springframework.security.oauth2.core.oidc.user.OidcUserAuthority;
import org.springframework.security.oauth2.core.user.OAuth2UserAuthority;
-import org.springframework.security.oauth2.server.resource.authentication.JwtAuthenticationConverter;
import org.springframework.security.web.SecurityFilterChain;
-import org.springframework.security.web.authentication.HttpStatusEntryPoint;
-import org.springframework.security.web.util.matcher.AntPathRequestMatcher;
+import org.springframework.security.web.authentication.logout.LogoutSuccessHandler;
+import java.util.ArrayList;
+import java.util.Collection;
import java.util.HashSet;
+import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.Set;
+import java.util.stream.Collectors;
@Configuration
-@EnableWebSecurity
// add new chain after api-filter chain (at position -2), but before the default fallback chain
@Order(SecurityProperties.BASIC_AUTH_ORDER - 1)
+@ConditionalOnProperty(value = "authenticate", havingValue = "oauth2")
public class OAuth2SecurityConfig {
+ private static final Logger log = LoggerFactory.getLogger(OAuth2SecurityConfig.class);
+
+
+ @Value("${spring.security.oauth2.client.jwt-roles-path:resource_access::cbioportal::roles}")
+ private String jwtRolesPath;
- @Value("${spring.security.oauth2.roles-path.client-id:}")
- private String clientId;
-
- @Value("${spring.security.oauth2.resourceserver.jwt.issuer-uri:}")
- private String jwtResourceServerUri;
-
- @Bean
- @ConditionalOnProperty(value = "authenticate", havingValue = "oauth2")
- public SecurityFilterChain oAuth2filterChain(HttpSecurity http) throws Exception {
+ private static final String LOGIN_URL = "/login";
- http.authorizeHttpRequests(auth ->
- auth.requestMatchers("/api/health", "/login", "/images/**").permitAll()
- .anyRequest().authenticated())
- .oauth2Login(oauth -> oauth.loginPage("/login"))
- .logout((logout) -> logout.logoutSuccessUrl("/login?logout_success"))
- .exceptionHandling(eh ->
- eh.defaultAuthenticationEntryPointFor(new HttpStatusEntryPoint(HttpStatus.UNAUTHORIZED), AntPathRequestMatcher.antMatcher("/api/**")))
- .csrf(AbstractHttpConfigurer::disable);
-
- if(!Objects.isNull(this.jwtResourceServerUri) && !this.jwtResourceServerUri.isEmpty()) {
- http.oauth2ResourceServer(OAuth2ResourceServerConfigurer::jwt);
- }
+ @Bean
+ public SecurityFilterChain filterChain(HttpSecurity http, ClientRegistrationRepository clientRegistrationRepository) throws Exception {
+ http.csrf(AbstractHttpConfigurer::disable)
+ .cors(Customizer.withDefaults())
+ .authorizeHttpRequests(authorize ->
+ authorize
+ .requestMatchers("/api/health", LOGIN_URL, "/images/**").permitAll()
+ .anyRequest().authenticated()
+ )
+ .oauth2Login(login ->
+ login
+ .loginPage(LOGIN_URL)
+ .userInfoEndpoint(userInfo ->
+ userInfo.userAuthoritiesMapper(userAuthoritiesMapper())
+ )
+ .failureUrl(LOGIN_URL + "?logout_failure")
+ )
+ .logout(logout -> logout
+ .logoutSuccessHandler(oidcLogoutSuccessHandler(clientRegistrationRepository))
+ );
return http.build();
}
- @Bean
- @ConditionalOnProperty(value = "authenticate", havingValue = "optional_oauth2")
- public SecurityFilterChain optionalOAuth2filterChain(HttpSecurity http) throws Exception {
- return http
- .oauth2Login(oauth -> oauth.loginPage("/login"))
- .authorizeHttpRequests(auth -> auth
- .requestMatchers("/").permitAll()
- .anyRequest().permitAll())
- .csrf(AbstractHttpConfigurer::disable)
- .logout((logout) -> logout.logoutSuccessUrl("/"))
- .build();
- }
- @Bean
- public GrantedAuthoritiesMapper userAuthoritiesMapper() {
+ private GrantedAuthoritiesMapper userAuthoritiesMapper() {
return (authorities) -> {
Set mappedAuthorities = new HashSet<>();
authorities.forEach(authority -> {
- Map claims = null;
- if (authority instanceof OidcUserAuthority oidcUserAuthority && !Objects.isNull(oidcUserAuthority.getUserInfo())) {
- claims = oidcUserAuthority.getUserInfo().getClaims();
- } else if (authority instanceof OAuth2UserAuthority oauth2UserAuthority) {
- claims = oauth2UserAuthority.getAttributes();
+ List