-
Notifications
You must be signed in to change notification settings - Fork 555
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into demo-rfc80-poc
- Loading branch information
Showing
20 changed files
with
226 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -109,3 +109,4 @@ Dockerfile.local | |
security.properties | ||
*.crt | ||
*.key | ||
*~ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
## The cBioPortal Foundation | ||
|
||
The mission of cBioPortal Foundation is to support the development and adoption of the cBioPortal for Cancer Genomics, open-source software for the interactive exploration of multidimensional cancer genomics data sets. The cBioPortal aims to significantly lower the barriers between complex genomic data and cancer researchers by providing rapid, intuitive, and high-quality access to molecular profiles and clinical attributes from large-scale cancer genomics projects, and by doing so, empower researchers to translate these rich data sets into biologic insights and clinical applications. | ||
|
||
The cBioPortal Foundation will help further the mission of cBioPortal by supporting hackathons, user meetings, internships and other activities. | ||
|
||
## Contribute to cBioPortal Foundation | ||
|
||
**TAX-DEDUCTIBLE CONTRIBUTIONS** | ||
|
||
**Grants or distributions accepted from:** | ||
Individuals • Corporations • Donor-Advised Funds • Foundations | ||
Retirement Accounts • Charitable Trusts | ||
|
||
**Donate any asset with established or appraisable value, such as:** | ||
Stocks • Bonds • Real Estate • Collectibles • Art | ||
Cryptocurrency • Privately Held Business Interests | ||
|
||
[Asset & Large Contributions](https://lohas.org/client/cbioportal-foundation/#donation_form) | ||
|
||
[!button Donate](https://abqwvktl.donorsupport.co/page/FUNFLDNZDHK) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
95 changes: 95 additions & 0 deletions
95
...yment/authorization-and-authentication/Keycloak-API-Access-and-User-Creation.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,95 @@ | ||
# Keycloak Management via API Access and User Creation | ||
|
||
**⚠️ This documentation is for keycloak <v20, see related [ticket](https://github.com/cBioPortal/cbioportal/issues/10360) ⚠️** | ||
|
||
## Introduction | ||
You may wish to programmatically manage aspects of your Keycloak setup via the Keycloak API. | ||
This is particularly useful for tasks such as: | ||
1. Bulk User Creation | ||
2. Modifying group membership | ||
3. Assigning roles to many users | ||
|
||
The following instructions will show you how to configure a Keycloak Client Service Account and assign appropriate permissions required for the management task. | ||
|
||
> [!NOTE] | ||
> Important URLS | ||
> https://\<KEYCLOAK_HOST\>/auth/admin/master/console/#/realms/\<REALM\>/clients | ||
> https://\<KEYCLOAK_HOST\>/auth/realms/\<REALM\>/protocol/openid-connect/token | ||
## Configure a Keycloak Client | ||
Navigate to: <Realm> -> Clients -> Select Client: `realm-management` -> Settings tab | ||
|
||
We’re using the `realm-management` client here but you can configure any other client. Make sure the following options are set. | ||
|
||
![](/images/previews/keycloak-api-access-settings.png) | ||
|
||
| parameter | value | comment | | ||
| ------------- |:-------------:| -----:| | ||
| Enabled | true || | ||
| Client Protocol | openid-connect | (default value) | | ||
| Access Type | confidential | This will allow us to make a call to the token service endpoint and follow an openid login flow. | | ||
| Valid Redirect URIs | _url_ | _url_ refers to base url of keycloak instance. Access Type must be set to confidential for this option to show | | ||
| Service Accounts Enabled | true | (default value). Access Type must be set to confidential for this option to show | | ||
|
||
> [!NOTE] | ||
> 1. The redirect url and service accounts enabled options will not appear on the UI until the Access Type -> confidential | ||
> 2. The Service Account Roles TAB will not show until Service Accounts Enabled: True | ||
> [!TIP] | ||
> 1. Configure ONE client per application/script (set of scripts) that will make calls against the Keycloak API. That way you can manage/revoke permissions and also regenerate the client_secret if needed. | ||
## Obtain Client Credentials | ||
Navigate to: <Realm> -> Clients -> Select Client: `realm-management` -> Credentials tab | ||
|
||
1. Select `Client Id and Secret` | ||
2. Click `Regenerate Secret` to generate a secret | ||
3. Keep `ClientId` and `Secret` for obtaining an access token from keycloak | ||
|
||
![](/images/previews/keycloak-api-access-credentials.png) | ||
|
||
| parameter | value | comment | | ||
| ------------- |:-------------:| -----:| | ||
| Client Authenticator | Client Id and Secret | | | ||
|
||
## Configure Service Account Roles | ||
Navigate to: <Realm> -> Clients -> Select Client: `realm-management` -> `Service Account Roles` Tab | ||
|
||
Under `Client Roles` -> Select the `realm-management` from the dropdown menu | ||
|
||
From here scroll through the available roles for the `view-users` roles. Click `Add selected >>` | ||
Assign additional roles if needed. | ||
|
||
![](/images/previews/keycloak-api-access-service-account.png) | ||
|
||
> [!NOTE] | ||
> 1. For managing users, we want to assign “manage-users” and “view-users” roles to “realm-management” | ||
> 2. Only add the permissions you require for the tasks that will be performed. | ||
|
||
## Make API calls to the Keycloak 12 REST API | ||
See Keycloak REST-API [documentation](https://www.keycloak.org/docs-api/latest/rest-api/index.html) | ||
|
||
Provide `client_id`, `client_secret`, `grant_type=”client_credentials”` as `x-www-form-urlencoded` | ||
|
||
1. Make a call to the token service to obtain an access token | ||
```bash | ||
# Obtain an access token | ||
curl -X POST https://<KEYCLOAK_HOST>/auth/realms/<REALM>/protocol/openid-connect/token \ | ||
-H 'Content-type: application/x-www-form-urlencoded' \ | ||
-d "client_id=$(KC_CLIENT_ID)" \ | ||
-d "client_secret=$(KC_CLIENT_SECRET)" \ | ||
-d "grant_type=$(KC_GRANT_TYPE)" | jq '.access_token' | ||
``` | ||
|
||
2. Send the token which each request | ||
```bash | ||
# Get keycloak users | ||
curl -X GET https://<KEYCLOAK_HOST>/auth/admin/realms/<REALM>/users \ | ||
-H "Authorization: Bearer ${ACCESS_TOKEN}" \ | ||
-H 'cache-control: no-cache' | ||
``` | ||
|
||
|
||
> [!NOTE] | ||
> 1. The access token by default only has a life of 300s (5min). This can be adjusted under the Settings Tab -> Advanced Settings Access Token Lifespan. | ||
> 2. These calls were made against Keycloak version 12 so they must include <KEYCLOAK_HOST>`/auth/` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
# Deploy on Kubernetes | ||
|
||
## Prerequisites | ||
|
||
Official [cBioPortal Helm chart](https://artifacthub.io/packages/search?org=cbioportal) can be used to easily deploy an instance on a Kubernetes cluster. Make sure you meet the following prerequisites before continuing with the usage instructions: | ||
|
||
- You have access to a cluster (e.g. Minikube or AWS EKS). We recommend [setting up a Minikube cluster](https://minikube.sigs.k8s.io/docs/start/) on your local machine for development purposes. | ||
- You have installed [Helm](https://helm.sh/docs/intro/install/) on your system. | ||
- You have read and write access to a mysql database server. | ||
|
||
## Usage instructions | ||
|
||
|
||
### Cluster & Database Setup | ||
|
||
#### Step 1 - Add cBioPortal label to your cluster | ||
|
||
Make sure your cluster is already set up and you have access to a node running on it. Instructions for this can vary, depending on your Kubernetes provider. Once your cluster is active, run the following command to add a label to the node on your cluster. | ||
|
||
``` | ||
kubectl label nodes <your-node-name> node-group=cbioportal | ||
``` | ||
|
||
#### Step 2 - Export database access credentials | ||
cBioPortal needs access to a mysql database server hosting cancer study data. As mentioned in the prerequisites, you need access to a mysql database server for this. Instructions for this can vary, depending on your database server provider. Once you have a server available, download MSK's latest database dump [here](https://public-db-dump.assets.cbioportal.org/) and add the data to your database server. Then, continue with the instructions below using your mysql server credentials. | ||
|
||
Create a new values file called _values.secret.yaml_ and add your database credential values. | ||
```yaml | ||
container: | ||
env: | ||
- name: DB_USER | ||
value: <your-db-user> | ||
- name: DB_PASSWORD | ||
value: <your-db-password> | ||
- name: DB_CONNECTION_STRING | ||
value: <your-db-connection_string> | ||
``` | ||
### Install cBioPortal | ||
Now that your cluster and data sources have been successfully configured, you can install the cBioPortal helm chart. | ||
#### Step 1 - Install Helm Chart | ||
Add repository. | ||
``` | ||
helm repo add cbioportal https://cbioportal.github.io/cbioportal-helm/ | ||
``` | ||
|
||
Install chart | ||
``` | ||
helm install my-cbioportal cbioportal/cbioportal --version 0.1.6 -f path/to/values.secret.yaml | ||
``` | ||
|
||
You should see something similar to this, indicating that the installation was successful. | ||
``` | ||
NAME: my-cbioportal | ||
LAST DEPLOYED: Thu Nov 14 14:15:18 2024 | ||
NAMESPACE: default | ||
STATUS: deployed | ||
REVISION: 1 | ||
TEST SUITE: None | ||
``` | ||
|
||
#### Step 2 - Access cBioPortal through localhost | ||
Run the following command to port-forward cBioPortal from the cluster to your local network. | ||
``` | ||
kubectl port-forward deployment/cbioportal 10000:8080 | ||
``` | ||
|
||
cBioPortal should now be available at localhost on port 10000. Navigate to [http://localhost:10000](http://localhost:10000) in your browser to view it. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
# cBioPortal ER Diagram | ||
[cBioPortal ER Diagram - PDF Version](https://github.com/cBioPortal/cbioportal/blob/master/db-scripts/src/main/resources/cbioportal-er-diagram.pdf) | ||
[cBioPortal ER Diagram - PDF Version](https://github.com/cBioPortal/cbioportal/blob/master/src/main/resources/db-scripts/cbioportal-er-diagram.pdf) | ||
|
||
![cBioPortal ER Diagram](https://raw.githubusercontent.com/cBioPortal/cbioportal/master/db-scripts/src/main/resources/cbioportal-er-diagram.png) | ||
![cBioPortal ER Diagram](https://github.com/cBioPortal/cbioportal/blob/master/src/main/resources/db-scripts/cbioportal-er-diagram.png) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.