diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index b4b9d42e33a..cc51d282418 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -20,7 +20,6 @@ /jans-auth-server/ @yurem @yuriyz /jans-fido2/ @yurem /jans-scim/ @jgomer2001 -/jans-client-api/ @jmunozherbas @yuriyz /jans-config-api/ @pujavs @yuriyz /jans-cli/ @devrimyatar /jans-linux-setup/ @devrimyatar @smansoft @yuriyz diff --git a/.github/workflows/build-wars.yml b/.github/workflows/build-wars.yml index 63f6509b8b0..a0a58ad6aaa 100644 --- a/.github/workflows/build-wars.yml +++ b/.github/workflows/build-wars.yml @@ -15,7 +15,6 @@ on: - 'jans-notify/**' - 'jans-orm/**' - 'jans-scim/**' - - 'jans-client-api/**' push: branches: @@ -31,7 +30,6 @@ on: - 'jans-notify/**' - 'jans-orm/**' - 'jans-scim/**' - - 'jans-client-api/**' jobs: build: name: Build wars @@ -40,7 +38,7 @@ jobs: strategy: max-parallel: 11 matrix: - fldrpath: ['jans-bom','agama','jans-fido2','jans-core','jans-eleven','jans-notify','jans-auth-server','jans-orm','jans-config-api','jans-scim','jans-client-api'] + fldrpath: ['jans-bom','agama','jans-fido2','jans-core','jans-eleven','jans-notify','jans-auth-server','jans-orm','jans-config-api','jans-scim'] steps: - name : Variables run: | diff --git a/.github/workflows/central_code_quality_check.yml b/.github/workflows/central_code_quality_check.yml index 5945ad09f65..c2f13cac27a 100644 --- a/.github/workflows/central_code_quality_check.yml +++ b/.github/workflows/central_code_quality_check.yml @@ -13,7 +13,6 @@ on: - 'jans-auth-server/**' - 'jans-orm/**' - 'jans-config-api/**' - - 'jans-client-api/**' - 'jans-scim/**' - 'jans-core/**' - 'jans-notify/**' @@ -36,7 +35,6 @@ on: - 'jans-auth-server/**' - 'jans-orm/**' - 'jans-config-api/**' - - 'jans-client-api/**' - 'jans-scim/**' - 'jans-core/**' - 'jans-notify/**' @@ -58,13 +56,12 @@ jobs: strategy: fail-fast: false matrix: - module: [jans-auth-server, agama, jans-config-api, jans-core, jans-linux-setup, jans-cli, jans-client-api, jans-fido2, jans-notify, jans-orm, jans-scim, jans-eleven, jans-pycloudlib] + module: [jans-auth-server, agama, jans-config-api, jans-core, jans-linux-setup, jans-cli, jans-fido2, jans-notify, jans-orm, jans-scim, jans-eleven, jans-pycloudlib] env: JVM_PROJECTS: | jans-auth-server jans-orm jans-config-api - jans-client-api jans-scim jans-core jans-notify @@ -142,8 +139,6 @@ jobs: case ${{ matrix.module }} in "jans-auth-server") ;& - "jans-client-api") - ;& "jans-scim") ;& "jans-eleven") diff --git a/.github/workflows/docker_build_image.yml b/.github/workflows/docker_build_image.yml index 55d7517f16b..ef0acf3d80f 100644 --- a/.github/workflows/docker_build_image.yml +++ b/.github/workflows/docker_build_image.yml @@ -28,9 +28,9 @@ on: workflow_dispatch: inputs: services: - description: 'One or set of the docker images. Format as following: "docker-jans-auth-server docker-jans-certmanager docker-jans-client-api docker-jans-config-api docker-jans-configurator docker-jans-fido2 docker-jans-persistence-loader docker-jans-scim docker-jans-monolith"' + description: 'One or set of the docker images. Format as following: "docker-jans-auth-server docker-jans-certmanager docker-jans-config-api docker-jans-configurator docker-jans-fido2 docker-jans-persistence-loader docker-jans-scim docker-jans-monolith"' required: true - default: 'docker-jans-auth-server docker-jans-certmanager docker-jans-client-api docker-jans-config-api docker-jans-configurator docker-jans-fido2 docker-jans-persistence-loader docker-jans-scim docker-jans-monolith' + default: 'docker-jans-auth-server docker-jans-certmanager docker-jans-config-api docker-jans-configurator docker-jans-fido2 docker-jans-persistence-loader docker-jans-scim docker-jans-monolith' cn_version: description: 'The war version to build the image off' required: false @@ -49,7 +49,7 @@ jobs: strategy: max-parallel: 8 matrix: - docker-images: ["auth-server", "certmanager", "config-api", "client-api", "configurator", "fido2", "persistence-loader", "scim", "monolith"] + docker-images: ["auth-server", "certmanager", "config-api", "configurator", "fido2", "persistence-loader", "scim", "monolith"] steps: - name: Checkout uses: actions/checkout@v3 @@ -63,7 +63,7 @@ jobs: DEFAULT_ALL=${{ github.event.inputs.services }} if [ -z "$DEFAULT_ALL" ] then - DEFAULT_ALL="docker-jans-auth-server docker-jans-certmanager docker-jans-client-api docker-jans-config-api docker-jans-configurator docker-jans-fido2 docker-jans-persistence-loader docker-jans-scim docker-jans-monolith" + DEFAULT_ALL="docker-jans-auth-server docker-jans-certmanager docker-jans-config-api docker-jans-configurator docker-jans-fido2 docker-jans-persistence-loader docker-jans-scim docker-jans-monolith" else echo "$DEFAULT_ALL" fi diff --git a/.github/workflows/docker_imagescan.yml b/.github/workflows/docker_imagescan.yml index f61e8424c9d..5981ac140e7 100644 --- a/.github/workflows/docker_imagescan.yml +++ b/.github/workflows/docker_imagescan.yml @@ -26,7 +26,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - docker-images: ["auth-server", "certmanager", "config-api", "client-api", "configurator", "fido2", "persistence-loader", "scim", "monolith"] + docker-images: ["auth-server", "certmanager", "config-api", "configurator", "fido2", "persistence-loader", "scim", "monolith"] steps: - uses: actions/checkout@v3 - name: Build the Container image diff --git a/.github/workflows/jans_pycloud_build_package.yml b/.github/workflows/jans_pycloud_build_package.yml index ae02e991acb..10118c2c787 100644 --- a/.github/workflows/jans_pycloud_build_package.yml +++ b/.github/workflows/jans_pycloud_build_package.yml @@ -48,7 +48,7 @@ jobs: if: github.actor != 'mo-auto' id: build_stable_reqs run: | - dockerimages="auth-server certmanager client-api config-api configurator fido2 persistence-loader scim" + dockerimages="auth-server certmanager config-api configurator fido2 persistence-loader scim" for image in $dockerimages; do sed -i '/git+https/c\git+https://github.com/${{ github.repository }}@${{ github.sha }}#egg=jans-pycloudlib&subdirectory=jans-pycloudlib' ./docker-jans-$image/requirements.txt done diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index b4377d6f95e..278e39878f6 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -83,7 +83,7 @@ jobs: #max-parallel: 1 fail-fast: false matrix: - maven: [ "jans-scim", "jans-orm", "jans-notify", "jans-fido2", "jans-eleven", "jans-core", "jans-config-api", "jans-client-api", "jans-bom", "jans-auth-server", "agama" ] + maven: [ "jans-scim", "jans-orm", "jans-notify", "jans-fido2", "jans-eleven", "jans-core", "jans-config-api", "jans-bom", "jans-auth-server", "agama" ] steps: - name: Checkout uses: actions/checkout@v3 @@ -120,7 +120,7 @@ jobs: #max-parallel: 1 fail-fast: false matrix: - simple: [ "docker-jans-auth-server", "docker-jans-certmanager", "docker-jans-config-api", "docker-jans-client-api", "docker-jans-configurator", "docker-jans-fido2", "docker-jans-persistence-loader", "docker-jans-scim", "docker-jans-monolith" ] + simple: [ "docker-jans-auth-server", "docker-jans-certmanager", "docker-jans-config-api", "docker-jans-configurator", "docker-jans-fido2", "docker-jans-persistence-loader", "docker-jans-scim", "docker-jans-monolith" ] steps: - name: Checkout uses: actions/checkout@v3 diff --git a/automation/analyze_test_microk8s_setup.sh b/automation/analyze_test_microk8s_setup.sh index 16be675663e..5d23c5ba272 100644 --- a/automation/analyze_test_microk8s_setup.sh +++ b/automation/analyze_test_microk8s_setup.sh @@ -17,11 +17,7 @@ collect_logs() { echo "Found $POD_NAME built on $BUILD" t=0 while true; do - if [[ $SERVICE == "client-api" ]];then - kubectl cp -n jans "$POD_NAME":opt/client-api/logs/ jans-"$SERVICE"-logs && zip -r jans-"$SERVICE"-logs-"$DATE".zip jans-"$SERVICE"-logs && rm -rf jans-"$SERVICE"-logs/ && t=120 || t=$(( t + 60 )) - else - kubectl cp -n jans "$POD_NAME":opt/jans/jetty/jans-"$SERVICE"/logs jans-"$SERVICE"-logs && zip -r jans-"$SERVICE"-logs-"$DATE".zip jans-"$SERVICE"-logs && rm -rf jans-"$SERVICE"-logs/ && t=120 || t=$(( t + 60 )) - fi + kubectl cp -n jans "$POD_NAME":opt/jans/jetty/jans-"$SERVICE"/logs jans-"$SERVICE"-logs && zip -r jans-"$SERVICE"-logs-"$DATE".zip jans-"$SERVICE"-logs && rm -rf jans-"$SERVICE"-logs/ && t=120 || t=$(( t + 60 )) if [[ $t == 120 ]];then break else @@ -46,7 +42,7 @@ echo "--------------------------------------Outputting configurator logs-------- kubectl logs -l APP_NAME=configurator -c config -n jans echo "--------------------------------------------------------------------------------------------------------------" -SERVICES="auth-server client-api fido2 scim" +SERVICES="auth-server fido2 scim" for SERVICE in $SERVICES; do kubectl -n jans wait --for=condition=available --timeout=30s deploy/janssen-"$SERVICE" || collect_logs "${SERVICE%-server}" "$1" "$2" "$3" done diff --git a/automation/github-labels/labels-schema.json b/automation/github-labels/labels-schema.json index 0ec5cdabcbf..e23fb26a1b1 100644 --- a/automation/github-labels/labels-schema.json +++ b/automation/github-labels/labels-schema.json @@ -89,15 +89,6 @@ "title-prefixes": [] } }, - "comp-docker-jans-client-api": { - "color": "0052CC", - "description": "Touching folder /docker-jans-client-api", - "auto-label": { - "branch": "", - "paths": ["docker-jans-client-api"], - "title-prefixes": [] - } - }, "comp-docker-jans-config-api": { "color": "0052CC", "description": "Touching folder /docker-jans-config-api", @@ -170,15 +161,6 @@ "title-prefixes": [] } }, - "comp-jans-client-api": { - "color": "0052CC", - "description": "Touching folder /jans-client-api", - "auto-label": { - "branch": "", - "paths": ["jans-client-api"], - "title-prefixes": [] - } - }, "comp-jans-config-api": { "color": "0052CC", "description": "Touching folder /jans-config-api", diff --git a/automation/rancher-partner-charts/questions.yaml b/automation/rancher-partner-charts/questions.yaml index c80f042e80a..2c686c1875b 100644 --- a/automation/rancher-partner-charts/questions.yaml +++ b/automation/rancher-partner-charts/questions.yaml @@ -37,20 +37,6 @@ questions: required: true label: Enable SCIM description: "System for Cross-domain Identity Management (SCIM) version 2.0" -- variable: global.client-api.enabled - default: false - type: boolean - group: "Optional Services" - required: true - label: Enable ClientAPI - description: "Middleware API to help application developers call an OAuth, OpenID or UMA server. You may wonder why this is necessary. It makes it easier for client developers to use OpenID signing and encryption features, without becoming crypto experts. This API provides some high level endpoints to do some of the heavy lifting." - show_subquestion_if: true - subquestions: - - variable: config.configmap.cnClientApiCertCn - default: "client-api" - description: "Client API CommonName value for certificate subject" - type: string - label: Client API certificate CommonName (CN) # ====================== # Test environment group @@ -574,35 +560,6 @@ questions: label: Auth Server KeyRotation image tag group: "Images" show_if: "global.auth-server-key-rotation.enabled=true" -# ClientAPI -- variable: client-api.image.repository - required: true - type: string - default: "janssenproject/client-api" - description: "The ClientAPI Image repository" - label: ClientAPI image repo - group: "Images" - show_if: "global.client-api.enabled=true" -- variable: client-api.image.pullPolicy - required: true - type: enum - group: "Images" - default: IfNotPresent - description: "The ClientAPI Image pull policy" - label: ClientAPI imagePullPolicy - options: - - "Always" - - "IfNotPresent" - - "Never" - show_if: "global.client-api.enabled=true" -- variable: client-api.image.tag - required: true - type: string - default: "1.0.1-1" - description: "The ClientAPI Image tag" - label: ClientAPI image tag - group: "Images" - show_if: "global.client-api.enabled=true" # Configurator - variable: config.image.repository required: true @@ -790,15 +747,6 @@ questions: label: Auth-server Replicas description: "Service replica number." show_if: "global.auth-server.enabled=true" -# ClientAPI -- variable: client-api.replicas - default: 1 - required: false - type: int - group: "Replicas" - label: ClientAPI Replicas - description: "Service replica number." - show_if: "global.client-api.enabled=true" # ConfigAPI - variable: config-api.replicas default: 1 diff --git a/automation/startjanssendemo.sh b/automation/startjanssendemo.sh index b3b8a6fe340..6c0311820ed 100644 --- a/automation/startjanssendemo.sh +++ b/automation/startjanssendemo.sh @@ -128,11 +128,6 @@ global: scriptLogLevel: "$LOG_LEVEL" auditStatsLogTarget: "$LOG_TARGET" auditStatsLogLevel: "$LOG_LEVEL" - client-api: - enabled: true - appLoggers: - clientApiLogTarget: "$LOG_TARGET" - clientApiLogLevel: "$LOG_LEVEL" config-api: enabled: true appLoggers: diff --git a/charts/janssen/Chart.yaml b/charts/janssen/Chart.yaml index dd57f9473a0..87aa3b21eda 100644 --- a/charts/janssen/Chart.yaml +++ b/charts/janssen/Chart.yaml @@ -66,9 +66,6 @@ dependencies: - name: auth-server-key-rotation condition: global.auth-server-key-rotation.enabled version: 1.0.3-dev - - name: client-api - condition: global.client-api.enabled - version: 1.0.3-dev - name: persistence condition: global.persistence.enabled version: 1.0.3-dev diff --git a/charts/janssen/README.md b/charts/janssen/README.md index 6c40c87e30a..f11ad5cc65f 100644 --- a/charts/janssen/README.md +++ b/charts/janssen/README.md @@ -10,7 +10,7 @@ Janssen Access and Identity Management | Name | Email | Url | | ---- | ------ | --- | -| moabu | support@jans.io | | +| moabu | | | ## Source Code @@ -25,7 +25,6 @@ Kubernetes: `>=v1.21.0-0` |------------|------|---------| | | auth-server | 1.0.3-dev | | | auth-server-key-rotation | 1.0.3-dev | -| | client-api | 1.0.3-dev | | | config | 1.0.3-dev | | | config-api | 1.0.3-dev | | | fido2 | 1.0.3-dev | @@ -84,33 +83,7 @@ Kubernetes: `>=v1.21.0-0` | auth-server.usrEnvs.secret | object | `{}` | Add custom secret envs to the service variable1: value1 | | auth-server.volumeMounts | list | `[]` | Configure any additional volumesMounts that need to be attached to the containers | | auth-server.volumes | list | `[]` | Configure any additional volumes that need to be attached to the pod | -| client-api | object | `{"additionalAnnotations":{},"additionalLabels":{},"dnsConfig":{},"dnsPolicy":"","hpa":{"behavior":{},"enabled":true,"maxReplicas":10,"metrics":[],"minReplicas":1,"targetCPUUtilizationPercentage":50},"image":{"pullPolicy":"IfNotPresent","pullSecrets":[],"repository":"janssenproject/client-api","tag":"1.0.3_dev"},"livenessProbe":{"exec":{"command":["curl","-k","https://localhost:8443/health-check"]},"initialDelaySeconds":30,"periodSeconds":30,"timeoutSeconds":5},"readinessProbe":{"initialDelaySeconds":60,"periodSeconds":25,"tcpSocket":{"port":8443},"timeoutSeconds":5},"replicas":1,"resources":{"limits":{"cpu":"1000m","memory":"400Mi"},"requests":{"cpu":"1000m","memory":"400Mi"}},"usrEnvs":{"normal":{},"secret":{}},"volumeMounts":[],"volumes":[]}` | Middleware API to help application developers call an OAuth, OpenID or UMA server. You may wonder why this is necessary. It makes it easier for client developers to use OpenID signing and encryption features, without becoming crypto experts. This API provides some high level endpoints to do some of the heavy lifting. | -| client-api.additionalAnnotations | object | `{}` | Additional annotations that will be added across the gateway in the format of {cert-manager.io/issuer: "letsencrypt-prod"} | -| client-api.additionalLabels | object | `{}` | Additional labels that will be added across the gateway in the format of {mylabel: "myapp"} | -| client-api.dnsConfig | object | `{}` | Add custom dns config | -| client-api.dnsPolicy | string | `""` | Add custom dns policy | -| client-api.hpa | object | `{"behavior":{},"enabled":true,"maxReplicas":10,"metrics":[],"minReplicas":1,"targetCPUUtilizationPercentage":50}` | Configure the HorizontalPodAutoscaler | -| client-api.hpa.behavior | object | `{}` | Scaling Policies | -| client-api.hpa.metrics | list | `[]` | metrics if targetCPUUtilizationPercentage is not set | -| client-api.image.pullPolicy | string | `"IfNotPresent"` | Image pullPolicy to use for deploying. | -| client-api.image.pullSecrets | list | `[]` | Image Pull Secrets | -| client-api.image.repository | string | `"janssenproject/client-api"` | Image to use for deploying. | -| client-api.image.tag | string | `"1.0.3_dev"` | Image tag to use for deploying. | -| client-api.livenessProbe | object | `{"exec":{"command":["curl","-k","https://localhost:8443/health-check"]},"initialDelaySeconds":30,"periodSeconds":30,"timeoutSeconds":5}` | Configure the liveness healthcheck for the auth server if needed. | -| client-api.livenessProbe.exec | object | `{"command":["curl","-k","https://localhost:8443/health-check"]}` | Executes the python3 healthcheck. | -| client-api.readinessProbe | object | `{"initialDelaySeconds":60,"periodSeconds":25,"tcpSocket":{"port":8443},"timeoutSeconds":5}` | Configure the readiness healthcheck for the auth server if needed. | -| client-api.replicas | int | `1` | Service replica number. | -| client-api.resources | object | `{"limits":{"cpu":"1000m","memory":"400Mi"},"requests":{"cpu":"1000m","memory":"400Mi"}}` | Resource specs. | -| client-api.resources.limits.cpu | string | `"1000m"` | CPU limit. | -| client-api.resources.limits.memory | string | `"400Mi"` | Memory limit. | -| client-api.resources.requests.cpu | string | `"1000m"` | CPU request. | -| client-api.resources.requests.memory | string | `"400Mi"` | Memory request. | -| client-api.usrEnvs | object | `{"normal":{},"secret":{}}` | Add custom normal and secret envs to the service | -| client-api.usrEnvs.normal | object | `{}` | Add custom normal envs to the service variable1: value1 | -| client-api.usrEnvs.secret | object | `{}` | Add custom secret envs to the service variable1: value1 | -| client-api.volumeMounts | list | `[]` | Configure any additional volumesMounts that need to be attached to the containers | -| client-api.volumes | list | `[]` | Configure any additional volumes that need to be attached to the pod | -| config | object | `{"additionalAnnotations":{},"additionalLabels":{},"adminPassword":"Test1234#","city":"Austin","configmap":{"cnCacheType":"NATIVE_PERSISTENCE","cnClientApiBindIpAddresses":"*","cnClientApiCertCn":"client-api","cnConfigGoogleSecretNamePrefix":"janssen","cnConfigGoogleSecretVersionId":"latest","cnConfigKubernetesConfigMap":"cn","cnCouchbaseBucketPrefix":"jans","cnCouchbaseCrt":"SWFtTm90YVNlcnZpY2VBY2NvdW50Q2hhbmdlTWV0b09uZQo=","cnCouchbaseIndexNumReplica":0,"cnCouchbasePassword":"P@ssw0rd","cnCouchbaseSuperUser":"admin","cnCouchbaseSuperUserPassword":"Test1234#","cnCouchbaseUrl":"cbjanssen.default.svc.cluster.local","cnCouchbaseUser":"janssen","cnGoogleProjectId":"google-project-to-save-config-and-secrets-to","cnGoogleSecretManagerPassPhrase":"Test1234#","cnGoogleSecretManagerServiceAccount":"SWFtTm90YVNlcnZpY2VBY2NvdW50Q2hhbmdlTWV0b09uZQo=","cnGoogleSpannerDatabaseId":"","cnGoogleSpannerInstanceId":"","cnJettyRequestHeaderSize":8192,"cnLdapUrl":"opendj:1636","cnMaxRamPercent":"75.0","cnPersistenceHybridMapping":"{}","cnRedisSentinelGroup":"","cnRedisSslTruststore":"","cnRedisType":"STANDALONE","cnRedisUrl":"redis.redis.svc.cluster.local:6379","cnRedisUseSsl":false,"cnScimProtectionMode":"OAUTH","cnSecretGoogleSecretNamePrefix":"janssen","cnSecretGoogleSecretVersionId":"latest","cnSecretKubernetesSecret":"cn","cnSqlDbDialect":"mysql","cnSqlDbHost":"my-release-mysql.default.svc.cluster.local","cnSqlDbName":"jans","cnSqlDbPort":3306,"cnSqlDbTimezone":"UTC","cnSqlDbUser":"jans","cnSqldbUserPassword":"Test1234#","lbAddr":""},"countryCode":"US","dnsConfig":{},"dnsPolicy":"","email":"support@jans.io","image":{"pullSecrets":[],"repository":"janssenproject/configurator","tag":"1.0.3_dev"},"ldapPassword":"P@ssw0rds","orgName":"Janssen","redisPassword":"P@assw0rd","resources":{"limits":{"cpu":"300m","memory":"300Mi"},"requests":{"cpu":"300m","memory":"300Mi"}},"state":"TX","usrEnvs":{"normal":{},"secret":{}},"volumeMounts":[],"volumes":[]}` | Configuration parameters for setup and initial configuration secret and config layers used by Janssen services. | +| config | object | `{"additionalAnnotations":{},"additionalLabels":{},"adminPassword":"Test1234#","city":"Austin","configmap":{"cnCacheType":"NATIVE_PERSISTENCE","cnConfigGoogleSecretNamePrefix":"janssen","cnConfigGoogleSecretVersionId":"latest","cnConfigKubernetesConfigMap":"cn","cnCouchbaseBucketPrefix":"jans","cnCouchbaseCrt":"SWFtTm90YVNlcnZpY2VBY2NvdW50Q2hhbmdlTWV0b09uZQo=","cnCouchbaseIndexNumReplica":0,"cnCouchbasePassword":"P@ssw0rd","cnCouchbaseSuperUser":"admin","cnCouchbaseSuperUserPassword":"Test1234#","cnCouchbaseUrl":"cbjanssen.default.svc.cluster.local","cnCouchbaseUser":"janssen","cnGoogleProjectId":"google-project-to-save-config-and-secrets-to","cnGoogleSecretManagerPassPhrase":"Test1234#","cnGoogleSecretManagerServiceAccount":"SWFtTm90YVNlcnZpY2VBY2NvdW50Q2hhbmdlTWV0b09uZQo=","cnGoogleSpannerDatabaseId":"","cnGoogleSpannerInstanceId":"","cnJettyRequestHeaderSize":8192,"cnLdapUrl":"opendj:1636","cnMaxRamPercent":"75.0","cnPersistenceHybridMapping":"{}","cnRedisSentinelGroup":"","cnRedisSslTruststore":"","cnRedisType":"STANDALONE","cnRedisUrl":"redis.redis.svc.cluster.local:6379","cnRedisUseSsl":false,"cnScimProtectionMode":"OAUTH","cnSecretGoogleSecretNamePrefix":"janssen","cnSecretGoogleSecretVersionId":"latest","cnSecretKubernetesSecret":"cn","cnSqlDbDialect":"mysql","cnSqlDbHost":"my-release-mysql.default.svc.cluster.local","cnSqlDbName":"jans","cnSqlDbPort":3306,"cnSqlDbTimezone":"UTC","cnSqlDbUser":"jans","cnSqldbUserPassword":"Test1234#","lbAddr":""},"countryCode":"US","dnsConfig":{},"dnsPolicy":"","email":"support@jans.io","image":{"pullSecrets":[],"repository":"janssenproject/configurator","tag":"1.0.3_dev"},"ldapPassword":"P@ssw0rds","orgName":"Janssen","redisPassword":"P@assw0rd","resources":{"limits":{"cpu":"300m","memory":"300Mi"},"requests":{"cpu":"300m","memory":"300Mi"}},"state":"TX","usrEnvs":{"normal":{},"secret":{}},"volumeMounts":[],"volumes":[]}` | Configuration parameters for setup and initial configuration secret and config layers used by Janssen services. | | config-api | object | `{"additionalAnnotations":{},"additionalLabels":{},"dnsConfig":{},"dnsPolicy":"","hpa":{"behavior":{},"enabled":true,"maxReplicas":10,"metrics":[],"minReplicas":1,"targetCPUUtilizationPercentage":50},"image":{"pullPolicy":"IfNotPresent","pullSecrets":[],"repository":"janssenproject/config-api","tag":"1.0.3_dev"},"livenessProbe":{"httpGet":{"path":"/jans-config-api/api/v1/health/live","port":8074},"initialDelaySeconds":30,"periodSeconds":30,"timeoutSeconds":5},"readinessProbe":{"httpGet":{"path":"jans-config-api/api/v1/health/ready","port":8074},"initialDelaySeconds":25,"periodSeconds":25,"timeoutSeconds":5},"replicas":1,"resources":{"limits":{"cpu":"1000m","memory":"400Mi"},"requests":{"cpu":"1000m","memory":"400Mi"}},"usrEnvs":{"normal":{},"secret":{}},"volumeMounts":[],"volumes":[]}` | Config Api endpoints can be used to configure the auth-server, which is an open-source OpenID Connect Provider (OP) and UMA Authorization Server (AS). | | config-api.additionalAnnotations | object | `{}` | Additional annotations that will be added across the gateway in the format of {cert-manager.io/issuer: "letsencrypt-prod"} | | config-api.additionalLabels | object | `{}` | Additional labels that will be added across the gateway in the format of {mylabel: "myapp"} | @@ -141,8 +114,6 @@ Kubernetes: `>=v1.21.0-0` | config.adminPassword | string | `"Test1234#"` | Admin password to log in to the UI. | | config.city | string | `"Austin"` | City. Used for certificate creation. | | config.configmap.cnCacheType | string | `"NATIVE_PERSISTENCE"` | Cache type. `NATIVE_PERSISTENCE`, `REDIS`. or `IN_MEMORY`. Defaults to `NATIVE_PERSISTENCE` . | -| config.configmap.cnClientApiBindIpAddresses | string | `"*"` | Client-api bind address. This limits what ip ranges can access the client-api. This should be left as * and controlled by a NetworkPolicy | -| config.configmap.cnClientApiCertCn | string | `"client-api"` | Client-api OAuth certificate common name. This should be left to the default value client-api. | | config.configmap.cnConfigGoogleSecretNamePrefix | string | `"janssen"` | Prefix for Janssen configuration secret in Google Secret Manager. Defaults to janssen. If left intact janssen-configuration secret will be created. Used only when global.configAdapterName and global.configSecretAdapter is set to google. | | config.configmap.cnConfigGoogleSecretVersionId | string | `"latest"` | Secret version to be used for configuration. Defaults to latest and should normally always stay that way. Used only when global.configAdapterName and global.configSecretAdapter is set to google. Used only when global.configAdapterName and global.configSecretAdapter is set to google. | | config.configmap.cnConfigKubernetesConfigMap | string | `"cn"` | The name of the Kubernetes ConfigMap that will hold the configuration layer | @@ -162,7 +133,7 @@ Kubernetes: `>=v1.21.0-0` | config.configmap.cnJettyRequestHeaderSize | int | `8192` | Jetty header size in bytes in the auth server | | config.configmap.cnLdapUrl | string | `"opendj:1636"` | OpenDJ internal address. Leave as default. Used when `global.cnPersistenceType` is set to `ldap`. | | config.configmap.cnMaxRamPercent | string | `"75.0"` | Value passed to Java option -XX:MaxRAMPercentage | -| config.configmap.cnPersistenceHybridMapping | string | `"{}"` | Specify data that should be saved in LDAP (one of default, user, cache, site, token, or session; default to default). Note this environment only takes effect when `global.cnPersistenceType` is set to `hybrid`. "default": "", "user": "", "site": "", "cache": "", "token": "", "session": "", | +| config.configmap.cnPersistenceHybridMapping | string | `"{}"` | Specify data that should be saved in LDAP (one of default, user, cache, site, token, or session; default to default). Note this environment only takes effect when `global.cnPersistenceType` is set to `hybrid`. { "default": "", "user": "", "site": "", "cache": "", "token": "", "session": "", } | | config.configmap.cnRedisSentinelGroup | string | `""` | Redis Sentinel Group. Often set when `config.configmap.cnRedisType` is set to `SENTINEL`. Can be used when `config.configmap.cnCacheType` is set to `REDIS`. | | config.configmap.cnRedisSslTruststore | string | `""` | Redis SSL truststore. Optional. Can be used when `config.configmap.cnCacheType` is set to `REDIS`. | | config.configmap.cnRedisType | string | `"STANDALONE"` | Redis service type. `STANDALONE` or `CLUSTER`. Can be used when `config.configmap.cnCacheType` is set to `REDIS`. | @@ -229,7 +200,7 @@ Kubernetes: `>=v1.21.0-0` | fido2.usrEnvs.secret | object | `{}` | Add custom secret envs to the service variable1: value1 | | fido2.volumeMounts | list | `[]` | Configure any additional volumesMounts that need to be attached to the containers | | fido2.volumes | list | `[]` | Configure any additional volumes that need to be attached to the pod | -| global | object | `{"alb":{"ingress":false},"auth-server":{"appLoggers":{"auditStatsLogLevel":"INFO","auditStatsLogTarget":"FILE","authLogLevel":"INFO","authLogTarget":"STDOUT","httpLogLevel":"INFO","httpLogTarget":"FILE","ldapStatsLogLevel":"INFO","ldapStatsLogTarget":"FILE","persistenceDurationLogLevel":"INFO","persistenceDurationLogTarget":"FILE","persistenceLogLevel":"INFO","persistenceLogTarget":"FILE","scriptLogLevel":"INFO","scriptLogTarget":"FILE"},"authEncKeys":"RSA1_5 RSA-OAEP","authServerServiceName":"auth-server","authSigKeys":"RS256 RS384 RS512 ES256 ES384 ES512 PS256 PS384 PS512","enabled":true},"auth-server-key-rotation":{"enabled":false},"awsStorageType":"io1","azureStorageAccountType":"Standard_LRS","azureStorageKind":"Managed","client-api":{"appLoggers":{"clientApiLogLevel":"INFO","clientApiLogTarget":"STDOUT","ldapStatsLogLevel":"INFO","ldapStatsLogTarget":"FILE","persistenceDurationLogLevel":"INFO","persistenceDurationLogTarget":"FILE","persistenceLogLevel":"INFO","persistenceLogTarget":"FILE","scriptLogLevel":"INFO","scriptLogTarget":"FILE"},"clientApiServerServiceName":"client-api","enabled":false},"cloud":{"testEnviroment":false},"cnDocumentStoreType":"LOCAL","cnGoogleApplicationCredentials":"/etc/jans/conf/google-credentials.json","cnPersistenceType":"sql","config":{"enabled":true},"config-api":{"appLoggers":{"configApiLogLevel":"INFO","configApiLogTarget":"STDOUT","ldapStatsLogLevel":"INFO","ldapStatsLogTarget":"FILE","persistenceDurationLogLevel":"INFO","persistenceDurationLogTarget":"FILE","persistenceLogLevel":"INFO","persistenceLogTarget":"FILE","scriptLogLevel":"INFO","scriptLogTarget":"FILE"},"configApiServerServiceName":"config-api","enabled":true},"configAdapterName":"kubernetes","configSecretAdapter":"kubernetes","fido2":{"appLoggers":{"fido2LogLevel":"INFO","fido2LogTarget":"STDOUT","persistenceLogLevel":"INFO","persistenceLogTarget":"FILE"},"enabled":true,"fido2ServiceName":"fido2"},"fqdn":"demoexample.jans.io","gcePdStorageType":"pd-standard","isFqdnRegistered":false,"istio":{"additionalAnnotations":{},"additionalLabels":{},"enabled":false,"namespace":"istio-system"},"lbIp":"22.22.22.22","nginx-ingress":{"enabled":true},"opendj":{"enabled":false,"ldapServiceName":"opendj"},"persistence":{"enabled":true},"scim":{"appLoggers":{"ldapStatsLogLevel":"INFO","ldapStatsLogTarget":"FILE","persistenceDurationLogLevel":"INFO","persistenceDurationLogTarget":"FILE","persistenceLogLevel":"INFO","persistenceLogTarget":"FILE","scimLogLevel":"INFO","scimLogTarget":"STDOUT","scriptLogLevel":"INFO","scriptLogTarget":"FILE"},"enabled":true,"scimServiceName":"scim"},"storageClass":{"allowVolumeExpansion":true,"allowedTopologies":[],"mountOptions":["debug"],"parameters":{},"provisioner":"microk8s.io/hostpath","reclaimPolicy":"Retain","volumeBindingMode":"WaitForFirstConsumer"},"upgrade":{"enabled":false},"usrEnvs":{"normal":{},"secret":{}}}` | Parameters used globally across all services helm charts. | +| global | object | `{"alb":{"ingress":false},"auth-server":{"appLoggers":{"auditStatsLogLevel":"INFO","auditStatsLogTarget":"FILE","authLogLevel":"INFO","authLogTarget":"STDOUT","httpLogLevel":"INFO","httpLogTarget":"FILE","ldapStatsLogLevel":"INFO","ldapStatsLogTarget":"FILE","persistenceDurationLogLevel":"INFO","persistenceDurationLogTarget":"FILE","persistenceLogLevel":"INFO","persistenceLogTarget":"FILE","scriptLogLevel":"INFO","scriptLogTarget":"FILE"},"authEncKeys":"RSA1_5 RSA-OAEP","authServerServiceName":"auth-server","authSigKeys":"RS256 RS384 RS512 ES256 ES384 ES512 PS256 PS384 PS512","enabled":true},"auth-server-key-rotation":{"enabled":false},"awsStorageType":"io1","azureStorageAccountType":"Standard_LRS","azureStorageKind":"Managed","cloud":{"testEnviroment":false},"cnDocumentStoreType":"LOCAL","cnGoogleApplicationCredentials":"/etc/jans/conf/google-credentials.json","cnPersistenceType":"sql","config":{"enabled":true},"config-api":{"appLoggers":{"configApiLogLevel":"INFO","configApiLogTarget":"STDOUT","ldapStatsLogLevel":"INFO","ldapStatsLogTarget":"FILE","persistenceDurationLogLevel":"INFO","persistenceDurationLogTarget":"FILE","persistenceLogLevel":"INFO","persistenceLogTarget":"FILE","scriptLogLevel":"INFO","scriptLogTarget":"FILE"},"configApiServerServiceName":"config-api","enabled":true},"configAdapterName":"kubernetes","configSecretAdapter":"kubernetes","fido2":{"appLoggers":{"fido2LogLevel":"INFO","fido2LogTarget":"STDOUT","persistenceLogLevel":"INFO","persistenceLogTarget":"FILE"},"enabled":true,"fido2ServiceName":"fido2"},"fqdn":"demoexample.jans.io","gcePdStorageType":"pd-standard","isFqdnRegistered":false,"istio":{"additionalAnnotations":{},"additionalLabels":{},"enabled":false,"namespace":"istio-system"},"lbIp":"22.22.22.22","nginx-ingress":{"enabled":true},"opendj":{"enabled":false,"ldapServiceName":"opendj"},"persistence":{"enabled":true},"scim":{"appLoggers":{"ldapStatsLogLevel":"INFO","ldapStatsLogTarget":"FILE","persistenceDurationLogLevel":"INFO","persistenceDurationLogTarget":"FILE","persistenceLogLevel":"INFO","persistenceLogTarget":"FILE","scimLogLevel":"INFO","scimLogTarget":"STDOUT","scriptLogLevel":"INFO","scriptLogTarget":"FILE"},"enabled":true,"scimServiceName":"scim"},"storageClass":{"allowVolumeExpansion":true,"allowedTopologies":[],"mountOptions":["debug"],"parameters":{},"provisioner":"microk8s.io/hostpath","reclaimPolicy":"Retain","volumeBindingMode":"WaitForFirstConsumer"},"upgrade":{"enabled":false},"usrEnvs":{"normal":{},"secret":{}}}` | Parameters used globally across all services helm charts. | | global.alb.ingress | bool | `false` | Activates ALB ingress | | global.auth-server-key-rotation.enabled | bool | `false` | Boolean flag to enable/disable the auth-server-key rotation cronjob chart. | | global.auth-server.appLoggers | object | `{"auditStatsLogLevel":"INFO","auditStatsLogTarget":"FILE","authLogLevel":"INFO","authLogTarget":"STDOUT","httpLogLevel":"INFO","httpLogTarget":"FILE","ldapStatsLogLevel":"INFO","ldapStatsLogTarget":"FILE","persistenceDurationLogLevel":"INFO","persistenceDurationLogTarget":"FILE","persistenceLogLevel":"INFO","persistenceLogTarget":"FILE","scriptLogLevel":"INFO","scriptLogTarget":"FILE"}` | App loggers can be configured to define where the logs will be redirected to and the level of each in which it should be displayed. | @@ -254,19 +225,6 @@ Kubernetes: `>=v1.21.0-0` | global.awsStorageType | string | `"io1"` | Volume storage type if using AWS volumes. | | global.azureStorageAccountType | string | `"Standard_LRS"` | Volume storage type if using Azure disks. | | global.azureStorageKind | string | `"Managed"` | Azure storage kind if using Azure disks | -| global.client-api.appLoggers | object | `{"clientApiLogLevel":"INFO","clientApiLogTarget":"STDOUT","ldapStatsLogLevel":"INFO","ldapStatsLogTarget":"FILE","persistenceDurationLogLevel":"INFO","persistenceDurationLogTarget":"FILE","persistenceLogLevel":"INFO","persistenceLogTarget":"FILE","scriptLogLevel":"INFO","scriptLogTarget":"FILE"}` | App loggers can be configured to define where the logs will be redirected to and the level of each in which it should be displayed. | -| global.client-api.appLoggers.clientApiLogLevel | string | `"INFO"` | client-api.log level | -| global.client-api.appLoggers.clientApiLogTarget | string | `"STDOUT"` | client-api.log target | -| global.client-api.appLoggers.ldapStatsLogLevel | string | `"INFO"` | client-api_persistence_ldap_statistics.log level | -| global.client-api.appLoggers.ldapStatsLogTarget | string | `"FILE"` | client-api_persistence_ldap_statistics.log target | -| global.client-api.appLoggers.persistenceDurationLogLevel | string | `"INFO"` | client-api_persistence_duration.log level | -| global.client-api.appLoggers.persistenceDurationLogTarget | string | `"FILE"` | client-api_persistence_duration.log target | -| global.client-api.appLoggers.persistenceLogLevel | string | `"INFO"` | client-api_persistence.log level | -| global.client-api.appLoggers.persistenceLogTarget | string | `"FILE"` | client-api_persistence.log target | -| global.client-api.appLoggers.scriptLogLevel | string | `"INFO"` | client-api_script.log level | -| global.client-api.appLoggers.scriptLogTarget | string | `"FILE"` | client-api_script.log target | -| global.client-api.clientApiServerServiceName | string | `"client-api"` | Name of the client-api service. Please keep it as default. | -| global.client-api.enabled | bool | `false` | Boolean flag to enable/disable the client-api chart. | | global.cloud.testEnviroment | bool | `false` | Boolean flag if enabled will strip resources requests and limits from all services. | | global.cnDocumentStoreType | string | `"LOCAL"` | Document store type to use for shibboleth files LOCAL. | | global.cnGoogleApplicationCredentials | string | `"/etc/jans/conf/google-credentials.json"` | Base64 encoded service account. The sa must have roles/secretmanager.admin to use Google secrets and roles/spanner.databaseUser to use Spanner. | @@ -320,7 +278,7 @@ Kubernetes: `>=v1.21.0-0` | global.scim.enabled | bool | `true` | Boolean flag to enable/disable the SCIM chart. | | global.scim.scimServiceName | string | `"scim"` | Name of the scim service. Please keep it as default. | | global.storageClass | object | `{"allowVolumeExpansion":true,"allowedTopologies":[],"mountOptions":["debug"],"parameters":{},"provisioner":"microk8s.io/hostpath","reclaimPolicy":"Retain","volumeBindingMode":"WaitForFirstConsumer"}` | StorageClass section for OpenDJ charts. This is not currently used by the openbanking distribution. You may specify custom parameters as needed. | -| global.storageClass.parameters | object | `{}` | parameters: | +| global.storageClass.parameters | object | `{}` | parameters: fsType: "" kind: "" pool: "" storageAccountType: "" type: "" | | global.upgrade.enabled | bool | `false` | Boolean flag used when running upgrading through versions command. Used when upgrading with LDAP as the persistence to load the 101x ldif. | | global.usrEnvs | object | `{"normal":{},"secret":{}}` | Add custom normal and secret envs to the service. Envs defined in global.userEnvs will be globally available to all services | | global.usrEnvs.normal | object | `{}` | Add custom normal envs to the service. variable1: value1 | @@ -441,4 +399,4 @@ Kubernetes: `>=v1.21.0-0` | scim.volumes | list | `[]` | Configure any additional volumes that need to be attached to the pod | ---------------------------------------------- -Autogenerated from chart metadata using [helm-docs v1.7.0](https://github.com/norwoodj/helm-docs/releases/v1.7.0) +Autogenerated from chart metadata using [helm-docs v1.11.0](https://github.com/norwoodj/helm-docs/releases/v1.11.0) diff --git a/charts/janssen/charts/auth-server-key-rotation/README.md b/charts/janssen/charts/auth-server-key-rotation/README.md index b6295f43d99..bb78b4aa48a 100644 --- a/charts/janssen/charts/auth-server-key-rotation/README.md +++ b/charts/janssen/charts/auth-server-key-rotation/README.md @@ -10,7 +10,7 @@ Responsible for regenerating auth-keys per x hours | Name | Email | Url | | ---- | ------ | --- | -| Mohammad Abudayyeh | support@jans.io | https://github.com/moabu | +| Mohammad Abudayyeh | | | ## Source Code @@ -45,4 +45,4 @@ Kubernetes: `>=v1.21.0-0` | volumes | list | `[]` | Configure any additional volumes that need to be attached to the pod | ---------------------------------------------- -Autogenerated from chart metadata using [helm-docs v1.7.0](https://github.com/norwoodj/helm-docs/releases/v1.7.0) +Autogenerated from chart metadata using [helm-docs v1.11.0](https://github.com/norwoodj/helm-docs/releases/v1.11.0) diff --git a/charts/janssen/charts/auth-server/README.md b/charts/janssen/charts/auth-server/README.md index f9924814419..cc16a942f79 100644 --- a/charts/janssen/charts/auth-server/README.md +++ b/charts/janssen/charts/auth-server/README.md @@ -10,7 +10,7 @@ OAuth Authorization Server, the OpenID Connect Provider, the UMA Authorization S | Name | Email | Url | | ---- | ------ | --- | -| Mohammad Abudayyeh | support@jans.io | https://github.com/moabu | +| Mohammad Abudayyeh | | | ## Source Code @@ -57,4 +57,4 @@ Kubernetes: `>=v1.21.0-0` | volumes | list | `[]` | | ---------------------------------------------- -Autogenerated from chart metadata using [helm-docs v1.7.0](https://github.com/norwoodj/helm-docs/releases/v1.7.0) +Autogenerated from chart metadata using [helm-docs v1.11.0](https://github.com/norwoodj/helm-docs/releases/v1.11.0) diff --git a/charts/janssen/charts/client-api/.helmignore b/charts/janssen/charts/client-api/.helmignore deleted file mode 100644 index f0c13194444..00000000000 --- a/charts/janssen/charts/client-api/.helmignore +++ /dev/null @@ -1,21 +0,0 @@ -# Patterns to ignore when building packages. -# This supports shell glob matching, relative path matching, and -# negation (prefixed with !). Only one pattern per line. -.DS_Store -# Common VCS dirs -.git/ -.gitignore -.bzr/ -.bzrignore -.hg/ -.hgignore -.svn/ -# Common backup files -*.swp -*.bak -*.tmp -*~ -# Various IDEs -.project -.idea/ -*.tmproj diff --git a/charts/janssen/charts/client-api/Chart.yaml b/charts/janssen/charts/client-api/Chart.yaml deleted file mode 100644 index 352425e2a48..00000000000 --- a/charts/janssen/charts/client-api/Chart.yaml +++ /dev/null @@ -1,21 +0,0 @@ - -apiVersion: v2 -name: client-api -version: 1.0.3-dev -kubeVersion: ">=v1.21.0-0" -description: Middleware API to help application developers call an OAuth, OpenID or UMA server. You may wonder why this is necessary. It makes it easier for client developers to use OpenID signing and encryption features, without becoming crypto experts. This API provides some high level endpoints to do some of the heavy lifting. -type: application -keywords: - - client - - API -home: https://github.com/JanssenProject/jans/jans-client-api -sources: - - https://github.com/JanssenProject/jans/jans-client-api - - https://github.com/JanssenProject/jans/docker-jans-client-api - - https://github.com/JanssenFederation/flex/tree/main/flex-cn-setup/pyjanssen/kubernetes/templates/helm/janssen/charts/client-api -maintainers: - - name: Mohammad Abudayyeh - email: support@jans.io - url: https://github.com/moabu -icon: https://github.com/JanssenProject/jans/raw/main/docs/logo/janssen_project_favicon_transparent_50px_50px.png -appVersion: "1.0.3-dev" diff --git a/charts/janssen/charts/client-api/README.md b/charts/janssen/charts/client-api/README.md deleted file mode 100644 index d9ee5bb6157..00000000000 --- a/charts/janssen/charts/client-api/README.md +++ /dev/null @@ -1,61 +0,0 @@ -# client-api - -![Version: 1.0.3-dev](https://img.shields.io/badge/Version-1.0.3--dev-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 1.0.3-dev](https://img.shields.io/badge/AppVersion-1.0.3--dev-informational?style=flat-square) - -Middleware API to help application developers call an OAuth, OpenID or UMA server. You may wonder why this is necessary. It makes it easier for client developers to use OpenID signing and encryption features, without becoming crypto experts. This API provides some high level endpoints to do some of the heavy lifting. - -**Homepage:** - -## Maintainers - -| Name | Email | Url | -| ---- | ------ | --- | -| Mohammad Abudayyeh | support@jans.io | https://github.com/moabu | - -## Source Code - -* -* -* - -## Requirements - -Kubernetes: `>=v1.21.0-0` - -## Values - -| Key | Type | Default | Description | -|-----|------|---------|-------------| -| additionalAnnotations | object | `{}` | Additional annotations that will be added across all resources in the format of {cert-manager.io/issuer: "letsencrypt-prod"}. key app is taken | -| additionalLabels | object | `{}` | Additional labels that will be added across all resources definitions in the format of {mylabel: "myapp"} | -| affinity | object | `{}` | | -| dnsConfig | object | `{}` | Add custom dns config | -| dnsPolicy | string | `""` | Add custom dns policy | -| hpa | object | `{"behavior":{},"enabled":true,"maxReplicas":10,"metrics":[],"minReplicas":1,"targetCPUUtilizationPercentage":50}` | Configure the HorizontalPodAutoscaler | -| hpa.behavior | object | `{}` | Scaling Policies | -| hpa.metrics | list | `[]` | metrics if targetCPUUtilizationPercentage is not set | -| image.pullPolicy | string | `"IfNotPresent"` | Image pullPolicy to use for deploying. | -| image.pullSecrets | list | `[]` | Image Pull Secrets | -| image.repository | string | `"janssenproject/client-api"` | Image to use for deploying. | -| image.tag | string | `"1.0.3_dev"` | Image tag to use for deploying. | -| livenessProbe | object | `{"exec":{"command":["curl","-k","https://localhost:8443/health-check"]},"initialDelaySeconds":30,"periodSeconds":30,"timeoutSeconds":5}` | Configure the liveness healthcheck for the auth server if needed. | -| livenessProbe.exec | object | `{"command":["curl","-k","https://localhost:8443/health-check"]}` | Executes the python3 healthcheck. | -| nodeSelector | object | `{}` | | -| readinessProbe | object | `{"initialDelaySeconds":60,"periodSeconds":25,"tcpSocket":{"port":8443},"timeoutSeconds":5}` | Configure the readiness healthcheck for the auth server if needed. | -| replicas | int | `1` | Service replica number. | -| resources | object | `{"limits":{"cpu":"1000m","memory":"400Mi"},"requests":{"cpu":"1000m","memory":"400Mi"}}` | Resource specs. | -| resources.limits.cpu | string | `"1000m"` | CPU limit. | -| resources.limits.memory | string | `"400Mi"` | Memory limit. | -| resources.requests.cpu | string | `"1000m"` | CPU request. | -| resources.requests.memory | string | `"400Mi"` | Memory request. | -| service.sessionAffinity | string | `"None"` | Default set to None If you want to make sure that connections from a particular client are passed to the same Pod each time, you can select the session affinity based on the client's IP addresses by setting this to ClientIP | -| service.sessionAffinityConfig | object | `{"clientIP":{"timeoutSeconds":10800}}` | the maximum session sticky time if sessionAffinity is ClientIP | -| tolerations | list | `[]` | | -| usrEnvs | object | `{"normal":{},"secret":{}}` | Add custom normal and secret envs to the service | -| usrEnvs.normal | object | `{}` | Add custom normal envs to the service variable1: value1 | -| usrEnvs.secret | object | `{}` | Add custom secret envs to the service variable1: value1 | -| volumeMounts | list | `[]` | Configure any additional volumesMounts that need to be attached to the containers | -| volumes | list | `[]` | Configure any additional volumes that need to be attached to the pod | - ----------------------------------------------- -Autogenerated from chart metadata using [helm-docs v1.7.0](https://github.com/norwoodj/helm-docs/releases/v1.7.0) diff --git a/charts/janssen/charts/client-api/templates/_helpers.tpl b/charts/janssen/charts/client-api/templates/_helpers.tpl deleted file mode 100644 index 67460b0fb1c..00000000000 --- a/charts/janssen/charts/client-api/templates/_helpers.tpl +++ /dev/null @@ -1,68 +0,0 @@ -{{/* vim: set filetype=mustache: */}} -{{/* -Expand the name of the chart. -*/}} -{{- define "client-api.name" -}} -{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}} -{{- end -}} - -{{/* -Create a default fully qualified app name. -We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). -If release name contains chart name it will be used as a full name. -*/}} -{{- define "client-api.fullname" -}} -{{- if .Values.fullnameOverride -}} -{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" -}} -{{- else -}} -{{- $name := default .Chart.Name .Values.nameOverride -}} -{{- if contains $name .Release.Name -}} -{{- .Release.Name | trunc 63 | trimSuffix "-" -}} -{{- else -}} -{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}} -{{- end -}} -{{- end -}} -{{- end -}} - -{{/* -Create chart name and version as used by the chart label. -*/}} -{{- define "client-api.chart" -}} -{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}} -{{- end -}} - -{{/* - Common labels -*/}} -{{- define "client-api.labels" -}} -app: {{ .Release.Name }}-{{ include "client-api.name" . }} -helm.sh/chart: {{ include "client-api.chart" . }} -app.kubernetes.io/instance: {{ .Release.Name }} -{{- if .Chart.AppVersion }} -app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} -{{- end }} -app.kubernetes.io/managed-by: {{ .Release.Service }} -{{- end -}} - -{{/* -Create user custom defined envs -*/}} -{{- define "client-api.usr-envs"}} -{{- range $key, $val := .Values.usrEnvs.normal }} -- name: {{ $key }} - value: {{ $val }} -{{- end }} -{{- end }} - -{{/* -Create user custom defined secret envs -*/}} -{{- define "client-api.usr-secret-envs"}} -{{- range $key, $val := .Values.usrEnvs.secret }} -- name: {{ $key }} - valueFrom: - secretKeyRef: - name: {{ $.Release.Name }}-{{ $.Chart.Name }}-user-custom-envs - key: {{ $key }} -{{- end }} -{{- end }} diff --git a/charts/janssen/charts/client-api/templates/client-api-destination-rules.yaml b/charts/janssen/charts/client-api/templates/client-api-destination-rules.yaml deleted file mode 100644 index 0246c9257e9..00000000000 --- a/charts/janssen/charts/client-api/templates/client-api-destination-rules.yaml +++ /dev/null @@ -1,23 +0,0 @@ -{{- if .Values.global.istio.enabled }} - -apiVersion: networking.istio.io/v1alpha3 -kind: DestinationRule -metadata: - name: {{ .Release.Name }}-client-api-mtls - namespace: {{.Release.Namespace}} - labels: - APP_NAME: client-api -{{ include "client-api.labels" . | indent 4 }} -{{- if .Values.additionalLabels }} -{{ toYaml .Values.additionalLabels | indent 4 }} -{{- end }} -{{- if .Values.additionalAnnotations }} - annotations: -{{ toYaml .Values.additionalAnnotations | indent 4 }} -{{- end }} -spec: - host: {{ index .Values "global" "client-api" "clientApiServerServiceName" }}.{{ .Release.Namespace }}.svc.cluster.local - trafficPolicy: - tls: - mode: ISTIO_MUTUAL -{{- end }} \ No newline at end of file diff --git a/charts/janssen/charts/client-api/templates/deployment.yaml b/charts/janssen/charts/client-api/templates/deployment.yaml deleted file mode 100644 index 123fe6266a5..00000000000 --- a/charts/janssen/charts/client-api/templates/deployment.yaml +++ /dev/null @@ -1,141 +0,0 @@ - -apiVersion: apps/v1 -kind: Deployment -metadata: - name: {{ include "client-api.fullname" . }} - namespace: {{ .Release.Namespace }} - labels: - APP_NAME: client-api -{{ include "client-api.labels" . | indent 4 }} -{{- if .Values.additionalLabels }} -{{ toYaml .Values.additionalLabels | indent 4 }} -{{- end }} -{{- if .Values.additionalAnnotations }} - annotations: -{{ toYaml .Values.additionalAnnotations | indent 4 }} -{{- end }} -spec: - replicas: {{ .Values.replicas }} - selector: - matchLabels: - app: {{ .Release.Name }}-{{ include "client-api.name" . }} - release: {{ .Release.Name }} - template: - metadata: - labels: - APP_NAME: client-api - app: {{ .Release.Name }}-{{ include "client-api.name" . }} - release: {{ .Release.Name }} - {{- if .Values.global.istio.ingress }} - annotations: - sidecar.istio.io/rewriteAppHTTPProbers: "true" - {{- end }} - spec: - {{- with .Values.image.pullSecrets }} - imagePullSecrets: - {{- toYaml . | nindent 8 }} - {{- end }} - dnsPolicy: {{ .Values.dnsPolicy | quote }} - {{- with .Values.dnsConfig }} - dnsConfig: -{{ toYaml . | indent 8 }} - {{- end }} - containers: - - name: {{ include "client-api.name" . }} - image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}" - env: - {{- include "client-api.usr-envs" . | indent 12 }} - {{- include "client-api.usr-secret-envs" . | indent 12 }} - securityContext: - runAsUser: 1000 - runAsNonRoot: true - imagePullPolicy: {{ .Values.image.pullPolicy }} - {{- if and (not .Values.global.isFqdnRegistered ) (or (eq .Values.global.storageClass.provisioner "kubernetes.io/aws-ebs") (eq .Values.global.storageClass.provisioner "openebs.io/local")) }} - command: - - /bin/sh - - -c - - | - /usr/bin/python3 /scripts/updatelbip.py & - /app/scripts/entrypoint.sh - {{- end }} - ports: - - containerPort: 8444 - - containerPort: 8443 - {{ if .Values.global.cnPrometheusPort }} - - name: prometheus-port - containerPort: {{ .Values.global.cnPrometheusPort }} - {{- end }} - envFrom: - - configMapRef: - name: {{ .Release.Name }}-config-cm - {{ if .Values.global.usrEnvs.secret }} - - secretRef: - name: {{ .Release.Name }}-global-user-custom-envs - {{- end }} - {{ if .Values.global.usrEnvs.normal }} - - configMapRef: - name: {{ .Release.Name }}-global-user-custom-envs - {{- end }} - livenessProbe: -{{- toYaml .Values.livenessProbe | nindent 12 }} - readinessProbe: -{{- toYaml .Values.readinessProbe | nindent 12 }} - volumeMounts: - {{- with .Values.volumeMounts }} -{{- toYaml . | nindent 12 }} - {{- end }} - {{ if or (eq .Values.global.configSecretAdapter "google") (eq .Values.global.cnPersistenceType "spanner") }} - - mountPath: {{ .Values.global.cnGoogleApplicationCredentials }} - name: google-sa - subPath: google-credentials.json - {{- end }} - - {{- if or (eq .Values.global.cnPersistenceType "couchbase") (eq .Values.global.cnPersistenceType "hybrid") }} - {{- if not .Values.global.istio.enabled }} - - name: cb-crt - mountPath: "/etc/certs/couchbase.crt" - subPath: couchbase.crt - {{- end }} - {{- end }} - {{- if and (not .Values.global.isFqdnRegistered ) (or (eq .Values.global.storageClass.provisioner "kubernetes.io/aws-ebs") (eq .Values.global.storageClass.provisioner "openebs.io/local")) }} - - name: {{ include "client-api.name" . }}-updatelbip - mountPath: /scripts - {{- end }} - {{- if or (eq .Values.global.storageClass.provisioner "microk8s.io/hostpath" ) (eq .Values.global.storageClass.provisioner "k8s.io/minikube-hostpath") }} - resources: {} - {{- else if .Values.global.cloud.testEnviroment }} - resources: {} - {{- else }} - resources: -{{- toYaml .Values.resources | nindent 12 }} - {{- end }} - volumes: - {{- with .Values.volumes }} -{{- toYaml . | nindent 8 }} - {{- end }} - {{ if or (eq .Values.global.configSecretAdapter "google") (eq .Values.global.cnPersistenceType "spanner") }} - - name: google-sa - secret: - secretName: {{ .Release.Name }}-google-sa - {{- end }} - - {{- if or (eq .Values.global.cnPersistenceType "couchbase") (eq .Values.global.cnPersistenceType "hybrid") }} - - {{- if not .Values.global.istio.enabled }} - - name: cb-crt - secret: - secretName: {{ .Release.Name }}-cb-crt - {{- end }} - {{- end }} - {{- if and (not .Values.global.isFqdnRegistered ) (or (eq .Values.global.storageClass.provisioner "kubernetes.io/aws-ebs") (eq .Values.global.storageClass.provisioner "openebs.io/local")) }} - - name: {{ include "client-api.name" . }}-updatelbip - configMap: - name: {{ .Release.Name }}-updatelbip - {{- end }} - {{- if not .Values.global.isFqdnRegistered }} - hostAliases: - - ip: {{ .Values.global.lbIp }} - hostnames: - - {{ .Values.global.fqdn }} - {{- end }} - diff --git a/charts/janssen/charts/client-api/templates/hpa.yaml b/charts/janssen/charts/client-api/templates/hpa.yaml deleted file mode 100644 index 71a622f41e4..00000000000 --- a/charts/janssen/charts/client-api/templates/hpa.yaml +++ /dev/null @@ -1,38 +0,0 @@ -{{ if .Values.hpa.enabled -}} - -apiVersion: autoscaling/v1 -kind: HorizontalPodAutoscaler -metadata: - name: {{ include "client-api.fullname" . }} - labels: - APP_NAME: client-api -{{ include "client-api.labels" . | indent 4 }} -{{- if .Values.additionalLabels }} -{{ toYaml .Values.additionalLabels | indent 4 }} -{{- end }} -{{- if .Values.additionalAnnotations }} - annotations: -{{ toYaml .Values.additionalAnnotations | indent 4 }} -{{- end }} -spec: - scaleTargetRef: - apiVersion: apps/v1 - kind: Deployment - name: {{ include "client-api.fullname" . }} - minReplicas: {{ .Values.hpa.minReplicas }} - maxReplicas: {{ .Values.hpa.maxReplicas }} - {{- if .Values.hpa.targetCPUUtilizationPercentage }} - targetCPUUtilizationPercentage: {{ .Values.hpa.targetCPUUtilizationPercentage }} - {{- else if .Values.hpa.metrics }} - metrics: - {{- with .Values.hpa.metrics }} -{{- toYaml . | nindent 4 }} - {{- end }} - {{- end }} - {{- if .Values.hpa.behavior }} - behavior: - {{- with .Values.hpa.behavior }} -{{- toYaml . | nindent 4 }} - {{- end }} - {{- end }} -{{- end }} \ No newline at end of file diff --git a/charts/janssen/charts/client-api/templates/networkpolicy.yaml b/charts/janssen/charts/client-api/templates/networkpolicy.yaml deleted file mode 100644 index 27f04416d94..00000000000 --- a/charts/janssen/charts/client-api/templates/networkpolicy.yaml +++ /dev/null @@ -1,39 +0,0 @@ -kind: NetworkPolicy -apiVersion: networking.k8s.io/v1 -metadata: - namespace: {{ .Release.Namespace }} - name: client-api-policy - labels: - APP_NAME: client-api -{{ include "client-api.labels" . | indent 4 }} -{{- if .Values.additionalLabels }} -{{ toYaml .Values.additionalLabels | indent 4 }} -{{- end }} -{{- if .Values.additionalAnnotations }} - annotations: -{{ toYaml .Values.additionalAnnotations | indent 4 }} -{{- end }} -spec: - policyTypes: - - Ingress - podSelector: - matchLabels: - app: client-api - ingress: - - from: - - podSelector: - matchLabels: - app: auth-server - ports: - - protocol: TCP - port: 8443 - - from: - - namespaceSelector: - matchLabels: - app: ingress-kong - - podSelector: - matchLabels: - app: ingress-kong - ports: - - protocol: TCP - port: 8443 \ No newline at end of file diff --git a/charts/janssen/charts/client-api/templates/service.yaml b/charts/janssen/charts/client-api/templates/service.yaml deleted file mode 100644 index 3f75e3e7390..00000000000 --- a/charts/janssen/charts/client-api/templates/service.yaml +++ /dev/null @@ -1,30 +0,0 @@ - -apiVersion: v1 -kind: Service -metadata: - # the name must match the application - name: {{ index .Values "global" "client-api" "clientApiServerServiceName" }} - namespace: {{ .Release.Namespace }} - labels: - APP_NAME: client-api -{{ include "client-api.labels" . | indent 4 }} -{{- if .Values.additionalLabels }} -{{ toYaml .Values.additionalLabels | indent 4 }} -{{- end }} -{{- if .Values.additionalAnnotations }} - annotations: -{{ toYaml .Values.additionalAnnotations | indent 4 }} -{{- end }} -spec: - ports: - - port: 8444 - name: tcp-{{ include "client-api.name" . }}-admin-gui - - port: 8443 - name: tcp-{{ include "client-api.name" . }}-app-connector - selector: - app: {{ .Release.Name }}-{{ include "client-api.name" . }} - sessionAffinity: {{ .Values.service.sessionAffinity }} - {{- with .Values.service.sessionAffinityConfig }} - sessionAffinityConfig: -{{ toYaml . | indent 4 }} - {{- end }} diff --git a/charts/janssen/charts/client-api/templates/user-custom-secret-envs.yaml b/charts/janssen/charts/client-api/templates/user-custom-secret-envs.yaml deleted file mode 100644 index 799602721b1..00000000000 --- a/charts/janssen/charts/client-api/templates/user-custom-secret-envs.yaml +++ /dev/null @@ -1,22 +0,0 @@ -{{ if .Values.usrEnvs.secret }} - -apiVersion: v1 -kind: Secret -metadata: - name: {{ .Release.Name }}-{{ .Chart.Name }}-user-custom-envs - labels: - APP_NAME: client-api -{{ include "client-api.labels" . | indent 4 }} -{{- if .Values.additionalLabels }} -{{ toYaml .Values.additionalLabels | indent 4 }} -{{- end }} -{{- if .Values.additionalAnnotations }} - annotations: -{{ toYaml .Values.additionalAnnotations | indent 4 }} -{{- end }} -type: Opaque -data: - {{- range $key, $val := .Values.usrEnvs.secret }} - {{ $key }}: {{ $val | b64enc }} - {{- end}} -{{- end}} \ No newline at end of file diff --git a/charts/janssen/charts/client-api/values.yaml b/charts/janssen/charts/client-api/values.yaml deleted file mode 100644 index b7a1533e4c4..00000000000 --- a/charts/janssen/charts/client-api/values.yaml +++ /dev/null @@ -1,87 +0,0 @@ - -# -- Middleware API to help application developers call an OAuth, OpenID or UMA server. You may wonder why this is necessary. It makes it easier for client developers to use OpenID signing and encryption features, without becoming crypto experts. This API provides some high level endpoints to do some of the heavy lifting. -# -- Configure the HorizontalPodAutoscaler -hpa: - enabled: true - minReplicas: 1 - maxReplicas: 10 - targetCPUUtilizationPercentage: 50 - # -- metrics if targetCPUUtilizationPercentage is not set - metrics: [] - # -- Scaling Policies - behavior: {} -# -- Add custom normal and secret envs to the service -usrEnvs: - # -- Add custom normal envs to the service - # variable1: value1 - normal: {} - # -- Add custom secret envs to the service - # variable1: value1 - secret: {} -# -- Add custom dns policy -dnsPolicy: "" -# -- Add custom dns config -dnsConfig: {} -image: - # -- Image pullPolicy to use for deploying. - pullPolicy: IfNotPresent - # -- Image to use for deploying. - repository: janssenproject/client-api - # -- Image tag to use for deploying. - tag: 1.0.3_dev - # -- Image Pull Secrets - pullSecrets: [ ] -# -- Service replica number. -replicas: 1 -# -- Resource specs. -resources: - limits: - # -- CPU limit. - cpu: 1000m - # -- Memory limit. - memory: 400Mi - requests: - # -- CPU request. - cpu: 1000m - # -- Memory request. - memory: 400Mi -service: - # -- Default set to None If you want to make sure that connections from a particular client are passed to the same Pod each time, you can select the session affinity based on the client's IP addresses by setting this to ClientIP - sessionAffinity: None - # -- the maximum session sticky time if sessionAffinity is ClientIP - sessionAffinityConfig: - clientIP: - timeoutSeconds: 10800 -# -- Configure the liveness healthcheck for the auth server if needed. -livenessProbe: - # -- Executes the python3 healthcheck. - exec: - command: - - curl - - -k - - https://localhost:8443/health-check - initialDelaySeconds: 30 - periodSeconds: 30 - timeoutSeconds: 5 -# -- Configure the readiness healthcheck for the auth server if needed. -readinessProbe: - tcpSocket: - port: 8443 - initialDelaySeconds: 60 - timeoutSeconds: 5 - periodSeconds: 25 -# -- Configure any additional volumes that need to be attached to the pod -volumes: [] -# -- Configure any additional volumesMounts that need to be attached to the containers -volumeMounts: [] - -nodeSelector: {} - -tolerations: [] - -affinity: {} - -# -- Additional labels that will be added across all resources definitions in the format of {mylabel: "myapp"} -additionalLabels: { } -# -- Additional annotations that will be added across all resources in the format of {cert-manager.io/issuer: "letsencrypt-prod"}. key app is taken -additionalAnnotations: { } diff --git a/charts/janssen/charts/config-api/README.md b/charts/janssen/charts/config-api/README.md index 6c3b9999141..6215ba48fb8 100644 --- a/charts/janssen/charts/config-api/README.md +++ b/charts/janssen/charts/config-api/README.md @@ -10,7 +10,7 @@ Jans Config Api endpoints can be used to configure jans-auth-server, which is an | Name | Email | Url | | ---- | ------ | --- | -| Mohammad Abudayyeh | support@jans.io | https://github.com/moabu | +| Mohammad Abudayyeh | | | ## Source Code @@ -61,4 +61,4 @@ Kubernetes: `>=v1.21.0-0` | volumes | list | `[]` | Configure any additional volumes that need to be attached to the pod | ---------------------------------------------- -Autogenerated from chart metadata using [helm-docs v1.7.0](https://github.com/norwoodj/helm-docs/releases/v1.7.0) +Autogenerated from chart metadata using [helm-docs v1.11.0](https://github.com/norwoodj/helm-docs/releases/v1.11.0) diff --git a/charts/janssen/charts/config/README.md b/charts/janssen/charts/config/README.md index 31f10b2ef64..9e18c4ed9bb 100644 --- a/charts/janssen/charts/config/README.md +++ b/charts/janssen/charts/config/README.md @@ -10,7 +10,7 @@ Configuration parameters for setup and initial configuration secret and config l | Name | Email | Url | | ---- | ------ | --- | -| Mohammad Abudayyeh | support@jans.io | https://github.com/moabu | +| Mohammad Abudayyeh | | | ## Source Code @@ -31,8 +31,6 @@ Kubernetes: `>=v1.21.0-0` | adminPassword | string | `"Test1234#"` | Admin password to log in to the UI. | | city | string | `"Austin"` | City. Used for certificate creation. | | configmap.cnCacheType | string | `"NATIVE_PERSISTENCE"` | Cache type. `NATIVE_PERSISTENCE`, `REDIS`. or `IN_MEMORY`. Defaults to `NATIVE_PERSISTENCE` . | -| configmap.cnClientApiBindIpAddresses | string | `"*"` | Client-api bind address. This limits what ip ranges can access the client-api. This should be left as * and controlled by a NetworkPolicy | -| configmap.cnClientApiCertCn | string | `"client-api"` | Client-api OAuth certificate common name. This should be left to the default value client-api. | | configmap.cnConfigGoogleSecretNamePrefix | string | `"janssen"` | Prefix for Janssen configuration secret in Google Secret Manager. Defaults to janssen. If left intact janssen-configuration secret will be created. Used only when global.configAdapterName and global.configSecretAdapter is set to google. | | configmap.cnConfigGoogleSecretVersionId | string | `"latest"` | Secret version to be used for configuration. Defaults to latest and should normally always stay that way. Used only when global.configAdapterName and global.configSecretAdapter is set to google. Used only when global.configAdapterName and global.configSecretAdapter is set to google. | | configmap.cnConfigKubernetesConfigMap | string | `"cn"` | The name of the Kubernetes ConfigMap that will hold the configuration layer | @@ -99,4 +97,4 @@ Kubernetes: `>=v1.21.0-0` | volumes | list | `[]` | Configure any additional volumes that need to be attached to the pod | ---------------------------------------------- -Autogenerated from chart metadata using [helm-docs v1.7.0](https://github.com/norwoodj/helm-docs/releases/v1.7.0) +Autogenerated from chart metadata using [helm-docs v1.11.0](https://github.com/norwoodj/helm-docs/releases/v1.11.0) diff --git a/charts/janssen/charts/config/templates/_helpers.tpl b/charts/janssen/charts/config/templates/_helpers.tpl index 3d589814438..64b98743e1d 100644 --- a/charts/janssen/charts/config/templates/_helpers.tpl +++ b/charts/janssen/charts/config/templates/_helpers.tpl @@ -90,8 +90,5 @@ Create optional scopes list {{- if .Values.global.scim.enabled}} {{ $newList = append $newList ("scim" | quote) }} {{- end}} -{{- if index .Values "global" "client-api" "enabled"}} -{{ $newList = append $newList ("client-api" |quote) }} -{{- end}} {{ toJson $newList }} {{- end }} \ No newline at end of file diff --git a/charts/janssen/charts/config/templates/configmaps.yaml b/charts/janssen/charts/config/templates/configmaps.yaml index 016dee9a3ca..aa5fe594aec 100644 --- a/charts/janssen/charts/config/templates/configmaps.yaml +++ b/charts/janssen/charts/config/templates/configmaps.yaml @@ -73,24 +73,6 @@ data: | replace "auditStatsLogLevel" "audit_log_level" | squote }} - {{- if index .Values "global" "client-api" "enabled" }} - CN_CLIENT_API_SERVER_URL: {{ cat ( index .Values "global" "client-api" "clientApiServerServiceName" ) ":8443" | quote | nospace }} - CN_CLIENT_API_BIND_IP_ADDRESSES: {{ .Values.configmap.cnClientApiBindIpAddresses | quote }} - CN_CLIENT_API_APP_LOGGERS: {{ index .Values "global" "client-api" "appLoggers" - | toJson - | replace "clientApiLogTarget" "client_api_log_target" - | replace "clientApiLogLevel" "client_api_log_level" - | replace "persistenceLogTarget" "persistence_log_target" - | replace "persistenceLogLevel" "persistence_log_level" - | replace "persistenceDurationLogTarget" "persistence_duration_log_target" - | replace "persistenceDurationLogLevel" "persistence_duration_log_level" - | replace "ldapStatsLogTarget" "ldap_stats_log_target" - | replace "ldapStatsLogLevel" "ldap_stats_log_level" - | replace "scriptLogTarget" "script_log_target" - | replace "scriptLogLevel" "script_log_level" - | squote - }} - {{- end }} {{- if index .Values "global" "config-api" "enabled" }} CN_CONFIG_API_APP_LOGGERS: {{ index .Values "global" "config-api" "appLoggers" | toJson @@ -142,7 +124,6 @@ data: CN_PERSISTENCE_LDAP_MAPPING: {{ .Values.configmap.cnPersistenceHybridMapping | quote }} {{- end }} # Auto enable installation of some services - CN_CLIENT_API_CERT_CN: {{ .Values.configmap.cnClientApiCertCn | quote }} {{ if eq .Values.configmap.cnCacheType "REDIS" }} CN_REDIS_URL: {{ .Values.configmap.cnRedisUrl | quote }} CN_REDIS_TYPE: {{ .Values.configmap.cnRedisType | quote }} diff --git a/charts/janssen/charts/config/values.yaml b/charts/janssen/charts/config/values.yaml index a58a7ebfdcb..90db03c9c28 100644 --- a/charts/janssen/charts/config/values.yaml +++ b/charts/janssen/charts/config/values.yaml @@ -31,10 +31,6 @@ configmap: cnSqldbUserPassword: Test1234# # -- Cache type. `NATIVE_PERSISTENCE`, `REDIS`. or `IN_MEMORY`. Defaults to `NATIVE_PERSISTENCE` . cnCacheType: NATIVE_PERSISTENCE - # -- Client-api OAuth certificate common name. This should be left to the default value client-api. - cnClientApiCertCn: client-api - # -- Client-api bind address. This limits what ip ranges can access the client-api. This should be left as * and controlled by a NetworkPolicy - cnClientApiBindIpAddresses: "*" containerMetadataName: kubernetes # -- The name of the Kubernetes ConfigMap that will hold the configuration layer cnConfigKubernetesConfigMap: cn diff --git a/charts/janssen/charts/fido2/README.md b/charts/janssen/charts/fido2/README.md index 681e65a8e2d..e53c8aa706c 100644 --- a/charts/janssen/charts/fido2/README.md +++ b/charts/janssen/charts/fido2/README.md @@ -10,7 +10,7 @@ FIDO 2.0 (FIDO2) is an open authentication standard that enables leveraging comm | Name | Email | Url | | ---- | ------ | --- | -| Mohammad Abudayyeh | support@jans.io | https://github.com/moabu | +| Mohammad Abudayyeh | | | ## Source Code @@ -58,4 +58,4 @@ Kubernetes: `>=v1.21.0-0` | volumes | list | `[]` | Configure any additional volumes that need to be attached to the pod | ---------------------------------------------- -Autogenerated from chart metadata using [helm-docs v1.7.0](https://github.com/norwoodj/helm-docs/releases/v1.7.0) +Autogenerated from chart metadata using [helm-docs v1.11.0](https://github.com/norwoodj/helm-docs/releases/v1.11.0) diff --git a/charts/janssen/charts/nginx-ingress/README.md b/charts/janssen/charts/nginx-ingress/README.md index 943c35406f6..0f17b4c4013 100644 --- a/charts/janssen/charts/nginx-ingress/README.md +++ b/charts/janssen/charts/nginx-ingress/README.md @@ -10,7 +10,7 @@ Nginx ingress definitions chart | Name | Email | Url | | ---- | ------ | --- | -| Mohammad Abudayyeh | support@jans.io | https://github.com/moabu | +| Mohammad Abudayyeh | | | ## Source Code @@ -70,4 +70,4 @@ Kubernetes: `>=v1.21.0-0` | nameOverride | string | `""` | | ---------------------------------------------- -Autogenerated from chart metadata using [helm-docs v1.7.0](https://github.com/norwoodj/helm-docs/releases/v1.7.0) +Autogenerated from chart metadata using [helm-docs v1.11.0](https://github.com/norwoodj/helm-docs/releases/v1.11.0) diff --git a/charts/janssen/charts/opendj/README.md b/charts/janssen/charts/opendj/README.md index 15b632e396d..d20f7a0739e 100644 --- a/charts/janssen/charts/opendj/README.md +++ b/charts/janssen/charts/opendj/README.md @@ -10,7 +10,7 @@ OpenDJ is a directory server which implements a wide range of Lightweight Direct | Name | Email | Url | | ---- | ------ | --- | -| Mohammad Abudayyeh | support@jans.io | https://github.com/moabu | +| Mohammad Abudayyeh | | | ## Source Code @@ -68,4 +68,4 @@ Kubernetes: `>=v1.21.0-0` | volumes | list | `[]` | Configure any additional volumes that need to be attached to the pod | ---------------------------------------------- -Autogenerated from chart metadata using [helm-docs v1.7.0](https://github.com/norwoodj/helm-docs/releases/v1.7.0) +Autogenerated from chart metadata using [helm-docs v1.11.0](https://github.com/norwoodj/helm-docs/releases/v1.11.0) diff --git a/charts/janssen/charts/persistence/README.md b/charts/janssen/charts/persistence/README.md index dff0a49e266..c7904147562 100644 --- a/charts/janssen/charts/persistence/README.md +++ b/charts/janssen/charts/persistence/README.md @@ -10,7 +10,7 @@ Job to generate data and initial config for Janssen Server persistence layer. | Name | Email | Url | | ---- | ------ | --- | -| Mohammad Abudayyeh | support@jans.io | https://github.com/moabu | +| Mohammad Abudayyeh | | | ## Source Code @@ -48,4 +48,4 @@ Kubernetes: `>=v1.21.0-0` | volumes | list | `[]` | Configure any additional volumes that need to be attached to the pod | ---------------------------------------------- -Autogenerated from chart metadata using [helm-docs v1.7.0](https://github.com/norwoodj/helm-docs/releases/v1.7.0) +Autogenerated from chart metadata using [helm-docs v1.11.0](https://github.com/norwoodj/helm-docs/releases/v1.11.0) diff --git a/charts/janssen/charts/scim/README.md b/charts/janssen/charts/scim/README.md index fc186a071ec..7e08c412b0b 100644 --- a/charts/janssen/charts/scim/README.md +++ b/charts/janssen/charts/scim/README.md @@ -10,7 +10,7 @@ System for Cross-domain Identity Management (SCIM) version 2.0 | Name | Email | Url | | ---- | ------ | --- | -| Mohammad Abudayyeh | support@jans.io | https://github.com/moabu | +| Mohammad Abudayyeh | | | ## Source Code @@ -57,4 +57,4 @@ Kubernetes: `>=v1.21.0-0` | volumes | list | `[]` | Configure any additional volumes that need to be attached to the pod | ---------------------------------------------- -Autogenerated from chart metadata using [helm-docs v1.7.0](https://github.com/norwoodj/helm-docs/releases/v1.7.0) +Autogenerated from chart metadata using [helm-docs v1.11.0](https://github.com/norwoodj/helm-docs/releases/v1.11.0) diff --git a/charts/janssen/values.schema.json b/charts/janssen/values.schema.json index 61c71a8a46f..8c15be64b17 100644 --- a/charts/janssen/values.schema.json +++ b/charts/janssen/values.schema.json @@ -12,11 +12,6 @@ "type": "object", "properties": {} }, - "client-api": { - "description": "Middleware API to help application developers call an OAuth, OpenID or UMA server. You may wonder why this is necessary. It makes it easier for client developers to use OpenID signing and encryption features, without becoming crypto experts. This API provides some high level endpoints to do some of the heavy lifting.", - "type": "object", - "properties": {} - }, "config": { "description": "Configuration parameters for setup and initial configuration secret annd config layers used by Janssen services.", "type": "object", @@ -78,15 +73,6 @@ "type": "string", "pattern": "^(NATIVE_PERSISTENCE|REDIS|IN_MEMORY)$" }, - "cnClientApiCertCn": { - "description": "Client-api OAuth certificate common name. This should be left to the default value client-api", - "type": "string", - "pattern": "^[a-z-]+$" - }, - "cnClientApiBindIpAddresses": { - "description": "Client-api bind address. This limits what ip ranges can access the client-api. This should be left as * and controlled by a NetworkPolicy", - "$ref": "#/definitions/ip-pattern" - }, "cnConfigKubernetesConfigMap": { "description": "The name of the ConfigMap that will hold the configuration layer", "type": "string", @@ -443,35 +429,6 @@ "type": "string", "pattern": "^(Managed)$" }, - "client-api": { - "type": "object", - "properties": { - "clientApiServerServiceName": { - "description": "Name of the client-api service. Please keep it as default.", - "type": "string", - "pattern": "^[a-z0-9-]+$" - }, - "enabled": { - "description": "Boolean flag to enable/disable the client-api chart.", - "type": "boolean" - }, - "appLoggers": { - "type": "object", - "properties": { - "clientApiLogTarget": { - "description": "client-api.log target", - "type": "string", - "pattern": "^(STDOUT|FILE)$" - }, - "clientApiLogLevel": { - "description": "client-api.log level", - "type": "string", - "pattern": "^(FATAL|ERROR|WARN|INFO|DEBUG|TRACE)$" - } - } - } - } - }, "cloud": { "type": "object", "properties": { @@ -804,9 +761,6 @@ { "$ref": "#/definitions/auth-server-key-rotation-enabled" }, - { - "$ref": "#/definitions/client-api-enabled" - }, { "$ref": "#/definitions/config-api-enabled" }, @@ -1156,147 +1110,6 @@ }, "else": true }, - "client-api-enabled": { - "if": { - "properties": { - "global": { - "properties": { - "client-api": { - "properties": { - "enabled": { - "const": "true" - } - } - } - } - } - } - }, - "then": { - "properties": { - "client-api": { - "required": [ - "image", - "replicas", - "resources", - "service" - ], - "properties": { - "hpa": { - "description": "Configure the HorizontalPodAutoscaler", - "type": "object", - "properties": { - "enabled": { - "type": "boolean" - }, - "minReplicas": { - "type": "integer" - }, - "maxReplicas": { - "type": "integer" - }, - "targetCPUUtilizationPercentage": { - "type": "integer" - }, - "metrics": { - "description": "metrics if targetCPUUtilizationPercentage is not set", - "type": "array" - }, - "behavior": { - "description": "Scaling Policies", - "type": "object" - } - } - }, - "usrEnvs": { - "description": "Add custom normal and secret envs to the service", - "type": "object", - "properties": { - "normal": { - "description": "Add custom normal envs to the service", - "type": "object" - }, - "secret": { - "description": "Add custom secret envs to the service", - "type": "object" - } - } - }, - "dnsPolicy": { - "description": "Add custom dns policy", - "type": "string", - "pattern": "^(Default|ClusterFirst|ClusterFirstWithHostNet|None|)$" - }, - "dnsConfig": { - "description": "Add custom dns config", - "type": "object" - }, - "image": { - "type": "object", - "properties": { - "pullPolicy": { - "description": "Image pullPolicy to use for deploying.", - "type": "string", - "pattern": "^(Always|Never|IfNotPresent)$" - }, - "repository": { - "description": "Image to use for deploying", - "type": "string", - "pattern": "^[a-z0-9-_/]+$" - }, - "tag": { - "description": "Image tag to use for deploying.", - "type": "string", - "pattern": "^[a-z0-9-_.]+$" - } - } - }, - "replicas": { - "description": "Service replica number.", - "type": "integer" - }, - "resources": { - "description": "Resource specs.", - "type": "object", - "properties": { - "limits": { - "type": "object", - "properties": { - "cpu": { - "description": "CPU limit.", - "type": "string", - "pattern": "^[0-9m]+$" - }, - "memory": { - "description": "Memory limit.", - "type": "string", - "pattern": "^[0-9Mi]+$" - } - } - }, - "requests": { - "type": "object", - "properties": { - "cpu": { - "description": "CPU request.", - "type": "string", - "pattern": "^[0-9m]+$" - }, - "memory": { - "description": "Memory request.", - "type": "string", - "pattern": "^[0-9Mi]+$" - } - } - } - } - } - } - } - } - }, - "else": true - }, "config-api-enabled": { "if": { "properties": { diff --git a/charts/janssen/values.yaml b/charts/janssen/values.yaml index 09c6a46654c..6ab4c58b1ce 100644 --- a/charts/janssen/values.yaml +++ b/charts/janssen/values.yaml @@ -118,80 +118,6 @@ auth-server-key-rotation: # -- Configure any additional volumesMounts that need to be attached to the containers volumeMounts: [] - # -- Additional labels that will be added across the gateway in the format of {mylabel: "myapp"} - additionalLabels: {} - # -- Additional annotations that will be added across the gateway in the format of {cert-manager.io/issuer: "letsencrypt-prod"} - additionalAnnotations: {} -# -- Middleware API to help application developers call an OAuth, OpenID or UMA server. You may wonder why this is necessary. It makes it easier for client developers to use OpenID signing and encryption features, without becoming crypto experts. This API provides some high level endpoints to do some of the heavy lifting. -client-api: - # -- Configure the HorizontalPodAutoscaler - hpa: - enabled: true - minReplicas: 1 - maxReplicas: 10 - targetCPUUtilizationPercentage: 50 - # -- metrics if targetCPUUtilizationPercentage is not set - metrics: [] - # -- Scaling Policies - behavior: {} - # -- Add custom normal and secret envs to the service - usrEnvs: - # -- Add custom normal envs to the service - # variable1: value1 - normal: {} - # -- Add custom secret envs to the service - # variable1: value1 - secret: {} - # -- Add custom dns policy - dnsPolicy: "" - # -- Add custom dns config - dnsConfig: {} - image: - # -- Image pullPolicy to use for deploying. - pullPolicy: IfNotPresent - # -- Image to use for deploying. - repository: janssenproject/client-api - # -- Image tag to use for deploying. - tag: 1.0.3_dev - # -- Image Pull Secrets - pullSecrets: [] - # -- Service replica number. - replicas: 1 - # -- Resource specs. - resources: - limits: - # -- CPU limit. - cpu: 1000m - # -- Memory limit. - memory: 400Mi - requests: - # -- CPU request. - cpu: 1000m - # -- Memory request. - memory: 400Mi - # -- Configure the liveness healthcheck for the auth server if needed. - livenessProbe: - # -- Executes the python3 healthcheck. - exec: - command: - - curl - - -k - - https://localhost:8443/health-check - initialDelaySeconds: 30 - periodSeconds: 30 - timeoutSeconds: 5 - # -- Configure the readiness healthcheck for the auth server if needed. - readinessProbe: - tcpSocket: - port: 8443 - initialDelaySeconds: 60 - timeoutSeconds: 5 - periodSeconds: 25 - # -- Configure any additional volumes that need to be attached to the pod - volumes: [] - # -- Configure any additional volumesMounts that need to be attached to the containers - volumeMounts: [] - # -- Additional labels that will be added across the gateway in the format of {mylabel: "myapp"} additionalLabels: {} # -- Additional annotations that will be added across the gateway in the format of {cert-manager.io/issuer: "letsencrypt-prod"} @@ -229,10 +155,6 @@ config: cnSqldbUserPassword: Test1234# # -- Cache type. `NATIVE_PERSISTENCE`, `REDIS`. or `IN_MEMORY`. Defaults to `NATIVE_PERSISTENCE` . cnCacheType: NATIVE_PERSISTENCE - # -- Client-api OAuth certificate common name. This should be left to the default value client-api. - cnClientApiCertCn: client-api - # -- Client-api bind address. This limits what ip ranges can access the client-api. This should be left as * and controlled by a NetworkPolicy - cnClientApiBindIpAddresses: "*" # -- The name of the Kubernetes ConfigMap that will hold the configuration layer cnConfigKubernetesConfigMap: cn # -- The prefix of couchbase buckets. This helps with separation in between different environments and allows for the same couchbase cluster to be used by different setups of Janssen. @@ -562,33 +484,6 @@ global: azureStorageAccountType: Standard_LRS # -- Azure storage kind if using Azure disks azureStorageKind: Managed - client-api: - # -- Name of the client-api service. Please keep it as default. - clientApiServerServiceName: client-api - # -- Boolean flag to enable/disable the client-api chart. - enabled: false - # -- App loggers can be configured to define where the logs will be redirected to and the level of each in which it should be displayed. - appLoggers: - # -- client-api.log target - clientApiLogTarget: "STDOUT" - # -- client-api.log level - clientApiLogLevel: "INFO" - # -- client-api_persistence.log target - persistenceLogTarget: "FILE" - # -- client-api_persistence.log level - persistenceLogLevel: "INFO" - # -- client-api_persistence_duration.log target - persistenceDurationLogTarget: "FILE" - # -- client-api_persistence_duration.log level - persistenceDurationLogLevel: "INFO" - # -- client-api_persistence_ldap_statistics.log target - ldapStatsLogTarget: "FILE" - # -- client-api_persistence_ldap_statistics.log level - ldapStatsLogLevel: "INFO" - # -- client-api_script.log target - scriptLogTarget: "FILE" - # -- client-api_script.log level - scriptLogLevel: "INFO" cloud: # -- Boolean flag if enabled will strip resources requests and limits from all services. testEnviroment: false diff --git a/docker-jans-certmanager/README.md b/docker-jans-certmanager/README.md index 9dd7d2f55a8..f2c947addce 100644 --- a/docker-jans-certmanager/README.md +++ b/docker-jans-certmanager/README.md @@ -148,22 +148,6 @@ Supported services: - `subj-alt-name`: Subject Alternative Name (SAN) for certificate (default to `localhost`) - `valid-to`: Validity length in days (default to `365`) -4. `client-api` - - Re-generate: - - - `/etc/certs/client_api_application.crt` - - `/etc/certs/client_api_application.key` - - `/etc/certs/client_api_application.keystore` - - `/etc/certs/client_api_admin.crt` - - `/etc/certs/client_api_admin.key` - - `/etc/certs/client_api_admin.keystore` - - Options: - - - `application-cn`: Subject alternative name for application certificate (default to `localhost`) - - `admin-cn`: Subject alternative name for admin certificate (default to `localhost`) - - `valid-to`: Validity length in days (default to `365`) #### prune diff --git a/docker-jans-certmanager/scripts/bootstrap.py b/docker-jans-certmanager/scripts/bootstrap.py index 8e521f99b3e..d6218a5cf8d 100644 --- a/docker-jans-certmanager/scripts/bootstrap.py +++ b/docker-jans-certmanager/scripts/bootstrap.py @@ -9,7 +9,6 @@ from settings import LOGGING_CONFIG from ldap_handler import LdapHandler from auth_handler import AuthHandler -from client_api_handler import ClientApiHandler # from oxshibboleth_handler import OxshibbolethHandler # from passport_handler import PassportHandler from web_handler import WebHandler @@ -22,7 +21,6 @@ "web": WebHandler, # "oxshibboleth": OxshibbolethHandler, "auth": AuthHandler, - "client-api": ClientApiHandler, "ldap": LdapHandler, # "passport": PassportHandler, } diff --git a/docker-jans-certmanager/scripts/client_api_handler.py b/docker-jans-certmanager/scripts/client_api_handler.py deleted file mode 100644 index d438273dea2..00000000000 --- a/docker-jans-certmanager/scripts/client_api_handler.py +++ /dev/null @@ -1,73 +0,0 @@ -import logging.config - -from jans.pycloudlib.utils import exec_cmd - -from base_handler import BaseHandler -from settings import LOGGING_CONFIG - -logging.config.dictConfig(LOGGING_CONFIG) -logger = logging.getLogger("certmanager") - - -class ClientApiHandler(BaseHandler): - def generate_x509(self, suffix, cert_cn): - try: - valid_to = int(self.opts.get("valid-to", 365)) - except ValueError: - valid_to = 365 - finally: - if valid_to < 1: - valid_to = 365 - - cert_file, key_file = self._patch_cert_key( - suffix, - extra_dns=[cert_cn], - valid_to=valid_to, - ) - return cert_file, key_file - - @staticmethod - def generate_keystore(cert_file, key_file, keystore_file, keystore_password): - out, err, code = exec_cmd( - "openssl pkcs12 -export -name client-api " - f"-out {keystore_file} " - f"-inkey {key_file} " - f"-in {cert_file} " - f"-passout pass:{keystore_password}" - ) - if code != 0: - logger.warning(f"Failed to generate keystore; reason={err.decode()}") - return False - return True - - def _patch_connector(self, conn_type): - suffix = f"client_api_{conn_type}" - cert_cn = self.opts.get(f"{conn_type}-cn", "localhost") - - cert_file, key_file = self.generate_x509(suffix, cert_cn) - if not self.dry_run: - self.manager.secret.from_file( - f"client_api_{conn_type}_cert", cert_file, - ) - self.manager.secret.from_file( - f"client_api_{conn_type}_key", key_file, - ) - - keystore_file = f"/etc/certs/client_api_{conn_type}.keystore" - keystore_password = self.manager.secret.get(f"client_api_{conn_type}_keystore_password") - - logger.info(f"Generating new {keystore_file} file") - generated = self.generate_keystore( - cert_file, key_file, keystore_file, keystore_password, - ) - if not self.dry_run and generated: - self.manager.secret.from_file( - f"client_api_{conn_type}_jks_base64", - keystore_file, - encode=True, - binary_mode=True, - ) - - def patch(self): - for conn_type in ("application", "admin"): - self._patch_connector(conn_type) diff --git a/docker-jans-client-api/.dockerignore b/docker-jans-client-api/.dockerignore deleted file mode 100644 index 6482f2e23ce..00000000000 --- a/docker-jans-client-api/.dockerignore +++ /dev/null @@ -1,9 +0,0 @@ -# exclude everything -* - -# include required files/directories -!scripts -!conf -!LICENSE -!requirements.txt -!jetty diff --git a/docker-jans-client-api/.hadolint.yaml b/docker-jans-client-api/.hadolint.yaml deleted file mode 100644 index 428f8174ee2..00000000000 --- a/docker-jans-client-api/.hadolint.yaml +++ /dev/null @@ -1,4 +0,0 @@ -ignored: - - DL3018 # Pin versions in apk add - - DL3013 # Pin versions in pip - - DL3003 # Use WORKDIR to switch to a directory diff --git a/docker-jans-client-api/CHANGELOG.md b/docker-jans-client-api/CHANGELOG.md deleted file mode 100644 index 09e91b1fbb0..00000000000 --- a/docker-jans-client-api/CHANGELOG.md +++ /dev/null @@ -1,157 +0,0 @@ -# Changelog - -## 1.0.2-1 (2022-08-30) - - -### Features - -* add newly redesigned jans-client-api ([#1540](https://github.com/JanssenProject/jans/issues/1540)) ([4582ae5](https://github.com/JanssenProject/jans/commit/4582ae563ddf2492c519fdbc7685af2ce3c5529d)) -* expose prometheus metrics via jmx exporter ([#1573](https://github.com/JanssenProject/jans/issues/1573)) ([205e320](https://github.com/JanssenProject/jans/commit/205e3206cf87bdb7cf0908bfdd7ee777d1ab955d)) -* introduce new hybrid persistence mapping ([#1505](https://github.com/JanssenProject/jans/issues/1505)) ([a77ab60](https://github.com/JanssenProject/jans/commit/a77ab602d15cb6bdf4751aaa11c2be9485b04a34)) - - -### Bug Fixes - -* **images:** conform to new couchbase persistence configuration ([#2188](https://github.com/JanssenProject/jans/issues/2188)) ([c708542](https://github.com/JanssenProject/jans/commit/c7085427fd298f74e8809ef4d6c39f780fa83776)) -* main docker version ([1220e1c](https://github.com/JanssenProject/jans/commit/1220e1c892c4462b74039bcf64f0cd0cedb80d1f)) -* **pycloudlib:** handle type mismatch for iterable ([#2004](https://github.com/JanssenProject/jans/issues/2004)) ([46e0b2e](https://github.com/JanssenProject/jans/commit/46e0b2e4aff70a97cdcdcd0102dc83d294e45fdc)) - - -### Miscellaneous Chores - -* prepare docker images release 1.0.1-1 ([12660a8](https://github.com/JanssenProject/jans/commit/12660a800bacb210bd3fb4b35c9156e9c5445343)) -* release 1.0.2-1 ([d01b51a](https://github.com/JanssenProject/jans/commit/d01b51a847bb2f67b52da433ebd1c5e4a66b7c1a)) - -## [1.0.1-1](https://github.com/JanssenProject/jans/compare/docker-jans-client-api-v1.0.0-1...docker-jans-client-api-v1.0.1-1) (2022-07-06) - - -### Features - -* add newly redesigned jans-client-api ([#1540](https://github.com/JanssenProject/jans/issues/1540)) ([4582ae5](https://github.com/JanssenProject/jans/commit/4582ae563ddf2492c519fdbc7685af2ce3c5529d)) -* expose prometheus metrics via jmx exporter ([#1573](https://github.com/JanssenProject/jans/issues/1573)) ([205e320](https://github.com/JanssenProject/jans/commit/205e3206cf87bdb7cf0908bfdd7ee777d1ab955d)) -* introduce new hybrid persistence mapping ([#1505](https://github.com/JanssenProject/jans/issues/1505)) ([a77ab60](https://github.com/JanssenProject/jans/commit/a77ab602d15cb6bdf4751aaa11c2be9485b04a34)) - - -### Bug Fixes - -* main docker version ([1220e1c](https://github.com/JanssenProject/jans/commit/1220e1c892c4462b74039bcf64f0cd0cedb80d1f)) - - -### Miscellaneous Chores - -* prepare docker images release 1.0.1-1 ([12660a8](https://github.com/JanssenProject/jans/commit/12660a800bacb210bd3fb4b35c9156e9c5445343)) - -## 1.0.0-1 (2022-05-20) - - -### Features - -* add helper to create persistence entry from LDIF file ([#1262](https://github.com/JanssenProject/jans/issues/1262)) ([f2e653e](https://github.com/JanssenProject/jans/commit/f2e653ef917efd017195f2330b64e64c333f4699)) -* adjust ownership and permission to avoid bloated images ([#1312](https://github.com/JanssenProject/jans/issues/1312)) ([d016682](https://github.com/JanssenProject/jans/commit/d0166821baf52665934c0eaa38de8b2f51825456)) - - -### Miscellaneous Chores - -* prepare release 1.0.0-1 ([8985928](https://github.com/JanssenProject/jans/commit/89859286d69e7de7885bd9da9f50720c8371e797)) -* release 1.0.0 ([b2895f2](https://github.com/JanssenProject/jans/commit/b2895f224b5772c0724ea0afbdf67a417a5c537c)) -* release 1.0.0-beta.16 ([a083ad6](https://github.com/JanssenProject/jans/commit/a083ad6b1d43201126e8d4f690a55ea1b109524c)) -* release 1.0.0-beta.16 ([90e4bb2](https://github.com/JanssenProject/jans/commit/90e4bb29df040bd9fe5921a054bc4226d34ca1ef)) -* release 1.0.0-beta.16 ([eec2073](https://github.com/JanssenProject/jans/commit/eec2073be9fd25544f31087e171934afb9a71e6d)) -* release 1.0.0-beta.16 ([cd92ead](https://github.com/JanssenProject/jans/commit/cd92ead2ca654383091c4923d3de5619b70fc5b9)) -* release 1.0.0-beta.16 ([7f0a91b](https://github.com/JanssenProject/jans/commit/7f0a91bd90efc1cd7a80047f9cd6b7c6a22417a2)) -* release 1.0.0-beta.16 ([c2ad604](https://github.com/JanssenProject/jans/commit/c2ad604dc29e7401bc4cb0788feaa20e11de0440)) -* release 1.0.0-beta.16 ([a641486](https://github.com/JanssenProject/jans/commit/a6414864712789d1fcf80b823338100aebda030e)) -* release 1.0.0-beta.16 ([94d5791](https://github.com/JanssenProject/jans/commit/94d5791a23fce4ecb8913c16c940cfbbc85fed4c)) -* release 1.0.0-beta.16 ([16de429](https://github.com/JanssenProject/jans/commit/16de4299bc5e9c4a842f279ae0d3ae8282a4ff2c)) -* release 1.0.0-beta.16 ([72915c0](https://github.com/JanssenProject/jans/commit/72915c0e82b9684ac1c59934d5b9a36c2456058d)) -* release 1.0.0-beta.16 ([3ea2b37](https://github.com/JanssenProject/jans/commit/3ea2b37deac3416564614fb6a4e84b056ddbed3f)) -* release 1.0.0-beta.16 ([78a6d39](https://github.com/JanssenProject/jans/commit/78a6d39ffadf9abee18c7be0e14ad3eb6ec2ef1b)) -* release 1.0.0-beta.16 ([11bfa93](https://github.com/JanssenProject/jans/commit/11bfa9368e6ee482cc44240de08c8133d91b3f4c)) -* release 1.0.0-beta.16 ([22b180b](https://github.com/JanssenProject/jans/commit/22b180bba9a08045a6daa7ca8ee2b71abd42a973)) -* release 1.0.0-beta.16 ([b9acd0b](https://github.com/JanssenProject/jans/commit/b9acd0bceeeb54e3c47f869f11d97a22e8dc161f)) -* release 1.0.0-beta.16 ([328cd30](https://github.com/JanssenProject/jans/commit/328cd309ae1655a52709e13ca2f89441c6c965a2)) -* release 1.0.0-beta.16 ([5a84602](https://github.com/JanssenProject/jans/commit/5a84602838fb5d2e667422220fcd44dc53543e23)) -* release 1.0.0-beta.16 ([4923277](https://github.com/JanssenProject/jans/commit/4923277b100b5c814d94b27b88d1809794dfc413)) -* release 1.0.0-beta.16 ([258ba96](https://github.com/JanssenProject/jans/commit/258ba962bd93eb5be4d51e7de3a80da89c2e222f)) -* release 1.0.0-beta.16 ([77c4423](https://github.com/JanssenProject/jans/commit/77c4423d82b697fd91a0e61f40bad6bd9da0dba8)) - -## [1.0.0-beta.16](https://github.com/JanssenProject/jans/compare/docker-jans-client-api-v1.0.0-beta.15...docker-jans-client-api-v1.0.0-beta.16) (2022-03-14) - - -### Features - -* add validity length (in days) for certs ([#981](https://github.com/JanssenProject/jans/issues/981)) ([abc89dc](https://github.com/JanssenProject/jans/commit/abc89dc6fadae5627a68a97ab4f4f5ceb56af809)) - - -### Miscellaneous Chores - -* release 1.0.0-beta.16 ([a083ad6](https://github.com/JanssenProject/jans/commit/a083ad6b1d43201126e8d4f690a55ea1b109524c)) -* release 1.0.0-beta.16 ([90e4bb2](https://github.com/JanssenProject/jans/commit/90e4bb29df040bd9fe5921a054bc4226d34ca1ef)) -* release 1.0.0-beta.16 ([eec2073](https://github.com/JanssenProject/jans/commit/eec2073be9fd25544f31087e171934afb9a71e6d)) -* release 1.0.0-beta.16 ([cd92ead](https://github.com/JanssenProject/jans/commit/cd92ead2ca654383091c4923d3de5619b70fc5b9)) -* release 1.0.0-beta.16 ([7f0a91b](https://github.com/JanssenProject/jans/commit/7f0a91bd90efc1cd7a80047f9cd6b7c6a22417a2)) -* release 1.0.0-beta.16 ([c2ad604](https://github.com/JanssenProject/jans/commit/c2ad604dc29e7401bc4cb0788feaa20e11de0440)) -* release 1.0.0-beta.16 ([a641486](https://github.com/JanssenProject/jans/commit/a6414864712789d1fcf80b823338100aebda030e)) -* release 1.0.0-beta.16 ([94d5791](https://github.com/JanssenProject/jans/commit/94d5791a23fce4ecb8913c16c940cfbbc85fed4c)) -* release 1.0.0-beta.16 ([16de429](https://github.com/JanssenProject/jans/commit/16de4299bc5e9c4a842f279ae0d3ae8282a4ff2c)) -* release 1.0.0-beta.16 ([72915c0](https://github.com/JanssenProject/jans/commit/72915c0e82b9684ac1c59934d5b9a36c2456058d)) -* release 1.0.0-beta.16 ([3ea2b37](https://github.com/JanssenProject/jans/commit/3ea2b37deac3416564614fb6a4e84b056ddbed3f)) -* release 1.0.0-beta.16 ([78a6d39](https://github.com/JanssenProject/jans/commit/78a6d39ffadf9abee18c7be0e14ad3eb6ec2ef1b)) -* release 1.0.0-beta.16 ([11bfa93](https://github.com/JanssenProject/jans/commit/11bfa9368e6ee482cc44240de08c8133d91b3f4c)) -* release 1.0.0-beta.16 ([22b180b](https://github.com/JanssenProject/jans/commit/22b180bba9a08045a6daa7ca8ee2b71abd42a973)) -* release 1.0.0-beta.16 ([b9acd0b](https://github.com/JanssenProject/jans/commit/b9acd0bceeeb54e3c47f869f11d97a22e8dc161f)) -* release 1.0.0-beta.16 ([328cd30](https://github.com/JanssenProject/jans/commit/328cd309ae1655a52709e13ca2f89441c6c965a2)) -* release 1.0.0-beta.16 ([5a84602](https://github.com/JanssenProject/jans/commit/5a84602838fb5d2e667422220fcd44dc53543e23)) -* release 1.0.0-beta.16 ([4923277](https://github.com/JanssenProject/jans/commit/4923277b100b5c814d94b27b88d1809794dfc413)) -* release 1.0.0-beta.16 ([258ba96](https://github.com/JanssenProject/jans/commit/258ba962bd93eb5be4d51e7de3a80da89c2e222f)) -* release 1.0.0-beta.16 ([77c4423](https://github.com/JanssenProject/jans/commit/77c4423d82b697fd91a0e61f40bad6bd9da0dba8)) -* release 1.0.0-beta.16 ([688b324](https://github.com/JanssenProject/jans/commit/688b32407b396917695cca787c08e95fe98269a1)) -* release 1.0.0-beta.16 ([4e86f15](https://github.com/JanssenProject/jans/commit/4e86f15fc39ec89d4790ebfaa7d30e7053fef606)) -* release 1.0.0-beta.16 ([8d514ee](https://github.com/JanssenProject/jans/commit/8d514ee63d840627321de2d89e816577dd919914)) -* release 1.0.0-beta.16 ([0899898](https://github.com/JanssenProject/jans/commit/0899898e80ba9b7e6a915574737bdf0756b59a14)) - -## 1.0.0-beta.15 (2022-03-02) - - -### Features - -* update base images [#672](https://github.com/JanssenProject/jans/issues/672) ([#673](https://github.com/JanssenProject/jans/issues/673)) ([0a23d08](https://github.com/JanssenProject/jans/commit/0a23d085ea8fe16d0b4cd21cd3ec8cde59df9f9a)) - - -### Bug Fixes - -* gprcio bug in build error ([664a4fe](https://github.com/JanssenProject/jans/commit/664a4fe4f611496e937428a0517f22aed1a564f4)) -* **pycloudlib:** missing tar option to not restore file timestamp [#613](https://github.com/JanssenProject/jans/issues/613) ([#627](https://github.com/JanssenProject/jans/issues/627)) ([d19fbfd](https://github.com/JanssenProject/jans/commit/d19fbfd6891d03fb0c76073dfa8ba2ffc44a3b9b)) - - -### Miscellaneous Chores - -* release 1.0.0-beta.15 ([ee5b719](https://github.com/JanssenProject/jans/commit/ee5b719bee5cc4bdaebf81a5103e6a7ab0695dbb)) -* release 1.0.0-beta.15 ([ca6d1c9](https://github.com/JanssenProject/jans/commit/ca6d1c9e2acb5e6422e1cd26ac277dd3eba4e56e)) -* release 1.0.0-beta.15 ([b65bab2](https://github.com/JanssenProject/jans/commit/b65bab20530b7d6736dd404e26649abf47c0fb60)) - -## 1.0.0-beta.14 (2021-12-27) - - -### Features - -* add support for plugins ([#67](https://www.github.com/JanssenProject/jans-cloud-native/issues/67)) ([7f2204c](https://www.github.com/JanssenProject/jans-cloud-native/commit/7f2204cb186902ebdc0d1f6ae1d321f3c5eeea5b)) -* deprecate password files in favor of secrets ([#152](https://www.github.com/JanssenProject/jans-cloud-native/issues/152)) ([f415213](https://www.github.com/JanssenProject/jans-cloud-native/commit/f415213cfd992363f3fb85005df16e963a6ed8ff)) - - -### Miscellaneous Chores - -* change release to 1.0.0-beta.14 ([2d5d61b](https://www.github.com/JanssenProject/jans-cloud-native/commit/2d5d61bc5971da0a087323e544f12206154af43f)) -* release 1.0.0-beta.13 ([789a9ed](https://www.github.com/JanssenProject/jans-cloud-native/commit/789a9edbe2d78e7424dc6ce4f153f719a5f09e35)) - -## 1.0.0-beta.13 (2021-12-03) - - -### Features - -* add support for plugins ([#67](https://www.github.com/JanssenProject/jans-cloud-native/issues/67)) ([7f2204c](https://www.github.com/JanssenProject/jans-cloud-native/commit/7f2204cb186902ebdc0d1f6ae1d321f3c5eeea5b)) - - -### Miscellaneous Chores - -* release 1.0.0-beta.13 ([789a9ed](https://www.github.com/JanssenProject/jans-cloud-native/commit/789a9edbe2d78e7424dc6ce4f153f719a5f09e35)) diff --git a/docker-jans-client-api/Dockerfile b/docker-jans-client-api/Dockerfile deleted file mode 100644 index e69482be072..00000000000 --- a/docker-jans-client-api/Dockerfile +++ /dev/null @@ -1,238 +0,0 @@ -FROM bellsoft/liberica-openjre-alpine:11.0.16 - -# =============== -# Alpine packages -# =============== - -RUN apk update \ - && apk upgrade --available \ - && apk add --no-cache openssl python3 tini curl py3-cryptography py3-psycopg2 py3-grpcio \ - && apk add --no-cache --virtual .build-deps zip wget git \ - && mkdir -p /usr/java/latest \ - && ln -sf /usr/lib/jvm/jre /usr/java/latest/jre - -# ===== -# Jetty -# ===== - -ARG JETTY_VERSION=11.0.11 -ARG JETTY_HOME=/opt/jetty -ARG JETTY_BASE=/opt/jans/jetty -ARG JETTY_USER_HOME_LIB=/home/jetty/lib - -# Install jetty -RUN wget -q https://repo1.maven.org/maven2/org/eclipse/jetty/jetty-home/${JETTY_VERSION}/jetty-home-${JETTY_VERSION}.tar.gz -O /tmp/jetty.tar.gz \ - && mkdir -p /opt \ - && tar -xzf /tmp/jetty.tar.gz -C /opt \ - && mv /opt/jetty-home-${JETTY_VERSION} ${JETTY_HOME} \ - && rm -rf /tmp/jetty.tar.gz - -# Ports required by jetty -EXPOSE 8080 - -# ====== -# Jython -# ====== - -ARG JYTHON_VERSION=2.7.3 -ARG JYTHON_BUILD_DATE='2022-08-01 07:49' -RUN wget -q https://maven.jans.io/maven/io/jans/jython-installer//${JYTHON_VERSION}/jython-installer-${JYTHON_VERSION}.jar -O /tmp/jython-installer.jar \ - && mkdir -p /opt/jython \ - && java -jar /tmp/jython-installer.jar -v -s -d /opt/jython -e ensurepip \ - && rm -f /tmp/jython-installer.jar /tmp/*.properties - -# ========== -# Client API -# ========== - -ENV CN_VERSION=1.0.3-SNAPSHOT -ENV CN_BUILD_DATE='2022-09-21 19:15' -ENV CN_SOURCE_URL=https://jenkins.jans.io/maven/io/jans/jans-client-api-server/${CN_VERSION}/jans-client-api-server-${CN_VERSION}.war - -COPY jetty/jetty-env.xml /tmp/WEB-INF/jetty-env.xml -RUN mkdir -p ${JETTY_BASE}/jans-client-api/webapps \ - && wget -q ${CN_SOURCE_URL} -O /tmp/jans-client-api.war \ - && cd /tmp \ - && zip -d jans-client-api.war WEB-INF/jetty-web.xml \ - && zip -r jans-client-api.war WEB-INF/jetty-env.xml \ - && cp jans-client-api.war ${JETTY_BASE}/jans-client-api/webapps/jans-client-api.war \ - && java -jar ${JETTY_HOME}/start.jar jetty.home=${JETTY_HOME} jetty.base=${JETTY_BASE}/jans-client-api --add-module=server,deploy,annotations,webapp,servlet,resources,http,http-forwarded,threadpool,jsp,websocket,logging/slf4j,logging-jetty \ - && rm -rf /tmp/jans-client-api.war /tmp/WEB-INF - -# ====== -# Python -# ====== - -COPY requirements.txt /app/requirements.txt -RUN python3 -m ensurepip \ - && pip3 install --no-cache-dir -U pip wheel \ - && pip3 install --no-cache-dir -r /app/requirements.txt \ - && pip3 uninstall -y pip wheel - -# ========== -# Prometheus -# ========== - -ARG PROMETHEUS_JAVAAGENT_VERSION=0.17.2 -COPY conf/prometheus-config.yaml /opt/prometheus/ -RUN mkdir -p /opt/prometheus \ - && wget -q https://repo1.maven.org/maven2/io/prometheus/jmx/jmx_prometheus_javaagent/${PROMETHEUS_JAVAAGENT_VERSION}/jmx_prometheus_javaagent-${PROMETHEUS_JAVAAGENT_VERSION}.jar -O /opt/prometheus/jmx_prometheus_javaagent.jar \ - && java -jar ${JETTY_HOME}/start.jar jetty.home=${JETTY_HOME} jetty.base=${JETTY_BASE}/jans-client-api --add-module=jmx,stats - -# ===================== -# jans-linux-setup sync -# ===================== - -ENV JANS_SOURCE_VERSION=8128244d16f212b9c687540ded6cb349abe4aafc -ARG JANS_SETUP_DIR=jans-linux-setup/jans_setup - -# note that as we're pulling from a monorepo (with multiple project in it) -# we are using partial-clone and sparse-checkout to get the jans-linux-setup code -RUN git clone --filter blob:none --no-checkout https://github.com/janssenproject/jans /tmp/jans \ - && cd /tmp/jans \ - && git sparse-checkout init --cone \ - && git checkout ${JANS_SOURCE_VERSION} \ - && git sparse-checkout set ${JANS_SETUP_DIR} - -RUN mkdir -p /app/static/rdbm /app/schema /app/templates/jans-client-api - -# sync static files and templates from linux-setup -RUN cd /tmp/jans \ - && cp ${JANS_SETUP_DIR}/static/rdbm/sql_data_types.json /app/static/rdbm/ \ - && cp ${JANS_SETUP_DIR}/static/rdbm/ldap_sql_data_type_mapping.json /app/static/rdbm/ \ - && cp ${JANS_SETUP_DIR}/static/rdbm/opendj_attributes_syntax.json /app/static/rdbm/ \ - && cp ${JANS_SETUP_DIR}/static/rdbm/sub_tables.json /app/static/rdbm/ \ - && cp ${JANS_SETUP_DIR}/schema/jans_schema.json /app/schema/ \ - && cp ${JANS_SETUP_DIR}/schema/custom_schema.json /app/schema/ \ - && cp ${JANS_SETUP_DIR}/schema/opendj_types.json /app/schema/ \ - && cp ${JANS_SETUP_DIR}/templates/jans-client-api/configuration.ldif /app/templates/jans-client-api/ \ - && cp ${JANS_SETUP_DIR}/templates/jans-client-api/dynamic-conf.json /app/templates/jans-client-api/ - -# ======= -# Cleanup -# ======= - -RUN apk del .build-deps && rm -rf /var/cache/apk/* /tmp/jans - -# ======= -# License -# ======= - -COPY LICENSE /licenses/LICENSE - -# ========== -# Config ENV -# ========== - -ENV CN_CONFIG_ADAPTER=consul \ - CN_CONFIG_CONSUL_HOST=localhost \ - CN_CONFIG_CONSUL_PORT=8500 \ - CN_CONFIG_CONSUL_CONSISTENCY=stale \ - CN_CONFIG_CONSUL_SCHEME=http \ - CN_CONFIG_CONSUL_VERIFY=false \ - CN_CONFIG_CONSUL_CACERT_FILE=/etc/certs/consul_ca.crt \ - CN_CONFIG_CONSUL_CERT_FILE=/etc/certs/consul_client.crt \ - CN_CONFIG_CONSUL_KEY_FILE=/etc/certs/consul_client.key \ - CN_CONFIG_CONSUL_TOKEN_FILE=/etc/certs/consul_token \ - CN_CONFIG_CONSUL_NAMESPACE=jans \ - CN_CONFIG_KUBERNETES_NAMESPACE=default \ - CN_CONFIG_KUBERNETES_CONFIGMAP=jans \ - CN_CONFIG_KUBERNETES_USE_KUBE_CONFIG=false \ - CN_CONFIG_GOOGLE_SECRET_VERSION_ID=latest \ - CN_CONFIG_GOOGLE_SECRET_NAME_PREFIX=jans - -# ========== -# Secret ENV -# ========== - -ENV CN_SECRET_ADAPTER=vault \ - CN_SECRET_VAULT_SCHEME=http \ - CN_SECRET_VAULT_HOST=localhost \ - CN_SECRET_VAULT_PORT=8200 \ - CN_SECRET_VAULT_VERIFY=false \ - CN_SECRET_VAULT_ROLE_ID_FILE=/etc/certs/vault_role_id \ - CN_SECRET_VAULT_SECRET_ID_FILE=/etc/certs/vault_secret_id \ - CN_SECRET_VAULT_CERT_FILE=/etc/certs/vault_client.crt \ - CN_SECRET_VAULT_KEY_FILE=/etc/certs/vault_client.key \ - CN_SECRET_VAULT_CACERT_FILE=/etc/certs/vault_ca.crt \ - CN_SECRET_VAULT_NAMESPACE=jans \ - CN_SECRET_KUBERNETES_NAMESPACE=default \ - CN_SECRET_KUBERNETES_SECRET=jans \ - CN_SECRET_KUBERNETES_USE_KUBE_CONFIG=false \ - CN_SECRET_GOOGLE_SECRET_MANAGER_PASSPHRASE=secret \ - CN_SECRET_GOOGLE_SECRET_VERSION_ID=latest \ - CN_SECRET_GOOGLE_SECRET_NAME_PREFIX=jans - -# =============== -# Persistence ENV -# =============== - -ENV CN_PERSISTENCE_TYPE=ldap \ - CN_HYBRID_MAPPING="{}" \ - CN_LDAP_URL=localhost:1636 \ - CN_LDAP_USE_SSL=true \ - CN_COUCHBASE_URL=localhost \ - CN_COUCHBASE_USER=admin \ - CN_COUCHBASE_CERT_FILE=/etc/certs/couchbase.crt \ - CN_COUCHBASE_PASSWORD_FILE=/etc/jans/conf/couchbase_password \ - CN_COUCHBASE_CONN_TIMEOUT=10000 \ - CN_COUCHBASE_CONN_MAX_WAIT=20000 \ - CN_COUCHBASE_SCAN_CONSISTENCY=not_bounded \ - CN_COUCHBASE_BUCKET_PREFIX=jans \ - CN_COUCHBASE_TRUSTSTORE_ENABLE=true \ - CN_COUCHBASE_KEEPALIVE_INTERVAL=30000 \ - CN_COUCHBASE_KEEPALIVE_TIMEOUT=2500 - -# ============== -# client-api ENV -# ============== - -ENV CN_CLIENT_API_APPLICATION_CERT_CN="" \ - CN_CLIENT_API_CERT_CN=localhost \ - CN_CLIENT_API_BIND_IP_ADDRESSES="*" - -# =========== -# Generic ENV -# =========== - -ENV CN_MAX_RAM_PERCENTAGE=75.0 \ - CN_WAIT_MAX_TIME=300 \ - CN_WAIT_SLEEP_DURATION=10 \ - CN_JAVA_OPTIONS="" \ - GOOGLE_PROJECT_ID="" \ - GOOGLE_APPLICATION_CREDENTIALS=/etc/jans/conf/google-credentials.json - -# ==== -# misc -# ==== - -LABEL name="janssenproject/client-api" \ - maintainer="Janssen Project " \ - vendor="Janssen Project" \ - version="1.0.3" \ - release="dev" \ - summary="Janssen Client API" \ - description="Client software to secure apps with OAuth 2.0, OpenID Connect, and UMA" - -RUN mkdir -p /etc/certs /etc/jans/conf ${JETTY_BASE}/jans-client-api/logs -COPY jetty/log4j2.xml ${JETTY_BASE}/jans-client-api/resources/ -COPY scripts /app/scripts -COPY conf/*.tmpl /app/templates/ -RUN chmod +x /app/scripts/entrypoint.sh - -# create non-root user -RUN adduser -s /bin/sh -D -G root -u 1000 jetty - -# adjust ownership and permission -RUN chmod -R g=u ${JETTY_BASE}/jans-client-api/resources \ - && chmod -R g=u ${JETTY_BASE}/jans-client-api/logs \ - && chmod -R g=u /etc/certs \ - && chmod -R g=u /etc/jans \ - && chmod 664 /usr/java/latest/jre/lib/security/cacerts \ - && chmod 664 /opt/jetty/etc/jetty.xml \ - && chmod 664 /opt/jetty/etc/webdefault.xml - -USER 1000 - -ENTRYPOINT ["tini", "-e", "143", "-g", "--"] -CMD ["sh", "/app/scripts/entrypoint.sh"] diff --git a/docker-jans-client-api/LICENSE b/docker-jans-client-api/LICENSE deleted file mode 100644 index 840be9e0074..00000000000 --- a/docker-jans-client-api/LICENSE +++ /dev/null @@ -1,203 +0,0 @@ - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright 2020 Gluu, Inc. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - -© 2020 Gluu, Inc. diff --git a/docker-jans-client-api/Makefile b/docker-jans-client-api/Makefile deleted file mode 100644 index a0b2d65d377..00000000000 --- a/docker-jans-client-api/Makefile +++ /dev/null @@ -1,18 +0,0 @@ -CN_VERSION?=1.0.3 -IMAGE_NAME=janssenproject/client-api -UNSTABLE_VERSION?=dev - -.PHONY: test clean all build-dev trivy-scan grype-scan -.DEFAULT_GOAL := build-dev - -build-dev: - @echo "[I] Building Docker image ${IMAGE_NAME}:${CN_VERSION}_${UNSTABLE_VERSION}" - @docker build --rm --force-rm -t ${IMAGE_NAME}:${CN_VERSION}_${UNSTABLE_VERSION} . - -trivy-scan: - @echo "[I] Scanning Docker image ${IMAGE_NAME}:${CN_VERSION}_${UNSTABLE_VERSION} using trivy" - @trivy image --security-checks vuln ${IMAGE_NAME}:${CN_VERSION}_${UNSTABLE_VERSION} - -grype-scan: - @echo "[I] Scanning Docker image ${IMAGE_NAME}:${CN_VERSION}_${UNSTABLE_VERSION} using grype" - @grype -v ${IMAGE_NAME}:${CN_VERSION}_${UNSTABLE_VERSION} diff --git a/docker-jans-client-api/README.md b/docker-jans-client-api/README.md deleted file mode 100644 index e2d9f828631..00000000000 --- a/docker-jans-client-api/README.md +++ /dev/null @@ -1,146 +0,0 @@ -# Overview - -Docker image packaging for client-api. - -## Versions - -See [Releases](https://github.com/JanssenProject/docker-jans-client-api/releases) for stable versions. -For bleeding-edge/unstable version, use `janssenproject/client-api`. - -## Environment Variables - -The following environment variables are supported by the container: - -- `CN_CONFIG_ADAPTER`: The config backend adapter, can be `consul` (default) or `kubernetes`. -- `CN_CONFIG_CONSUL_HOST`: hostname or IP of Consul (default to `localhost`). -- `CN_CONFIG_CONSUL_PORT`: port of Consul (default to `8500`). -- `CN_CONFIG_CONSUL_CONSISTENCY`: Consul consistency mode (choose one of `default`, `consistent`, or `stale`). Default to `stale` mode. -- `CN_CONFIG_CONSUL_SCHEME`: supported Consul scheme (`http` or `https`). -- `CN_CONFIG_CONSUL_VERIFY`: whether to verify cert or not (default to `false`). -- `CN_CONFIG_CONSUL_CACERT_FILE`: path to Consul CA cert file (default to `/etc/certs/consul_ca.crt`). This file will be used if it exists and `CN_CONFIG_CONSUL_VERIFY` set to `true`. -- `CN_CONFIG_CONSUL_CERT_FILE`: path to Consul cert file (default to `/etc/certs/consul_client.crt`). -- `CN_CONFIG_CONSUL_KEY_FILE`: path to Consul key file (default to `/etc/certs/consul_client.key`). -- `CN_CONFIG_CONSUL_TOKEN_FILE`: path to file contains ACL token (default to `/etc/certs/consul_token`). -- `CN_CONFIG_KUBERNETES_NAMESPACE`: Kubernetes namespace (default to `default`). -- `CN_CONFIG_KUBERNETES_CONFIGMAP`: Kubernetes configmaps name (default to `jans`). -- `CN_CONFIG_KUBERNETES_USE_KUBE_CONFIG`: Load credentials from `$HOME/.kube/config`, only useful for non-container environment (default to `false`). -- `CN_CONFIG_GOOGLE_SECRET_VERSION_ID`: Janssen configuration secret version ID in Google Secret Manager. Defaults to `latest`, which is recommended. -- `CN_CONFIG_GOOGLE_SECRET_NAME_PREFIX`: Prefix for Janssen configuration secret in Google Secret Manager. Defaults to `jans`. If left intact `jans-configuration` secret will be created. -- `CN_SECRET_ADAPTER`: The secrets' adapter, can be `vault` (default), `kubernetes`, or `google`. -- `CN_SECRET_VAULT_SCHEME`: supported Vault scheme (`http` or `https`). -- `CN_SECRET_VAULT_HOST`: hostname or IP of Vault (default to `localhost`). -- `CN_SECRET_VAULT_PORT`: port of Vault (default to `8200`). -- `CN_SECRET_VAULT_VERIFY`: whether to verify cert or not (default to `false`). -- `CN_SECRET_VAULT_ROLE_ID_FILE`: path to file contains Vault AppRole role ID (default to `/etc/certs/vault_role_id`). -- `CN_SECRET_VAULT_SECRET_ID_FILE`: path to file contains Vault AppRole secret ID (default to `/etc/certs/vault_secret_id`). -- `CN_SECRET_VAULT_CERT_FILE`: path to Vault cert file (default to `/etc/certs/vault_client.crt`). -- `CN_SECRET_VAULT_KEY_FILE`: path to Vault key file (default to `/etc/certs/vault_client.key`). -- `CN_SECRET_VAULT_CACERT_FILE`: path to Vault CA cert file (default to `/etc/certs/vault_ca.crt`). This file will be used if it exists and `CN_SECRET_VAULT_VERIFY` set to `true`. -- `CN_SECRET_KUBERNETES_NAMESPACE`: Kubernetes namespace (default to `default`). -- `CN_SECRET_KUBERNETES_SECRET`: Kubernetes secrets name (default to `jans`). -- `CN_SECRET_KUBERNETES_USE_KUBE_CONFIG`: Load credentials from `$HOME/.kube/config`, only useful for non-container environment (default to `false`). -- `CN_SECRET_GOOGLE_SECRET_VERSION_ID`: Janssen secret version ID in Google Secret Manager. Defaults to `latest`, which is recommended. -- `CN_SECRET_GOOGLE_SECRET_MANAGER_PASSPHRASE`: Passphrase for Janssen secret in Google Secret Manager. This is recommended to be changed and defaults to `secret`. -- `CN_SECRET_GOOGLE_SECRET_NAME_PREFIX`: Prefix for Janssen secret in Google Secret Manager. Defaults to `jans`. If left `jans-secret` secret will be created. -- `CN_WAIT_MAX_TIME`: How long the startup "health checks" should run (default to `300` seconds). -- `CN_WAIT_SLEEP_DURATION`: Delay between startup "health checks" (default to `10` seconds). -- `CN_MAX_RAM_PERCENTAGE`: Value passed to Java option `-XX:MaxRAMPercentage`. -- `CN_PERSISTENCE_TYPE`: Persistence backend being used (one of `ldap`, `couchbase`, or `hybrid`; default to `ldap`). -- `CN_HYBRID_MAPPING`: Specify data mapping for each persistence (default to `"{}"`). Note this environment only takes effect when `CN_PERSISTENCE_TYPE` is set to `hybrid`. See [hybrid mapping](#hybrid-mapping) section for details. -- `CN_LDAP_URL`: Address and port of LDAP server (default to `localhost:1636`). -- `CN_LDAP_USE_SSL`: Whether to use SSL connection to LDAP server (default to `true`). -- `CN_COUCHBASE_URL`: Address of Couchbase server (default to `localhost`). -- `CN_COUCHBASE_USER`: Username of Couchbase server (default to `admin`). -- `CN_COUCHBASE_CERT_FILE`: Couchbase root certificate location (default to `/etc/certs/couchbase.crt`). -- `CN_COUCHBASE_PASSWORD_FILE`: Path to file contains Couchbase password (default to `/etc/jans/conf/couchbase_password`). -- `CN_COUCHBASE_CONN_TIMEOUT`: Connect timeout used when a bucket is opened (default to `10000` milliseconds). -- `CN_COUCHBASE_CONN_MAX_WAIT`: Maximum time to wait before retrying connection (default to `20000` milliseconds). -- `CN_COUCHBASE_SCAN_CONSISTENCY`: Default scan consistency; one of `not_bounded`, `request_plus`, or `statement_plus` (default to `not_bounded`). -- `CN_COUCHBASE_BUCKET_PREFIX`: Prefix for Couchbase buckets (default to `jans`). -- `CN_COUCHBASE_TRUSTSTORE_ENABLE`: Enable truststore for encrypted Couchbase connection (default to `true`). -- `CN_COUCHBASE_KEEPALIVE_INTERVAL`: Keep-alive interval for Couchbase connection (default to `30000` milliseconds). -- `CN_COUCHBASE_KEEPALIVE_TIMEOUT`: Keep-alive timeout for Couchbase connection (default to `2500` milliseconds). -- `CN_CLIENT_API_CERT_CN`: CommonName used in certificate subject. -- `CN_CLIENT_API_BIND_IP_ADDRESSES`: A comma-separated host/IP address that are allowed to access client-api (default to `*`). -- `CN_JAVA_OPTIONS`: Java options passed to entrypoint, i.e. `-Xmx1024m` (default to empty-string). -- `GOOGLE_PROJECT_ID`: Google Project ID (default to empty string). Used when `CN_CONFIG_ADAPTER` or `CN_SECRET_ADAPTER` set to `google`. -- `GOOGLE_APPLICATION_CREDENTIALS`: Path to Google credentials JSON file (default to `/etc/jans/conf/google-credentials.json`). Used when `CN_CONFIG_ADAPTER` or `CN_SECRET_ADAPTER` set to `google`. -- `CN_CLIENT_API_APP_LOGGERS`: Custom logging configuration in JSON-string format with hash type (see [Configure app loggers](#configure-app-loggers) section for details). -- `CN_PROMETHEUS_PORT`: Port used by Prometheus JMX agent (default to empty string). To enable Prometheus JMX agent, set the value to a number. See [Exposing metrics](#exposing-metrics) for details. - -### Configure app loggers - -App loggers can be configured to define where the logs will be redirected and what is the level the logs should be displayed. - -Supported redirect target: - -- `STDOUT` -- `FILE` - -Supported level: - -- `FATAL` -- `ERROR` -- `WARN` -- `INFO` -- `DEBUG` -- `TRACE` - -The following key-value pairs are the defaults: - -```json -{ - "client_api_log_target": "STDOUT", - "client_api_log_level": "INFO", - "persistence_log_target": "FILE", - "persistence_log_level": "INFO", - "persistence_duration_log_target": "FILE", - "persistence_duration_log_level": "INFO", - "ldap_stats_log_target": "FILE", - "ldap_stats_log_level": "INFO", - "script_log_target": "FILE", - "script_log_level": "INFO" -} -``` - -### Hybrid mapping - -As per v1.0.1, hybrid persistence supports all available persistence types. To configure hybrid persistence and its data mapping, follow steps below: - -1. Set `CN_PERSISTENCE_TYPE` environment variable to `hybrid` - -2. Set `CN_HYBRID_MAPPING` with the following format: - - ``` - { - "default": "", - "user": "", - "site": "", - "cache": "", - "token": "", - "session": "", - } - ``` - - Example: - - ``` - { - "default": "sql", - "user": "spanner", - "site": "ldap", - "cache": "sql", - "token": "couchbase", - "session": "spanner", - } - ``` - -### Exposing metrics - -As per v1.0.1, certain metrics can be exposed via Prometheus JMX exporter. -To expose the metrics, set the `CN_PROMETHEUS_PORT` environment variable, i.e. `CN_PROMETHEUS_PORT=9093`. -Afterwards, metrics can be scraped by Prometheus or accessed manually by making request to `/metrics` URL, -i.e. `http://container:9093/metrics`. - -Note that Prometheus JMX exporter uses pre-defined config file (see `conf/prometheus-config.yaml`). -To customize the config, mount custom config file to `/opt/prometheus/prometheus-config.yaml` inside the container. diff --git a/docker-jans-client-api/conf/jans-couchbase.properties.tmpl b/docker-jans-client-api/conf/jans-couchbase.properties.tmpl deleted file mode 100644 index d5caad62951..00000000000 --- a/docker-jans-client-api/conf/jans-couchbase.properties.tmpl +++ /dev/null @@ -1,64 +0,0 @@ -servers: %(hostname)s - -# The connect timeout is used when a Bucket is opened. -# If you feel the urge to change this value to something higher, there is a good chance that your network is not properly set up. -# Connecting to the server should in practice not take longer than a second on a reasonably fast network. -# Default SDK connectTimeout is 10s -connection.connect-timeout: %(couchbase_conn_timeout)s - -# Enable/disable DNS SRV lookup for the bootstrap nodes -# Default dnsSrvEnabled is true -connection.dns.use-lookup: false - -# Key/value timeout -# Default SDK kvTimeout is 2500ms -connection.kv-timeout: 5000 - -# Query timeout -# Default SDK queryTimeout is 75s -connection.query-timeout: 75000 - -# Configures whether mutation tokens will be returned from the server for all mutation operations -# Default mutationTokensEnabled is true -# connection.mutation-tokens-enabled: false - -# At startup when connection error is occurred persistence layer can make another attempt to open buckets. -# Before make next try it pause process for 5 second. If after that total connection time is less than specified -# in property above new attempt will be executed -connection.connection-max-wait-time: %(couchbase_conn_max_wait)s - -# Default scan consistency. Possible values are: not_bounded, request_plus, statement_plus -connection.scan-consistency: %(couchbase_scan_consistency)s - -# Disable scan consistency in queries. Default value: false -# connection.ignore-attribute-scan-consistency: true - -# Try to execute query with scan consitency specified in connection.scan-consistency first. -# On failure execute query again with scan consistency specified in attributes defintions. Default value: true -# connection.attempt-without-attribute-scan-consistency: false - -# Enable scopes support. Default value: false -# connection.enable-scope-support: true - -# Disable mapping to short attribute names. Default value: false -# connection.disable-attribute-mapping: true - -auth.userName: %(couchbase_server_user)s -auth.userPassword: %(encoded_couchbase_server_pw)s - -buckets: %(couchbase_buckets)s - -bucket.default: %(default_bucket)s -%(couchbase_mappings)s - -password.encryption.method: %(encryption_method)s - -ssl.trustStore.enable: %(ssl_enabled)s -ssl.trustStore.file: %(couchbaseTrustStoreFn)s -ssl.trustStore.pin: %(encoded_couchbaseTrustStorePass)s -ssl.trustStore.type: pkcs12 - -tls.enable: false - -binaryAttributes=objectGUID -certificateAttributes=userCertificate diff --git a/docker-jans-client-api/conf/jans-ldap.properties.tmpl b/docker-jans-client-api/conf/jans-ldap.properties.tmpl deleted file mode 100644 index a7ec401fe75..00000000000 --- a/docker-jans-client-api/conf/jans-ldap.properties.tmpl +++ /dev/null @@ -1,28 +0,0 @@ -bindDN: %(ldap_binddn)s -bindPassword: %(encoded_ox_ldap_pw)s -servers: %(ldap_hostname)s:%(ldaps_port)s - -useSSL: %(ssl_enabled)s -ssl.trustStoreFile: %(ldapTrustStoreFn)s -ssl.trustStorePin: %(encoded_ldapTrustStorePass)s -ssl.trustStoreFormat: pkcs12 - -maxconnections: 40 - -# Max wait 20 seconds -connection.max-wait-time-millis=20000 - -# Force to recreate polled connections after 30 minutes -connection.max-age-time-millis=1800000 - -# Invoke connection health check after checkout it from pool -connection-pool.health-check.on-checkout.enabled=false - -# Interval to check connections in pool. Value is 3 minutes. Not used when onnection-pool.health-check.on-checkout.enabled=true -connection-pool.health-check.interval-millis=180000 - -# How long to wait during connection health check. Max wait 20 seconds -connection-pool.health-check.max-response-time-millis=20000 - -binaryAttributes=objectGUID -certificateAttributes=userCertificate diff --git a/docker-jans-client-api/conf/jans-spanner.properties.tmpl b/docker-jans-client-api/conf/jans-spanner.properties.tmpl deleted file mode 100644 index 73db25b7d54..00000000000 --- a/docker-jans-client-api/conf/jans-spanner.properties.tmpl +++ /dev/null @@ -1,30 +0,0 @@ -connection.project=%(spanner_project)s -connection.instance=%(spanner_instance)s -connection.database=%(spanner_database)s - -# Prefix connection.client-property.key=value will be coverterd to key=value -# This is reserved for future usage -#connection.client-property=clientPropertyValue - -# spanner creds or emulator -%(spanner_creds)s - -# Password hash method -password.encryption.method=SSHA-256 - -# Connection pool size -#connection.pool.max-sessions=400 -#connection.pool.min-sessions=100 -#connection.pool.inc-step=25 - -# Max time needed to create connection pool in milliseconds -connection.pool.create-max-wait-time-millis=20000 - -# Maximum allowed statement result set size -statement.limit.default-maximum-result-size=1000 - -# Maximum allowed delete statement result set size -statement.limit.maximum-result-delete-size=10000 - -binaryAttributes=objectGUID -certificateAttributes=userCertificate diff --git a/docker-jans-client-api/conf/jans-sql.properties.tmpl b/docker-jans-client-api/conf/jans-sql.properties.tmpl deleted file mode 100644 index fdcadc0d61f..00000000000 --- a/docker-jans-client-api/conf/jans-sql.properties.tmpl +++ /dev/null @@ -1,37 +0,0 @@ -db.schema.name=%(rdbm_db)s - -connection.uri=jdbc:%(rdbm_type)s://%(rdbm_host)s:%(rdbm_port)s/%(rdbm_db)s?enabledTLSProtocols=TLSv1.2 - -connection.driver-property.serverTimezone=%(server_time_zone)s -# Prefix connection.driver-property.key=value will be coverterd to key=value JDBC driver properties -#connection.driver-property.driverProperty=driverPropertyValue - -#connection.driver-property.useServerPrepStmts=false -connection.driver-property.cachePrepStmts=false -connection.driver-property.cacheResultSetMetadata=true -connection.driver-property.metadataCacheSize=500 -#connection.driver-property.prepStmtCacheSize=500 -#connection.driver-property.prepStmtCacheSqlLimit=1024 - -auth.userName=%(rdbm_user)s -auth.userPassword=%(rdbm_password_enc)s - -# Password hash method -password.encryption.method=SSHA-256 - -# Connection pool size -connection.pool.max-total=40 -connection.pool.max-idle=15 -connection.pool.min-idle=5 - -# Max time needed to create connection pool in milliseconds -connection.pool.create-max-wait-time-millis=20000 - -# Max wait 20 seconds -connection.pool.max-wait-time-millis=20000 - -# Allow to evict connection in pool after 30 minutes -connection.pool.min-evictable-idle-time-millis=1800000 - -binaryAttributes=objectGUID -certificateAttributes=userCertificate diff --git a/docker-jans-client-api/conf/jans.properties.tmpl b/docker-jans-client-api/conf/jans.properties.tmpl deleted file mode 100644 index 1b5a56bffeb..00000000000 --- a/docker-jans-client-api/conf/jans.properties.tmpl +++ /dev/null @@ -1,11 +0,0 @@ -persistence.type=%(persistence_type)s - -jansAuth_ConfigurationEntryDN=ou=jans-auth,ou=configuration,o=jans -fido2_ConfigurationEntryDN=ou=jans-fido2,ou=configuration,o=jans -scim_ConfigurationEntryDN=ou=jans-scim,ou=configuration,o=jans -configApi_ConfigurationEntryDN=ou=jans-config-api,ou=configuration,o=jans -clientApi_ConfigurationEntryDN=ou=jans-client-api,ou=configuration,o=jans - -certsDir=/etc/certs -confDir= -pythonModulesDir=/opt/jans/python/libs:/opt/jython/Lib/site-packages diff --git a/docker-jans-client-api/conf/prometheus-config.yaml b/docker-jans-client-api/conf/prometheus-config.yaml deleted file mode 100644 index 6e8a2583872..00000000000 --- a/docker-jans-client-api/conf/prometheus-config.yaml +++ /dev/null @@ -1,10 +0,0 @@ ---- -startDelaySeconds: 0 -ssl: false -lowercaseOutputName: true -lowercaseOutputLabelNames: true -whitelistObjectNames: ["org.eclipse.jetty.server.handler:*"] -rules: - - pattern: ".*xx" - - pattern: ".*requests" - - pattern: ".*requestTimeTotal" diff --git a/docker-jans-client-api/conf/salt.tmpl b/docker-jans-client-api/conf/salt.tmpl deleted file mode 100644 index ee6c2c330e3..00000000000 --- a/docker-jans-client-api/conf/salt.tmpl +++ /dev/null @@ -1 +0,0 @@ -encodeSalt = %(encode_salt)s diff --git a/docker-jans-client-api/jetty/jans-client-api.xml b/docker-jans-client-api/jetty/jans-client-api.xml deleted file mode 100644 index 9e4ded669fa..00000000000 --- a/docker-jans-client-api/jetty/jans-client-api.xml +++ /dev/null @@ -1,11 +0,0 @@ - - - - - /jans-client-api - - /jans-client-api.war - - true - - diff --git a/docker-jans-client-api/jetty/jetty-env.xml b/docker-jans-client-api/jetty/jetty-env.xml deleted file mode 100644 index 228cae0b737..00000000000 --- a/docker-jans-client-api/jetty/jetty-env.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - - - - - BeanManager - - - - javax.enterprise.inject.spi.BeanManager - org.jboss.weld.resources.ManagerObjectFactory - - - - - - diff --git a/docker-jans-client-api/jetty/log4j2.xml b/docker-jans-client-api/jetty/log4j2.xml deleted file mode 100644 index db469a7162b..00000000000 --- a/docker-jans-client-api/jetty/log4j2.xml +++ /dev/null @@ -1,113 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/docker-jans-client-api/requirements.txt b/docker-jans-client-api/requirements.txt deleted file mode 100644 index 936bcfcc1bf..00000000000 --- a/docker-jans-client-api/requirements.txt +++ /dev/null @@ -1,5 +0,0 @@ -# pinned to py3-grpcio version to avoid failure on native extension build -grpcio==1.41.0 -ruamel.yaml==0.16.10 -libcst<0.4 -git+https://github.com/JanssenProject/jans@36125fe65c5f20af7a06f5cb96743cf60fec3d06#egg=jans-pycloudlib&subdirectory=jans-pycloudlib diff --git a/docker-jans-client-api/scripts/bootstrap.py b/docker-jans-client-api/scripts/bootstrap.py deleted file mode 100644 index 78e4e1f51f5..00000000000 --- a/docker-jans-client-api/scripts/bootstrap.py +++ /dev/null @@ -1,369 +0,0 @@ -import json -import logging.config -import os -import re -from functools import cached_property -from string import Template - -from jans.pycloudlib import get_manager -from jans.pycloudlib.persistence import render_couchbase_properties -from jans.pycloudlib.persistence import render_base_properties -from jans.pycloudlib.persistence import render_hybrid_properties -from jans.pycloudlib.persistence import render_ldap_properties -from jans.pycloudlib.persistence import render_salt -from jans.pycloudlib.persistence import sync_couchbase_truststore -from jans.pycloudlib.persistence import sync_ldap_truststore -from jans.pycloudlib.persistence import render_sql_properties -from jans.pycloudlib.persistence import render_spanner_properties -from jans.pycloudlib.persistence import CouchbaseClient -from jans.pycloudlib.persistence import LdapClient -from jans.pycloudlib.persistence import SpannerClient -from jans.pycloudlib.persistence import SqlClient -from jans.pycloudlib.persistence.utils import PersistenceMapper -from jans.pycloudlib.utils import cert_to_truststore -from jans.pycloudlib.utils import get_random_chars -from jans.pycloudlib.utils import exec_cmd -from jans.pycloudlib.utils import generate_ssl_certkey -from jans.pycloudlib.utils import generate_base64_contents - -from settings import LOGGING_CONFIG - -logging.config.dictConfig(LOGGING_CONFIG) -logger = logging.getLogger("entrypoint") - -manager = get_manager() - - -def get_web_cert(): - if not os.path.isfile("/etc/certs/web_https.crt"): - manager.secret.to_file("ssl_cert", "/etc/certs/web_https.crt") - - cert_to_truststore( - "web_https", - "/etc/certs/web_https.crt", - "/usr/java/latest/jre/lib/security/cacerts", - "changeit", - ) - - -def generate_keystore(cert_file, key_file, keystore_file, keystore_password): - out, err, code = exec_cmd( - "openssl pkcs12 -export -name client-api " - f"-out {keystore_file} " - f"-inkey {key_file} " - f"-in {cert_file} " - f"-passout pass:{keystore_password}" - ) - assert code == 0, "Failed to generate application keystore; reason={}".format(err.decode()) - - -class Connector: - def __init__(self, manager): - self.manager = manager - - @property - def cert_file(self): - return "/etc/certs/client_api.crt" - - @property - def key_file(self): - return "/etc/certs/client_api.key" - - @property - def keystore_file(self): - return "/etc/certs/client_api.jks" - - @property - def cert_cn(self): - # CN_CLIENT_API_APPLICATION_CERT_CN is deprecated, but we keep it as backward-compat - legacy_cn = os.environ.get("CN_CLIENT_API_APPLICATION_CERT_CN", "") - if legacy_cn: - return legacy_cn - return os.environ.get("CN_CLIENT_API_CERT_CN", "localhost") - - def sync_x509(self): - cert = self.manager.secret.get("client_api_cert") - key = self.manager.secret.get("client_api_key") - - if cert and key: - self.manager.secret.to_file("client_api_cert", self.cert_file) - self.manager.secret.to_file("client_api_key", self.key_file) - else: - generate_ssl_certkey( - "client_api", - self.manager.config.get("admin_email"), - self.manager.config.get("hostname"), - self.manager.config.get("orgName"), - self.manager.config.get("country_code"), - self.manager.config.get("state"), - self.manager.config.get("city"), - extra_dns=[self.cert_cn], - ) - # save cert and key to secrets for later use - self.manager.secret.from_file("client_api_cert", self.cert_file) - self.manager.secret.from_file("client_api_key", self.key_file) - - def get_keystore_password(self): - password = manager.secret.get("client_api_keystore_password") - - if not password: - password = get_random_chars() - manager.secret.set("client_api_keystore_password", password) - return password - - def sync_keystore(self): - jks = self.manager.secret.get("client_api_jks_base64") - - if jks: - self.manager.secret.to_file( - "client_api_jks_base64", self.keystore_file, decode=True, binary_mode=True, - ) - else: - generate_keystore(self.cert_file, self.key_file, self.keystore_file, self.get_keystore_password()) - # save keystore to secrets for later use - self.manager.secret.from_file( - "client_api_jks_base64", self.keystore_file, encode=True, binary_mode=True, - ) - - def sync(self): - self.sync_x509() - self.sync_keystore() - - -def main(): - persistence_type = os.environ.get("CN_PERSISTENCE_TYPE", "ldap") - - render_salt(manager, "/app/templates/salt.tmpl", "/etc/jans/conf/salt") - render_base_properties("/app/templates/jans.properties.tmpl", "/etc/jans/conf/jans.properties") - - mapper = PersistenceMapper() - persistence_groups = mapper.groups() - - if persistence_type == "hybrid": - render_hybrid_properties("/etc/jans/conf/jans-hybrid.properties") - - if "ldap" in persistence_groups: - render_ldap_properties( - manager, - "/app/templates/jans-ldap.properties.tmpl", - "/etc/jans/conf/jans-ldap.properties", - ) - sync_ldap_truststore(manager) - - if "couchbase" in persistence_groups: - render_couchbase_properties( - manager, - "/app/templates/jans-couchbase.properties.tmpl", - "/etc/jans/conf/jans-couchbase.properties", - ) - sync_couchbase_truststore(manager) - - if "sql" in persistence_groups: - render_sql_properties( - manager, - "/app/templates/jans-sql.properties.tmpl", - "/etc/jans/conf/jans-sql.properties", - ) - - if "spanner" in persistence_groups: - render_spanner_properties( - manager, - "/app/templates/jans-spanner.properties.tmpl", - "/etc/jans/conf/jans-spanner.properties", - ) - - get_web_cert() - - modify_jetty_xml() - modify_webdefault_xml() - configure_logging() - - connector = Connector(manager) - connector.sync() - - persistence_setup = PersistenceSetup(manager, connector) - persistence_setup.import_ldif_files() - - -def configure_logging(): - # defaults - config = { - "client_api_log_target": "STDOUT", - "client_api_log_level": "INFO", - "persistence_log_target": "FILE", - "persistence_log_level": "INFO", - "persistence_duration_log_target": "FILE", - "persistence_duration_log_level": "INFO", - "ldap_stats_log_target": "FILE", - "ldap_stats_log_level": "INFO", - "script_log_target": "FILE", - "script_log_level": "INFO" - } - - # pre-populate custom config; format is JSON string of ``dict`` - try: - custom_config = json.loads(os.environ.get("CN_CLIENT_API_APP_LOGGERS", "{}")) - except json.decoder.JSONDecodeError as exc: - logger.warning(f"Unable to load logging configuration from environment variable; reason={exc}; fallback to defaults") - custom_config = {} - - # ensure custom config is ``dict`` type - if not isinstance(custom_config, dict): - logger.warning("Invalid data type for CN_CLIENT_API_APP_LOGGERS; fallback to defaults") - custom_config = {} - - # list of supported levels; OFF is not supported - log_levels = ("FATAL", "ERROR", "WARN", "INFO", "DEBUG", "TRACE",) - - # list of supported outputs - log_targets = ("STDOUT", "FILE",) - - for k, v in custom_config.items(): - if k not in config: - continue - - if k.endswith("_log_level") and v not in log_levels: - logger.warning(f"Invalid {v} log level for {k}; fallback to defaults") - v = config[k] - - if k.endswith("_log_target") and v not in log_targets: - logger.warning(f"Invalid {v} log output for {k}; fallback to defaults") - v = config[k] - - # update the config - config[k] = v - - # mapping between the ``log_target`` value and their appenders - file_aliases = { - "client_api_log_target": "FILE", - "persistence_log_target": "JANS_CLIENTAPI_PERSISTENCE_FILE", - "persistence_duration_log_target": "JANS_CLIENTAPI_PERSISTENCE_DURATION_FILE", - "ldap_stats_log_target": "JANS_CLIENTAPI_PERSISTENCE_LDAP_STATISTICS_FILE", - "script_log_target": "JANS_CLIENTAPI_SCRIPT_LOG_FILE", - } - - for key, value in config.items(): - if not key.endswith("_target"): - continue - - if value == "STDOUT": - config[key] = "Console" - else: - config[key] = file_aliases[key] - - logfile = "/opt/jans/jetty/jans-client-api/resources/log4j2.xml" - with open(logfile) as f: - txt = f.read() - - tmpl = Template(txt) - with open(logfile, "w") as f: - f.write(tmpl.safe_substitute(config)) - - -def modify_jetty_xml(): - fn = "/opt/jetty/etc/jetty.xml" - with open(fn) as f: - txt = f.read() - - # disable contexts - updates = re.sub( - r'', - r'\n\t\t\t\t false\n\t\t\t ', - txt, - flags=re.DOTALL | re.M, - ) - - with open(fn, "w") as f: - f.write(updates) - - -def modify_webdefault_xml(): - fn = "/opt/jetty/etc/webdefault.xml" - with open(fn) as f: - txt = f.read() - - # disable dirAllowed - updates = re.sub( - r'(dirAllowed)(\s*)()true()', - r'\1\2\3false\4', - txt, - flags=re.DOTALL | re.M, - ) - - with open(fn, "w") as f: - f.write(updates) - - -class PersistenceSetup: - def __init__(self, manager, connector): - self.manager = manager - self.connector = connector - - client_classes = { - "ldap": LdapClient, - "couchbase": CouchbaseClient, - "spanner": SpannerClient, - "sql": SqlClient, - } - - # determine persistence type - mapper = PersistenceMapper() - self.persistence_type = mapper.mapping["default"] - - # determine persistence client - client_cls = client_classes.get(self.persistence_type) - self.client = client_cls(manager) - - def get_dynamic_conf(self, ctx): - with open("/app/templates/jans-client-api/dynamic-conf.json") as f: - txt = f.read() % ctx - - conf = json.loads(txt) - - ip_addresses = os.environ.get("CN_CLIENT_API_BIND_IP_ADDRESSES", "*") - conf["bindIpAddresses"] = [ - addr.strip() - for addr in ip_addresses.split(",") - if addr - ] - - persistence_type = os.environ.get("CN_PERSISTENCE_TYPE", "ldap") - conf["storageConfiguration"] = { - "baseDn": "o=jans", - "type": "/etc/jans/conf/jans.properties", - "salt": "/etc/jans/conf/salt", - "connection": f"/etc/jans/conf/jans-{persistence_type}.properties", - } - - # TODO: change loggingLevel? - return conf - - @cached_property - def ctx(self): - ctx = { - "client_api_keystore_fn": self.connector.keystore_file, - "client_api_keystore_pw": self.connector.get_keystore_password(), - "client_api_crypto_provider_fn": "/etc/certs/client-api-jwks.keystore", - "client_api_storage_type": "jans_server_configuration", - } - - dynamic_conf = json.dumps(self.get_dynamic_conf(ctx)) - ctx["client_api_dynamic_conf_base64"] = generate_base64_contents(dynamic_conf) - return ctx - - @cached_property - def ldif_files(self): - filenames = ["configuration.ldif"] - return [ - f"/app/templates/jans-client-api/{filename}" - for filename in filenames - ] - - def import_ldif_files(self): - for file_ in self.ldif_files: - logger.info(f"Importing {file_}") - self.client.create_from_ldif(file_, self.ctx) - - -if __name__ == "__main__": - main() diff --git a/docker-jans-client-api/scripts/entrypoint.sh b/docker-jans-client-api/scripts/entrypoint.sh deleted file mode 100644 index 939a6eb84ea..00000000000 --- a/docker-jans-client-api/scripts/entrypoint.sh +++ /dev/null @@ -1,39 +0,0 @@ -#!/bin/sh - -set -e - -get_prometheus_opt() { - prom_opt="" - - if [ -n "${CN_PROMETHEUS_PORT}" ]; then - prom_opt=" - -javaagent:/opt/prometheus/jmx_prometheus_javaagent.jar=${CN_PROMETHEUS_PORT}:/opt/prometheus/prometheus-config.yaml - " - fi - echo "${prom_opt}" -} - -python3 /app/scripts/wait.py -python3 /app/scripts/bootstrap.py - -# run jans-client-api -cd /opt/jans/jetty/jans-client-api - -# shellcheck disable=SC2086 -exec java \ - -server \ - -XX:+DisableExplicitGC \ - -XX:+UseContainerSupport \ - -XX:MaxRAMPercentage=$CN_MAX_RAM_PERCENTAGE \ - -Djava.net.preferIPv4Stack=true \ - -Djans.base=/etc/jans \ - -Dserver.base=/opt/jans/jetty/jans-client-api \ - -Dlog.base=/opt/jans/jetty/jans-client-api \ - -Djava.io.tmpdir=/tmp \ - -Dpython.home=/opt/jython \ - -Dlog4j2.configurationFile=resources/log4j2.xml \ - $(get_prometheus_opt) \ - ${CN_JAVA_OPTIONS} \ - -jar /opt/jetty/start.jar \ - jetty.deploy.scanInterval=0 \ - jetty.httpConfig.sendServerVersion=false diff --git a/docker-jans-client-api/scripts/settings.py b/docker-jans-client-api/scripts/settings.py deleted file mode 100644 index ae616d61a0e..00000000000 --- a/docker-jans-client-api/scripts/settings.py +++ /dev/null @@ -1,35 +0,0 @@ -LOGGING_CONFIG = { - "version": 1, - "formatters": { - "default": { - "format": "%(levelname)s - %(name)s - %(asctime)s - %(message)s", - }, - }, - "handlers": { - "console": { - "class": "logging.StreamHandler", - "formatter": "default", - }, - }, - "loggers": { - "jans.pycloudlib": { - "handlers": ["console"], - "level": "INFO", - "propagate": True, - }, - "entrypoint": { - "handlers": ["console"], - "level": "INFO", - "propagate": False, - }, - # "wait": { - # "handlers": ["console"], - # "level": "INFO", - # "propagate": False, - # }, - }, - # "root": { - # "level": "INFO", - # "handlers": ["console"], - # }, -} diff --git a/docker-jans-client-api/scripts/wait.py b/docker-jans-client-api/scripts/wait.py deleted file mode 100644 index 1e195e298e3..00000000000 --- a/docker-jans-client-api/scripts/wait.py +++ /dev/null @@ -1,34 +0,0 @@ -import logging.config -import os - -from jans.pycloudlib import get_manager -from jans.pycloudlib import wait_for -from jans.pycloudlib import wait_for_persistence -from jans.pycloudlib.validators import validate_persistence_type -from jans.pycloudlib.validators import validate_persistence_hybrid_mapping -from jans.pycloudlib.validators import validate_persistence_sql_dialect - -from settings import LOGGING_CONFIG - -logging.config.dictConfig(LOGGING_CONFIG) - - -def main(): - persistence_type = os.environ.get("CN_PERSISTENCE_TYPE", "ldap") - validate_persistence_type(persistence_type) - - if persistence_type == "hybrid": - validate_persistence_hybrid_mapping() - - if persistence_type == "sql": - sql_dialect = os.environ.get("CN_SQL_DB_DIALECT", "mysql") - validate_persistence_sql_dialect(sql_dialect) - - manager = get_manager() - deps = ["config", "secret"] - wait_for(manager, deps) - wait_for_persistence(manager) - - -if __name__ == "__main__": - main() diff --git a/docker-jans-client-api/version.txt b/docker-jans-client-api/version.txt deleted file mode 100644 index 446dec6fac7..00000000000 --- a/docker-jans-client-api/version.txt +++ /dev/null @@ -1 +0,0 @@ -1.0.2-1 diff --git a/docker-jans-configurator/README.md b/docker-jans-configurator/README.md index 6c1dbe9d787..c27b66626bf 100644 --- a/docker-jans-configurator/README.md +++ b/docker-jans-configurator/README.md @@ -80,7 +80,7 @@ The load command can be used either to generate or restore config and secret for - `auth_sig_keys`: space-separated key algorithm for signing (default to `RS256 RS384 RS512 ES256 ES384 ES512 PS256 PS384 PS512`) - `auth_enc_keys`: space-separated key algorithm for encryption (default to `RSA1_5 RSA-OAEP`) - - `optional_scopes`: list of scopes that will be used (supported scopes are `ldap`, `scim`, `fido2`, `client-api`, `couchbase`, `redis`, `sql`, `casa`; default to empty list) + - `optional_scopes`: list of scopes that will be used (supported scopes are `ldap`, `scim`, `fido2`, `couchbase`, `redis`, `sql`, `casa`; default to empty list) - `ldap_pw`: user's password to access LDAP database (only used if `optional_scopes` list contains `ldap` scope) - `sql_pw`: user's password to access SQL database (only used if `optional_scopes` list contains `sql` scope) - `couchbase_pw`: user's password to access Couchbase database (only used if `optional_scopes` list contains `couchbase` scope) diff --git a/docker-jans-configurator/scripts/parameter.py b/docker-jans-configurator/scripts/parameter.py index d503ed58d92..e6b81552d51 100644 --- a/docker-jans-configurator/scripts/parameter.py +++ b/docker-jans-configurator/scripts/parameter.py @@ -31,7 +31,6 @@ # these scopes are no longer needed; not removed for backward-compat "fido2", - "client-api", "casa", "scim", ) diff --git a/docker-jans-monolith/Dockerfile b/docker-jans-monolith/Dockerfile index 06b8596fbe7..2ba336c3557 100644 --- a/docker-jans-monolith/Dockerfile +++ b/docker-jans-monolith/Dockerfile @@ -73,7 +73,6 @@ ENV CN_HOSTNAME="demoexample.jans.io" \ CN_INSTALL_CONFIG_API="true" \ CN_INSTALL_SCIM="true" \ CN_INSTALL_FIDO2="true" \ - CN_INSTALL_CLIENT_API="true" \ MYSQL_DATABASE="jans" \ MYSQL_USER="jans" \ MYSQL_PASSWORD="" diff --git a/docker-jans-monolith/README.md b/docker-jans-monolith/README.md index b950533a0d3..8b6622bb170 100644 --- a/docker-jans-monolith/README.md +++ b/docker-jans-monolith/README.md @@ -2,7 +2,7 @@ **This image is for testing and development purposes only! Use Janssen [helm charts](../charts) for production setups** -Docker monolith image packaging for Janssen.This image packs janssen services including, the auth-server, client-api, config-api, fido2, and scim. +Docker monolith image packaging for Janssen.This image packs janssen services including, the auth-server, config-api, fido2, and scim. ## Versions @@ -26,7 +26,6 @@ The following environment variables are supported by the container: | `CN_INSTALL_CONFIG_API` | Installs the Config API service. | `true` | | `CN_INSTALL_SCIM` | Installs the SCIM API service. | `true` | | `CN_INSTALL_FIDO2` | Installs the FIDO2 API service. | `true` | -| `CN_INSTALL_CLIENT_API` | Installs the CLIENT API service. | `true` | | `MYSQL_DATABASE` | MySQL jans database. | `jans` | | `MYSQL_USER` | MySQL database user. | `jans` | | `MYSQL_PASSWORD` | MySQL database user password. | `1t5Fin3#security` | diff --git a/docker-jans-monolith/jans-mysql-compose.yml b/docker-jans-monolith/jans-mysql-compose.yml index e1371084ab6..3140c875c26 100644 --- a/docker-jans-monolith/jans-mysql-compose.yml +++ b/docker-jans-monolith/jans-mysql-compose.yml @@ -37,14 +37,12 @@ services: - CN_INSTALL_CONFIG_API=true - CN_INSTALL_SCIM=true - CN_INSTALL_FIDO2=true - - CN_INSTALL_CLIENT_API=true - MYSQL_DATABASE=jans - MYSQL_USER=jans - MYSQL_PASSWORD=1t5Fin3#security - MYSQL_HOST=mysql volumes: - ./jans-auth-custom:/opt/jans/jetty/jans-auth/custom - - ./jans-client-api-custom:/opt/jans/jetty/jans-client-api/custom - ./jans-config-api-custom:/opt/jans/jetty/jans-config-api/custom - ./jans-fido2-custom:/opt/jans/jetty/jans-fido2/custom - ./jans-scim-custom:/opt/jans/jetty/jans-scim/custom diff --git a/docker-jans-monolith/scripts/entrypoint.sh b/docker-jans-monolith/scripts/entrypoint.sh index e0bba577e71..23257a12fe9 100644 --- a/docker-jans-monolith/scripts/entrypoint.sh +++ b/docker-jans-monolith/scripts/entrypoint.sh @@ -15,7 +15,6 @@ set -e # INSTALL_LDAP # CN_INSTALL_CONFIG_API # CN_INSTALL_SCIM -# CN_INSTALL_CLIENT_API # MYSQL_DATABASE # MYSQL_USER # MYSQL_PASSWORD @@ -39,7 +38,6 @@ install_jans() { echo "install_config_api=""$([[ ${CN_INSTALL_CONFIG_API} == true ]] && echo True || echo False)" | tee -a setup.properties > /dev/null echo "install_scim_server=""$([[ ${CN_INSTALL_SCIM} == true ]] && echo True || echo False)" | tee -a setup.properties > /dev/null echo "installFido2=""$([[ ${CN_INSTALL_FIDO2} == true ]] && echo True || echo False)" | tee -a setup.properties > /dev/null - echo "install_client_api=""$([[ ${CN_INSTALL_CLIENT_API} == true ]] && echo True || echo False)" | tee -a setup.properties > /dev/null if [[ "${INSTALL_LDAP}" == "false" ]]; then echo "rdbm_install=2" | tee -a setup.properties > /dev/null @@ -72,7 +70,6 @@ check_installed_jans() { start_services() { /etc/init.d/apache2 start /opt/dist/scripts/jans-auth start - /opt/dist/scripts/jans-client-api start /opt/dist/scripts/jans-config-api start /opt/dist/scripts/jans-scim start /opt/dist/scripts/jans-fido2 start @@ -82,7 +79,6 @@ check_installed_jans start_services tail -f /opt/jans/jetty/jans-auth/logs/*.log \ --f /opt/jans/jetty/jans-client-api/logs/*.log \ -f /opt/jans/jetty/jans-config-api/logs/*.log \ -f /opt/jans/jetty/jans-fido2/logs/*.log \ -f /opt/jans/jetty/jans-scim/logs/*.log diff --git a/docs/admin/README.md b/docs/admin/README.md index d6b628313fd..b61bf861a56 100644 --- a/docs/admin/README.md +++ b/docs/admin/README.md @@ -42,9 +42,6 @@ keys of the OpenID Provider. * **Integration Guide** A collection of docs about configuring third party software and SaaS providers. -* **Client API Admin Guide** If you need advanced OpenID signing and encryption -features, the Client API does some of the heavy lifting for developers. - * **Config API Admin Guide** This required component is used by all configuration tools to write Janssen software configuration to the database. diff --git a/docs/admin/client-api/README.md b/docs/admin/client-api/README.md deleted file mode 100644 index 4f691d45ebe..00000000000 --- a/docs/admin/client-api/README.md +++ /dev/null @@ -1,12 +0,0 @@ ---- -tags: - - administration - - client-api ---- - -# Overview - -Please use the left navigation menu to browse the content of this section while we are still working on developing content for `Overview` page. - -!!! Contribute - If you’d like to contribute to this document, get started with the [Contribution Guide](https://docs.jans.io/head/CONTRIBUTING/#contributing-to-the-documentation) \ No newline at end of file diff --git a/docs/admin/client-api/config.md b/docs/admin/client-api/config.md deleted file mode 100644 index 4846b542167..00000000000 --- a/docs/admin/client-api/config.md +++ /dev/null @@ -1,8 +0,0 @@ ---- -tags: - - administration - - client-api ---- - -This is a placeholder - diff --git a/docs/admin/client-api/key-mgt.md b/docs/admin/client-api/key-mgt.md deleted file mode 100644 index 4846b542167..00000000000 --- a/docs/admin/client-api/key-mgt.md +++ /dev/null @@ -1,8 +0,0 @@ ---- -tags: - - administration - - client-api ---- - -This is a placeholder - diff --git a/docs/admin/client-api/logs.md b/docs/admin/client-api/logs.md deleted file mode 100644 index 4846b542167..00000000000 --- a/docs/admin/client-api/logs.md +++ /dev/null @@ -1,8 +0,0 @@ ---- -tags: - - administration - - client-api ---- - -This is a placeholder - diff --git a/docs/admin/client-api/monitoring.md b/docs/admin/client-api/monitoring.md deleted file mode 100644 index 4846b542167..00000000000 --- a/docs/admin/client-api/monitoring.md +++ /dev/null @@ -1,8 +0,0 @@ ---- -tags: - - administration - - client-api ---- - -This is a placeholder - diff --git a/docs/admin/client-api/oauth-features.md b/docs/admin/client-api/oauth-features.md deleted file mode 100644 index 4846b542167..00000000000 --- a/docs/admin/client-api/oauth-features.md +++ /dev/null @@ -1,8 +0,0 @@ ---- -tags: - - administration - - client-api ---- - -This is a placeholder - diff --git a/docs/admin/client-api/oidc-features.md b/docs/admin/client-api/oidc-features.md deleted file mode 100644 index 4846b542167..00000000000 --- a/docs/admin/client-api/oidc-features.md +++ /dev/null @@ -1,8 +0,0 @@ ---- -tags: - - administration - - client-api ---- - -This is a placeholder - diff --git a/docs/admin/client-api/sdks.md b/docs/admin/client-api/sdks.md deleted file mode 100644 index 4846b542167..00000000000 --- a/docs/admin/client-api/sdks.md +++ /dev/null @@ -1,8 +0,0 @@ ---- -tags: - - administration - - client-api ---- - -This is a placeholder - diff --git a/docs/admin/client-api/siop-features.md b/docs/admin/client-api/siop-features.md deleted file mode 100644 index 4846b542167..00000000000 --- a/docs/admin/client-api/siop-features.md +++ /dev/null @@ -1,8 +0,0 @@ ---- -tags: - - administration - - client-api ---- - -This is a placeholder - diff --git a/docs/admin/client-api/uma-features.md b/docs/admin/client-api/uma-features.md deleted file mode 100644 index 4846b542167..00000000000 --- a/docs/admin/client-api/uma-features.md +++ /dev/null @@ -1,8 +0,0 @@ ---- -tags: - - administration - - client-api ---- - -This is a placeholder - diff --git a/docs/admin/install/install-faq.md b/docs/admin/install/install-faq.md index 076165440cd..d7721a86c49 100644 --- a/docs/admin/install/install-faq.md +++ b/docs/admin/install/install-faq.md @@ -114,7 +114,6 @@ Command above should list services along with its current status. ```commandline UNIT LOAD ACTIVE SUB DESCRIPTION jans-auth.service loaded active running Janssen OAauth service -jans-client-api.service loaded active running Janssen Client API service jans-config-api.service loaded active running Janssen Config API service jans-fido2.service loaded active running Janssen Fido2 Service jans-scim.service loaded active running Janssen Scim service diff --git a/docs/admin/reference/json/client-api.md b/docs/admin/reference/json/client-api.md deleted file mode 100644 index a81a4bed825..00000000000 --- a/docs/admin/reference/json/client-api.md +++ /dev/null @@ -1,9 +0,0 @@ ---- -tags: - - administration - - reference - - json ---- - -This is a placeholder - diff --git a/docs/admin/reference/kubernetes/image-client-api.md b/docs/admin/reference/kubernetes/image-client-api.md deleted file mode 100644 index 6b4c0a16ca7..00000000000 --- a/docs/admin/reference/kubernetes/image-client-api.md +++ /dev/null @@ -1,9 +0,0 @@ ---- -tags: - - administration - - reference - - kubernetes ---- - -This is a placeholder - diff --git a/docs/admin/reference/openapi.md b/docs/admin/reference/openapi.md index a7540606af7..9196534e424 100644 --- a/docs/admin/reference/openapi.md +++ b/docs/admin/reference/openapi.md @@ -12,8 +12,7 @@ Follow the links below to access respective documentation. | Service | REST API | Java API | | --- |-------------------------------------------------------------------------------------------------------------------------------------------------------------------| --- | -| Jans Auth Server | [Swagger](https://gluu.org/swagger-ui/?url=https://raw.githubusercontent.com/JanssenProject/jans/main/jans-auth-server/docs/swagger.yaml) | [Javadoc](https://jenkins.jans.io/javadocs/jans-auth/main/)| -| Jans Client API | [Swagger](https://gluu.org/swagger-ui/?url=https://raw.githubusercontent.com/JanssenProject/jans/main/jans-client-api/server/src/main/resources/swagger.yaml) | [Javadoc](https://jenkins.jans.io/javadocs/jans-client-api/main/)| +| Jans Auth Server | [Swagger](https://gluu.org/swagger-ui/?url=https://raw.githubusercontent.com/JanssenProject/jans/main/jans-auth-server/docs/swagger.yaml) | [Javadoc](https://jenkins.jans.io/javadocs/jans-auth/main/)| | Jans Config API | [Swagger](https://gluu.org/swagger-ui/?url=https://raw.githubusercontent.com/JanssenProject/jans/main/jans-config-api/docs/jans-config-api-swagger.yaml) | [Javadoc](https://jenkins.jans.io/javadocs/jans-config-api/main/) | | Jans Core | NA | [Javadoc](https://jenkins.jans.io/javadocs/jans-core/main/)| | Jans FIDO 2 | [Swagger](https://gluu.org/swagger-ui/?url=https://raw.githubusercontent.com/JanssenProject/jans/main/jans-fido2/docs/jansFido2Swagger.yaml) | | diff --git a/docs/developer/implementation-design/README.md b/docs/developer/implementation-design/README.md index 8394c01e012..04cc5d359cc 100644 --- a/docs/developer/implementation-design/README.md +++ b/docs/developer/implementation-design/README.md @@ -19,7 +19,6 @@ This documentation explains technical design, architecture and interactions of v | Service | REST API | Java API | | --- | --- | --- | | Jans Auth Server | [Swagger](https://gluu.org/swagger-ui/?url=https://raw.githubusercontent.com/JanssenProject/jans/main/jans-auth-server/docs/swagger.yaml)| [Javadoc](https://jenkins.jans.io/javadocs/jans-auth/main/)| -| Jans Client API | [Swagger](https://gluu.org/swagger-ui/?url=https://raw.githubusercontent.com/JanssenProject/jans/main/jans-client-api/server/src/main/resources/swagger.yaml)| [Javadoc](https://jenkins.jans.io/javadocs/jans-client-api/main/)| | Jans Config API | [Swagger](https://gluu.org/swagger-ui/?url=https://raw.githubusercontent.com/JanssenProject/jans/main/jans-config-api/docs/jans-config-api-swagger.yaml)| | | Jans Core | | [Javadoc](https://jenkins.jans.io/javadocs/jans-core/main/)| | Jans FIDO 2 | [Swagger](https://gluu.org/swagger-ui/?url=https://raw.githubusercontent.com/JanssenProject/jans/main/jans-fido2/docs/jansFido2Swagger.yaml) | | diff --git a/docs/developer/implementation-design/jans-client-api.md b/docs/developer/implementation-design/jans-client-api.md deleted file mode 100644 index 2cc30f714e7..00000000000 --- a/docs/developer/implementation-design/jans-client-api.md +++ /dev/null @@ -1 +0,0 @@ -This file is a placeholder. diff --git a/jans-client-api/.gitignore b/jans-client-api/.gitignore deleted file mode 100644 index eefb39ae476..00000000000 --- a/jans-client-api/.gitignore +++ /dev/null @@ -1,40 +0,0 @@ -.project -.settings/ -*.classpath - -.idea - - - -### Java template -*.class - -# Mobile Tools for Java (J2ME) -.mtj.tmp/ - -# Package Files # -*.jar -*.war -*.ear - -*.iml - -# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml -hs_err_pid* - - -/server/.oxd-license -/server/oxd-server.log -/server/oxd_db.mv.db -/server/oxd_db.trace.db -gen-client/profiles/* -gen-client/profiles/*/ -!gen-client/profiles/default/ -gen-client/src/test/resources/properties/* -!gen-client/src/test/resources/properties/testng.properties -!gen-client/src/test/resources/properties/testng.xml -gen-client/target/ -server/dependency-reduced-pom.xml -server/src/test/resources/properties/users/* -uma-rs-core/target/ -uma-rs-resteasy/target/ \ No newline at end of file diff --git a/jans-client-api/CHANGELOG.md b/jans-client-api/CHANGELOG.md deleted file mode 100644 index 464540c2d32..00000000000 --- a/jans-client-api/CHANGELOG.md +++ /dev/null @@ -1,123 +0,0 @@ -# Changelog - -## 1.0.2 (2022-08-30) - - -### Features - -* **jans-client-api:** migration to Weld/Resteasy and Jetty 11 - Issue 260 ([#1319](https://github.com/JanssenProject/jans/issues/1319)) ([420ffc3](https://github.com/JanssenProject/jans/commit/420ffc3329b91c52d5c9996d7c1e600d9b6fead2)) -* **jans-client-api:** Use injectable operations and remove serviceprovider ([#1643](https://github.com/JanssenProject/jans/issues/1643)) ([982cab3](https://github.com/JanssenProject/jans/commit/982cab3bc3f499d3ec3fbefbd10cb87f58333998)) - - -### Bug Fixes - -* **jans-client-api:** minor observations PR13119 - typo transalation code-improvement ([#1806](https://github.com/JanssenProject/jans/issues/1806)) ([6df2e42](https://github.com/JanssenProject/jans/commit/6df2e422879d8726f2b1d6574fe5492355317bf9)) -* **jans-client-api:** remove jans-config-api dependency and solve wrong test dependencies ([#1737](https://github.com/JanssenProject/jans/issues/1737)) ([97dbe9c](https://github.com/JanssenProject/jans/commit/97dbe9cc3072ca17e9f092cc6d3df5a510778ac2)) -* **jans-client-api:** upgrade seleniumhq version from 3.x to 4.x ([#2110](https://github.com/JanssenProject/jans/issues/2110)) ([d48271e](https://github.com/JanssenProject/jans/commit/d48271e872de72c7085e592988ad2e4e8950116d)) - - -### Miscellaneous Chores - -* prepare helm chart release 1.0.1 ([ae78b76](https://github.com/JanssenProject/jans/commit/ae78b760aa536ecde3b7e7972070e144d6c3c072)) -* release 1.0.1 ([828bfe8](https://github.com/JanssenProject/jans/commit/828bfe80cee87e639839391f98ac3dc2f2d4a920)) -* release 1.0.2 ([43dead6](https://github.com/JanssenProject/jans/commit/43dead615f3508ca393c330c2db27a8fb9d1017a)) - -## [1.0.1](https://github.com/JanssenProject/jans/compare/jans-client-api-v1.0.0...jans-client-api-v1.0.1) (2022-07-06) - - -### Features - -* **jans-client-api:** migration to Weld/Resteasy and Jetty 11 - Issue 260 ([#1319](https://github.com/JanssenProject/jans/issues/1319)) ([420ffc3](https://github.com/JanssenProject/jans/commit/420ffc3329b91c52d5c9996d7c1e600d9b6fead2)) - - -### Miscellaneous Chores - -* release 1.0.0 ([3df6f77](https://github.com/JanssenProject/jans/commit/3df6f7721a8e9d57e28d065ee29153d023dfe9ea)) -* release 1.0.0 ([9644d1b](https://github.com/JanssenProject/jans/commit/9644d1bd29c291e57c140b0c9ac67243c322ac35)) -* release 1.0.1 ([828bfe8](https://github.com/JanssenProject/jans/commit/828bfe80cee87e639839391f98ac3dc2f2d4a920)) - -## 1.0.0 (2022-05-19) - - -### Features - -* **jans:** jetty 11 integration ([#1123](https://github.com/JanssenProject/jans/issues/1123)) ([6c1caa1](https://github.com/JanssenProject/jans/commit/6c1caa1c4c92d28571f8589cd701e6885d4d85ef)) - - -### Bug Fixes - -* jans-client-api replace netstat with ss in startup script ([#1246](https://github.com/JanssenProject/jans/issues/1246)) ([cde3fb1](https://github.com/JanssenProject/jans/commit/cde3fb1ef1d8f33c74983b0936485e8298e155bf)) - - -### Miscellaneous Chores - -* release 1.0.0 ([b2895f2](https://github.com/JanssenProject/jans/commit/b2895f224b5772c0724ea0afbdf67a417a5c537c)) -* release 1.0.0-beta.16 ([a083ad6](https://github.com/JanssenProject/jans/commit/a083ad6b1d43201126e8d4f690a55ea1b109524c)) -* release 1.0.0-beta.16 ([90e4bb2](https://github.com/JanssenProject/jans/commit/90e4bb29df040bd9fe5921a054bc4226d34ca1ef)) -* release 1.0.0-beta.16 ([eec2073](https://github.com/JanssenProject/jans/commit/eec2073be9fd25544f31087e171934afb9a71e6d)) -* release 1.0.0-beta.16 ([cd92ead](https://github.com/JanssenProject/jans/commit/cd92ead2ca654383091c4923d3de5619b70fc5b9)) -* release 1.0.0-beta.16 ([7f0a91b](https://github.com/JanssenProject/jans/commit/7f0a91bd90efc1cd7a80047f9cd6b7c6a22417a2)) -* release 1.0.0-beta.16 ([c2ad604](https://github.com/JanssenProject/jans/commit/c2ad604dc29e7401bc4cb0788feaa20e11de0440)) -* release 1.0.0-beta.16 ([a641486](https://github.com/JanssenProject/jans/commit/a6414864712789d1fcf80b823338100aebda030e)) -* release 1.0.0-beta.16 ([94d5791](https://github.com/JanssenProject/jans/commit/94d5791a23fce4ecb8913c16c940cfbbc85fed4c)) -* release 1.0.0-beta.16 ([16de429](https://github.com/JanssenProject/jans/commit/16de4299bc5e9c4a842f279ae0d3ae8282a4ff2c)) -* release 1.0.0-beta.16 ([72915c0](https://github.com/JanssenProject/jans/commit/72915c0e82b9684ac1c59934d5b9a36c2456058d)) -* release 1.0.0-beta.16 ([3ea2b37](https://github.com/JanssenProject/jans/commit/3ea2b37deac3416564614fb6a4e84b056ddbed3f)) -* release 1.0.0-beta.16 ([78a6d39](https://github.com/JanssenProject/jans/commit/78a6d39ffadf9abee18c7be0e14ad3eb6ec2ef1b)) -* release 1.0.0-beta.16 ([11bfa93](https://github.com/JanssenProject/jans/commit/11bfa9368e6ee482cc44240de08c8133d91b3f4c)) -* release 1.0.0-beta.16 ([22b180b](https://github.com/JanssenProject/jans/commit/22b180bba9a08045a6daa7ca8ee2b71abd42a973)) -* release 1.0.0-beta.16 ([b9acd0b](https://github.com/JanssenProject/jans/commit/b9acd0bceeeb54e3c47f869f11d97a22e8dc161f)) -* release 1.0.0-beta.16 ([328cd30](https://github.com/JanssenProject/jans/commit/328cd309ae1655a52709e13ca2f89441c6c965a2)) -* release 1.0.0-beta.16 ([5a84602](https://github.com/JanssenProject/jans/commit/5a84602838fb5d2e667422220fcd44dc53543e23)) -* release 1.0.0-beta.16 ([4923277](https://github.com/JanssenProject/jans/commit/4923277b100b5c814d94b27b88d1809794dfc413)) -* release 1.0.0-beta.16 ([258ba96](https://github.com/JanssenProject/jans/commit/258ba962bd93eb5be4d51e7de3a80da89c2e222f)) -* release 1.0.0-beta.16 ([77c4423](https://github.com/JanssenProject/jans/commit/77c4423d82b697fd91a0e61f40bad6bd9da0dba8)) -* release 1.0.0-beta.16 ([688b324](https://github.com/JanssenProject/jans/commit/688b32407b396917695cca787c08e95fe98269a1)) -* release 1.0.0-beta.16 ([4e86f15](https://github.com/JanssenProject/jans/commit/4e86f15fc39ec89d4790ebfaa7d30e7053fef606)) -* release 1.0.0-beta.16 ([8d514ee](https://github.com/JanssenProject/jans/commit/8d514ee63d840627321de2d89e816577dd919914)) -* release 1.0.0-beta.16 ([0899898](https://github.com/JanssenProject/jans/commit/0899898e80ba9b7e6a915574737bdf0756b59a14)) - -## [1.0.0-beta.16](https://github.com/JanssenProject/jans/compare/jans-client-api-v1.0.0-beta.15...jans-client-api-v1.0.0-beta.16) (2022-03-14) - - -### Miscellaneous Chores - -* release 1.0.0-beta.16 ([a083ad6](https://github.com/JanssenProject/jans/commit/a083ad6b1d43201126e8d4f690a55ea1b109524c)) -* release 1.0.0-beta.16 ([90e4bb2](https://github.com/JanssenProject/jans/commit/90e4bb29df040bd9fe5921a054bc4226d34ca1ef)) -* release 1.0.0-beta.16 ([eec2073](https://github.com/JanssenProject/jans/commit/eec2073be9fd25544f31087e171934afb9a71e6d)) -* release 1.0.0-beta.16 ([cd92ead](https://github.com/JanssenProject/jans/commit/cd92ead2ca654383091c4923d3de5619b70fc5b9)) -* release 1.0.0-beta.16 ([7f0a91b](https://github.com/JanssenProject/jans/commit/7f0a91bd90efc1cd7a80047f9cd6b7c6a22417a2)) -* release 1.0.0-beta.16 ([c2ad604](https://github.com/JanssenProject/jans/commit/c2ad604dc29e7401bc4cb0788feaa20e11de0440)) -* release 1.0.0-beta.16 ([a641486](https://github.com/JanssenProject/jans/commit/a6414864712789d1fcf80b823338100aebda030e)) -* release 1.0.0-beta.16 ([94d5791](https://github.com/JanssenProject/jans/commit/94d5791a23fce4ecb8913c16c940cfbbc85fed4c)) -* release 1.0.0-beta.16 ([16de429](https://github.com/JanssenProject/jans/commit/16de4299bc5e9c4a842f279ae0d3ae8282a4ff2c)) -* release 1.0.0-beta.16 ([72915c0](https://github.com/JanssenProject/jans/commit/72915c0e82b9684ac1c59934d5b9a36c2456058d)) -* release 1.0.0-beta.16 ([3ea2b37](https://github.com/JanssenProject/jans/commit/3ea2b37deac3416564614fb6a4e84b056ddbed3f)) -* release 1.0.0-beta.16 ([78a6d39](https://github.com/JanssenProject/jans/commit/78a6d39ffadf9abee18c7be0e14ad3eb6ec2ef1b)) -* release 1.0.0-beta.16 ([11bfa93](https://github.com/JanssenProject/jans/commit/11bfa9368e6ee482cc44240de08c8133d91b3f4c)) -* release 1.0.0-beta.16 ([22b180b](https://github.com/JanssenProject/jans/commit/22b180bba9a08045a6daa7ca8ee2b71abd42a973)) -* release 1.0.0-beta.16 ([b9acd0b](https://github.com/JanssenProject/jans/commit/b9acd0bceeeb54e3c47f869f11d97a22e8dc161f)) -* release 1.0.0-beta.16 ([328cd30](https://github.com/JanssenProject/jans/commit/328cd309ae1655a52709e13ca2f89441c6c965a2)) -* release 1.0.0-beta.16 ([5a84602](https://github.com/JanssenProject/jans/commit/5a84602838fb5d2e667422220fcd44dc53543e23)) -* release 1.0.0-beta.16 ([4923277](https://github.com/JanssenProject/jans/commit/4923277b100b5c814d94b27b88d1809794dfc413)) -* release 1.0.0-beta.16 ([258ba96](https://github.com/JanssenProject/jans/commit/258ba962bd93eb5be4d51e7de3a80da89c2e222f)) -* release 1.0.0-beta.16 ([77c4423](https://github.com/JanssenProject/jans/commit/77c4423d82b697fd91a0e61f40bad6bd9da0dba8)) -* release 1.0.0-beta.16 ([688b324](https://github.com/JanssenProject/jans/commit/688b32407b396917695cca787c08e95fe98269a1)) -* release 1.0.0-beta.16 ([4e86f15](https://github.com/JanssenProject/jans/commit/4e86f15fc39ec89d4790ebfaa7d30e7053fef606)) -* release 1.0.0-beta.16 ([8d514ee](https://github.com/JanssenProject/jans/commit/8d514ee63d840627321de2d89e816577dd919914)) -* release 1.0.0-beta.16 ([0899898](https://github.com/JanssenProject/jans/commit/0899898e80ba9b7e6a915574737bdf0756b59a14)) - -## 1.0.0-beta.15 (2022-03-02) - - -### Bug Fixes - -* jans-client-api/server/pom.xml to reduce vulnerabilities ([89756bb](https://github.com/JanssenProject/jans/commit/89756bb35beb154eabe5760e611f23c3b44a4d79)) -* **jans-client-api:** corrected test cases configuration [#724](https://github.com/JanssenProject/jans/issues/724) ([#726](https://github.com/JanssenProject/jans/issues/726)) ([f98db00](https://github.com/JanssenProject/jans/commit/f98db0061ccb5d61f70e52e065861e33d1958e9f)) - - -### Miscellaneous Chores - -* release 1.0.0-beta.15 ([ee5b719](https://github.com/JanssenProject/jans/commit/ee5b719bee5cc4bdaebf81a5103e6a7ab0695dbb)) -* release 1.0.0-beta.15 ([ca6d1c9](https://github.com/JanssenProject/jans/commit/ca6d1c9e2acb5e6422e1cd26ac277dd3eba4e56e)) -* release 1.0.0-beta.15 ([b65bab2](https://github.com/JanssenProject/jans/commit/b65bab20530b7d6736dd404e26649abf47c0fb60)) diff --git a/jans-client-api/LICENSE b/jans-client-api/LICENSE deleted file mode 100644 index d8a87cbecfe..00000000000 --- a/jans-client-api/LICENSE +++ /dev/null @@ -1,201 +0,0 @@ - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright 2020 Gluu Inc. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/jans-client-api/README.md b/jans-client-api/README.md deleted file mode 100644 index 3839783bc58..00000000000 --- a/jans-client-api/README.md +++ /dev/null @@ -1,123 +0,0 @@ -# jans-client-api - -## Introduction - -jans-client-api is a middleware service which can be used by web application developers to facilitate user authentication and authorization with an external [OAuth 2.0](https://tools.ietf.org/html/rfc6749) identity provider. It includes the server which is a simple REST application designed to work over the web (via https), making it possible for many apps across many servers to leverage a central jans-client-api service for [OAuth 2.0](https://tools.ietf.org/html/rfc6749) security. - -## Packaging and running the application - -### Prerequisites - -- A working installation of jans-auth-server - -### Verify jans-auth-server necessary configuration - -1. Verify configurationEntryDN in jans.properties - - ``` - clientApi_ConfigurationEntryDN=ou=jans-client-api,ou=configuration,o=jans - ``` - -2. Verify `clientApi_ConfigurationEntryDN` in DB configuration, if not exist execute respective insert. - - - [MySql](https://github.com/JanssenProject/jans-client-api/blob/master/server/scripts/mysql/clientApi_ConfigurationEntryDN.sql) - - [Ldap](https://github.com/JanssenProject/jans-client-api/blob/master/server/scripts/ldap/clientApi_ConfigurationEntryDN.ldif) - -3. Verify file route of next parameters in `clientApi_ConfigurationEntryDN` field:`jansConfDyn` configuration json: - ``` - "keyStorePath" - "cryptProviderKeyStorePath" - "mtlsClientKeyStorePath" - "storageConfiguration" - ``` - -### Source Packaging - -You can build the jans-client-api server using [Maven](https://maven.apache.org). The code is available in [GitHub](https://github.com/JanssenProject/jans-client-api). - -Create a folder to clone ${PATH_REPOSITORY}, and clone inside. -```bash -cd ${PATH_REPOSITORY} -git clone https://github.com/JanssenProject/jans-client-api.git -cd jans-client-api -mvn clean install -Dmaven.test.skip=true -Dcompile.jans.base={JANS_AUTH_SERVER_CONFIG_PATH, example: /etc/jans} -``` - -After the build is finished `jans-client-api-server.war` is generated in `${PATH_REPOSITORY}/jans-client-api/server/target/`. - -### Jetty 11 Deploy - -Download jetty 11 zip, here a link: -https://repo1.maven.org/maven2/org/eclipse/jetty/jetty-home/11.0.9/jetty-home-11.0.9.zip - -Create a folder to unzip Jetty ${PATH_FOLDER_JETTY}, and unzip Jetty inside. - -```bash -cd ${PATH_FOLDER_JETTY} -export JETTY_HOME=${PATH_FOLDER_JETTY}/jetty-home-11.0.9 -mkdir jetty-base -export JETTY_BASE=${PATH_FOLDER_JETTY}/jetty-base/ -cd jetty-base -java -jar $JETTY_HOME/start.jar --add-module=server,deploy,annotations,webapp,servlet,resources,http,http-forwarded,threadpool,jsp,websocket,logging/slf4j,logging-jetty -cp ${PATH_REPOSITORY}/jans-client-api/server/target/jans-client-api-server.war $JETTY_BASE/webapps/ -java -jar $JETTY_HOME/start.jar jetty.http.port=9999 -``` - -After `jans-client-api` server is started, status can be checked using `health-check` url: http://localhost:9999/jans-client-api-server/health-check. - -## Compile and running tests - -### Compile with tests - -```bash -mvn clean install -Djans.base=/etc/jans -``` - -`Djans.base` is the conf path of the local running `jans-auth-server` - -### Running tests - -```bash -mvn test -Djans.base=/etc/jans -``` - -`Djans.base` is the conf path of the local running `jans-auth-server` - -### Running tests with external jans-client-api - -```bash -mvn test -Dmaven.test.skip=false -Dtest.client.api.url=http://localhost:9999/jans-client-api-server/ -``` - -`Dtest.client.api.url` is the url of a running `jans-client-api-server` - -## Api Description - -jans-client-api offers an easy API for [OAuth 2.0](https://tools.ietf.org/html/rfc6749), [OpenID Connect](http://openid.net/specs/openid-connect-core-1_0.html), and [UMA 2.0](https://docs.kantarainitiative.org/uma/wg/oauth-uma-grant-2.0-05.html). - -| HTTP request | Method | Description | -|-----------------------------------------|--------|------------------------------------------------------------------------------------------------------------------------| -| /health-check | GET | Quick check whether jans-client-api-server is alive. | -| /register-site | POST | Register client with jans-client-api-server. | -| /get-client-token | POST | Gets Client Token. | -| /introspect-access-token | POST | Introspect Access Token. | -| /update-site | POST | Updates client. If something changes in a pre-registered client, you can use this API to update your client in the OP. | -| /remove-site | POST | Removes site from jans-client-api-server. | -| /get-authorization-url | POST | Gets Authorization Url. | -| /get-tokens-by-code | POST | Get tokens by code. | -| /get-user-info | POST | Get User Info. | -| /get-access-token-by-refresh-token | POST | Get Access Token By Refresh Token. | -| /uma-rs-protect | POST | UMA RS Protect Resources. | -| /uma-rs-modify | POST | This end-point can be used to modify one resource at a time from whole set of UMA resources of cient. | -| /uma-rs-check-access | POST | UMA RS Check Access. | -| /introspect-rpt | POST | Introspect RPT. | -| /uma-rp-get-rpt | POST | UMA RP Get RPT. | -| /uma-rp-get-claims-gathering-url | POST | UMA RP Get Claims Gathering URL. | -| /get-jwks | POST | Get JSON Web Key Set. | -| /get-issuer | POST | Get Issuer. | -| /get-discovery | POST | Get OP Discovery Configuration. | -| /get-rp-jwks | GET | Get Rp JWKS. | -| /get-request-object-uri | POST | Get Request Object Uri. | -| /get-request-object/{request_object_id} | GET | Get Request Object. | - -jans-client-api has defined swagger specification [here](https://gluu.org/swagger-ui/?url=https://raw.githubusercontent.com/JanssenProject/jans-client-api/master/server/src/main/resources/swagger.yaml). It is possible to generated native library in your favorite language by [Swagger Code Generator](https://swagger.io/tools/swagger-codegen/). diff --git a/jans-client-api/client/.gitignore b/jans-client-api/client/.gitignore deleted file mode 100644 index b83d22266ac..00000000000 --- a/jans-client-api/client/.gitignore +++ /dev/null @@ -1 +0,0 @@ -/target/ diff --git a/jans-client-api/client/pom.xml b/jans-client-api/client/pom.xml deleted file mode 100644 index 112966f3d5a..00000000000 --- a/jans-client-api/client/pom.xml +++ /dev/null @@ -1,121 +0,0 @@ - - - - 4.0.0 - jans-client-api - jar - 1.0.3-SNAPSHOT - jans-client-api - http://ox.gluu.org - - - io.jans - jans-client-api-parent - 1.0.3-SNAPSHOT - - - - 3.0.2 - true - - - - jans-client-api - - - - src/main/resources - - - - - src/test/resources - true - - - - - - org.apache.maven.plugins - maven-compiler-plugin - - - org.apache.maven.plugins - maven-clean-plugin - - - org.apache.maven.plugins - maven-deploy-plugin - - - org.apache.maven.plugins - maven-install-plugin - - - org.apache.maven.plugins - maven-jar-plugin - - - - test-jar - - - - - - org.apache.maven.plugins - maven-resources-plugin - - - org.apache.maven.plugins - maven-site-plugin - - - org.apache.maven.plugins - maven-surefire-plugin - - - - true - - - - org.codehaus.mojo - findbugs-maven-plugin - - - org.apache.maven.plugins - maven-war-plugin - - - org.apache.maven.plugins - maven-source-plugin - - - org.apache.maven.plugins - maven-idea-plugin - - - - - - - - com.fasterxml.jackson.core - jackson-databind - - - - io.jans - jans-client-api-common - - - - - org.apache.logging.log4j - log4j-slf4j-impl - - - - - \ No newline at end of file diff --git a/jans-client-api/client/src/main/java/io/jans/ca/client/ClientInterface.java b/jans-client-api/client/src/main/java/io/jans/ca/client/ClientInterface.java deleted file mode 100644 index fc2709b8984..00000000000 --- a/jans-client-api/client/src/main/java/io/jans/ca/client/ClientInterface.java +++ /dev/null @@ -1,70 +0,0 @@ -package io.jans.ca.client; - -import com.fasterxml.jackson.databind.JsonNode; -import io.jans.ca.common.introspection.CorrectRptIntrospectionResponse; -import io.jans.ca.common.params.*; -import io.jans.ca.common.response.*; - -/** - * @author yuriyz - */ -public interface ClientInterface { - - String healthCheck(); - - JsonNode getRpJwks(); - - String getRequestObject(String value); - - GetClientTokenResponse getClientToken(GetClientTokenParams params); - - IntrospectAccessTokenResponse introspectAccessToken(String authorization, String authorizationRpId, IntrospectAccessTokenParams params); - - CorrectRptIntrospectionResponse introspectRpt(String authorization, String authorizationRpId, IntrospectRptParams params); - - RegisterSiteResponse registerSite(RegisterSiteParams params); - - UpdateSiteResponse updateSite(String authorization, String authorizationRpId, UpdateSiteParams params); - - RemoveSiteResponse removeSite(String authorization, String authorizationRpId, RemoveSiteParams params); - - GetAuthorizationUrlResponse getAuthorizationUrl(String authorization, String authorizationRpId, GetAuthorizationUrlParams params); - - GetAuthorizationCodeResponse getAuthorizationCode(String authorization, String authorizationRpId, GetAuthorizationCodeParams params); - - GetTokensByCodeResponse2 getTokenByCode(String authorization, String authorizationRpId, GetTokensByCodeParams params); - - JsonNode getUserInfo(String authorization, String authorizationRpId, GetUserInfoParams params); - - GetLogoutUriResponse getLogoutUri(String authorization, String authorizationRpId, GetLogoutUrlParams params); - - GetClientTokenResponse getAccessTokenByRefreshToken(String authorization, String authorizationRpId, GetAccessTokenByRefreshTokenParams params); - - RsProtectResponse umaRsProtect(String authorization, String authorizationRpId, RsProtectParams2 params); - - RsModifyResponse umaRsModify(String authorization, String authorizationRpId, RsModifyParams params); - - RsCheckAccessResponse umaRsCheckAccess(String authorization, String authorizationRpId, RsCheckAccessParams params); - - RpGetRptResponse umaRpGetRpt(String authorization, String authorizationRpId, RpGetRptParams params); - - RpGetClaimsGatheringUrlResponse umaRpGetClaimsGatheringUrl(String authorization, String authorizationRpId, RpGetClaimsGatheringUrlParams params); - - AuthorizationCodeFlowResponse authorizationCodeFlow(String authorization, String authorizationRpId, AuthorizationCodeFlowParams params); - - CheckAccessTokenResponse checkAccessToken(String authorization, String authorizationRpId, CheckAccessTokenParams params); - - CheckIdTokenResponse checkIdToken(String authorization, String authorizationRpId, CheckIdTokenParams params); - - String getRp(String authorization, String authorizationRpId, GetRpParams params); - - GetJwksResponse getJwks(String authorization, String authorizationRpId, GetJwksParams params); - - GetDiscoveryResponse getDiscovery(GetDiscoveryParams params); - - GetIssuerResponse getIssuer(GetIssuerParams params); - - GetRequestObjectUriResponse getRequestObjectUri(String authorization, String authorizationRpId, GetRequestObjectUriParams params); - - String getApitargetURL(); -} diff --git a/jans-client-api/client/src/main/java/io/jans/ca/client/GetTokensByCodeResponse2.java b/jans-client-api/client/src/main/java/io/jans/ca/client/GetTokensByCodeResponse2.java deleted file mode 100644 index 9cfa8fcd3a6..00000000000 --- a/jans-client-api/client/src/main/java/io/jans/ca/client/GetTokensByCodeResponse2.java +++ /dev/null @@ -1,100 +0,0 @@ -package io.jans.ca.client; - -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.databind.JsonNode; -import io.jans.ca.common.response.IOpResponse; - -/** - * @author Yuriy Zabrovarnyy - */ -public class GetTokensByCodeResponse2 implements IOpResponse { - - @JsonProperty(value = "access_token") - private String accessToken; - @JsonProperty(value = "expires_in") - private int expiresIn; // expiration time in seconds - @JsonProperty(value = "id_token") - private String idToken; - @JsonProperty(value = "refresh_token") - private String refreshToken; - @JsonProperty("id_token_claims") - private JsonNode idTokenClaims; - - @JsonProperty("error") - private String error; - - @JsonProperty("error_description") - private String errorDescription; - - public GetTokensByCodeResponse2() { - } - - public String getRefreshToken() { - return refreshToken; - } - - public void setRefreshToken(String refreshToken) { - this.refreshToken = refreshToken; - } - - public String getAccessToken() { - return accessToken; - } - - public void setAccessToken(String accessToken) { - this.accessToken = accessToken; - } - - public int getExpiresIn() { - return expiresIn; - } - - public void setExpiresIn(int expiresIn) { - this.expiresIn = expiresIn; - } - - public String getIdToken() { - return idToken; - } - - public void setIdToken(String idToken) { - this.idToken = idToken; - } - - public JsonNode getIdTokenClaims() { - return idTokenClaims; - } - - public void setIdTokenClaims(JsonNode idTokenClaims) { - this.idTokenClaims = idTokenClaims; - } - - public String getError() { - return error; - } - - public void setError(String error) { - this.error = error; - } - - public String getErrorDescription() { - return errorDescription; - } - - public void setErrorDescription(String errorDescription) { - this.errorDescription = errorDescription; - } - - @Override - public String toString() { - return "GetTokensByCodeResponse2{" + - "accessToken='" + accessToken + '\'' + - ", expiresIn=" + expiresIn + - ", idToken='" + idToken + '\'' + - ", refreshToken='" + refreshToken + '\'' + - ", idTokenClaims=" + idTokenClaims + '\'' + - ", error=" + error + '\'' + - ", errorDescription=" + errorDescription + - '}'; - } -} diff --git a/jans-client-api/client/src/main/java/io/jans/ca/client/RpClient.java b/jans-client-api/client/src/main/java/io/jans/ca/client/RpClient.java deleted file mode 100644 index ae22c5a6728..00000000000 --- a/jans-client-api/client/src/main/java/io/jans/ca/client/RpClient.java +++ /dev/null @@ -1,10 +0,0 @@ -package io.jans.ca.client; - -/** - * @author yuriyz - */ -public class RpClient { - - private RpClient() { - } -} diff --git a/jans-client-api/client/src/main/java/io/jans/ca/client/RsProtectParams2.java b/jans-client-api/client/src/main/java/io/jans/ca/client/RsProtectParams2.java deleted file mode 100644 index f6a3c4d8ada..00000000000 --- a/jans-client-api/client/src/main/java/io/jans/ca/client/RsProtectParams2.java +++ /dev/null @@ -1,69 +0,0 @@ -package io.jans.ca.client; - -import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonProperty; -import io.jans.ca.common.params.HasRpIdParams; - -/** - * @author yuriyz - */ -@JsonIgnoreProperties(ignoreUnknown = true) -public class RsProtectParams2 implements HasRpIdParams { - - @JsonProperty(value = "rp_id") - private String rp_id; - @JsonProperty(value = "resources") - private JsonNode resources; - @JsonProperty(value = "protection_access_token") - private String protection_access_token; - @JsonProperty(value = "overwrite") - private Boolean overwrite = false; - - public RsProtectParams2() { - } - - public String getToken() { - return protection_access_token; - } - - public void setToken(String token) { - this.protection_access_token = token; - } - - public String getRpId() { - return rp_id; - } - - public void setRpId(String rpId) { - this.rp_id = rpId; - } - - public JsonNode getResources() { - return resources; - } - - public void setResources(JsonNode resources) { - this.resources = resources; - } - - public Boolean getOverwrite() { - return overwrite; - } - - public void setOverwrite(Boolean overwrite) { - this.overwrite = overwrite; - } - - @Override - public String toString() { - final StringBuilder sb = new StringBuilder(); - sb.append("RsProtectParams"); - sb.append("{rp_id='").append(rp_id).append('\''); - sb.append(", resources=").append(resources); - sb.append(", protection_access_token=").append(protection_access_token); - sb.append(", overwrite=").append(overwrite); - sb.append('}'); - return sb.toString(); - } -} diff --git a/jans-client-api/client/src/main/resources/log4j2.xml b/jans-client-api/client/src/main/resources/log4j2.xml deleted file mode 100644 index ebb600925a1..00000000000 --- a/jans-client-api/client/src/main/resources/log4j2.xml +++ /dev/null @@ -1,152 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/jans-client-api/common/.gitignore b/jans-client-api/common/.gitignore deleted file mode 100644 index b83d22266ac..00000000000 --- a/jans-client-api/common/.gitignore +++ /dev/null @@ -1 +0,0 @@ -/target/ diff --git a/jans-client-api/common/pom.xml b/jans-client-api/common/pom.xml deleted file mode 100644 index 85808b2af0a..00000000000 --- a/jans-client-api/common/pom.xml +++ /dev/null @@ -1,190 +0,0 @@ - - - - 4.0.0 - jans-client-api-common - jar - 1.0.3-SNAPSHOT - jans-client-api-common - http://ox.gluu.org - - - io.jans - jans-client-api-parent - 1.0.3-SNAPSHOT - - - - true - - - - jans-client-api-common - - - - org.apache.maven.plugins - maven-compiler-plugin - - - org.apache.maven.plugins - maven-clean-plugin - - - org.apache.maven.plugins - maven-deploy-plugin - - - org.apache.maven.plugins - maven-install-plugin - - - org.apache.maven.plugins - maven-jar-plugin - 2.2 - - - - test-jar - - - - - - org.apache.maven.plugins - maven-resources-plugin - - - org.apache.maven.plugins - maven-site-plugin - - - org.apache.maven.plugins - maven-surefire-plugin - - - org.codehaus.mojo - findbugs-maven-plugin - - - org.apache.maven.plugins - maven-war-plugin - - - org.apache.maven.plugins - maven-source-plugin - - - org.apache.maven.plugins - maven-idea-plugin - - - - - - - - com.fasterxml.jackson.core - jackson-annotations - - - com.fasterxml.jackson.core - jackson-databind - - - io.jans - uma-rs-resteasy - - - com.google.guava - guava - - - io.jans - jans-auth-model - - - io.jans - jans-core-util - - - io.jans - jans-orm-annotation - - - commons-beanutils - commons-beanutils - - - commons-codec - commons-codec - - - commons-configuration - commons-configuration - - - commons-io - commons-io - - - commons-lang - commons-lang - - - - org.slf4j - slf4j-api - - - org.apache.logging.log4j - log4j-slf4j-impl - - - org.apache.logging.log4j - log4j-core - - - org.apache.logging.log4j - log4j-api - - - org.testng - testng - - - org.apache.httpcomponents - httpclient - - - - org.seleniumhq.selenium - selenium-java - - - org.seleniumhq.selenium - selenium-api - - - org.seleniumhq.selenium - selenium-remote-driver - - - org.seleniumhq.selenium - selenium-support - - - org.seleniumhq.selenium - htmlunit-driver - - - net.sourceforge.htmlunit - htmlunit-cssparser - - - org.jboss.resteasy - resteasy-jaxb-provider - - - - \ No newline at end of file diff --git a/jans-client-api/common/src/main/java/io/jans/ca/common/CoreUtils.java b/jans-client-api/common/src/main/java/io/jans/ca/common/CoreUtils.java deleted file mode 100644 index 858e73ed8ee..00000000000 --- a/jans-client-api/common/src/main/java/io/jans/ca/common/CoreUtils.java +++ /dev/null @@ -1,339 +0,0 @@ -/** - * All rights reserved -- Copyright 2015 Gluu Inc. - */ -package io.jans.ca.common; - -import com.google.common.base.Strings; -import org.apache.commons.lang.StringUtils; -import org.apache.http.HttpHost; -import org.apache.http.client.HttpClient; -import org.apache.http.config.Registry; -import org.apache.http.config.RegistryBuilder; -import org.apache.http.conn.socket.ConnectionSocketFactory; -import org.apache.http.conn.socket.PlainConnectionSocketFactory; -import org.apache.http.conn.ssl.SSLConnectionSocketFactory; -import org.apache.http.conn.ssl.TrustStrategy; -import org.apache.http.impl.client.CloseableHttpClient; -import org.apache.http.impl.client.HttpClientBuilder; -import org.apache.http.impl.client.HttpClients; -import org.apache.http.impl.conn.PoolingHttpClientConnectionManager; -import org.apache.http.ssl.SSLContexts; -import io.jans.ca.common.proxy.ProxyConfiguration; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import javax.net.ssl.HostnameVerifier; -import javax.net.ssl.SSLContext; -import javax.net.ssl.SSLSession; -import java.io.BufferedReader; -import java.io.File; -import java.io.IOException; -import java.io.UnsupportedEncodingException; -import java.math.BigInteger; -import java.net.MalformedURLException; -import java.net.URL; -import java.net.URLDecoder; -import java.security.KeyManagementException; -import java.security.KeyStoreException; -import java.security.NoSuchAlgorithmException; -import java.security.SecureRandom; -import java.security.cert.CertificateException; -import java.security.cert.X509Certificate; -import java.util.Date; -import java.util.LinkedHashMap; -import java.util.Map; -import java.util.Optional; -import java.util.concurrent.Executors; -import java.util.concurrent.ScheduledExecutorService; -import java.util.concurrent.ThreadFactory; - -/** - * Core utility class. - * - * @author Yuriy Zabrovarnyy - * @version 0.9, 27/07/2013 - */ -public class CoreUtils { - - public static final String DOC_URL = "https://gluu.org/docs/jans_client_api"; - - public static boolean isExpired(Date expiredAt) { - return expiredAt != null && expiredAt.before(new Date()); - } - - - /** - * UTF-8 encoding string - */ - public static final String UTF8 = "UTF-8"; - - /** - * Logger - */ - private static final Logger LOG = LoggerFactory.getLogger(CoreUtils.class); - - public static final int COMMAND_STR_LENGTH_SIZE = 4; - public static final int BUFFER_SIZE = 8192; - - /** - * Avoid instance creation. - */ - private CoreUtils() { - } - - public static ScheduledExecutorService createExecutor() { - return Executors.newSingleThreadScheduledExecutor(daemonThreadFactory()); - } - - public static ThreadFactory daemonThreadFactory() { - return new ThreadFactory() { - public Thread newThread(Runnable p_r) { - Thread thread = new Thread(p_r); - thread.setDaemon(true); - return thread; - } - }; - } - - public static void sleep(int i) { - try { - Thread.sleep(i * 1000); - } catch (InterruptedException e) { - LOG.error(e.getMessage(), e); - } - } - - public static long parseSilently(String p_str) { - try { - return Long.parseLong(p_str); - } catch (Exception e) { - return -1; - } - } - - public static String normalizeLengthPrefixString(int p_length) { - if (p_length <= 0) { - throw new IllegalArgumentException("Length must be more than zero."); - } - final String s = Integer.toString(p_length); - final StringBuilder sb = new StringBuilder(s); - final int sbLength = sb.length(); - if (sbLength < COMMAND_STR_LENGTH_SIZE) { - for (int i = sbLength; i < COMMAND_STR_LENGTH_SIZE; i++) { - sb.insert(0, '0'); - } - } - if (sb.length() != COMMAND_STR_LENGTH_SIZE) { - throw new IllegalArgumentException("Normalized length size must be exactly: " + COMMAND_STR_LENGTH_SIZE); - } - return sb.toString(); - } - - public static ReadResult readCommand(String p_leftString, BufferedReader p_reader) throws IOException { - int commandSize = -1; - final StringBuilder storage = new StringBuilder(p_leftString != null ? p_leftString : ""); - while (true) { - LOG.trace("commandSize: {}, stringStorage: {}", commandSize, storage.toString()); - - final char[] buffer = new char[BUFFER_SIZE]; - final int readCount = p_reader.read(buffer, 0, BUFFER_SIZE); - if (readCount == -1) { - LOG.trace("End of stream. Quit."); - return null; - } - - storage.append(buffer, 0, readCount); - - final int storageLength = storage.length(); - if (commandSize == -1 && storageLength >= CoreUtils.COMMAND_STR_LENGTH_SIZE) { - final String sizeString = storage.substring(0, CoreUtils.COMMAND_STR_LENGTH_SIZE); - commandSize = (int) CoreUtils.parseSilently(sizeString); - LOG.trace("Parsed sizeString: {}, commandSize: {}", sizeString, commandSize); - - if (commandSize == -1) { - LOG.trace("Unable to identify command size. Quit."); - return null; - } - } - - final int totalSize = commandSize + CoreUtils.COMMAND_STR_LENGTH_SIZE; - if (commandSize != -1 && storageLength >= totalSize) { - final String commandAsString = storage.substring( - CoreUtils.COMMAND_STR_LENGTH_SIZE, totalSize); - - String leftString = ""; - if (storageLength > (totalSize + 1)) { - storage.substring(totalSize + 1); - } - final ReadResult result = new ReadResult(commandAsString, leftString); - LOG.trace("Read result: {}", result); - return result; - } - } - } - - public static boolean allNotBlank(String... p_strings) { - if (p_strings != null && p_strings.length > 0) { - for (String s : p_strings) { - if (StringUtils.isBlank(s)) { - return false; - } - } - return true; - } - return false; - } - - /** - * @param trustStoreFile trust store file, e.g. D:/Development/gluu_conf/etc/certs/DA855F9895A1CA3B9E7D4BF5-java.jks - * @param trustStorePassword trust store password - * @return http client - * @throws Exception - */ - - - public static HttpClient createHttpClientWithKeyStore(File trustStoreFile, String trustStorePassword, String[] tlsVersions, String[] tlsSecureCiphers, Optional proxyConfiguration) throws Exception { - - SSLContext sslcontext = SSLContexts.custom() - .loadTrustMaterial(trustStoreFile, trustStorePassword.toCharArray()) - .build(); - - SSLConnectionSocketFactory sslConSocFactory = new SSLConnectionSocketFactory( - sslcontext, tlsVersions, tlsSecureCiphers, SSLConnectionSocketFactory.getDefaultHostnameVerifier()); - - return createClient(sslConSocFactory, proxyConfiguration); - } - - public static HttpClient createHttpClientForMutualAuthentication(File trustStoreFile, String trustStorePassword, File mtlsClientKeyStoreFile, String mtlsClientKeyStorePassword, String[] tlsVersions, String[] tlsSecureCiphers, Optional proxyConfiguration) throws Exception { - - SSLContext sslcontext = SSLContexts.custom() - .loadKeyMaterial(mtlsClientKeyStoreFile, mtlsClientKeyStorePassword.toCharArray(), mtlsClientKeyStorePassword.toCharArray()) - .loadTrustMaterial(trustStoreFile, trustStorePassword.toCharArray()) - .build(); - - SSLConnectionSocketFactory sslConSocFactory = new SSLConnectionSocketFactory( - sslcontext, tlsVersions, tlsSecureCiphers, SSLConnectionSocketFactory.getDefaultHostnameVerifier()); - - return createClient(sslConSocFactory, proxyConfiguration); - } - - public static HttpClient createHttpClientTrustAll(Optional proxyConfiguration, String[] tlsVersions, String[] tlsSecureCiphers) throws NoSuchAlgorithmException, KeyManagementException, - KeyStoreException { - - SSLContext sslContext = SSLContexts.custom().loadTrustMaterial(new TrustStrategy() { - @Override - public boolean isTrusted(X509Certificate[] chain, String authType) throws CertificateException { - return true; - } - }).build(); - //No operation verifier for trust All Client - HostnameVerifier allowAllHosts = new HostnameVerifier() { - - public boolean verify(String s, SSLSession sslSession) { - return true; - } - - public final String toString() { - return "NO_OP"; - } - }; - - SSLConnectionSocketFactory sslContextFactory = new SSLConnectionSocketFactory(sslContext, tlsVersions, tlsSecureCiphers, allowAllHosts); - - return createClient(sslContextFactory, proxyConfiguration); - } - - public static HttpClient createClientFallback(Optional proxyConfiguration) { - if (proxyConfiguration.isPresent() && !Strings.isNullOrEmpty(proxyConfiguration.get().getHost())) { - HttpHost proxyhost = null; - ProxyConfiguration proxyConfigObj = proxyConfiguration.get(); - - if (isSafePort(proxyConfigObj.getPort()) && !Strings.isNullOrEmpty(proxyConfigObj.getProtocol())) { - proxyhost = new HttpHost(proxyConfigObj.getHost(), proxyConfigObj.getPort(), proxyConfigObj.getProtocol()); - } else if (isSafePort(proxyConfigObj.getPort())) { - proxyhost = new HttpHost(proxyConfigObj.getHost(), proxyConfigObj.getPort()); - } else { - proxyhost = new HttpHost(proxyConfigObj.getHost()); - } - - return HttpClientBuilder.create().setProxy(proxyhost).build(); - } - return HttpClientBuilder.create().build(); - } - - public static HttpClient createClient(SSLConnectionSocketFactory connectionFactory, Optional proxyConfiguration) { - - HttpClientBuilder httClientBuilder = HttpClients.custom(); - - Registry socketFactoryRegistry = RegistryBuilder.create() - .register("https", connectionFactory) - .register("http", new PlainConnectionSocketFactory()) - .build(); - - PoolingHttpClientConnectionManager cm = new PoolingHttpClientConnectionManager(socketFactoryRegistry); - - if (connectionFactory != null) { - httClientBuilder = httClientBuilder.setSSLSocketFactory(connectionFactory); - } - - if (proxyConfiguration.isPresent() && !Strings.isNullOrEmpty(proxyConfiguration.get().getHost())) { - HttpHost proxyhost = null; - ProxyConfiguration proxyConfigObj = proxyConfiguration.get(); - - if (isSafePort(proxyConfigObj.getPort()) && !Strings.isNullOrEmpty(proxyConfigObj.getProtocol())) { - proxyhost = new HttpHost(proxyConfigObj.getHost(), proxyConfigObj.getPort(), proxyConfigObj.getProtocol()); - } else if (isSafePort(proxyConfigObj.getPort())) { - proxyhost = new HttpHost(proxyConfigObj.getHost(), proxyConfigObj.getPort()); - } else { - proxyhost = new HttpHost(proxyConfigObj.getHost()); - } - - httClientBuilder = httClientBuilder.setProxy(proxyhost); - } - - CloseableHttpClient httpClient = httClientBuilder - .setConnectionManager(cm).build(); - - cm.setMaxTotal(200); // Increase max total connection to 200 - cm.setDefaultMaxPerRoute(20); // Increase default max connection per route to 20 - - return httpClient; - } - - public static String secureRandomString() { - return new BigInteger(130, new SecureRandom()).toString(32); - } - - public static Map splitQuery(String url) throws UnsupportedEncodingException, MalformedURLException { - return splitQuery(new URL(url)); - } - - public static Map splitQuery(URL url) throws UnsupportedEncodingException { - Map queryPairs = new LinkedHashMap<>(); - String query = url.getQuery(); - String[] pairs = query.split("&"); - for (String pair : pairs) { - int idx = pair.indexOf("="); - queryPairs.put(URLDecoder.decode(pair.substring(0, idx), "UTF-8"), URLDecoder.decode(pair.substring(idx + 1), "UTF-8")); - } - return queryPairs; - } - - public static String cleanUpLog(String log) { - try { - // remove `client_secret` from logs - final int index = StringUtils.indexOf(log, "client_secret"); - if (index != -1) { - final int commaIndex = StringUtils.indexOf(log, ",", index + 1); - return log.substring(0, index - 1) + log.substring(commaIndex + 1, log.length()); - } - } catch (Exception e) { - LOG.error(e.getMessage(), e); - } - return log; - } - - private static boolean isSafePort(Integer input) { - return input != null && input > 0; - } -} diff --git a/jans-client-api/common/src/main/java/io/jans/ca/common/ErrorResponse.java b/jans-client-api/common/src/main/java/io/jans/ca/common/ErrorResponse.java deleted file mode 100644 index 808b693a9df..00000000000 --- a/jans-client-api/common/src/main/java/io/jans/ca/common/ErrorResponse.java +++ /dev/null @@ -1,104 +0,0 @@ -/** - * All rights reserved -- Copyright 2015 Gluu Inc. - */ -package io.jans.ca.common; - -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.databind.JsonNode; -import io.jans.ca.common.response.IOpResponse; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import java.io.Serializable; - -/** - * @author Yuriy Zabrovarnyy - */ -@JsonIgnoreProperties(ignoreUnknown = true) -public class ErrorResponse implements Serializable, IOpResponse { - - private static final Logger LOG = LoggerFactory.getLogger(ErrorResponse.class); - - @JsonProperty(value = "error") - private String error; - @JsonProperty(value = "error_description") - private String error_description; - @JsonProperty(value = "details") - private JsonNode details; - @JsonProperty(value = "reason") - private JsonNode reason; - - public ErrorResponse() { - } - - public ErrorResponse(String error) { - this.error = error; - } - - public ErrorResponse(ErrorResponseCode code) { - this.error = code.getCode(); - this.error_description = code.getDescription(); - } - - public ErrorResponse(String error, String errorDescription) { - this.error = error; - this.error_description = errorDescription; - } - - public String getError() { - return error; - } - - public void setError(String error) { - this.error = error; - } - - @JsonProperty(value = "error_description") - public String getErrorDescription() { - return error_description; - } - - public void setErrorDescription(String error_description) { - this.error_description = error_description; - } - - public JsonNode getDetails() { - return details; - } - - public void setDetails(JsonNode details) { - this.details = details; - } - - public JsonNode getReason() { - return reason; - } - - public void setReason(JsonNode reason) { - this.reason = reason; - } - - public T detailsAs(Class p_class) { - if (details != null && p_class != null) { - final String asString = details.toString(); - try { - return Jackson2.createJsonMapper().readValue(asString, p_class); - } catch (Exception e) { - LOG.error(e.getMessage(), e); - } - LOG.error("Unable to parse string to response, string: {}", asString); - } - return null; - } - - @Override - public String toString() { - return "ErrorResponse{" + - "error='" + error + '\'' + - ", error_description='" + error_description + '\'' + - ", details=" + details + - ", reason=" + reason + - '}'; - } -} diff --git a/jans-client-api/common/src/main/java/io/jans/ca/common/ErrorResponseCode.java b/jans-client-api/common/src/main/java/io/jans/ca/common/ErrorResponseCode.java deleted file mode 100644 index a6b066e9561..00000000000 --- a/jans-client-api/common/src/main/java/io/jans/ca/common/ErrorResponseCode.java +++ /dev/null @@ -1,170 +0,0 @@ -/** - * All rights reserved -- Copyright 2015 Gluu Inc. - */ -package io.jans.ca.common; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; -import io.jans.as.model.common.SubjectType; -import io.jans.as.model.crypto.encryption.BlockEncryptionAlgorithm; -import io.jans.as.model.crypto.encryption.KeyEncryptionAlgorithm; -import io.jans.as.model.crypto.signature.SignatureAlgorithm; -import org.apache.commons.lang.StringUtils; - -import java.util.Arrays; - -/** - * @author Yuriy Zabrovarnyy - * @version 0.9, 09/08/2013 - */ - -public enum ErrorResponseCode { - - INTERNAL_ERROR_UNKNOWN(500, "internal_error", "Unknown internal server error occurs."), - INTERNAL_ERROR_NO_PARAMS(400, "bad_request", "Command parameters are not specified or otherwise malformed."), - BAD_REQUEST_NO_RP_ID(400, "bad_request", "rp_id is empty or not specified or is otherwise invalid (not registered)."), - BAD_REQUEST_NO_CODE(400, "bad_request", "'code' is empty or not specified."), - BAD_REQUEST_NO_STATE(400, "bad_request", "'state' is empty or not specified."), - BAD_REQUEST_STATE_NOT_VALID(400, "bad_request", "'state' is not registered."), - BAD_REQUEST_INVALID_CODE(400, "bad_request", "'code' is invalid."), - BAD_REQUEST_NO_RESOURCE(400, "bad_request_no_resource", "The 'resource' is empty or not specified."), - BAD_REQUEST_NO_REFRESH_TOKEN(400, "bad_request", "'refresh token' is empty or not specified."), - NO_ID_TOKEN_RETURNED(500, "no_id_token", "id_token is not returned. Please check: 1) OP log file for error (oxauth.log) 2) whether 'openid' scope is present for 'get_authorization_url' command"), - NO_ID_TOKEN_PARAM(400, "no_id_token", "id_token is not provided in request to jans_client_api."), - NO_ACCESS_TOKEN_RETURNED(500, "no_access_token", "access_token is not returned by OP. Please check OP configuration."), - ACCESS_TOKEN_INSUFFICIENT_SCOPE(403, "access_token_insufficient_scope", "access_token does not have `jans_client_api` scope. Make sure a) scope exists on AS b) register_site is registered with 'jans_client_api' scope c) get_client_token has 'jans_client_api' scope in request"), - INVALID_NONCE(400, "invalid_nonce", "Nonce value is not registered with jans_client_api."), - INVALID_ID_TOKEN_NO_NONCE(500, "invalid_id_token_no_nonce", "Invalid id_token. Nonce claim is missing from id_token."), - INVALID_STATE(400, "invalid_state", "State value is not registered by rp."), - INVALID_ID_TOKEN_BAD_NONCE(500, "invalid_id_token_bad_nonce", "Invalid id_token. Nonce value from token does not match nonce from request."), - INVALID_ID_TOKEN_BAD_AUDIENCE(500, "invalid_id_token_bad_audience", "Invalid id_token. Audience value from token does not match audience from request."), - INVALID_ID_TOKEN_NO_AUDIENCE(500, "invalid_id_token_no_audience", "Invalid id_token. Audience claim is missing from id_token."), - INVALID_ID_TOKEN_BAD_AUTHORIZED_PARTY(500, "invalid_id_token_bad_authorized_party", "Invalid id_token. Authorized party value from token does not match client_id of client."), - INVALID_ID_TOKEN_NO_AUTHORIZED_PARTY(500, "invalid_id_token_no_authorized_party", "Invalid id_token. Authorized party (`azp`) is missing in ID Token."), - INVALID_ID_TOKEN_EXPIRED(500, "invalid_id_token_expired", "Invalid id_token. id_token expired."), - INVALID_ID_TOKEN_NO_ISSUER(500, "invalid_id_token_no_issuer", "Invalid id_token. Issuer claim is missing from id_token."), - INVALID_ID_TOKEN_BAD_ISSUER(500, "invalid_id_token_bad_issuer", "Invalid id_token. Bad issuer."), - INVALID_ID_TOKEN_BAD_SIGNATURE(500, "invalid_id_token_bad_signature", "Invalid id_token. Bad signature."), - INVALID_ID_TOKEN_INVALID_ALGORITHM(500, "invalid_id_token_invalid_algorithm", "Invalid id_token. The algorithm used to sign the ID Token does not matches with `id_token_signed_response_alg` algorithm set during client registration.."), - INVALID_ID_TOKEN_UNKNOWN(500, "invalid_id_token_unknown", "Invalid id_token, validation fail due to exception, please check jans_client_api.log for details."), - INVALID_ACCESS_TOKEN_BAD_HASH(500, "invalid_access_token_bad_hash", "access_token is invalid. Hash of access_token does not match hash from id_token (at_hash)."), - INVALID_STATE_BAD_HASH(500, "invalid_state_bad_hash", "State is invalid. Hash of state does not match hash from id_token (s_hash)."), - INVALID_AUTHORIZATION_CODE_BAD_HASH(500, "invalid_authorization_code_bad_hash", "Authorization code is invalid. Hash of authorization code does not match hash from id_token (c_hash)."), - ERROR_AUTHORIZATION_CODE(500, "error_authorization_code", "Error Authorization code - Check keystorePath, keystorePassword, signatureAlgorithms, jansConfWebKeys, and credentials."), - INVALID_REGISTRATION_CLIENT_URL(500, "invalid_registration_client_url", "Registration client URL is invalid. Please check registration_client_url response parameter from IDP (http://openid.net/specs/openid-connect-registration-1_0.html#RegistrationResponse)."), - INVALID_RP_ID(400, "invalid_rp_id", "Invalid rp_id. Unable to find the site for rp_id. It does not exist or has been removed from the server. Please use the register_site command to register a site."), - INVALID_REQUEST(400, "invalid_request", "Request is invalid. It doesn't contains all required parameters or otherwise is malformed."), - INVALID_REQUEST_SCOPES_REQUIRED(400, "invalid_request", "Request is invalid. Scopes are required parameter in request."), - INVALID_CLIENT_SECRET_REQUIRED(400, "invalid_client_secret", "client_secret is required parameter in request (skip client_id if you wish to dynamically register client.)."), - INVALID_CLIENT_ID_REQUIRED(400, "invalid_client_id", "client_id is required parameter in request (skip client_secret if you wish to dynamically register client.)."), - UNSUPPORTED_OPERATION(500, "unsupported_operation", "Operation is not supported by server error."), - INVALID_OP_HOST(400, "invalid_op_host", "Invalid op_host (empty or blank)."), - INVALID_OP_CONFIGURATION_ENDPOINT(400, "invalid_op_configuration_endpoint", "Invalid op_configuration_endpoint (invalid or blank)."), - INVALID_OP_HOST_AND_CONFIGURATION_ENDPOINT(400, "invalid_op_host_and_configuration_endpoint", "Both op_host and op_configuration_endpoint are invalid (empty or blank). At least one parameter should be defined."), - INVALID_ALLOWED_OP_HOST_URL(400, "invalid_allowed_op_host_url", "Please check 1) The urls in allowed_op_hosts field of jans_client_api.yml are valid. 2) If op_host url is valid."), - RESTRICTED_OP_HOST(400, "restricted_op_host", "jans_client_api is not allowed to access op_host. Please check if op_host url is present in allowed_op_hosts field of jans_client_api.yml."), - BLANK_ACCESS_TOKEN(403, "blank_access_token", "access_token is blank. Command is protected by access_token, please provide valid token or otherwise switch off protection in configuration with protect_commands_with_access_token=false"), - INVALID_ACCESS_TOKEN(403, "invalid_access_token", "Invalid access_token. Command is protected by access_token, please provide valid token or otherwise switch off protection in configuration with protect_commands_with_access_token=false"), - NO_CLIENT_ID_IN_INTROSPECTION_RESPONSE(500, "invalid_introspection_response", "AS returned introspection response with empty/blank client_id which is required by jans_client_api. Please check your AS installation and make sure AS return client_id for introspection call (CE 3.1.0 or later)."), - INACTIVE_ACCESS_TOKEN(403, "inactive_access_token", "Inactive access_token. Command is protected by access_token, please provide valid token or otherwise switch off protection in configuration with protect_commands_with_access_token=false"), - INVALID_REDIRECT_URI(400, "invalid_redirect_uri", "Invalid redirect_uri (empty, blank or invalid)."), - REDIRECT_URI_HAS_FRAGMENT_COMPONENT(400, "redirect_uri_has_fragment_component", "Fragment component is not allowed in redirect uri."), - INVALID_SCOPE(400, "invalid_scope", "Invalid scope parameter (empty or blank)."), - INVALID_ACR_VALUES(400, "invalid_acr_values", "Invalid acr_values parameter (empty or blank)."), - INVALID_SIGNATURE_ALGORITHM(400, "invalid_algorithm", "Invalid algorithm provided. Valid algorithms are: " + Arrays.toString(SignatureAlgorithm.values())), - INVALID_KEY_ENCRYPTION_ALGORITHM(400, "invalid_algorithm", "Invalid algorithm provided. Valid algorithms are: " + Arrays.toString(KeyEncryptionAlgorithm.values())), - INVALID_SUBJECT_TYPE(400, "invalid_subject_type", "Invalid subject type provided. Valid algorithms are: " + Arrays.toString(SubjectType.values())), - INVALID_BLOCK_ENCRYPTION_ALGORITHM(400, "invalid_algorithm", "Invalid algorithm provided. Valid algorithms are: " + Arrays.toString(BlockEncryptionAlgorithm.values())), - NO_CONNECT_DISCOVERY_RESPONSE(500, "no_connect_discovery_response", "Unable to fetch Connect discovery response /.well-known/openid-configuration"), - NO_REGISTRATION_ENDPOINT(500, "invalid_request", "OP does not support dynamic client registration. Please register client manually and provide client_id and client_secret to register_site command."), - NO_UMA_DISCOVERY_RESPONSE(500, "no_uma_discovery_response", "Unable to fetch UMA discovery response /.well-known/uma2-configuration"), - NO_UMA_RESOURCES_TO_PROTECT(400, "invalid_uma_request", "Resources list to protect is empty or blank. Please check it according to protocol definition at " + CoreUtils.DOC_URL), - NO_UMA_HTTP_METHOD(400, "invalid_http_method", "http_method is not specified or otherwise not GET or POST or PUT or DELETE. Please check it according to protocol definition at " + CoreUtils.DOC_URL), - INVALID_UMA_SCOPES_PARAMETER(400, "invalid_uma_scope_parameter", "At least one of the scope passed as parameter isn't registered"), - NO_UMA_PATH_PARAMETER(400, "invalid_path_parameter", "path parameter is not specified or otherwise not valid"), - NO_UMA_TICKET_PARAMETER(400, "invalid_ticket_parameter", "ticket parameter is not specified or otherwise is not valid"), - NO_UMA_CLAIMS_REDIRECT_URI_PARAMETER(400, "invalid_claims_redirect_uri_parameter", "claims_redirect_uri parameter is not specified or otherwise is not valid"), - NO_UMA_RPT_PARAMETER(400, "invalid_rpt_parameter", "rpt parameter is not specified or otherwise is not valid"), - INVALID_CLAIM_TOKEN_OR_CLAIM_TOKEN_FORMAT(400, "invalid_claim_token_or_claim_token_form", "Claim token or claim token format is invalid."), - UMA_NEED_INFO(403, "need_info", "The authorization server needs additional information in order to determine whether the client is authorized to have these permissions."), - UMA_HTTP_METHOD_NOT_UNIQUE(400, "http_method_not_unique", "HTTP method defined in JSON must be unique within given PATH (but occurs more then one time)."), - UMA_FAILED_TO_VALIDATE_SCOPE_EXPRESSION(400, "invalid_scope_expression", "The scope expression is invalid. Please check the documentation and make sure it is a valid JsonLogic expression."), - UMA_PROTECTION_FAILED_BECAUSE_RESOURCES_ALREADY_EXISTS(400, "uma_protection_exists", "Server already has UMA Resources registered for this rp_id. It is possible to overwrite it if provide overwrite=true for uma_rs_protect command (existing resources will be removed and new UMA Resources added)."), - FAILED_TO_GET_END_SESSION_ENDPOINT(500, "no_end_session_endpoint_at_op", "OP does not provide end_session_endpoint at /.well-known/openid-configuration."), - FAILED_TO_GET_RPT(500, "internal_error", "Failed to get RPT."), - FAILED_TO_REMOVE_SITE(500, "remove_site_failed", "Failed to remove site."), - REDIRECT_URI_IS_NOT_REGISTERED(400, "redirect_uri_is_not_registered", "The authorization redirect uri is not registered."), - FAILED_TO_GET_DISCOVERY(500, "failed_to_get_discovery", "Failed to get OP discovery configuration."), - FAILED_TO_GET_ISSUER(500, "failed_to_get_issuer", "Failed to get OP Issuer. Please check 1) if correct `resource` parameter is passed to this command. 2) Rp log file for error details (jans_client_api.log)."), - INVALID_ISSUER_DISCOVERED(500, "invalid_issuer_discovered", "Discovered issuer not matched with issuer obtained from Webfinger."), - FAILED_TO_GET_REQUEST_URI(500, "failed_to_get_request_uri", "Failed to create `request_uri`."), - REQUEST_OBJECT_NOT_FOUND(404, "request_object_not_found", "Request object not found. The `request_uri` has either expired or it does not exist."), - BAD_REQUEST_NO_RP_HOST(400, "bad_request_no_rp_host", "'rp_host_url' is empty or not specified."), - PARAMETER_OUT_OF_BOUND(400, "parameter_out_of_bound", "Number of path parameter(s) more than required."), - SSL_HANDSHAKE_ERROR(500, "ssl_handshake_error", "Unable to find valid certification path to requested target. Please check if key_store_path in jans_client_api configuration is correct."), - INVALID_ALGORITHM(500, "invalid_algorithm", "Invalid algorithm provided (empty or null)."), - ALGORITHM_NOT_SUPPORTED(500, "algorithm_not_supported", "Algorithm not supported."), - KEY_ID_NOT_FOUND(500, "key_id_not_found", "`kid` is missing in `ID_TOKEN`. Unable to find matching key out of the Issuer's published set."), - NO_SUBJECT_IDENTIFIER(500, "no_subject_identifier", "ID Token is missing `sub` value."), - ID_TOKEN_WITHOUT_SIGNATURE_NOT_ALLOWED(400, "id_token_without_signature_not_allowed", "`ID_TOKEN` without signature is not allowed. To allow `ID_TOKEN` without signature set `accept_id_token_without_signature` field to 'true' in jans_client_api.yml."), - INVALID_ID_TOKEN_ISSUED_AT(500, "invalid_id_token_issued_at", "`ISSUED_AT` date is either invalid or missing from `ID_TOKEN`."), - INVALID_ID_TOKEN_EXPIRATION_TIME(500, "invalid_id_token_expiration_time", "EXPIRATION_TIME (`exp`) is either invalid or missing from `ID_TOKEN`."), - INVALID_ID_TOKEN_OLD_ISSUED_AT(500, "invalid_id_token_old_issued_at", "Invalid ID_TOKEN. `ISSUED_AT` date too far in the past"), - INVALID_SUBJECT_IDENTIFIER(500, "invalid_subject_identifier", "UserInfo `sub` value does not matches with `sub` value of ID_TOKEN."), - FAILED_TO_VERIFY_SUBJECT_IDENTIFIER(500, "failed_to_verify_subject_identifier", "Failed to verify subject identifier (`sub`) of UserInfo response. See jans_client_api logs for details."), - AT_HASH_NOT_FOUND(500, "at_hash_not_found", "`at_hash` is missing in `ID_TOKEN`."), - C_HASH_NOT_FOUND(500, "c_hash_not_found", "`c_hash` is missing in `ID_TOKEN`."), - S_HASH_NOT_FOUND(500, "s_hash_not_found", "`s_hash` is missing in `ID_TOKEN`."), - INVALID_AUTHORIZATION_RP_ID(400, "invalid_authorization_rp_id", "`rp_id` in `AuthorizationRpId` header is invalid. The `AuthorizationRpId` header should contain `rp_id` from `protect_commands_with_rp_id` field in config."), - AUTHORIZATION_RP_ID_NOT_FOUND(400, "authorization_rp_id_not_found", "`rp_id` in `AuthorizationRpId` header is not registered in jans_client_api."), - AUTHORIZATION_RP_ID_HEADER_NOT_FOUND(400, "authorization_rp_id_header_not_found", "`AuthorizationRpId` header is not present or invalid."), - NO_CLIENT_ID_RETURNED(500, "no_client_id_returned", "`client_id` is not returned from OP host. Please check OP log file for error (oxauth.log)."), - NO_CLIENT_SECRET_RETURNED(500, "no_client_secret_returned", "`client_secret` is not returned from OP host. Please check: 1) OP log file for error (oxauth.log) 2) whether `returnClientSecretOnRead` configuration property is set to true on OP host."), - RP_ACCESS_DENIED(403, "rp_access_denied", "The caller is not allowed to make request to jans_client_api. To allow add ip_address of caller in `bind_ip_addresses` field of `jans_client_api.yml`."), - JWKS_GENERATION_DISABLE(500, "jwks_generation_disable", "Relying party JWKS generation is disabled in running jans_client_api instance. To enable it set `enable_jwks_generation` field to true in `jans_client_api.yml`. Also set values of `crypt_provider_key_store_path` and `crypt_provider_key_store_password`."); - - private final int httpStatus; - private final String code; - private final String description; - - ErrorResponseCode(int httpStatus, String code, String description) { - this.code = code; - this.description = description; - this.httpStatus = httpStatus; - } - - public int getHttpStatus() { - return httpStatus; - } - - public String getDescription() { - return description; - } - - @JsonValue - public String getCode() { - return code; - } - - @JsonCreator - public static ErrorResponseCode fromValue(String v) { - if (StringUtils.isNotBlank(v)) { - for (ErrorResponseCode t : values()) { - if (t.getCode().equalsIgnoreCase(v)) { - return t; - } - } - } - return null; - } - - @Override - public String toString() { - final StringBuilder sb = new StringBuilder(); - sb.append("ErrorResponseCode"); - sb.append("{value='").append(code).append('\''); - sb.append(", description='").append(description).append('\''); - sb.append('}'); - return sb.toString(); - } -} diff --git a/jans-client-api/common/src/main/java/io/jans/ca/common/ExpiredObject.java b/jans-client-api/common/src/main/java/io/jans/ca/common/ExpiredObject.java deleted file mode 100644 index 9372152a4a5..00000000000 --- a/jans-client-api/common/src/main/java/io/jans/ca/common/ExpiredObject.java +++ /dev/null @@ -1,142 +0,0 @@ -package io.jans.ca.common; - -import com.google.common.base.Preconditions; -import com.google.common.base.Strings; -import io.jans.orm.annotation.*; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import java.io.Serializable; -import java.util.Calendar; -import java.util.Date; - -@DataEntry -@ObjectClass("rpExpiredObject") -public class ExpiredObject implements Serializable { - - @DN - private String dn; - @AttributeName(name = "rpId") - private String key; - @AttributeName(name = "dat") - private String value; - @AttributeName(name = "iat") - private Date iat; - @AttributeName(name = "exp") - private Date exp; - @AttributeName(name = "jansTyp") - private String typeString; - private ExpiredObjectType type; - @Expiration - private Integer ttl; // in seconds - - private static final Logger LOG = LoggerFactory.getLogger(ExpiredObject.class); - - public ExpiredObject() { - } - - public ExpiredObject(String key, String value, ExpiredObjectType expiredObjectType, int expiredObjectExpirationInMins) { - Preconditions.checkState(!Strings.isNullOrEmpty(key), "Expired Object contains blank or null key. Please specify valid Expired Object."); - Preconditions.checkState(!Strings.isNullOrEmpty(value), "Expired Object contains blank or null value. Please specify valid Expired Object."); - - Calendar cal = Calendar.getInstance(); - - this.key = key; - this.type = expiredObjectType; - this.typeString = expiredObjectType.getValue(); - this.iat = cal.getTime(); - cal.add(Calendar.MINUTE, expiredObjectExpirationInMins); - this.exp = cal.getTime(); - this.ttl = expiredObjectExpirationInMins * 60; - this.value = value; - } - - public ExpiredObject(String key, String value, ExpiredObjectType expiredObjectType, Date iat, Date exp) { - Preconditions.checkState(!Strings.isNullOrEmpty(key), "Expired Object contains blank or null value. Please specify valid Expired Object."); - Preconditions.checkState(!Strings.isNullOrEmpty(value), "Expired Object contains blank or null value. Please specify valid Expired Object."); - this.key = key; - this.type = expiredObjectType; - this.typeString = expiredObjectType.getValue(); - this.iat = iat; - this.exp = exp; - this.value = value; - } - - public String getDn() { - return this.dn; - } - - public void setDn(String dn) { - this.dn = dn; - } - - public String getKey() { - return key; - } - - public void setKey(String key) { - this.key = key; - } - - public String getValue() { - return value; - } - - public void setValue(String value) { - this.value = value; - } - - public ExpiredObjectType getType() { - return type; - } - - public void setType(ExpiredObjectType type) { - this.type = type; - } - - public String getTypeString() { - return this.typeString; - } - - public void setTypeString(String typeString) { - this.typeString = typeString; - } - - public Integer getTtl() { - return ttl; - } - - public void setTtl(Integer ttl) { - this.ttl = ttl; - } - - public Date getIat() { - return iat; - } - - public void setIat(Date iat) { - this.iat = iat; - } - - public Date getExp() { - return exp; - } - - public void setExp(Date exp) { - this.exp = exp; - } - - @Override - public String toString() { - return "ExpiredObject{" + - "dn='" + dn + '\'' + - ", key='" + key + '\'' + - ", value='" + value + '\'' + - ", iat=" + iat + - ", exp=" + exp + - ", type=" + type.getValue() + - ", ttl=" + ttl + - '}'; - } - -} diff --git a/jans-client-api/common/src/main/java/io/jans/ca/common/ExpiredObjectType.java b/jans-client-api/common/src/main/java/io/jans/ca/common/ExpiredObjectType.java deleted file mode 100644 index 9ce47c57e55..00000000000 --- a/jans-client-api/common/src/main/java/io/jans/ca/common/ExpiredObjectType.java +++ /dev/null @@ -1,35 +0,0 @@ -package io.jans.ca.common; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; -import org.apache.commons.lang.StringUtils; - -public enum ExpiredObjectType { - STATE("state"), - NONCE("nonce"), - REQUEST_OBJECT("request_object"), - JWKS("jwks"); - - private final String value; - - ExpiredObjectType(String p_value) { - value = p_value; - } - - @JsonValue - public String getValue() { - return value; - } - - @JsonCreator - public static ExpiredObjectType fromValue(String v) { - if (StringUtils.isNotBlank(v)) { - for (ExpiredObjectType t : values()) { - if (t.getValue().equalsIgnoreCase(v)) { - return t; - } - } - } - return null; - } -} diff --git a/jans-client-api/common/src/main/java/io/jans/ca/common/Jackson2.java b/jans-client-api/common/src/main/java/io/jans/ca/common/Jackson2.java deleted file mode 100644 index 9af8e28cc51..00000000000 --- a/jans-client-api/common/src/main/java/io/jans/ca/common/Jackson2.java +++ /dev/null @@ -1,80 +0,0 @@ -package io.jans.ca.common; - -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.databind.*; -import com.fasterxml.jackson.databind.introspect.JacksonAnnotationIntrospector; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import java.io.IOException; - -/** - * Sticks to jackson 2 (2.9.5). We got this problem due to migration to dropwizard 1.3.1 which is using jackson 2.9.5 - * - * @author yuriyz - */ -public class Jackson2 { - - private static final Logger LOG = LoggerFactory.getLogger(Jackson2.class); - - private Jackson2() { - } - - /** - * Lazy initialization of jackson mapper via static holder - */ - private static class JacksonMapperHolder { - private static final ObjectMapper MAPPER = jsonMapper(); - - public static ObjectMapper jsonMapper() { - final AnnotationIntrospector jackson = new JacksonAnnotationIntrospector(); - - final ObjectMapper mapper = new ObjectMapper(); - final DeserializationConfig deserializationConfig = mapper.getDeserializationConfig().with(jackson); - final SerializationConfig serializationConfig = mapper.getSerializationConfig().with(jackson); - if (deserializationConfig != null && serializationConfig != null) { - // do nothing for now - } - return mapper; - } - } - - public static ObjectMapper createJsonMapper() { - return JacksonMapperHolder.MAPPER; - } - - public static String asJson(Object p_object) throws IOException { - final ObjectMapper mapper = createJsonMapper().configure(SerializationFeature.WRAP_ROOT_VALUE, false); - return mapper.writeValueAsString(p_object); - } - - public static ObjectMapper createRpMapper() { - return createJsonMapperWithoutEmptyAttributes(); - } - - public static ObjectMapper createJsonMapperWithoutEmptyAttributes() { - final ObjectMapper mapper = createJsonMapper().configure(SerializationFeature.WRAP_ROOT_VALUE, false); - mapper.setSerializationInclusion(JsonInclude.Include.NON_NULL); - mapper.setSerializationInclusion(JsonInclude.Include.NON_EMPTY); - return mapper; - } - - public static String serializeWithoutNulls(Object p_object) throws IOException { - final ObjectMapper mapper = createRpMapper(); - return mapper.writeValueAsString(p_object); - } - - public static String asJsonSilently(Object p_object) { - try { - final ObjectMapper mapper = createJsonMapper().configure(SerializationFeature.WRAP_ROOT_VALUE, false); - return mapper.writeValueAsString(p_object); - } catch (Exception e) { - LOG.error("Failed to serialize object into json.", e); - return ""; - } - } - - public static JsonNode asOldNode(JsonNode node) throws IOException { - return Jackson2.createJsonMapper().readTree(Jackson2.asJsonSilently(node)); - } -} diff --git a/jans-client-api/common/src/main/java/io/jans/ca/common/PersistenceConfigKeys.java b/jans-client-api/common/src/main/java/io/jans/ca/common/PersistenceConfigKeys.java deleted file mode 100644 index c4cd3ccd572..00000000000 --- a/jans-client-api/common/src/main/java/io/jans/ca/common/PersistenceConfigKeys.java +++ /dev/null @@ -1,21 +0,0 @@ -package io.jans.ca.common; - -public enum PersistenceConfigKeys { - - BaseDn("baseDn"), - PersistenceType("persistence.type"), - BindPassword("bindPassword"), - EncodeSalt("encodeSalt"); - - private String keyName; - - private PersistenceConfigKeys(String keyName) { - - this.keyName = keyName; - } - - public String getKeyName() { - - return this.keyName; - } -} diff --git a/jans-client-api/common/src/main/java/io/jans/ca/common/ReadResult.java b/jans-client-api/common/src/main/java/io/jans/ca/common/ReadResult.java deleted file mode 100644 index 05d05cac95a..00000000000 --- a/jans-client-api/common/src/main/java/io/jans/ca/common/ReadResult.java +++ /dev/null @@ -1,53 +0,0 @@ -/** - * All rights reserved -- Copyright 2015 Gluu Inc. - */ -package io.jans.ca.common; - -/** - * @author Yuriy Zabrovarnyy - * @version 0.9, 28/07/2013 - */ -public class ReadResult { - - private String m_command; - private String m_leftString; - - public ReadResult() { - } - - public ReadResult(String command, String leftString) { - m_command = command; - m_leftString = leftString; - } - - public String getCommand() { - return m_command; - } - - public void setCommand(String command) { - m_command = command; - } - - public String getLeftString() { - return m_leftString; - } - - public void setLeftString(String leftString) { - m_leftString = leftString; - } - - /** - * Returns string representation of object - * - * @return string representation of object - */ - @Override - public String toString() { - final StringBuilder sb = new StringBuilder(); - sb.append("ReadResult"); - sb.append("{m_command='").append(m_command).append('\''); - sb.append(", m_leftString='").append(m_leftString).append('\''); - sb.append('}'); - return sb.toString(); - } -} diff --git a/jans-client-api/common/src/main/java/io/jans/ca/common/introspection/CorrectRptIntrospectionResponse.java b/jans-client-api/common/src/main/java/io/jans/ca/common/introspection/CorrectRptIntrospectionResponse.java deleted file mode 100644 index b8742135d1f..00000000000 --- a/jans-client-api/common/src/main/java/io/jans/ca/common/introspection/CorrectRptIntrospectionResponse.java +++ /dev/null @@ -1,154 +0,0 @@ -package io.jans.ca.common.introspection; - -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import org.jboss.resteasy.annotations.providers.jaxb.IgnoreMediaTypes; - -import jakarta.xml.bind.annotation.XmlElement; -import jakarta.xml.bind.annotation.XmlRootElement; -import java.util.List; - -/** - * @author yuriyz - */ -@IgnoreMediaTypes("application/*+json") -@JsonPropertyOrder({"active", "exp", "iat", "nbf", "permissions", "client_id", "sub", "aud", "iss", "jti"}) -@XmlRootElement -@JsonIgnoreProperties(ignoreUnknown = true) -public class CorrectRptIntrospectionResponse { - - private boolean active; // according spec, must be "active" http://tools.ietf.org/html/draft-richer-oauth-introspection-03#section-2.2 - private Integer expiresAt; - private Integer issuedAt; - private Integer nbf; - private String clientId; - private String sub; - private String aud; - private String iss; - private String jti; - private List permissions; - - public CorrectRptIntrospectionResponse() { - } - - public CorrectRptIntrospectionResponse(boolean status) { - this.active = status; - } - - @JsonProperty(value = "aud") - @XmlElement(name = "aud") - public String getAud() { - return aud; - } - - public void setAud(String aud) { - this.aud = aud; - } - - @JsonProperty(value = "iss") - @XmlElement(name = "iss") - public String getIss() { - return iss; - } - - public void setIss(String iss) { - this.iss = iss; - } - - @JsonProperty(value = "jti") - @XmlElement(name = "jti") - public String getJti() { - return jti; - } - - public void setJti(String jti) { - this.jti = jti; - } - - @JsonProperty(value = "sub") - @XmlElement(name = "sub") - public String getSub() { - return sub; - } - - public void setSub(String sub) { - this.sub = sub; - } - - @JsonProperty(value = "client_id") - @XmlElement(name = "client_id") - public String getClientId() { - return clientId; - } - - public void setClientId(String clientId) { - this.clientId = clientId; - } - - @JsonProperty(value = "active") - @XmlElement(name = "active") - public boolean getActive() { - return active; - } - - public void setActive(boolean status) { - this.active = status; - } - - @JsonProperty(value = "nbf") - @XmlElement(name = "nbf") - public Integer getNbf() { - return nbf; - } - - public void setNbf(Integer nbf) { - this.nbf = nbf; - } - - @JsonProperty(value = "exp") - @XmlElement(name = "exp") - public Integer getExpiresAt() { - return expiresAt; - } - - public void setExpiresAt(Integer expiresAt) { - this.expiresAt = expiresAt; - } - - @JsonProperty(value = "iat") - @XmlElement(name = "iat") - public Integer getIssuedAt() { - return issuedAt; - } - - public void setIssuedAt(Integer p_issuedAt) { - issuedAt = p_issuedAt; - } - - @JsonProperty(value = "permissions") - @XmlElement(name = "permissions") - public List getPermissions() { - return permissions; - } - - public void setPermissions(List p_permissions) { - permissions = p_permissions; - } - - @Override - public String toString() { - return "RptStatusResponse" + - "{active=" + active + - ", expiresAt=" + expiresAt + - ", issuedAt=" + issuedAt + - ", nbf=" + nbf + - ", clientId=" + clientId + - ", sub=" + sub + - ", aud=" + aud + - ", iss=" + iss + - ", jti=" + jti + - ", permissions=" + permissions + - '}'; - } -} diff --git a/jans-client-api/common/src/main/java/io/jans/ca/common/introspection/CorrectUmaPermission.java b/jans-client-api/common/src/main/java/io/jans/ca/common/introspection/CorrectUmaPermission.java deleted file mode 100644 index 40af451afab..00000000000 --- a/jans-client-api/common/src/main/java/io/jans/ca/common/introspection/CorrectUmaPermission.java +++ /dev/null @@ -1,72 +0,0 @@ -package io.jans.ca.common.introspection; - -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import org.jboss.resteasy.annotations.providers.jaxb.IgnoreMediaTypes; - -import jakarta.xml.bind.annotation.XmlElement; -import jakarta.xml.bind.annotation.XmlRootElement; -import java.io.Serializable; -import java.util.List; - -/** - * @author yuriyz - */ -@IgnoreMediaTypes("application/*+json") -@JsonPropertyOrder({"resource_id", "resource_scopes", "exp"}) -@JsonIgnoreProperties(ignoreUnknown = true) -@XmlRootElement -public class CorrectUmaPermission implements Serializable { - - private String resourceId; - private List scopes; - private Integer expiresAt; - - public CorrectUmaPermission() { - } - - public CorrectUmaPermission(String resourceId, List scopes) { - this.resourceId = resourceId; - this.scopes = scopes; - } - - @JsonProperty(value = "resource_id") - @XmlElement(name = "resource_id") - public String getResourceId() { - return resourceId; - } - - public void setResourceId(String resourceId) { - this.resourceId = resourceId; - } - - @JsonProperty(value = "resource_scopes") - @XmlElement(name = "resource_scopes") - public List getScopes() { - return scopes; - } - - public void setScopes(List scopes) { - this.scopes = scopes; - } - - @JsonProperty(value = "exp") - @XmlElement(name = "exp") - public Integer getExpiresAt() { - return expiresAt; - } - - public void setExpiresAt(Integer expiresAt) { - this.expiresAt = expiresAt; - } - - @Override - public String toString() { - return "UmaPermission{" + - "resourceId='" + resourceId + '\'' + - ", scopes=" + scopes + - ", expiresAt=" + expiresAt + - '}'; - } -} \ No newline at end of file diff --git a/jans-client-api/common/src/main/java/io/jans/ca/common/params/AuthorizationCodeFlowParams.java b/jans-client-api/common/src/main/java/io/jans/ca/common/params/AuthorizationCodeFlowParams.java deleted file mode 100644 index 08006064b82..00000000000 --- a/jans-client-api/common/src/main/java/io/jans/ca/common/params/AuthorizationCodeFlowParams.java +++ /dev/null @@ -1,133 +0,0 @@ -/** - * All rights reserved -- Copyright 2015 Gluu Inc. - */ - -package io.jans.ca.common.params; - - -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** - * @author Yuriy Zabrovarnyy - * @version 0.9, 19/06/2015 - */ - -@JsonIgnoreProperties(ignoreUnknown = true) -public class AuthorizationCodeFlowParams implements HasRpIdParams { - - @JsonProperty(value = "rp_id") - private String rp_id; - @JsonProperty(value = "redirect_url") - private String redirect_url; - @JsonProperty(value = "client_id") - private String client_id; - @JsonProperty(value = "client_secret") - private String client_secret; - @JsonProperty(value = "user_id") - private String user_id; - @JsonProperty(value = "user_secret") - private String user_secret; - @JsonProperty(value = "scope") - private String scope; - @JsonProperty(value = "nonce") - private String nonce; - @JsonProperty(value = "acr") - private String acr; - - public AuthorizationCodeFlowParams() { - } - - public String getRpId() { - return rp_id; - } - - public void setRpId(String rpId) { - this.rp_id = rpId; - } - - public String getAcr() { - return acr; - } - - public void setAcr(String acr) { - this.acr = acr; - } - - public String getClientSecret() { - return client_secret; - } - - public void setClientSecret(String clientSecret) { - this.client_secret = clientSecret; - } - - public String getNonce() { - return nonce; - } - - public void setNonce(String nonce) { - this.nonce = nonce; - } - - public String getScope() { - return scope; - } - - public void setScope(String scope) { - this.scope = scope; - } - - public String getRedirectUrl() { - return redirect_url; - } - - public void setRedirectUrl(String p_redirectUrl) { - redirect_url = p_redirectUrl; - } - - public String getClientId() { - return client_id; - } - - public void setClientId(String p_clientId) { - client_id = p_clientId; - } - - public String getUserId() { - return user_id; - } - - public void setUserId(String p_userId) { - user_id = p_userId; - } - - public String getUserSecret() { - return user_secret; - } - - public void setUserSecret(String p_userSecret) { - user_secret = p_userSecret; - } - - /** - * Returns string representation of object - * - * @return string representation of object - */ - @Override - public String toString() { - final StringBuilder sb = new StringBuilder(); - sb.append("AuthorizationCodeFlowParams"); - sb.append("{rp_id='").append(rp_id).append('\''); - sb.append(", redirect_url='").append(redirect_url).append('\''); - sb.append(", client_id='").append(client_id).append('\''); - sb.append(", user_id='").append(user_id).append('\''); - sb.append(", user_secret='").append(user_secret).append('\''); - sb.append(", scope='").append(scope).append('\''); - sb.append(", nonce='").append(nonce).append('\''); - sb.append(", acr='").append(acr).append('\''); - sb.append('}'); - return sb.toString(); - } -} \ No newline at end of file diff --git a/jans-client-api/common/src/main/java/io/jans/ca/common/params/CheckAccessTokenParams.java b/jans-client-api/common/src/main/java/io/jans/ca/common/params/CheckAccessTokenParams.java deleted file mode 100644 index 78e8ef66af2..00000000000 --- a/jans-client-api/common/src/main/java/io/jans/ca/common/params/CheckAccessTokenParams.java +++ /dev/null @@ -1,102 +0,0 @@ -/** - * All rights reserved -- Copyright 2015 Gluu Inc. - */ -package io.jans.ca.common.params; - -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** - * Check access token parameters. - * - * @author Yuriy Zabrovarnyy - * @version 0.9, 23/10/2013 - */ - -@JsonIgnoreProperties(ignoreUnknown = true) -public class CheckAccessTokenParams implements HasRpIdParams { - - /** - * rp ID - */ - @JsonProperty(value = "rp_id") - private String rp_id; - - /** - * Id token - */ - @JsonProperty(value = "id_token") - private String id_token; - - /** - * Access token - */ - @JsonProperty(value = "access_token") - private String access_token; - - /** - * Constructor - */ - public CheckAccessTokenParams() { - } - - public String getRpId() { - return rp_id; - } - - public void setRpId(String rpId) { - this.rp_id = rpId; - } - - /** - * Gets id token. - * - * @return id token - */ - public String getIdToken() { - return id_token; - } - - /** - * Sets id token. - * - * @param p_idToken id token - */ - public void setIdToken(String p_idToken) { - id_token = p_idToken; - } - - /** - * Gets access token. - * - * @return access token - */ - public String getAccessToken() { - return access_token; - } - - /** - * Sets access token. - * - * @param p_accessToken access token - */ - public void setAccessToken(String p_accessToken) { - access_token = p_accessToken; - } - - /** - * Returns string representation of object - * - * @return string representation of object - */ - @Override - public String toString() { - final StringBuilder sb = new StringBuilder(); - sb.append("CheckAccessTokenParams"); - sb.append("{rp_id='").append(rp_id).append('\''); - sb.append(", id_token='").append(id_token).append('\''); - sb.append(", access_token='").append(access_token).append('\''); - sb.append('}'); - return sb.toString(); - } -} diff --git a/jans-client-api/common/src/main/java/io/jans/ca/common/params/CheckIdTokenParams.java b/jans-client-api/common/src/main/java/io/jans/ca/common/params/CheckIdTokenParams.java deleted file mode 100644 index 2b6ec0f374f..00000000000 --- a/jans-client-api/common/src/main/java/io/jans/ca/common/params/CheckIdTokenParams.java +++ /dev/null @@ -1,99 +0,0 @@ -/** - * All rights reserved -- Copyright 2015 Gluu Inc. - */ -package io.jans.ca.common.params; - -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** - * @author Yuriy Zabrovarnyy - * @version 0.9, 21/10/2013 - */ - -@JsonIgnoreProperties(ignoreUnknown = true) -public class CheckIdTokenParams implements HasRpIdParams { - - @JsonProperty(value = "rp_id") - private String rp_id; - @JsonProperty(value = "id_token") - private String id_token; - @JsonProperty(value = "nonce") - private String nonce; - @JsonProperty(value = "state") - private String state; - @JsonProperty(value = "code") - private String code; - @JsonProperty(value = "access_token") - private String access_token; - - public CheckIdTokenParams() { - } - - public String getNonce() { - return nonce; - } - - public void setNonce(String nonce) { - this.nonce = nonce; - } - - public String getRpId() { - return rp_id; - } - - public void setRpId(String rpId) { - this.rp_id = rpId; - } - - public String getIdToken() { - return id_token; - } - - public void setIdToken(String p_idToken) { - id_token = p_idToken; - } - - public String getCode() { - return code; - } - - public void setCode(String code) { - this.code = code; - } - - public String getAccessToken() { - return access_token; - } - - public void setAccessToken(String access_token) { - this.access_token = access_token; - } - - public String getState() { - return state; - } - - public void setState(String state) { - this.state = state; - } - - /** - * Returns string representation of object - * - * @return string representation of object - */ - @Override - public String toString() { - final StringBuilder sb = new StringBuilder(); - sb.append("CheckIdTokenParams"); - sb.append("{id_token='").append(id_token).append('\''); - sb.append(", rp_id='").append(rp_id).append('\''); - sb.append(", nonce='").append(nonce).append('\''); - sb.append(", code='").append(code).append('\''); - sb.append(", access_token='").append(access_token).append('\''); - sb.append(", state='").append(state).append('\''); - sb.append('}'); - return sb.toString(); - } -} diff --git a/jans-client-api/common/src/main/java/io/jans/ca/common/params/EmptyParams.java b/jans-client-api/common/src/main/java/io/jans/ca/common/params/EmptyParams.java deleted file mode 100644 index 5d56ecf8292..00000000000 --- a/jans-client-api/common/src/main/java/io/jans/ca/common/params/EmptyParams.java +++ /dev/null @@ -1,12 +0,0 @@ -package io.jans.ca.common.params; - -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; - -/** - * @author Yuriy Zabrovarnyy - * @version 0.9, 06/06/2016 - */ - -@JsonIgnoreProperties(ignoreUnknown = true) -public class EmptyParams implements IParams { -} diff --git a/jans-client-api/common/src/main/java/io/jans/ca/common/params/GetAccessTokenByRefreshTokenParams.java b/jans-client-api/common/src/main/java/io/jans/ca/common/params/GetAccessTokenByRefreshTokenParams.java deleted file mode 100644 index 2891919e924..00000000000 --- a/jans-client-api/common/src/main/java/io/jans/ca/common/params/GetAccessTokenByRefreshTokenParams.java +++ /dev/null @@ -1,53 +0,0 @@ -package io.jans.ca.common.params; - -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonProperty; - -import java.util.List; - -/** - * @author yuriyz - */ -@JsonIgnoreProperties(ignoreUnknown = true) -public class GetAccessTokenByRefreshTokenParams implements HasRpIdParams { - - @JsonProperty(value = "rp_id") - private String rp_id; - @JsonProperty(value = "refresh_token") - private String refresh_token; - @JsonProperty(value = "scope") - private List scope; - - public String getRpId() { - return rp_id; - } - - public void setRpId(String rpId) { - this.rp_id = rpId; - } - - public String getRefreshToken() { - return refresh_token; - } - - public void setRefreshToken(String refreshToken) { - this.refresh_token = refreshToken; - } - - public List getScope() { - return scope; - } - - public void setScope(List scope) { - this.scope = scope; - } - - @Override - public String toString() { - return "GetAccessTokenByRefreshTokenParams{" + - "rp_id='" + rp_id + '\'' + - ", refresh_token='" + refresh_token + '\'' + - ", scope=" + scope + - '}'; - } -} diff --git a/jans-client-api/common/src/main/java/io/jans/ca/common/params/GetAuthorizationCodeParams.java b/jans-client-api/common/src/main/java/io/jans/ca/common/params/GetAuthorizationCodeParams.java deleted file mode 100644 index 53b4d087cbd..00000000000 --- a/jans-client-api/common/src/main/java/io/jans/ca/common/params/GetAuthorizationCodeParams.java +++ /dev/null @@ -1,102 +0,0 @@ -package io.jans.ca.common.params; - -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonProperty; - -import java.util.List; - -/** - * @author Yuriy Zabrovarnyy - * @version 0.9, 06/10/2015 - */ - -@JsonIgnoreProperties(ignoreUnknown = true) -public class GetAuthorizationCodeParams implements HasRpIdParams { - - @JsonProperty(value = "rp_id") - private String rp_id; - @JsonProperty(value = "acr_values") - private List acr_values; - @JsonProperty(value = "username") - private String username; - @JsonProperty(value = "password") - private String password; - @JsonProperty(value = "state") - private String state; - @JsonProperty(value = "nonce") - private String nonce; - @JsonProperty(value = "request") - private String request; - - public GetAuthorizationCodeParams() { - } - - public String getNonce() { - return nonce; - } - - public void setNonce(String nonce) { - this.nonce = nonce; - } - - public String getState() { - return state; - } - - public void setState(String state) { - this.state = state; - } - - public String getPassword() { - return password; - } - - public void setPassword(String password) { - this.password = password; - } - - public String getUsername() { - return username; - } - - public void setUsername(String username) { - this.username = username; - } - - public String getRpId() { - return rp_id; - } - - public void setRpId(String rpId) { - this.rp_id = rpId; - } - - public List getAcrValues() { - return acr_values; - } - - public void setAcrValues(List acrValues) { - this.acr_values = acrValues; - } - - public String getRequest() { - return request; - } - - public void setRequest(String request) { - this.request = request; - } - - @Override - public String toString() { - final StringBuilder sb = new StringBuilder(); - sb.append("GetAuthorizationCodeParams"); - sb.append("{acr_values=").append(acr_values); - sb.append(", rp_id='").append(rp_id).append('\''); - sb.append(", username='").append(username).append('\''); - sb.append(", password='").append(password).append('\''); - sb.append(", state='").append(state).append('\''); - sb.append('}'); - return sb.toString(); - } -} diff --git a/jans-client-api/common/src/main/java/io/jans/ca/common/params/GetAuthorizationUrlParams.java b/jans-client-api/common/src/main/java/io/jans/ca/common/params/GetAuthorizationUrlParams.java deleted file mode 100644 index 05c8db9725e..00000000000 --- a/jans-client-api/common/src/main/java/io/jans/ca/common/params/GetAuthorizationUrlParams.java +++ /dev/null @@ -1,165 +0,0 @@ -package io.jans.ca.common.params; - -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonProperty; - -import java.util.List; -import java.util.Map; - -/** - * @author Yuriy Zabrovarnyy - * @version 0.9, 22/09/2015 - */ - -@JsonIgnoreProperties(ignoreUnknown = true) -public class GetAuthorizationUrlParams implements HasRpIdParams { - - @JsonProperty(value = "rp_id") - private String rp_id; - @JsonProperty(value = "acr_values") - private List acr_values; - @JsonProperty(value = "prompt") - private String prompt; - @JsonProperty(value = "scope") - private List scope; - @JsonProperty(value = "hd") - private String hd; // https://developers.google.com/identity/protocols/OpenIDConnect#hd-param - @JsonProperty(value = "state") - private String state; - @JsonProperty(value = "nonce") - private String nonce; - @JsonProperty(value = "custom_parameters") - private Map custom_parameters; - @JsonProperty(value = "params") - private Map params; - @JsonProperty(value = "redirect_uri") - private String redirect_uri; - @JsonProperty(value = "response_types") - private List response_types; - - public GetAuthorizationUrlParams() { - } - - public Map getCustomParameters() { - return custom_parameters; - } - - public void setCustomParameters(Map customParameters) { - this.custom_parameters = customParameters; - } - - public String getHostedDomain() { - return hd; - } - - public void setHostedDomain(String hostedDomain) { - this.hd = hostedDomain; - } - - public List getScope() { - return scope; - } - - public void setScope(List scope) { - this.scope = scope; - } - - public String getPrompt() { - return prompt; - } - - public void setPrompt(String prompt) { - this.prompt = prompt; - } - - public String getRpId() { - return rp_id; - } - - public void setRpId(String rpId) { - this.rp_id = rpId; - } - - public List getAcrValues() { - return acr_values; - } - - public void setAcrValues(List acrValues) { - this.acr_values = acrValues; - } - - public Map getParams() { - return params; - } - - public void setParams(Map params) { - this.params = params; - } - - public String getState() { - return state; - } - - public void setState(String state) { - this.state = state; - } - - public String getRedirectUri() { - return redirect_uri; - } - - public void setRedirectUri(String redirectUri) { - this.redirect_uri = redirectUri; - } - - public List getResponseTypes() { - return response_types; - } - - public void setResponseTypes(List responseTypes) { - this.response_types = responseTypes; - } - - public String getNonce() { - return nonce; - } - - public void setNonce(String nonce) { - this.nonce = nonce; - } - - @Override - public boolean equals(Object o) { - if (this == o) return true; - if (o == null || getClass() != o.getClass()) return false; - - GetAuthorizationUrlParams that = (GetAuthorizationUrlParams) o; - - return !(acr_values != null ? !acr_values.equals(that.acr_values) : that.acr_values != null) && !(rp_id != null ? !rp_id.equals(that.rp_id) : that.rp_id != null); - - } - - @Override - public int hashCode() { - int result = rp_id != null ? rp_id.hashCode() : 0; - result = 31 * result + (acr_values != null ? acr_values.hashCode() : 0); - return result; - } - - @Override - public String toString() { - return "GetAuthorizationUrlParams{" + - "rp_id='" + rp_id + '\'' + - ", acr_values=" + acr_values + - ", prompt='" + prompt + '\'' + - ", scope=" + scope + - ", hd='" + hd + '\'' + - ", params=" + params + - ", custom_parameters=" + custom_parameters + - ", redirect_uri='" + redirect_uri + '\'' + - ", state='" + state + '\'' + - ", nonce='" + nonce + '\'' + - ", response_types=" + response_types + '\'' + - '}'; - } -} diff --git a/jans-client-api/common/src/main/java/io/jans/ca/common/params/GetClientTokenParams.java b/jans-client-api/common/src/main/java/io/jans/ca/common/params/GetClientTokenParams.java deleted file mode 100644 index fb0f65f79dd..00000000000 --- a/jans-client-api/common/src/main/java/io/jans/ca/common/params/GetClientTokenParams.java +++ /dev/null @@ -1,120 +0,0 @@ -package io.jans.ca.common.params; - -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonProperty; - -import java.util.List; - -/** - * @author Yuriy Zabrovarnyy - * @version 0.9, 31/03/2017 - */ - -@JsonIgnoreProperties(ignoreUnknown = true) -public class GetClientTokenParams implements IParams { - - @JsonProperty(value = "client_id") - private String client_id; - @JsonProperty(value = "client_secret") - private String client_secret; - @JsonProperty(value = "op_host") - private String op_host; - @JsonProperty(value = "op_discovery_path") - private String op_discovery_path; - @JsonProperty(value = "op_configuration_endpoint") - private String op_configuration_endpoint; - @JsonProperty(value = "scope") - private List scope; - @JsonProperty(value = "authentication_method") - private String authentication_method; - @JsonProperty(value = "algorithm") - private String algorithm; - @JsonProperty(value = "key_id") - private String key_id; - - public String getOpDiscoveryPath() { - return op_discovery_path; - } - - public void setOpDiscoveryPath(String opDiscoveryPath) { - this.op_discovery_path = opDiscoveryPath; - } - - public String getOpConfigurationEndpoint() { - return op_configuration_endpoint; - } - - public void setOpConfigurationEndpoint(String op_configuration_endpoint) { - this.op_configuration_endpoint = op_configuration_endpoint; - } - - public String getClientId() { - return client_id; - } - - public void setClientId(String clientId) { - this.client_id = clientId; - } - - public String getClientSecret() { - return client_secret; - } - - public void setClientSecret(String clientSecret) { - this.client_secret = clientSecret; - } - - public String getOpHost() { - return op_host; - } - - public void setOpHost(String opHost) { - this.op_host = opHost; - } - - public List getScope() { - return scope; - } - - public void setScope(List scope) { - this.scope = scope; - } - - public String getAuthenticationMethod() { - return authentication_method; - } - - public void setAuthenticationMethod(String authenticationMethod) { - this.authentication_method = authenticationMethod; - } - - public String getAlgorithm() { - return algorithm; - } - - public void setAlgorithm(String algorithm) { - this.algorithm = algorithm; - } - - public String getKeyId() { - return key_id; - } - - public void setKeyId(String keyId) { - this.key_id = keyId; - } - - @Override - public String toString() { - return "GetClientTokenParams{" + - "client_id='" + client_id + '\'' + - ", op_host='" + op_host + '\'' + - ", op_discovery_path='" + op_discovery_path + '\'' + - ", op_configuration_endpoint='" + op_configuration_endpoint + '\'' + - ", scope=" + scope + - ", authentication_method='" + authentication_method + '\'' + - ", algorithm='" + algorithm + '\'' + - ", key_id='" + key_id + '\'' + - '}'; - } -} diff --git a/jans-client-api/common/src/main/java/io/jans/ca/common/params/GetDiscoveryParams.java b/jans-client-api/common/src/main/java/io/jans/ca/common/params/GetDiscoveryParams.java deleted file mode 100644 index 10244489d62..00000000000 --- a/jans-client-api/common/src/main/java/io/jans/ca/common/params/GetDiscoveryParams.java +++ /dev/null @@ -1,55 +0,0 @@ -package io.jans.ca.common.params; - -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** - * @author yuriyz - */ -@JsonIgnoreProperties(ignoreUnknown = true) -public class GetDiscoveryParams implements IParams { - - @JsonProperty(value = "op_host") - private String op_host; - - @JsonProperty(value = "op_discovery_path") - private String op_discovery_path; - - @JsonProperty(value = "op_configuration_endpoint") - private String op_configuration_endpoint; - - public GetDiscoveryParams() { - } - - public String getOpHost() { - return op_host; - } - - public void setOpHost(String opHost) { - this.op_host = opHost; - } - - public String getOpDiscoveryPath() { - return op_discovery_path; - } - - public void setOpDiscoveryPath(String opDiscoveryPath) { - this.op_discovery_path = opDiscoveryPath; - } - - public String getOpConfigurationEndpoint() { - return op_configuration_endpoint; - } - - public void setOpConfigurationEndpoint(String op_configuration_endpoint) { - this.op_configuration_endpoint = op_configuration_endpoint; - } - @Override - public String toString() { - return "GetDiscoveryParams{" + - "op_host='" + op_host + '\'' + - ", op_discovery_path='" + op_discovery_path + '\'' + - ", op_configuration_endpoint='" + op_configuration_endpoint + '\'' + - '}'; - } -} diff --git a/jans-client-api/common/src/main/java/io/jans/ca/common/params/GetIssuerParams.java b/jans-client-api/common/src/main/java/io/jans/ca/common/params/GetIssuerParams.java deleted file mode 100644 index 52b7c4f9f1d..00000000000 --- a/jans-client-api/common/src/main/java/io/jans/ca/common/params/GetIssuerParams.java +++ /dev/null @@ -1,63 +0,0 @@ -package io.jans.ca.common.params; - -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonProperty; - -@JsonIgnoreProperties(ignoreUnknown = true) -public class GetIssuerParams implements IParams { - - @JsonProperty(value = "op_host") - private String op_host; - - @JsonProperty(value = "op_discovery_path") - private String op_discovery_path; - - @JsonProperty(value = "op_configuration_endpoint") - private String op_configuration_endpoint; - - @JsonProperty(value = "resource") - private String resource; - - public String getOpHost() { - return op_host; - } - - public void setOpHost(String opHost) { - this.op_host = opHost; - } - - public String getOpDiscoveryPath() { - return op_discovery_path; - } - - public void setOpDiscoveryPath(String opDiscoveryPath) { - this.op_discovery_path = opDiscoveryPath; - } - - public String getOpConfigurationEndpoint() { - return op_configuration_endpoint; - } - - public void setOpConfigurationEndpoint(String op_configuration_endpoint) { - this.op_configuration_endpoint = op_configuration_endpoint; - } - - public String getResource() { - return resource; - } - - public void setResource(String resource) { - this.resource = resource; - } - - @Override - public String toString() { - return "WebfingerParams{" + - "op_host='" + op_host + '\'' + - ", op_discovery_path='" + op_discovery_path + '\'' + - ", op_configuration_endpoint='" + op_configuration_endpoint + '\'' + - ", resource='" + resource + '\'' + - '}'; - } - -} diff --git a/jans-client-api/common/src/main/java/io/jans/ca/common/params/GetJwksParams.java b/jans-client-api/common/src/main/java/io/jans/ca/common/params/GetJwksParams.java deleted file mode 100644 index 2a33983d7e6..00000000000 --- a/jans-client-api/common/src/main/java/io/jans/ca/common/params/GetJwksParams.java +++ /dev/null @@ -1,52 +0,0 @@ -/* - All rights reserved -- Copyright 2015 Gluu Inc. -*/ -package io.jans.ca.common.params; - -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** - * Parameter class for JWKS request - * - * @author Shoeb - * @version 11/10/2018 - */ -@JsonIgnoreProperties(ignoreUnknown = true) -@JsonInclude(JsonInclude.Include.NON_NULL) -public class GetJwksParams implements IParams { - - @JsonProperty(value = "op_host") - private String op_host; - - @JsonProperty(value = "op_discovery_path") - private String op_discovery_path; - - @JsonProperty(value = "op_configuration_endpoint") - private String op_configuration_endpoint; - - public String getOpHost() { - return op_host; - } - - public void setOpHost(String opHost) { - this.op_host = opHost; - } - - public String getOpDiscoveryPath() { - return op_discovery_path; - } - - public void setOpDiscoveryPath(String opDiscoveryPath) { - this.op_discovery_path = opDiscoveryPath; - } - - public String getOpConfigurationEndpoint() { - return op_configuration_endpoint; - } - - public void setOpConfigurationEndpoint(String op_configuration_endpoint) { - this.op_configuration_endpoint = op_configuration_endpoint; - } -} diff --git a/jans-client-api/common/src/main/java/io/jans/ca/common/params/GetLogoutUrlParams.java b/jans-client-api/common/src/main/java/io/jans/ca/common/params/GetLogoutUrlParams.java deleted file mode 100644 index 8fbfecef520..00000000000 --- a/jans-client-api/common/src/main/java/io/jans/ca/common/params/GetLogoutUrlParams.java +++ /dev/null @@ -1,81 +0,0 @@ -package io.jans.ca.common.params; - -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** - * @author Yuriy Zabrovarnyy - * @version 0.9, 17/11/2015 - */ - -@JsonIgnoreProperties(ignoreUnknown = true) -public class GetLogoutUrlParams implements HasRpIdParams { - - @JsonProperty(value = "rp_id") - private String rp_id; - - @JsonProperty(value = "id_token_hint") - private String id_token_hint; - @JsonProperty(value = "post_logout_redirect_uri") - private String post_logout_redirect_uri; - @JsonProperty(value = "state") - private String state; - @JsonProperty(value = "session_state") - private String session_state; - - public GetLogoutUrlParams() { - } - - public String getPostLogoutRedirectUri() { - return post_logout_redirect_uri; - } - - public void setPostLogoutRedirectUri(String postLogoutRedirectUri) { - this.post_logout_redirect_uri = postLogoutRedirectUri; - } - - public String getIdTokenHint() { - return id_token_hint; - } - - public void setIdTokenHint(String idTokenHint) { - this.id_token_hint = idTokenHint; - } - - public String getRpId() { - return rp_id; - } - - public void setRpId(String rpId) { - this.rp_id = rpId; - } - - public String getState() { - return state; - } - - public void setState(String state) { - this.state = state; - } - - public String getSessionState() { - return session_state; - } - - public void setSessionState(String sessionState) { - this.session_state = sessionState; - } - - @Override - public String toString() { - final StringBuilder sb = new StringBuilder(); - sb.append("LogoutParams"); - sb.append("{rp_id=").append(rp_id); - sb.append(", id_token_hint=").append(id_token_hint); - sb.append(", post_logout_redirect_uri=").append(post_logout_redirect_uri); - sb.append(", state=").append(state); - sb.append(", session_state=").append(session_state); - sb.append('}'); - return sb.toString(); - } -} diff --git a/jans-client-api/common/src/main/java/io/jans/ca/common/params/GetRequestObjectUriParams.java b/jans-client-api/common/src/main/java/io/jans/ca/common/params/GetRequestObjectUriParams.java deleted file mode 100644 index 5f27003c54f..00000000000 --- a/jans-client-api/common/src/main/java/io/jans/ca/common/params/GetRequestObjectUriParams.java +++ /dev/null @@ -1,60 +0,0 @@ -package io.jans.ca.common.params; - -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonProperty; - -import java.util.Map; - -@JsonIgnoreProperties(ignoreUnknown = true) -public class GetRequestObjectUriParams implements HasRpIdParams { - - @JsonProperty(value = "rp_id") - private String rp_id; - @JsonProperty(value = "params") - private Map params; - @JsonProperty(value = "request_object_signing_alg") - private String request_object_signing_alg; - @JsonProperty(value = "rp_host_url") - private String rp_host_url; - - public String getRpId() { - return rp_id; - } - - public void setRpId(String rpId) { - this.rp_id = rpId; - } - - public Map getParams() { - return params; - } - - public void setParams(Map params) { - this.params = params; - } - - public String getRequestObjectSigningAlg() { - return request_object_signing_alg; - } - - public void setRequestObjectSigningAlg(String request_object_signing_alg) { - this.request_object_signing_alg = request_object_signing_alg; - } - - public String getRpHostUrl() { - return rp_host_url; - } - - public void setRpHostUrl(String rp_host_url) { - this.rp_host_url = rp_host_url; - } - @Override - public String toString() { - return "GetRequestUri{" + - "rp_id='" + rp_id + '\'' + - ", params=" + params + - ", request_object_signing_alg=" + request_object_signing_alg + - ", rp_host_url=" + rp_host_url + - '}'; - } -} diff --git a/jans-client-api/common/src/main/java/io/jans/ca/common/params/GetRpParams.java b/jans-client-api/common/src/main/java/io/jans/ca/common/params/GetRpParams.java deleted file mode 100644 index 6a400e08361..00000000000 --- a/jans-client-api/common/src/main/java/io/jans/ca/common/params/GetRpParams.java +++ /dev/null @@ -1,47 +0,0 @@ -package io.jans.ca.common.params; - -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** - * @author yuriyz - */ -@JsonIgnoreProperties(ignoreUnknown = true) -public class GetRpParams implements HasRpIdParams { - - @JsonProperty(value = "rp_id") - private String rp_id; - @JsonProperty(value = "list") - private Boolean list; - - public GetRpParams() { - } - - public GetRpParams(String rpId) { - this.rp_id = rpId; - } - - public String getRpId() { - return rp_id; - } - - public void setRpId(String rpId) { - this.rp_id = rpId; - } - - public Boolean getList() { - return list; - } - - public void setList(Boolean list) { - this.list = list; - } - - @Override - public String toString() { - return "GetRpParams{" + - "rpId='" + rp_id + '\'' + - "list='" + list + '\'' + - '}'; - } -} diff --git a/jans-client-api/common/src/main/java/io/jans/ca/common/params/GetTokensByCodeParams.java b/jans-client-api/common/src/main/java/io/jans/ca/common/params/GetTokensByCodeParams.java deleted file mode 100644 index f65e332c6de..00000000000 --- a/jans-client-api/common/src/main/java/io/jans/ca/common/params/GetTokensByCodeParams.java +++ /dev/null @@ -1,97 +0,0 @@ -package io.jans.ca.common.params; - -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** - * @author Yuriy Zabrovarnyy - * @version 0.9, 22/09/2015 - */ - -@JsonIgnoreProperties(ignoreUnknown = true) -public class GetTokensByCodeParams implements HasRpIdParams { - - @JsonProperty(value = "rp_id") - private String rp_id; - @JsonProperty(value = "code") - private String code; - @JsonProperty(value = "state") - private String state; - @JsonProperty(value = "authentication_method") - private String authentication_method; - @JsonProperty(value = "algorithm") - private String algorithm; - - public GetTokensByCodeParams() { - } - - public String getCode() { - return code; - } - - public void setCode(String code) { - this.code = code; - } - - public String getState() { - return state; - } - - public void setState(String state) { - this.state = state; - } - - public String getRpId() { - return rp_id; - } - - public void setRpId(String rpId) { - this.rp_id = rpId; - } - - public String getAuthenticationMethod() { - return authentication_method; - } - - public void setAuthenticationMethod(String authenticationMethod) { - this.authentication_method = authenticationMethod; - } - - public String getAlgorithm() { - return algorithm; - } - - public void setAlgorithm(String algorithm) { - this.algorithm = algorithm; - } - - @Override - public boolean equals(Object o) { - if (this == o) return true; - if (o == null || getClass() != o.getClass()) return false; - - GetTokensByCodeParams that = (GetTokensByCodeParams) o; - - return !(code != null ? !code.equals(that.code) : that.code != null) && !(rp_id != null ? !rp_id.equals(that.rp_id) : that.rp_id != null); - } - - @Override - public int hashCode() { - int result = rp_id != null ? rp_id.hashCode() : 0; - result = 31 * result + (code != null ? code.hashCode() : 0); - return result; - } - - @Override - public String toString() { - final StringBuilder sb = new StringBuilder(); - sb.append("GetTokensByCodeParams"); - sb.append("{code='").append(code).append('\''); - sb.append(", rp_id='").append(rp_id).append('\''); - sb.append(", state='").append(state).append('\''); - sb.append(", authentication_method='").append(authentication_method).append('\''); - sb.append(", algorithm='").append(algorithm).append('\''); - sb.append('}'); - return sb.toString(); - } -} diff --git a/jans-client-api/common/src/main/java/io/jans/ca/common/params/GetUserInfoParams.java b/jans-client-api/common/src/main/java/io/jans/ca/common/params/GetUserInfoParams.java deleted file mode 100644 index 44fb7e2191d..00000000000 --- a/jans-client-api/common/src/main/java/io/jans/ca/common/params/GetUserInfoParams.java +++ /dev/null @@ -1,77 +0,0 @@ -package io.jans.ca.common.params; - -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** - * @author Yuriy Zabrovarnyy - * @version 0.9, 22/09/2015 - */ - -@JsonIgnoreProperties(ignoreUnknown = true) -public class GetUserInfoParams implements HasRpIdParams { - - @JsonProperty(value = "rp_id") - private String rp_id; - @JsonProperty(value = "access_token") - private String access_token; - @JsonProperty(value = "id_token") - private String id_token; - - public GetUserInfoParams() { - } - - public String getAccessToken() { - return access_token; - } - - public void setAccessToken(String accessToken) { - this.access_token = accessToken; - } - - public String getRpId() { - return rp_id; - } - - public void setRpId(String rpId) { - this.rp_id = rpId; - } - - public String getIdToken() { - return id_token; - } - - public void setIdToken(String idToken) { - this.id_token = idToken; - } - - @Override - public boolean equals(Object o) { - if (this == o) return true; - if (o == null || getClass() != o.getClass()) return false; - - GetUserInfoParams that = (GetUserInfoParams) o; - - if (access_token != null ? !access_token.equals(that.access_token) : that.access_token != null) return false; - return !(rp_id != null ? !rp_id.equals(that.rp_id) : that.rp_id != null); - - } - - @Override - public int hashCode() { - int result = rp_id != null ? rp_id.hashCode() : 0; - result = 31 * result + (access_token != null ? access_token.hashCode() : 0); - return result; - } - - @Override - public String toString() { - final StringBuilder sb = new StringBuilder(); - sb.append("GetUserInfoParams"); - sb.append("{access_token='").append(access_token).append('\''); - sb.append(", rp_id='").append(rp_id).append('\''); - sb.append(", id_token='").append(id_token).append('\''); - sb.append('}'); - return sb.toString(); - } -} diff --git a/jans-client-api/common/src/main/java/io/jans/ca/common/params/HasRpIdParams.java b/jans-client-api/common/src/main/java/io/jans/ca/common/params/HasRpIdParams.java deleted file mode 100644 index e68ee72b731..00000000000 --- a/jans-client-api/common/src/main/java/io/jans/ca/common/params/HasRpIdParams.java +++ /dev/null @@ -1,11 +0,0 @@ -package io.jans.ca.common.params; - -/** - * @author Yuriy Zabrovarnyy - * @version 0.9, 23/05/2016 - */ - -public interface HasRpIdParams extends IParams { - - String getRpId(); -} diff --git a/jans-client-api/common/src/main/java/io/jans/ca/common/params/IParams.java b/jans-client-api/common/src/main/java/io/jans/ca/common/params/IParams.java deleted file mode 100644 index e598ab3df8b..00000000000 --- a/jans-client-api/common/src/main/java/io/jans/ca/common/params/IParams.java +++ /dev/null @@ -1,14 +0,0 @@ -/** - * All rights reserved -- Copyright 2015 Gluu Inc. - */ -package io.jans.ca.common.params; - -import java.io.Serializable; - -/** - * @author Yuriy Zabrovarnyy - * @version 0.9, 09/08/2013 - */ - -public interface IParams extends Serializable { -} diff --git a/jans-client-api/common/src/main/java/io/jans/ca/common/params/ImplicitFlowParams.java b/jans-client-api/common/src/main/java/io/jans/ca/common/params/ImplicitFlowParams.java deleted file mode 100644 index add73a0ff7a..00000000000 --- a/jans-client-api/common/src/main/java/io/jans/ca/common/params/ImplicitFlowParams.java +++ /dev/null @@ -1,120 +0,0 @@ -/** - * All rights reserved -- Copyright 2015 Gluu Inc. - */ -package io.jans.ca.common.params; - -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** - * @author Yuriy Zabrovarnyy - * @version 0.9, 23/06/2015 - */ - -@JsonIgnoreProperties(ignoreUnknown = true) -public class ImplicitFlowParams implements HasRpIdParams { - - @JsonProperty(value = "rp_id") - private String rp_id; - @JsonProperty(value = "redirect_url") - private String redirect_url; - @JsonProperty(value = "client_id") - private String client_id; - @JsonProperty(value = "client_secret") - private String client_secret; - @JsonProperty(value = "user_id") - private String user_id; - @JsonProperty(value = "user_secret") - private String user_secret; - @JsonProperty(value = "scope") - private String scope; - @JsonProperty(value = "nonce") - private String nonce; - - public ImplicitFlowParams() { - } - - public String getClientSecret() { - return client_secret; - } - - public void setClientSecret(String clientSecret) { - this.client_secret = clientSecret; - } - - public String getNonce() { - return nonce; - } - - public void setNonce(String nonce) { - this.nonce = nonce; - } - - public String getScope() { - return scope; - } - - public void setScope(String scope) { - this.scope = scope; - } - - public String getRedirectUrl() { - return redirect_url; - } - - public void setRedirectUrl(String p_redirectUrl) { - redirect_url = p_redirectUrl; - } - - public String getClientId() { - return client_id; - } - - public void setClientId(String p_clientId) { - client_id = p_clientId; - } - - public String getUserId() { - return user_id; - } - - public void setUserId(String p_userId) { - user_id = p_userId; - } - - public String getUserSecret() { - return user_secret; - } - - public void setUserSecret(String p_userSecret) { - user_secret = p_userSecret; - } - - public String getRpId() { - return rp_id; - } - - public void setRpId(String rpId) { - this.rp_id = rpId; - } - - /** - * Returns string representation of object - * - * @return string representation of object - */ - @Override - public String toString() { - final StringBuilder sb = new StringBuilder(); - sb.append("ImplicitFlowParams"); - sb.append("{rp_id='").append(rp_id).append('\''); - sb.append(", redirect_url='").append(redirect_url).append('\''); - sb.append(", client_id='").append(client_id).append('\''); - sb.append(", user_id='").append(user_id).append('\''); - sb.append(", user_secret='").append(user_secret).append('\''); - sb.append(", scope='").append(scope).append('\''); - sb.append(", nonce='").append(nonce).append('\''); - sb.append('}'); - return sb.toString(); - } -} \ No newline at end of file diff --git a/jans-client-api/common/src/main/java/io/jans/ca/common/params/IntrospectAccessTokenParams.java b/jans-client-api/common/src/main/java/io/jans/ca/common/params/IntrospectAccessTokenParams.java deleted file mode 100644 index 2a66cda43db..00000000000 --- a/jans-client-api/common/src/main/java/io/jans/ca/common/params/IntrospectAccessTokenParams.java +++ /dev/null @@ -1,34 +0,0 @@ -package io.jans.ca.common.params; - -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** - * @author yuriyz - */ -@JsonIgnoreProperties(ignoreUnknown = true) -public class IntrospectAccessTokenParams implements HasRpIdParams { - - @JsonProperty(value = "rp_id") - private String rp_id; - @JsonProperty(value = "access_token") - private String access_token; - - @Override - public String getRpId() { - return rp_id; - } - - public void setRpId(String rpId) { - this.rp_id = rpId; - } - - public String getAccessToken() { - return access_token; - } - - public void setAccessToken(String accessToken) { - this.access_token = accessToken; - } - -} diff --git a/jans-client-api/common/src/main/java/io/jans/ca/common/params/IntrospectRptParams.java b/jans-client-api/common/src/main/java/io/jans/ca/common/params/IntrospectRptParams.java deleted file mode 100644 index 97569c44876..00000000000 --- a/jans-client-api/common/src/main/java/io/jans/ca/common/params/IntrospectRptParams.java +++ /dev/null @@ -1,34 +0,0 @@ -package io.jans.ca.common.params; - -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** - * @author yuriyz - */ -@JsonIgnoreProperties(ignoreUnknown = true) -public class IntrospectRptParams implements HasRpIdParams { - - @JsonProperty(value = "rp_id") - private String rp_id; - @JsonProperty(value = "rpt") - private String rpt; - - @Override - public String getRpId() { - return rp_id; - } - - public void setRpId(String rpId) { - this.rp_id = rpId; - } - - public String getRpt() { - return rpt; - } - - public void setRpt(String rpt) { - this.rpt = rpt; - } - -} diff --git a/jans-client-api/common/src/main/java/io/jans/ca/common/params/RegisterSiteParams.java b/jans-client-api/common/src/main/java/io/jans/ca/common/params/RegisterSiteParams.java deleted file mode 100644 index ec9c8c45f7a..00000000000 --- a/jans-client-api/common/src/main/java/io/jans/ca/common/params/RegisterSiteParams.java +++ /dev/null @@ -1,958 +0,0 @@ -package io.jans.ca.common.params; - -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonProperty; - -import java.util.List; -import java.util.Map; - -/** - * @author Yuriy Zabrovarnyy - */ - -@JsonIgnoreProperties(ignoreUnknown = true) -public class RegisterSiteParams implements HasRpIdParams { - @JsonProperty(value = "op_host") - private String op_host; - @JsonProperty(value = "op_discovery_path") - private String op_discovery_path; - @JsonProperty(value = "op_configuration_endpoint") - private String op_configuration_endpoint; - @JsonProperty(value = "post_logout_redirect_uris") - private List post_logout_redirect_uris; - @JsonProperty(value = "redirect_uris") - private List redirect_uris; - @JsonProperty(value = "response_types") - private List response_types; - @JsonProperty(value = "claims_redirect_uri") - private List claims_redirect_uri; - @JsonProperty(value = "client_id") - private String client_id; - @JsonProperty(value = "client_secret") - private String client_secret; - @JsonProperty(value = "client_registration_access_token") - private String client_registration_access_token; - @JsonProperty(value = "client_registration_client_uri") - private String client_registration_client_uri; - @JsonProperty(value = "client_name") - private String client_name; - @JsonProperty(value = "client_jwks_uri") - private String client_jwks_uri; - @JsonProperty(value = "client_token_endpoint_auth_method") - private String client_token_endpoint_auth_method; - @JsonProperty(value = "client_token_endpoint_auth_signing_alg") - private String client_token_endpoint_auth_signing_alg; - @JsonProperty(value = "client_request_uris") - private List client_request_uris; - @JsonProperty(value = "client_frontchannel_logout_uri") - private String client_frontchannel_logout_uri; - @JsonProperty(value = "client_sector_identifier_uri") - private String client_sector_identifier_uri; - - @JsonProperty(value = "scope") - private List scope; - @JsonProperty(value = "ui_locales") - private List ui_locales; - @JsonProperty(value = "claims_locales") - private List claims_locales; - @JsonProperty(value = "acr_values") - private List acr_values; - @JsonProperty(value = "grant_types") - private List grant_types; - @JsonProperty(value = "contacts") - private List contacts; - @JsonProperty(value = "access_token_as_jwt") - private Boolean access_token_as_jwt = false; - @JsonProperty(value = "access_token_signing_alg") - private String access_token_signing_alg; - @JsonProperty(value = "rpt_as_jwt") - private Boolean rpt_as_jwt = false; - - @JsonProperty(value = "logo_uri") - private String logo_uri; - @JsonProperty(value = "client_uri") - private String client_uri; - @JsonProperty(value = "policy_uri") - private String policy_uri; - @JsonProperty(value = "front_channel_logout_session_required") - private Boolean front_channel_logout_session_required = false; - @JsonProperty(value = "tos_uri") - private String tos_uri; - @JsonProperty(value = "jwks") - private String jwks; - @JsonProperty(value = "id_token_binding_cnf") - private String id_token_binding_cnf; - @JsonProperty(value = "tls_client_auth_subject_dn") - private String tls_client_auth_subject_dn; - @JsonProperty(value = "subject_type") - private String subject_type; - @JsonProperty(value = "run_introspection_script_beforeaccess_token_as_jwt_creation_and_include_claims") - private Boolean run_introspection_script_beforeaccess_token_as_jwt_creation_and_include_claims = false; - @JsonProperty(value = "id_token_signed_response_alg") - private String id_token_signed_response_alg; - @JsonProperty(value = "id_token_encrypted_response_alg") - private String id_token_encrypted_response_alg; - @JsonProperty(value = "id_token_encrypted_response_enc") - private String id_token_encrypted_response_enc; - @JsonProperty(value = "user_info_signed_response_alg") - private String user_info_signed_response_alg; - @JsonProperty(value = "user_info_encrypted_response_alg") - private String user_info_encrypted_response_alg; - @JsonProperty(value = "user_info_encrypted_response_enc") - private String user_info_encrypted_response_enc; - @JsonProperty(value = "request_object_signing_alg") - private String request_object_signing_alg; - @JsonProperty(value = "request_object_encryption_alg") - private String request_object_encryption_alg; - @JsonProperty(value = "request_object_encryption_enc") - private String request_object_encryption_enc; - @JsonProperty(value = "default_max_age") - private Integer default_max_age; - @JsonProperty(value = "require_auth_time") - private Boolean require_auth_time = false; - @JsonProperty(value = "initiate_login_uri") - private String initiate_login_uri; - @JsonProperty(value = "authorized_origins") - private List authorized_origins; - @JsonProperty(value = "access_token_lifetime") - private Integer access_token_lifetime; - @JsonProperty(value = "software_id") - private String software_id; - @JsonProperty(value = "software_version") - private String software_version; - @JsonProperty(value = "software_statement") - private String software_statement; - @JsonProperty(value = "custom_attributes") - private Map custom_attributes; - @JsonProperty(value = "sync_client_from_op") - private Boolean syncClientFromOp = false; - @JsonProperty(value = "sync_client_period_in_seconds") - private int syncClientPeriodInSeconds = 86400; - @JsonProperty(value = "allow_spontaneous_scopes") - private Boolean allowSpontaneousScopes = false; - @JsonProperty(value = "spontaneous_scopes") - private List spontaneousScopes; - - public RegisterSiteParams() { - } - - public Boolean getRptAsJwt() { - return rpt_as_jwt; - } - - public void setRptAsJwt(Boolean rpt_as_jwt) { - this.rpt_as_jwt = rpt_as_jwt; - } - - public Boolean getAccessTokenAsJwt() { - return access_token_as_jwt; - } - - public void setAccessTokenAsJwt(Boolean access_token_as_jwt) { - this.access_token_as_jwt = access_token_as_jwt; - } - - public String getAccessTokenSigningAlg() { - return access_token_signing_alg; - } - - public void setAccessTokenSigningAlg(String access_token_signing_alg) { - this.access_token_signing_alg = access_token_signing_alg; - } - - public String getClientRegistrationAccessToken() { - return client_registration_access_token; - } - - public void setClientRegistrationAccessToken(String clientRegistrationAccessToken) { - this.client_registration_access_token = clientRegistrationAccessToken; - } - - public String getClientRegistrationClientUri() { - return client_registration_client_uri; - } - - public void setClientRegistrationClientUri(String clientRegistrationClientUri) { - this.client_registration_client_uri = clientRegistrationClientUri; - } - - public String getClientName() { - return client_name; - } - - public void setClientName(String clientName) { - this.client_name = clientName; - } - - public String getOpHost() { - return op_host; - } - - public void setOpHost(String opHost) { - this.op_host = opHost; - } - - public String getOpDiscoveryPath() { - return op_discovery_path; - } - - public void setOpDiscoveryPath(String opDiscoveryPath) { - this.op_discovery_path = opDiscoveryPath; - } - - public String getOpConfigurationEndpoint() { - return op_configuration_endpoint; - } - - public void setOpConfigurationEndpoint(String op_configuration_endpoint) { - this.op_configuration_endpoint = op_configuration_endpoint; - } - - public String getClientSectorIdentifierUri() { - return client_sector_identifier_uri; - } - - public void setClientSectorIdentifierUri(String clientSectorIdentifierUri) { - this.client_sector_identifier_uri = clientSectorIdentifierUri; - } - - public String getClientFrontchannelLogoutUri() { - return client_frontchannel_logout_uri; - } - - public void setClientFrontchannelLogoutUri(String clientFrontchannelLogoutUri) { - this.client_frontchannel_logout_uri = clientFrontchannelLogoutUri; - } - - public List getClientRequestUris() { - return client_request_uris; - } - - public void setClientRequestUris(List clientRequestUris) { - this.client_request_uris = clientRequestUris; - } - - public String getClientTokenEndpointAuthMethod() { - return client_token_endpoint_auth_method; - } - - public void setClientTokenEndpointAuthMethod(String clientTokenEndpointAuthMethod) { - this.client_token_endpoint_auth_method = clientTokenEndpointAuthMethod; - } - - public List getPostLogoutRedirectUris() { - return post_logout_redirect_uris; - } - - public void setPostLogoutRedirectUris(List post_logout_redirect_uris) { - this.post_logout_redirect_uris = post_logout_redirect_uris; - } - - public String getClientTokenEndpointAuthSigningAlg() { - return client_token_endpoint_auth_signing_alg; - } - - public void setClientTokenEndpointAuthSigningAlg(String clientTokenEndpointAuthSigningAlg) { - this.client_token_endpoint_auth_signing_alg = clientTokenEndpointAuthSigningAlg; - } - - public String getClientJwksUri() { - return client_jwks_uri; - } - - public void setClientJwksUri(String clientJwksUri) { - this.client_jwks_uri = clientJwksUri; - } - - public List getClaimsLocales() { - return claims_locales; - } - - public void setClaimsLocales(List claimsLocales) { - this.claims_locales = claimsLocales; - } - - public String getClientId() { - return client_id; - } - - public void setClientId(String clientId) { - this.client_id = clientId; - } - - public String getClientSecret() { - return client_secret; - } - - public void setClientSecret(String clientSecret) { - this.client_secret = clientSecret; - } - - public List getGrantTypes() { - return grant_types; - } - - public void setGrantTypes(List grantTypes) { - this.grant_types = grantTypes; - } - - public List getRedirectUris() { - return redirect_uris; - } - - public void setRedirectUris(List redirectUris) { - this.redirect_uris = redirectUris; - } - - public List getResponseTypes() { - return response_types; - } - - public void setResponseTypes(List responseTypes) { - this.response_types = responseTypes; - } - - public List getScope() { - return scope; - } - - public void setScope(List scope) { - this.scope = scope; - } - - public List getUiLocales() { - return ui_locales; - } - - public void setUiLocales(List uiLocales) { - this.ui_locales = uiLocales; - } - - public List getAcrValues() { - return acr_values; - } - - public void setAcrValues(List acrValues) { - this.acr_values = acrValues; - } - - public List getContacts() { - return contacts; - } - - public void setContacts(List contacts) { - this.contacts = contacts; - } - - public List getClaimsRedirectUri() { - return claims_redirect_uri; - } - - public void setClaimsRedirectUri(List claimsRedirectUri) { - this.claims_redirect_uri = claimsRedirectUri; - } - - /** - * Returns an URL that references a logo for the Client application. - * - * @return The URL that references a logo for the Client application. - */ - public String getLogoUri() { - return logo_uri; - } - - /** - * Sets an URL that references a logo for the Client application. - * - * @param logoUri The URL that references a logo for the Client application. - */ - public void setLogoUri(String logoUri) { - this.logo_uri = logoUri; - } - - /** - * Returns an URL of the home page of the Client. - * - * @return The URL of the home page of the Client. - */ - public String getClientUri() { - return client_uri; - } - - /** - * Sets an URL of the home page of the Client. - * - * @param clientUri The URL of the home page of the Client. - */ - public void setClientUri(String clientUri) { - this.client_uri = clientUri; - } - - /** - * Returns an URL that the Relying Party Client provides to the End-User to read about the how the profile data - * will be used. - * - * @return The policy URL. - */ - public String getPolicyUri() { - return policy_uri; - } - - /** - * Sets an URL that the Relying Party Client provides to the End-User to read about the how the profile data will - * be used. - * - * @param policyUri The policy URL. - */ - public void setPolicyUri(String policyUri) { - this.policy_uri = policyUri; - } - - /** - * Gets logout session required. - * - * @return logout session required - */ - public Boolean getFrontChannelLogoutSessionRequired() { - return front_channel_logout_session_required; - } - - /** - * Sets front channel logout session required. - * - * @param frontChannelLogoutSessionRequired front channel logout session required - */ - public void setFrontChannelLogoutSessionRequired(Boolean frontChannelLogoutSessionRequired) { - this.front_channel_logout_session_required = frontChannelLogoutSessionRequired; - } - - /** - * Returns an URL that the Relying Party Client provides to the End-User to read about the Relying Party's terms - * of service. - * - * @return The tems of service URL. - */ - public String getTosUri() { - return tos_uri; - } - - /** - * Sets an URL that the Relying Party Client provides to the End-User to read about the Relying Party's terms of - * service. - * - * @param tosUri The term of service URL. - */ - public void setTosUri(String tosUri) { - this.tos_uri = tosUri; - } - - /** - * Client's JSON Web Key Set (JWK) document, passed by value. The semantics of the jwks parameter are the same as - * the jwks_uri parameter, other than that the JWK Set is passed by value, rather than by reference. - * This parameter is intended only to be used by Clients that, for some reason, are unable to use the jwks_uri - * parameter, for instance, by native applications that might not have a location to host the contents of the JWK - * Set. If a Client can use jwks_uri, it must not use jwks. - * One significant downside of jwks is that it does not enable key rotation (which jwks_uri does, as described in - * Section 10 of OpenID Connect Core 1.0). The jwks_uri and jwks parameters must not be used together. - * - * @return The Client's JSON Web Key Set (JWK) document. - */ - public String getJwks() { - return jwks; - } - - /** - * Client's JSON Web Key Set (JWK) document, passed by value. The semantics of the jwks parameter are the same as - * the jwks_uri parameter, other than that the JWK Set is passed by value, rather than by reference. - * This parameter is intended only to be used by Clients that, for some reason, are unable to use the jwks_uri - * parameter, for instance, by native applications that might not have a location to host the contents of the JWK - * Set. If a Client can use jwks_uri, it must not use jwks. - * One significant downside of jwks is that it does not enable key rotation (which jwks_uri does, as described in - * Section LogoUri10 of OpenID Connect Core 1.0). The jwks_uri and jwks parameters must not be used together. - * - * @param jwks The Client's JSON Web Key Set (JWK) document. - */ - public void setJwks(String jwks) { - this.jwks = jwks; - } - - public String getIdTokenBindingCnf() { - return id_token_binding_cnf; - } - - public void setIdTokenBindingCnf(String idTokenTokenBindingCnf) { - this.id_token_binding_cnf = idTokenTokenBindingCnf; - } - - public String getTlsClientAuthSubjectDn() { - return tls_client_auth_subject_dn; - } - - public void setTlsClientAuthSubjectDn(String tlsClientAuthSubjectDn) { - this.tls_client_auth_subject_dn = tlsClientAuthSubjectDn; - } - - /** - * Returns the Subject Type. Valid types include pairwise and public. - * - * @return The Subject Type. - */ - public String getSubjectType() { - return subject_type; - } - - /** - * Sets the Subject Type. Valid types include pairwise and public. - * - * @param subjectType The Subject Type. - */ - public void setSubjectType(String subjectType) { - this.subject_type = subjectType; - } - - public Boolean getRunIntrospectionScriptBeforeAccessTokenAsJwtCreationAndIncludeClaims() { - return run_introspection_script_beforeaccess_token_as_jwt_creation_and_include_claims; - } - - public void setRunIntrospectionScriptBeforeAccessTokenAsJwtCreationAndIncludeClaims(Boolean runIntrospectionScriptBeforeAccessTokenAsJwtCreationAndIncludeClaims) { - this.run_introspection_script_beforeaccess_token_as_jwt_creation_and_include_claims = runIntrospectionScriptBeforeAccessTokenAsJwtCreationAndIncludeClaims; - } - - /** - * Returns th JWS alg algorithm (JWA) required for the ID Token issued to this client_id. - * - * @return The JWS algorithm (JWA). - */ - public String getIdTokenSignedResponseAlg() { - return id_token_signed_response_alg; - } - - /** - * Sets the JWS alg algorithm (JWA) required for the ID Token issued to this client_id. - * - * @param idTokenSignedResponseAlg The JWS algorithm (JWA). - */ - public void setIdTokenSignedResponseAlg(String idTokenSignedResponseAlg) { - this.id_token_signed_response_alg = idTokenSignedResponseAlg; - } - - /** - * Returns the JWE alg algorithm (JWA) required for encrypting the ID Token issued to this client_id. - * - * @return The JWE algorithm (JWA). - */ - public String getIdTokenEncryptedResponseAlg() { - return id_token_encrypted_response_alg; - } - - /** - * Sets the JWE alg algorithm (JWA) required for encrypting the ID Token issued to this client_id. - * - * @param idTokenEncryptedResponseAlg The JWE algorithm (JWA). - */ - public void setIdTokenEncryptedResponseAlg(String idTokenEncryptedResponseAlg) { - this.id_token_encrypted_response_alg = idTokenEncryptedResponseAlg; - } - - /** - * Returns the JWE enc algorithm (JWA) required for symmetric encryption of the ID Token issued to this client_id. - * - * @return The JWE algorithm (JWA). - */ - public String getIdTokenEncryptedResponseEnc() { - return id_token_encrypted_response_enc; - } - - /** - * Sets the JWE enc algorithm (JWA) required for symmetric encryption of the ID Token issued to this client_id. - * - * @param idTokenEncryptedResponseEnc The JWE algorithm (JWA). - */ - public void setIdTokenEncryptedResponseEnc(String idTokenEncryptedResponseEnc) { - this.id_token_encrypted_response_enc = idTokenEncryptedResponseEnc; - } - - /** - * Returns the JWS alg algorithm (JWA) required for UserInfo responses. - * - * @return The JWS algorithm (JWA). - */ - public String getUserInfoSignedResponseAlg() { - return user_info_signed_response_alg; - } - - /** - * Sets the JWS alg algorithm (JWA) required for UserInfo responses. - * - * @param userInfoSignedResponseAlg The JWS algorithm (JWA). - */ - public void setUserInfoSignedResponseAlg(String userInfoSignedResponseAlg) { - this.user_info_signed_response_alg = userInfoSignedResponseAlg; - } - - /** - * Returns the JWE alg algorithm (JWA) required for encrypting UserInfo responses. - * - * @return The JWE algorithm (JWA). - */ - public String getUserInfoEncryptedResponseAlg() { - return user_info_encrypted_response_alg; - } - - /** - * Sets the JWE alg algorithm (JWA) required for encrypting UserInfo responses. - * - * @param userInfoEncryptedResponseAlg The JWE algorithm (JWA). - */ - public void setUserInfoEncryptedResponseAlg(String userInfoEncryptedResponseAlg) { - this.user_info_encrypted_response_alg = userInfoEncryptedResponseAlg; - } - - /** - * Returns the JWE enc algorithm (JWA) required for symmetric encryption of UserInfo responses. - * - * @return The JWE algorithm (JWA). - */ - public String getUserInfoEncryptedResponseEnc() { - return user_info_encrypted_response_enc; - } - - /** - * Sets the JWE enc algorithm (JWA) required for symmetric encryption of UserInfo responses. - * - * @param userInfoEncryptedResponseEnc The JWE algorithm (JWA). - */ - public void setUserInfoEncryptedResponseEnc(String userInfoEncryptedResponseEnc) { - this.user_info_encrypted_response_enc = userInfoEncryptedResponseEnc; - } - - /** - * Returns the JWS alg algorithm (JWA) that must be required by the Authorization Server. - * - * @return The JWS algorithm (JWA). - */ - public String getRequestObjectSigningAlg() { - return request_object_signing_alg; - } - - /** - * Sets the JWS alg algorithm (JWA) that must be required by the Authorization Server. - * - * @param requestObjectSigningAlg The JWS algorithm (JWA). - */ - public void setRequestObjectSigningAlg(String requestObjectSigningAlg) { - this.request_object_signing_alg = requestObjectSigningAlg; - } - - /** - * Returns the JWE alg algorithm (JWA) the RP is declaring that it may use for encrypting Request Objects - * sent to the OP. - * - * @return The JWE alg algorithm (JWA). - */ - public String getRequestObjectEncryptionAlg() { - return request_object_encryption_alg; - } - - /** - * Sets the JWE alg algorithm (JWA) the RP is declaring that it may use for encrypting Request Objects - * sent to the OP. - * - * @param requestObjectEncryptionAlg The JWE alg algorithm (JWA). - */ - public void setRequestObjectEncryptionAlg(String requestObjectEncryptionAlg) { - this.request_object_encryption_alg = requestObjectEncryptionAlg; - } - - /** - * Returns the JWE enc algorithm (JWA) the RP is declaring that it may use for encrypting Request Objects - * sent to the OP. - * - * @return The JWE enc algorithm (JWA). - */ - public String getRequestObjectEncryptionEnc() { - return request_object_encryption_enc; - } - - /** - * Sets the JWE enc algorithm (JWA) the RP is declaring that it may use for encrypting Request Objects - * sent to the OP. - * - * @param requestObjectEncryptionEnc The JWE enc algorithm (JWA). - */ - public void setRequestObjectEncryptionEnc(String requestObjectEncryptionEnc) { - this.request_object_encryption_enc = requestObjectEncryptionEnc; - } - - /** - * Returns the Default Maximum Authentication Age. - * - * @return The Default Maximum Authentication Age. - */ - public Integer getDefaultMaxAge() { - return default_max_age; - } - - /** - * Sets the Default Maximum Authentication Age. - * - * @param defaultMaxAge The Default Maximum Authentication Age. - */ - public void setDefaultMaxAge(Integer defaultMaxAge) { - this.default_max_age = defaultMaxAge; - } - - /** - * Returns the Boolean value specifying whether the auth_time claim in the id_token is required. - * It is required when the value is true. The auth_time claim request in the request object overrides this setting. - * - * @return The Boolean value specifying whether the auth_time claim in the id_token is required. - */ - public Boolean getRequireAuthTime() { - return require_auth_time; - } - - /** - * Sets the Boolean value specifying whether the auth_time claim in the id_token is required. - * Ir is required when the value is true. The auth_time claim request in the request object overrides this setting. - * - * @param requireAuthTime The Boolean value specifying whether the auth_time claim in the id_token is required. - */ - public void setRequireAuthTime(Boolean requireAuthTime) { - this.require_auth_time = requireAuthTime; - } - - /** - * Returns the URI using the https: scheme that the authorization server can call to initiate a login at the client. - * - * @return The URI using the https: scheme that the authorization server can call to initiate a login at the client. - */ - public String getInitiateLoginUri() { - return initiate_login_uri; - } - - /** - * Sets the URI using the https: scheme that the authorization server can call to initiate a login at the client. - * - * @param initiateLoginUri The URI using the https: scheme that the authorization server can call to initiate a - * login at the client. - */ - public void setInitiateLoginUri(String initiateLoginUri) { - this.initiate_login_uri = initiateLoginUri; - } - - /** - * Returns authorized JavaScript origins. - * - * @return Authorized JavaScript origins. - */ - public List getAuthorizedOrigins() { - return authorized_origins; - } - - /** - * Sets authorized JavaScript origins. - * - * @param authorizedOrigins Authorized JavaScript origins. - */ - public void setAuthorizedOrigins(List authorizedOrigins) { - this.authorized_origins = authorizedOrigins; - } - - /** - * Returns the Client-specific access token expiration. - * - * @return The Client-specific access token expiration. - */ - public Integer getAccessTokenLifetime() { - return access_token_lifetime; - } - - /** - * Sets the Client-specific access token expiration (in seconds). Set it to Null or Zero to use the system default value. - * - * @param accessTokenLifetime The Client-specific access token expiration. - */ - public void setAccessTokenLifetime(Integer accessTokenLifetime) { - this.access_token_lifetime = accessTokenLifetime; - } - - /** - * Returns a unique identifier string (UUID) assigned by the client developer or software publisher used by - * registration endpoints to identify the client software to be dynamically registered. - * - * @return The software identifier. - */ - public String getSoftwareId() { - return software_id; - } - - /** - * Sets a unique identifier string (UUID) assigned by the client developer or software publisher used by - * registration endpoints to identify the client software to be dynamically registered. - * - * @param softwareId The software identifier. - */ - public void setSoftwareId(String softwareId) { - this.software_id = softwareId; - } - - /** - * Returns a version identifier string for the client software identified by "software_id". - * The value of the "software_version" should change on any update to the client software identified by the same - * "software_id". - * - * @return The version identifier. - */ - public String getSoftwareVersion() { - return software_version; - } - - /** - * Sets a version identifier string for the client software identified by "software_id". - * The value of the "software_version" should change on any update to the client software identified by the same - * "software_id". - * - * @param softwareVersion The version identifier. - */ - public void setSoftwareVersion(String softwareVersion) { - this.software_version = softwareVersion; - } - - /** - * Returns a software statement containing client metadata values about the client software as claims. - * This is a string value containing the entire signed JWT. - * - * @return The software statement. - */ - public String getSoftwareStatement() { - return software_statement; - } - - /** - * Sets a software statement containing client metadata values about the client software as claims. - * This is a string value containing the entire signed JWT. - * - * @param softwareStatement The software statement. - */ - public void setSoftwareStatement(String softwareStatement) { - this.software_statement = softwareStatement; - } - - /** - * Gets custom attribute map copy. - * - * @return custom attribute map copy - */ - public Map getCustomAttributes() { - return custom_attributes; - } - - public void setCustomAttributes(Map customAttributes) { - this.custom_attributes = customAttributes; - } - - public Boolean getSyncClientFromOp() { - return syncClientFromOp; - } - - public void setSyncClientFromOp(Boolean syncClientFromOp) { - this.syncClientFromOp = syncClientFromOp; - } - - public int getSyncClientPeriodInSeconds() { - return syncClientPeriodInSeconds; - } - - public void setSyncClientPeriodInSeconds(int syncClientPeriodInSeconds) { - this.syncClientPeriodInSeconds = syncClientPeriodInSeconds; - } - - public Boolean getAllowSpontaneousScopes() { - return allowSpontaneousScopes; - } - - public void setAllowSpontaneousScopes(Boolean allowSpontaneousScopes) { - this.allowSpontaneousScopes = allowSpontaneousScopes; - } - - public List getSpontaneousScopes() { - return spontaneousScopes; - } - - public void setSpontaneousScopes(List spontaneousScopes) { - this.spontaneousScopes = spontaneousScopes; - } - - @Override - public String toString() { - return "RegisterSiteParams{" + - "op_host='" + op_host + '\'' + - ", op_discovery_path='" + op_discovery_path + '\'' + - ", op_configuration_endpoint='" + op_configuration_endpoint + '\'' + - ", post_logout_redirect_uris='" + post_logout_redirect_uris + '\'' + - ", redirect_uris=" + redirect_uris + - ", response_types=" + response_types + - ", claims_redirect_uri=" + claims_redirect_uri + - ", client_id='" + client_id + '\'' + - ", client_registration_access_token='" + client_registration_access_token + '\'' + - ", client_registration_client_uri='" + client_registration_client_uri + '\'' + - ", client_name='" + client_name + '\'' + - ", client_jwks_uri='" + client_jwks_uri + '\'' + - ", client_token_endpoint_auth_method='" + client_token_endpoint_auth_method + '\'' + - ", client_token_endpoint_auth_signing_alg='" + client_token_endpoint_auth_signing_alg + '\'' + - ", client_request_uris=" + client_request_uris + - ", client_frontchannel_logout_uri=" + client_frontchannel_logout_uri + - ", client_sector_identifier_uri='" + client_sector_identifier_uri + '\'' + - ", scope=" + scope + - ", ui_locales=" + ui_locales + - ", claims_locales=" + claims_locales + - ", acr_values=" + acr_values + - ", grant_types=" + grant_types + - ", contacts=" + contacts + - ", access_token_as_jwt=" + access_token_as_jwt + - ", access_token_signing_alg=" + access_token_signing_alg + - ", rpt_as_jwt=" + rpt_as_jwt + - ", logo_uri='" + logo_uri + '\'' + - ", client_uri='" + client_uri + '\'' + - ", policy_uri='" + policy_uri + '\'' + - ", front_channel_logout_session_required='" + front_channel_logout_session_required + '\'' + - ", tos_uri='" + tos_uri + '\'' + - ", jwks='" + jwks + '\'' + - ", id_token_binding_cnf='" + id_token_binding_cnf + '\'' + - ", tls_client_auth_subject_dn='" + tls_client_auth_subject_dn + '\'' + - ", subject_type='" + subject_type + '\'' + - ", run_introspection_script_beforeaccess_token_as_jwt_creation_and_include_claims='" + run_introspection_script_beforeaccess_token_as_jwt_creation_and_include_claims + '\'' + - ", id_token_signed_response_alg='" + id_token_signed_response_alg + '\'' + - ", id_token_encrypted_response_alg='" + id_token_encrypted_response_alg + '\'' + - ", id_token_encrypted_response_enc='" + id_token_encrypted_response_enc + '\'' + - ", user_info_signed_response_alg='" + user_info_signed_response_alg + '\'' + - ", user_info_encrypted_response_alg='" + user_info_encrypted_response_alg + '\'' + - ", user_info_encrypted_response_enc='" + user_info_encrypted_response_enc + '\'' + - ", request_object_signing_alg='" + request_object_signing_alg + '\'' + - ", request_object_encryption_alg='" + request_object_encryption_alg + '\'' + - ", request_object_encryption_enc='" + request_object_encryption_enc + '\'' + - ", default_max_age='" + default_max_age + '\'' + - ", require_auth_time='" + require_auth_time + '\'' + - ", initiate_login_uri='" + initiate_login_uri + '\'' + - ", authorized_origins='" + authorized_origins + '\'' + - ", access_token_lifetime='" + access_token_lifetime + '\'' + - ", software_id='" + software_id + '\'' + - ", software_version='" + software_version + '\'' + - ", software_statement='" + software_statement + '\'' + - ", custom_attributes='" + custom_attributes + '\'' + - ", syncClientFromOp='" + syncClientFromOp + '\'' + - ", syncClientPeriodInSeconds='" + syncClientPeriodInSeconds + '\'' + - ", allowSpontaneousScopes='" + allowSpontaneousScopes + '\'' + - ", spontaneousScopes='" + spontaneousScopes + '\'' + - '}'; - } - - @JsonIgnore - @Override - public String getRpId() { - return "no"; - } -} - diff --git a/jans-client-api/common/src/main/java/io/jans/ca/common/params/RemoveSiteParams.java b/jans-client-api/common/src/main/java/io/jans/ca/common/params/RemoveSiteParams.java deleted file mode 100644 index 868c3f0b3c1..00000000000 --- a/jans-client-api/common/src/main/java/io/jans/ca/common/params/RemoveSiteParams.java +++ /dev/null @@ -1,41 +0,0 @@ -package io.jans.ca.common.params; - -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** - * @author yuriyz - */ -@JsonIgnoreProperties(ignoreUnknown = true) -public class RemoveSiteParams implements HasRpIdParams { - - @JsonProperty(value = "rp_id") - private String rp_id; - - public RemoveSiteParams() { - } - - public RemoveSiteParams(String rpId) { - this(rpId, null); - } - - public RemoveSiteParams(String rpId, String token) { - this.rp_id = rpId; - } - - @Override - public String getRpId() { - return rp_id; - } - - public void setRpId(String rpId) { - this.rp_id = rpId; - } - - @Override - public String toString() { - return "RemoveSiteParams{" + - "rp_id='" + rp_id + '\'' + - '}'; - } -} diff --git a/jans-client-api/common/src/main/java/io/jans/ca/common/params/RpGetClaimsGatheringUrlParams.java b/jans-client-api/common/src/main/java/io/jans/ca/common/params/RpGetClaimsGatheringUrlParams.java deleted file mode 100644 index 6634a6687b5..00000000000 --- a/jans-client-api/common/src/main/java/io/jans/ca/common/params/RpGetClaimsGatheringUrlParams.java +++ /dev/null @@ -1,82 +0,0 @@ -package io.jans.ca.common.params; - -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonProperty; - -import java.util.Map; - -/** - * @author Yuriy Zabrovarnyy - * @version 0.9, 17/06/2016 - */ - -@JsonIgnoreProperties(ignoreUnknown = true) -public class RpGetClaimsGatheringUrlParams implements HasRpIdParams { - - @JsonProperty(value = "rp_id") - private String rp_id; - @JsonProperty(value = "ticket") - private String ticket; - @JsonProperty(value = "claims_redirect_uri") - private String claims_redirect_uri; - @JsonProperty(value = "state") - private String state; - @JsonProperty(value = "custom_parameters") - private Map custom_parameters; - - public RpGetClaimsGatheringUrlParams() { - } - - public String getRpId() { - return rp_id; - } - - public void setRpId(String rpId) { - this.rp_id = rpId; - } - - public String getTicket() { - return ticket; - } - - public void setTicket(String ticket) { - this.ticket = ticket; - } - - public String getClaimsRedirectUri() { - return claims_redirect_uri; - } - - public void setClaimsRedirectUri(String claimsRedirectUri) { - this.claims_redirect_uri = claimsRedirectUri; - } - - public String getState() { - return state; - } - - public void setState(String state) { - this.state = state; - } - - public Map getCustomParameters() { - return custom_parameters; - } - - public void setCustomParameters(Map custom_parameters) { - this.custom_parameters = custom_parameters; - } - - @Override - public String toString() { - final StringBuilder sb = new StringBuilder(); - sb.append("RpGetGetClaimsGatheringUrlParams"); - sb.append("{rp_id='").append(rp_id).append('\''); - sb.append(", ticket=").append(ticket); - sb.append(", claims_redirect_uri=").append(claims_redirect_uri); - sb.append(", state=").append(state); - sb.append(", custom_parameters=").append(custom_parameters); - sb.append('}'); - return sb.toString(); - } -} diff --git a/jans-client-api/common/src/main/java/io/jans/ca/common/params/RpGetRptParams.java b/jans-client-api/common/src/main/java/io/jans/ca/common/params/RpGetRptParams.java deleted file mode 100644 index 1985176639a..00000000000 --- a/jans-client-api/common/src/main/java/io/jans/ca/common/params/RpGetRptParams.java +++ /dev/null @@ -1,127 +0,0 @@ -/** - * All rights reserved -- Copyright 2015 Gluu Inc. - */ -package io.jans.ca.common.params; - -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonProperty; - -import java.util.List; -import java.util.Map; - -/** - * @author Yuriy Zabrovarnyy - */ -@JsonIgnoreProperties(ignoreUnknown = true) -public class RpGetRptParams implements HasRpIdParams { - - @JsonProperty(value = "rp_id") - private String rp_id; - @JsonProperty(value = "ticket") - private String ticket; - @JsonProperty(value = "claim_token") - private String claim_token; - @JsonProperty(value = "claim_token_format") - private String claim_token_format; - @JsonProperty(value = "pct") - private String pct; - @JsonProperty(value = "rpt") - private String rpt; - @JsonProperty(value = "scope") - private List scope; - @JsonProperty(value = "state") - private String state; - @JsonProperty(value = "params") - private Map params; - - public RpGetRptParams() { - } - - public Map getParams() { - return params; - } - - public void setParams(Map params) { - this.params = params; - } - - public String getRpId() { - return rp_id; - } - - public void setRpId(String rpId) { - this.rp_id = rpId; - } - - - public String getTicket() { - return ticket; - } - - public void setTicket(String ticket) { - this.ticket = ticket; - } - - public String getClaimToken() { - return claim_token; - } - - public void setClaimToken(String claimToken) { - this.claim_token = claimToken; - } - - public String getClaimTokenFormat() { - return claim_token_format; - } - - public void setClaimTokenFormat(String claimTokenFormat) { - this.claim_token_format = claimTokenFormat; - } - - public String getPct() { - return pct; - } - - public void setPct(String pct) { - this.pct = pct; - } - - public String getRpt() { - return rpt; - } - - public void setRpt(String rpt) { - this.rpt = rpt; - } - - public List getScope() { - return scope; - } - - public void setScope(List scope) { - this.scope = scope; - } - - public String getState() { - return state; - } - - public void setState(String state) { - this.state = state; - } - - @Override - public String toString() { - return "RpGetRptParams{" + - "rp_id='" + rp_id + '\'' + - ", ticket='" + ticket + '\'' + - ", claim_token='" + claim_token + '\'' + - ", claim_token_format='" + claim_token_format + '\'' + - ", pct='" + pct + '\'' + - ", rpt='" + rpt + '\'' + - ", scope=" + scope + - ", state='" + state + '\'' + - ", params='" + params + '\'' + - '}'; - } -} diff --git a/jans-client-api/common/src/main/java/io/jans/ca/common/params/RsCheckAccessParams.java b/jans-client-api/common/src/main/java/io/jans/ca/common/params/RsCheckAccessParams.java deleted file mode 100644 index c913e67b085..00000000000 --- a/jans-client-api/common/src/main/java/io/jans/ca/common/params/RsCheckAccessParams.java +++ /dev/null @@ -1,82 +0,0 @@ -package io.jans.ca.common.params; - -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonProperty; - -import java.util.List; - -/** - * @author Yuriy Zabrovarnyy - * @version 0.9, 06/06/2016 - */ - -@JsonIgnoreProperties(ignoreUnknown = true) -public class RsCheckAccessParams implements HasRpIdParams { - - @JsonProperty(value = "rp_id") - private String rp_id; - @JsonProperty(value = "rpt") - private String rpt; - @JsonProperty(value = "path") - private String path; - @JsonProperty(value = "http_method") - private String http_method; - @JsonProperty(value = "scopes") - private List scopes; - - public RsCheckAccessParams() { - } - - public String getRpId() { - return rp_id; - } - - public void setRpId(String rpId) { - this.rp_id = rpId; - } - - public String getRpt() { - return rpt; - } - - public void setRpt(String rpt) { - this.rpt = rpt; - } - - public String getPath() { - return path; - } - - public void setPath(String path) { - this.path = path; - } - - public String getHttpMethod() { - return http_method; - } - - public void setHttpMethod(String httpMethod) { - this.http_method = httpMethod; - } - - public List getScopes() { - return scopes; - } - - public void setScopes(List scopes) { - this.scopes = scopes; - } - - @Override - public String toString() { - final StringBuilder sb = new StringBuilder(); - sb.append("RsCheckAccessParams"); - sb.append("{rp_id='").append(rp_id).append('\''); - sb.append(", rpt='").append(rpt).append('\''); - sb.append(", path='").append(path).append('\''); - sb.append(", http_method='").append(http_method).append('\''); - sb.append(", scopes='").append(scopes).append('\''); - sb.append('}'); - return sb.toString(); - } -} diff --git a/jans-client-api/common/src/main/java/io/jans/ca/common/params/RsModifyParams.java b/jans-client-api/common/src/main/java/io/jans/ca/common/params/RsModifyParams.java deleted file mode 100644 index e8708d868bb..00000000000 --- a/jans-client-api/common/src/main/java/io/jans/ca/common/params/RsModifyParams.java +++ /dev/null @@ -1,82 +0,0 @@ -package io.jans.ca.common.params; - -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.google.common.base.Strings; - -import java.util.List; - -@JsonIgnoreProperties(ignoreUnknown = true) -public class RsModifyParams implements HasRpIdParams { - - @JsonProperty(value = "rp_id") - private String rp_id; - @JsonProperty("path") - String path; - @JsonProperty("http_method") - String httpMethod; - @JsonProperty("scopes") - List scopes; - @JsonProperty("scope_expression") - String scopeExpression; - - public String getRpId() { - return rp_id; - } - - public void setRpId(String rpId) { - this.rp_id = rpId; - } - - public String getPath() { - return path; - } - - public void setPath(String path) { - this.path = path; - } - - public String getHttpMethod() { - return httpMethod; - } - - public void setHttpMethod(String httpMethod) { - this.httpMethod = httpMethod; - } - - public List getScopes() { - return scopes; - } - - public void setScopes(List scopes) { - this.scopes = scopes; - } - - public String getScopeExpression() { - return scopeExpression; - } - - public void setScopeExpression(String scopeExpression) { - this.scopeExpression = correctScopeExpression(scopeExpression); - } - - @Override - public String toString() { - final StringBuilder sb = new StringBuilder(); - sb.append("RsModifyParams"); - sb.append("{rp_id='").append(rp_id).append('\''); - sb.append(", path=").append(path); - sb.append(", httpMethod=").append(httpMethod); - sb.append(", scopes=").append(scopes); - sb.append(", scopeExpression=").append(scopeExpression); - sb.append('}'); - return sb.toString(); - } - - public static String correctScopeExpression(String input) { - if (!Strings.isNullOrEmpty(input) && !input.equals("null")) { - return input.replaceAll("'", "\"");//replacing all single quotes to double quotes - } - return input; - } -} diff --git a/jans-client-api/common/src/main/java/io/jans/ca/common/params/RsProtectParams.java b/jans-client-api/common/src/main/java/io/jans/ca/common/params/RsProtectParams.java deleted file mode 100644 index 959e5ed1f51..00000000000 --- a/jans-client-api/common/src/main/java/io/jans/ca/common/params/RsProtectParams.java +++ /dev/null @@ -1,61 +0,0 @@ -package io.jans.ca.common.params; - -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonProperty; -import io.jans.ca.rs.protect.RsResource; - -import java.util.List; - -/** - * @author Yuriy Zabrovarnyy - * @version 0.9, 31/05/2016 - */ - -@JsonIgnoreProperties(ignoreUnknown = true) -public class RsProtectParams implements HasRpIdParams { - - @JsonProperty(value = "rp_id") - private String rp_id; - @JsonProperty(value = "resources") - private List resources; - @JsonProperty(value = "overwrite") - private Boolean overwrite = false; - - public RsProtectParams() { - } - - public String getRpId() { - return rp_id; - } - - public void setRpId(String rpId) { - this.rp_id = rpId; - } - - public List getResources() { - return resources; - } - - public void setResources(List resources) { - this.resources = resources; - } - - public Boolean getOverwrite() { - return overwrite; - } - - public void setOverwrite(Boolean overwrite) { - this.overwrite = overwrite; - } - - @Override - public String toString() { - final StringBuilder sb = new StringBuilder(); - sb.append("RsProtectParams"); - sb.append("{rp_id='").append(rp_id).append('\''); - sb.append(", resources=").append(resources); - sb.append(", overwrite=").append(overwrite); - sb.append('}'); - return sb.toString(); - } -} diff --git a/jans-client-api/common/src/main/java/io/jans/ca/common/params/StringParam.java b/jans-client-api/common/src/main/java/io/jans/ca/common/params/StringParam.java deleted file mode 100644 index a33ba077887..00000000000 --- a/jans-client-api/common/src/main/java/io/jans/ca/common/params/StringParam.java +++ /dev/null @@ -1,47 +0,0 @@ -package io.jans.ca.common.params; - -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonProperty; -import io.jans.ca.common.Jackson2; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import java.io.IOException; - -@JsonIgnoreProperties(ignoreUnknown = true) -public class StringParam implements IParams { - private static final Logger LOG = LoggerFactory.getLogger(StringParam.class); - @JsonProperty(value = "value") - String value; - - public StringParam() { - } - - public StringParam(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public void setValue(String value) { - this.value = value; - } - - @Override - public String toString() { - return "StringParam{" + - "value='" + value + '\'' + - '}'; - } - - public String toJsonString() { - try { - return Jackson2.serializeWithoutNulls(this); - } catch (IOException e) { - LOG.error("Error in parsing StringParam object.", e); - throw new RuntimeException(e); - } - } -} diff --git a/jans-client-api/common/src/main/java/io/jans/ca/common/params/UpdateSiteParams.java b/jans-client-api/common/src/main/java/io/jans/ca/common/params/UpdateSiteParams.java deleted file mode 100644 index 1ec3a3cc8af..00000000000 --- a/jans-client-api/common/src/main/java/io/jans/ca/common/params/UpdateSiteParams.java +++ /dev/null @@ -1,935 +0,0 @@ -package io.jans.ca.common.params; - -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonProperty; - -import java.util.List; -import java.util.Map; - -/** - * @author Yuriy Zabrovarnyy - * @version 0.9, 14/03/2016 - */ - -@JsonIgnoreProperties(ignoreUnknown = true) -public class UpdateSiteParams implements HasRpIdParams { - - @JsonProperty(value = "rp_id") - private String rp_id; - @JsonProperty(value = "post_logout_redirect_uris") - private List post_logout_redirect_uris; - - @JsonProperty(value = "redirect_uris") - private List redirect_uris; - @JsonProperty(value = "response_types") - private List response_types; - - @JsonProperty(value = "client_id") - private String client_id; - @JsonProperty(value = "client_secret") - private String client_secret; - @JsonProperty(value = "client_jwks_uri") - private String client_jwks_uri; - @JsonProperty(value = "client_sector_identifier_uri") - private String client_sector_identifier_uri; - @JsonProperty(value = "client_token_endpoint_auth_method") - private String client_token_endpoint_auth_method; - @JsonProperty(value = "client_request_uris") - private List client_request_uris; - @JsonProperty(value = "client_frontchannel_logout_uri") - private String client_frontchannel_logout_uri; - - @JsonProperty(value = "scope") - private List scope; - @JsonProperty(value = "ui_locales") - private List ui_locales; - @JsonProperty(value = "claims_locales") - private List claims_locales; - @JsonProperty(value = "acr_values") - private List acr_values; - @JsonProperty(value = "grant_types") - private List grant_types; - @JsonProperty(value = "contacts") - private List contacts; - @JsonProperty(value = "access_token_as_jwt") - private Boolean access_token_as_jwt; - @JsonProperty(value = "access_token_signing_alg") - private String access_token_signing_alg; - @JsonProperty(value = "rpt_as_jwt") - private Boolean rpt_as_jwt; - @JsonProperty(value = "claims_redirect_uri") - private List claims_redirect_uri; - - @JsonProperty(value = "client_registration_access_token") - private String client_registration_access_token; - @JsonProperty(value = "client_registration_client_uri") - private String client_registration_client_uri; - @JsonProperty(value = "client_name") - private String client_name; - @JsonProperty(value = "client_token_endpoint_auth_signing_alg") - private String client_token_endpoint_auth_signing_alg; - @JsonProperty(value = "logo_uri") - private String logo_uri; - @JsonProperty(value = "client_uri") - private String client_uri; - @JsonProperty(value = "policy_uri") - private String policy_uri; - @JsonProperty(value = "front_channel_logout_session_required") - private Boolean front_channel_logout_session_required; - @JsonProperty(value = "tos_uri") - private String tos_uri; - @JsonProperty(value = "jwks") - private String jwks; - @JsonProperty(value = "id_token_binding_cnf") - private String id_token_binding_cnf; - @JsonProperty(value = "tls_client_auth_subject_dn") - private String tls_client_auth_subject_dn; - @JsonProperty(value = "subject_type") - private String subject_type; - @JsonProperty(value = "run_introspection_script_beforeaccess_token_as_jwt_creation_and_include_claims") - private Boolean run_introspection_script_beforeaccess_token_as_jwt_creation_and_include_claims; - @JsonProperty(value = "id_token_signed_response_alg") - private String id_token_signed_response_alg; - @JsonProperty(value = "id_token_encrypted_response_alg") - private String id_token_encrypted_response_alg; - @JsonProperty(value = "id_token_encrypted_response_enc") - private String id_token_encrypted_response_enc; - @JsonProperty(value = "user_info_signed_response_alg") - private String user_info_signed_response_alg; - @JsonProperty(value = "user_info_encrypted_response_alg") - private String user_info_encrypted_response_alg; - @JsonProperty(value = "user_info_encrypted_response_enc") - private String user_info_encrypted_response_enc; - @JsonProperty(value = "request_object_signing_alg") - private String request_object_signing_alg; - @JsonProperty(value = "request_object_encryption_alg") - private String request_object_encryption_alg; - @JsonProperty(value = "request_object_encryption_enc") - private String request_object_encryption_enc; - @JsonProperty(value = "default_max_age") - private Integer default_max_age; - @JsonProperty(value = "require_auth_time") - private Boolean require_auth_time; - @JsonProperty(value = "initiate_login_uri") - private String initiate_login_uri; - @JsonProperty(value = "authorized_origins") - private List authorized_origins; - @JsonProperty(value = "access_token_lifetime") - private Integer access_token_lifetime; - @JsonProperty(value = "software_id") - private String software_id; - @JsonProperty(value = "software_version") - private String software_version; - @JsonProperty(value = "software_statement") - private String software_statement; - @JsonProperty(value = "custom_attributes") - private Map custom_attributes; - @JsonProperty(value = "sync_client_from_op") - private Boolean syncClientFromOp = false; - @JsonProperty(value = "sync_client_period_in_seconds") - private int syncClientPeriodInSeconds = 86400; - @JsonProperty(value = "allow_spontaneous_scopes") - private Boolean allowSpontaneousScopes = false; - @JsonProperty(value = "spontaneous_scopes") - private List spontaneousScopes; - - public UpdateSiteParams() { - } - - public List getClaimsRedirectUri() { - return claims_redirect_uri; - } - - public void setClaimsRedirectUri(List claims_redirect_uri) { - this.claims_redirect_uri = claims_redirect_uri; - } - - public Boolean getRptAsJwt() { - return rpt_as_jwt; - } - - public void setRptAsJwt(Boolean rpt_as_jwt) { - this.rpt_as_jwt = rpt_as_jwt; - } - - public String getClientSectorIdentifierUri() { - return client_sector_identifier_uri; - } - - public void setClientSectorIdentifierUri(String clientSectorIdentifierUri) { - this.client_sector_identifier_uri = clientSectorIdentifierUri; - } - - public String getRpId() { - return rp_id; - } - - public void setRpId(String rpId) { - this.rp_id = rpId; - } - - public String getClientFrontchannelLogoutUri() { - return client_frontchannel_logout_uri; - } - - public void setClientFrontchannelLogoutUri(String clientFrontchannelLogoutUri) { - this.client_frontchannel_logout_uri = clientFrontchannelLogoutUri; - } - - public List getClientRequestUris() { - return client_request_uris; - } - - public void setClientRequestUris(List clientRequestUris) { - this.client_request_uris = clientRequestUris; - } - - public String getClientTokenEndpointAuthMethod() { - return client_token_endpoint_auth_method; - } - - public void setClientTokenEndpointAuthMethod(String clientTokenEndpointAuthMethod) { - this.client_token_endpoint_auth_method = clientTokenEndpointAuthMethod; - } - - public List getPostLogoutRedirectUris() { - return post_logout_redirect_uris; - } - - public void setPostLogoutRedirectUris(List postLogoutRedirectUris) { - this.post_logout_redirect_uris = postLogoutRedirectUris; - } - - public String getClientJwksUri() { - return client_jwks_uri; - } - - public void setClientJwksUri(String clientJwksUri) { - this.client_jwks_uri = clientJwksUri; - } - - public List getClaimsLocales() { - return claims_locales; - } - - public void setClaimsLocales(List claimsLocales) { - this.claims_locales = claimsLocales; - } - - public String getClientId() { - return client_id; - } - - public void setClientId(String clientId) { - this.client_id = clientId; - } - - public String getClientSecret() { - return client_secret; - } - - public void setClientSecret(String clientSecret) { - this.client_secret = clientSecret; - } - - public List getGrantType() { - return grant_types; - } - - public void setGrantType(List grantType) { - this.grant_types = grantType; - } - - public List getRedirectUris() { - return redirect_uris; - } - - public void setRedirectUris(List redirectUris) { - this.redirect_uris = redirectUris; - } - - public List getResponseTypes() { - return response_types; - } - - public void setResponseTypes(List responseTypes) { - this.response_types = responseTypes; - } - - public List getScope() { - return scope; - } - - public void setScope(List scope) { - this.scope = scope; - } - - public List getUiLocales() { - return ui_locales; - } - - public void setUiLocales(List uiLocales) { - this.ui_locales = uiLocales; - } - - public List getAcrValues() { - return acr_values; - } - - public void setAcrValues(List acrValues) { - this.acr_values = acrValues; - } - - public List getContacts() { - return contacts; - } - - public void setContacts(List contacts) { - this.contacts = contacts; - } - - public Boolean getAccessTokenAsJwt() { - return access_token_as_jwt; - } - - public void setAccessTokenAsJwt(Boolean access_token_as_jwt) { - this.access_token_as_jwt = access_token_as_jwt; - } - - public String getAccessTokenSigningAlg() { - return access_token_signing_alg; - } - - public void setAccessTokenSigningAlg(String access_token_signing_alg) { - this.access_token_signing_alg = access_token_signing_alg; - } - - public String getClientRegistrationAccessToken() { - return client_registration_access_token; - } - - public void setClientRegistrationAccessToken(String clientRegistrationAccessToken) { - this.client_registration_access_token = clientRegistrationAccessToken; - } - - public String getClientRegistrationClientUri() { - return client_registration_client_uri; - } - - public void setClientRegistrationClientUri(String clientRegistrationClientUri) { - this.client_registration_client_uri = clientRegistrationClientUri; - } - - public String getClientName() { - return client_name; - } - - public void setClientName(String clientName) { - this.client_name = clientName; - } - - public String getClientTokenEndpointAuthSigningAlg() { - return client_token_endpoint_auth_signing_alg; - } - - public void setClientTokenEndpointAuthSigningAlg(String clientTokenEndpointAuthSigningAlg) { - this.client_token_endpoint_auth_signing_alg = clientTokenEndpointAuthSigningAlg; - } - - /** - * Returns an URL that references a logo for the Client application. - * - * @return The URL that references a logo for the Client application. - */ - public String getLogoUri() { - return logo_uri; - } - - /** - * Sets an URL that references a logo for the Client application. - * - * @param logoUri The URL that references a logo for the Client application. - */ - public void setLogoUri(String logoUri) { - this.logo_uri = logoUri; - } - - /** - * Returns an URL of the home page of the Client. - * - * @return The URL of the home page of the Client. - */ - public String getClientUri() { - return client_uri; - } - - /** - * Sets an URL of the home page of the Client. - * - * @param clientUri The URL of the home page of the Client. - */ - public void setClientUri(String clientUri) { - this.client_uri = clientUri; - } - - /** - * Returns an URL that the Relying Party Client provides to the End-User to read about the how the profile data - * will be used. - * - * @return The policy URL. - */ - public String getPolicyUri() { - return policy_uri; - } - - /** - * Sets an URL that the Relying Party Client provides to the End-User to read about the how the profile data will - * be used. - * - * @param policyUri The policy URL. - */ - public void setPolicyUri(String policyUri) { - this.policy_uri = policyUri; - } - - /** - * Gets logout session required. - * - * @return logout session required - */ - public Boolean getFrontChannelLogoutSessionRequired() { - return front_channel_logout_session_required; - } - - /** - * Sets front channel logout session required. - * - * @param frontChannelLogoutSessionRequired front channel logout session required - */ - public void setFrontChannelLogoutSessionRequired(Boolean frontChannelLogoutSessionRequired) { - this.front_channel_logout_session_required = frontChannelLogoutSessionRequired; - } - - /** - * Returns an URL that the Relying Party Client provides to the End-User to read about the Relying Party's terms - * of service. - * - * @return The tems of service URL. - */ - public String getTosUri() { - return tos_uri; - } - - /** - * Sets an URL that the Relying Party Client provides to the End-User to read about the Relying Party's terms of - * service. - * - * @param tosUri The term of service URL. - */ - public void setTosUri(String tosUri) { - this.tos_uri = tosUri; - } - - /** - * Client's JSON Web Key Set (JWK) document, passed by value. The semantics of the jwks parameter are the same as - * the jwks_uri parameter, other than that the JWK Set is passed by value, rather than by reference. - * This parameter is intended only to be used by Clients that, for some reason, are unable to use the jwks_uri - * parameter, for instance, by native applications that might not have a location to host the contents of the JWK - * Set. If a Client can use jwks_uri, it must not use jwks. - * One significant downside of jwks is that it does not enable key rotation (which jwks_uri does, as described in - * Section 10 of OpenID Connect Core 1.0). The jwks_uri and jwks parameters must not be used together. - * - * @return The Client's JSON Web Key Set (JWK) document. - */ - public String getJwks() { - return jwks; - } - - /** - * Client's JSON Web Key Set (JWK) document, passed by value. The semantics of the jwks parameter are the same as - * the jwks_uri parameter, other than that the JWK Set is passed by value, rather than by reference. - * This parameter is intended only to be used by Clients that, for some reason, are unable to use the jwks_uri - * parameter, for instance, by native applications that might not have a location to host the contents of the JWK - * Set. If a Client can use jwks_uri, it must not use jwks. - * One significant downside of jwks is that it does not enable key rotation (which jwks_uri does, as described in - * Section LogoUri10 of OpenID Connect Core 1.0). The jwks_uri and jwks parameters must not be used together. - * - * @param jwks The Client's JSON Web Key Set (JWK) document. - */ - public void setJwks(String jwks) { - this.jwks = jwks; - } - - public String getIdTokenBindingCnf() { - return id_token_binding_cnf; - } - - public void setIdTokenBindingCnf(String idTokenTokenBindingCnf) { - this.id_token_binding_cnf = idTokenTokenBindingCnf; - } - - public String getTlsClientAuthSubjectDn() { - return tls_client_auth_subject_dn; - } - - public void setTlsClientAuthSubjectDn(String tlsClientAuthSubjectDn) { - this.tls_client_auth_subject_dn = tlsClientAuthSubjectDn; - } - - /** - * Returns the Subject Type. Valid types include pairwise and public. - * - * @return The Subject Type. - */ - public String getSubjectType() { - return subject_type; - } - - /** - * Sets the Subject Type. Valid types include pairwise and public. - * - * @param subjectType The Subject Type. - */ - public void setSubjectType(String subjectType) { - this.subject_type = subjectType; - } - - public Boolean getRunIntrospectionScriptBeforeAccessTokenAsJwtCreationAndIncludeClaims() { - return run_introspection_script_beforeaccess_token_as_jwt_creation_and_include_claims; - } - - public void setRunIntrospectionScriptBeforeAccessTokenAsJwtCreationAndIncludeClaims(Boolean runIntrospectionScriptBeforeAccessTokenAsJwtCreationAndIncludeClaims) { - this.run_introspection_script_beforeaccess_token_as_jwt_creation_and_include_claims = runIntrospectionScriptBeforeAccessTokenAsJwtCreationAndIncludeClaims; - } - - /** - * Returns th JWS alg algorithm (JWA) required for the ID Token issued to this client_id. - * - * @return The JWS algorithm (JWA). - */ - public String getIdTokenSignedResponseAlg() { - return id_token_signed_response_alg; - } - - /** - * Sets the JWS alg algorithm (JWA) required for the ID Token issued to this client_id. - * - * @param idTokenSignedResponseAlg The JWS algorithm (JWA). - */ - public void setIdTokenSignedResponseAlg(String idTokenSignedResponseAlg) { - this.id_token_signed_response_alg = idTokenSignedResponseAlg; - } - - /** - * Returns the JWE alg algorithm (JWA) required for encrypting the ID Token issued to this client_id. - * - * @return The JWE algorithm (JWA). - */ - public String getIdTokenEncryptedResponseAlg() { - return id_token_encrypted_response_alg; - } - - /** - * Sets the JWE alg algorithm (JWA) required for encrypting the ID Token issued to this client_id. - * - * @param idTokenEncryptedResponseAlg The JWE algorithm (JWA). - */ - public void setIdTokenEncryptedResponseAlg(String idTokenEncryptedResponseAlg) { - this.id_token_encrypted_response_alg = idTokenEncryptedResponseAlg; - } - - /** - * Returns the JWE enc algorithm (JWA) required for symmetric encryption of the ID Token issued to this client_id. - * - * @return The JWE algorithm (JWA). - */ - public String getIdTokenEncryptedResponseEnc() { - return id_token_encrypted_response_enc; - } - - /** - * Sets the JWE enc algorithm (JWA) required for symmetric encryption of the ID Token issued to this client_id. - * - * @param idTokenEncryptedResponseEnc The JWE algorithm (JWA). - */ - public void setIdTokenEncryptedResponseEnc(String idTokenEncryptedResponseEnc) { - this.id_token_encrypted_response_enc = idTokenEncryptedResponseEnc; - } - - /** - * Returns the JWS alg algorithm (JWA) required for UserInfo responses. - * - * @return The JWS algorithm (JWA). - */ - public String getUserInfoSignedResponseAlg() { - return user_info_signed_response_alg; - } - - /** - * Sets the JWS alg algorithm (JWA) required for UserInfo responses. - * - * @param userInfoSignedResponseAlg The JWS algorithm (JWA). - */ - public void setUserInfoSignedResponseAlg(String userInfoSignedResponseAlg) { - this.user_info_signed_response_alg = userInfoSignedResponseAlg; - } - - /** - * Returns the JWE alg algorithm (JWA) required for encrypting UserInfo responses. - * - * @return The JWE algorithm (JWA). - */ - public String getUserInfoEncryptedResponseAlg() { - return user_info_encrypted_response_alg; - } - - /** - * Sets the JWE alg algorithm (JWA) required for encrypting UserInfo responses. - * - * @param userInfoEncryptedResponseAlg The JWE algorithm (JWA). - */ - public void setUserInfoEncryptedResponseAlg(String userInfoEncryptedResponseAlg) { - this.user_info_encrypted_response_alg = userInfoEncryptedResponseAlg; - } - - /** - * Returns the JWE enc algorithm (JWA) required for symmetric encryption of UserInfo responses. - * - * @return The JWE algorithm (JWA). - */ - public String getUserInfoEncryptedResponseEnc() { - return user_info_encrypted_response_enc; - } - - /** - * Sets the JWE enc algorithm (JWA) required for symmetric encryption of UserInfo responses. - * - * @param userInfoEncryptedResponseEnc The JWE algorithm (JWA). - */ - public void setUserInfoEncryptedResponseEnc(String userInfoEncryptedResponseEnc) { - this.user_info_encrypted_response_enc = userInfoEncryptedResponseEnc; - } - - /** - * Returns the JWS alg algorithm (JWA) that must be required by the Authorization Server. - * - * @return The JWS algorithm (JWA). - */ - public String getRequestObjectSigningAlg() { - return request_object_signing_alg; - } - - /** - * Sets the JWS alg algorithm (JWA) that must be required by the Authorization Server. - * - * @param requestObjectSigningAlg The JWS algorithm (JWA). - */ - public void setRequestObjectSigningAlg(String requestObjectSigningAlg) { - this.request_object_signing_alg = requestObjectSigningAlg; - } - - /** - * Returns the JWE alg algorithm (JWA) the RP is declaring that it may use for encrypting Request Objects - * sent to the OP. - * - * @return The JWE alg algorithm (JWA). - */ - public String getRequestObjectEncryptionAlg() { - return request_object_encryption_alg; - } - - /** - * Sets the JWE alg algorithm (JWA) the RP is declaring that it may use for encrypting Request Objects - * sent to the OP. - * - * @param requestObjectEncryptionAlg The JWE alg algorithm (JWA). - */ - public void setRequestObjectEncryptionAlg(String requestObjectEncryptionAlg) { - this.request_object_encryption_alg = requestObjectEncryptionAlg; - } - - /** - * Returns the JWE enc algorithm (JWA) the RP is declaring that it may use for encrypting Request Objects - * sent to the OP. - * - * @return The JWE enc algorithm (JWA). - */ - public String getRequestObjectEncryptionEnc() { - return request_object_encryption_enc; - } - - /** - * Sets the JWE enc algorithm (JWA) the RP is declaring that it may use for encrypting Request Objects - * sent to the OP. - * - * @param requestObjectEncryptionEnc The JWE enc algorithm (JWA). - */ - public void setRequestObjectEncryptionEnc(String requestObjectEncryptionEnc) { - this.request_object_encryption_enc = requestObjectEncryptionEnc; - } - - /** - * Returns the Default Maximum Authentication Age. - * - * @return The Default Maximum Authentication Age. - */ - public Integer getDefaultMaxAge() { - return default_max_age; - } - - /** - * Sets the Default Maximum Authentication Age. - * - * @param defaultMaxAge The Default Maximum Authentication Age. - */ - public void setDefaultMaxAge(Integer defaultMaxAge) { - this.default_max_age = defaultMaxAge; - } - - /** - * Returns the Boolean value specifying whether the auth_time claim in the id_token is required. - * It is required when the value is true. The auth_time claim request in the request object overrides this setting. - * - * @return The Boolean value specifying whether the auth_time claim in the id_token is required. - */ - public Boolean getRequireAuthTime() { - return require_auth_time; - } - - /** - * Sets the Boolean value specifying whether the auth_time claim in the id_token is required. - * Ir is required when the value is true. The auth_time claim request in the request object overrides this setting. - * - * @param requireAuthTime The Boolean value specifying whether the auth_time claim in the id_token is required. - */ - public void setRequireAuthTime(Boolean requireAuthTime) { - this.require_auth_time = requireAuthTime; - } - - /** - * Returns the URI using the https: scheme that the authorization server can call to initiate a login at the client. - * - * @return The URI using the https: scheme that the authorization server can call to initiate a login at the client. - */ - public String getInitiateLoginUri() { - return initiate_login_uri; - } - - /** - * Sets the URI using the https: scheme that the authorization server can call to initiate a login at the client. - * - * @param initiateLoginUri The URI using the https: scheme that the authorization server can call to initiate a - * login at the client. - */ - public void setInitiateLoginUri(String initiateLoginUri) { - this.initiate_login_uri = initiateLoginUri; - } - - /** - * Returns authorized JavaScript origins. - * - * @return Authorized JavaScript origins. - */ - public List getAuthorizedOrigins() { - return authorized_origins; - } - - /** - * Sets authorized JavaScript origins. - * - * @param authorizedOrigins Authorized JavaScript origins. - */ - public void setAuthorizedOrigins(List authorizedOrigins) { - this.authorized_origins = authorizedOrigins; - } - - /** - * Returns the Client-specific access token expiration. - * - * @return The Client-specific access token expiration. - */ - public Integer getAccessTokenLifetime() { - return access_token_lifetime; - } - - /** - * Sets the Client-specific access token expiration (in seconds). Set it to Null or Zero to use the system default value. - * - * @param accessTokenLifetime The Client-specific access token expiration. - */ - public void setAccessTokenLifetime(Integer accessTokenLifetime) { - this.access_token_lifetime = accessTokenLifetime; - } - - /** - * Returns a unique identifier string (UUID) assigned by the client developer or software publisher used by - * registration endpoints to identify the client software to be dynamically registered. - * - * @return The software identifier. - */ - public String getSoftwareId() { - return software_id; - } - - /** - * Sets a unique identifier string (UUID) assigned by the client developer or software publisher used by - * registration endpoints to identify the client software to be dynamically registered. - * - * @param softwareId The software identifier. - */ - public void setSoftwareId(String softwareId) { - this.software_id = softwareId; - } - - /** - * Returns a version identifier string for the client software identified by "software_id". - * The value of the "software_version" should change on any update to the client software identified by the same - * "software_id". - * - * @return The version identifier. - */ - public String getSoftwareVersion() { - return software_version; - } - - /** - * Sets a version identifier string for the client software identified by "software_id". - * The value of the "software_version" should change on any update to the client software identified by the same - * "software_id". - * - * @param softwareVersion The version identifier. - */ - public void setSoftwareVersion(String softwareVersion) { - this.software_version = softwareVersion; - } - - /** - * Returns a software statement containing client metadata values about the client software as claims. - * This is a string value containing the entire signed JWT. - * - * @return The software statement. - */ - public String getSoftwareStatement() { - return software_statement; - } - - /** - * Sets a software statement containing client metadata values about the client software as claims. - * This is a string value containing the entire signed JWT. - * - * @param softwareStatement The software statement. - */ - public void setSoftwareStatement(String softwareStatement) { - this.software_statement = softwareStatement; - } - - /** - * Gets custom attribute map copy. - * - * @return custom attribute map copy - */ - public Map getCustomAttributes() { - return custom_attributes; - } - - public void setCustomAttributes(Map customAttributes) { - this.custom_attributes = customAttributes; - } - - public Boolean getSyncClientFromOp() { - return syncClientFromOp; - } - - public void setSyncClientFromOp(Boolean syncClientFromOp) { - this.syncClientFromOp = syncClientFromOp; - } - - public int getSyncClientPeriodInSeconds() { - return syncClientPeriodInSeconds; - } - - public void setSyncClientPeriodInSeconds(int syncClientPeriodInSeconds) { - this.syncClientPeriodInSeconds = syncClientPeriodInSeconds; - } - - public Boolean getAllowSpontaneousScopes() { - return allowSpontaneousScopes; - } - - public void setAllowSpontaneousScopes(Boolean allowSpontaneousScopes) { - this.allowSpontaneousScopes = allowSpontaneousScopes; - } - - public List getSpontaneousScopes() { - return spontaneousScopes; - } - - public void setSpontaneousScopes(List spontaneousScopes) { - this.spontaneousScopes = spontaneousScopes; - } - - @Override - public String toString() { - final StringBuilder sb = new StringBuilder(); - sb.append("UpdateSiteParams"); - sb.append("{acr_values=").append(acr_values); - sb.append(", rp_id='").append(rp_id).append('\''); - sb.append(", post_logout_redirect_uris='").append(post_logout_redirect_uris).append('\''); - sb.append(", redirect_uris=").append(redirect_uris); - sb.append(", response_types=").append(response_types); - sb.append(", client_id='").append(client_id).append('\''); - sb.append(", client_secret='").append(client_secret).append('\''); - sb.append(", client_sector_identifier_uri='").append(client_sector_identifier_uri).append('\''); - sb.append(", scope=").append(scope); - sb.append(", ui_locales=").append(ui_locales); - sb.append(", claims_locales=").append(claims_locales); - sb.append(", grant_types=").append(grant_types); - sb.append(", contacts=").append(contacts); - sb.append(", access_token_as_jwt=").append(access_token_as_jwt); - sb.append(", access_token_signing_alg=").append(access_token_signing_alg); - sb.append(", rpt_as_jwt=").append(rpt_as_jwt); - sb.append(",claims_redirect_uri=").append(claims_redirect_uri); - sb.append(",client_frontchannel_logout_uri=").append(client_frontchannel_logout_uri); - - - sb.append(", client_registration_access_token=").append(client_registration_access_token); - sb.append(", client_registration_client_uri=").append(client_registration_client_uri); - sb.append(", client_name=").append(client_name); - sb.append(", client_token_endpoint_auth_signing_alg=").append(client_token_endpoint_auth_signing_alg); - sb.append(", logo_uri=").append(logo_uri); - sb.append(", client_uri=").append(client_uri); - sb.append(", policy_uri=").append(policy_uri); - sb.append(", front_channel_logout_session_required=").append(front_channel_logout_session_required); - sb.append(", tos_uri=").append(tos_uri); - sb.append(", jwks=").append(jwks); - sb.append(", id_token_binding_cnf=").append(id_token_binding_cnf); - sb.append(", tls_client_auth_subject_dn=").append(tls_client_auth_subject_dn); - sb.append(", subject_type=").append(subject_type); - sb.append(", run_introspection_script_beforeaccess_token_as_jwt_creation_and_include_claims=").append(run_introspection_script_beforeaccess_token_as_jwt_creation_and_include_claims); - sb.append(", id_token_signed_response_alg=").append(id_token_signed_response_alg); - sb.append(", id_token_encrypted_response_alg=").append(id_token_encrypted_response_alg); - sb.append(", id_token_encrypted_response_enc=").append(id_token_encrypted_response_enc); - sb.append(", user_info_signed_response_alg=").append(user_info_signed_response_alg); - sb.append(", user_info_encrypted_response_alg=").append(user_info_encrypted_response_alg); - sb.append(", user_info_encrypted_response_enc=").append(user_info_encrypted_response_enc); - sb.append(", request_object_signing_alg=").append(request_object_signing_alg); - sb.append(", request_object_encryption_alg=").append(request_object_encryption_alg); - sb.append(", request_object_encryption_enc=").append(request_object_encryption_enc); - sb.append(", default_max_age=").append(default_max_age); - sb.append(", require_auth_time=").append(require_auth_time); - sb.append(", initiate_login_uri=").append(initiate_login_uri); - sb.append(", authorized_origins=").append(authorized_origins); - sb.append(", access_token_lifetime=").append(access_token_lifetime); - sb.append(", software_id=").append(software_id); - sb.append(", software_version=").append(software_version); - sb.append(", software_statement=").append(software_statement); - sb.append(", custom_attributes=").append(custom_attributes); - sb.append(", syncClientFromOp=").append(syncClientFromOp); - sb.append(", syncClientPeriodInSeconds=").append(syncClientPeriodInSeconds); - sb.append(", allowSpontaneousScopes=").append(allowSpontaneousScopes); - sb.append(", spontaneousScopes=").append(spontaneousScopes); - sb.append('}'); - return sb.toString(); - } - -} \ No newline at end of file diff --git a/jans-client-api/common/src/main/java/io/jans/ca/common/params/ValidateParams.java b/jans-client-api/common/src/main/java/io/jans/ca/common/params/ValidateParams.java deleted file mode 100644 index 7722b9e228a..00000000000 --- a/jans-client-api/common/src/main/java/io/jans/ca/common/params/ValidateParams.java +++ /dev/null @@ -1,90 +0,0 @@ -package io.jans.ca.common.params; - - -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** - * @author Yuriy Zabrovarnyy - * @version 0.9, 14/03/2017 - */ - -@JsonIgnoreProperties(ignoreUnknown = true) -public class ValidateParams implements HasRpIdParams { - - @JsonProperty(value = "rp_id") - private String rp_id; - - @JsonProperty(value = "code") - private String code; - @JsonProperty(value = "id_token") - private String id_token; - @JsonProperty(value = "access_token") - private String access_token; - - @JsonProperty(value = "nonce") - private String nonce; - @JsonProperty(value = "state") - private String state; - - public String getCode() { - return code; - } - - public void setCode(String code) { - this.code = code; - } - - public String getState() { - return state; - } - - public void setState(String state) { - this.state = state; - } - - public String getIdToken() { - return id_token; - } - - public void setIdToken(String idToken) { - this.id_token = idToken; - } - - public String getAccessToken() { - return access_token; - } - - public void setAccessToken(String accessToken) { - this.access_token = accessToken; - } - - public void setRpId(String rpId) { - this.rp_id = rpId; - } - - @Override - public String getRpId() { - return rp_id; - } - - public String getNonce() { - return nonce; - } - - public void setNonce(String nonce) { - this.nonce = nonce; - } - - @Override - public String toString() { - return "ValidateParams{" + - "rp_id='" + rp_id + '\'' + - ", code='" + code + '\'' + - ", id_token='" + id_token + '\'' + - ", access_token='" + access_token + '\'' + - ", nonce='" + nonce + '\'' + - ", state='" + state + '\'' + - '}'; - } -} diff --git a/jans-client-api/common/src/main/java/io/jans/ca/common/proxy/ProxyConfiguration.java b/jans-client-api/common/src/main/java/io/jans/ca/common/proxy/ProxyConfiguration.java deleted file mode 100644 index 3371365652d..00000000000 --- a/jans-client-api/common/src/main/java/io/jans/ca/common/proxy/ProxyConfiguration.java +++ /dev/null @@ -1,45 +0,0 @@ -package io.jans.ca.common.proxy; - -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; - -@JsonIgnoreProperties( - ignoreUnknown = true -) -public class ProxyConfiguration { - private String host; - private Integer port; - private String protocol; - - public String getHost() { - return host; - } - - public void setHost(String host) { - this.host = host; - } - - public Integer getPort() { - return port; - } - - public void setPort(Integer port) { - this.port = port; - } - - public String getProtocol() { - return protocol; - } - - public void setProtocol(String protocol) { - this.protocol = protocol; - } - - @Override - public String toString() { - return "ProxyConfiguration{" + - "host='" + host + '\'' + - ", port=" + port + - ", protocol='" + protocol + '\'' + - '}'; - } -} diff --git a/jans-client-api/common/src/main/java/io/jans/ca/common/response/AuthorizationCodeFlowResponse.java b/jans-client-api/common/src/main/java/io/jans/ca/common/response/AuthorizationCodeFlowResponse.java deleted file mode 100644 index 246d05b532c..00000000000 --- a/jans-client-api/common/src/main/java/io/jans/ca/common/response/AuthorizationCodeFlowResponse.java +++ /dev/null @@ -1,93 +0,0 @@ -/** - * All rights reserved -- Copyright 2015 Gluu Inc. - */ -package io.jans.ca.common.response; - - -import com.fasterxml.jackson.annotation.JsonProperty; - -/** - * @author Yuriy Zabrovarnyy - * @version 0.9, 19/06/2015 - */ - -public class AuthorizationCodeFlowResponse implements IOpResponse { - - @JsonProperty(value = "access_token") - private String accessToken; - @JsonProperty(value = "expires_in_seconds") - private long expiresIn; - @JsonProperty(value = "refresh_token") - private String refreshToken; - @JsonProperty(value = "authorization_code") - private String authorizationCode; - @JsonProperty(value = "scope") - private String scope; - @JsonProperty(value = "id_token") - private String idToken; - - public AuthorizationCodeFlowResponse() { - } - - public String getIdToken() { - return idToken; - } - - public void setIdToken(String idToken) { - this.idToken = idToken; - } - - public String getAccessToken() { - return accessToken; - } - - public void setAccessToken(String p_patToken) { - accessToken = p_patToken; - } - - public long getExpiresIn() { - return expiresIn; - } - - public void setExpiresIn(long p_expiresIn) { - expiresIn = p_expiresIn; - } - - public String getRefreshToken() { - return refreshToken; - } - - public void setRefreshToken(String p_patRefreshToken) { - refreshToken = p_patRefreshToken; - } - - public String getAuthorizationCode() { - return authorizationCode; - } - - public void setAuthorizationCode(String p_authorizationCode) { - authorizationCode = p_authorizationCode; - } - - public String getScope() { - return scope; - } - - public void setScope(String p_scope) { - scope = p_scope; - } - - @Override - public String toString() { - final StringBuilder sb = new StringBuilder(); - sb.append("AuthorizationCodeFlowResponse"); - sb.append("{accessToken='").append(accessToken).append('\''); - sb.append(", expiresIn=").append(expiresIn); - sb.append(", refreshToken='").append(refreshToken).append('\''); - sb.append(", authorizationCode='").append(authorizationCode).append('\''); - sb.append(", scope='").append(scope).append('\''); - sb.append(", idToken='").append(idToken).append('\''); - sb.append('}'); - return sb.toString(); - } -} diff --git a/jans-client-api/common/src/main/java/io/jans/ca/common/response/CheckAccessTokenResponse.java b/jans-client-api/common/src/main/java/io/jans/ca/common/response/CheckAccessTokenResponse.java deleted file mode 100644 index 1fa12099d5e..00000000000 --- a/jans-client-api/common/src/main/java/io/jans/ca/common/response/CheckAccessTokenResponse.java +++ /dev/null @@ -1,66 +0,0 @@ -/** - * All rights reserved -- Copyright 2015 Gluu Inc. - */ -package io.jans.ca.common.response; - -import com.fasterxml.jackson.annotation.JsonProperty; - -import java.util.Date; - -/** - * @author Yuriy Zabrovarnyy - * @version 0.9, 23/10/2013 - */ - -public class CheckAccessTokenResponse implements IOpResponse { - - @JsonProperty(value = "active") - private boolean active; - @JsonProperty(value = "expires_at") - private Date expiresAt; - @JsonProperty(value = "issued_at") - private Date issuedAt; - - public CheckAccessTokenResponse() { - } - - public boolean isActive() { - return active; - } - - public void setActive(boolean p_active) { - active = p_active; - } - - public Date getExpiresAt() { - return expiresAt != null ? new Date(expiresAt.getTime()) : null; - } - - public void setExpiresAt(Date p_expiresAt) { - expiresAt = p_expiresAt != null ? new Date(p_expiresAt.getTime()) : null; - } - - public Date getIssuedAt() { - return issuedAt != null ? new Date(issuedAt.getTime()) : null; - } - - public void setIssuedAt(Date p_issuedAt) { - issuedAt = p_issuedAt != null ? new Date(p_issuedAt.getTime()) : null; - } - - /** - * Returns string representation of object - * - * @return string representation of object - */ - @Override - public String toString() { - final StringBuilder sb = new StringBuilder(); - sb.append("CheckAccessTokenResponse"); - sb.append("{active=").append(active); - sb.append(", expiresAt=").append(expiresAt); - sb.append(", issuedAt=").append(issuedAt); - sb.append('}'); - return sb.toString(); - } -} diff --git a/jans-client-api/common/src/main/java/io/jans/ca/common/response/CheckIdTokenResponse.java b/jans-client-api/common/src/main/java/io/jans/ca/common/response/CheckIdTokenResponse.java deleted file mode 100644 index ceb9172a6e1..00000000000 --- a/jans-client-api/common/src/main/java/io/jans/ca/common/response/CheckIdTokenResponse.java +++ /dev/null @@ -1,77 +0,0 @@ -/** - * All rights reserved -- Copyright 2015 Gluu Inc. - */ -package io.jans.ca.common.response; - -import com.fasterxml.jackson.annotation.JsonProperty; - -import java.util.List; -import java.util.Map; - -/** - * @author Yuriy Zabrovarnyy - * @version 0.9, 21/10/2013 - */ - -public class CheckIdTokenResponse implements IOpResponse { - - @JsonProperty(value = "active") - private boolean active; - @JsonProperty(value = "expires_at") - private long expiresAt; - @JsonProperty(value = "issued_at") - private long issuedAt; - @JsonProperty("claims") - private Map> claims; - - public CheckIdTokenResponse() { - } - - public Map> getClaims() { - return claims; - } - - public void setClaims(Map> p_claims) { - claims = p_claims; - } - - public boolean isActive() { - return active; - } - - public void setActive(boolean p_active) { - active = p_active; - } - - public long getExpiresAt() { - return expiresAt; - } - - public void setExpiresAt(long p_expiresAt) { - expiresAt = p_expiresAt; - } - - public long getIssuedAt() { - return issuedAt; - } - - public void setIssuedAt(long p_issuedAt) { - issuedAt = p_issuedAt; - } - - /** - * Returns string representation of object - * - * @return string representation of object - */ - @Override - public String toString() { - final StringBuilder sb = new StringBuilder(); - sb.append("CheckIdTokenResponse"); - sb.append("{active=").append(active); - sb.append(", expiresAt=").append(expiresAt); - sb.append(", issuedAt=").append(issuedAt); - sb.append('}'); - return sb.toString(); - } -} diff --git a/jans-client-api/common/src/main/java/io/jans/ca/common/response/GetAuthorizationCodeResponse.java b/jans-client-api/common/src/main/java/io/jans/ca/common/response/GetAuthorizationCodeResponse.java deleted file mode 100644 index 4959093fc3b..00000000000 --- a/jans-client-api/common/src/main/java/io/jans/ca/common/response/GetAuthorizationCodeResponse.java +++ /dev/null @@ -1,38 +0,0 @@ -package io.jans.ca.common.response; - -import com.fasterxml.jackson.annotation.JsonProperty; - -/** - * @author Yuriy Zabrovarnyy - * @version 0.9, 06/10/2015 - */ - -public class GetAuthorizationCodeResponse implements IOpResponse { - - @JsonProperty(value = "code") - private String code; - - public GetAuthorizationCodeResponse() { - } - - public GetAuthorizationCodeResponse(String code) { - this.code = code; - } - - public String getCode() { - return code; - } - - public void setCode(String code) { - this.code = code; - } - - @Override - public String toString() { - final StringBuilder sb = new StringBuilder(); - sb.append("GetAuthorizationCodeResponse"); - sb.append("{code='").append(code).append('\''); - sb.append('}'); - return sb.toString(); - } -} diff --git a/jans-client-api/common/src/main/java/io/jans/ca/common/response/GetAuthorizationUrlResponse.java b/jans-client-api/common/src/main/java/io/jans/ca/common/response/GetAuthorizationUrlResponse.java deleted file mode 100644 index 640732c0ac5..00000000000 --- a/jans-client-api/common/src/main/java/io/jans/ca/common/response/GetAuthorizationUrlResponse.java +++ /dev/null @@ -1,39 +0,0 @@ -package io.jans.ca.common.response; - - -import com.fasterxml.jackson.annotation.JsonProperty; - -/** - * @author Yuriy Zabrovarnyy - * @version 0.9, 01/10/2015 - */ - -public class GetAuthorizationUrlResponse implements IOpResponse { - - @JsonProperty(value = "authorization_url") - private String authorizationUrl; - - public GetAuthorizationUrlResponse() { - } - - public GetAuthorizationUrlResponse(String authorizationUrl) { - this.authorizationUrl = authorizationUrl; - } - - public String getAuthorizationUrl() { - return authorizationUrl; - } - - public void setAuthorizationUrl(String authorizationUrl) { - this.authorizationUrl = authorizationUrl; - } - - @Override - public String toString() { - final StringBuilder sb = new StringBuilder(); - sb.append("GetAuthorizationUrlResponse"); - sb.append("{authorizationUrl='").append(authorizationUrl).append('\''); - sb.append('}'); - return sb.toString(); - } -} diff --git a/jans-client-api/common/src/main/java/io/jans/ca/common/response/GetClientTokenResponse.java b/jans-client-api/common/src/main/java/io/jans/ca/common/response/GetClientTokenResponse.java deleted file mode 100644 index 3b5db013af3..00000000000 --- a/jans-client-api/common/src/main/java/io/jans/ca/common/response/GetClientTokenResponse.java +++ /dev/null @@ -1,64 +0,0 @@ -package io.jans.ca.common.response; - -import com.fasterxml.jackson.annotation.JsonProperty; - -import java.util.List; - -/** - * @author Yuriy Zabrovarnyy - * @version 0.9, 31/03/2017 - */ - -public class GetClientTokenResponse implements IOpResponse { - - @JsonProperty(value = "access_token") - private String accessToken; - @JsonProperty(value = "expires_in") - private int expiresIn; // expiration time in seconds - @JsonProperty(value = "refresh_token") - private String refreshToken; - @JsonProperty(value = "scope") - private List scope; - - public String getAccessToken() { - return accessToken; - } - - public void setAccessToken(String accessToken) { - this.accessToken = accessToken; - } - - public int getExpiresIn() { - return expiresIn; - } - - public void setExpiresIn(int expiresIn) { - this.expiresIn = expiresIn; - } - - public String getRefreshToken() { - return refreshToken; - } - - public void setRefreshToken(String refreshToken) { - this.refreshToken = refreshToken; - } - - public List getScope() { - return scope; - } - - public void setScope(List scope) { - this.scope = scope; - } - - @Override - public String toString() { - return "GetClientTokenResponse{" + - "accessToken='" + accessToken + '\'' + - ", expiresIn=" + expiresIn + - ", refreshToken=" + refreshToken + - ", scope=" + scope + - '}'; - } -} diff --git a/jans-client-api/common/src/main/java/io/jans/ca/common/response/GetDiscoveryResponse.java b/jans-client-api/common/src/main/java/io/jans/ca/common/response/GetDiscoveryResponse.java deleted file mode 100644 index 542cc2ba125..00000000000 --- a/jans-client-api/common/src/main/java/io/jans/ca/common/response/GetDiscoveryResponse.java +++ /dev/null @@ -1,520 +0,0 @@ -package io.jans.ca.common.response; - -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonProperty; - -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -/** - * @author yuriyz - */ -@JsonIgnoreProperties(ignoreUnknown = true) -public class GetDiscoveryResponse implements IOpResponse { - - @JsonProperty(value = "issuer") - private String issuer; - @JsonProperty(value = "authorization_endpoint") - private String authorization_endpoint; - @JsonProperty(value = "token_endpoint") - private String token_endpoint; - @JsonProperty(value = "token_revocation_endpoint") - private String token_revocation_endpoint; - @JsonProperty(value = "user_info_endpoint") - private String user_info_endpoint; - @JsonProperty(value = "client_info_endpoint") - private String client_info_endpoint; - @JsonProperty(value = "check_session_iframe") - private String check_session_iframe; - @JsonProperty(value = "end_session_endpoint") - private String end_session_endpoint; - @JsonProperty(value = "jwks_uri") - private String jwks_uri; - @JsonProperty(value = "registration_endpoint") - private String registration_endpoint; - @JsonProperty(value = "id_generation_endpoint") - private String id_generation_endpoint; - @JsonProperty(value = "introspection_endpoint") - private String introspection_endpoint; - @JsonProperty(value = "scopes_supported") - private List scopes_supported; - @JsonProperty(value = "response_types_supported") - private List response_types_supported; - @JsonProperty(value = "grant_types_supported") - private List grant_types_supported; - @JsonProperty(value = "acr_values_supported") - private List acr_values_supported; - @JsonProperty(value = "subject_types_supported") - private List subject_types_supported; - @JsonProperty(value = "user_info_signing_alg_values_supported") - private List user_info_signing_alg_values_supported; - @JsonProperty(value = "user_info_encryption_alg_values_supported") - private List user_info_encryption_alg_values_supported; - @JsonProperty(value = "user_info_encryption_enc_values_supported") - private List user_info_encryption_enc_values_supported; - @JsonProperty(value = "id_token_signing_alg_values_supported") - private List id_token_signing_alg_values_supported; - @JsonProperty(value = "id_token_encryption_alg_values_supported") - private List id_token_encryption_alg_values_supported; - @JsonProperty(value = "id_token_encryption_enc_values_supported") - private List id_token_encryption_enc_values_supported; - @JsonProperty(value = "request_object_signing_alg_values_supported") - private List request_object_signing_alg_values_supported; - @JsonProperty(value = "request_object_encryption_alg_values_supported") - private List request_object_encryption_alg_values_supported; - @JsonProperty(value = "request_object_encryption_enc_values_supported") - private List request_object_encryption_enc_values_supported; - @JsonProperty(value = "token_endpoint_auth_methods_supported") - private List token_endpoint_auth_methods_supported; - @JsonProperty(value = "token_endpoint_auth_signing_alg_values_supported") - private List token_endpoint_auth_signing_alg_values_supported; - @JsonProperty(value = "display_values_supported") - private List display_values_supported; - @JsonProperty(value = "claim_types_supported") - private List claim_types_supported; - @JsonProperty(value = "claims_supported") - private List claims_supported; - @JsonProperty(value = "id_token_token_binding_cnf_values_supported") - private List id_token_token_binding_cnf_values_supported; - @JsonProperty(value = "service_documentation") - private String service_documentation; - @JsonProperty(value = "claims_locales_supported") - private List claims_locales_supported; - @JsonProperty(value = "ui_locales_supported") - private List ui_locales_supported; - @JsonProperty(value = "claims_parameter_supported") - private Boolean claims_parameter_supported; - @JsonProperty(value = "request_parameter_supported") - private Boolean request_parameter_supported; - @JsonProperty(value = "request_uri_parameter_supported") - private Boolean request_uri_parameter_supported; - @JsonProperty(value = "require_request_uri_registration") - private Boolean require_request_uri_registration; - @JsonProperty(value = "tls_client_certificate_bound_access_tokens") - private Boolean tls_client_certificate_bound_access_tokens; - @JsonProperty(value = "front_channel_logout_supported") - private Boolean front_channel_logout_supported; - @JsonProperty(value = "front_channel_logout_session_supported") - private Boolean front_channel_logout_session_supported; - @JsonProperty(value = "op_policy_uri") - private String op_policy_uri; - @JsonProperty(value = "op_tos_uri") - private String op_tos_uri; - @JsonProperty(value = "scope_to_claims_mapping") - private Map> scope_to_claims_mapping = new HashMap>(); - - public GetDiscoveryResponse() { - } - - public String getIssuer() { - return issuer; - } - - public void setIssuer(String issuer) { - this.issuer = issuer; - } - - public String getAuthorizationEndpoint() { - return authorization_endpoint; - } - - public void setAuthorizationEndpoint(String authorizationEndpoint) { - this.authorization_endpoint = authorizationEndpoint; - } - - public String getTokenEndpoint() { - return token_endpoint; - } - - public void setTokenEndpoint(String tokenEndpoint) { - this.token_endpoint = tokenEndpoint; - } - - public String getTokenRevocationEndpoint() { - return token_revocation_endpoint; - } - - public void setTokenRevocationEndpoint(String tokenRevocationEndpoint) { - this.token_revocation_endpoint = tokenRevocationEndpoint; - } - - public String getUserInfoEndpoint() { - return user_info_endpoint; - } - - public void setUserInfoEndpoint(String userInfoEndpoint) { - this.user_info_endpoint = userInfoEndpoint; - } - - public String getClientInfoEndpoint() { - return client_info_endpoint; - } - - public void setClientInfoEndpoint(String clientInfoEndpoint) { - this.client_info_endpoint = clientInfoEndpoint; - } - - public String getCheckSessionIFrame() { - return check_session_iframe; - } - - public void setCheckSessionIFrame(String checkSessionIFrame) { - this.check_session_iframe = checkSessionIFrame; - } - - public String getEndSessionEndpoint() { - return end_session_endpoint; - } - - public void setEndSessionEndpoint(String endSessionEndpoint) { - this.end_session_endpoint = endSessionEndpoint; - } - - public String getJwksUri() { - return jwks_uri; - } - - public void setJwksUri(String jwksUri) { - this.jwks_uri = jwksUri; - } - - public String getRegistrationEndpoint() { - return registration_endpoint; - } - - public void setRegistrationEndpoint(String registrationEndpoint) { - this.registration_endpoint = registrationEndpoint; - } - - public String getIdGenerationEndpoint() { - return id_generation_endpoint; - } - - public void setIdGenerationEndpoint(String idGenerationEndpoint) { - this.id_generation_endpoint = idGenerationEndpoint; - } - - public String getIntrospectionEndpoint() { - return introspection_endpoint; - } - - public void setIntrospectionEndpoint(String introspectionEndpoint) { - this.introspection_endpoint = introspectionEndpoint; - } - - public List getScopesSupported() { - return scopes_supported; - } - - public void setScopesSupported(List scopesSupported) { - this.scopes_supported = scopesSupported; - } - - public List getResponseTypesSupported() { - return response_types_supported; - } - - public void setResponseTypesSupported(List responseTypesSupported) { - this.response_types_supported = responseTypesSupported; - } - - public List getGrantTypesSupported() { - return grant_types_supported; - } - - public void setGrantTypesSupported(List grantTypesSupported) { - this.grant_types_supported = grantTypesSupported; - } - - public List getAcrValuesSupported() { - return acr_values_supported; - } - - public void setAcrValuesSupported(List acrValuesSupported) { - this.acr_values_supported = acrValuesSupported; - } - - public List getSubjectTypesSupported() { - return subject_types_supported; - } - - public void setSubjectTypesSupported(List subjectTypesSupported) { - this.subject_types_supported = subjectTypesSupported; - } - - public List getUserInfoSigningAlgValuesSupported() { - return user_info_signing_alg_values_supported; - } - - public void setUserInfoSigningAlgValuesSupported(List userInfoSigningAlgValuesSupported) { - this.user_info_signing_alg_values_supported = userInfoSigningAlgValuesSupported; - } - - public List getUserInfoEncryptionAlgValuesSupported() { - return user_info_encryption_alg_values_supported; - } - - public void setUserInfoEncryptionAlgValuesSupported(List userInfoEncryptionAlgValuesSupported) { - this.user_info_encryption_alg_values_supported = userInfoEncryptionAlgValuesSupported; - } - - public List getUserInfoEncryptionEncValuesSupported() { - return user_info_encryption_enc_values_supported; - } - - public void setUserInfoEncryptionEncValuesSupported(List userInfoEncryptionEncValuesSupported) { - this.user_info_encryption_enc_values_supported = userInfoEncryptionEncValuesSupported; - } - - public List getIdTokenSigningAlgValuesSupported() { - return id_token_signing_alg_values_supported; - } - - public void setIdTokenSigningAlgValuesSupported(List idTokenSigningAlgValuesSupported) { - this.id_token_signing_alg_values_supported = idTokenSigningAlgValuesSupported; - } - - public List getIdTokenEncryptionAlgValuesSupported() { - return id_token_encryption_alg_values_supported; - } - - public void setIdTokenEncryptionAlgValuesSupported(List idTokenEncryptionAlgValuesSupported) { - this.id_token_encryption_alg_values_supported = idTokenEncryptionAlgValuesSupported; - } - - public List getIdTokenEncryptionEncValuesSupported() { - return id_token_encryption_enc_values_supported; - } - - public void setIdTokenEncryptionEncValuesSupported(List idTokenEncryptionEncValuesSupported) { - this.id_token_encryption_enc_values_supported = idTokenEncryptionEncValuesSupported; - } - - public List getRequestObjectSigningAlgValuesSupported() { - return request_object_signing_alg_values_supported; - } - - public void setRequestObjectSigningAlgValuesSupported(List requestObjectSigningAlgValuesSupported) { - this.request_object_signing_alg_values_supported = requestObjectSigningAlgValuesSupported; - } - - public List getRequestObjectEncryptionAlgValuesSupported() { - return request_object_encryption_alg_values_supported; - } - - public void setRequestObjectEncryptionAlgValuesSupported(List requestObjectEncryptionAlgValuesSupported) { - this.request_object_encryption_alg_values_supported = requestObjectEncryptionAlgValuesSupported; - } - - public List getRequestObjectEncryptionEncValuesSupported() { - return request_object_encryption_enc_values_supported; - } - - public void setRequestObjectEncryptionEncValuesSupported(List requestObjectEncryptionEncValuesSupported) { - this.request_object_encryption_enc_values_supported = requestObjectEncryptionEncValuesSupported; - } - - public List getTokenEndpointAuthMethodsSupported() { - return token_endpoint_auth_methods_supported; - } - - public void setTokenEndpointAuthMethodsSupported(List tokenEndpointAuthMethodsSupported) { - this.token_endpoint_auth_methods_supported = tokenEndpointAuthMethodsSupported; - } - - public List getTokenEndpointAuthSigningAlgValuesSupported() { - return token_endpoint_auth_signing_alg_values_supported; - } - - public void setTokenEndpointAuthSigningAlgValuesSupported(List tokenEndpointAuthSigningAlgValuesSupported) { - this.token_endpoint_auth_signing_alg_values_supported = tokenEndpointAuthSigningAlgValuesSupported; - } - - public List getDisplayValuesSupported() { - return display_values_supported; - } - - public void setDisplayValuesSupported(List displayValuesSupported) { - this.display_values_supported = displayValuesSupported; - } - - public List getClaimTypesSupported() { - return claim_types_supported; - } - - public void setClaimTypesSupported(List claimTypesSupported) { - this.claim_types_supported = claimTypesSupported; - } - - public List getClaimsSupported() { - return claims_supported; - } - - public void setClaimsSupported(List claimsSupported) { - this.claims_supported = claimsSupported; - } - - public List getIdTokenTokenBindingCnfValuesSupported() { - return id_token_token_binding_cnf_values_supported; - } - - public void setIdTokenTokenBindingCnfValuesSupported(List idTokenTokenBindingCnfValuesSupported) { - this.id_token_token_binding_cnf_values_supported = idTokenTokenBindingCnfValuesSupported; - } - - public String getServiceDocumentation() { - return service_documentation; - } - - public void setServiceDocumentation(String serviceDocumentation) { - this.service_documentation = serviceDocumentation; - } - - public List getClaimsLocalesSupported() { - return claims_locales_supported; - } - - public void setClaimsLocalesSupported(List claimsLocalesSupported) { - this.claims_locales_supported = claimsLocalesSupported; - } - - public List getUiLocalesSupported() { - return ui_locales_supported; - } - - public void setUiLocalesSupported(List uiLocalesSupported) { - this.ui_locales_supported = uiLocalesSupported; - } - - public Boolean getClaimsParameterSupported() { - return claims_parameter_supported; - } - - public void setClaimsParameterSupported(Boolean claimsParameterSupported) { - this.claims_parameter_supported = claimsParameterSupported; - } - - public Boolean getRequestParameterSupported() { - return request_parameter_supported; - } - - public void setRequestParameterSupported(Boolean requestParameterSupported) { - this.request_parameter_supported = requestParameterSupported; - } - - public Boolean getRequestUriParameterSupported() { - return request_uri_parameter_supported; - } - - public void setRequestUriParameterSupported(Boolean requestUriParameterSupported) { - this.request_uri_parameter_supported = requestUriParameterSupported; - } - - public Boolean getRequireRequestUriRegistration() { - return require_request_uri_registration; - } - - public void setRequireRequestUriRegistration(Boolean requireRequestUriRegistration) { - this.require_request_uri_registration = requireRequestUriRegistration; - } - - public Boolean getTlsClientCertificateBoundAccessTokens() { - return tls_client_certificate_bound_access_tokens; - } - - public void setTlsClientCertificateBoundAccessTokens(Boolean tlsClientCertificateBoundAccessTokens) { - this.tls_client_certificate_bound_access_tokens = tlsClientCertificateBoundAccessTokens; - } - - public Boolean getFrontChannelLogoutSupported() { - return front_channel_logout_supported; - } - - public void setFrontChannelLogoutSupported(Boolean frontChannelLogoutSupported) { - this.front_channel_logout_supported = frontChannelLogoutSupported; - } - - public Boolean getFrontChannelLogoutSessionSupported() { - return front_channel_logout_session_supported; - } - - public void setFrontChannelLogoutSessionSupported(Boolean frontChannelLogoutSessionSupported) { - this.front_channel_logout_session_supported = frontChannelLogoutSessionSupported; - } - - public String getOpPolicyUri() { - return op_policy_uri; - } - - public void setOpPolicyUri(String opPolicyUri) { - this.op_policy_uri = opPolicyUri; - } - - public String getOpTosUri() { - return op_tos_uri; - } - - public void setOpTosUri(String opTosUri) { - this.op_tos_uri = opTosUri; - } - - public Map> getScopeToClaimsMapping() { - return scope_to_claims_mapping; - } - - public void setScopeToClaimsMapping(Map> scopeToClaimsMapping) { - this.scope_to_claims_mapping = scopeToClaimsMapping; - } - - @Override - public String toString() { - return "GetDiscoveryResponse{" + - "issuer='" + issuer + '\'' + - ", authorization_endpoint='" + authorization_endpoint + '\'' + - ", token_endpoint='" + token_endpoint + '\'' + - ", token_revocation_endpoint='" + token_revocation_endpoint + '\'' + - ", user_info_endpoint='" + user_info_endpoint + '\'' + - ", client_info_endpoint='" + client_info_endpoint + '\'' + - ", check_session_iframe='" + check_session_iframe + '\'' + - ", end_session_endpoint='" + end_session_endpoint + '\'' + - ", jwks_uri='" + jwks_uri + '\'' + - ", registration_endpoint='" + registration_endpoint + '\'' + - ", id_generation_endpoint='" + id_generation_endpoint + '\'' + - ", introspection_endpoint='" + introspection_endpoint + '\'' + - ", scopes_supported=" + scopes_supported + - ", response_types_supported=" + response_types_supported + - ", grant_types_supported=" + grant_types_supported + - ", acr_values_supported=" + acr_values_supported + - ", subject_types_supported=" + subject_types_supported + - ", user_info_signing_alg_values_supported=" + user_info_signing_alg_values_supported + - ", user_info_encryption_alg_values_supported=" + user_info_encryption_alg_values_supported + - ", user_info_encryption_enc_values_supported=" + user_info_encryption_enc_values_supported + - ", id_token_signing_alg_values_supported=" + id_token_signing_alg_values_supported + - ", id_token_encryption_alg_values_supported=" + id_token_encryption_alg_values_supported + - ", id_token_encryption_enc_values_supported=" + id_token_encryption_enc_values_supported + - ", request_object_signing_alg_values_supported=" + request_object_signing_alg_values_supported + - ", request_object_encryption_alg_values_supported=" + request_object_encryption_alg_values_supported + - ", request_object_encryption_enc_values_supported=" + request_object_encryption_enc_values_supported + - ", token_endpoint_auth_methods_supported=" + token_endpoint_auth_methods_supported + - ", token_endpoint_auth_signing_alg_values_supported=" + token_endpoint_auth_signing_alg_values_supported + - ", display_values_supported=" + display_values_supported + - ", claim_types_supported=" + claim_types_supported + - ", claims_supported=" + claims_supported + - ", id_token_token_binding_cnf_values_supported=" + id_token_token_binding_cnf_values_supported + - ", service_documentation='" + service_documentation + '\'' + - ", claims_locales_supported=" + claims_locales_supported + - ", ui_locales_supported=" + ui_locales_supported + - ", claims_parameter_supported=" + claims_parameter_supported + - ", request_parameter_supported=" + request_parameter_supported + - ", request_uri_parameter_supported=" + request_uri_parameter_supported + - ", require_request_uri_registration=" + require_request_uri_registration + - ", tls_client_certificate_bound_access_tokens=" + tls_client_certificate_bound_access_tokens + - ", front_channel_logout_supported=" + front_channel_logout_supported + - ", front_channel_logout_session_supported=" + front_channel_logout_session_supported + - ", op_policy_uri='" + op_policy_uri + '\'' + - ", op_tos_uri='" + op_tos_uri + '\'' + - ", scope_to_claims_mapping=" + scope_to_claims_mapping + - '}'; - } -} diff --git a/jans-client-api/common/src/main/java/io/jans/ca/common/response/GetIssuerResponse.java b/jans-client-api/common/src/main/java/io/jans/ca/common/response/GetIssuerResponse.java deleted file mode 100644 index 5cbf3c874da..00000000000 --- a/jans-client-api/common/src/main/java/io/jans/ca/common/response/GetIssuerResponse.java +++ /dev/null @@ -1,43 +0,0 @@ -package io.jans.ca.common.response; - -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonProperty; -import io.jans.as.model.discovery.WebFingerLink; - -import java.util.List; - -@JsonIgnoreProperties(ignoreUnknown = true) -public class GetIssuerResponse implements IOpResponse { - - @JsonProperty(value = "subject") - private String subject; - @JsonProperty(value = "links") - private List links; - - public GetIssuerResponse() { - } - - public String getSubject() { - return subject; - } - - public void setSubject(String subject) { - this.subject = subject; - } - - public List getLinks() { - return links; - } - - public void setLinks(List links) { - this.links = links; - } - - @Override - public String toString() { - return "WebfingerResponse{" + - "subject='" + subject + '\'' + - ", links=" + links + - '}'; - } -} diff --git a/jans-client-api/common/src/main/java/io/jans/ca/common/response/GetJwksResponse.java b/jans-client-api/common/src/main/java/io/jans/ca/common/response/GetJwksResponse.java deleted file mode 100644 index fd9838f9eba..00000000000 --- a/jans-client-api/common/src/main/java/io/jans/ca/common/response/GetJwksResponse.java +++ /dev/null @@ -1,37 +0,0 @@ -/* - All rights reserved -- Copyright 2015 Gluu Inc. - */ -package io.jans.ca.common.response; - -import com.fasterxml.jackson.annotation.JsonProperty; -import io.jans.as.model.jwk.JSONWebKey; - -import java.util.List; - -/** - * JSON Web Key Set response class - * - * @author Shoeb - * @version 12/01/2018 - */ - - -public class GetJwksResponse implements IOpResponse { - - @JsonProperty(value = "keys" ) - private List keys; - - public GetJwksResponse() { - } - - public List getKeys() { - return keys; - } - - public void setKeys(List keys) { - this.keys = keys; - } - -} - - diff --git a/jans-client-api/common/src/main/java/io/jans/ca/common/response/GetLogoutUriResponse.java b/jans-client-api/common/src/main/java/io/jans/ca/common/response/GetLogoutUriResponse.java deleted file mode 100644 index a9c47f30449..00000000000 --- a/jans-client-api/common/src/main/java/io/jans/ca/common/response/GetLogoutUriResponse.java +++ /dev/null @@ -1,36 +0,0 @@ -package io.jans.ca.common.response; - -import com.fasterxml.jackson.annotation.JsonProperty; - -/** - * @author Yuriy Zabrovarnyy - * @version 0.9, 17/11/2015 - */ - -public class GetLogoutUriResponse implements IOpResponse { - - @JsonProperty(value = "uri") - private String uri; - - public GetLogoutUriResponse() { - } - - public GetLogoutUriResponse(String uri) { - this.uri = uri; - } - - public String getUri() { - return uri; - } - - public void setUri(String uri) { - this.uri = uri; - } - - @Override - public String toString() { - return "GetLogoutUriResponse" + - "{uri='" + uri + '\'' + - '}'; - } -} diff --git a/jans-client-api/common/src/main/java/io/jans/ca/common/response/GetRequestObjectUriResponse.java b/jans-client-api/common/src/main/java/io/jans/ca/common/response/GetRequestObjectUriResponse.java deleted file mode 100644 index f93e05a51a7..00000000000 --- a/jans-client-api/common/src/main/java/io/jans/ca/common/response/GetRequestObjectUriResponse.java +++ /dev/null @@ -1,17 +0,0 @@ -package io.jans.ca.common.response; - -import com.fasterxml.jackson.annotation.JsonProperty; - -public class GetRequestObjectUriResponse implements IOpResponse { - - @JsonProperty(value = "request_uri" ) - private String requestUri; - - public String getRequestUri() { - return requestUri; - } - - public void setRequestUri(String requestUri) { - this.requestUri = requestUri; - } -} diff --git a/jans-client-api/common/src/main/java/io/jans/ca/common/response/GetRpResponse.java b/jans-client-api/common/src/main/java/io/jans/ca/common/response/GetRpResponse.java deleted file mode 100644 index 96c281cc8c3..00000000000 --- a/jans-client-api/common/src/main/java/io/jans/ca/common/response/GetRpResponse.java +++ /dev/null @@ -1,36 +0,0 @@ -package io.jans.ca.common.response; - - -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.databind.JsonNode; - -/** - * @author yuriyz - */ -public class GetRpResponse implements IOpResponse { - - @JsonProperty(value = "node") - private JsonNode node; - - public GetRpResponse() { - } - - public GetRpResponse(JsonNode node) { - this.node = node; - } - - public JsonNode getNode() { - return node; - } - - public void setNode(JsonNode node) { - this.node = node; - } - - @Override - public String toString() { - return "GetRpResponse{" + - "node='" + node + '\'' + - '}'; - } -} diff --git a/jans-client-api/common/src/main/java/io/jans/ca/common/response/GetTokensByCodeResponse.java b/jans-client-api/common/src/main/java/io/jans/ca/common/response/GetTokensByCodeResponse.java deleted file mode 100644 index f555457d753..00000000000 --- a/jans-client-api/common/src/main/java/io/jans/ca/common/response/GetTokensByCodeResponse.java +++ /dev/null @@ -1,79 +0,0 @@ -package io.jans.ca.common.response; - - -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.databind.JsonNode; - -/** - * @author Yuriy Zabrovarnyy - * @version 0.9, 06/10/2015 - */ - -public class GetTokensByCodeResponse implements IOpResponse { - - @JsonProperty(value = "access_token") - private String accessToken; - @JsonProperty(value = "expires_in") - private int expiresIn; // expiration time in seconds - @JsonProperty(value = "id_token") - private String idToken; - @JsonProperty(value = "refresh_token") - private String refreshToken; - @JsonProperty("id_token_claims") - private JsonNode idTokenClaims; - - public GetTokensByCodeResponse() { - } - - public String getRefreshToken() { - return refreshToken; - } - - public void setRefreshToken(String refreshToken) { - this.refreshToken = refreshToken; - } - - public String getAccessToken() { - return accessToken; - } - - public void setAccessToken(String accessToken) { - this.accessToken = accessToken; - } - - public int getExpiresIn() { - return expiresIn; - } - - public void setExpiresIn(int expiresIn) { - this.expiresIn = expiresIn; - } - - public String getIdToken() { - return idToken; - } - - public void setIdToken(String idToken) { - this.idToken = idToken; - } - - public JsonNode getIdTokenClaims() { - return idTokenClaims; - } - - public void setIdTokenClaims(JsonNode idTokenClaims) { - this.idTokenClaims = idTokenClaims; - } - - @Override - public String toString() { - final StringBuilder sb = new StringBuilder(); - sb.append("GetTokensByCodeResponse"); - sb.append("{accessToken='").append(accessToken).append('\''); - sb.append(", expiresIn=").append(expiresIn); - sb.append(", idToken='").append(idToken).append('\''); - sb.append(", idTokenClaims=").append(idTokenClaims); - sb.append('}'); - return sb.toString(); - } -} diff --git a/jans-client-api/common/src/main/java/io/jans/ca/common/response/GetUserInfoResponse.java b/jans-client-api/common/src/main/java/io/jans/ca/common/response/GetUserInfoResponse.java deleted file mode 100644 index 5b64f9be29b..00000000000 --- a/jans-client-api/common/src/main/java/io/jans/ca/common/response/GetUserInfoResponse.java +++ /dev/null @@ -1,62 +0,0 @@ -package io.jans.ca.common.response; - -import com.fasterxml.jackson.annotation.JsonProperty; -import com.google.common.collect.Maps; - -import java.util.List; -import java.util.Map; - -/** - * @author Yuriy Zabrovarnyy - * @version 0.9, 12/10/2015 - */ - -public class GetUserInfoResponse implements IOpResponse { - - @JsonProperty("claims") - private Map> claims = Maps.newHashMap(); - @JsonProperty("refresh_token") - private String refreshToken; - @JsonProperty("access_token") - private String accessToken; - - public GetUserInfoResponse() { - } - - public GetUserInfoResponse(Map> claims) { - this.claims = claims; - } - - public Map> getClaims() { - return claims; - } - - public void setClaims(Map> claims) { - this.claims = claims; - } - - public String getRefreshToken() { - return refreshToken; - } - - public void setRefreshToken(String refreshToken) { - this.refreshToken = refreshToken; - } - - public String getAccessToken() { - return accessToken; - } - - public void setAccessToken(String accessToken) { - this.accessToken = accessToken; - } - - @Override - public String toString() { - return "GetUserInfoResponse{" + - "claims=" + claims + - ", refreshToken='" + refreshToken + '\'' + - ", accessToken='" + accessToken + '\'' + - '}'; - } -} diff --git a/jans-client-api/common/src/main/java/io/jans/ca/common/response/IOpResponse.java b/jans-client-api/common/src/main/java/io/jans/ca/common/response/IOpResponse.java deleted file mode 100644 index 441cb162806..00000000000 --- a/jans-client-api/common/src/main/java/io/jans/ca/common/response/IOpResponse.java +++ /dev/null @@ -1,12 +0,0 @@ -/** - * All rights reserved -- Copyright 2015 Gluu Inc. - */ -package io.jans.ca.common.response; - -/** - * @author Yuriy Zabrovarnyy - * @version 0.9, 13/08/2013 - */ - -public interface IOpResponse /*extends Serializable*/ { -} diff --git a/jans-client-api/common/src/main/java/io/jans/ca/common/response/ImplicitFlowResponse.java b/jans-client-api/common/src/main/java/io/jans/ca/common/response/ImplicitFlowResponse.java deleted file mode 100644 index eb4a245b427..00000000000 --- a/jans-client-api/common/src/main/java/io/jans/ca/common/response/ImplicitFlowResponse.java +++ /dev/null @@ -1,94 +0,0 @@ -/** - * All rights reserved -- Copyright 2015 Gluu Inc. - */ -package io.jans.ca.common.response; - - -import com.fasterxml.jackson.annotation.JsonProperty; - -/** - * @author Yuriy Zabrovarnyy - * @version 0.9, 23/06/2015 - */ - -public class ImplicitFlowResponse implements IOpResponse { - - @JsonProperty(value = "access_token") - private String accessToken; - @JsonProperty(value = "expires_in_seconds") - private long expiresIn; - @JsonProperty(value = "refresh_token") - private String refreshToken; - @JsonProperty(value = "authorization_code") - private String authorizationCode; - @JsonProperty(value = "scope") - private String scope; - @JsonProperty(value = "id_token") - private String idToken; - - - public ImplicitFlowResponse() { - } - - public String getIdToken() { - return idToken; - } - - public void setIdToken(String idToken) { - this.idToken = idToken; - } - - public String getAccessToken() { - return accessToken; - } - - public void setAccessToken(String p_patToken) { - accessToken = p_patToken; - } - - public long getExpiresIn() { - return expiresIn; - } - - public void setExpiresIn(long p_expiresIn) { - expiresIn = p_expiresIn; - } - - public String getRefreshToken() { - return refreshToken; - } - - public void setRefreshToken(String p_patRefreshToken) { - refreshToken = p_patRefreshToken; - } - - public String getAuthorizationCode() { - return authorizationCode; - } - - public void setAuthorizationCode(String p_authorizationCode) { - authorizationCode = p_authorizationCode; - } - - public String getScope() { - return scope; - } - - public void setScope(String p_scope) { - scope = p_scope; - } - - @Override - public String toString() { - final StringBuilder sb = new StringBuilder(); - sb.append("ImplicitFlowResponse"); - sb.append("{accessToken='").append(accessToken).append('\''); - sb.append(", expiresIn=").append(expiresIn); - sb.append(", refreshToken='").append(refreshToken).append('\''); - sb.append(", authorizationCode='").append(authorizationCode).append('\''); - sb.append(", scope='").append(scope).append('\''); - sb.append(", idToken='").append(idToken).append('\''); - sb.append('}'); - return sb.toString(); - } -} \ No newline at end of file diff --git a/jans-client-api/common/src/main/java/io/jans/ca/common/response/IntrospectAccessTokenResponse.java b/jans-client-api/common/src/main/java/io/jans/ca/common/response/IntrospectAccessTokenResponse.java deleted file mode 100644 index af1c0f7201a..00000000000 --- a/jans-client-api/common/src/main/java/io/jans/ca/common/response/IntrospectAccessTokenResponse.java +++ /dev/null @@ -1,162 +0,0 @@ -package io.jans.ca.common.response; - -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import org.jboss.resteasy.annotations.providers.jaxb.IgnoreMediaTypes; - -import java.util.ArrayList; -import java.util.Collection; -import java.util.List; - -/** - * @author Yuriy Zabrovarnyy - */ -@JsonPropertyOrder({"active", "scopes", "client_id", "username", "token_type", "exp", "iat", "sub", "aud", "iss", "jti", "acr_values"}) -@IgnoreMediaTypes({"application/*+json"}) -public class IntrospectAccessTokenResponse { - @JsonProperty("active") - private boolean active; - - @Deprecated - @JsonProperty("scopes") - private List scopes; - @JsonProperty("scope") - private List scope; - @JsonProperty("client_id") - private String clientId; - @JsonProperty("username") - private String username; - @JsonProperty("token_type") - private String tokenType; - @JsonProperty("exp") - private Integer expiresAt; - @JsonProperty("iat") - private Integer issuedAt; - @JsonProperty("sub") - private String subject; - @JsonProperty("aud") - private String audience; - @JsonProperty("iss") - private String issuer; - @JsonProperty("jti") - private String jti; - @JsonProperty("acr_values") - private String acrValues; - - public IntrospectAccessTokenResponse() { - } - - public IntrospectAccessTokenResponse(boolean p_active) { - this.active = p_active; - } - - public String getAcrValues() { - return this.acrValues; - } - - public void setAcrValues(String p_authMode) { - this.acrValues = p_authMode; - } - - public boolean isActive() { - return this.active; - } - - public void setActive(boolean p_active) { - this.active = p_active; - } - - @Deprecated - public List getScopes() { - return this.scopes; - } - - @Deprecated - public void setScopes(Collection scopes) { - this.scopes = scopes != null ? new ArrayList(scopes) : new ArrayList(); - } - - public List getScope() { - return this.scope; - } - - public void setScope(Collection scope) { - this.scope = scope != null ? new ArrayList(scope) : new ArrayList(); - } - - public Integer getExpiresAt() { - return this.expiresAt; - } - - public void setExpiresAt(Integer expiresAt) { - this.expiresAt = expiresAt; - } - - public Integer getIssuedAt() { - return this.issuedAt; - } - - public void setIssuedAt(Integer issuedAt) { - this.issuedAt = issuedAt; - } - - public String getClientId() { - return this.clientId; - } - - public void setClientId(String clientId) { - this.clientId = clientId; - } - - public String getUsername() { - return this.username; - } - - public void setUsername(String username) { - this.username = username; - } - - public String getTokenType() { - return this.tokenType; - } - - public void setTokenType(String tokenType) { - this.tokenType = tokenType; - } - - public String getSubject() { - return this.subject; - } - - public void setSub(String subject) { - this.subject = subject; - } - - public String getAudience() { - return this.audience; - } - - public void setAudience(String audience) { - this.audience = audience; - } - - public String getIssuer() { - return this.issuer; - } - - public void setIssuer(String issuer) { - this.issuer = issuer; - } - - public String getJti() { - return this.jti; - } - - public void setJti(String jti) { - this.jti = jti; - } - - public String toString() { - return "IntrospectAccessTokenResponse{active=" + this.active + ", scopes=" + this.scopes + ", scope=" + this.scope + ", clientId='" + this.clientId + '\'' + ", username='" + this.username + '\'' + ", tokenType='" + this.tokenType + '\'' + ", expiresAt=" + this.expiresAt + ", issuedAt=" + this.issuedAt + ", subject='" + this.subject + '\'' + ", audience='" + this.audience + '\'' + ", issuer='" + this.issuer + '\'' + ", jti='" + this.jti + '\'' + ", acrValues='" + this.acrValues + '\'' + '}'; - } -} diff --git a/jans-client-api/common/src/main/java/io/jans/ca/common/response/LicenseStatusOpResponse.java b/jans-client-api/common/src/main/java/io/jans/ca/common/response/LicenseStatusOpResponse.java deleted file mode 100644 index a0620cdb354..00000000000 --- a/jans-client-api/common/src/main/java/io/jans/ca/common/response/LicenseStatusOpResponse.java +++ /dev/null @@ -1,75 +0,0 @@ -/** - * All rights reserved -- Copyright 2015 Gluu Inc. - */ -package io.jans.ca.common.response; - -import com.fasterxml.jackson.annotation.JsonProperty; - -import java.util.List; - -/** - * @author Yuriy Zabrovarnyy - * @version 0.9, 23/11/2014 - */ - -public class LicenseStatusOpResponse implements IOpResponse { - - @JsonProperty(value = "valid") - private boolean valid = false; - @JsonProperty(value = "thread_count") - private int threadCount; - @JsonProperty(value = "name") - private String name; - @JsonProperty(value = "features") - private List features; - - public LicenseStatusOpResponse() { - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public List getFeatures() { - return features; - } - - public LicenseStatusOpResponse setFeatures(List features) { - this.features = features; - return this; - } - - public int getThreadCount() { - return threadCount; - } - - public LicenseStatusOpResponse setThreadCount(int threadCount) { - this.threadCount = threadCount; - return this; - } - - public boolean isValid() { - return valid; - } - - public LicenseStatusOpResponse setValid(boolean valid) { - this.valid = valid; - return this; - } - - @Override - public String toString() { - final StringBuilder sb = new StringBuilder(); - sb.append("LicenseStatusOpResponse"); - sb.append("{features=").append(features); - sb.append(", valid=").append(valid); - sb.append(", threadCount=").append(threadCount); - sb.append(", name='").append(name).append('\''); - sb.append('}'); - return sb.toString(); - } -} diff --git a/jans-client-api/common/src/main/java/io/jans/ca/common/response/POJOResponse.java b/jans-client-api/common/src/main/java/io/jans/ca/common/response/POJOResponse.java deleted file mode 100644 index abf1e56f87f..00000000000 --- a/jans-client-api/common/src/main/java/io/jans/ca/common/response/POJOResponse.java +++ /dev/null @@ -1,17 +0,0 @@ -package io.jans.ca.common.response; - -/** - * @author Yuriy Zabrovarnyy - */ -public class POJOResponse implements IOpResponse { - - private final Object node; - - public POJOResponse(Object node) { - this.node = node; - } - - public Object getNode() { - return node; - } -} diff --git a/jans-client-api/common/src/main/java/io/jans/ca/common/response/RegisterSiteResponse.java b/jans-client-api/common/src/main/java/io/jans/ca/common/response/RegisterSiteResponse.java deleted file mode 100644 index 9c477cffe78..00000000000 --- a/jans-client-api/common/src/main/java/io/jans/ca/common/response/RegisterSiteResponse.java +++ /dev/null @@ -1,121 +0,0 @@ -package io.jans.ca.common.response; - - -import com.fasterxml.jackson.annotation.JsonProperty; - -/** - * @author Yuriy Zabrovarnyy - * @version 0.9, 29/09/2015 - */ - -public class RegisterSiteResponse implements IOpResponse { - - @JsonProperty(value = "rp_id") - private String rpId; - @JsonProperty(value = "op_host") - private String opHost; - @JsonProperty(value = "client_id") - private String clientId; - @JsonProperty(value = "client_name") - private String clientName; - @JsonProperty(value = "client_secret") - private String clientSecret; - @JsonProperty(value = "client_registration_access_token") - private String clientRegistrationAccessToken; - @JsonProperty(value = "client_registration_client_uri") - private String clientRegistrationClientUri; - @JsonProperty(value = "client_id_issued_at") - private long clientIdIssuedAt; - @JsonProperty(value = "client_secret_expires_at") - private long clientSecretExpiresAt; - - public RegisterSiteResponse() { - } - - public String getRpId() { - return rpId; - } - - public void setRpId(String rpId) { - this.rpId = rpId; - } - - public String getOpHost() { - return opHost; - } - - public void setOpHost(String opHost) { - this.opHost = opHost; - } - - public String getClientId() { - return clientId; - } - - public void setClientId(String clientId) { - this.clientId = clientId; - } - - public String getClientName() { - return clientName; - } - - public void setClientName(String clientName) { - this.clientName = clientName; - } - - public String getClientSecret() { - return clientSecret; - } - - public void setClientSecret(String clientSecret) { - this.clientSecret = clientSecret; - } - - public String getClientRegistrationAccessToken() { - return clientRegistrationAccessToken; - } - - public void setClientRegistrationAccessToken(String clientRegistrationAccessToken) { - this.clientRegistrationAccessToken = clientRegistrationAccessToken; - } - - public String getClientRegistrationClientUri() { - return clientRegistrationClientUri; - } - - public void setClientRegistrationClientUri(String clientRegistrationClientUri) { - this.clientRegistrationClientUri = clientRegistrationClientUri; - } - - public long getClientIdIssuedAt() { - return clientIdIssuedAt; - } - - public void setClientIdIssuedAt(long clientIdIssuedAt) { - this.clientIdIssuedAt = clientIdIssuedAt; - } - - public long getClientSecretExpiresAt() { - return clientSecretExpiresAt; - } - - public void setClientSecretExpiresAt(long clientSecretExpiresAt) { - this.clientSecretExpiresAt = clientSecretExpiresAt; - } - - @Override - public String toString() { - return "RegisterSiteResponse{" + - "rpId='" + rpId + '\'' + - ", opHost='" + opHost + '\'' + - ", clientId='" + clientId + '\'' + - ", clientName='" + clientName + '\'' + - ", clientSecret='" + clientSecret + '\'' + - ", clientRegistrationAccessToken='" + clientRegistrationAccessToken + '\'' + - ", clientRegistrationClientUri='" + clientRegistrationClientUri + '\'' + - ", clientIdIssuedAt=" + clientIdIssuedAt + - ", clientSecretExpiresAt=" + clientSecretExpiresAt + - '}'; - } -} diff --git a/jans-client-api/common/src/main/java/io/jans/ca/common/response/RemoveSiteResponse.java b/jans-client-api/common/src/main/java/io/jans/ca/common/response/RemoveSiteResponse.java deleted file mode 100644 index 675affab649..00000000000 --- a/jans-client-api/common/src/main/java/io/jans/ca/common/response/RemoveSiteResponse.java +++ /dev/null @@ -1,28 +0,0 @@ -package io.jans.ca.common.response; - - -import com.fasterxml.jackson.annotation.JsonProperty; - -/** - * @author yuriyz - */ -public class RemoveSiteResponse implements IOpResponse { - - @JsonProperty(value = "rp_id") - private String rpId; - - public RemoveSiteResponse() { - } - - public RemoveSiteResponse(String rpId) { - this.rpId = rpId; - } - - public String getRpId() { - return rpId; - } - - public void setRpId(String rpId) { - this.rpId = rpId; - } -} diff --git a/jans-client-api/common/src/main/java/io/jans/ca/common/response/RpGetClaimsGatheringUrlResponse.java b/jans-client-api/common/src/main/java/io/jans/ca/common/response/RpGetClaimsGatheringUrlResponse.java deleted file mode 100644 index 201b3655081..00000000000 --- a/jans-client-api/common/src/main/java/io/jans/ca/common/response/RpGetClaimsGatheringUrlResponse.java +++ /dev/null @@ -1,44 +0,0 @@ -package io.jans.ca.common.response; - - -import com.fasterxml.jackson.annotation.JsonProperty; - -/** - * @author Yuriy Zabrovarnyy - * @version 0.9, 17/06/2016 - */ - -public class RpGetClaimsGatheringUrlResponse implements IOpResponse { - - @JsonProperty(value = "url") - private String url; - @JsonProperty(value = "state") - private String state; - - public RpGetClaimsGatheringUrlResponse() { - } - - public String getUrl() { - return url; - } - - public void setUrl(String url) { - this.url = url; - } - - public String getState() { - return state; - } - - public void setState(String state) { - this.state = state; - } - - @Override - public String toString() { - return "RpGetClaimsGatheringUrlResponse{" + - "url='" + url + '\'' + - "state='" + state + '\'' + - '}'; - } -} diff --git a/jans-client-api/common/src/main/java/io/jans/ca/common/response/RpGetRptResponse.java b/jans-client-api/common/src/main/java/io/jans/ca/common/response/RpGetRptResponse.java deleted file mode 100644 index 913c0baeec3..00000000000 --- a/jans-client-api/common/src/main/java/io/jans/ca/common/response/RpGetRptResponse.java +++ /dev/null @@ -1,81 +0,0 @@ -/** - * All rights reserved -- Copyright 2015 Gluu Inc. - */ -package io.jans.ca.common.response; - - -import com.fasterxml.jackson.annotation.JsonProperty; - -/** - * @author Yuriy Zabrovarnyy - * @version 0.9, 02/01/2014 - */ - -public class RpGetRptResponse implements IOpResponse { - - @JsonProperty(value = "access_token") - private String rpt; - @JsonProperty(value = "token_type") - private String tokenType; - @JsonProperty(value = "pct") - private String pct; - @JsonProperty(value = "updated") - private Boolean updated; - - @JsonProperty(value = "error") - private String error; - - public RpGetRptResponse() { - } - - public String getRpt() { - return rpt; - } - - public void setRpt(String p_rptToken) { - rpt = p_rptToken; - } - - public String getTokenType() { - return tokenType; - } - - public void setTokenType(String tokenType) { - this.tokenType = tokenType; - } - - public String getPct() { - return pct; - } - - public void setPct(String pct) { - this.pct = pct; - } - - public Boolean getUpdated() { - return updated; - } - - public void setUpdated(Boolean updated) { - this.updated = updated; - } - - public String getError() { - return error; - } - - public void setError(String error) { - this.error = error; - } - - @Override - public String toString() { - return "RpGetRptResponse{" + - "rpt='" + rpt + '\'' + - ", tokenType='" + tokenType + '\'' + - ", error='" + error + '\'' + - ", pct='" + pct + '\'' + - ", updated=" + updated + - '}'; - } -} diff --git a/jans-client-api/common/src/main/java/io/jans/ca/common/response/RsCheckAccessResponse.java b/jans-client-api/common/src/main/java/io/jans/ca/common/response/RsCheckAccessResponse.java deleted file mode 100644 index 07984992dd8..00000000000 --- a/jans-client-api/common/src/main/java/io/jans/ca/common/response/RsCheckAccessResponse.java +++ /dev/null @@ -1,82 +0,0 @@ -package io.jans.ca.common.response; - -import com.fasterxml.jackson.annotation.JsonProperty; - -/** - * @author Yuriy Zabrovarnyy - * @version 0.9, 10/06/2016 - */ - -public class RsCheckAccessResponse implements IOpResponse { - - @JsonProperty(value = "access") - private String access; - @JsonProperty(value = "www-authenticate_header") - private String wwwAuthenticateHeader; - @JsonProperty(value = "ticket") - private String ticket; - @JsonProperty(value = "error") - private String error; - @JsonProperty(value = "error_description") - private String errorDescription; - - public RsCheckAccessResponse() { - } - - public RsCheckAccessResponse(String access) { - this.access = access; - } - - public String getAccess() { - return access; - } - - public void setAccess(String access) { - this.access = access; - } - - public String getWwwAuthenticateHeader() { - return wwwAuthenticateHeader; - } - - public void setWwwAuthenticateHeader(String wwwAuthenticateHeader) { - this.wwwAuthenticateHeader = wwwAuthenticateHeader; - } - - public String getTicket() { - return ticket; - } - - public void setTicket(String ticket) { - this.ticket = ticket; - } - - public String getError() { - return error; - } - - public void setError(String error) { - this.error = error; - } - - public String getErrorDescription() { - return errorDescription; - } - - public void setErrorDescription(String errorDescription) { - this.errorDescription = errorDescription; - } - - @Override - public String toString() { - final StringBuilder sb = new StringBuilder(); - sb.append("RsCheckResponse"); - sb.append("{access='").append(access).append('\''); - sb.append(", wwwAuthenticateHeader='").append(wwwAuthenticateHeader).append('\''); - sb.append(", error='").append(error).append('\''); - sb.append(", errorDescription='").append(errorDescription).append('\''); - sb.append(", ticket='").append(ticket).append('\''); - sb.append('}'); - return sb.toString(); - } -} diff --git a/jans-client-api/common/src/main/java/io/jans/ca/common/response/RsModifyResponse.java b/jans-client-api/common/src/main/java/io/jans/ca/common/response/RsModifyResponse.java deleted file mode 100644 index cd3d364098b..00000000000 --- a/jans-client-api/common/src/main/java/io/jans/ca/common/response/RsModifyResponse.java +++ /dev/null @@ -1,23 +0,0 @@ -package io.jans.ca.common.response; - -import com.fasterxml.jackson.annotation.JsonProperty; - -public class RsModifyResponse implements IOpResponse { - @JsonProperty(value = "rp_id") - private String rpId; - - public RsModifyResponse() { - } - - public RsModifyResponse(String rpId) { - this.rpId = rpId; - } - - public String getRpId() { - return rpId; - } - - public void setRpId(String rpId) { - this.rpId = rpId; - } -} diff --git a/jans-client-api/common/src/main/java/io/jans/ca/common/response/RsProtectResponse.java b/jans-client-api/common/src/main/java/io/jans/ca/common/response/RsProtectResponse.java deleted file mode 100644 index 5893813f557..00000000000 --- a/jans-client-api/common/src/main/java/io/jans/ca/common/response/RsProtectResponse.java +++ /dev/null @@ -1,52 +0,0 @@ -package io.jans.ca.common.response; - - -import com.fasterxml.jackson.annotation.JsonProperty; - -/** - * @author Yuriy Zabrovarnyy - * @version 0.9, 31/05/2016 - */ - -public class RsProtectResponse implements IOpResponse { - - @JsonProperty(value = "rp_id") - private String rpId; - - @JsonProperty(value = "error") - private String error; - - @JsonProperty(value = "error_description") - private String errorDescription; - - public RsProtectResponse() { - } - - public RsProtectResponse(String rpId) { - this.rpId = rpId; - } - - public String getRpId() { - return rpId; - } - - public void setRpId(String rpId) { - this.rpId = rpId; - } - - public String getError() { - return error; - } - - public void setError(String error) { - this.error = error; - } - - public String getErrorDescription() { - return errorDescription; - } - - public void setErrorDescription(String errorDescription) { - this.errorDescription = errorDescription; - } -} diff --git a/jans-client-api/common/src/main/java/io/jans/ca/common/response/UpdateSiteResponse.java b/jans-client-api/common/src/main/java/io/jans/ca/common/response/UpdateSiteResponse.java deleted file mode 100644 index edb4e550a4b..00000000000 --- a/jans-client-api/common/src/main/java/io/jans/ca/common/response/UpdateSiteResponse.java +++ /dev/null @@ -1,26 +0,0 @@ -package io.jans.ca.common.response; - - -import com.fasterxml.jackson.annotation.JsonProperty; - -/** - * @author Yuriy Zabrovarnyy - * @version 0.9, 14/03/2016 - */ - -public class UpdateSiteResponse implements IOpResponse { - - @JsonProperty(value = "rp_id") - private String rpId; - - public UpdateSiteResponse() { - } - - public String getRpId() { - return rpId; - } - - public void setRpId(String rpId) { - this.rpId = rpId; - } -} diff --git a/jans-client-api/common/src/main/java/io/jans/ca/common/rest/ProtectedApi.java b/jans-client-api/common/src/main/java/io/jans/ca/common/rest/ProtectedApi.java deleted file mode 100644 index 5be4398b167..00000000000 --- a/jans-client-api/common/src/main/java/io/jans/ca/common/rest/ProtectedApi.java +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Janssen Project software is available under the MIT License (2008). See http://opensource.org/licenses/MIT for full text. - * - * Copyright (c) 2020, Janssen Project - */ - -package io.jans.ca.common.rest; - -import jakarta.ws.rs.NameBinding; - -import java.lang.annotation.ElementType; -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; -import java.lang.annotation.Target; - -@NameBinding -@Retention(RetentionPolicy.RUNTIME) -@Target({ ElementType.TYPE, ElementType.METHOD }) -public @interface ProtectedApi { - - String[] scopes() default {}; - -} diff --git a/jans-client-api/common/src/test/java/io/jans/ca/common/CoreUtilsTest.java b/jans-client-api/common/src/test/java/io/jans/ca/common/CoreUtilsTest.java deleted file mode 100644 index 8381b08b486..00000000000 --- a/jans-client-api/common/src/test/java/io/jans/ca/common/CoreUtilsTest.java +++ /dev/null @@ -1,15 +0,0 @@ -package io.jans.ca.common; - -import org.testng.Assert; -import org.testng.annotations.Test; - -/** - * @author Yuriy Zabrovarnyy - */ -public class CoreUtilsTest { - - @Test - public void cleanUpLogs() { - Assert.assertEquals("{'client_name':'name', 'rp_id':'test_id'}", CoreUtils.cleanUpLog("{'client_name':'name', 'client_secret':'secret', 'rp_id':'test_id'}")); - } -} diff --git a/jans-client-api/common/src/test/java/io/jans/ca/common/SeleniumTestUtils.java b/jans-client-api/common/src/test/java/io/jans/ca/common/SeleniumTestUtils.java deleted file mode 100644 index acd4d458d95..00000000000 --- a/jans-client-api/common/src/test/java/io/jans/ca/common/SeleniumTestUtils.java +++ /dev/null @@ -1,170 +0,0 @@ -package io.jans.ca.common; - -import io.jans.as.client.AuthorizationRequest; -import io.jans.as.client.AuthorizationResponse; -import io.jans.as.model.common.Holder; -import io.jans.as.model.common.ResponseType; -import io.jans.as.model.util.Util; -import org.apache.commons.collections.CollectionUtils; -import org.openqa.selenium.*; -import org.openqa.selenium.htmlunit.HtmlUnitDriver; -import org.openqa.selenium.interactions.Actions; -import org.openqa.selenium.support.ui.FluentWait; -import org.openqa.selenium.support.ui.Wait; -import org.openqa.selenium.support.ui.WebDriverWait; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.testng.collections.Lists; - -import java.io.UnsupportedEncodingException; -import java.net.URLDecoder; -import java.time.Duration; -import java.util.List; -import java.util.concurrent.TimeUnit; -import java.util.stream.Collectors; - -import static org.testng.Assert.fail; - -public class SeleniumTestUtils { - - private static int WAIT_OPERATION_TIMEOUT = 60; - private static final Logger LOG = LoggerFactory.getLogger(SeleniumTestUtils.class); - - public static AuthorizationResponse authorizeClient( - String opHost, String userId, String userSecret, String clientId, String redirectUrls, String state, String nonce, List responseTypes, List scopes) { - WebDriver currentDriver = initWebDriver(true, true); - - loginGluuServer(currentDriver, opHost, userId, userSecret, clientId, redirectUrls, state, nonce, responseTypes, scopes); - AuthorizationResponse authorizationResponse = acceptAuthorization(currentDriver); - - currentDriver.close(); - currentDriver.quit(); - return authorizationResponse; - } - - private static void loginGluuServer( - WebDriver driver, String opHost, String userId, String userSecret, String clientId, String redirectUrls, String state, String nonce, List responseTypes, List scopes) { - //navigate to opHost - String authorizationUrl = getAuthorizationUrl(opHost, clientId, redirectUrls, state, nonce, responseTypes, scopes); - - driver.navigate().to(authorizationUrl); - - LOG.info("Login page loaded. The current url is: " + authorizationUrl); - - WebElement loginButton = waitForRequredElementLoad(driver, "loginForm:loginButton"); - if (userId != null) { - setWebElementValue(driver, "loginForm:username", userId); - } - setWebElementValue(driver, "loginForm:password", userSecret); - - loginButton.click(); - waitForPageSwitch(driver, authorizationUrl); - - if (driver.getPageSource().contains("Failed to authenticate.")) { - fail("Failed to authenticate user"); - } - driver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS); - } - - private static void setWebElementValue(WebDriver currentDriver, String elemnetId, String value) { - WebElement webElement = currentDriver.findElement(By.id(elemnetId)); - webElement.sendKeys(value); - - int remainAttempts = 10; - do { - if (value.equals(webElement.getAttribute("value"))) { - break; - } - - ((JavascriptExecutor) currentDriver).executeScript("arguments[0].value='" + value + "';", webElement); - - try { - Thread.sleep(500); - } catch (InterruptedException e) { - e.printStackTrace(); - } - - remainAttempts--; - } while (remainAttempts >= 1); - } - - private static WebElement waitForRequredElementLoad(WebDriver currentDriver, String id) { - Wait wait = new FluentWait<>(currentDriver) - .withTimeout(Duration.ofSeconds(WAIT_OPERATION_TIMEOUT)) - .pollingEvery(Duration.ofMillis(1000)) - .ignoring(NoSuchElementException.class); - - WebElement loginButton = wait.until(d -> { - return d.findElement(By.id(id)); - }); - return loginButton; - } - - private static AuthorizationResponse acceptAuthorization(WebDriver driver) { - String authorizationResponseStr = driver.getCurrentUrl(); - AuthorizationResponse authorizationResponse = null; - // Check for authorization form if client has no persistent authorization - if (!authorizationResponseStr.contains("#")) { - WebElement allowButton = waitForRequredElementLoad(driver, "authorizeForm:allowButton"); - - // We have to use JavaScript because target is link with onclick - JavascriptExecutor jse = (JavascriptExecutor) driver; - jse.executeScript("scroll(0, 1000)"); - - Actions actions = new Actions(driver); - actions.click(allowButton).perform(); - - authorizationResponseStr = driver.getCurrentUrl(); - authorizationResponse = new AuthorizationResponse(authorizationResponseStr); - - LOG.info("Authorization Response url is: " + driver.getCurrentUrl()); - } else { - fail("The authorization form was expected to be shown."); - } - return authorizationResponse; - } - - private static WebDriver initWebDriver(boolean enableJavascript, boolean cleanupCookies) { - WebDriver webDriver = new HtmlUnitDriver(enableJavascript); - try { - if (cleanupCookies) { - webDriver.manage().deleteAllCookies(); - } - } catch (Exception e) { - e.printStackTrace(); - } - - return webDriver; - } - - private static String getAuthorizationUrl(String opHost, String clientId, String redirectUrls, String state, String nonce, List responseTypes, List scopes) { - try { - if(CollectionUtils.isEmpty(responseTypes)) { - responseTypes = Lists.newArrayList("code", "id_token", "token"); - } - - if(CollectionUtils.isEmpty(scopes)) { - scopes = Lists.newArrayList("openid", "profile", "jans_client_api", "uma_protection"); - } - List resTypes = responseTypes.stream().map(item -> ResponseType.fromString(item)).collect(Collectors.toList()); - AuthorizationRequest authorizationRequest = new AuthorizationRequest(resTypes, clientId, scopes, redirectUrls.split(" ")[0], nonce); - authorizationRequest.setResponseTypes(responseTypes.stream().map(item -> ResponseType.fromString(item)).collect(Collectors.toList())); - authorizationRequest.setState(state); - - return URLDecoder.decode(opHost + "/jans-auth/restv1/authorize?" +authorizationRequest.getQueryString(), Util.UTF8_STRING_ENCODING); - } catch (UnsupportedEncodingException ex) { - fail("Failed to decode the authorization URL."); - return null; - } - } - - private static String waitForPageSwitch(WebDriver currentDriver, String previousURL) { - Holder currentUrl = new Holder<>(); - WebDriverWait wait = new WebDriverWait(currentDriver, Duration.ofSeconds(WAIT_OPERATION_TIMEOUT)); - wait.until(d -> { - currentUrl.setT(d.getCurrentUrl()); - return !currentUrl.getT().equals(previousURL); - }); - return currentUrl.getT(); - } -} diff --git a/jans-client-api/common/src/test/java/io/jans/ca/common/params/ParamsSecurityTest.java b/jans-client-api/common/src/test/java/io/jans/ca/common/params/ParamsSecurityTest.java deleted file mode 100644 index d1e001fa04d..00000000000 --- a/jans-client-api/common/src/test/java/io/jans/ca/common/params/ParamsSecurityTest.java +++ /dev/null @@ -1,72 +0,0 @@ -package io.jans.ca.common.params; - -import org.apache.commons.lang.StringUtils; -import org.testng.SkipException; -import org.testng.annotations.Test; - -import java.io.File; -import java.io.IOException; -import java.net.URL; -import java.util.Arrays; -import java.util.HashSet; -import java.util.List; -import java.util.Set; - -import static org.testng.Assert.assertTrue; - -/** - * @author Yuriy Zabrovarnyy - */ -public class ParamsSecurityTest { - - private static final String PARAMS_PACKAGE = "io.jans.ca.common.params"; - private static final String CLASS_FILE_SUFFIX = ".class"; - private static final List EXCLUSING_LIST = Arrays.asList( - GetClientTokenParams.class, - GetRpParams.class, - RegisterSiteParams.class, - GetJwksParams.class, - EmptyParams.class, - HasRpIdParams.class, - GetDiscoveryParams.class, - GetIssuerParams.class, - GetRequestObjectUriParams.class, - StringParam.class, - IParams.class - ); - - @Test - public void checkParamsImplementsHasProtectionAccessTokenInterface() throws IOException { - for (Class clazz : getAllParamsClasses()) { - if (EXCLUSING_LIST.contains(clazz)) { - continue; - } - if (!HasRpIdParams.class.isAssignableFrom(clazz)) { - throw new AssertionError("Params class does not implement HasRpIdParams interface, class: " + clazz); - } - } - } - - private Set getAllParamsClasses() { - final URL packageResource = Thread.currentThread().getContextClassLoader().getResource(StringUtils.replace(PARAMS_PACKAGE, ".", "/")); - final File packageFile = new File(StringUtils.replace(packageResource.getFile(), "test-classes", "classes")); - if (!packageFile.exists()) { - throw new SkipException("Failed to find test-classes."); - } - assertTrue(packageFile.isDirectory()); - - final File[] classFiles = packageFile.listFiles(); - - Set classes = new HashSet<>(); - for (File file : classFiles) { - String resource = PARAMS_PACKAGE + "." + file.getName(); - int endIndex = resource.length() - CLASS_FILE_SUFFIX.length(); - String className = resource.substring(0, endIndex); - try { - classes.add(Class.forName(className)); - } catch (ClassNotFoundException ignore) { - } - } - return classes; - } -} diff --git a/jans-client-api/common/src/test/resources/testng.xml b/jans-client-api/common/src/test/resources/testng.xml deleted file mode 100644 index 557d3d1e52d..00000000000 --- a/jans-client-api/common/src/test/resources/testng.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - \ No newline at end of file diff --git a/jans-client-api/gen-client/README.md b/jans-client-api/gen-client/README.md deleted file mode 100644 index d4a9d486e88..00000000000 --- a/jans-client-api/gen-client/README.md +++ /dev/null @@ -1,604 +0,0 @@ -# swagger-java-client - -oxd-server -- API version: 4.2 - -oxd-server - - -*Automatically generated by the [Swagger Codegen](https://github.com/swagger-api/swagger-codegen)* - - -## Requirements - -Building the API client library requires: -1. Java 1.7+ -2. Maven/Gradle - -## Installation - -To install the API client library to your local Maven repository, simply execute: - -```shell -mvn clean install -``` - -To deploy it to a remote Maven repository instead, configure the settings of the repository and execute: - -```shell -mvn clean deploy -``` - -Refer to the [OSSRH Guide](http://central.sonatype.org/pages/ossrh-guide.html) for more information. - -### Maven users - -Add this dependency to your project's POM: - -```xml - - io.swagger - swagger-java-client - 1.0.1 - compile - -``` - -### Gradle users - -Add this dependency to your project's build file: - -```groovy -compile "io.swagger:swagger-java-client:1.0.0" -``` - -### Others - -At first generate the JAR by executing: - -```shell -mvn clean package -``` - -Then manually install the following JARs: - -* `target/swagger-java-client-1.0.0.jar` -* `target/lib/*.jar` - -## Getting Started - -Please follow the [installation](#installation) instruction and execute the following Java code: - -```java -import io.swagger.client.*; -import io.swagger.client.auth.*; -import io.swagger.client.model.*; -import io.swagger.client.api.DevelopersApi; - -import java.io.File; -import java.util.*; - -public class DevelopersApiExample { - - public static void main(String[] args) { - - DevelopersApi apiInstance = new DevelopersApi(); - GetAccessTokenByRefreshTokenParams body = new GetAccessTokenByRefreshTokenParams(); // GetAccessTokenByRefreshTokenParams | - String authorization = "authorization_example"; // String | - try { - GetAccessTokenByRefreshTokenResponse result = apiInstance.getAccessTokenByRefreshToken(body, authorization); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling DevelopersApi#getAccessTokenByRefreshToken"); - e.printStackTrace(); - } - } -} -import io.swagger.client.*; -import io.swagger.client.auth.*; -import io.swagger.client.model.*; -import io.swagger.client.api.DevelopersApi; - -import java.io.File; -import java.util.*; - -public class DevelopersApiExample { - - public static void main(String[] args) { - - DevelopersApi apiInstance = new DevelopersApi(); - GetAuthorizationUrlParams body = new GetAuthorizationUrlParams(); // GetAuthorizationUrlParams | - String authorization = "authorization_example"; // String | - try { - GetAuthorizationUrlResponse result = apiInstance.getAuthorizationUrl(body, authorization); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling DevelopersApi#getAuthorizationUrl"); - e.printStackTrace(); - } - } -} -import io.swagger.client.*; -import io.swagger.client.auth.*; -import io.swagger.client.model.*; -import io.swagger.client.api.DevelopersApi; - -import java.io.File; -import java.util.*; - -public class DevelopersApiExample { - - public static void main(String[] args) { - - DevelopersApi apiInstance = new DevelopersApi(); - GetClientTokenParams body = new GetClientTokenParams(); // GetClientTokenParams | - try { - GetClientTokenResponse result = apiInstance.getClientToken(body); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling DevelopersApi#getClientToken"); - e.printStackTrace(); - } - } -} -import io.swagger.client.*; -import io.swagger.client.auth.*; -import io.swagger.client.model.*; -import io.swagger.client.api.DevelopersApi; - -import java.io.File; -import java.util.*; - -public class DevelopersApiExample { - - public static void main(String[] args) { - - DevelopersApi apiInstance = new DevelopersApi(); - GetDiscoveryParams body = new GetDiscoveryParams(); // GetDiscoveryParams | - try { - GetDiscoveryResponse result = apiInstance.getDiscovery(body); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling DevelopersApi#getDiscovery"); - e.printStackTrace(); - } - } -} -import io.swagger.client.*; -import io.swagger.client.auth.*; -import io.swagger.client.model.*; -import io.swagger.client.api.DevelopersApi; - -import java.io.File; -import java.util.*; - -public class DevelopersApiExample { - - public static void main(String[] args) { - - DevelopersApi apiInstance = new DevelopersApi(); - GetJwksParams body = new GetJwksParams(); // GetJwksParams | - String authorization = "authorization_example"; // String | - try { - GetJwksResponse result = apiInstance.getJsonWebKeySet(body, authorization); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling DevelopersApi#getJsonWebKeySet"); - e.printStackTrace(); - } - } -} -import io.swagger.client.*; -import io.swagger.client.auth.*; -import io.swagger.client.model.*; -import io.swagger.client.api.DevelopersApi; - -import java.io.File; -import java.util.*; - -public class DevelopersApiExample { - - public static void main(String[] args) { - - DevelopersApi apiInstance = new DevelopersApi(); - GetLogoutUriParams body = new GetLogoutUriParams(); // GetLogoutUriParams | - String authorization = "authorization_example"; // String | - try { - GetLogoutUriResponse result = apiInstance.getLogoutUri(body, authorization); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling DevelopersApi#getLogoutUri"); - e.printStackTrace(); - } - } -} -import io.swagger.client.*; -import io.swagger.client.auth.*; -import io.swagger.client.model.*; -import io.swagger.client.api.DevelopersApi; - -import java.io.File; -import java.util.*; - -public class DevelopersApiExample { - - public static void main(String[] args) { - - DevelopersApi apiInstance = new DevelopersApi(); - GetTokensByCodeParams body = new GetTokensByCodeParams(); // GetTokensByCodeParams | - String authorization = "authorization_example"; // String | - try { - GetTokensByCodeResponse result = apiInstance.getTokensByCode(body, authorization); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling DevelopersApi#getTokensByCode"); - e.printStackTrace(); - } - } -} -import io.swagger.client.*; -import io.swagger.client.auth.*; -import io.swagger.client.model.*; -import io.swagger.client.api.DevelopersApi; - -import java.io.File; -import java.util.*; - -public class DevelopersApiExample { - - public static void main(String[] args) { - - DevelopersApi apiInstance = new DevelopersApi(); - GetUserInfoParams body = new GetUserInfoParams(); // GetUserInfoParams | - String authorization = "authorization_example"; // String | - try { - Map result = apiInstance.getUserInfo(body, authorization); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling DevelopersApi#getUserInfo"); - e.printStackTrace(); - } - } -} -import io.swagger.client.*; -import io.swagger.client.auth.*; -import io.swagger.client.model.*; -import io.swagger.client.api.DevelopersApi; - -import java.io.File; -import java.util.*; - -public class DevelopersApiExample { - - public static void main(String[] args) { - - DevelopersApi apiInstance = new DevelopersApi(); - try { - apiInstance.healthCheck(); - } catch (ApiException e) { - System.err.println("Exception when calling DevelopersApi#healthCheck"); - e.printStackTrace(); - } - } -} -import io.swagger.client.*; -import io.swagger.client.auth.*; -import io.swagger.client.model.*; -import io.swagger.client.api.DevelopersApi; - -import java.io.File; -import java.util.*; - -public class DevelopersApiExample { - - public static void main(String[] args) { - - DevelopersApi apiInstance = new DevelopersApi(); - IntrospectAccessTokenParams body = new IntrospectAccessTokenParams(); // IntrospectAccessTokenParams | - String authorization = "authorization_example"; // String | - try { - IntrospectAccessTokenResponse result = apiInstance.introspectAccessToken(body, authorization); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling DevelopersApi#introspectAccessToken"); - e.printStackTrace(); - } - } -} -import io.swagger.client.*; -import io.swagger.client.auth.*; -import io.swagger.client.model.*; -import io.swagger.client.api.DevelopersApi; - -import java.io.File; -import java.util.*; - -public class DevelopersApiExample { - - public static void main(String[] args) { - - DevelopersApi apiInstance = new DevelopersApi(); - IntrospectRptParams body = new IntrospectRptParams(); // IntrospectRptParams | - String authorization = "authorization_example"; // String | - try { - IntrospectRptResponse result = apiInstance.introspectRpt(body, authorization); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling DevelopersApi#introspectRpt"); - e.printStackTrace(); - } - } -} -import io.swagger.client.*; -import io.swagger.client.auth.*; -import io.swagger.client.model.*; -import io.swagger.client.api.DevelopersApi; - -import java.io.File; -import java.util.*; - -public class DevelopersApiExample { - - public static void main(String[] args) { - - DevelopersApi apiInstance = new DevelopersApi(); - RegisterSiteParams body = new RegisterSiteParams(); // RegisterSiteParams | - try { - RegisterSiteResponse result = apiInstance.registerSite(body); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling DevelopersApi#registerSite"); - e.printStackTrace(); - } - } -} -import io.swagger.client.*; -import io.swagger.client.auth.*; -import io.swagger.client.model.*; -import io.swagger.client.api.DevelopersApi; - -import java.io.File; -import java.util.*; - -public class DevelopersApiExample { - - public static void main(String[] args) { - - DevelopersApi apiInstance = new DevelopersApi(); - RemoveSiteParams body = new RemoveSiteParams(); // RemoveSiteParams | - String authorization = "authorization_example"; // String | - try { - RemoveSiteResponse result = apiInstance.removeSite(body, authorization); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling DevelopersApi#removeSite"); - e.printStackTrace(); - } - } -} -import io.swagger.client.*; -import io.swagger.client.auth.*; -import io.swagger.client.model.*; -import io.swagger.client.api.DevelopersApi; - -import java.io.File; -import java.util.*; - -public class DevelopersApiExample { - - public static void main(String[] args) { - - DevelopersApi apiInstance = new DevelopersApi(); - UmaRpGetClaimsGatheringUrlParams body = new UmaRpGetClaimsGatheringUrlParams(); // UmaRpGetClaimsGatheringUrlParams | - String authorization = "authorization_example"; // String | - try { - UmaRpGetClaimsGatheringUrlResponse result = apiInstance.umaRpGetClaimsGatheringUrl(body, authorization); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling DevelopersApi#umaRpGetClaimsGatheringUrl"); - e.printStackTrace(); - } - } -} -import io.swagger.client.*; -import io.swagger.client.auth.*; -import io.swagger.client.model.*; -import io.swagger.client.api.DevelopersApi; - -import java.io.File; -import java.util.*; - -public class DevelopersApiExample { - - public static void main(String[] args) { - - DevelopersApi apiInstance = new DevelopersApi(); - UmaRpGetRptParams body = new UmaRpGetRptParams(); // UmaRpGetRptParams | - String authorization = "authorization_example"; // String | - try { - UmaRpGetRptResponse result = apiInstance.umaRpGetRpt(body, authorization); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling DevelopersApi#umaRpGetRpt"); - e.printStackTrace(); - } - } -} -import io.swagger.client.*; -import io.swagger.client.auth.*; -import io.swagger.client.model.*; -import io.swagger.client.api.DevelopersApi; - -import java.io.File; -import java.util.*; - -public class DevelopersApiExample { - - public static void main(String[] args) { - - DevelopersApi apiInstance = new DevelopersApi(); - UmaRsCheckAccessParams body = new UmaRsCheckAccessParams(); // UmaRsCheckAccessParams | - String authorization = "authorization_example"; // String | - try { - UmaRsCheckAccessResponse result = apiInstance.umaRsCheckAccess(body, authorization); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling DevelopersApi#umaRsCheckAccess"); - e.printStackTrace(); - } - } -} -import io.swagger.client.*; -import io.swagger.client.auth.*; -import io.swagger.client.model.*; -import io.swagger.client.api.DevelopersApi; - -import java.io.File; -import java.util.*; - -public class DevelopersApiExample { - - public static void main(String[] args) { - - DevelopersApi apiInstance = new DevelopersApi(); - UmaRsModifyParams body = new UmaRsModifyParams(); // UmaRsModifyParams | - String authorization = "authorization_example"; // String | - try { - UmaRsModifyResponse result = apiInstance.umaRsModify(body, authorization); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling DevelopersApi#umaRsModify"); - e.printStackTrace(); - } - } -} -import io.swagger.client.*; -import io.swagger.client.auth.*; -import io.swagger.client.model.*; -import io.swagger.client.api.DevelopersApi; - -import java.io.File; -import java.util.*; - -public class DevelopersApiExample { - - public static void main(String[] args) { - - DevelopersApi apiInstance = new DevelopersApi(); - UmaRsProtectParams body = new UmaRsProtectParams(); // UmaRsProtectParams | - String authorization = "authorization_example"; // String | - try { - UmaRsProtectResponse result = apiInstance.umaRsProtect(body, authorization); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling DevelopersApi#umaRsProtect"); - e.printStackTrace(); - } - } -} -import io.swagger.client.*; -import io.swagger.client.auth.*; -import io.swagger.client.model.*; -import io.swagger.client.api.DevelopersApi; - -import java.io.File; -import java.util.*; - -public class DevelopersApiExample { - - public static void main(String[] args) { - - DevelopersApi apiInstance = new DevelopersApi(); - UpdateSiteParams body = new UpdateSiteParams(); // UpdateSiteParams | - String authorization = "authorization_example"; // String | - try { - UpdateSiteResponse result = apiInstance.updateSite(body, authorization); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling DevelopersApi#updateSite"); - e.printStackTrace(); - } - } -} -``` - -## Documentation for API Endpoints - -All URIs are relative to *https://gluu.org/* - -Class | Method | HTTP request | Description ------------- | ------------- | ------------- | ------------- -*DevelopersApi* | [**getAccessTokenByRefreshToken**](docs/DevelopersApi.md#getAccessTokenByRefreshToken) | **POST** /get-access-token-by-refresh-token | Get Access Token By Refresh Token -*DevelopersApi* | [**getAuthorizationUrl**](docs/DevelopersApi.md#getAuthorizationUrl) | **POST** /get-authorization-url | Get Authorization Url -*DevelopersApi* | [**getClientToken**](docs/DevelopersApi.md#getClientToken) | **POST** /get-client-token | Get Client Token -*DevelopersApi* | [**getDiscovery**](docs/DevelopersApi.md#getDiscovery) | **POST** /get-discovery | Get OP Discovery Configuration -*DevelopersApi* | [**getJsonWebKeySet**](docs/DevelopersApi.md#getJsonWebKeySet) | **POST** /get-jwks | Get JSON Web Key Set -*DevelopersApi* | [**getLogoutUri**](docs/DevelopersApi.md#getLogoutUri) | **POST** /get-logout-uri | Get Logout URL -*DevelopersApi* | [**getTokensByCode**](docs/DevelopersApi.md#getTokensByCode) | **POST** /get-tokens-by-code | Get Tokens By Code -*DevelopersApi* | [**getUserInfo**](docs/DevelopersApi.md#getUserInfo) | **POST** /get-user-info | Get User Info -*DevelopersApi* | [**healthCheck**](docs/DevelopersApi.md#healthCheck) | **GET** /health-check | Health Check -*DevelopersApi* | [**introspectAccessToken**](docs/DevelopersApi.md#introspectAccessToken) | **POST** /introspect-access-token | Introspect Access Token -*DevelopersApi* | [**introspectRpt**](docs/DevelopersApi.md#introspectRpt) | **POST** /introspect-rpt | Introspect RPT -*DevelopersApi* | [**registerSite**](docs/DevelopersApi.md#registerSite) | **POST** /register-site | Register Site -*DevelopersApi* | [**removeSite**](docs/DevelopersApi.md#removeSite) | **POST** /remove-site | Remove Site -*DevelopersApi* | [**umaRpGetClaimsGatheringUrl**](docs/DevelopersApi.md#umaRpGetClaimsGatheringUrl) | **POST** /uma-rp-get-claims-gathering-url | UMA RP Get Claims Gathering URL -*DevelopersApi* | [**umaRpGetRpt**](docs/DevelopersApi.md#umaRpGetRpt) | **POST** /uma-rp-get-rpt | UMA RP Get RPT -*DevelopersApi* | [**umaRsCheckAccess**](docs/DevelopersApi.md#umaRsCheckAccess) | **POST** /uma-rs-check-access | UMA RS Check Access -*DevelopersApi* | [**umaRsModify**](docs/DevelopersApi.md#umaRsModify) | **POST** /uma-rs-modify | UMA RS Modify Resources -*DevelopersApi* | [**umaRsProtect**](docs/DevelopersApi.md#umaRsProtect) | **POST** /uma-rs-protect | UMA RS Protect Resources -*DevelopersApi* | [**updateSite**](docs/DevelopersApi.md#updateSite) | **POST** /update-site | Update Site - -## Documentation for Models - - - [Condition](docs/Condition.md) - - [ErrorResponse](docs/ErrorResponse.md) - - [GetAccessTokenByRefreshTokenParams](docs/GetAccessTokenByRefreshTokenParams.md) - - [GetAccessTokenByRefreshTokenResponse](docs/GetAccessTokenByRefreshTokenResponse.md) - - [GetAuthorizationUrlParams](docs/GetAuthorizationUrlParams.md) - - [GetAuthorizationUrlResponse](docs/GetAuthorizationUrlResponse.md) - - [GetClientTokenParams](docs/GetClientTokenParams.md) - - [GetClientTokenResponse](docs/GetClientTokenResponse.md) - - [GetDiscoveryParams](docs/GetDiscoveryParams.md) - - [GetDiscoveryResponse](docs/GetDiscoveryResponse.md) - - [GetJwksParams](docs/GetJwksParams.md) - - [GetJwksResponse](docs/GetJwksResponse.md) - - [GetLogoutUriParams](docs/GetLogoutUriParams.md) - - [GetLogoutUriResponse](docs/GetLogoutUriResponse.md) - - [GetTokensByCodeParams](docs/GetTokensByCodeParams.md) - - [GetTokensByCodeResponse](docs/GetTokensByCodeResponse.md) - - [GetUserInfoParams](docs/GetUserInfoParams.md) - - [IntrospectAccessTokenParams](docs/IntrospectAccessTokenParams.md) - - [IntrospectAccessTokenResponse](docs/IntrospectAccessTokenResponse.md) - - [IntrospectRptParams](docs/IntrospectRptParams.md) - - [IntrospectRptResponse](docs/IntrospectRptResponse.md) - - [JsonWebKey](docs/JsonWebKey.md) - - [RegisterSiteParams](docs/RegisterSiteParams.md) - - [RegisterSiteResponse](docs/RegisterSiteResponse.md) - - [RemoveSiteParams](docs/RemoveSiteParams.md) - - [RemoveSiteResponse](docs/RemoveSiteResponse.md) - - [RsResource](docs/RsResource.md) - - [UmaRpGetClaimsGatheringUrlParams](docs/UmaRpGetClaimsGatheringUrlParams.md) - - [UmaRpGetClaimsGatheringUrlResponse](docs/UmaRpGetClaimsGatheringUrlResponse.md) - - [UmaRpGetRptParams](docs/UmaRpGetRptParams.md) - - [UmaRpGetRptResponse](docs/UmaRpGetRptResponse.md) - - [UmaRsCheckAccessParams](docs/UmaRsCheckAccessParams.md) - - [UmaRsCheckAccessResponse](docs/UmaRsCheckAccessResponse.md) - - [UmaRsModifyParams](docs/UmaRsModifyParams.md) - - [UmaRsModifyResponse](docs/UmaRsModifyResponse.md) - - [UmaRsProtectParams](docs/UmaRsProtectParams.md) - - [UmaRsProtectResponse](docs/UmaRsProtectResponse.md) - - [UpdateSiteParams](docs/UpdateSiteParams.md) - - [UpdateSiteResponse](docs/UpdateSiteResponse.md) - -## Documentation for Authorization - -All endpoints do not require authorization. -Authentication schemes defined for the API: - -## Recommendation - -It's recommended to create an instance of `ApiClient` per thread in a multithreaded environment to avoid any potential issues. - -## Author - -yuriyz@gluu.org diff --git a/jans-client-api/gen-client/pom.xml b/jans-client-api/gen-client/pom.xml deleted file mode 100644 index ed0a215b9c9..00000000000 --- a/jans-client-api/gen-client/pom.xml +++ /dev/null @@ -1,299 +0,0 @@ - - 4.0.0 - jans-client-api-gen - jar - jans-client-api-gen - 1.0.3-SNAPSHOT - https://github.com/swagger-api/swagger-codegen - Swagger Java - - - io.jans - jans-client-api-parent - 1.0.3-SNAPSHOT - - - - 1.8 - ${java.version} - ${java.version} - 1.8.0 - 2.7.5 - 2.8.9 - 2.0.0 - 1.3.5 - 1.0.0 - 4.13.1 - UTF-8 - true - - - - scm:git:git@github.com:swagger-api/swagger-codegen.git - scm:git:git@github.com:swagger-api/swagger-codegen.git - https://github.com/swagger-api/swagger-codegen - - - 2.2.0 - - - - - Unlicense - https://github.com/JanssenProject/jans-client-api/blob/master/LICENSE - repo - - - - - - Swagger - apiteam@swagger.io - Swagger - http://swagger.io - - - - - jans-client-api-gen - - profiles/${cfg}/test-data.properties - - - - - src/test/resources - true - - - - - - org.apache.maven.plugins - maven-surefire-plugin - 2.12 - - - - loggerPath - conf/log4j.properties - - - -Xms512m -Xmx1500m - methods - pertest - true - - - - maven-dependency-plugin - - - package - - copy-dependencies - - - ${project.build.directory}/lib - - - - - - - - - org.apache.maven.plugins - maven-jar-plugin - 2.2 - - - - jar - test-jar - - - - - - - - - org.codehaus.mojo - build-helper-maven-plugin - 1.10 - - - add_sources - generate-sources - - add-source - - - - src/main/java - - - - - add_test_sources - generate-test-sources - - add-test-source - - - - src/test/java - - - - - - - org.apache.maven.plugins - maven-javadoc-plugin - 2.10.4 - - - attach-javadocs - - jar - - - - - - org.apache.maven.plugins - maven-source-plugin - 2.2.1 - - - attach-sources - - jar-no-fork - - - - - - - - - - set-configuration-name - - - !cfg - - - - default - - - - - sign-artifacts - - - - org.apache.maven.plugins - maven-gpg-plugin - 1.5 - - - sign-artifacts - verify - - sign - - - - - - - - - - - - io.jans - jans-client-api-common - - - org.slf4j - slf4j-log4j12 - - - - - io.jans - jans-client-api-common - ${project.version} - - - org.slf4j - slf4j-log4j12 - - - test-jar - test - - - com.google.guava - guava - - - org.testng - testng - - - org.yaml - snakeyaml - - - - - io.swagger.core.v3 - swagger-annotations - ${swagger-core-version} - - - com.squareup.okhttp - okhttp - ${okhttp-version} - - - com.squareup.okhttp - logging-interceptor - ${okhttp-version} - - - com.google.code.gson - gson - ${gson-version} - - - io.gsonfire - gson-fire - ${gson-fire-version} - - - com.google.code.gson - gson - - - - - org.threeten - threetenbp - ${threetenbp-version} - - - - junit - junit - ${junit-version} - test - - - \ No newline at end of file diff --git a/jans-client-api/gen-client/profiles/default/test-data.properties b/jans-client-api/gen-client/profiles/default/test-data.properties deleted file mode 100644 index f02fabdd4b5..00000000000 --- a/jans-client-api/gen-client/profiles/default/test-data.properties +++ /dev/null @@ -1,11 +0,0 @@ -## Developer test ng properties (convenient way to run separate test without suite) ## -oxd.server.address=localhost:8099 -op.server.address=localhost:8085 -redirectUrl=https://client.example.com/cb -postLogoutRedirectUrl=https://client.example.com/cb/logout -logoutUrl=https://client.example.com/logout -auth.user.uid=test_user -auth.user.password=test_user_password -auth.client.id=@!06DC.B0AB.F1F4.245D!0001!72CC.B86C!0008!FF81!2D39 -auth.client.secret=Y3MhfiRpuB1x -rsProtect={"resources":[{"path":"/ws/phone","conditions":[{"httpMethods":["GET"],"scopes":["http://photoz.example.com/dev/actions/all","http://photoz.example.com/dev/actions/view"],"ticketScopes":["http://photoz.example.com/dev/actions/view"]},{"httpMethods":["PUT", "POST"],"scopes":["http://photoz.example.com/dev/actions/all","http://photoz.example.com/dev/actions/add"],"ticketScopes":["http://photoz.example.com/dev/actions/add"]},{"httpMethods":["DELETE"],"scopes":["http://photoz.example.com/dev/actions/all","http://photoz.example.com/dev/actions/remove"],"ticketScopes":["http://photoz.example.com/dev/actions/remove"]}]}]} \ No newline at end of file diff --git a/jans-client-api/gen-client/profiles/jenkins-build.jans.io/test-data.properties b/jans-client-api/gen-client/profiles/jenkins-build.jans.io/test-data.properties deleted file mode 100644 index f02fabdd4b5..00000000000 --- a/jans-client-api/gen-client/profiles/jenkins-build.jans.io/test-data.properties +++ /dev/null @@ -1,11 +0,0 @@ -## Developer test ng properties (convenient way to run separate test without suite) ## -oxd.server.address=localhost:8099 -op.server.address=localhost:8085 -redirectUrl=https://client.example.com/cb -postLogoutRedirectUrl=https://client.example.com/cb/logout -logoutUrl=https://client.example.com/logout -auth.user.uid=test_user -auth.user.password=test_user_password -auth.client.id=@!06DC.B0AB.F1F4.245D!0001!72CC.B86C!0008!FF81!2D39 -auth.client.secret=Y3MhfiRpuB1x -rsProtect={"resources":[{"path":"/ws/phone","conditions":[{"httpMethods":["GET"],"scopes":["http://photoz.example.com/dev/actions/all","http://photoz.example.com/dev/actions/view"],"ticketScopes":["http://photoz.example.com/dev/actions/view"]},{"httpMethods":["PUT", "POST"],"scopes":["http://photoz.example.com/dev/actions/all","http://photoz.example.com/dev/actions/add"],"ticketScopes":["http://photoz.example.com/dev/actions/add"]},{"httpMethods":["DELETE"],"scopes":["http://photoz.example.com/dev/actions/all","http://photoz.example.com/dev/actions/remove"],"ticketScopes":["http://photoz.example.com/dev/actions/remove"]}]}]} \ No newline at end of file diff --git a/jans-client-api/gen-client/profiles/jenkins-dev1.jans.io/test-data.properties b/jans-client-api/gen-client/profiles/jenkins-dev1.jans.io/test-data.properties deleted file mode 100644 index f02fabdd4b5..00000000000 --- a/jans-client-api/gen-client/profiles/jenkins-dev1.jans.io/test-data.properties +++ /dev/null @@ -1,11 +0,0 @@ -## Developer test ng properties (convenient way to run separate test without suite) ## -oxd.server.address=localhost:8099 -op.server.address=localhost:8085 -redirectUrl=https://client.example.com/cb -postLogoutRedirectUrl=https://client.example.com/cb/logout -logoutUrl=https://client.example.com/logout -auth.user.uid=test_user -auth.user.password=test_user_password -auth.client.id=@!06DC.B0AB.F1F4.245D!0001!72CC.B86C!0008!FF81!2D39 -auth.client.secret=Y3MhfiRpuB1x -rsProtect={"resources":[{"path":"/ws/phone","conditions":[{"httpMethods":["GET"],"scopes":["http://photoz.example.com/dev/actions/all","http://photoz.example.com/dev/actions/view"],"ticketScopes":["http://photoz.example.com/dev/actions/view"]},{"httpMethods":["PUT", "POST"],"scopes":["http://photoz.example.com/dev/actions/all","http://photoz.example.com/dev/actions/add"],"ticketScopes":["http://photoz.example.com/dev/actions/add"]},{"httpMethods":["DELETE"],"scopes":["http://photoz.example.com/dev/actions/all","http://photoz.example.com/dev/actions/remove"],"ticketScopes":["http://photoz.example.com/dev/actions/remove"]}]}]} \ No newline at end of file diff --git a/jans-client-api/gen-client/src/main/AndroidManifest.xml b/jans-client-api/gen-client/src/main/AndroidManifest.xml deleted file mode 100644 index 465dcb520c4..00000000000 --- a/jans-client-api/gen-client/src/main/AndroidManifest.xml +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/jans-client-api/gen-client/src/main/java/io/swagger/client/ApiCallback.java b/jans-client-api/gen-client/src/main/java/io/swagger/client/ApiCallback.java deleted file mode 100644 index d2ccc76e419..00000000000 --- a/jans-client-api/gen-client/src/main/java/io/swagger/client/ApiCallback.java +++ /dev/null @@ -1,61 +0,0 @@ -/* - * jans-api-server - * jans-api-server - * - * OpenAPI spec version: 4.2 - * Contact: yuriyz@gluu.org - * - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen.git - * Do not edit the class manually. - */ - -package io.swagger.client; - -import java.io.IOException; - -import java.util.Map; -import java.util.List; - -/** - * Callback for asynchronous API call. - * - * @param The return type - */ -public interface ApiCallback { - /** - * This is called when the API call fails. - * - * @param e The exception causing the failure - * @param statusCode Status code of the response if available, otherwise it would be 0 - * @param responseHeaders Headers of the response if available, otherwise it would be null - */ - void onFailure(ApiException e, int statusCode, Map> responseHeaders); - - /** - * This is called when the API call succeeded. - * - * @param result The result deserialized from response - * @param statusCode Status code of the response - * @param responseHeaders Headers of the response - */ - void onSuccess(T result, int statusCode, Map> responseHeaders); - - /** - * This is called when the API upload processing. - * - * @param bytesWritten bytes Written - * @param contentLength content length of request body - * @param done write end - */ - void onUploadProgress(long bytesWritten, long contentLength, boolean done); - - /** - * This is called when the API downlond processing. - * - * @param bytesRead bytes Read - * @param contentLength content lenngth of the response - * @param done Read end - */ - void onDownloadProgress(long bytesRead, long contentLength, boolean done); -} diff --git a/jans-client-api/gen-client/src/main/java/io/swagger/client/ApiClient.java b/jans-client-api/gen-client/src/main/java/io/swagger/client/ApiClient.java deleted file mode 100644 index 8c0430fc512..00000000000 --- a/jans-client-api/gen-client/src/main/java/io/swagger/client/ApiClient.java +++ /dev/null @@ -1,1203 +0,0 @@ -/* - * jans-api-server - * jans-api-server - * - * OpenAPI spec version: 4.2 - * Contact: yuriyz@gluu.org - * - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen.git - * Do not edit the class manually. - */ - -package io.swagger.client; - -import com.squareup.okhttp.*; -import com.squareup.okhttp.internal.http.HttpMethod; -import com.squareup.okhttp.logging.HttpLoggingInterceptor; -import com.squareup.okhttp.logging.HttpLoggingInterceptor.Level; -import okio.BufferedSink; -import okio.Okio; -import org.threeten.bp.LocalDate; -import org.threeten.bp.OffsetDateTime; -import org.threeten.bp.format.DateTimeFormatter; - -import javax.net.ssl.*; -import java.io.File; -import java.io.IOException; -import java.io.InputStream; -import java.io.UnsupportedEncodingException; -import java.lang.reflect.Type; -import java.net.URLConnection; -import java.net.URLEncoder; -import java.security.GeneralSecurityException; -import java.security.KeyStore; -import java.security.SecureRandom; -import java.security.cert.Certificate; -import java.security.cert.CertificateException; -import java.security.cert.CertificateFactory; -import java.security.cert.X509Certificate; -import java.text.DateFormat; -import java.util.*; -import java.util.Map.Entry; -import java.util.concurrent.TimeUnit; -import java.util.regex.Matcher; -import java.util.regex.Pattern; - -import io.swagger.client.auth.Authentication; -import io.swagger.client.auth.HttpBasicAuth; -import io.swagger.client.auth.ApiKeyAuth; -import io.swagger.client.auth.OAuth; - -public class ApiClient { - - private String basePath = "https://gluu.org/"; - private boolean debugging = false; - private Map defaultHeaderMap = new HashMap(); - private String tempFolderPath = null; - - private Map authentications; - - private DateFormat dateFormat; - private DateFormat datetimeFormat; - private boolean lenientDatetimeFormat; - private int dateLength; - - private InputStream sslCaCert; - private boolean verifyingSsl; - private KeyManager[] keyManagers; - - private OkHttpClient httpClient; - private JSON json; - - private HttpLoggingInterceptor loggingInterceptor; - - /* - * Constructor for ApiClient - */ - public ApiClient() { - httpClient = new OkHttpClient(); - - - verifyingSsl = true; - - json = new JSON(); - - // Set default User-Agent. - setUserAgent("Swagger-Codegen/1.0.0/java"); - - // Setup authentications (key: authentication name, value: authentication). - authentications = new HashMap(); - // Prevent the authentications from being modified. - authentications = Collections.unmodifiableMap(authentications); - } - - /** - * Get base path - * - * @return Baes path - */ - public String getBasePath() { - return basePath; - } - - /** - * Set base path - * - * @param basePath Base path of the URL (e.g https://gluu.org/ - * @return An instance of OkHttpClient - */ - public ApiClient setBasePath(String basePath) { - this.basePath = basePath; - return this; - } - - /** - * Get HTTP client - * - * @return An instance of OkHttpClient - */ - public OkHttpClient getHttpClient() { - return httpClient; - } - - /** - * Set HTTP client - * - * @param httpClient An instance of OkHttpClient - * @return Api Client - */ - public ApiClient setHttpClient(OkHttpClient httpClient) { - this.httpClient = httpClient; - return this; - } - - /** - * Get JSON - * - * @return JSON object - */ - public JSON getJSON() { - return json; - } - - /** - * Set JSON - * - * @param json JSON object - * @return Api client - */ - public ApiClient setJSON(JSON json) { - this.json = json; - return this; - } - - /** - * True if isVerifyingSsl flag is on - * - * @return True if isVerifySsl flag is on - */ - public boolean isVerifyingSsl() { - return verifyingSsl; - } - - /** - * Configure whether to verify certificate and hostname when making https requests. - * Default to true. - * NOTE: Do NOT set to false in production code, otherwise you would face multiple types of cryptographic attacks. - * - * @param verifyingSsl True to verify TLS/SSL connection - * @return ApiClient - */ - public ApiClient setVerifyingSsl(boolean verifyingSsl) { - this.verifyingSsl = verifyingSsl; - applySslSettings(); - return this; - } - - /** - * Get SSL CA cert. - * - * @return Input stream to the SSL CA cert - */ - public InputStream getSslCaCert() { - return sslCaCert; - } - - /** - * Configure the CA certificate to be trusted when making https requests. - * Use null to reset to default. - * - * @param sslCaCert input stream for SSL CA cert - * @return ApiClient - */ - public ApiClient setSslCaCert(InputStream sslCaCert) { - this.sslCaCert = sslCaCert; - applySslSettings(); - return this; - } - - public KeyManager[] getKeyManagers() { - return keyManagers; - } - - /** - * Configure client keys to use for authorization in an SSL session. - * Use null to reset to default. - * - * @param managers The KeyManagers to use - * @return ApiClient - */ - public ApiClient setKeyManagers(KeyManager[] managers) { - this.keyManagers = managers; - applySslSettings(); - return this; - } - - public DateFormat getDateFormat() { - return dateFormat; - } - - public ApiClient setDateFormat(DateFormat dateFormat) { - this.json.setDateFormat(dateFormat); - return this; - } - - public ApiClient setSqlDateFormat(DateFormat dateFormat) { - this.json.setSqlDateFormat(dateFormat); - return this; - } - - public ApiClient setOffsetDateTimeFormat(DateTimeFormatter dateFormat) { - this.json.setOffsetDateTimeFormat(dateFormat); - return this; - } - - public ApiClient setLocalDateFormat(DateTimeFormatter dateFormat) { - this.json.setLocalDateFormat(dateFormat); - return this; - } - - public ApiClient setLenientOnJson(boolean lenientOnJson) { - this.json.setLenientOnJson(lenientOnJson); - return this; - } - - /** - * Get authentications (key: authentication name, value: authentication). - * - * @return Map of authentication objects - */ - public Map getAuthentications() { - return authentications; - } - - /** - * Get authentication for the given name. - * - * @param authName The authentication name - * @return The authentication, null if not found - */ - public Authentication getAuthentication(String authName) { - return authentications.get(authName); - } - - /** - * Helper method to set username for the first HTTP basic authentication. - * - * @param username Username - */ - public void setUsername(String username) { - for (Authentication auth : authentications.values()) { - if (auth instanceof HttpBasicAuth) { - ((HttpBasicAuth) auth).setUsername(username); - return; - } - } - throw new RuntimeException("No HTTP basic authentication configured!"); - } - - /** - * Helper method to set password for the first HTTP basic authentication. - * - * @param password Password - */ - public void setPassword(String password) { - for (Authentication auth : authentications.values()) { - if (auth instanceof HttpBasicAuth) { - ((HttpBasicAuth) auth).setPassword(password); - return; - } - } - throw new RuntimeException("No HTTP basic authentication configured!"); - } - - /** - * Helper method to set API key value for the first API key authentication. - * - * @param apiKey API key - */ - public void setApiKey(String apiKey) { - for (Authentication auth : authentications.values()) { - if (auth instanceof ApiKeyAuth) { - ((ApiKeyAuth) auth).setApiKey(apiKey); - return; - } - } - throw new RuntimeException("No API key authentication configured!"); - } - - /** - * Helper method to set API key prefix for the first API key authentication. - * - * @param apiKeyPrefix API key prefix - */ - public void setApiKeyPrefix(String apiKeyPrefix) { - for (Authentication auth : authentications.values()) { - if (auth instanceof ApiKeyAuth) { - ((ApiKeyAuth) auth).setApiKeyPrefix(apiKeyPrefix); - return; - } - } - throw new RuntimeException("No API key authentication configured!"); - } - - /** - * Helper method to set access token for the first OAuth2 authentication. - * - * @param accessToken Access token - */ - public void setAccessToken(String accessToken) { - for (Authentication auth : authentications.values()) { - if (auth instanceof OAuth) { - ((OAuth) auth).setAccessToken(accessToken); - return; - } - } - throw new RuntimeException("No OAuth2 authentication configured!"); - } - - /** - * Set the User-Agent header's value (by adding to the default header map). - * - * @param userAgent HTTP request's user agent - * @return ApiClient - */ - public ApiClient setUserAgent(String userAgent) { - addDefaultHeader("User-Agent", userAgent); - return this; - } - - /** - * Add a default header. - * - * @param key The header's key - * @param value The header's value - * @return ApiClient - */ - public ApiClient addDefaultHeader(String key, String value) { - defaultHeaderMap.put(key, value); - return this; - } - - /** - * Check that whether debugging is enabled for this API client. - * - * @return True if debugging is enabled, false otherwise. - */ - public boolean isDebugging() { - return debugging; - } - - /** - * Enable/disable debugging for this API client. - * - * @param debugging To enable (true) or disable (false) debugging - * @return ApiClient - */ - public ApiClient setDebugging(boolean debugging) { - if (debugging != this.debugging) { - if (debugging) { - loggingInterceptor = new HttpLoggingInterceptor(); - loggingInterceptor.setLevel(Level.BODY); - httpClient.interceptors().add(loggingInterceptor); - } else { - httpClient.interceptors().remove(loggingInterceptor); - loggingInterceptor = null; - } - } - this.debugging = debugging; - return this; - } - - /** - * The path of temporary folder used to store downloaded files from endpoints - * with file response. The default value is null, i.e. using - * the system's default tempopary folder. - * - * @see createTempFile - * @return Temporary folder path - */ - public String getTempFolderPath() { - return tempFolderPath; - } - - /** - * Set the temporary folder path (for downloading files) - * - * @param tempFolderPath Temporary folder path - * @return ApiClient - */ - public ApiClient setTempFolderPath(String tempFolderPath) { - this.tempFolderPath = tempFolderPath; - return this; - } - - /** - * Get connection timeout (in milliseconds). - * - * @return Timeout in milliseconds - */ - public int getConnectTimeout() { - return httpClient.getConnectTimeout(); - } - - /** - * Sets the connect timeout (in milliseconds). - * A value of 0 means no timeout, otherwise values must be between 1 and - * - * @param connectionTimeout connection timeout in milliseconds - * @return Api client - */ - public ApiClient setConnectTimeout(int connectionTimeout) { - httpClient.setConnectTimeout(connectionTimeout, TimeUnit.MILLISECONDS); - return this; - } - - /** - * Get read timeout (in milliseconds). - * - * @return Timeout in milliseconds - */ - public int getReadTimeout() { - return httpClient.getReadTimeout(); - } - - /** - * Sets the read timeout (in milliseconds). - * A value of 0 means no timeout, otherwise values must be between 1 and - * {@link Integer#MAX_VALUE}. - * - * @param readTimeout read timeout in milliseconds - * @return Api client - */ - public ApiClient setReadTimeout(int readTimeout) { - httpClient.setReadTimeout(readTimeout, TimeUnit.MILLISECONDS); - return this; - } - - /** - * Get write timeout (in milliseconds). - * - * @return Timeout in milliseconds - */ - public int getWriteTimeout() { - return httpClient.getWriteTimeout(); - } - - /** - * Sets the write timeout (in milliseconds). - * A value of 0 means no timeout, otherwise values must be between 1 and - * {@link Integer#MAX_VALUE}. - * - * @param writeTimeout connection timeout in milliseconds - * @return Api client - */ - public ApiClient setWriteTimeout(int writeTimeout) { - httpClient.setWriteTimeout(writeTimeout, TimeUnit.MILLISECONDS); - return this; - } - - /** - * Format the given parameter object into string. - * - * @param param Parameter - * @return String representation of the parameter - */ - public String parameterToString(Object param) { - if (param == null) { - return ""; - } else if (param instanceof Date || param instanceof OffsetDateTime || param instanceof LocalDate) { - //Serialize to json string and remove the " enclosing characters - String jsonStr = json.serialize(param); - return jsonStr.substring(1, jsonStr.length() - 1); - } else if (param instanceof Collection) { - StringBuilder b = new StringBuilder(); - for (Object o : (Collection)param) { - if (b.length() > 0) { - b.append(","); - } - b.append(String.valueOf(o)); - } - return b.toString(); - } else { - return String.valueOf(param); - } - } - - /** - * Formats the specified query parameter to a list containing a single {@code Pair} object. - * - * Note that {@code value} must not be a collection. - * - * @param name The name of the parameter. - * @param value The value of the parameter. - * @return A list containing a single {@code Pair} object. - */ - public List parameterToPair(String name, Object value) { - List params = new ArrayList(); - - // preconditions - if (name == null || name.isEmpty() || value == null || value instanceof Collection) return params; - - params.add(new Pair(name, parameterToString(value))); - return params; - } - - /** - * Formats the specified collection query parameters to a list of {@code Pair} objects. - * - * Note that the values of each of the returned Pair objects are percent-encoded. - * - * @param collectionFormat The collection format of the parameter. - * @param name The name of the parameter. - * @param value The value of the parameter. - * @return A list of {@code Pair} objects. - */ - public List parameterToPairs(String collectionFormat, String name, Collection value) { - List params = new ArrayList(); - - // preconditions - if (name == null || name.isEmpty() || value == null || value.isEmpty()) { - return params; - } - - // create the params based on the collection format - if ("multi".equals(collectionFormat)) { - for (Object item : value) { - params.add(new Pair(name, escapeString(parameterToString(item)))); - } - return params; - } - - // collectionFormat is assumed to be "csv" by default - String delimiter = ","; - - // escape all delimiters except commas, which are URI reserved - // characters - if ("ssv".equals(collectionFormat)) { - delimiter = escapeString(" "); - } else if ("tsv".equals(collectionFormat)) { - delimiter = escapeString("\t"); - } else if ("pipes".equals(collectionFormat)) { - delimiter = escapeString("|"); - } - - StringBuilder sb = new StringBuilder() ; - for (Object item : value) { - sb.append(delimiter); - sb.append(escapeString(parameterToString(item))); - } - - params.add(new Pair(name, sb.substring(delimiter.length()))); - - return params; - } - - /** - * Sanitize filename by removing path. - * e.g. ../../sun.gif becomes sun.gif - * - * @param filename The filename to be sanitized - * @return The sanitized filename - */ - public String sanitizeFilename(String filename) { - return filename.replaceAll(".*[/\\\\]", ""); - } - - /** - * Check if the given MIME is a JSON MIME. - * JSON MIME examples: - * application/json - * application/json; charset=UTF8 - * APPLICATION/JSON - * application/vnd.company+json - * "* / *" is also default to JSON - * @param mime MIME (Multipurpose Internet Mail Extensions) - * @return True if the given MIME is JSON, false otherwise. - */ - public boolean isJsonMime(String mime) { - String jsonMime = "(?i)^(application/json|[^;/ \t]+/[^;/ \t]+[+]json)[ \t]*(;.*)?$"; - return mime != null && (mime.matches(jsonMime) || mime.equals("*/*")); - } - - /** - * Select the Accept header's value from the given accepts array: - * if JSON exists in the given array, use it; - * otherwise use all of them (joining into a string) - * - * @param accepts The accepts array to select from - * @return The Accept header to use. If the given array is empty, - * null will be returned (not to set the Accept header explicitly). - */ - public String selectHeaderAccept(String[] accepts) { - if (accepts.length == 0) { - return null; - } - for (String accept : accepts) { - if (isJsonMime(accept)) { - return accept; - } - } - return StringUtil.join(accepts, ","); - } - - /** - * Select the Content-Type header's value from the given array: - * if JSON exists in the given array, use it; - * otherwise use the first one of the array. - * - * @param contentTypes The Content-Type array to select from - * @return The Content-Type header to use. If the given array is empty, - * or matches "any", JSON will be used. - */ - public String selectHeaderContentType(String[] contentTypes) { - if (contentTypes.length == 0 || contentTypes[0].equals("*/*")) { - return "application/json"; - } - for (String contentType : contentTypes) { - if (isJsonMime(contentType)) { - return contentType; - } - } - return contentTypes[0]; - } - - /** - * Escape the given string to be used as URL query value. - * - * @param str String to be escaped - * @return Escaped string - */ - public String escapeString(String str) { - try { - return URLEncoder.encode(str, "utf8").replaceAll("\\+", "%20"); - } catch (UnsupportedEncodingException e) { - return str; - } - } - - /** - * Deserialize response body to Java object, according to the return type and - * the Content-Type response header. - * - * @param Type - * @param response HTTP response - * @param returnType The type of the Java object - * @return The deserialized Java object - * @throws ApiException If fail to deserialize response body, i.e. cannot read response body - * or the Content-Type of the response is not supported. - */ - @SuppressWarnings("unchecked") - public T deserialize(Response response, Type returnType) throws ApiException { - if (response == null || returnType == null) { - return null; - } - - if ("byte[]".equals(returnType.toString())) { - // Handle binary response (byte array). - try { - return (T) response.body().bytes(); - } catch (IOException e) { - throw new ApiException(e); - } - } else if (returnType.equals(File.class)) { - // Handle file downloading. - return (T) downloadFileFromResponse(response); - } - - String respBody; - try { - if (response.body() != null) - respBody = response.body().string(); - else - respBody = null; - } catch (IOException e) { - throw new ApiException(e); - } - - if (respBody == null || "".equals(respBody)) { - return null; - } - - String contentType = response.headers().get("Content-Type"); - if (contentType == null) { - // ensuring a default content type - contentType = "application/json"; - } - if (isJsonMime(contentType)) { - return json.deserialize(respBody, returnType); - } else if (returnType.equals(String.class)) { - // Expecting string, return the raw response body. - return (T) respBody; - } else { - throw new ApiException( - "Content type \"" + contentType + "\" is not supported for type: " + returnType, - response.code(), - response.headers().toMultimap(), - respBody); - } - } - - /** - * Serialize the given Java object into request body according to the object's - * class and the request Content-Type. - * - * @param obj The Java object - * @param contentType The request Content-Type - * @return The serialized request body - * @throws ApiException If fail to serialize the given object - */ - public RequestBody serialize(Object obj, String contentType) throws ApiException { - if (obj instanceof byte[]) { - // Binary (byte array) body parameter support. - return RequestBody.create(MediaType.parse(contentType), (byte[]) obj); - } else if (obj instanceof File) { - // File body parameter support. - return RequestBody.create(MediaType.parse(contentType), (File) obj); - } else if (isJsonMime(contentType)) { - String content; - if (obj != null) { - content = json.serialize(obj); - } else { - content = null; - } - return RequestBody.create(MediaType.parse(contentType), content); - } else { - throw new ApiException("Content type \"" + contentType + "\" is not supported"); - } - } - - /** - * Download file from the given response. - * - * @param response An instance of the Response object - * @throws ApiException If fail to read file content from response and write to disk - * @return Downloaded file - */ - public File downloadFileFromResponse(Response response) throws ApiException { - try { - File file = prepareDownloadFile(response); - BufferedSink sink = Okio.buffer(Okio.sink(file)); - sink.writeAll(response.body().source()); - sink.close(); - return file; - } catch (IOException e) { - throw new ApiException(e); - } - } - - /** - * Prepare file for download - * - * @param response An instance of the Response object - * @throws IOException If fail to prepare file for download - * @return Prepared file for the download - */ - public File prepareDownloadFile(Response response) throws IOException { - String filename = null; - String contentDisposition = response.header("Content-Disposition"); - if (contentDisposition != null && !"".equals(contentDisposition)) { - // Get filename from the Content-Disposition header. - Pattern pattern = Pattern.compile("filename=['\"]?([^'\"\\s]+)['\"]?"); - Matcher matcher = pattern.matcher(contentDisposition); - if (matcher.find()) { - filename = sanitizeFilename(matcher.group(1)); - } - } - - String prefix = null; - String suffix = null; - if (filename == null) { - prefix = "download-"; - suffix = ""; - } else { - int pos = filename.lastIndexOf("."); - if (pos == -1) { - prefix = filename + "-"; - } else { - prefix = filename.substring(0, pos) + "-"; - suffix = filename.substring(pos); - } - // File.createTempFile requires the prefix to be at least three characters long - if (prefix.length() < 3) - prefix = "download-"; - } - - if (tempFolderPath == null) - return File.createTempFile(prefix, suffix); - else - return File.createTempFile(prefix, suffix, new File(tempFolderPath)); - } - - /** - * {@link #execute(Call, Type)} - * - * @param Type - * @param call An instance of the Call object - * @throws ApiException If fail to execute the call - * @return ApiResponse<T> - */ - public ApiResponse execute(Call call) throws ApiException { - return execute(call, null); - } - - /** - * Execute HTTP call and deserialize the HTTP response body into the given return type. - * - * @param returnType The return type used to deserialize HTTP response body - * @param The return type corresponding to (same with) returnType - * @param call Call - * @return ApiResponse object containing response status, headers and - * data, which is a Java object deserialized from response body and would be null - * when returnType is null. - * @throws ApiException If fail to execute the call - */ - public ApiResponse execute(Call call, Type returnType) throws ApiException { - try { - Response response = call.execute(); - T data = handleResponse(response, returnType); - return new ApiResponse(response.code(), response.headers().toMultimap(), data); - } catch (IOException e) { - throw new ApiException(e); - } - } - - /** - * {@link #executeAsync(Call, Type, ApiCallback)} - * - * @param Type - * @param call An instance of the Call object - * @param callback ApiCallback<T> - */ - public void executeAsync(Call call, ApiCallback callback) { - executeAsync(call, null, callback); - } - - /** - * Execute HTTP call asynchronously. - * - * @see #execute(Call, Type) - * @param Type - * @param call The callback to be executed when the API call finishes - * @param returnType Return type - * @param callback ApiCallback - */ - @SuppressWarnings("unchecked") - public void executeAsync(Call call, final Type returnType, final ApiCallback callback) { - call.enqueue(new Callback() { - @Override - public void onFailure(Request request, IOException e) { - callback.onFailure(new ApiException(e), 0, null); - } - - @Override - public void onResponse(Response response) throws IOException { - T result; - try { - result = (T) handleResponse(response, returnType); - } catch (ApiException e) { - callback.onFailure(e, response.code(), response.headers().toMultimap()); - return; - } - callback.onSuccess(result, response.code(), response.headers().toMultimap()); - } - }); - } - - /** - * Handle the given response, return the deserialized object when the response is successful. - * - * @param Type - * @param response Response - * @param returnType Return type - * @throws ApiException If the response has a unsuccessful status code or - * fail to deserialize the response body - * @return Type - */ - public T handleResponse(Response response, Type returnType) throws ApiException { - if (response.isSuccessful()) { - if (returnType == null || response.code() == 204) { - // returning null if the returnType is not defined, - // or the status code is 204 (No Content) - if (response.body() != null) { - try { - response.body().close(); - } catch (IOException e) { - throw new ApiException(response.message(), e, response.code(), response.headers().toMultimap()); - } - } - return null; - } else { - return deserialize(response, returnType); - } - } else { - String respBody = null; - if (response.body() != null) { - try { - respBody = response.body().string(); - } catch (IOException e) { - throw new ApiException(response.message(), e, response.code(), response.headers().toMultimap()); - } - } - throw new ApiException(response.message(), response.code(), response.headers().toMultimap(), respBody); - } - } - - /** - * Build HTTP call with the given options. - * - * @param path The sub-path of the HTTP URL - * @param method The request method, one of "GET", "HEAD", "OPTIONS", "POST", "PUT", "PATCH" and "DELETE" - * @param queryParams The query parameters - * @param collectionQueryParams The collection query parameters - * @param body The request body object - * @param headerParams The header parameters - * @param formParams The form parameters - * @param authNames The authentications to apply - * @param progressRequestListener Progress request listener - * @return The HTTP call - * @throws ApiException If fail to serialize the request body object - */ - public Call buildCall(String path, String method, List queryParams, List collectionQueryParams, Object body, Map headerParams, Map formParams, String[] authNames, ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { - Request request = buildRequest(path, method, queryParams, collectionQueryParams, body, headerParams, formParams, authNames, progressRequestListener); - - return httpClient.newCall(request); - } - - /** - * Build an HTTP request with the given options. - * - * @param path The sub-path of the HTTP URL - * @param method The request method, one of "GET", "HEAD", "OPTIONS", "POST", "PUT", "PATCH" and "DELETE" - * @param queryParams The query parameters - * @param collectionQueryParams The collection query parameters - * @param body The request body object - * @param headerParams The header parameters - * @param formParams The form parameters - * @param authNames The authentications to apply - * @param progressRequestListener Progress request listener - * @return The HTTP request - * @throws ApiException If fail to serialize the request body object - */ - public Request buildRequest(String path, String method, List queryParams, List collectionQueryParams, Object body, Map headerParams, Map formParams, String[] authNames, ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { - updateParamsForAuth(authNames, queryParams, headerParams); - - final String url = buildUrl(path, queryParams, collectionQueryParams); - final Request.Builder reqBuilder = new Request.Builder().url(url); - processHeaderParams(headerParams, reqBuilder); - - String contentType = (String) headerParams.get("Content-Type"); - // ensuring a default content type - if (contentType == null) { - contentType = "application/json"; - } - - RequestBody reqBody; - if (!HttpMethod.permitsRequestBody(method)) { - reqBody = null; - } else if ("application/x-www-form-urlencoded".equals(contentType)) { - reqBody = buildRequestBodyFormEncoding(formParams); - } else if ("multipart/form-data".equals(contentType)) { - reqBody = buildRequestBodyMultipart(formParams); - } else if (body == null) { - if ("DELETE".equals(method)) { - // allow calling DELETE without sending a request body - reqBody = null; - } else { - // use an empty request body (for POST, PUT and PATCH) - reqBody = RequestBody.create(MediaType.parse(contentType), ""); - } - } else { - reqBody = serialize(body, contentType); - } - - Request request = null; - - if(progressRequestListener != null && reqBody != null) { - ProgressRequestBody progressRequestBody = new ProgressRequestBody(reqBody, progressRequestListener); - request = reqBuilder.method(method, progressRequestBody).build(); - } else { - request = reqBuilder.method(method, reqBody).build(); - } - - return request; - } - - /** - * Build full URL by concatenating base path, the given sub path and query parameters. - * - * @param path The sub path - * @param queryParams The query parameters - * @param collectionQueryParams The collection query parameters - * @return The full URL - */ - public String buildUrl(String path, List queryParams, List collectionQueryParams) { - final StringBuilder url = new StringBuilder(); - url.append(basePath).append(path); - - if (queryParams != null && !queryParams.isEmpty()) { - // support (constant) query string in `path`, e.g. "/posts?draft=1" - String prefix = path.contains("?") ? "&" : "?"; - for (Pair param : queryParams) { - if (param.getValue() != null) { - if (prefix != null) { - url.append(prefix); - prefix = null; - } else { - url.append("&"); - } - String value = parameterToString(param.getValue()); - url.append(escapeString(param.getName())).append("=").append(escapeString(value)); - } - } - } - - if (collectionQueryParams != null && !collectionQueryParams.isEmpty()) { - String prefix = url.toString().contains("?") ? "&" : "?"; - for (Pair param : collectionQueryParams) { - if (param.getValue() != null) { - if (prefix != null) { - url.append(prefix); - prefix = null; - } else { - url.append("&"); - } - String value = parameterToString(param.getValue()); - // collection query parameter value already escaped as part of parameterToPairs - url.append(escapeString(param.getName())).append("=").append(value); - } - } - } - - return url.toString(); - } - - /** - * Set header parameters to the request builder, including default headers. - * - * @param headerParams Header parameters in the ofrm of Map - * @param reqBuilder Reqeust.Builder - */ - public void processHeaderParams(Map headerParams, Request.Builder reqBuilder) { - for (Entry param : headerParams.entrySet()) { - reqBuilder.header(param.getKey(), parameterToString(param.getValue())); - } - for (Entry header : defaultHeaderMap.entrySet()) { - if (!headerParams.containsKey(header.getKey())) { - reqBuilder.header(header.getKey(), parameterToString(header.getValue())); - } - } - } - - /** - * Update query and header parameters based on authentication settings. - * - * @param authNames The authentications to apply - * @param queryParams List of query parameters - * @param headerParams Map of header parameters - */ - public void updateParamsForAuth(String[] authNames, List queryParams, Map headerParams) { - for (String authName : authNames) { - Authentication auth = authentications.get(authName); - if (auth == null) throw new RuntimeException("Authentication undefined: " + authName); - auth.applyToParams(queryParams, headerParams); - } - } - - /** - * Build a form-encoding request body with the given form parameters. - * - * @param formParams Form parameters in the form of Map - * @return RequestBody - */ - public RequestBody buildRequestBodyFormEncoding(Map formParams) { - FormEncodingBuilder formBuilder = new FormEncodingBuilder(); - for (Entry param : formParams.entrySet()) { - formBuilder.add(param.getKey(), parameterToString(param.getValue())); - } - return formBuilder.build(); - } - - /** - * Build a multipart (file uploading) request body with the given form parameters, - * which could contain text fields and file fields. - * - * @param formParams Form parameters in the form of Map - * @return RequestBody - */ - public RequestBody buildRequestBodyMultipart(Map formParams) { - MultipartBuilder mpBuilder = new MultipartBuilder().type(MultipartBuilder.FORM); - for (Entry param : formParams.entrySet()) { - if (param.getValue() instanceof File) { - File file = (File) param.getValue(); - Headers partHeaders = Headers.of("Content-Disposition", "form-data; name=\"" + param.getKey() + "\"; filename=\"" + file.getName() + "\""); - MediaType mediaType = MediaType.parse(guessContentTypeFromFile(file)); - mpBuilder.addPart(partHeaders, RequestBody.create(mediaType, file)); - } else { - Headers partHeaders = Headers.of("Content-Disposition", "form-data; name=\"" + param.getKey() + "\""); - mpBuilder.addPart(partHeaders, RequestBody.create(null, parameterToString(param.getValue()))); - } - } - return mpBuilder.build(); - } - - /** - * Guess Content-Type header from the given file (defaults to "application/octet-stream"). - * - * @param file The given file - * @return The guessed Content-Type - */ - public String guessContentTypeFromFile(File file) { - String contentType = URLConnection.guessContentTypeFromName(file.getName()); - if (contentType == null) { - return "application/octet-stream"; - } else { - return contentType; - } - } - - /** - * Apply SSL related settings to httpClient according to the current values of - * verifyingSsl and sslCaCert. - */ - private void applySslSettings() { - try { - TrustManager[] trustManagers = null; - HostnameVerifier hostnameVerifier = null; - if (!verifyingSsl) { - TrustManager trustAll = new X509TrustManager() { - @Override - public void checkClientTrusted(X509Certificate[] chain, String authType) throws CertificateException {} - @Override - public void checkServerTrusted(X509Certificate[] chain, String authType) throws CertificateException {} - @Override - public X509Certificate[] getAcceptedIssuers() { return null; } - }; - SSLContext sslContext = SSLContext.getInstance("TLS"); - trustManagers = new TrustManager[]{ trustAll }; - hostnameVerifier = new HostnameVerifier() { - @Override - public boolean verify(String hostname, SSLSession session) { return true; } - }; - } else if (sslCaCert != null) { - char[] password = null; // Any password will work. - CertificateFactory certificateFactory = CertificateFactory.getInstance("X.509"); - Collection certificates = certificateFactory.generateCertificates(sslCaCert); - if (certificates.isEmpty()) { - throw new IllegalArgumentException("expected non-empty set of trusted certificates"); - } - KeyStore caKeyStore = newEmptyKeyStore(password); - int index = 0; - for (Certificate certificate : certificates) { - String certificateAlias = "ca" + Integer.toString(index++); - caKeyStore.setCertificateEntry(certificateAlias, certificate); - } - TrustManagerFactory trustManagerFactory = TrustManagerFactory.getInstance(TrustManagerFactory.getDefaultAlgorithm()); - trustManagerFactory.init(caKeyStore); - trustManagers = trustManagerFactory.getTrustManagers(); - } - - if (keyManagers != null || trustManagers != null) { - SSLContext sslContext = SSLContext.getInstance("TLS"); - sslContext.init(keyManagers, trustManagers, new SecureRandom()); - httpClient.setSslSocketFactory(sslContext.getSocketFactory()); - } else { - httpClient.setSslSocketFactory(null); - } - httpClient.setHostnameVerifier(hostnameVerifier); - } catch (GeneralSecurityException e) { - throw new RuntimeException(e); - } - } - - private KeyStore newEmptyKeyStore(char[] password) throws GeneralSecurityException { - try { - KeyStore keyStore = KeyStore.getInstance(KeyStore.getDefaultType()); - keyStore.load(null, password); - return keyStore; - } catch (IOException e) { - throw new AssertionError(e); - } - } -} diff --git a/jans-client-api/gen-client/src/main/java/io/swagger/client/ApiException.java b/jans-client-api/gen-client/src/main/java/io/swagger/client/ApiException.java deleted file mode 100644 index 15800e6d6b4..00000000000 --- a/jans-client-api/gen-client/src/main/java/io/swagger/client/ApiException.java +++ /dev/null @@ -1,89 +0,0 @@ -/* - * jans-api-server - * jans-api-server - * - * OpenAPI spec version: 4.2 - * Contact: yuriyz@gluu.org - * - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen.git - * Do not edit the class manually. - */ - -package io.swagger.client; - -import java.util.Map; -import java.util.List; - -public class ApiException extends Exception { - private int code = 0; - private Map> responseHeaders = null; - private String responseBody = null; - - public ApiException() {} - - public ApiException(Throwable throwable) { - super(throwable); - } - - public ApiException(String message) { - super(message); - } - - public ApiException(String message, Throwable throwable, int code, Map> responseHeaders, String responseBody) { - super(message, throwable); - this.code = code; - this.responseHeaders = responseHeaders; - this.responseBody = responseBody; - } - - public ApiException(String message, int code, Map> responseHeaders, String responseBody) { - this(message, (Throwable) null, code, responseHeaders, responseBody); - } - - public ApiException(String message, Throwable throwable, int code, Map> responseHeaders) { - this(message, throwable, code, responseHeaders, null); - } - - public ApiException(int code, Map> responseHeaders, String responseBody) { - this((String) null, (Throwable) null, code, responseHeaders, responseBody); - } - - public ApiException(int code, String message) { - super(message); - this.code = code; - } - - public ApiException(int code, String message, Map> responseHeaders, String responseBody) { - this(code, message); - this.responseHeaders = responseHeaders; - this.responseBody = responseBody; - } - - /** - * Get the HTTP status code. - * - * @return HTTP status code - */ - public int getCode() { - return code; - } - - /** - * Get the HTTP response headers. - * - * @return A map of list of string - */ - public Map> getResponseHeaders() { - return responseHeaders; - } - - /** - * Get the HTTP response body. - * - * @return Response body in the form of string - */ - public String getResponseBody() { - return responseBody; - } -} diff --git a/jans-client-api/gen-client/src/main/java/io/swagger/client/ApiResponse.java b/jans-client-api/gen-client/src/main/java/io/swagger/client/ApiResponse.java deleted file mode 100644 index 08252012222..00000000000 --- a/jans-client-api/gen-client/src/main/java/io/swagger/client/ApiResponse.java +++ /dev/null @@ -1,58 +0,0 @@ -/* - * jans-api-server - * jans-api-server - * - * OpenAPI spec version: 4.2 - * Contact: yuriyz@gluu.org - * - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen.git - * Do not edit the class manually. - */ - -package io.swagger.client; - -import java.util.List; -import java.util.Map; - -/** - * API response returned by API call. - * - * @param The type of data that is deserialized from response body - */ -public class ApiResponse { - final private int statusCode; - final private Map> headers; - final private T data; - - /** - * @param statusCode The status code of HTTP response - * @param headers The headers of HTTP response - */ - public ApiResponse(int statusCode, Map> headers) { - this(statusCode, headers, null); - } - - /** - * @param statusCode The status code of HTTP response - * @param headers The headers of HTTP response - * @param data The object deserialized from response bod - */ - public ApiResponse(int statusCode, Map> headers, T data) { - this.statusCode = statusCode; - this.headers = headers; - this.data = data; - } - - public int getStatusCode() { - return statusCode; - } - - public Map> getHeaders() { - return headers; - } - - public T getData() { - return data; - } -} diff --git a/jans-client-api/gen-client/src/main/java/io/swagger/client/Configuration.java b/jans-client-api/gen-client/src/main/java/io/swagger/client/Configuration.java deleted file mode 100644 index 23b61c683d7..00000000000 --- a/jans-client-api/gen-client/src/main/java/io/swagger/client/Configuration.java +++ /dev/null @@ -1,37 +0,0 @@ -/* - * jans-api-server - * jans-api-server - * - * OpenAPI spec version: 4.2 - * Contact: yuriyz@gluu.org - * - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen.git - * Do not edit the class manually. - */ - -package io.swagger.client; - -public class Configuration { - private static ApiClient defaultApiClient = new ApiClient(); - - /** - * Get the default API client, which would be used when creating API - * instances without providing an API client. - * - * @return Default API client - */ - public static ApiClient getDefaultApiClient() { - return defaultApiClient; - } - - /** - * Set the default API client, which would be used when creating API - * instances without providing an API client. - * - * @param apiClient API client - */ - public static void setDefaultApiClient(ApiClient apiClient) { - defaultApiClient = apiClient; - } -} diff --git a/jans-client-api/gen-client/src/main/java/io/swagger/client/GzipRequestInterceptor.java b/jans-client-api/gen-client/src/main/java/io/swagger/client/GzipRequestInterceptor.java deleted file mode 100644 index 4846255a813..00000000000 --- a/jans-client-api/gen-client/src/main/java/io/swagger/client/GzipRequestInterceptor.java +++ /dev/null @@ -1,80 +0,0 @@ -/* - * jans-api-server - * jans-api-server - * - * OpenAPI spec version: 4.2 - * Contact: yuriyz@gluu.org - * - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen.git - * Do not edit the class manually. - */ - -package io.swagger.client; - -import com.squareup.okhttp.*; -import okio.Buffer; -import okio.BufferedSink; -import okio.GzipSink; -import okio.Okio; - -import java.io.IOException; - -/** - * Encodes request bodies using gzip. - * - * Taken from https://github.com/square/okhttp/issues/350 - */ -class GzipRequestInterceptor implements Interceptor { - @Override public Response intercept(Chain chain) throws IOException { - Request originalRequest = chain.request(); - if (originalRequest.body() == null || originalRequest.header("Content-Encoding") != null) { - return chain.proceed(originalRequest); - } - - Request compressedRequest = originalRequest.newBuilder() - .header("Content-Encoding", "gzip") - .method(originalRequest.method(), forceContentLength(gzip(originalRequest.body()))) - .build(); - return chain.proceed(compressedRequest); - } - - private RequestBody forceContentLength(final RequestBody requestBody) throws IOException { - final Buffer buffer = new Buffer(); - requestBody.writeTo(buffer); - return new RequestBody() { - @Override - public MediaType contentType() { - return requestBody.contentType(); - } - - @Override - public long contentLength() { - return buffer.size(); - } - - @Override - public void writeTo(BufferedSink sink) throws IOException { - sink.write(buffer.snapshot()); - } - }; - } - - private RequestBody gzip(final RequestBody body) { - return new RequestBody() { - @Override public MediaType contentType() { - return body.contentType(); - } - - @Override public long contentLength() { - return -1; // We don't know the compressed length in advance! - } - - @Override public void writeTo(BufferedSink sink) throws IOException { - BufferedSink gzipSink = Okio.buffer(new GzipSink(sink)); - body.writeTo(gzipSink); - gzipSink.close(); - } - }; - } -} \ No newline at end of file diff --git a/jans-client-api/gen-client/src/main/java/io/swagger/client/JSON.java b/jans-client-api/gen-client/src/main/java/io/swagger/client/JSON.java deleted file mode 100644 index 4f171bd4749..00000000000 --- a/jans-client-api/gen-client/src/main/java/io/swagger/client/JSON.java +++ /dev/null @@ -1,363 +0,0 @@ -/* - * jans-api-server - * jans-api-server - * - * OpenAPI spec version: 4.2 - * Contact: yuriyz@gluu.org - * - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen.git - * Do not edit the class manually. - */ - -package io.swagger.client; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import io.gsonfire.GsonFireBuilder; -import io.gsonfire.PostProcessor; -import io.gsonfire.TypeSelector; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapter; -import com.google.gson.internal.bind.util.ISO8601Utils; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import org.threeten.bp.LocalDate; -import org.threeten.bp.OffsetDateTime; -import org.threeten.bp.format.DateTimeFormatter; - -import io.swagger.client.model.*; - -import java.io.IOException; -import java.io.StringReader; -import java.lang.reflect.Type; -import java.text.DateFormat; -import java.text.ParseException; -import java.text.ParsePosition; -import java.util.Date; -import java.util.Map; -import java.util.HashMap; - -public class JSON { - private Gson gson; - private boolean isLenientOnJson = false; - private DateTypeAdapter dateTypeAdapter = new DateTypeAdapter(); - private SqlDateTypeAdapter sqlDateTypeAdapter = new SqlDateTypeAdapter(); - private OffsetDateTimeTypeAdapter offsetDateTimeTypeAdapter = new OffsetDateTimeTypeAdapter(); - private LocalDateTypeAdapter localDateTypeAdapter = new LocalDateTypeAdapter(); - - public static GsonBuilder createGson() { - GsonFireBuilder fireBuilder = new GsonFireBuilder() - ; - return fireBuilder.createGsonBuilder(); - } - - private static String getDiscriminatorValue(JsonElement readElement, String discriminatorField) { - JsonElement element = readElement.getAsJsonObject().get(discriminatorField); - if(null == element) { - throw new IllegalArgumentException("missing discriminator field: <" + discriminatorField + ">"); - } - return element.getAsString(); - } - - private static Class getClassByDiscriminator(Map> classByDiscriminatorValue, String discriminatorValue) { - Class clazz = classByDiscriminatorValue.get(discriminatorValue.toUpperCase()); - if(null == clazz) { - throw new IllegalArgumentException("cannot determine model class of name: <" + discriminatorValue + ">"); - } - return clazz; - } - - public JSON() { - gson = createGson() - .registerTypeAdapter(Date.class, dateTypeAdapter) - .registerTypeAdapter(java.sql.Date.class, sqlDateTypeAdapter) - .registerTypeAdapter(OffsetDateTime.class, offsetDateTimeTypeAdapter) - .registerTypeAdapter(LocalDate.class, localDateTypeAdapter) - .create(); - } - - /** - * Get Gson. - * - * @return Gson - */ - public Gson getGson() { - return gson; - } - - /** - * Set Gson. - * - * @param gson Gson - * @return JSON - */ - public JSON setGson(Gson gson) { - this.gson = gson; - return this; - } - - public JSON setLenientOnJson(boolean lenientOnJson) { - isLenientOnJson = lenientOnJson; - return this; - } - - /** - * Serialize the given Java object into JSON string. - * - * @param obj Object - * @return String representation of the JSON - */ - public String serialize(Object obj) { - return gson.toJson(obj); - } - - /** - * Deserialize the given JSON string to Java object. - * - * @param Type - * @param body The JSON string - * @param returnType The type to deserialize into - * @return The deserialized Java object - */ - @SuppressWarnings("unchecked") - public T deserialize(String body, Type returnType) { - try { - if (isLenientOnJson) { - JsonReader jsonReader = new JsonReader(new StringReader(body)); - // see https://google-gson.googlecode.com/svn/trunk/gson/docs/javadocs/com/google/gson/stream/JsonReader.html#setLenient(boolean) - jsonReader.setLenient(true); - return gson.fromJson(jsonReader, returnType); - } else { - return gson.fromJson(body, returnType); - } - } catch (JsonParseException e) { - // Fallback processing when failed to parse JSON form response body: - // return the response body string directly for the String return type; - if (returnType.equals(String.class)) - return (T) body; - else throw (e); - } - } - - /** - * Gson TypeAdapter for JSR310 OffsetDateTime type - */ - public static class OffsetDateTimeTypeAdapter extends TypeAdapter { - - private DateTimeFormatter formatter; - - public OffsetDateTimeTypeAdapter() { - this(DateTimeFormatter.ISO_OFFSET_DATE_TIME); - } - - public OffsetDateTimeTypeAdapter(DateTimeFormatter formatter) { - this.formatter = formatter; - } - - public void setFormat(DateTimeFormatter dateFormat) { - this.formatter = dateFormat; - } - - @Override - public void write(JsonWriter out, OffsetDateTime date) throws IOException { - if (date == null) { - out.nullValue(); - } else { - out.value(formatter.format(date)); - } - } - - @Override - public OffsetDateTime read(JsonReader in) throws IOException { - switch (in.peek()) { - case NULL: - in.nextNull(); - return null; - default: - String date = in.nextString(); - if (date.endsWith("+0000")) { - date = date.substring(0, date.length()-5) + "Z"; - } - return OffsetDateTime.parse(date, formatter); - } - } - } - - /** - * Gson TypeAdapter for JSR310 LocalDate type - */ - public class LocalDateTypeAdapter extends TypeAdapter { - - private DateTimeFormatter formatter; - - public LocalDateTypeAdapter() { - this(DateTimeFormatter.ISO_LOCAL_DATE); - } - - public LocalDateTypeAdapter(DateTimeFormatter formatter) { - this.formatter = formatter; - } - - public void setFormat(DateTimeFormatter dateFormat) { - this.formatter = dateFormat; - } - - @Override - public void write(JsonWriter out, LocalDate date) throws IOException { - if (date == null) { - out.nullValue(); - } else { - out.value(formatter.format(date)); - } - } - - @Override - public LocalDate read(JsonReader in) throws IOException { - switch (in.peek()) { - case NULL: - in.nextNull(); - return null; - default: - String date = in.nextString(); - return LocalDate.parse(date, formatter); - } - } - } - - public JSON setOffsetDateTimeFormat(DateTimeFormatter dateFormat) { - offsetDateTimeTypeAdapter.setFormat(dateFormat); - return this; - } - - public JSON setLocalDateFormat(DateTimeFormatter dateFormat) { - localDateTypeAdapter.setFormat(dateFormat); - return this; - } - - /** - * Gson TypeAdapter for java.sql.Date type - * If the dateFormat is null, a simple "yyyy-MM-dd" format will be used - * (more efficient than SimpleDateFormat). - */ - public static class SqlDateTypeAdapter extends TypeAdapter { - - private DateFormat dateFormat; - - public SqlDateTypeAdapter() { - } - - public SqlDateTypeAdapter(DateFormat dateFormat) { - this.dateFormat = dateFormat; - } - - public void setFormat(DateFormat dateFormat) { - this.dateFormat = dateFormat; - } - - @Override - public void write(JsonWriter out, java.sql.Date date) throws IOException { - if (date == null) { - out.nullValue(); - } else { - String value; - if (dateFormat != null) { - value = dateFormat.format(date); - } else { - value = date.toString(); - } - out.value(value); - } - } - - @Override - public java.sql.Date read(JsonReader in) throws IOException { - switch (in.peek()) { - case NULL: - in.nextNull(); - return null; - default: - String date = in.nextString(); - try { - if (dateFormat != null) { - return new java.sql.Date(dateFormat.parse(date).getTime()); - } - return new java.sql.Date(ISO8601Utils.parse(date, new ParsePosition(0)).getTime()); - } catch (ParseException e) { - throw new JsonParseException(e); - } - } - } - } - - /** - * Gson TypeAdapter for java.util.Date type - * If the dateFormat is null, ISO8601Utils will be used. - */ - public static class DateTypeAdapter extends TypeAdapter { - - private DateFormat dateFormat; - - public DateTypeAdapter() { - } - - public DateTypeAdapter(DateFormat dateFormat) { - this.dateFormat = dateFormat; - } - - public void setFormat(DateFormat dateFormat) { - this.dateFormat = dateFormat; - } - - @Override - public void write(JsonWriter out, Date date) throws IOException { - if (date == null) { - out.nullValue(); - } else { - String value; - if (dateFormat != null) { - value = dateFormat.format(date); - } else { - value = ISO8601Utils.format(date, true); - } - out.value(value); - } - } - - @Override - public Date read(JsonReader in) throws IOException { - try { - switch (in.peek()) { - case NULL: - in.nextNull(); - return null; - default: - String date = in.nextString(); - try { - if (dateFormat != null) { - return dateFormat.parse(date); - } - return ISO8601Utils.parse(date, new ParsePosition(0)); - } catch (ParseException e) { - throw new JsonParseException(e); - } - } - } catch (IllegalArgumentException e) { - throw new JsonParseException(e); - } - } - } - - public JSON setDateFormat(DateFormat dateFormat) { - dateTypeAdapter.setFormat(dateFormat); - return this; - } - - public JSON setSqlDateFormat(DateFormat dateFormat) { - sqlDateTypeAdapter.setFormat(dateFormat); - return this; - } - -} diff --git a/jans-client-api/gen-client/src/main/java/io/swagger/client/Pair.java b/jans-client-api/gen-client/src/main/java/io/swagger/client/Pair.java deleted file mode 100644 index 4533b4bd47a..00000000000 --- a/jans-client-api/gen-client/src/main/java/io/swagger/client/Pair.java +++ /dev/null @@ -1,50 +0,0 @@ -/* - * jans-api-server - * jans-api-server - * - * OpenAPI spec version: 4.2 - * Contact: yuriyz@gluu.org - * - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen.git - * Do not edit the class manually. - */ - -package io.swagger.client; - -public class Pair { - private String name = ""; - private String value = ""; - - public Pair (String name, String value) { - setName(name); - setValue(value); - } - - private void setName(String name) { - if (!isValidString(name)) return; - - this.name = name; - } - - private void setValue(String value) { - if (!isValidString(value)) return; - - this.value = value; - } - - public String getName() { - return this.name; - } - - public String getValue() { - return this.value; - } - - private boolean isValidString(String arg) { - if (arg == null) return false; - if (arg.trim().isEmpty()) return false; - - return true; - } -} diff --git a/jans-client-api/gen-client/src/main/java/io/swagger/client/ProgressRequestBody.java b/jans-client-api/gen-client/src/main/java/io/swagger/client/ProgressRequestBody.java deleted file mode 100644 index 34f73cff9e3..00000000000 --- a/jans-client-api/gen-client/src/main/java/io/swagger/client/ProgressRequestBody.java +++ /dev/null @@ -1,76 +0,0 @@ -/* - * jans-api-server - * jans-api-server - * - * OpenAPI spec version: 4.2 - * Contact: yuriyz@gluu.org - * - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen.git - * Do not edit the class manually. - */ - -package io.swagger.client; - -import com.squareup.okhttp.MediaType; -import com.squareup.okhttp.RequestBody; - -import java.io.IOException; - -import okio.Buffer; -import okio.BufferedSink; -import okio.ForwardingSink; -import okio.Okio; -import okio.Sink; - -public class ProgressRequestBody extends RequestBody { - - public interface ProgressRequestListener { - void onRequestProgress(long bytesWritten, long contentLength, boolean done); - } - - private final RequestBody requestBody; - - private final ProgressRequestListener progressListener; - - public ProgressRequestBody(RequestBody requestBody, ProgressRequestListener progressListener) { - this.requestBody = requestBody; - this.progressListener = progressListener; - } - - @Override - public MediaType contentType() { - return requestBody.contentType(); - } - - @Override - public long contentLength() throws IOException { - return requestBody.contentLength(); - } - - @Override - public void writeTo(BufferedSink sink) throws IOException { - BufferedSink bufferedSink = Okio.buffer(sink(sink)); - requestBody.writeTo(bufferedSink); - bufferedSink.flush(); - } - - private Sink sink(Sink sink) { - return new ForwardingSink(sink) { - - long bytesWritten = 0L; - long contentLength = 0L; - - @Override - public void write(Buffer source, long byteCount) throws IOException { - super.write(source, byteCount); - if (contentLength == 0) { - contentLength = contentLength(); - } - - bytesWritten += byteCount; - progressListener.onRequestProgress(bytesWritten, contentLength, bytesWritten == contentLength); - } - }; - } -} diff --git a/jans-client-api/gen-client/src/main/java/io/swagger/client/ProgressResponseBody.java b/jans-client-api/gen-client/src/main/java/io/swagger/client/ProgressResponseBody.java deleted file mode 100644 index 26a1bd9d5d1..00000000000 --- a/jans-client-api/gen-client/src/main/java/io/swagger/client/ProgressResponseBody.java +++ /dev/null @@ -1,75 +0,0 @@ -/* - * jans-api-server - * jans-api-server - * - * OpenAPI spec version: 4.2 - * Contact: yuriyz@gluu.org - * - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen.git - * Do not edit the class manually. - */ - -package io.swagger.client; - -import com.squareup.okhttp.MediaType; -import com.squareup.okhttp.ResponseBody; - -import java.io.IOException; - -import okio.Buffer; -import okio.BufferedSource; -import okio.ForwardingSource; -import okio.Okio; -import okio.Source; - -public class ProgressResponseBody extends ResponseBody { - - public interface ProgressListener { - void update(long bytesRead, long contentLength, boolean done); - } - - private final ResponseBody responseBody; - private final ProgressListener progressListener; - private BufferedSource bufferedSource; - - public ProgressResponseBody(ResponseBody responseBody, ProgressListener progressListener) { - this.responseBody = responseBody; - this.progressListener = progressListener; - } - - @Override - public MediaType contentType() { - return responseBody.contentType(); - } - - @Override - public long contentLength() throws IOException { - return responseBody.contentLength(); - } - - @Override - public BufferedSource source() throws IOException { - if (bufferedSource == null) { - bufferedSource = Okio.buffer(source(responseBody.source())); - } - return bufferedSource; - } - - private Source source(Source source) { - return new ForwardingSource(source) { - long totalBytesRead = 0L; - - @Override - public long read(Buffer sink, long byteCount) throws IOException { - long bytesRead = super.read(sink, byteCount); - // read() returns the number of bytes read, or -1 if this source is exhausted. - totalBytesRead += bytesRead != -1 ? bytesRead : 0; - progressListener.update(totalBytesRead, responseBody.contentLength(), bytesRead == -1); - return bytesRead; - } - }; - } -} - - diff --git a/jans-client-api/gen-client/src/main/java/io/swagger/client/StringUtil.java b/jans-client-api/gen-client/src/main/java/io/swagger/client/StringUtil.java deleted file mode 100644 index b5e96b573de..00000000000 --- a/jans-client-api/gen-client/src/main/java/io/swagger/client/StringUtil.java +++ /dev/null @@ -1,53 +0,0 @@ -/* - * jans-api-server - * jans-api-server - * - * OpenAPI spec version: 4.2 - * Contact: yuriyz@gluu.org - * - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen.git - * Do not edit the class manually. - */ - -package io.swagger.client; - -public class StringUtil { - /** - * Check if the given array contains the given value (with case-insensitive comparison). - * - * @param array The array - * @param value The value to search - * @return true if the array contains the value - */ - public static boolean containsIgnoreCase(String[] array, String value) { - for (String str : array) { - if (value == null && str == null) return true; - if (value != null && value.equalsIgnoreCase(str)) return true; - } - return false; - } - - /** - * Join an array of strings with the given separator. - *

- * Note: This might be replaced by utility method from commons-lang or guava someday - * if one of those libraries is added as dependency. - *

- * - * @param array The array of strings - * @param separator The separator - * @return the resulting string - */ - public static String join(String[] array, String separator) { - int len = array.length; - if (len == 0) return ""; - - StringBuilder out = new StringBuilder(); - out.append(array[0]); - for (int i = 1; i < len; i++) { - out.append(separator).append(array[i]); - } - return out.toString(); - } -} diff --git a/jans-client-api/gen-client/src/main/java/io/swagger/client/api/DevelopersApi.java b/jans-client-api/gen-client/src/main/java/io/swagger/client/api/DevelopersApi.java deleted file mode 100644 index 1406d471dac..00000000000 --- a/jans-client-api/gen-client/src/main/java/io/swagger/client/api/DevelopersApi.java +++ /dev/null @@ -1,3041 +0,0 @@ -/* - * jans-api-server - * jans-api-server - * - * OpenAPI spec version: 4.2 - * Contact: yuriyz@gluu.org - * - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen.git - * Do not edit the class manually. - */ - -package io.swagger.client.api; - -import io.swagger.client.ApiCallback; -import io.swagger.client.ApiClient; -import io.swagger.client.ApiException; -import io.swagger.client.ApiResponse; -import io.swagger.client.Configuration; -import io.swagger.client.Pair; -import io.swagger.client.ProgressRequestBody; -import io.swagger.client.ProgressResponseBody; - -import com.google.gson.reflect.TypeToken; - -import java.io.IOException; - - -import io.swagger.client.model.ErrorResponse; -import io.swagger.client.model.GetAccessTokenByRefreshTokenParams; -import io.swagger.client.model.GetAccessTokenByRefreshTokenResponse; -import io.swagger.client.model.GetAuthorizationUrlParams; -import io.swagger.client.model.GetAuthorizationUrlResponse; -import io.swagger.client.model.GetClientTokenParams; -import io.swagger.client.model.GetClientTokenResponse; -import io.swagger.client.model.GetDiscoveryParams; -import io.swagger.client.model.GetDiscoveryResponse; -import io.swagger.client.model.GetIssuerParams; -import io.swagger.client.model.GetIssuerResponse; -import io.swagger.client.model.GetJwksParams; -import io.swagger.client.model.GetJwksResponse; -import io.swagger.client.model.GetLogoutUriParams; -import io.swagger.client.model.GetLogoutUriResponse; -import io.swagger.client.model.GetRequestObjectUriParams; -import io.swagger.client.model.GetRequestObjectUriResponse; -import io.swagger.client.model.GetRpJwksResponse; -import io.swagger.client.model.GetTokensByCodeParams; -import io.swagger.client.model.GetTokensByCodeResponse; -import io.swagger.client.model.GetUserInfoParams; -import io.swagger.client.model.IntrospectAccessTokenParams; -import io.swagger.client.model.IntrospectAccessTokenResponse; -import io.swagger.client.model.IntrospectRptParams; -import io.swagger.client.model.IntrospectRptResponse; -import io.swagger.client.model.RegisterSiteParams; -import io.swagger.client.model.RegisterSiteResponse; -import io.swagger.client.model.RemoveSiteParams; -import io.swagger.client.model.RemoveSiteResponse; -import io.swagger.client.model.UmaRpGetClaimsGatheringUrlParams; -import io.swagger.client.model.UmaRpGetClaimsGatheringUrlResponse; -import io.swagger.client.model.UmaRpGetRptParams; -import io.swagger.client.model.UmaRpGetRptResponse; -import io.swagger.client.model.UmaRsCheckAccessParams; -import io.swagger.client.model.UmaRsCheckAccessResponse; -import io.swagger.client.model.UmaRsModifyParams; -import io.swagger.client.model.UmaRsModifyResponse; -import io.swagger.client.model.UmaRsProtectParams; -import io.swagger.client.model.UmaRsProtectResponse; -import io.swagger.client.model.UpdateSiteParams; -import io.swagger.client.model.UpdateSiteResponse; - -import java.lang.reflect.Type; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -public class DevelopersApi { - private ApiClient apiClient; - - public DevelopersApi() { - this(Configuration.getDefaultApiClient()); - } - - public DevelopersApi(ApiClient apiClient) { - this.apiClient = apiClient; - } - - public ApiClient getApiClient() { - return apiClient; - } - - public void setApiClient(ApiClient apiClient) { - this.apiClient = apiClient; - } - - /** - * Build call for getAccessTokenByRefreshToken - * @param body (optional) - * @param authorization (optional) - * @param authorizationRpId (optional) - * @param progressListener Progress listener - * @param progressRequestListener Progress request listener - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - */ - public com.squareup.okhttp.Call getAccessTokenByRefreshTokenCall(GetAccessTokenByRefreshTokenParams body, String authorization, String authorizationRpId, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { - Object localVarPostBody = body; - - // create path and map variables - String localVarPath = "/get-access-token-by-refresh-token"; - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - - Map localVarHeaderParams = new HashMap(); - if (authorization != null) - localVarHeaderParams.put("Authorization", apiClient.parameterToString(authorization)); - if (authorizationRpId != null) - localVarHeaderParams.put("AuthorizationRpId", apiClient.parameterToString(authorizationRpId)); - - Map localVarFormParams = new HashMap(); - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); - - final String[] localVarContentTypes = { - "application/json" - }; - final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - localVarHeaderParams.put("Content-Type", localVarContentType); - - if(progressListener != null) { - apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { - @Override - public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { - com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); - return originalResponse.newBuilder() - .body(new ProgressResponseBody(originalResponse.body(), progressListener)) - .build(); - } - }); - } - - String[] localVarAuthNames = new String[] { }; - return apiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); - } - - @SuppressWarnings("rawtypes") - private com.squareup.okhttp.Call getAccessTokenByRefreshTokenValidateBeforeCall(GetAccessTokenByRefreshTokenParams body, String authorization, String authorizationRpId, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { - - com.squareup.okhttp.Call call = getAccessTokenByRefreshTokenCall(body, authorization, authorizationRpId, progressListener, progressRequestListener); - return call; - - - - - - } - - /** - * Get Access Token By Refresh Token - * Get Access Token By Refresh Token - * @param body (optional) - * @param authorization (optional) - * @param authorizationRpId (optional) - * @return GetAccessTokenByRefreshTokenResponse - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - */ - public GetAccessTokenByRefreshTokenResponse getAccessTokenByRefreshToken(GetAccessTokenByRefreshTokenParams body, String authorization, String authorizationRpId) throws ApiException { - ApiResponse resp = getAccessTokenByRefreshTokenWithHttpInfo(body, authorization, authorizationRpId); - return resp.getData(); - } - - /** - * Get Access Token By Refresh Token - * Get Access Token By Refresh Token - * @param body (optional) - * @param authorization (optional) - * @param authorizationRpId (optional) - * @return ApiResponse<GetAccessTokenByRefreshTokenResponse> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - */ - public ApiResponse getAccessTokenByRefreshTokenWithHttpInfo(GetAccessTokenByRefreshTokenParams body, String authorization, String authorizationRpId) throws ApiException { - com.squareup.okhttp.Call call = getAccessTokenByRefreshTokenValidateBeforeCall(body, authorization, authorizationRpId, null, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return apiClient.execute(call, localVarReturnType); - } - - /** - * Get Access Token By Refresh Token (asynchronously) - * Get Access Token By Refresh Token - * @param body (optional) - * @param authorization (optional) - * @param authorizationRpId (optional) - * @param callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object - */ - public com.squareup.okhttp.Call getAccessTokenByRefreshTokenAsync(GetAccessTokenByRefreshTokenParams body, String authorization, String authorizationRpId, final ApiCallback callback) throws ApiException { - - ProgressResponseBody.ProgressListener progressListener = null; - ProgressRequestBody.ProgressRequestListener progressRequestListener = null; - - if (callback != null) { - progressListener = new ProgressResponseBody.ProgressListener() { - @Override - public void update(long bytesRead, long contentLength, boolean done) { - callback.onDownloadProgress(bytesRead, contentLength, done); - } - }; - - progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { - @Override - public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { - callback.onUploadProgress(bytesWritten, contentLength, done); - } - }; - } - - com.squareup.okhttp.Call call = getAccessTokenByRefreshTokenValidateBeforeCall(body, authorization, authorizationRpId, progressListener, progressRequestListener); - Type localVarReturnType = new TypeToken(){}.getType(); - apiClient.executeAsync(call, localVarReturnType, callback); - return call; - } - /** - * Build call for getAuthorizationUrl - * @param body (optional) - * @param authorization (optional) - * @param authorizationRpId (optional) - * @param progressListener Progress listener - * @param progressRequestListener Progress request listener - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - */ - public com.squareup.okhttp.Call getAuthorizationUrlCall(GetAuthorizationUrlParams body, String authorization, String authorizationRpId, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { - Object localVarPostBody = body; - - // create path and map variables - String localVarPath = "/get-authorization-url"; - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - - Map localVarHeaderParams = new HashMap(); - if (authorization != null) - localVarHeaderParams.put("Authorization", apiClient.parameterToString(authorization)); - if (authorizationRpId != null) - localVarHeaderParams.put("AuthorizationRpId", apiClient.parameterToString(authorizationRpId)); - - Map localVarFormParams = new HashMap(); - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); - - final String[] localVarContentTypes = { - "application/json" - }; - final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - localVarHeaderParams.put("Content-Type", localVarContentType); - - if(progressListener != null) { - apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { - @Override - public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { - com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); - return originalResponse.newBuilder() - .body(new ProgressResponseBody(originalResponse.body(), progressListener)) - .build(); - } - }); - } - - String[] localVarAuthNames = new String[] { }; - return apiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); - } - - @SuppressWarnings("rawtypes") - private com.squareup.okhttp.Call getAuthorizationUrlValidateBeforeCall(GetAuthorizationUrlParams body, String authorization, String authorizationRpId, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { - - com.squareup.okhttp.Call call = getAuthorizationUrlCall(body, authorization, authorizationRpId, progressListener, progressRequestListener); - return call; - - - - - - } - - /** - * Get Authorization Url - * Gets authorization url - * @param body (optional) - * @param authorization (optional) - * @param authorizationRpId (optional) - * @return GetAuthorizationUrlResponse - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - */ - public GetAuthorizationUrlResponse getAuthorizationUrl(GetAuthorizationUrlParams body, String authorization, String authorizationRpId) throws ApiException { - ApiResponse resp = getAuthorizationUrlWithHttpInfo(body, authorization, authorizationRpId); - return resp.getData(); - } - - /** - * Get Authorization Url - * Gets authorization url - * @param body (optional) - * @param authorization (optional) - * @param authorizationRpId (optional) - * @return ApiResponse<GetAuthorizationUrlResponse> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - */ - public ApiResponse getAuthorizationUrlWithHttpInfo(GetAuthorizationUrlParams body, String authorization, String authorizationRpId) throws ApiException { - com.squareup.okhttp.Call call = getAuthorizationUrlValidateBeforeCall(body, authorization, authorizationRpId, null, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return apiClient.execute(call, localVarReturnType); - } - - /** - * Get Authorization Url (asynchronously) - * Gets authorization url - * @param body (optional) - * @param authorization (optional) - * @param authorizationRpId (optional) - * @param callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object - */ - public com.squareup.okhttp.Call getAuthorizationUrlAsync(GetAuthorizationUrlParams body, String authorization, String authorizationRpId, final ApiCallback callback) throws ApiException { - - ProgressResponseBody.ProgressListener progressListener = null; - ProgressRequestBody.ProgressRequestListener progressRequestListener = null; - - if (callback != null) { - progressListener = new ProgressResponseBody.ProgressListener() { - @Override - public void update(long bytesRead, long contentLength, boolean done) { - callback.onDownloadProgress(bytesRead, contentLength, done); - } - }; - - progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { - @Override - public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { - callback.onUploadProgress(bytesWritten, contentLength, done); - } - }; - } - - com.squareup.okhttp.Call call = getAuthorizationUrlValidateBeforeCall(body, authorization, authorizationRpId, progressListener, progressRequestListener); - Type localVarReturnType = new TypeToken(){}.getType(); - apiClient.executeAsync(call, localVarReturnType, callback); - return call; - } - /** - * Build call for getClientToken - * @param body (optional) - * @param progressListener Progress listener - * @param progressRequestListener Progress request listener - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - */ - public com.squareup.okhttp.Call getClientTokenCall(GetClientTokenParams body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { - Object localVarPostBody = body; - - // create path and map variables - String localVarPath = "/get-client-token"; - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - - Map localVarHeaderParams = new HashMap(); - - Map localVarFormParams = new HashMap(); - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); - - final String[] localVarContentTypes = { - "application/json" - }; - final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - localVarHeaderParams.put("Content-Type", localVarContentType); - - if(progressListener != null) { - apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { - @Override - public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { - com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); - return originalResponse.newBuilder() - .body(new ProgressResponseBody(originalResponse.body(), progressListener)) - .build(); - } - }); - } - - String[] localVarAuthNames = new String[] { }; - return apiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); - } - - @SuppressWarnings("rawtypes") - private com.squareup.okhttp.Call getClientTokenValidateBeforeCall(GetClientTokenParams body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { - - com.squareup.okhttp.Call call = getClientTokenCall(body, progressListener, progressRequestListener); - return call; - - - - - - } - - /** - * Get Client Token - * Gets Client Token - * @param body (optional) - * @return GetClientTokenResponse - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - */ - public GetClientTokenResponse getClientToken(GetClientTokenParams body) throws ApiException { - ApiResponse resp = getClientTokenWithHttpInfo(body); - return resp.getData(); - } - - /** - * Get Client Token - * Gets Client Token - * @param body (optional) - * @return ApiResponse<GetClientTokenResponse> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - */ - public ApiResponse getClientTokenWithHttpInfo(GetClientTokenParams body) throws ApiException { - com.squareup.okhttp.Call call = getClientTokenValidateBeforeCall(body, null, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return apiClient.execute(call, localVarReturnType); - } - - /** - * Get Client Token (asynchronously) - * Gets Client Token - * @param body (optional) - * @param callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object - */ - public com.squareup.okhttp.Call getClientTokenAsync(GetClientTokenParams body, final ApiCallback callback) throws ApiException { - - ProgressResponseBody.ProgressListener progressListener = null; - ProgressRequestBody.ProgressRequestListener progressRequestListener = null; - - if (callback != null) { - progressListener = new ProgressResponseBody.ProgressListener() { - @Override - public void update(long bytesRead, long contentLength, boolean done) { - callback.onDownloadProgress(bytesRead, contentLength, done); - } - }; - - progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { - @Override - public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { - callback.onUploadProgress(bytesWritten, contentLength, done); - } - }; - } - - com.squareup.okhttp.Call call = getClientTokenValidateBeforeCall(body, progressListener, progressRequestListener); - Type localVarReturnType = new TypeToken(){}.getType(); - apiClient.executeAsync(call, localVarReturnType, callback); - return call; - } - /** - * Build call for getDiscovery - * @param body (optional) - * @param progressListener Progress listener - * @param progressRequestListener Progress request listener - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - */ - public com.squareup.okhttp.Call getDiscoveryCall(GetDiscoveryParams body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { - Object localVarPostBody = body; - - // create path and map variables - String localVarPath = "/get-discovery"; - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - - Map localVarHeaderParams = new HashMap(); - - Map localVarFormParams = new HashMap(); - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); - - final String[] localVarContentTypes = { - "application/json" - }; - final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - localVarHeaderParams.put("Content-Type", localVarContentType); - - if(progressListener != null) { - apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { - @Override - public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { - com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); - return originalResponse.newBuilder() - .body(new ProgressResponseBody(originalResponse.body(), progressListener)) - .build(); - } - }); - } - - String[] localVarAuthNames = new String[] { }; - return apiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); - } - - @SuppressWarnings("rawtypes") - private com.squareup.okhttp.Call getDiscoveryValidateBeforeCall(GetDiscoveryParams body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { - - com.squareup.okhttp.Call call = getDiscoveryCall(body, progressListener, progressRequestListener); - return call; - - - - - - } - - /** - * Get OP Discovery Configuration - * Get OP Discovery Configuration - * @param body (optional) - * @return GetDiscoveryResponse - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - */ - public GetDiscoveryResponse getDiscovery(GetDiscoveryParams body) throws ApiException { - ApiResponse resp = getDiscoveryWithHttpInfo(body); - return resp.getData(); - } - - /** - * Get OP Discovery Configuration - * Get OP Discovery Configuration - * @param body (optional) - * @return ApiResponse<GetDiscoveryResponse> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - */ - public ApiResponse getDiscoveryWithHttpInfo(GetDiscoveryParams body) throws ApiException { - com.squareup.okhttp.Call call = getDiscoveryValidateBeforeCall(body, null, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return apiClient.execute(call, localVarReturnType); - } - - /** - * Get OP Discovery Configuration (asynchronously) - * Get OP Discovery Configuration - * @param body (optional) - * @param callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object - */ - public com.squareup.okhttp.Call getDiscoveryAsync(GetDiscoveryParams body, final ApiCallback callback) throws ApiException { - - ProgressResponseBody.ProgressListener progressListener = null; - ProgressRequestBody.ProgressRequestListener progressRequestListener = null; - - if (callback != null) { - progressListener = new ProgressResponseBody.ProgressListener() { - @Override - public void update(long bytesRead, long contentLength, boolean done) { - callback.onDownloadProgress(bytesRead, contentLength, done); - } - }; - - progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { - @Override - public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { - callback.onUploadProgress(bytesWritten, contentLength, done); - } - }; - } - - com.squareup.okhttp.Call call = getDiscoveryValidateBeforeCall(body, progressListener, progressRequestListener); - Type localVarReturnType = new TypeToken(){}.getType(); - apiClient.executeAsync(call, localVarReturnType, callback); - return call; - } - /** - * Build call for getIssuer - * @param body (optional) - * @param progressListener Progress listener - * @param progressRequestListener Progress request listener - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - */ - public com.squareup.okhttp.Call getIssuerCall(GetIssuerParams body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { - Object localVarPostBody = body; - - // create path and map variables - String localVarPath = "/get-issuer"; - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - - Map localVarHeaderParams = new HashMap(); - - Map localVarFormParams = new HashMap(); - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); - - final String[] localVarContentTypes = { - "application/json" - }; - final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - localVarHeaderParams.put("Content-Type", localVarContentType); - - if(progressListener != null) { - apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { - @Override - public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { - com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); - return originalResponse.newBuilder() - .body(new ProgressResponseBody(originalResponse.body(), progressListener)) - .build(); - } - }); - } - - String[] localVarAuthNames = new String[] { }; - return apiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); - } - - @SuppressWarnings("rawtypes") - private com.squareup.okhttp.Call getIssuerValidateBeforeCall(GetIssuerParams body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { - - com.squareup.okhttp.Call call = getIssuerCall(body, progressListener, progressRequestListener); - return call; - - - - - - } - - /** - * Get Issuer - * Get Issuer - * @param body (optional) - * @return GetIssuerResponse - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - */ - public GetIssuerResponse getIssuer(GetIssuerParams body) throws ApiException { - ApiResponse resp = getIssuerWithHttpInfo(body); - return resp.getData(); - } - - /** - * Get Issuer - * Get Issuer - * @param body (optional) - * @return ApiResponse<GetIssuerResponse> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - */ - public ApiResponse getIssuerWithHttpInfo(GetIssuerParams body) throws ApiException { - com.squareup.okhttp.Call call = getIssuerValidateBeforeCall(body, null, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return apiClient.execute(call, localVarReturnType); - } - - /** - * Get Issuer (asynchronously) - * Get Issuer - * @param body (optional) - * @param callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object - */ - public com.squareup.okhttp.Call getIssuerAsync(GetIssuerParams body, final ApiCallback callback) throws ApiException { - - ProgressResponseBody.ProgressListener progressListener = null; - ProgressRequestBody.ProgressRequestListener progressRequestListener = null; - - if (callback != null) { - progressListener = new ProgressResponseBody.ProgressListener() { - @Override - public void update(long bytesRead, long contentLength, boolean done) { - callback.onDownloadProgress(bytesRead, contentLength, done); - } - }; - - progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { - @Override - public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { - callback.onUploadProgress(bytesWritten, contentLength, done); - } - }; - } - - com.squareup.okhttp.Call call = getIssuerValidateBeforeCall(body, progressListener, progressRequestListener); - Type localVarReturnType = new TypeToken(){}.getType(); - apiClient.executeAsync(call, localVarReturnType, callback); - return call; - } - /** - * Build call for getJsonWebKeySet - * @param body (optional) - * @param authorization (optional) - * @param authorizationRpId (optional) - * @param progressListener Progress listener - * @param progressRequestListener Progress request listener - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - */ - public com.squareup.okhttp.Call getJsonWebKeySetCall(GetJwksParams body, String authorization, String authorizationRpId, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { - Object localVarPostBody = body; - - // create path and map variables - String localVarPath = "/get-jwks"; - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - - Map localVarHeaderParams = new HashMap(); - if (authorization != null) - localVarHeaderParams.put("Authorization", apiClient.parameterToString(authorization)); - if (authorizationRpId != null) - localVarHeaderParams.put("AuthorizationRpId", apiClient.parameterToString(authorizationRpId)); - - Map localVarFormParams = new HashMap(); - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); - - final String[] localVarContentTypes = { - "application/json" - }; - final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - localVarHeaderParams.put("Content-Type", localVarContentType); - - if(progressListener != null) { - apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { - @Override - public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { - com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); - return originalResponse.newBuilder() - .body(new ProgressResponseBody(originalResponse.body(), progressListener)) - .build(); - } - }); - } - - String[] localVarAuthNames = new String[] { }; - return apiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); - } - - @SuppressWarnings("rawtypes") - private com.squareup.okhttp.Call getJsonWebKeySetValidateBeforeCall(GetJwksParams body, String authorization, String authorizationRpId, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { - - com.squareup.okhttp.Call call = getJsonWebKeySetCall(body, authorization, authorizationRpId, progressListener, progressRequestListener); - return call; - - - - - - } - - /** - * Get JSON Web Key Set - * Get JSON Web Key Set - * @param body (optional) - * @param authorization (optional) - * @param authorizationRpId (optional) - * @return GetJwksResponse - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - */ - public GetJwksResponse getJsonWebKeySet(GetJwksParams body, String authorization, String authorizationRpId) throws ApiException { - ApiResponse resp = getJsonWebKeySetWithHttpInfo(body, authorization, authorizationRpId); - return resp.getData(); - } - - /** - * Get JSON Web Key Set - * Get JSON Web Key Set - * @param body (optional) - * @param authorization (optional) - * @param authorizationRpId (optional) - * @return ApiResponse<GetJwksResponse> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - */ - public ApiResponse getJsonWebKeySetWithHttpInfo(GetJwksParams body, String authorization, String authorizationRpId) throws ApiException { - com.squareup.okhttp.Call call = getJsonWebKeySetValidateBeforeCall(body, authorization, authorizationRpId, null, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return apiClient.execute(call, localVarReturnType); - } - - /** - * Get JSON Web Key Set (asynchronously) - * Get JSON Web Key Set - * @param body (optional) - * @param authorization (optional) - * @param authorizationRpId (optional) - * @param callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object - */ - public com.squareup.okhttp.Call getJsonWebKeySetAsync(GetJwksParams body, String authorization, String authorizationRpId, final ApiCallback callback) throws ApiException { - - ProgressResponseBody.ProgressListener progressListener = null; - ProgressRequestBody.ProgressRequestListener progressRequestListener = null; - - if (callback != null) { - progressListener = new ProgressResponseBody.ProgressListener() { - @Override - public void update(long bytesRead, long contentLength, boolean done) { - callback.onDownloadProgress(bytesRead, contentLength, done); - } - }; - - progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { - @Override - public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { - callback.onUploadProgress(bytesWritten, contentLength, done); - } - }; - } - - com.squareup.okhttp.Call call = getJsonWebKeySetValidateBeforeCall(body, authorization, authorizationRpId, progressListener, progressRequestListener); - Type localVarReturnType = new TypeToken(){}.getType(); - apiClient.executeAsync(call, localVarReturnType, callback); - return call; - } - /** - * Build call for getLogoutUri - * @param body (optional) - * @param authorization (optional) - * @param authorizationRpId (optional) - * @param progressListener Progress listener - * @param progressRequestListener Progress request listener - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - */ - public com.squareup.okhttp.Call getLogoutUriCall(GetLogoutUriParams body, String authorization, String authorizationRpId, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { - Object localVarPostBody = body; - - // create path and map variables - String localVarPath = "/get-logout-uri"; - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - - Map localVarHeaderParams = new HashMap(); - if (authorization != null) - localVarHeaderParams.put("Authorization", apiClient.parameterToString(authorization)); - if (authorizationRpId != null) - localVarHeaderParams.put("AuthorizationRpId", apiClient.parameterToString(authorizationRpId)); - - Map localVarFormParams = new HashMap(); - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); - - final String[] localVarContentTypes = { - "application/json" - }; - final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - localVarHeaderParams.put("Content-Type", localVarContentType); - - if(progressListener != null) { - apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { - @Override - public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { - com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); - return originalResponse.newBuilder() - .body(new ProgressResponseBody(originalResponse.body(), progressListener)) - .build(); - } - }); - } - - String[] localVarAuthNames = new String[] { }; - return apiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); - } - - @SuppressWarnings("rawtypes") - private com.squareup.okhttp.Call getLogoutUriValidateBeforeCall(GetLogoutUriParams body, String authorization, String authorizationRpId, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { - - com.squareup.okhttp.Call call = getLogoutUriCall(body, authorization, authorizationRpId, progressListener, progressRequestListener); - return call; - - - - - - } - - /** - * Get Logout URL - * Get Logout URL - * @param body (optional) - * @param authorization (optional) - * @param authorizationRpId (optional) - * @return GetLogoutUriResponse - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - */ - public GetLogoutUriResponse getLogoutUri(GetLogoutUriParams body, String authorization, String authorizationRpId) throws ApiException { - ApiResponse resp = getLogoutUriWithHttpInfo(body, authorization, authorizationRpId); - return resp.getData(); - } - - /** - * Get Logout URL - * Get Logout URL - * @param body (optional) - * @param authorization (optional) - * @param authorizationRpId (optional) - * @return ApiResponse<GetLogoutUriResponse> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - */ - public ApiResponse getLogoutUriWithHttpInfo(GetLogoutUriParams body, String authorization, String authorizationRpId) throws ApiException { - com.squareup.okhttp.Call call = getLogoutUriValidateBeforeCall(body, authorization, authorizationRpId, null, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return apiClient.execute(call, localVarReturnType); - } - - /** - * Get Logout URL (asynchronously) - * Get Logout URL - * @param body (optional) - * @param authorization (optional) - * @param authorizationRpId (optional) - * @param callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object - */ - public com.squareup.okhttp.Call getLogoutUriAsync(GetLogoutUriParams body, String authorization, String authorizationRpId, final ApiCallback callback) throws ApiException { - - ProgressResponseBody.ProgressListener progressListener = null; - ProgressRequestBody.ProgressRequestListener progressRequestListener = null; - - if (callback != null) { - progressListener = new ProgressResponseBody.ProgressListener() { - @Override - public void update(long bytesRead, long contentLength, boolean done) { - callback.onDownloadProgress(bytesRead, contentLength, done); - } - }; - - progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { - @Override - public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { - callback.onUploadProgress(bytesWritten, contentLength, done); - } - }; - } - - com.squareup.okhttp.Call call = getLogoutUriValidateBeforeCall(body, authorization, authorizationRpId, progressListener, progressRequestListener); - Type localVarReturnType = new TypeToken(){}.getType(); - apiClient.executeAsync(call, localVarReturnType, callback); - return call; - } - /** - * Build call for getRequestObject - * @param requestObjectId request object id (required) - * @param progressListener Progress listener - * @param progressRequestListener Progress request listener - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - */ - public com.squareup.okhttp.Call getRequestObjectCall(String requestObjectId, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { - Object localVarPostBody = null; - - // create path and map variables - String localVarPath = "/get-request-object/{request_object_id}" - .replaceAll("\\{" + "request_object_id" + "\\}", apiClient.escapeString(requestObjectId.toString())); - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - - Map localVarHeaderParams = new HashMap(); - - Map localVarFormParams = new HashMap(); - - final String[] localVarAccepts = { - "text/plain" - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); - - final String[] localVarContentTypes = { - - }; - final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - localVarHeaderParams.put("Content-Type", localVarContentType); - - if(progressListener != null) { - apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { - @Override - public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { - com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); - return originalResponse.newBuilder() - .body(new ProgressResponseBody(originalResponse.body(), progressListener)) - .build(); - } - }); - } - - String[] localVarAuthNames = new String[] { }; - return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); - } - - @SuppressWarnings("rawtypes") - private com.squareup.okhttp.Call getRequestObjectValidateBeforeCall(String requestObjectId, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { - // verify the required parameter 'requestObjectId' is set - if (requestObjectId == null) { - throw new ApiException("Missing the required parameter 'requestObjectId' when calling getRequestObject(Async)"); - } - - com.squareup.okhttp.Call call = getRequestObjectCall(requestObjectId, progressListener, progressRequestListener); - return call; - - - - - - } - - /** - * Get Request Object - * Get Request Object - * @param requestObjectId request object id (required) - * @return String - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - */ - public String getRequestObject(String requestObjectId) throws ApiException { - ApiResponse resp = getRequestObjectWithHttpInfo(requestObjectId); - return resp.getData(); - } - - /** - * Get Request Object - * Get Request Object - * @param requestObjectId request object id (required) - * @return ApiResponse<String> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - */ - public ApiResponse getRequestObjectWithHttpInfo(String requestObjectId) throws ApiException { - com.squareup.okhttp.Call call = getRequestObjectValidateBeforeCall(requestObjectId, null, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return apiClient.execute(call, localVarReturnType); - } - - /** - * Get Request Object (asynchronously) - * Get Request Object - * @param requestObjectId request object id (required) - * @param callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object - */ - public com.squareup.okhttp.Call getRequestObjectAsync(String requestObjectId, final ApiCallback callback) throws ApiException { - - ProgressResponseBody.ProgressListener progressListener = null; - ProgressRequestBody.ProgressRequestListener progressRequestListener = null; - - if (callback != null) { - progressListener = new ProgressResponseBody.ProgressListener() { - @Override - public void update(long bytesRead, long contentLength, boolean done) { - callback.onDownloadProgress(bytesRead, contentLength, done); - } - }; - - progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { - @Override - public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { - callback.onUploadProgress(bytesWritten, contentLength, done); - } - }; - } - - com.squareup.okhttp.Call call = getRequestObjectValidateBeforeCall(requestObjectId, progressListener, progressRequestListener); - Type localVarReturnType = new TypeToken(){}.getType(); - apiClient.executeAsync(call, localVarReturnType, callback); - return call; - } - /** - * Build call for getRequestObjectUri - * @param body (optional) - * @param authorization (optional) - * @param authorizationRpId (optional) - * @param progressListener Progress listener - * @param progressRequestListener Progress request listener - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - */ - public com.squareup.okhttp.Call getRequestObjectUriCall(GetRequestObjectUriParams body, String authorization, String authorizationRpId, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { - Object localVarPostBody = body; - - // create path and map variables - String localVarPath = "/get-request-object-uri"; - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - - Map localVarHeaderParams = new HashMap(); - if (authorization != null) - localVarHeaderParams.put("Authorization", apiClient.parameterToString(authorization)); - if (authorizationRpId != null) - localVarHeaderParams.put("AuthorizationRpId", apiClient.parameterToString(authorizationRpId)); - - Map localVarFormParams = new HashMap(); - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); - - final String[] localVarContentTypes = { - "application/json" - }; - final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - localVarHeaderParams.put("Content-Type", localVarContentType); - - if(progressListener != null) { - apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { - @Override - public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { - com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); - return originalResponse.newBuilder() - .body(new ProgressResponseBody(originalResponse.body(), progressListener)) - .build(); - } - }); - } - - String[] localVarAuthNames = new String[] { }; - return apiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); - } - - @SuppressWarnings("rawtypes") - private com.squareup.okhttp.Call getRequestObjectUriValidateBeforeCall(GetRequestObjectUriParams body, String authorization, String authorizationRpId, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { - - com.squareup.okhttp.Call call = getRequestObjectUriCall(body, authorization, authorizationRpId, progressListener, progressRequestListener); - return call; - - - - - - } - - /** - * Get Request Object Uri - * Get Request Object Uri - * @param body (optional) - * @param authorization (optional) - * @param authorizationRpId (optional) - * @return GetRequestObjectUriResponse - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - */ - public GetRequestObjectUriResponse getRequestObjectUri(GetRequestObjectUriParams body, String authorization, String authorizationRpId) throws ApiException { - ApiResponse resp = getRequestObjectUriWithHttpInfo(body, authorization, authorizationRpId); - return resp.getData(); - } - - /** - * Get Request Object Uri - * Get Request Object Uri - * @param body (optional) - * @param authorization (optional) - * @param authorizationRpId (optional) - * @return ApiResponse<GetRequestObjectUriResponse> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - */ - public ApiResponse getRequestObjectUriWithHttpInfo(GetRequestObjectUriParams body, String authorization, String authorizationRpId) throws ApiException { - com.squareup.okhttp.Call call = getRequestObjectUriValidateBeforeCall(body, authorization, authorizationRpId, null, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return apiClient.execute(call, localVarReturnType); - } - - /** - * Get Request Object Uri (asynchronously) - * Get Request Object Uri - * @param body (optional) - * @param authorization (optional) - * @param authorizationRpId (optional) - * @param callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object - */ - public com.squareup.okhttp.Call getRequestObjectUriAsync(GetRequestObjectUriParams body, String authorization, String authorizationRpId, final ApiCallback callback) throws ApiException { - - ProgressResponseBody.ProgressListener progressListener = null; - ProgressRequestBody.ProgressRequestListener progressRequestListener = null; - - if (callback != null) { - progressListener = new ProgressResponseBody.ProgressListener() { - @Override - public void update(long bytesRead, long contentLength, boolean done) { - callback.onDownloadProgress(bytesRead, contentLength, done); - } - }; - - progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { - @Override - public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { - callback.onUploadProgress(bytesWritten, contentLength, done); - } - }; - } - - com.squareup.okhttp.Call call = getRequestObjectUriValidateBeforeCall(body, authorization, authorizationRpId, progressListener, progressRequestListener); - Type localVarReturnType = new TypeToken(){}.getType(); - apiClient.executeAsync(call, localVarReturnType, callback); - return call; - } - /** - * Build call for getRpJwks - * @param progressListener Progress listener - * @param progressRequestListener Progress request listener - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - */ - public com.squareup.okhttp.Call getRpJwksCall(final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { - Object localVarPostBody = null; - - // create path and map variables - String localVarPath = "/get-rp-jwks"; - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - - Map localVarHeaderParams = new HashMap(); - - Map localVarFormParams = new HashMap(); - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); - - final String[] localVarContentTypes = { - - }; - final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - localVarHeaderParams.put("Content-Type", localVarContentType); - - if(progressListener != null) { - apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { - @Override - public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { - com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); - return originalResponse.newBuilder() - .body(new ProgressResponseBody(originalResponse.body(), progressListener)) - .build(); - } - }); - } - - String[] localVarAuthNames = new String[] { }; - return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); - } - - @SuppressWarnings("rawtypes") - private com.squareup.okhttp.Call getRpJwksValidateBeforeCall(final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { - - com.squareup.okhttp.Call call = getRpJwksCall(progressListener, progressRequestListener); - return call; - - - - - - } - - /** - * Get Rp JWKS - * Get Rp JWKS - * @return GetRpJwksResponse - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - */ - public GetRpJwksResponse getRpJwks() throws ApiException { - ApiResponse resp = getRpJwksWithHttpInfo(); - return resp.getData(); - } - - /** - * Get Rp JWKS - * Get Rp JWKS - * @return ApiResponse<GetRpJwksResponse> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - */ - public ApiResponse getRpJwksWithHttpInfo() throws ApiException { - com.squareup.okhttp.Call call = getRpJwksValidateBeforeCall(null, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return apiClient.execute(call, localVarReturnType); - } - - /** - * Get Rp JWKS (asynchronously) - * Get Rp JWKS - * @param callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object - */ - public com.squareup.okhttp.Call getRpJwksAsync(final ApiCallback callback) throws ApiException { - - ProgressResponseBody.ProgressListener progressListener = null; - ProgressRequestBody.ProgressRequestListener progressRequestListener = null; - - if (callback != null) { - progressListener = new ProgressResponseBody.ProgressListener() { - @Override - public void update(long bytesRead, long contentLength, boolean done) { - callback.onDownloadProgress(bytesRead, contentLength, done); - } - }; - - progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { - @Override - public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { - callback.onUploadProgress(bytesWritten, contentLength, done); - } - }; - } - - com.squareup.okhttp.Call call = getRpJwksValidateBeforeCall(progressListener, progressRequestListener); - Type localVarReturnType = new TypeToken(){}.getType(); - apiClient.executeAsync(call, localVarReturnType, callback); - return call; - } - /** - * Build call for getTokensByCode - * @param body (optional) - * @param authorization (optional) - * @param authorizationRpId (optional) - * @param progressListener Progress listener - * @param progressRequestListener Progress request listener - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - */ - public com.squareup.okhttp.Call getTokensByCodeCall(GetTokensByCodeParams body, String authorization, String authorizationRpId, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { - Object localVarPostBody = body; - - // create path and map variables - String localVarPath = "/get-tokens-by-code"; - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - - Map localVarHeaderParams = new HashMap(); - if (authorization != null) - localVarHeaderParams.put("Authorization", apiClient.parameterToString(authorization)); - if (authorizationRpId != null) - localVarHeaderParams.put("AuthorizationRpId", apiClient.parameterToString(authorizationRpId)); - - Map localVarFormParams = new HashMap(); - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); - - final String[] localVarContentTypes = { - "application/json" - }; - final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - localVarHeaderParams.put("Content-Type", localVarContentType); - - if(progressListener != null) { - apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { - @Override - public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { - com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); - return originalResponse.newBuilder() - .body(new ProgressResponseBody(originalResponse.body(), progressListener)) - .build(); - } - }); - } - - String[] localVarAuthNames = new String[] { }; - return apiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); - } - - @SuppressWarnings("rawtypes") - private com.squareup.okhttp.Call getTokensByCodeValidateBeforeCall(GetTokensByCodeParams body, String authorization, String authorizationRpId, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { - - com.squareup.okhttp.Call call = getTokensByCodeCall(body, authorization, authorizationRpId, progressListener, progressRequestListener); - return call; - - - - - - } - - /** - * Get Tokens By Code - * Get tokens by code - * @param body (optional) - * @param authorization (optional) - * @param authorizationRpId (optional) - * @return GetTokensByCodeResponse - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - */ - public GetTokensByCodeResponse getTokensByCode(GetTokensByCodeParams body, String authorization, String authorizationRpId) throws ApiException { - ApiResponse resp = getTokensByCodeWithHttpInfo(body, authorization, authorizationRpId); - return resp.getData(); - } - - /** - * Get Tokens By Code - * Get tokens by code - * @param body (optional) - * @param authorization (optional) - * @param authorizationRpId (optional) - * @return ApiResponse<GetTokensByCodeResponse> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - */ - public ApiResponse getTokensByCodeWithHttpInfo(GetTokensByCodeParams body, String authorization, String authorizationRpId) throws ApiException { - com.squareup.okhttp.Call call = getTokensByCodeValidateBeforeCall(body, authorization, authorizationRpId, null, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return apiClient.execute(call, localVarReturnType); - } - - /** - * Get Tokens By Code (asynchronously) - * Get tokens by code - * @param body (optional) - * @param authorization (optional) - * @param authorizationRpId (optional) - * @param callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object - */ - public com.squareup.okhttp.Call getTokensByCodeAsync(GetTokensByCodeParams body, String authorization, String authorizationRpId, final ApiCallback callback) throws ApiException { - - ProgressResponseBody.ProgressListener progressListener = null; - ProgressRequestBody.ProgressRequestListener progressRequestListener = null; - - if (callback != null) { - progressListener = new ProgressResponseBody.ProgressListener() { - @Override - public void update(long bytesRead, long contentLength, boolean done) { - callback.onDownloadProgress(bytesRead, contentLength, done); - } - }; - - progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { - @Override - public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { - callback.onUploadProgress(bytesWritten, contentLength, done); - } - }; - } - - com.squareup.okhttp.Call call = getTokensByCodeValidateBeforeCall(body, authorization, authorizationRpId, progressListener, progressRequestListener); - Type localVarReturnType = new TypeToken(){}.getType(); - apiClient.executeAsync(call, localVarReturnType, callback); - return call; - } - /** - * Build call for getUserInfo - * @param body (optional) - * @param authorization (optional) - * @param authorizationRpId (optional) - * @param progressListener Progress listener - * @param progressRequestListener Progress request listener - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - */ - public com.squareup.okhttp.Call getUserInfoCall(GetUserInfoParams body, String authorization, String authorizationRpId, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { - Object localVarPostBody = body; - - // create path and map variables - String localVarPath = "/get-user-info"; - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - - Map localVarHeaderParams = new HashMap(); - if (authorization != null) - localVarHeaderParams.put("Authorization", apiClient.parameterToString(authorization)); - if (authorizationRpId != null) - localVarHeaderParams.put("AuthorizationRpId", apiClient.parameterToString(authorizationRpId)); - - Map localVarFormParams = new HashMap(); - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); - - final String[] localVarContentTypes = { - "application/json" - }; - final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - localVarHeaderParams.put("Content-Type", localVarContentType); - - if(progressListener != null) { - apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { - @Override - public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { - com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); - return originalResponse.newBuilder() - .body(new ProgressResponseBody(originalResponse.body(), progressListener)) - .build(); - } - }); - } - - String[] localVarAuthNames = new String[] { }; - return apiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); - } - - @SuppressWarnings("rawtypes") - private com.squareup.okhttp.Call getUserInfoValidateBeforeCall(GetUserInfoParams body, String authorization, String authorizationRpId, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { - - com.squareup.okhttp.Call call = getUserInfoCall(body, authorization, authorizationRpId, progressListener, progressRequestListener); - return call; - - - - - - } - - /** - * Get User Info - * Get User Info - * @param body (optional) - * @param authorization (optional) - * @param authorizationRpId (optional) - * @return Map<String, Object> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - */ - public Map getUserInfo(GetUserInfoParams body, String authorization, String authorizationRpId) throws ApiException { - ApiResponse> resp = getUserInfoWithHttpInfo(body, authorization, authorizationRpId); - return resp.getData(); - } - - /** - * Get User Info - * Get User Info - * @param body (optional) - * @param authorization (optional) - * @param authorizationRpId (optional) - * @return ApiResponse<Map<String, Object>> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - */ - public ApiResponse> getUserInfoWithHttpInfo(GetUserInfoParams body, String authorization, String authorizationRpId) throws ApiException { - com.squareup.okhttp.Call call = getUserInfoValidateBeforeCall(body, authorization, authorizationRpId, null, null); - Type localVarReturnType = new TypeToken>(){}.getType(); - return apiClient.execute(call, localVarReturnType); - } - - /** - * Get User Info (asynchronously) - * Get User Info - * @param body (optional) - * @param authorization (optional) - * @param authorizationRpId (optional) - * @param callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object - */ - public com.squareup.okhttp.Call getUserInfoAsync(GetUserInfoParams body, String authorization, String authorizationRpId, final ApiCallback> callback) throws ApiException { - - ProgressResponseBody.ProgressListener progressListener = null; - ProgressRequestBody.ProgressRequestListener progressRequestListener = null; - - if (callback != null) { - progressListener = new ProgressResponseBody.ProgressListener() { - @Override - public void update(long bytesRead, long contentLength, boolean done) { - callback.onDownloadProgress(bytesRead, contentLength, done); - } - }; - - progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { - @Override - public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { - callback.onUploadProgress(bytesWritten, contentLength, done); - } - }; - } - - com.squareup.okhttp.Call call = getUserInfoValidateBeforeCall(body, authorization, authorizationRpId, progressListener, progressRequestListener); - Type localVarReturnType = new TypeToken>(){}.getType(); - apiClient.executeAsync(call, localVarReturnType, callback); - return call; - } - /** - * Build call for healthCheck - * @param progressListener Progress listener - * @param progressRequestListener Progress request listener - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - */ - public com.squareup.okhttp.Call healthCheckCall(final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { - Object localVarPostBody = null; - - // create path and map variables - String localVarPath = "/health-check"; - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - - Map localVarHeaderParams = new HashMap(); - - Map localVarFormParams = new HashMap(); - - final String[] localVarAccepts = { - - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); - - final String[] localVarContentTypes = { - - }; - final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - localVarHeaderParams.put("Content-Type", localVarContentType); - - if(progressListener != null) { - apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { - @Override - public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { - com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); - return originalResponse.newBuilder() - .body(new ProgressResponseBody(originalResponse.body(), progressListener)) - .build(); - } - }); - } - - String[] localVarAuthNames = new String[] { }; - return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); - } - - @SuppressWarnings("rawtypes") - private com.squareup.okhttp.Call healthCheckValidateBeforeCall(final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { - - com.squareup.okhttp.Call call = healthCheckCall(progressListener, progressRequestListener); - return call; - - - - - - } - - /** - * Health Check - * Health Check endpoint is for quick check whether jans-client-api is alive. - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - */ - public void healthCheck() throws ApiException { - healthCheckWithHttpInfo(); - } - - /** - * Health Check - * Health Check endpoint is for quick check whether jans-client-api is alive. - * @return ApiResponse<Void> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - */ - public ApiResponse healthCheckWithHttpInfo() throws ApiException { - com.squareup.okhttp.Call call = healthCheckValidateBeforeCall(null, null); - return apiClient.execute(call); - } - - /** - * Health Check (asynchronously) - * Health Check endpoint is for quick check whether jans-client-api is alive. - * @param callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object - */ - public com.squareup.okhttp.Call healthCheckAsync(final ApiCallback callback) throws ApiException { - - ProgressResponseBody.ProgressListener progressListener = null; - ProgressRequestBody.ProgressRequestListener progressRequestListener = null; - - if (callback != null) { - progressListener = new ProgressResponseBody.ProgressListener() { - @Override - public void update(long bytesRead, long contentLength, boolean done) { - callback.onDownloadProgress(bytesRead, contentLength, done); - } - }; - - progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { - @Override - public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { - callback.onUploadProgress(bytesWritten, contentLength, done); - } - }; - } - - com.squareup.okhttp.Call call = healthCheckValidateBeforeCall(progressListener, progressRequestListener); - apiClient.executeAsync(call, callback); - return call; - } - /** - * Build call for introspectAccessToken - * @param body (optional) - * @param authorization (optional) - * @param authorizationRpId (optional) - * @param progressListener Progress listener - * @param progressRequestListener Progress request listener - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - */ - public com.squareup.okhttp.Call introspectAccessTokenCall(IntrospectAccessTokenParams body, String authorization, String authorizationRpId, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { - Object localVarPostBody = body; - - // create path and map variables - String localVarPath = "/introspect-access-token"; - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - - Map localVarHeaderParams = new HashMap(); - if (authorization != null) - localVarHeaderParams.put("Authorization", apiClient.parameterToString(authorization)); - if (authorizationRpId != null) - localVarHeaderParams.put("AuthorizationRpId", apiClient.parameterToString(authorizationRpId)); - - Map localVarFormParams = new HashMap(); - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); - - final String[] localVarContentTypes = { - "application/json" - }; - final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - localVarHeaderParams.put("Content-Type", localVarContentType); - - if(progressListener != null) { - apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { - @Override - public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { - com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); - return originalResponse.newBuilder() - .body(new ProgressResponseBody(originalResponse.body(), progressListener)) - .build(); - } - }); - } - - String[] localVarAuthNames = new String[] { }; - return apiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); - } - - @SuppressWarnings("rawtypes") - private com.squareup.okhttp.Call introspectAccessTokenValidateBeforeCall(IntrospectAccessTokenParams body, String authorization, String authorizationRpId, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { - - com.squareup.okhttp.Call call = introspectAccessTokenCall(body, authorization, authorizationRpId, progressListener, progressRequestListener); - return call; - - - - - - } - - /** - * Introspect Access Token - * Introspect Access Token - * @param body (optional) - * @param authorization (optional) - * @param authorizationRpId (optional) - * @return IntrospectAccessTokenResponse - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - */ - public IntrospectAccessTokenResponse introspectAccessToken(IntrospectAccessTokenParams body, String authorization, String authorizationRpId) throws ApiException { - ApiResponse resp = introspectAccessTokenWithHttpInfo(body, authorization, authorizationRpId); - return resp.getData(); - } - - /** - * Introspect Access Token - * Introspect Access Token - * @param body (optional) - * @param authorization (optional) - * @param authorizationRpId (optional) - * @return ApiResponse<IntrospectAccessTokenResponse> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - */ - public ApiResponse introspectAccessTokenWithHttpInfo(IntrospectAccessTokenParams body, String authorization, String authorizationRpId) throws ApiException { - com.squareup.okhttp.Call call = introspectAccessTokenValidateBeforeCall(body, authorization, authorizationRpId, null, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return apiClient.execute(call, localVarReturnType); - } - - /** - * Introspect Access Token (asynchronously) - * Introspect Access Token - * @param body (optional) - * @param authorization (optional) - * @param authorizationRpId (optional) - * @param callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object - */ - public com.squareup.okhttp.Call introspectAccessTokenAsync(IntrospectAccessTokenParams body, String authorization, String authorizationRpId, final ApiCallback callback) throws ApiException { - - ProgressResponseBody.ProgressListener progressListener = null; - ProgressRequestBody.ProgressRequestListener progressRequestListener = null; - - if (callback != null) { - progressListener = new ProgressResponseBody.ProgressListener() { - @Override - public void update(long bytesRead, long contentLength, boolean done) { - callback.onDownloadProgress(bytesRead, contentLength, done); - } - }; - - progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { - @Override - public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { - callback.onUploadProgress(bytesWritten, contentLength, done); - } - }; - } - - com.squareup.okhttp.Call call = introspectAccessTokenValidateBeforeCall(body, authorization, authorizationRpId, progressListener, progressRequestListener); - Type localVarReturnType = new TypeToken(){}.getType(); - apiClient.executeAsync(call, localVarReturnType, callback); - return call; - } - /** - * Build call for introspectRpt - * @param body (optional) - * @param authorization (optional) - * @param authorizationRpId (optional) - * @param progressListener Progress listener - * @param progressRequestListener Progress request listener - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - */ - public com.squareup.okhttp.Call introspectRptCall(IntrospectRptParams body, String authorization, String authorizationRpId, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { - Object localVarPostBody = body; - - // create path and map variables - String localVarPath = "/introspect-rpt"; - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - - Map localVarHeaderParams = new HashMap(); - if (authorization != null) - localVarHeaderParams.put("Authorization", apiClient.parameterToString(authorization)); - if (authorizationRpId != null) - localVarHeaderParams.put("AuthorizationRpId", apiClient.parameterToString(authorizationRpId)); - - Map localVarFormParams = new HashMap(); - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); - - final String[] localVarContentTypes = { - "application/json" - }; - final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - localVarHeaderParams.put("Content-Type", localVarContentType); - - if(progressListener != null) { - apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { - @Override - public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { - com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); - return originalResponse.newBuilder() - .body(new ProgressResponseBody(originalResponse.body(), progressListener)) - .build(); - } - }); - } - - String[] localVarAuthNames = new String[] { }; - return apiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); - } - - @SuppressWarnings("rawtypes") - private com.squareup.okhttp.Call introspectRptValidateBeforeCall(IntrospectRptParams body, String authorization, String authorizationRpId, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { - - com.squareup.okhttp.Call call = introspectRptCall(body, authorization, authorizationRpId, progressListener, progressRequestListener); - return call; - - - - - - } - - /** - * Introspect RPT - * Introspect RPT - * @param body (optional) - * @param authorization (optional) - * @param authorizationRpId (optional) - * @return IntrospectRptResponse - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - */ - public IntrospectRptResponse introspectRpt(IntrospectRptParams body, String authorization, String authorizationRpId) throws ApiException { - ApiResponse resp = introspectRptWithHttpInfo(body, authorization, authorizationRpId); - return resp.getData(); - } - - /** - * Introspect RPT - * Introspect RPT - * @param body (optional) - * @param authorization (optional) - * @param authorizationRpId (optional) - * @return ApiResponse<IntrospectRptResponse> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - */ - public ApiResponse introspectRptWithHttpInfo(IntrospectRptParams body, String authorization, String authorizationRpId) throws ApiException { - com.squareup.okhttp.Call call = introspectRptValidateBeforeCall(body, authorization, authorizationRpId, null, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return apiClient.execute(call, localVarReturnType); - } - - /** - * Introspect RPT (asynchronously) - * Introspect RPT - * @param body (optional) - * @param authorization (optional) - * @param authorizationRpId (optional) - * @param callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object - */ - public com.squareup.okhttp.Call introspectRptAsync(IntrospectRptParams body, String authorization, String authorizationRpId, final ApiCallback callback) throws ApiException { - - ProgressResponseBody.ProgressListener progressListener = null; - ProgressRequestBody.ProgressRequestListener progressRequestListener = null; - - if (callback != null) { - progressListener = new ProgressResponseBody.ProgressListener() { - @Override - public void update(long bytesRead, long contentLength, boolean done) { - callback.onDownloadProgress(bytesRead, contentLength, done); - } - }; - - progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { - @Override - public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { - callback.onUploadProgress(bytesWritten, contentLength, done); - } - }; - } - - com.squareup.okhttp.Call call = introspectRptValidateBeforeCall(body, authorization, authorizationRpId, progressListener, progressRequestListener); - Type localVarReturnType = new TypeToken(){}.getType(); - apiClient.executeAsync(call, localVarReturnType, callback); - return call; - } - /** - * Build call for registerSite - * @param body (optional) - * @param progressListener Progress listener - * @param progressRequestListener Progress request listener - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - */ - public com.squareup.okhttp.Call registerSiteCall(RegisterSiteParams body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { - Object localVarPostBody = body; - - // create path and map variables - String localVarPath = "/register-site"; - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - - Map localVarHeaderParams = new HashMap(); - - Map localVarFormParams = new HashMap(); - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); - - final String[] localVarContentTypes = { - "application/json" - }; - final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - localVarHeaderParams.put("Content-Type", localVarContentType); - - if(progressListener != null) { - apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { - @Override - public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { - com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); - return originalResponse.newBuilder() - .body(new ProgressResponseBody(originalResponse.body(), progressListener)) - .build(); - } - }); - } - - String[] localVarAuthNames = new String[] { }; - return apiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); - } - - @SuppressWarnings("rawtypes") - private com.squareup.okhttp.Call registerSiteValidateBeforeCall(RegisterSiteParams body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { - - com.squareup.okhttp.Call call = registerSiteCall(body, progressListener, progressRequestListener); - return call; - - - - - - } - - /** - * Register Site - * Registers site at jans-client-api - * @param body (optional) - * @return RegisterSiteResponse - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - */ - public RegisterSiteResponse registerSite(RegisterSiteParams body) throws ApiException { - ApiResponse resp = registerSiteWithHttpInfo(body); - return resp.getData(); - } - - /** - * Register Site - * Registers site at jans-client-api - * @param body (optional) - * @return ApiResponse<RegisterSiteResponse> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - */ - public ApiResponse registerSiteWithHttpInfo(RegisterSiteParams body) throws ApiException { - com.squareup.okhttp.Call call = registerSiteValidateBeforeCall(body, null, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return apiClient.execute(call, localVarReturnType); - } - - /** - * Register Site (asynchronously) - * Registers site at jans-client-api - * @param body (optional) - * @param callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object - */ - public com.squareup.okhttp.Call registerSiteAsync(RegisterSiteParams body, final ApiCallback callback) throws ApiException { - - ProgressResponseBody.ProgressListener progressListener = null; - ProgressRequestBody.ProgressRequestListener progressRequestListener = null; - - if (callback != null) { - progressListener = new ProgressResponseBody.ProgressListener() { - @Override - public void update(long bytesRead, long contentLength, boolean done) { - callback.onDownloadProgress(bytesRead, contentLength, done); - } - }; - - progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { - @Override - public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { - callback.onUploadProgress(bytesWritten, contentLength, done); - } - }; - } - - com.squareup.okhttp.Call call = registerSiteValidateBeforeCall(body, progressListener, progressRequestListener); - Type localVarReturnType = new TypeToken(){}.getType(); - apiClient.executeAsync(call, localVarReturnType, callback); - return call; - } - /** - * Build call for removeSite - * @param body (optional) - * @param authorization (optional) - * @param authorizationRpId (optional) - * @param progressListener Progress listener - * @param progressRequestListener Progress request listener - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - */ - public com.squareup.okhttp.Call removeSiteCall(RemoveSiteParams body, String authorization, String authorizationRpId, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { - Object localVarPostBody = body; - - // create path and map variables - String localVarPath = "/remove-site"; - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - - Map localVarHeaderParams = new HashMap(); - if (authorization != null) - localVarHeaderParams.put("Authorization", apiClient.parameterToString(authorization)); - if (authorizationRpId != null) - localVarHeaderParams.put("AuthorizationRpId", apiClient.parameterToString(authorizationRpId)); - - Map localVarFormParams = new HashMap(); - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); - - final String[] localVarContentTypes = { - "application/json" - }; - final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - localVarHeaderParams.put("Content-Type", localVarContentType); - - if(progressListener != null) { - apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { - @Override - public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { - com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); - return originalResponse.newBuilder() - .body(new ProgressResponseBody(originalResponse.body(), progressListener)) - .build(); - } - }); - } - - String[] localVarAuthNames = new String[] { }; - return apiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); - } - - @SuppressWarnings("rawtypes") - private com.squareup.okhttp.Call removeSiteValidateBeforeCall(RemoveSiteParams body, String authorization, String authorizationRpId, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { - - com.squareup.okhttp.Call call = removeSiteCall(body, authorization, authorizationRpId, progressListener, progressRequestListener); - return call; - - - - - - } - - /** - * Remove Site - * Removes site from jans-client-api - * @param body (optional) - * @param authorization (optional) - * @param authorizationRpId (optional) - * @return RemoveSiteResponse - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - */ - public RemoveSiteResponse removeSite(RemoveSiteParams body, String authorization, String authorizationRpId) throws ApiException { - ApiResponse resp = removeSiteWithHttpInfo(body, authorization, authorizationRpId); - return resp.getData(); - } - - /** - * Remove Site - * Removes site from jans-client-api - * @param body (optional) - * @param authorization (optional) - * @param authorizationRpId (optional) - * @return ApiResponse<RemoveSiteResponse> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - */ - public ApiResponse removeSiteWithHttpInfo(RemoveSiteParams body, String authorization, String authorizationRpId) throws ApiException { - com.squareup.okhttp.Call call = removeSiteValidateBeforeCall(body, authorization, authorizationRpId, null, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return apiClient.execute(call, localVarReturnType); - } - - /** - * Remove Site (asynchronously) - * Removes site from jans-client-api - * @param body (optional) - * @param authorization (optional) - * @param authorizationRpId (optional) - * @param callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object - */ - public com.squareup.okhttp.Call removeSiteAsync(RemoveSiteParams body, String authorization, String authorizationRpId, final ApiCallback callback) throws ApiException { - - ProgressResponseBody.ProgressListener progressListener = null; - ProgressRequestBody.ProgressRequestListener progressRequestListener = null; - - if (callback != null) { - progressListener = new ProgressResponseBody.ProgressListener() { - @Override - public void update(long bytesRead, long contentLength, boolean done) { - callback.onDownloadProgress(bytesRead, contentLength, done); - } - }; - - progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { - @Override - public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { - callback.onUploadProgress(bytesWritten, contentLength, done); - } - }; - } - - com.squareup.okhttp.Call call = removeSiteValidateBeforeCall(body, authorization, authorizationRpId, progressListener, progressRequestListener); - Type localVarReturnType = new TypeToken(){}.getType(); - apiClient.executeAsync(call, localVarReturnType, callback); - return call; - } - /** - * Build call for umaRpGetClaimsGatheringUrl - * @param body (optional) - * @param authorization (optional) - * @param authorizationRpId (optional) - * @param progressListener Progress listener - * @param progressRequestListener Progress request listener - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - */ - public com.squareup.okhttp.Call umaRpGetClaimsGatheringUrlCall(UmaRpGetClaimsGatheringUrlParams body, String authorization, String authorizationRpId, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { - Object localVarPostBody = body; - - // create path and map variables - String localVarPath = "/uma-rp-get-claims-gathering-url"; - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - - Map localVarHeaderParams = new HashMap(); - if (authorization != null) - localVarHeaderParams.put("Authorization", apiClient.parameterToString(authorization)); - if (authorizationRpId != null) - localVarHeaderParams.put("AuthorizationRpId", apiClient.parameterToString(authorizationRpId)); - - Map localVarFormParams = new HashMap(); - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); - - final String[] localVarContentTypes = { - "application/json" - }; - final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - localVarHeaderParams.put("Content-Type", localVarContentType); - - if(progressListener != null) { - apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { - @Override - public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { - com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); - return originalResponse.newBuilder() - .body(new ProgressResponseBody(originalResponse.body(), progressListener)) - .build(); - } - }); - } - - String[] localVarAuthNames = new String[] { }; - return apiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); - } - - @SuppressWarnings("rawtypes") - private com.squareup.okhttp.Call umaRpGetClaimsGatheringUrlValidateBeforeCall(UmaRpGetClaimsGatheringUrlParams body, String authorization, String authorizationRpId, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { - - com.squareup.okhttp.Call call = umaRpGetClaimsGatheringUrlCall(body, authorization, authorizationRpId, progressListener, progressRequestListener); - return call; - - - - - - } - - /** - * UMA RP Get Claims Gathering URL - * UMA RP Get Claims Gathering URL - * @param body (optional) - * @param authorization (optional) - * @param authorizationRpId (optional) - * @return UmaRpGetClaimsGatheringUrlResponse - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - */ - public UmaRpGetClaimsGatheringUrlResponse umaRpGetClaimsGatheringUrl(UmaRpGetClaimsGatheringUrlParams body, String authorization, String authorizationRpId) throws ApiException { - ApiResponse resp = umaRpGetClaimsGatheringUrlWithHttpInfo(body, authorization, authorizationRpId); - return resp.getData(); - } - - /** - * UMA RP Get Claims Gathering URL - * UMA RP Get Claims Gathering URL - * @param body (optional) - * @param authorization (optional) - * @param authorizationRpId (optional) - * @return ApiResponse<UmaRpGetClaimsGatheringUrlResponse> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - */ - public ApiResponse umaRpGetClaimsGatheringUrlWithHttpInfo(UmaRpGetClaimsGatheringUrlParams body, String authorization, String authorizationRpId) throws ApiException { - com.squareup.okhttp.Call call = umaRpGetClaimsGatheringUrlValidateBeforeCall(body, authorization, authorizationRpId, null, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return apiClient.execute(call, localVarReturnType); - } - - /** - * UMA RP Get Claims Gathering URL (asynchronously) - * UMA RP Get Claims Gathering URL - * @param body (optional) - * @param authorization (optional) - * @param authorizationRpId (optional) - * @param callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object - */ - public com.squareup.okhttp.Call umaRpGetClaimsGatheringUrlAsync(UmaRpGetClaimsGatheringUrlParams body, String authorization, String authorizationRpId, final ApiCallback callback) throws ApiException { - - ProgressResponseBody.ProgressListener progressListener = null; - ProgressRequestBody.ProgressRequestListener progressRequestListener = null; - - if (callback != null) { - progressListener = new ProgressResponseBody.ProgressListener() { - @Override - public void update(long bytesRead, long contentLength, boolean done) { - callback.onDownloadProgress(bytesRead, contentLength, done); - } - }; - - progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { - @Override - public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { - callback.onUploadProgress(bytesWritten, contentLength, done); - } - }; - } - - com.squareup.okhttp.Call call = umaRpGetClaimsGatheringUrlValidateBeforeCall(body, authorization, authorizationRpId, progressListener, progressRequestListener); - Type localVarReturnType = new TypeToken(){}.getType(); - apiClient.executeAsync(call, localVarReturnType, callback); - return call; - } - /** - * Build call for umaRpGetRpt - * @param body (optional) - * @param authorization (optional) - * @param authorizationRpId (optional) - * @param progressListener Progress listener - * @param progressRequestListener Progress request listener - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - */ - public com.squareup.okhttp.Call umaRpGetRptCall(UmaRpGetRptParams body, String authorization, String authorizationRpId, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { - Object localVarPostBody = body; - - // create path and map variables - String localVarPath = "/uma-rp-get-rpt"; - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - - Map localVarHeaderParams = new HashMap(); - if (authorization != null) - localVarHeaderParams.put("Authorization", apiClient.parameterToString(authorization)); - if (authorizationRpId != null) - localVarHeaderParams.put("AuthorizationRpId", apiClient.parameterToString(authorizationRpId)); - - Map localVarFormParams = new HashMap(); - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); - - final String[] localVarContentTypes = { - "application/json" - }; - final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - localVarHeaderParams.put("Content-Type", localVarContentType); - - if(progressListener != null) { - apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { - @Override - public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { - com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); - return originalResponse.newBuilder() - .body(new ProgressResponseBody(originalResponse.body(), progressListener)) - .build(); - } - }); - } - - String[] localVarAuthNames = new String[] { }; - return apiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); - } - - @SuppressWarnings("rawtypes") - private com.squareup.okhttp.Call umaRpGetRptValidateBeforeCall(UmaRpGetRptParams body, String authorization, String authorizationRpId, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { - - com.squareup.okhttp.Call call = umaRpGetRptCall(body, authorization, authorizationRpId, progressListener, progressRequestListener); - return call; - - - - - - } - - /** - * UMA RP Get RPT - * UMA RP Get RPT - * @param body (optional) - * @param authorization (optional) - * @param authorizationRpId (optional) - * @return UmaRpGetRptResponse - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - */ - public UmaRpGetRptResponse umaRpGetRpt(UmaRpGetRptParams body, String authorization, String authorizationRpId) throws ApiException { - ApiResponse resp = umaRpGetRptWithHttpInfo(body, authorization, authorizationRpId); - return resp.getData(); - } - - /** - * UMA RP Get RPT - * UMA RP Get RPT - * @param body (optional) - * @param authorization (optional) - * @param authorizationRpId (optional) - * @return ApiResponse<UmaRpGetRptResponse> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - */ - public ApiResponse umaRpGetRptWithHttpInfo(UmaRpGetRptParams body, String authorization, String authorizationRpId) throws ApiException { - com.squareup.okhttp.Call call = umaRpGetRptValidateBeforeCall(body, authorization, authorizationRpId, null, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return apiClient.execute(call, localVarReturnType); - } - - /** - * UMA RP Get RPT (asynchronously) - * UMA RP Get RPT - * @param body (optional) - * @param authorization (optional) - * @param authorizationRpId (optional) - * @param callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object - */ - public com.squareup.okhttp.Call umaRpGetRptAsync(UmaRpGetRptParams body, String authorization, String authorizationRpId, final ApiCallback callback) throws ApiException { - - ProgressResponseBody.ProgressListener progressListener = null; - ProgressRequestBody.ProgressRequestListener progressRequestListener = null; - - if (callback != null) { - progressListener = new ProgressResponseBody.ProgressListener() { - @Override - public void update(long bytesRead, long contentLength, boolean done) { - callback.onDownloadProgress(bytesRead, contentLength, done); - } - }; - - progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { - @Override - public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { - callback.onUploadProgress(bytesWritten, contentLength, done); - } - }; - } - - com.squareup.okhttp.Call call = umaRpGetRptValidateBeforeCall(body, authorization, authorizationRpId, progressListener, progressRequestListener); - Type localVarReturnType = new TypeToken(){}.getType(); - apiClient.executeAsync(call, localVarReturnType, callback); - return call; - } - /** - * Build call for umaRsCheckAccess - * @param body (optional) - * @param authorization (optional) - * @param authorizationRpId (optional) - * @param progressListener Progress listener - * @param progressRequestListener Progress request listener - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - */ - public com.squareup.okhttp.Call umaRsCheckAccessCall(UmaRsCheckAccessParams body, String authorization, String authorizationRpId, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { - Object localVarPostBody = body; - - // create path and map variables - String localVarPath = "/uma-rs-check-access"; - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - - Map localVarHeaderParams = new HashMap(); - if (authorization != null) - localVarHeaderParams.put("Authorization", apiClient.parameterToString(authorization)); - if (authorizationRpId != null) - localVarHeaderParams.put("AuthorizationRpId", apiClient.parameterToString(authorizationRpId)); - - Map localVarFormParams = new HashMap(); - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); - - final String[] localVarContentTypes = { - "application/json" - }; - final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - localVarHeaderParams.put("Content-Type", localVarContentType); - - if(progressListener != null) { - apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { - @Override - public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { - com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); - return originalResponse.newBuilder() - .body(new ProgressResponseBody(originalResponse.body(), progressListener)) - .build(); - } - }); - } - - String[] localVarAuthNames = new String[] { }; - return apiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); - } - - @SuppressWarnings("rawtypes") - private com.squareup.okhttp.Call umaRsCheckAccessValidateBeforeCall(UmaRsCheckAccessParams body, String authorization, String authorizationRpId, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { - - com.squareup.okhttp.Call call = umaRsCheckAccessCall(body, authorization, authorizationRpId, progressListener, progressRequestListener); - return call; - - - - - - } - - /** - * UMA RS Check Access - * UMA RS Check Access - * @param body (optional) - * @param authorization (optional) - * @param authorizationRpId (optional) - * @return UmaRsCheckAccessResponse - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - */ - public UmaRsCheckAccessResponse umaRsCheckAccess(UmaRsCheckAccessParams body, String authorization, String authorizationRpId) throws ApiException { - ApiResponse resp = umaRsCheckAccessWithHttpInfo(body, authorization, authorizationRpId); - return resp.getData(); - } - - /** - * UMA RS Check Access - * UMA RS Check Access - * @param body (optional) - * @param authorization (optional) - * @param authorizationRpId (optional) - * @return ApiResponse<UmaRsCheckAccessResponse> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - */ - public ApiResponse umaRsCheckAccessWithHttpInfo(UmaRsCheckAccessParams body, String authorization, String authorizationRpId) throws ApiException { - com.squareup.okhttp.Call call = umaRsCheckAccessValidateBeforeCall(body, authorization, authorizationRpId, null, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return apiClient.execute(call, localVarReturnType); - } - - /** - * UMA RS Check Access (asynchronously) - * UMA RS Check Access - * @param body (optional) - * @param authorization (optional) - * @param authorizationRpId (optional) - * @param callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object - */ - public com.squareup.okhttp.Call umaRsCheckAccessAsync(UmaRsCheckAccessParams body, String authorization, String authorizationRpId, final ApiCallback callback) throws ApiException { - - ProgressResponseBody.ProgressListener progressListener = null; - ProgressRequestBody.ProgressRequestListener progressRequestListener = null; - - if (callback != null) { - progressListener = new ProgressResponseBody.ProgressListener() { - @Override - public void update(long bytesRead, long contentLength, boolean done) { - callback.onDownloadProgress(bytesRead, contentLength, done); - } - }; - - progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { - @Override - public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { - callback.onUploadProgress(bytesWritten, contentLength, done); - } - }; - } - - com.squareup.okhttp.Call call = umaRsCheckAccessValidateBeforeCall(body, authorization, authorizationRpId, progressListener, progressRequestListener); - Type localVarReturnType = new TypeToken(){}.getType(); - apiClient.executeAsync(call, localVarReturnType, callback); - return call; - } - /** - * Build call for umaRsModify - * @param body (optional) - * @param authorization (optional) - * @param authorizationRpId (optional) - * @param progressListener Progress listener - * @param progressRequestListener Progress request listener - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - */ - public com.squareup.okhttp.Call umaRsModifyCall(UmaRsModifyParams body, String authorization, String authorizationRpId, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { - Object localVarPostBody = body; - - // create path and map variables - String localVarPath = "/uma-rs-modify"; - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - - Map localVarHeaderParams = new HashMap(); - if (authorization != null) - localVarHeaderParams.put("Authorization", apiClient.parameterToString(authorization)); - if (authorizationRpId != null) - localVarHeaderParams.put("AuthorizationRpId", apiClient.parameterToString(authorizationRpId)); - - Map localVarFormParams = new HashMap(); - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); - - final String[] localVarContentTypes = { - "application/json" - }; - final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - localVarHeaderParams.put("Content-Type", localVarContentType); - - if(progressListener != null) { - apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { - @Override - public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { - com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); - return originalResponse.newBuilder() - .body(new ProgressResponseBody(originalResponse.body(), progressListener)) - .build(); - } - }); - } - - String[] localVarAuthNames = new String[] { }; - return apiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); - } - - @SuppressWarnings("rawtypes") - private com.squareup.okhttp.Call umaRsModifyValidateBeforeCall(UmaRsModifyParams body, String authorization, String authorizationRpId, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { - - com.squareup.okhttp.Call call = umaRsModifyCall(body, authorization, authorizationRpId, progressListener, progressRequestListener); - return call; - - - - - - } - - /** - * UMA RS Modify Resources - * UMA RS Modify Resource. This end-point can be used to modify one resource at a time from whole set of UMA resources of cient. - * @param body (optional) - * @param authorization (optional) - * @param authorizationRpId (optional) - * @return UmaRsModifyResponse - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - */ - public UmaRsModifyResponse umaRsModify(UmaRsModifyParams body, String authorization, String authorizationRpId) throws ApiException { - ApiResponse resp = umaRsModifyWithHttpInfo(body, authorization, authorizationRpId); - return resp.getData(); - } - - /** - * UMA RS Modify Resources - * UMA RS Modify Resource. This end-point can be used to modify one resource at a time from whole set of UMA resources of cient. - * @param body (optional) - * @param authorization (optional) - * @param authorizationRpId (optional) - * @return ApiResponse<UmaRsModifyResponse> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - */ - public ApiResponse umaRsModifyWithHttpInfo(UmaRsModifyParams body, String authorization, String authorizationRpId) throws ApiException { - com.squareup.okhttp.Call call = umaRsModifyValidateBeforeCall(body, authorization, authorizationRpId, null, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return apiClient.execute(call, localVarReturnType); - } - - /** - * UMA RS Modify Resources (asynchronously) - * UMA RS Modify Resource. This end-point can be used to modify one resource at a time from whole set of UMA resources of cient. - * @param body (optional) - * @param authorization (optional) - * @param authorizationRpId (optional) - * @param callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object - */ - public com.squareup.okhttp.Call umaRsModifyAsync(UmaRsModifyParams body, String authorization, String authorizationRpId, final ApiCallback callback) throws ApiException { - - ProgressResponseBody.ProgressListener progressListener = null; - ProgressRequestBody.ProgressRequestListener progressRequestListener = null; - - if (callback != null) { - progressListener = new ProgressResponseBody.ProgressListener() { - @Override - public void update(long bytesRead, long contentLength, boolean done) { - callback.onDownloadProgress(bytesRead, contentLength, done); - } - }; - - progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { - @Override - public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { - callback.onUploadProgress(bytesWritten, contentLength, done); - } - }; - } - - com.squareup.okhttp.Call call = umaRsModifyValidateBeforeCall(body, authorization, authorizationRpId, progressListener, progressRequestListener); - Type localVarReturnType = new TypeToken(){}.getType(); - apiClient.executeAsync(call, localVarReturnType, callback); - return call; - } - /** - * Build call for umaRsProtect - * @param body (optional) - * @param authorization (optional) - * @param authorizationRpId (optional) - * @param progressListener Progress listener - * @param progressRequestListener Progress request listener - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - */ - public com.squareup.okhttp.Call umaRsProtectCall(UmaRsProtectParams body, String authorization, String authorizationRpId, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { - Object localVarPostBody = body; - - // create path and map variables - String localVarPath = "/uma-rs-protect"; - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - - Map localVarHeaderParams = new HashMap(); - if (authorization != null) - localVarHeaderParams.put("Authorization", apiClient.parameterToString(authorization)); - if (authorizationRpId != null) - localVarHeaderParams.put("AuthorizationRpId", apiClient.parameterToString(authorizationRpId)); - - Map localVarFormParams = new HashMap(); - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); - - final String[] localVarContentTypes = { - "application/json" - }; - final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - localVarHeaderParams.put("Content-Type", localVarContentType); - - if(progressListener != null) { - apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { - @Override - public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { - com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); - return originalResponse.newBuilder() - .body(new ProgressResponseBody(originalResponse.body(), progressListener)) - .build(); - } - }); - } - - String[] localVarAuthNames = new String[] { }; - return apiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); - } - - @SuppressWarnings("rawtypes") - private com.squareup.okhttp.Call umaRsProtectValidateBeforeCall(UmaRsProtectParams body, String authorization, String authorizationRpId, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { - - com.squareup.okhttp.Call call = umaRsProtectCall(body, authorization, authorizationRpId, progressListener, progressRequestListener); - return call; - - - - - - } - - /** - * UMA RS Protect Resources - * UMA RS Protect Resources. It's important to have a single HTTP method, mentioned only once within a given path in JSON, otherwise, the operation will fail. - * @param body (optional) - * @param authorization (optional) - * @param authorizationRpId (optional) - * @return UmaRsProtectResponse - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - */ - public UmaRsProtectResponse umaRsProtect(UmaRsProtectParams body, String authorization, String authorizationRpId) throws ApiException { - ApiResponse resp = umaRsProtectWithHttpInfo(body, authorization, authorizationRpId); - return resp.getData(); - } - - /** - * UMA RS Protect Resources - * UMA RS Protect Resources. It's important to have a single HTTP method, mentioned only once within a given path in JSON, otherwise, the operation will fail. - * @param body (optional) - * @param authorization (optional) - * @param authorizationRpId (optional) - * @return ApiResponse<UmaRsProtectResponse> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - */ - public ApiResponse umaRsProtectWithHttpInfo(UmaRsProtectParams body, String authorization, String authorizationRpId) throws ApiException { - com.squareup.okhttp.Call call = umaRsProtectValidateBeforeCall(body, authorization, authorizationRpId, null, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return apiClient.execute(call, localVarReturnType); - } - - /** - * UMA RS Protect Resources (asynchronously) - * UMA RS Protect Resources. It's important to have a single HTTP method, mentioned only once within a given path in JSON, otherwise, the operation will fail. - * @param body (optional) - * @param authorization (optional) - * @param authorizationRpId (optional) - * @param callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object - */ - public com.squareup.okhttp.Call umaRsProtectAsync(UmaRsProtectParams body, String authorization, String authorizationRpId, final ApiCallback callback) throws ApiException { - - ProgressResponseBody.ProgressListener progressListener = null; - ProgressRequestBody.ProgressRequestListener progressRequestListener = null; - - if (callback != null) { - progressListener = new ProgressResponseBody.ProgressListener() { - @Override - public void update(long bytesRead, long contentLength, boolean done) { - callback.onDownloadProgress(bytesRead, contentLength, done); - } - }; - - progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { - @Override - public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { - callback.onUploadProgress(bytesWritten, contentLength, done); - } - }; - } - - com.squareup.okhttp.Call call = umaRsProtectValidateBeforeCall(body, authorization, authorizationRpId, progressListener, progressRequestListener); - Type localVarReturnType = new TypeToken(){}.getType(); - apiClient.executeAsync(call, localVarReturnType, callback); - return call; - } - /** - * Build call for updateSite - * @param body (optional) - * @param authorization (optional) - * @param authorizationRpId (optional) - * @param progressListener Progress listener - * @param progressRequestListener Progress request listener - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - */ - public com.squareup.okhttp.Call updateSiteCall(UpdateSiteParams body, String authorization, String authorizationRpId, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { - Object localVarPostBody = body; - - // create path and map variables - String localVarPath = "/update-site"; - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - - Map localVarHeaderParams = new HashMap(); - if (authorization != null) - localVarHeaderParams.put("Authorization", apiClient.parameterToString(authorization)); - if (authorizationRpId != null) - localVarHeaderParams.put("AuthorizationRpId", apiClient.parameterToString(authorizationRpId)); - - Map localVarFormParams = new HashMap(); - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); - - final String[] localVarContentTypes = { - "application/json" - }; - final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - localVarHeaderParams.put("Content-Type", localVarContentType); - - if(progressListener != null) { - apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { - @Override - public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { - com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); - return originalResponse.newBuilder() - .body(new ProgressResponseBody(originalResponse.body(), progressListener)) - .build(); - } - }); - } - - String[] localVarAuthNames = new String[] { }; - return apiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); - } - - @SuppressWarnings("rawtypes") - private com.squareup.okhttp.Call updateSiteValidateBeforeCall(UpdateSiteParams body, String authorization, String authorizationRpId, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { - - com.squareup.okhttp.Call call = updateSiteCall(body, authorization, authorizationRpId, progressListener, progressRequestListener); - return call; - - - - - - } - - /** - * Update Site - * Updates site at jans-client-api. If something changes in a pre-registered client, you can use this API to update your client in the OP. - * @param body (optional) - * @param authorization (optional) - * @param authorizationRpId (optional) - * @return UpdateSiteResponse - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - */ - public UpdateSiteResponse updateSite(UpdateSiteParams body, String authorization, String authorizationRpId) throws ApiException { - ApiResponse resp = updateSiteWithHttpInfo(body, authorization, authorizationRpId); - return resp.getData(); - } - - /** - * Update Site - * Updates site at jans-client-api. If something changes in a pre-registered client, you can use this API to update your client in the OP. - * @param body (optional) - * @param authorization (optional) - * @param authorizationRpId (optional) - * @return ApiResponse<UpdateSiteResponse> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - */ - public ApiResponse updateSiteWithHttpInfo(UpdateSiteParams body, String authorization, String authorizationRpId) throws ApiException { - com.squareup.okhttp.Call call = updateSiteValidateBeforeCall(body, authorization, authorizationRpId, null, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return apiClient.execute(call, localVarReturnType); - } - - /** - * Update Site (asynchronously) - * Updates site at jans-client-api. If something changes in a pre-registered client, you can use this API to update your client in the OP. - * @param body (optional) - * @param authorization (optional) - * @param authorizationRpId (optional) - * @param callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object - */ - public com.squareup.okhttp.Call updateSiteAsync(UpdateSiteParams body, String authorization, String authorizationRpId, final ApiCallback callback) throws ApiException { - - ProgressResponseBody.ProgressListener progressListener = null; - ProgressRequestBody.ProgressRequestListener progressRequestListener = null; - - if (callback != null) { - progressListener = new ProgressResponseBody.ProgressListener() { - @Override - public void update(long bytesRead, long contentLength, boolean done) { - callback.onDownloadProgress(bytesRead, contentLength, done); - } - }; - - progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { - @Override - public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { - callback.onUploadProgress(bytesWritten, contentLength, done); - } - }; - } - - com.squareup.okhttp.Call call = updateSiteValidateBeforeCall(body, authorization, authorizationRpId, progressListener, progressRequestListener); - Type localVarReturnType = new TypeToken(){}.getType(); - apiClient.executeAsync(call, localVarReturnType, callback); - return call; - } -} diff --git a/jans-client-api/gen-client/src/main/java/io/swagger/client/auth/ApiKeyAuth.java b/jans-client-api/gen-client/src/main/java/io/swagger/client/auth/ApiKeyAuth.java deleted file mode 100644 index f871dee19ae..00000000000 --- a/jans-client-api/gen-client/src/main/java/io/swagger/client/auth/ApiKeyAuth.java +++ /dev/null @@ -1,73 +0,0 @@ -/* - * jans-api-server - * jans-api-server - * - * OpenAPI spec version: 4.2 - * Contact: yuriyz@gluu.org - * - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen.git - * Do not edit the class manually. - */ - -package io.swagger.client.auth; - -import io.swagger.client.Pair; - -import java.util.Map; -import java.util.List; - -public class ApiKeyAuth implements Authentication { - private final String location; - private final String paramName; - - private String apiKey; - private String apiKeyPrefix; - - public ApiKeyAuth(String location, String paramName) { - this.location = location; - this.paramName = paramName; - } - - public String getLocation() { - return location; - } - - public String getParamName() { - return paramName; - } - - public String getApiKey() { - return apiKey; - } - - public void setApiKey(String apiKey) { - this.apiKey = apiKey; - } - - public String getApiKeyPrefix() { - return apiKeyPrefix; - } - - public void setApiKeyPrefix(String apiKeyPrefix) { - this.apiKeyPrefix = apiKeyPrefix; - } - - @Override - public void applyToParams(List queryParams, Map headerParams) { - if (apiKey == null) { - return; - } - String value; - if (apiKeyPrefix != null) { - value = apiKeyPrefix + " " + apiKey; - } else { - value = apiKey; - } - if ("query".equals(location)) { - queryParams.add(new Pair(paramName, value)); - } else if ("header".equals(location)) { - headerParams.put(paramName, value); - } - } -} diff --git a/jans-client-api/gen-client/src/main/java/io/swagger/client/auth/Authentication.java b/jans-client-api/gen-client/src/main/java/io/swagger/client/auth/Authentication.java deleted file mode 100644 index 1b74149b91b..00000000000 --- a/jans-client-api/gen-client/src/main/java/io/swagger/client/auth/Authentication.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * jans-api-server - * jans-api-server - * - * OpenAPI spec version: 4.2 - * Contact: yuriyz@gluu.org - * - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen.git - * Do not edit the class manually. - */ - -package io.swagger.client.auth; - -import io.swagger.client.Pair; - -import java.util.Map; -import java.util.List; - -public interface Authentication { - /** - * Apply authentication settings to header and query params. - * - * @param queryParams List of query parameters - * @param headerParams Map of header parameters - */ - void applyToParams(List queryParams, Map headerParams); -} diff --git a/jans-client-api/gen-client/src/main/java/io/swagger/client/auth/HttpBasicAuth.java b/jans-client-api/gen-client/src/main/java/io/swagger/client/auth/HttpBasicAuth.java deleted file mode 100644 index 2378cd9c2d8..00000000000 --- a/jans-client-api/gen-client/src/main/java/io/swagger/client/auth/HttpBasicAuth.java +++ /dev/null @@ -1,53 +0,0 @@ -/* - * jans-api-server - * jans-api-server - * - * OpenAPI spec version: 4.2 - * Contact: yuriyz@gluu.org - * - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen.git - * Do not edit the class manually. - */ - -package io.swagger.client.auth; - -import io.swagger.client.Pair; - -import com.squareup.okhttp.Credentials; - -import java.util.Map; -import java.util.List; - -import java.io.UnsupportedEncodingException; - -public class HttpBasicAuth implements Authentication { - private String username; - private String password; - - public String getUsername() { - return username; - } - - public void setUsername(String username) { - this.username = username; - } - - public String getPassword() { - return password; - } - - public void setPassword(String password) { - this.password = password; - } - - @Override - public void applyToParams(List queryParams, Map headerParams) { - if (username == null && password == null) { - return; - } - headerParams.put("Authorization", Credentials.basic( - username == null ? "" : username, - password == null ? "" : password)); - } -} diff --git a/jans-client-api/gen-client/src/main/java/io/swagger/client/auth/OAuth.java b/jans-client-api/gen-client/src/main/java/io/swagger/client/auth/OAuth.java deleted file mode 100644 index 80e440af2e4..00000000000 --- a/jans-client-api/gen-client/src/main/java/io/swagger/client/auth/OAuth.java +++ /dev/null @@ -1,37 +0,0 @@ -/* - * jans-api-server - * jans-api-server - * - * OpenAPI spec version: 4.2 - * Contact: yuriyz@gluu.org - * - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen.git - * Do not edit the class manually. - */ - -package io.swagger.client.auth; - -import io.swagger.client.Pair; - -import java.util.Map; -import java.util.List; - -public class OAuth implements Authentication { - private String accessToken; - - public String getAccessToken() { - return accessToken; - } - - public void setAccessToken(String accessToken) { - this.accessToken = accessToken; - } - - @Override - public void applyToParams(List queryParams, Map headerParams) { - if (accessToken != null) { - headerParams.put("Authorization", "Bearer " + accessToken); - } - } -} diff --git a/jans-client-api/gen-client/src/main/java/io/swagger/client/auth/OAuthFlow.java b/jans-client-api/gen-client/src/main/java/io/swagger/client/auth/OAuthFlow.java deleted file mode 100644 index 2c75faed954..00000000000 --- a/jans-client-api/gen-client/src/main/java/io/swagger/client/auth/OAuthFlow.java +++ /dev/null @@ -1,17 +0,0 @@ -/* - * jans-api-server - * jans-api-server - * - * OpenAPI spec version: 4.2 - * Contact: yuriyz@gluu.org - * - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen.git - * Do not edit the class manually. - */ - -package io.swagger.client.auth; - -public enum OAuthFlow { - accessCode, implicit, password, application -} diff --git a/jans-client-api/gen-client/src/main/java/io/swagger/client/model/Condition.java b/jans-client-api/gen-client/src/main/java/io/swagger/client/model/Condition.java deleted file mode 100644 index c287049e7b2..00000000000 --- a/jans-client-api/gen-client/src/main/java/io/swagger/client/model/Condition.java +++ /dev/null @@ -1,182 +0,0 @@ -/* - * jans-api-server - * jans-api-server - * - * OpenAPI spec version: 4.2 - * Contact: yuriyz@gluu.org - * - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen.git - * Do not edit the class manually. - */ - -package io.swagger.client.model; - -import java.util.Objects; -import java.util.Arrays; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import io.swagger.v3.oas.annotations.media.Schema; -import java.io.IOException; -import java.util.ArrayList; -import java.util.List; -/** - * Condition - */ - - -public class Condition { - @SerializedName("httpMethods") - private List httpMethods = new ArrayList(); - - @SerializedName("scopes") - private List scopes = new ArrayList(); - - @SerializedName("scope_expression") - private List scopeExpression = new ArrayList(); - - @SerializedName("ticketScopes") - private List ticketScopes = new ArrayList(); - - public Condition httpMethods(List httpMethods) { - this.httpMethods = httpMethods; - return this; - } - - public Condition addHttpMethodsItem(String httpMethodsItem) { - this.httpMethods.add(httpMethodsItem); - return this; - } - - /** - * Get httpMethods - * @return httpMethods - **/ - @Schema(required = true, description = "") - public List getHttpMethods() { - return httpMethods; - } - - public void setHttpMethods(List httpMethods) { - this.httpMethods = httpMethods; - } - - public Condition scopes(List scopes) { - this.scopes = scopes; - return this; - } - - public Condition addScopesItem(String scopesItem) { - this.scopes.add(scopesItem); - return this; - } - - /** - * Get scopes - * @return scopes - **/ - @Schema(required = true, description = "") - public List getScopes() { - return scopes; - } - - public void setScopes(List scopes) { - this.scopes = scopes; - } - - public Condition scopeExpression(List scopeExpression) { - this.scopeExpression = scopeExpression; - return this; - } - - public Condition addScopeExpressionItem(String scopeExpressionItem) { - this.scopeExpression.add(scopeExpressionItem); - return this; - } - - /** - * Get scopeExpression - * @return scopeExpression - **/ - @Schema(required = true, description = "") - public List getScopeExpression() { - return scopeExpression; - } - - public void setScopeExpression(List scopeExpression) { - this.scopeExpression = scopeExpression; - } - - public Condition ticketScopes(List ticketScopes) { - this.ticketScopes = ticketScopes; - return this; - } - - public Condition addTicketScopesItem(String ticketScopesItem) { - this.ticketScopes.add(ticketScopesItem); - return this; - } - - /** - * Get ticketScopes - * @return ticketScopes - **/ - @Schema(required = true, description = "") - public List getTicketScopes() { - return ticketScopes; - } - - public void setTicketScopes(List ticketScopes) { - this.ticketScopes = ticketScopes; - } - - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - Condition condition = (Condition) o; - return Objects.equals(this.httpMethods, condition.httpMethods) && - Objects.equals(this.scopes, condition.scopes) && - Objects.equals(this.scopeExpression, condition.scopeExpression) && - Objects.equals(this.ticketScopes, condition.ticketScopes); - } - - @Override - public int hashCode() { - return Objects.hash(httpMethods, scopes, scopeExpression, ticketScopes); - } - - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class Condition {\n"); - - sb.append(" httpMethods: ").append(toIndentedString(httpMethods)).append("\n"); - sb.append(" scopes: ").append(toIndentedString(scopes)).append("\n"); - sb.append(" scopeExpression: ").append(toIndentedString(scopeExpression)).append("\n"); - sb.append(" ticketScopes: ").append(toIndentedString(ticketScopes)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - -} diff --git a/jans-client-api/gen-client/src/main/java/io/swagger/client/model/ErrorResponse.java b/jans-client-api/gen-client/src/main/java/io/swagger/client/model/ErrorResponse.java deleted file mode 100644 index 34a71093637..00000000000 --- a/jans-client-api/gen-client/src/main/java/io/swagger/client/model/ErrorResponse.java +++ /dev/null @@ -1,137 +0,0 @@ -/* - * jans-api-server - * jans-api-server - * - * OpenAPI spec version: 4.2 - * Contact: yuriyz@gluu.org - * - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen.git - * Do not edit the class manually. - */ - -package io.swagger.client.model; - -import java.util.Objects; -import java.util.Arrays; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import io.swagger.v3.oas.annotations.media.Schema; -import java.io.IOException; -/** - * ErrorResponse - */ - - -public class ErrorResponse { - @SerializedName("error") - private String error = null; - - @SerializedName("error_description") - private String errorDescription = null; - - @SerializedName("details") - private String details = null; - - public ErrorResponse error(String error) { - this.error = error; - return this; - } - - /** - * Get error - * @return error - **/ - @Schema(required = true, description = "") - public String getError() { - return error; - } - - public void setError(String error) { - this.error = error; - } - - public ErrorResponse errorDescription(String errorDescription) { - this.errorDescription = errorDescription; - return this; - } - - /** - * Get errorDescription - * @return errorDescription - **/ - @Schema(required = true, description = "") - public String getErrorDescription() { - return errorDescription; - } - - public void setErrorDescription(String errorDescription) { - this.errorDescription = errorDescription; - } - - public ErrorResponse details(String details) { - this.details = details; - return this; - } - - /** - * Get details - * @return details - **/ - @Schema(description = "") - public String getDetails() { - return details; - } - - public void setDetails(String details) { - this.details = details; - } - - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - ErrorResponse errorResponse = (ErrorResponse) o; - return Objects.equals(this.error, errorResponse.error) && - Objects.equals(this.errorDescription, errorResponse.errorDescription) && - Objects.equals(this.details, errorResponse.details); - } - - @Override - public int hashCode() { - return Objects.hash(error, errorDescription, details); - } - - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class ErrorResponse {\n"); - - sb.append(" error: ").append(toIndentedString(error)).append("\n"); - sb.append(" errorDescription: ").append(toIndentedString(errorDescription)).append("\n"); - sb.append(" details: ").append(toIndentedString(details)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - -} diff --git a/jans-client-api/gen-client/src/main/java/io/swagger/client/model/GetAccessTokenByRefreshTokenParams.java b/jans-client-api/gen-client/src/main/java/io/swagger/client/model/GetAccessTokenByRefreshTokenParams.java deleted file mode 100644 index 110f5e75035..00000000000 --- a/jans-client-api/gen-client/src/main/java/io/swagger/client/model/GetAccessTokenByRefreshTokenParams.java +++ /dev/null @@ -1,144 +0,0 @@ -/* - * jans-api-server - * jans-api-server - * - * OpenAPI spec version: 4.2 - * Contact: yuriyz@gluu.org - * - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen.git - * Do not edit the class manually. - */ - -package io.swagger.client.model; - -import java.util.Objects; -import java.util.Arrays; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import io.swagger.v3.oas.annotations.media.Schema; -import java.io.IOException; -import java.util.ArrayList; -import java.util.List; -/** - * GetAccessTokenByRefreshTokenParams - */ - - -public class GetAccessTokenByRefreshTokenParams { - @SerializedName("rp_id") - private String rpId = null; - - @SerializedName("refresh_token") - private String refreshToken = null; - - @SerializedName("scope") - private List scope = new ArrayList(); - - public GetAccessTokenByRefreshTokenParams rpId(String rpId) { - this.rpId = rpId; - return this; - } - - /** - * Get rpId - * @return rpId - **/ - @Schema(example = "bcad760f-91ba-46e1-a020-05e4281d91b6", required = true, description = "") - public String getRpId() { - return rpId; - } - - public void setRpId(String rpId) { - this.rpId = rpId; - } - - public GetAccessTokenByRefreshTokenParams refreshToken(String refreshToken) { - this.refreshToken = refreshToken; - return this; - } - - /** - * Get refreshToken - * @return refreshToken - **/ - @Schema(example = "33d7988e-6ffb-4fe5-8c2a-0e158691d446", required = true, description = "") - public String getRefreshToken() { - return refreshToken; - } - - public void setRefreshToken(String refreshToken) { - this.refreshToken = refreshToken; - } - - public GetAccessTokenByRefreshTokenParams scope(List scope) { - this.scope = scope; - return this; - } - - public GetAccessTokenByRefreshTokenParams addScopeItem(String scopeItem) { - this.scope.add(scopeItem); - return this; - } - - /** - * Get scope - * @return scope - **/ - @Schema(example = "[\"openid\"]", required = true, description = "") - public List getScope() { - return scope; - } - - public void setScope(List scope) { - this.scope = scope; - } - - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - GetAccessTokenByRefreshTokenParams getAccessTokenByRefreshTokenParams = (GetAccessTokenByRefreshTokenParams) o; - return Objects.equals(this.rpId, getAccessTokenByRefreshTokenParams.rpId) && - Objects.equals(this.refreshToken, getAccessTokenByRefreshTokenParams.refreshToken) && - Objects.equals(this.scope, getAccessTokenByRefreshTokenParams.scope); - } - - @Override - public int hashCode() { - return Objects.hash(rpId, refreshToken, scope); - } - - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class GetAccessTokenByRefreshTokenParams {\n"); - - sb.append(" rpId: ").append(toIndentedString(rpId)).append("\n"); - sb.append(" refreshToken: ").append(toIndentedString(refreshToken)).append("\n"); - sb.append(" scope: ").append(toIndentedString(scope)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - -} diff --git a/jans-client-api/gen-client/src/main/java/io/swagger/client/model/GetAccessTokenByRefreshTokenResponse.java b/jans-client-api/gen-client/src/main/java/io/swagger/client/model/GetAccessTokenByRefreshTokenResponse.java deleted file mode 100644 index c6b26be9156..00000000000 --- a/jans-client-api/gen-client/src/main/java/io/swagger/client/model/GetAccessTokenByRefreshTokenResponse.java +++ /dev/null @@ -1,167 +0,0 @@ -/* - * jans-api-server - * jans-api-server - * - * OpenAPI spec version: 4.2 - * Contact: yuriyz@gluu.org - * - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen.git - * Do not edit the class manually. - */ - -package io.swagger.client.model; - -import java.util.Objects; -import java.util.Arrays; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import io.swagger.v3.oas.annotations.media.Schema; -import java.io.IOException; -import java.util.ArrayList; -import java.util.List; -/** - * GetAccessTokenByRefreshTokenResponse - */ - - -public class GetAccessTokenByRefreshTokenResponse { - @SerializedName("scope") - private List scope = new ArrayList(); - - @SerializedName("access_token") - private String accessToken = null; - - @SerializedName("expires_in") - private Integer expiresIn = null; - - @SerializedName("refresh_token") - private String refreshToken = null; - - public GetAccessTokenByRefreshTokenResponse scope(List scope) { - this.scope = scope; - return this; - } - - public GetAccessTokenByRefreshTokenResponse addScopeItem(String scopeItem) { - this.scope.add(scopeItem); - return this; - } - - /** - * Get scope - * @return scope - **/ - @Schema(example = "[\"openid\",\"profile\",\"uma_protection\",\"email\"]", required = true, description = "") - public List getScope() { - return scope; - } - - public void setScope(List scope) { - this.scope = scope; - } - - public GetAccessTokenByRefreshTokenResponse accessToken(String accessToken) { - this.accessToken = accessToken; - return this; - } - - /** - * Get accessToken - * @return accessToken - **/ - @Schema(example = "b75434ff-f465-4b70-92e4-b7ba6b6c58f2", required = true, description = "") - public String getAccessToken() { - return accessToken; - } - - public void setAccessToken(String accessToken) { - this.accessToken = accessToken; - } - - public GetAccessTokenByRefreshTokenResponse expiresIn(Integer expiresIn) { - this.expiresIn = expiresIn; - return this; - } - - /** - * Get expiresIn - * @return expiresIn - **/ - @Schema(example = "299", required = true, description = "") - public Integer getExpiresIn() { - return expiresIn; - } - - public void setExpiresIn(Integer expiresIn) { - this.expiresIn = expiresIn; - } - - public GetAccessTokenByRefreshTokenResponse refreshToken(String refreshToken) { - this.refreshToken = refreshToken; - return this; - } - - /** - * Get refreshToken - * @return refreshToken - **/ - @Schema(example = "33d7988e-6ffb-4fe5-8c2a-0e158691d446", required = true, description = "") - public String getRefreshToken() { - return refreshToken; - } - - public void setRefreshToken(String refreshToken) { - this.refreshToken = refreshToken; - } - - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - GetAccessTokenByRefreshTokenResponse getAccessTokenByRefreshTokenResponse = (GetAccessTokenByRefreshTokenResponse) o; - return Objects.equals(this.scope, getAccessTokenByRefreshTokenResponse.scope) && - Objects.equals(this.accessToken, getAccessTokenByRefreshTokenResponse.accessToken) && - Objects.equals(this.expiresIn, getAccessTokenByRefreshTokenResponse.expiresIn) && - Objects.equals(this.refreshToken, getAccessTokenByRefreshTokenResponse.refreshToken); - } - - @Override - public int hashCode() { - return Objects.hash(scope, accessToken, expiresIn, refreshToken); - } - - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class GetAccessTokenByRefreshTokenResponse {\n"); - - sb.append(" scope: ").append(toIndentedString(scope)).append("\n"); - sb.append(" accessToken: ").append(toIndentedString(accessToken)).append("\n"); - sb.append(" expiresIn: ").append(toIndentedString(expiresIn)).append("\n"); - sb.append(" refreshToken: ").append(toIndentedString(refreshToken)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - -} diff --git a/jans-client-api/gen-client/src/main/java/io/swagger/client/model/GetAuthorizationUrlParams.java b/jans-client-api/gen-client/src/main/java/io/swagger/client/model/GetAuthorizationUrlParams.java deleted file mode 100644 index 7326420d910..00000000000 --- a/jans-client-api/gen-client/src/main/java/io/swagger/client/model/GetAuthorizationUrlParams.java +++ /dev/null @@ -1,342 +0,0 @@ -/* - * jans-api-server - * jans-api-server - * - * OpenAPI spec version: 4.2 - * Contact: yuriyz@gluu.org - * - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen.git - * Do not edit the class manually. - */ - -package io.swagger.client.model; - -import java.util.Objects; -import java.util.Arrays; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import io.swagger.v3.oas.annotations.media.Schema; -import java.io.IOException; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -/** - * GetAuthorizationUrlParams - */ - - -public class GetAuthorizationUrlParams { - @SerializedName("rp_id") - private String rpId = null; - - @SerializedName("scope") - private List scope = null; - - @SerializedName("acr_values") - private List acrValues = null; - - @SerializedName("prompt") - private String prompt = null; - - @SerializedName("state") - private String state = null; - - @SerializedName("nonce") - private String nonce = null; - - @SerializedName("redirect_uri") - private String redirectUri = null; - - @SerializedName("response_types") - private List responseTypes = null; - - @SerializedName("custom_parameters") - private Map customParameters = null; - - @SerializedName("params") - private Map params = null; - - public GetAuthorizationUrlParams rpId(String rpId) { - this.rpId = rpId; - return this; - } - - /** - * Get rpId - * @return rpId - **/ - @Schema(example = "bcad760f-91ba-46e1-a020-05e4281d91b6", required = true, description = "") - public String getRpId() { - return rpId; - } - - public void setRpId(String rpId) { - this.rpId = rpId; - } - - public GetAuthorizationUrlParams scope(List scope) { - this.scope = scope; - return this; - } - - public GetAuthorizationUrlParams addScopeItem(String scopeItem) { - if (this.scope == null) { - this.scope = new ArrayList(); - } - this.scope.add(scopeItem); - return this; - } - - /** - * Get scope - * @return scope - **/ - @Schema(example = "[\"openid\"]", description = "") - public List getScope() { - return scope; - } - - public void setScope(List scope) { - this.scope = scope; - } - - public GetAuthorizationUrlParams acrValues(List acrValues) { - this.acrValues = acrValues; - return this; - } - - public GetAuthorizationUrlParams addAcrValuesItem(String acrValuesItem) { - if (this.acrValues == null) { - this.acrValues = new ArrayList(); - } - this.acrValues.add(acrValuesItem); - return this; - } - - /** - * Get acrValues - * @return acrValues - **/ - @Schema(example = "[\"basic\"]", description = "") - public List getAcrValues() { - return acrValues; - } - - public void setAcrValues(List acrValues) { - this.acrValues = acrValues; - } - - public GetAuthorizationUrlParams prompt(String prompt) { - this.prompt = prompt; - return this; - } - - /** - * Get prompt - * @return prompt - **/ - @Schema(description = "") - public String getPrompt() { - return prompt; - } - - public void setPrompt(String prompt) { - this.prompt = prompt; - } - - public GetAuthorizationUrlParams state(String state) { - this.state = state; - return this; - } - - /** - * Get state - * @return state - **/ - @Schema(description = "") - public String getState() { - return state; - } - - public void setState(String state) { - this.state = state; - } - - public GetAuthorizationUrlParams nonce(String nonce) { - this.nonce = nonce; - return this; - } - - /** - * Get nonce - * @return nonce - **/ - @Schema(description = "") - public String getNonce() { - return nonce; - } - - public void setNonce(String nonce) { - this.nonce = nonce; - } - - public GetAuthorizationUrlParams redirectUri(String redirectUri) { - this.redirectUri = redirectUri; - return this; - } - - /** - * Get redirectUri - * @return redirectUri - **/ - @Schema(example = "https://client.example.org/cb", description = "") - public String getRedirectUri() { - return redirectUri; - } - - public void setRedirectUri(String redirectUri) { - this.redirectUri = redirectUri; - } - - public GetAuthorizationUrlParams responseTypes(List responseTypes) { - this.responseTypes = responseTypes; - return this; - } - - public GetAuthorizationUrlParams addResponseTypesItem(String responseTypesItem) { - if (this.responseTypes == null) { - this.responseTypes = new ArrayList(); - } - this.responseTypes.add(responseTypesItem); - return this; - } - - /** - * Provide a list of the OAuth 2.0 response_type values that the Client is declaring that it will restrict itself to using. If omitted, the default is that the Client will use only the code response type. - * @return responseTypes - **/ - @Schema(example = "[\"code\"]", description = "Provide a list of the OAuth 2.0 response_type values that the Client is declaring that it will restrict itself to using. If omitted, the default is that the Client will use only the code response type.") - public List getResponseTypes() { - return responseTypes; - } - - public void setResponseTypes(List responseTypes) { - this.responseTypes = responseTypes; - } - - public GetAuthorizationUrlParams customParameters(Map customParameters) { - this.customParameters = customParameters; - return this; - } - - public GetAuthorizationUrlParams putCustomParametersItem(String key, String customParametersItem) { - if (this.customParameters == null) { - this.customParameters = new HashMap(); - } - this.customParameters.put(key, customParametersItem); - return this; - } - - /** - * Get customParameters - * @return customParameters - **/ - @Schema(description = "") - public Map getCustomParameters() { - return customParameters; - } - - public void setCustomParameters(Map customParameters) { - this.customParameters = customParameters; - } - - public GetAuthorizationUrlParams params(Map params) { - this.params = params; - return this; - } - - public GetAuthorizationUrlParams putParamsItem(String key, String paramsItem) { - if (this.params == null) { - this.params = new HashMap(); - } - this.params.put(key, paramsItem); - return this; - } - - /** - * Get params - * @return params - **/ - @Schema(description = "") - public Map getParams() { - return params; - } - - public void setParams(Map params) { - this.params = params; - } - - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - GetAuthorizationUrlParams getAuthorizationUrlParams = (GetAuthorizationUrlParams) o; - return Objects.equals(this.rpId, getAuthorizationUrlParams.rpId) && - Objects.equals(this.scope, getAuthorizationUrlParams.scope) && - Objects.equals(this.acrValues, getAuthorizationUrlParams.acrValues) && - Objects.equals(this.prompt, getAuthorizationUrlParams.prompt) && - Objects.equals(this.state, getAuthorizationUrlParams.state) && - Objects.equals(this.nonce, getAuthorizationUrlParams.nonce) && - Objects.equals(this.redirectUri, getAuthorizationUrlParams.redirectUri) && - Objects.equals(this.responseTypes, getAuthorizationUrlParams.responseTypes) && - Objects.equals(this.customParameters, getAuthorizationUrlParams.customParameters) && - Objects.equals(this.params, getAuthorizationUrlParams.params); - } - - @Override - public int hashCode() { - return Objects.hash(rpId, scope, acrValues, prompt, state, nonce, redirectUri, responseTypes, customParameters, params); - } - - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class GetAuthorizationUrlParams {\n"); - - sb.append(" rpId: ").append(toIndentedString(rpId)).append("\n"); - sb.append(" scope: ").append(toIndentedString(scope)).append("\n"); - sb.append(" acrValues: ").append(toIndentedString(acrValues)).append("\n"); - sb.append(" prompt: ").append(toIndentedString(prompt)).append("\n"); - sb.append(" state: ").append(toIndentedString(state)).append("\n"); - sb.append(" nonce: ").append(toIndentedString(nonce)).append("\n"); - sb.append(" redirectUri: ").append(toIndentedString(redirectUri)).append("\n"); - sb.append(" responseTypes: ").append(toIndentedString(responseTypes)).append("\n"); - sb.append(" customParameters: ").append(toIndentedString(customParameters)).append("\n"); - sb.append(" params: ").append(toIndentedString(params)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - -} diff --git a/jans-client-api/gen-client/src/main/java/io/swagger/client/model/GetAuthorizationUrlResponse.java b/jans-client-api/gen-client/src/main/java/io/swagger/client/model/GetAuthorizationUrlResponse.java deleted file mode 100644 index 679659011f4..00000000000 --- a/jans-client-api/gen-client/src/main/java/io/swagger/client/model/GetAuthorizationUrlResponse.java +++ /dev/null @@ -1,91 +0,0 @@ -/* - * jans-api-server - * jans-api-server - * - * OpenAPI spec version: 4.2 - * Contact: yuriyz@gluu.org - * - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen.git - * Do not edit the class manually. - */ - -package io.swagger.client.model; - -import java.util.Objects; -import java.util.Arrays; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import io.swagger.v3.oas.annotations.media.Schema; -import java.io.IOException; -/** - * GetAuthorizationUrlResponse - */ - - -public class GetAuthorizationUrlResponse { - @SerializedName("authorization_url") - private String authorizationUrl = null; - - public GetAuthorizationUrlResponse authorizationUrl(String authorizationUrl) { - this.authorizationUrl = authorizationUrl; - return this; - } - - /** - * Get authorizationUrl - * @return authorizationUrl - **/ - @Schema(example = "https:///oxauth/restv1/authorize?response_type=code&client_id=@!1736.179E.AA60.16B2!0001!8F7C.B9AB!0008!8A36.24E1.97DE.F4EF&redirect_uri=https://192.168.200.95/&scope=openid+profile+email+uma_protection+uma_authorization&state=473ot4nuqb4ubeokc139raur13&nonce=lbrdgorr974q66q6q9g454iccm", required = true, description = "") - public String getAuthorizationUrl() { - return authorizationUrl; - } - - public void setAuthorizationUrl(String authorizationUrl) { - this.authorizationUrl = authorizationUrl; - } - - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - GetAuthorizationUrlResponse getAuthorizationUrlResponse = (GetAuthorizationUrlResponse) o; - return Objects.equals(this.authorizationUrl, getAuthorizationUrlResponse.authorizationUrl); - } - - @Override - public int hashCode() { - return Objects.hash(authorizationUrl); - } - - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class GetAuthorizationUrlResponse {\n"); - - sb.append(" authorizationUrl: ").append(toIndentedString(authorizationUrl)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - -} diff --git a/jans-client-api/gen-client/src/main/java/io/swagger/client/model/GetClientTokenParams.java b/jans-client-api/gen-client/src/main/java/io/swagger/client/model/GetClientTokenParams.java deleted file mode 100644 index cdd8ff57f9f..00000000000 --- a/jans-client-api/gen-client/src/main/java/io/swagger/client/model/GetClientTokenParams.java +++ /dev/null @@ -1,285 +0,0 @@ -/* - * jans-api-server - * jans-api-server - * - * OpenAPI spec version: 4.2 - * Contact: yuriyz@gluu.org - * - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen.git - * Do not edit the class manually. - */ - -package io.swagger.client.model; - -import java.util.Objects; -import java.util.Arrays; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import io.swagger.v3.oas.annotations.media.Schema; -import java.io.IOException; -import java.util.ArrayList; -import java.util.List; -/** - * GetClientTokenParams - */ - - -public class GetClientTokenParams { - @SerializedName("op_configuration_endpoint") - private String opConfigurationEndpoint = null; - - @SerializedName("op_host") - private String opHost = null; - - @SerializedName("op_discovery_path") - private String opDiscoveryPath = null; - - @SerializedName("scope") - private List scope = null; - - @SerializedName("client_id") - private String clientId = null; - - @SerializedName("client_secret") - private String clientSecret = null; - - @SerializedName("authentication_method") - private String authenticationMethod = null; - - @SerializedName("algorithm") - private String algorithm = null; - - @SerializedName("key_id") - private String keyId = null; - - public GetClientTokenParams opConfigurationEndpoint(String opConfigurationEndpoint) { - this.opConfigurationEndpoint = opConfigurationEndpoint; - return this; - } - - /** - * The openid configuration endpoint URL. If missing, then `op_host` must be defined. - * @return opConfigurationEndpoint - **/ - @Schema(example = "https://op.example.com/acme/.well-known/openid-configuration", required = true, description = "The openid configuration endpoint URL. If missing, then `op_host` must be defined.") - public String getOpConfigurationEndpoint() { - return opConfigurationEndpoint; - } - - public void setOpConfigurationEndpoint(String opConfigurationEndpoint) { - this.opConfigurationEndpoint = opConfigurationEndpoint; - } - - public GetClientTokenParams opHost(String opHost) { - this.opHost = opHost; - return this; - } - - /** - * Deprecated in favor of `op_configuration_endpoint`. It will be removed in future version(s). Provide the URL of OpenID Provider (OP) in this field. If missing, then `op_configuration_endpoint` must be defined. - * @return opHost - **/ - @Schema(example = "https://", description = "Deprecated in favor of `op_configuration_endpoint`. It will be removed in future version(s). Provide the URL of OpenID Provider (OP) in this field. If missing, then `op_configuration_endpoint` must be defined.") - public String getOpHost() { - return opHost; - } - - public void setOpHost(String opHost) { - this.opHost = opHost; - } - - public GetClientTokenParams opDiscoveryPath(String opDiscoveryPath) { - this.opDiscoveryPath = opDiscoveryPath; - return this; - } - - /** - * Deprecated in favor of `op_configuration_endpoint`. It will be removed in future version(s). Provide path to the OpenID Connect Provider's discovery document in this field. For example, if it is 'https://example.com/.well-known/openid-configuration' then the path is blank. But if it is 'https://example.com/oxauth/.well-known/openid-configuration' then the path is '/oxauth' - * @return opDiscoveryPath - **/ - @Schema(example = "/oxauth", description = "Deprecated in favor of `op_configuration_endpoint`. It will be removed in future version(s). Provide path to the OpenID Connect Provider's discovery document in this field. For example, if it is 'https://example.com/.well-known/openid-configuration' then the path is blank. But if it is 'https://example.com/oxauth/.well-known/openid-configuration' then the path is '/oxauth'") - public String getOpDiscoveryPath() { - return opDiscoveryPath; - } - - public void setOpDiscoveryPath(String opDiscoveryPath) { - this.opDiscoveryPath = opDiscoveryPath; - } - - public GetClientTokenParams scope(List scope) { - this.scope = scope; - return this; - } - - public GetClientTokenParams addScopeItem(String scopeItem) { - if (this.scope == null) { - this.scope = new ArrayList(); - } - this.scope.add(scopeItem); - return this; - } - - /** - * Get scope - * @return scope - **/ - @Schema(example = "[\"openid\"]", description = "") - public List getScope() { - return scope; - } - - public void setScope(List scope) { - this.scope = scope; - } - - public GetClientTokenParams clientId(String clientId) { - this.clientId = clientId; - return this; - } - - /** - * Get clientId - * @return clientId - **/ - @Schema(example = "@!1736.179E.AA60.16B2!0001!8F7C.B9AB!0008!A2BB.9AE6.5F14.B387", required = true, description = "") - public String getClientId() { - return clientId; - } - - public void setClientId(String clientId) { - this.clientId = clientId; - } - - public GetClientTokenParams clientSecret(String clientSecret) { - this.clientSecret = clientSecret; - return this; - } - - /** - * Get clientSecret - * @return clientSecret - **/ - @Schema(example = "f436b936-03fc-433f-9772-53c2bc9e1c74", required = true, description = "") - public String getClientSecret() { - return clientSecret; - } - - public void setClientSecret(String clientSecret) { - this.clientSecret = clientSecret; - } - - public GetClientTokenParams authenticationMethod(String authenticationMethod) { - this.authenticationMethod = authenticationMethod; - return this; - } - - /** - * if value is missed then basic authentication is used. Otherwise it's possible to set `private_key_jwt` value for Private Key authentication. - * @return authenticationMethod - **/ - @Schema(description = "if value is missed then basic authentication is used. Otherwise it's possible to set `private_key_jwt` value for Private Key authentication.") - public String getAuthenticationMethod() { - return authenticationMethod; - } - - public void setAuthenticationMethod(String authenticationMethod) { - this.authenticationMethod = authenticationMethod; - } - - public GetClientTokenParams algorithm(String algorithm) { - this.algorithm = algorithm; - return this; - } - - /** - * optional but is required if authentication_method=private_key_jwt. Valid values are none, HS256, HS384, HS512, RS256, RS384, RS512, ES256, ES384, ES512 - * @return algorithm - **/ - @Schema(description = "optional but is required if authentication_method=private_key_jwt. Valid values are none, HS256, HS384, HS512, RS256, RS384, RS512, ES256, ES384, ES512") - public String getAlgorithm() { - return algorithm; - } - - public void setAlgorithm(String algorithm) { - this.algorithm = algorithm; - } - - public GetClientTokenParams keyId(String keyId) { - this.keyId = keyId; - return this; - } - - /** - * optional but is required if authentication_method=private_key_jwt. It has to be valid key id from key store. - * @return keyId - **/ - @Schema(description = "optional but is required if authentication_method=private_key_jwt. It has to be valid key id from key store.") - public String getKeyId() { - return keyId; - } - - public void setKeyId(String keyId) { - this.keyId = keyId; - } - - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - GetClientTokenParams getClientTokenParams = (GetClientTokenParams) o; - return Objects.equals(this.opConfigurationEndpoint, getClientTokenParams.opConfigurationEndpoint) && - Objects.equals(this.opHost, getClientTokenParams.opHost) && - Objects.equals(this.opDiscoveryPath, getClientTokenParams.opDiscoveryPath) && - Objects.equals(this.scope, getClientTokenParams.scope) && - Objects.equals(this.clientId, getClientTokenParams.clientId) && - Objects.equals(this.clientSecret, getClientTokenParams.clientSecret) && - Objects.equals(this.authenticationMethod, getClientTokenParams.authenticationMethod) && - Objects.equals(this.algorithm, getClientTokenParams.algorithm) && - Objects.equals(this.keyId, getClientTokenParams.keyId); - } - - @Override - public int hashCode() { - return Objects.hash(opConfigurationEndpoint, opHost, opDiscoveryPath, scope, clientId, clientSecret, authenticationMethod, algorithm, keyId); - } - - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class GetClientTokenParams {\n"); - - sb.append(" opConfigurationEndpoint: ").append(toIndentedString(opConfigurationEndpoint)).append("\n"); - sb.append(" opHost: ").append(toIndentedString(opHost)).append("\n"); - sb.append(" opDiscoveryPath: ").append(toIndentedString(opDiscoveryPath)).append("\n"); - sb.append(" scope: ").append(toIndentedString(scope)).append("\n"); - sb.append(" clientId: ").append(toIndentedString(clientId)).append("\n"); - sb.append(" clientSecret: ").append(toIndentedString(clientSecret)).append("\n"); - sb.append(" authenticationMethod: ").append(toIndentedString(authenticationMethod)).append("\n"); - sb.append(" algorithm: ").append(toIndentedString(algorithm)).append("\n"); - sb.append(" keyId: ").append(toIndentedString(keyId)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - -} diff --git a/jans-client-api/gen-client/src/main/java/io/swagger/client/model/GetClientTokenResponse.java b/jans-client-api/gen-client/src/main/java/io/swagger/client/model/GetClientTokenResponse.java deleted file mode 100644 index eaffb8f6ef2..00000000000 --- a/jans-client-api/gen-client/src/main/java/io/swagger/client/model/GetClientTokenResponse.java +++ /dev/null @@ -1,167 +0,0 @@ -/* - * jans-api-server - * jans-api-server - * - * OpenAPI spec version: 4.2 - * Contact: yuriyz@gluu.org - * - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen.git - * Do not edit the class manually. - */ - -package io.swagger.client.model; - -import java.util.Objects; -import java.util.Arrays; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import io.swagger.v3.oas.annotations.media.Schema; -import java.io.IOException; -import java.util.ArrayList; -import java.util.List; -/** - * GetClientTokenResponse - */ - - -public class GetClientTokenResponse { - @SerializedName("scope") - private List scope = new ArrayList(); - - @SerializedName("access_token") - private String accessToken = null; - - @SerializedName("expires_in") - private Integer expiresIn = null; - - @SerializedName("refresh_token") - private String refreshToken = null; - - public GetClientTokenResponse scope(List scope) { - this.scope = scope; - return this; - } - - public GetClientTokenResponse addScopeItem(String scopeItem) { - this.scope.add(scopeItem); - return this; - } - - /** - * Get scope - * @return scope - **/ - @Schema(example = "[\"openid\",\"rp\"]", required = true, description = "") - public List getScope() { - return scope; - } - - public void setScope(List scope) { - this.scope = scope; - } - - public GetClientTokenResponse accessToken(String accessToken) { - this.accessToken = accessToken; - return this; - } - - /** - * Get accessToken - * @return accessToken - **/ - @Schema(example = "b75434ff-f465-4b70-92e4-b7ba6b6c58f2", required = true, description = "") - public String getAccessToken() { - return accessToken; - } - - public void setAccessToken(String accessToken) { - this.accessToken = accessToken; - } - - public GetClientTokenResponse expiresIn(Integer expiresIn) { - this.expiresIn = expiresIn; - return this; - } - - /** - * Get expiresIn - * @return expiresIn - **/ - @Schema(example = "299", required = true, description = "") - public Integer getExpiresIn() { - return expiresIn; - } - - public void setExpiresIn(Integer expiresIn) { - this.expiresIn = expiresIn; - } - - public GetClientTokenResponse refreshToken(String refreshToken) { - this.refreshToken = refreshToken; - return this; - } - - /** - * Get refreshToken - * @return refreshToken - **/ - @Schema(required = true, description = "") - public String getRefreshToken() { - return refreshToken; - } - - public void setRefreshToken(String refreshToken) { - this.refreshToken = refreshToken; - } - - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - GetClientTokenResponse getClientTokenResponse = (GetClientTokenResponse) o; - return Objects.equals(this.scope, getClientTokenResponse.scope) && - Objects.equals(this.accessToken, getClientTokenResponse.accessToken) && - Objects.equals(this.expiresIn, getClientTokenResponse.expiresIn) && - Objects.equals(this.refreshToken, getClientTokenResponse.refreshToken); - } - - @Override - public int hashCode() { - return Objects.hash(scope, accessToken, expiresIn, refreshToken); - } - - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class GetClientTokenResponse {\n"); - - sb.append(" scope: ").append(toIndentedString(scope)).append("\n"); - sb.append(" accessToken: ").append(toIndentedString(accessToken)).append("\n"); - sb.append(" expiresIn: ").append(toIndentedString(expiresIn)).append("\n"); - sb.append(" refreshToken: ").append(toIndentedString(refreshToken)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - -} diff --git a/jans-client-api/gen-client/src/main/java/io/swagger/client/model/GetDiscoveryParams.java b/jans-client-api/gen-client/src/main/java/io/swagger/client/model/GetDiscoveryParams.java deleted file mode 100644 index ffcd936ec07..00000000000 --- a/jans-client-api/gen-client/src/main/java/io/swagger/client/model/GetDiscoveryParams.java +++ /dev/null @@ -1,137 +0,0 @@ -/* - * jans-api-server - * jans-api-server - * - * OpenAPI spec version: 4.2 - * Contact: yuriyz@gluu.org - * - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen.git - * Do not edit the class manually. - */ - -package io.swagger.client.model; - -import java.util.Objects; -import java.util.Arrays; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import io.swagger.v3.oas.annotations.media.Schema; -import java.io.IOException; -/** - * GetDiscoveryParams - */ - - -public class GetDiscoveryParams { - @SerializedName("op_configuration_endpoint") - private String opConfigurationEndpoint = null; - - @SerializedName("op_host") - private String opHost = null; - - @SerializedName("op_discovery_path") - private String opDiscoveryPath = null; - - public GetDiscoveryParams opConfigurationEndpoint(String opConfigurationEndpoint) { - this.opConfigurationEndpoint = opConfigurationEndpoint; - return this; - } - - /** - * The openid configuration endpoint URL. If missing, then `op_host` must be defined. - * @return opConfigurationEndpoint - **/ - @Schema(example = "https://op.example.com/acme/.well-known/openid-configuration", required = true, description = "The openid configuration endpoint URL. If missing, then `op_host` must be defined.") - public String getOpConfigurationEndpoint() { - return opConfigurationEndpoint; - } - - public void setOpConfigurationEndpoint(String opConfigurationEndpoint) { - this.opConfigurationEndpoint = opConfigurationEndpoint; - } - - public GetDiscoveryParams opHost(String opHost) { - this.opHost = opHost; - return this; - } - - /** - * Deprecated in favor of `op_configuration_endpoint`. It will be removed in future version(s). Provide the URL of OpenID Provider (OP) in this field. If missing, then `op_configuration_endpoint` must be defined. - * @return opHost - **/ - @Schema(example = "https://", description = "Deprecated in favor of `op_configuration_endpoint`. It will be removed in future version(s). Provide the URL of OpenID Provider (OP) in this field. If missing, then `op_configuration_endpoint` must be defined.") - public String getOpHost() { - return opHost; - } - - public void setOpHost(String opHost) { - this.opHost = opHost; - } - - public GetDiscoveryParams opDiscoveryPath(String opDiscoveryPath) { - this.opDiscoveryPath = opDiscoveryPath; - return this; - } - - /** - * Deprecated in favor of `op_configuration_endpoint`. It will be removed in future version(s). Provide path to the OpenID Connect Provider's discovery document in this field. For example, if it is 'https://example.com/.well-known/openid-configuration' then the path is blank. But if it is 'https://example.com/oxauth/.well-known/openid-configuration' then the path is '/oxauth' - * @return opDiscoveryPath - **/ - @Schema(example = "/oxauth", description = "Deprecated in favor of `op_configuration_endpoint`. It will be removed in future version(s). Provide path to the OpenID Connect Provider's discovery document in this field. For example, if it is 'https://example.com/.well-known/openid-configuration' then the path is blank. But if it is 'https://example.com/oxauth/.well-known/openid-configuration' then the path is '/oxauth'") - public String getOpDiscoveryPath() { - return opDiscoveryPath; - } - - public void setOpDiscoveryPath(String opDiscoveryPath) { - this.opDiscoveryPath = opDiscoveryPath; - } - - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - GetDiscoveryParams getDiscoveryParams = (GetDiscoveryParams) o; - return Objects.equals(this.opConfigurationEndpoint, getDiscoveryParams.opConfigurationEndpoint) && - Objects.equals(this.opHost, getDiscoveryParams.opHost) && - Objects.equals(this.opDiscoveryPath, getDiscoveryParams.opDiscoveryPath); - } - - @Override - public int hashCode() { - return Objects.hash(opConfigurationEndpoint, opHost, opDiscoveryPath); - } - - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class GetDiscoveryParams {\n"); - - sb.append(" opConfigurationEndpoint: ").append(toIndentedString(opConfigurationEndpoint)).append("\n"); - sb.append(" opHost: ").append(toIndentedString(opHost)).append("\n"); - sb.append(" opDiscoveryPath: ").append(toIndentedString(opDiscoveryPath)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - -} diff --git a/jans-client-api/gen-client/src/main/java/io/swagger/client/model/GetDiscoveryResponse.java b/jans-client-api/gen-client/src/main/java/io/swagger/client/model/GetDiscoveryResponse.java deleted file mode 100644 index 73d200d4b9d..00000000000 --- a/jans-client-api/gen-client/src/main/java/io/swagger/client/model/GetDiscoveryResponse.java +++ /dev/null @@ -1,1281 +0,0 @@ -/* - * jans-api-server - * jans-api-server - * - * OpenAPI spec version: 4.2 - * Contact: yuriyz@gluu.org - * - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen.git - * Do not edit the class manually. - */ - -package io.swagger.client.model; - -import java.util.Objects; -import java.util.Arrays; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import io.swagger.v3.oas.annotations.media.Schema; -import java.io.IOException; -import java.util.ArrayList; -import java.util.List; -/** - * GetDiscoveryResponse - */ - - -public class GetDiscoveryResponse { - @SerializedName("issuer") - private String issuer = null; - - @SerializedName("authorization_endpoint") - private String authorizationEndpoint = null; - - @SerializedName("token_endpoint") - private String tokenEndpoint = null; - - @SerializedName("token_revocation_endpoint") - private String tokenRevocationEndpoint = null; - - @SerializedName("user_info_endpoint") - private String userInfoEndpoint = null; - - @SerializedName("client_info_endpoint") - private String clientInfoEndpoint = null; - - @SerializedName("check_session_iframe") - private String checkSessionIframe = null; - - @SerializedName("end_session_endpoint") - private String endSessionEndpoint = null; - - @SerializedName("jwks_uri") - private String jwksUri = null; - - @SerializedName("registration_endpoint") - private String registrationEndpoint = null; - - @SerializedName("id_generation_endpoint") - private String idGenerationEndpoint = null; - - @SerializedName("introspection_endpoint") - private String introspectionEndpoint = null; - - @SerializedName("scopes_supported") - private List scopesSupported = null; - - @SerializedName("response_types_supported") - private List responseTypesSupported = null; - - @SerializedName("grant_types_supported") - private List grantTypesSupported = null; - - @SerializedName("acr_values_supported") - private List acrValuesSupported = null; - - @SerializedName("subject_types_supported") - private List subjectTypesSupported = null; - - @SerializedName("user_info_signing_alg_values_supported") - private List userInfoSigningAlgValuesSupported = null; - - @SerializedName("user_info_encryption_alg_values_supported") - private List userInfoEncryptionAlgValuesSupported = null; - - @SerializedName("user_info_encryption_enc_values_supported") - private List userInfoEncryptionEncValuesSupported = null; - - @SerializedName("id_token_signing_alg_values_supported") - private List idTokenSigningAlgValuesSupported = null; - - @SerializedName("id_token_encryption_alg_values_supported") - private List idTokenEncryptionAlgValuesSupported = null; - - @SerializedName("id_token_encryption_enc_values_supported") - private List idTokenEncryptionEncValuesSupported = null; - - @SerializedName("request_object_signing_alg_values_supported") - private List requestObjectSigningAlgValuesSupported = null; - - @SerializedName("request_object_encryption_alg_values_supported") - private List requestObjectEncryptionAlgValuesSupported = null; - - @SerializedName("request_object_encryption_enc_values_supported") - private List requestObjectEncryptionEncValuesSupported = null; - - @SerializedName("token_endpoint_auth_methods_supported") - private List tokenEndpointAuthMethodsSupported = null; - - @SerializedName("token_endpoint_auth_signing_alg_values_supported") - private List tokenEndpointAuthSigningAlgValuesSupported = null; - - @SerializedName("display_values_supported") - private List displayValuesSupported = null; - - @SerializedName("claim_types_supported") - private List claimTypesSupported = null; - - @SerializedName("claims_supported") - private List claimsSupported = null; - - @SerializedName("id_token_token_binding_cnf_values_supported") - private List idTokenTokenBindingCnfValuesSupported = null; - - @SerializedName("service_documentation") - private String serviceDocumentation = null; - - @SerializedName("claims_locales_supported") - private List claimsLocalesSupported = null; - - @SerializedName("ui_locales_supported") - private List uiLocalesSupported = null; - - @SerializedName("claims_parameter_supported") - private Boolean claimsParameterSupported = null; - - @SerializedName("request_parameter_supported") - private Boolean requestParameterSupported = null; - - @SerializedName("request_uri_parameter_supported") - private Boolean requestUriParameterSupported = null; - - @SerializedName("require_request_uri_registration") - private Boolean requireRequestUriRegistration = null; - - @SerializedName("tls_client_certificate_bound_access_tokens") - private Boolean tlsClientCertificateBoundAccessTokens = null; - - @SerializedName("front_channel_logout_supported") - private Boolean frontChannelLogoutSupported = null; - - @SerializedName("front_channel_logout_session_supported") - private Boolean frontChannelLogoutSessionSupported = null; - - @SerializedName("op_policy_uri") - private String opPolicyUri = null; - - @SerializedName("op_tos_uri") - private String opTosUri = null; - - @SerializedName("scope_to_claims_mapping") - private Object scopeToClaimsMapping = null; - - public GetDiscoveryResponse issuer(String issuer) { - this.issuer = issuer; - return this; - } - - /** - * Get issuer - * @return issuer - **/ - @Schema(example = "https://", description = "") - public String getIssuer() { - return issuer; - } - - public void setIssuer(String issuer) { - this.issuer = issuer; - } - - public GetDiscoveryResponse authorizationEndpoint(String authorizationEndpoint) { - this.authorizationEndpoint = authorizationEndpoint; - return this; - } - - /** - * Get authorizationEndpoint - * @return authorizationEndpoint - **/ - @Schema(example = "https:///oxauth/restv1/authorize", description = "") - public String getAuthorizationEndpoint() { - return authorizationEndpoint; - } - - public void setAuthorizationEndpoint(String authorizationEndpoint) { - this.authorizationEndpoint = authorizationEndpoint; - } - - public GetDiscoveryResponse tokenEndpoint(String tokenEndpoint) { - this.tokenEndpoint = tokenEndpoint; - return this; - } - - /** - * Get tokenEndpoint - * @return tokenEndpoint - **/ - @Schema(example = "https:///oxauth/restv1/token", description = "") - public String getTokenEndpoint() { - return tokenEndpoint; - } - - public void setTokenEndpoint(String tokenEndpoint) { - this.tokenEndpoint = tokenEndpoint; - } - - public GetDiscoveryResponse tokenRevocationEndpoint(String tokenRevocationEndpoint) { - this.tokenRevocationEndpoint = tokenRevocationEndpoint; - return this; - } - - /** - * Get tokenRevocationEndpoint - * @return tokenRevocationEndpoint - **/ - @Schema(example = "https:///oxauth/restv1/token/v1", description = "") - public String getTokenRevocationEndpoint() { - return tokenRevocationEndpoint; - } - - public void setTokenRevocationEndpoint(String tokenRevocationEndpoint) { - this.tokenRevocationEndpoint = tokenRevocationEndpoint; - } - - public GetDiscoveryResponse userInfoEndpoint(String userInfoEndpoint) { - this.userInfoEndpoint = userInfoEndpoint; - return this; - } - - /** - * Get userInfoEndpoint - * @return userInfoEndpoint - **/ - @Schema(example = "https:///oxauth/restv1/userinfo", description = "") - public String getUserInfoEndpoint() { - return userInfoEndpoint; - } - - public void setUserInfoEndpoint(String userInfoEndpoint) { - this.userInfoEndpoint = userInfoEndpoint; - } - - public GetDiscoveryResponse clientInfoEndpoint(String clientInfoEndpoint) { - this.clientInfoEndpoint = clientInfoEndpoint; - return this; - } - - /** - * Get clientInfoEndpoint - * @return clientInfoEndpoint - **/ - @Schema(example = "https:///oxauth/restv1/clientinfo", description = "") - public String getClientInfoEndpoint() { - return clientInfoEndpoint; - } - - public void setClientInfoEndpoint(String clientInfoEndpoint) { - this.clientInfoEndpoint = clientInfoEndpoint; - } - - public GetDiscoveryResponse checkSessionIframe(String checkSessionIframe) { - this.checkSessionIframe = checkSessionIframe; - return this; - } - - /** - * Get checkSessionIframe - * @return checkSessionIframe - **/ - @Schema(example = "https:///oxauth/opiframe.htm", description = "") - public String getCheckSessionIframe() { - return checkSessionIframe; - } - - public void setCheckSessionIframe(String checkSessionIframe) { - this.checkSessionIframe = checkSessionIframe; - } - - public GetDiscoveryResponse endSessionEndpoint(String endSessionEndpoint) { - this.endSessionEndpoint = endSessionEndpoint; - return this; - } - - /** - * Get endSessionEndpoint - * @return endSessionEndpoint - **/ - @Schema(example = "https:///oxauth/restv1/end_session", description = "") - public String getEndSessionEndpoint() { - return endSessionEndpoint; - } - - public void setEndSessionEndpoint(String endSessionEndpoint) { - this.endSessionEndpoint = endSessionEndpoint; - } - - public GetDiscoveryResponse jwksUri(String jwksUri) { - this.jwksUri = jwksUri; - return this; - } - - /** - * Get jwksUri - * @return jwksUri - **/ - @Schema(example = "https:///oxauth/restv1/jwks", description = "") - public String getJwksUri() { - return jwksUri; - } - - public void setJwksUri(String jwksUri) { - this.jwksUri = jwksUri; - } - - public GetDiscoveryResponse registrationEndpoint(String registrationEndpoint) { - this.registrationEndpoint = registrationEndpoint; - return this; - } - - /** - * Get registrationEndpoint - * @return registrationEndpoint - **/ - @Schema(example = "https:///oxauth/restv1/register", description = "") - public String getRegistrationEndpoint() { - return registrationEndpoint; - } - - public void setRegistrationEndpoint(String registrationEndpoint) { - this.registrationEndpoint = registrationEndpoint; - } - - public GetDiscoveryResponse idGenerationEndpoint(String idGenerationEndpoint) { - this.idGenerationEndpoint = idGenerationEndpoint; - return this; - } - - /** - * Get idGenerationEndpoint - * @return idGenerationEndpoint - **/ - @Schema(example = "https:///oxauth/restv1/id", description = "") - public String getIdGenerationEndpoint() { - return idGenerationEndpoint; - } - - public void setIdGenerationEndpoint(String idGenerationEndpoint) { - this.idGenerationEndpoint = idGenerationEndpoint; - } - - public GetDiscoveryResponse introspectionEndpoint(String introspectionEndpoint) { - this.introspectionEndpoint = introspectionEndpoint; - return this; - } - - /** - * Get introspectionEndpoint - * @return introspectionEndpoint - **/ - @Schema(example = "https:///oxauth/restv1/introspection", description = "") - public String getIntrospectionEndpoint() { - return introspectionEndpoint; - } - - public void setIntrospectionEndpoint(String introspectionEndpoint) { - this.introspectionEndpoint = introspectionEndpoint; - } - - public GetDiscoveryResponse scopesSupported(List scopesSupported) { - this.scopesSupported = scopesSupported; - return this; - } - - public GetDiscoveryResponse addScopesSupportedItem(String scopesSupportedItem) { - if (this.scopesSupported == null) { - this.scopesSupported = new ArrayList(); - } - this.scopesSupported.add(scopesSupportedItem); - return this; - } - - /** - * Get scopesSupported - * @return scopesSupported - **/ - @Schema(example = "[\"owner\",\"casa\",\"address\",\"clientinfo\",\"user_name\",\"openid\",\"profile\",\"uma_protection\",\"admin\",\"permission\",\"manage\",\"phone\",\"mobile_phone\",\"name\",\"rp\",\"email\"]", description = "") - public List getScopesSupported() { - return scopesSupported; - } - - public void setScopesSupported(List scopesSupported) { - this.scopesSupported = scopesSupported; - } - - public GetDiscoveryResponse responseTypesSupported(List responseTypesSupported) { - this.responseTypesSupported = responseTypesSupported; - return this; - } - - public GetDiscoveryResponse addResponseTypesSupportedItem(String responseTypesSupportedItem) { - if (this.responseTypesSupported == null) { - this.responseTypesSupported = new ArrayList(); - } - this.responseTypesSupported.add(responseTypesSupportedItem); - return this; - } - - /** - * Get responseTypesSupported - * @return responseTypesSupported - **/ - @Schema(example = "[\"token id_token\",\"token code id_token\",\"token\",\"token code\",\"code\",\"code id_token\",\"id_token\"]", description = "") - public List getResponseTypesSupported() { - return responseTypesSupported; - } - - public void setResponseTypesSupported(List responseTypesSupported) { - this.responseTypesSupported = responseTypesSupported; - } - - public GetDiscoveryResponse grantTypesSupported(List grantTypesSupported) { - this.grantTypesSupported = grantTypesSupported; - return this; - } - - public GetDiscoveryResponse addGrantTypesSupportedItem(String grantTypesSupportedItem) { - if (this.grantTypesSupported == null) { - this.grantTypesSupported = new ArrayList(); - } - this.grantTypesSupported.add(grantTypesSupportedItem); - return this; - } - - /** - * Get grantTypesSupported - * @return grantTypesSupported - **/ - @Schema(example = "[\"authorization_code\",\"refresh_token\",\"urn:ietf:params:oauth:grant-type:uma-ticket\",\"password\",\"implicit\",\"client_credentials\"]", description = "") - public List getGrantTypesSupported() { - return grantTypesSupported; - } - - public void setGrantTypesSupported(List grantTypesSupported) { - this.grantTypesSupported = grantTypesSupported; - } - - public GetDiscoveryResponse acrValuesSupported(List acrValuesSupported) { - this.acrValuesSupported = acrValuesSupported; - return this; - } - - public GetDiscoveryResponse addAcrValuesSupportedItem(String acrValuesSupportedItem) { - if (this.acrValuesSupported == null) { - this.acrValuesSupported = new ArrayList(); - } - this.acrValuesSupported.add(acrValuesSupportedItem); - return this; - } - - /** - * Get acrValuesSupported - * @return acrValuesSupported - **/ - @Schema(example = "[\"u2f\",\"super_gluu\",\"otp\",\"auth_ldap_server\"]", description = "") - public List getAcrValuesSupported() { - return acrValuesSupported; - } - - public void setAcrValuesSupported(List acrValuesSupported) { - this.acrValuesSupported = acrValuesSupported; - } - - public GetDiscoveryResponse subjectTypesSupported(List subjectTypesSupported) { - this.subjectTypesSupported = subjectTypesSupported; - return this; - } - - public GetDiscoveryResponse addSubjectTypesSupportedItem(String subjectTypesSupportedItem) { - if (this.subjectTypesSupported == null) { - this.subjectTypesSupported = new ArrayList(); - } - this.subjectTypesSupported.add(subjectTypesSupportedItem); - return this; - } - - /** - * Get subjectTypesSupported - * @return subjectTypesSupported - **/ - @Schema(example = "[\"public\",\"pairwise\"]", description = "") - public List getSubjectTypesSupported() { - return subjectTypesSupported; - } - - public void setSubjectTypesSupported(List subjectTypesSupported) { - this.subjectTypesSupported = subjectTypesSupported; - } - - public GetDiscoveryResponse userInfoSigningAlgValuesSupported(List userInfoSigningAlgValuesSupported) { - this.userInfoSigningAlgValuesSupported = userInfoSigningAlgValuesSupported; - return this; - } - - public GetDiscoveryResponse addUserInfoSigningAlgValuesSupportedItem(String userInfoSigningAlgValuesSupportedItem) { - if (this.userInfoSigningAlgValuesSupported == null) { - this.userInfoSigningAlgValuesSupported = new ArrayList(); - } - this.userInfoSigningAlgValuesSupported.add(userInfoSigningAlgValuesSupportedItem); - return this; - } - - /** - * Get userInfoSigningAlgValuesSupported - * @return userInfoSigningAlgValuesSupported - **/ - @Schema(example = "[\"HS256\",\"HS384\",\"HS512\",\"RS256\",\"RS384\",\"RS512\",\"ES256\",\"ES384\",\"ES512\"]", description = "") - public List getUserInfoSigningAlgValuesSupported() { - return userInfoSigningAlgValuesSupported; - } - - public void setUserInfoSigningAlgValuesSupported(List userInfoSigningAlgValuesSupported) { - this.userInfoSigningAlgValuesSupported = userInfoSigningAlgValuesSupported; - } - - public GetDiscoveryResponse userInfoEncryptionAlgValuesSupported(List userInfoEncryptionAlgValuesSupported) { - this.userInfoEncryptionAlgValuesSupported = userInfoEncryptionAlgValuesSupported; - return this; - } - - public GetDiscoveryResponse addUserInfoEncryptionAlgValuesSupportedItem(String userInfoEncryptionAlgValuesSupportedItem) { - if (this.userInfoEncryptionAlgValuesSupported == null) { - this.userInfoEncryptionAlgValuesSupported = new ArrayList(); - } - this.userInfoEncryptionAlgValuesSupported.add(userInfoEncryptionAlgValuesSupportedItem); - return this; - } - - /** - * Get userInfoEncryptionAlgValuesSupported - * @return userInfoEncryptionAlgValuesSupported - **/ - @Schema(example = "[\"RSA1_5\",\"RSA-OAEP\",\"A128KW\",\"A256KW\"]", description = "") - public List getUserInfoEncryptionAlgValuesSupported() { - return userInfoEncryptionAlgValuesSupported; - } - - public void setUserInfoEncryptionAlgValuesSupported(List userInfoEncryptionAlgValuesSupported) { - this.userInfoEncryptionAlgValuesSupported = userInfoEncryptionAlgValuesSupported; - } - - public GetDiscoveryResponse userInfoEncryptionEncValuesSupported(List userInfoEncryptionEncValuesSupported) { - this.userInfoEncryptionEncValuesSupported = userInfoEncryptionEncValuesSupported; - return this; - } - - public GetDiscoveryResponse addUserInfoEncryptionEncValuesSupportedItem(String userInfoEncryptionEncValuesSupportedItem) { - if (this.userInfoEncryptionEncValuesSupported == null) { - this.userInfoEncryptionEncValuesSupported = new ArrayList(); - } - this.userInfoEncryptionEncValuesSupported.add(userInfoEncryptionEncValuesSupportedItem); - return this; - } - - /** - * Get userInfoEncryptionEncValuesSupported - * @return userInfoEncryptionEncValuesSupported - **/ - @Schema(example = "[\"RSA1_5\",\"RSA-OAEP\",\"A128KW\",\"A256KW\"]", description = "") - public List getUserInfoEncryptionEncValuesSupported() { - return userInfoEncryptionEncValuesSupported; - } - - public void setUserInfoEncryptionEncValuesSupported(List userInfoEncryptionEncValuesSupported) { - this.userInfoEncryptionEncValuesSupported = userInfoEncryptionEncValuesSupported; - } - - public GetDiscoveryResponse idTokenSigningAlgValuesSupported(List idTokenSigningAlgValuesSupported) { - this.idTokenSigningAlgValuesSupported = idTokenSigningAlgValuesSupported; - return this; - } - - public GetDiscoveryResponse addIdTokenSigningAlgValuesSupportedItem(String idTokenSigningAlgValuesSupportedItem) { - if (this.idTokenSigningAlgValuesSupported == null) { - this.idTokenSigningAlgValuesSupported = new ArrayList(); - } - this.idTokenSigningAlgValuesSupported.add(idTokenSigningAlgValuesSupportedItem); - return this; - } - - /** - * Get idTokenSigningAlgValuesSupported - * @return idTokenSigningAlgValuesSupported - **/ - @Schema(example = "[\"none\",\"HS256\",\"HS384\",\"HS512\",\"RS256\",\"RS384\",\"RS512\",\"ES256\",\"ES384\",\"ES512\"]", description = "") - public List getIdTokenSigningAlgValuesSupported() { - return idTokenSigningAlgValuesSupported; - } - - public void setIdTokenSigningAlgValuesSupported(List idTokenSigningAlgValuesSupported) { - this.idTokenSigningAlgValuesSupported = idTokenSigningAlgValuesSupported; - } - - public GetDiscoveryResponse idTokenEncryptionAlgValuesSupported(List idTokenEncryptionAlgValuesSupported) { - this.idTokenEncryptionAlgValuesSupported = idTokenEncryptionAlgValuesSupported; - return this; - } - - public GetDiscoveryResponse addIdTokenEncryptionAlgValuesSupportedItem(String idTokenEncryptionAlgValuesSupportedItem) { - if (this.idTokenEncryptionAlgValuesSupported == null) { - this.idTokenEncryptionAlgValuesSupported = new ArrayList(); - } - this.idTokenEncryptionAlgValuesSupported.add(idTokenEncryptionAlgValuesSupportedItem); - return this; - } - - /** - * Get idTokenEncryptionAlgValuesSupported - * @return idTokenEncryptionAlgValuesSupported - **/ - @Schema(example = "[\"RSA1_5\",\"RSA-OAEP\",\"A128KW\",\"A256KW\"]", description = "") - public List getIdTokenEncryptionAlgValuesSupported() { - return idTokenEncryptionAlgValuesSupported; - } - - public void setIdTokenEncryptionAlgValuesSupported(List idTokenEncryptionAlgValuesSupported) { - this.idTokenEncryptionAlgValuesSupported = idTokenEncryptionAlgValuesSupported; - } - - public GetDiscoveryResponse idTokenEncryptionEncValuesSupported(List idTokenEncryptionEncValuesSupported) { - this.idTokenEncryptionEncValuesSupported = idTokenEncryptionEncValuesSupported; - return this; - } - - public GetDiscoveryResponse addIdTokenEncryptionEncValuesSupportedItem(String idTokenEncryptionEncValuesSupportedItem) { - if (this.idTokenEncryptionEncValuesSupported == null) { - this.idTokenEncryptionEncValuesSupported = new ArrayList(); - } - this.idTokenEncryptionEncValuesSupported.add(idTokenEncryptionEncValuesSupportedItem); - return this; - } - - /** - * Get idTokenEncryptionEncValuesSupported - * @return idTokenEncryptionEncValuesSupported - **/ - @Schema(example = "[\"A128CBC+HS256\",\"A256CBC+HS512\",\"A128GCM\",\"A256GCM\"]", description = "") - public List getIdTokenEncryptionEncValuesSupported() { - return idTokenEncryptionEncValuesSupported; - } - - public void setIdTokenEncryptionEncValuesSupported(List idTokenEncryptionEncValuesSupported) { - this.idTokenEncryptionEncValuesSupported = idTokenEncryptionEncValuesSupported; - } - - public GetDiscoveryResponse requestObjectSigningAlgValuesSupported(List requestObjectSigningAlgValuesSupported) { - this.requestObjectSigningAlgValuesSupported = requestObjectSigningAlgValuesSupported; - return this; - } - - public GetDiscoveryResponse addRequestObjectSigningAlgValuesSupportedItem(String requestObjectSigningAlgValuesSupportedItem) { - if (this.requestObjectSigningAlgValuesSupported == null) { - this.requestObjectSigningAlgValuesSupported = new ArrayList(); - } - this.requestObjectSigningAlgValuesSupported.add(requestObjectSigningAlgValuesSupportedItem); - return this; - } - - /** - * Get requestObjectSigningAlgValuesSupported - * @return requestObjectSigningAlgValuesSupported - **/ - @Schema(example = "[\"none\",\"HS256\",\"HS384\",\"HS512\",\"RS256\",\"RS384\",\"RS512\",\"ES256\",\"ES384\",\"ES512\"]", description = "") - public List getRequestObjectSigningAlgValuesSupported() { - return requestObjectSigningAlgValuesSupported; - } - - public void setRequestObjectSigningAlgValuesSupported(List requestObjectSigningAlgValuesSupported) { - this.requestObjectSigningAlgValuesSupported = requestObjectSigningAlgValuesSupported; - } - - public GetDiscoveryResponse requestObjectEncryptionAlgValuesSupported(List requestObjectEncryptionAlgValuesSupported) { - this.requestObjectEncryptionAlgValuesSupported = requestObjectEncryptionAlgValuesSupported; - return this; - } - - public GetDiscoveryResponse addRequestObjectEncryptionAlgValuesSupportedItem(String requestObjectEncryptionAlgValuesSupportedItem) { - if (this.requestObjectEncryptionAlgValuesSupported == null) { - this.requestObjectEncryptionAlgValuesSupported = new ArrayList(); - } - this.requestObjectEncryptionAlgValuesSupported.add(requestObjectEncryptionAlgValuesSupportedItem); - return this; - } - - /** - * Get requestObjectEncryptionAlgValuesSupported - * @return requestObjectEncryptionAlgValuesSupported - **/ - @Schema(example = "[\"RSA1_5\",\"RSA-OAEP\",\"A128KW\",\"A256KW\"]", description = "") - public List getRequestObjectEncryptionAlgValuesSupported() { - return requestObjectEncryptionAlgValuesSupported; - } - - public void setRequestObjectEncryptionAlgValuesSupported(List requestObjectEncryptionAlgValuesSupported) { - this.requestObjectEncryptionAlgValuesSupported = requestObjectEncryptionAlgValuesSupported; - } - - public GetDiscoveryResponse requestObjectEncryptionEncValuesSupported(List requestObjectEncryptionEncValuesSupported) { - this.requestObjectEncryptionEncValuesSupported = requestObjectEncryptionEncValuesSupported; - return this; - } - - public GetDiscoveryResponse addRequestObjectEncryptionEncValuesSupportedItem(String requestObjectEncryptionEncValuesSupportedItem) { - if (this.requestObjectEncryptionEncValuesSupported == null) { - this.requestObjectEncryptionEncValuesSupported = new ArrayList(); - } - this.requestObjectEncryptionEncValuesSupported.add(requestObjectEncryptionEncValuesSupportedItem); - return this; - } - - /** - * Get requestObjectEncryptionEncValuesSupported - * @return requestObjectEncryptionEncValuesSupported - **/ - @Schema(example = "[\"A128CBC+HS256\",\"A256CBC+HS512\",\"A128GCM\",\"A256GCM\"]", description = "") - public List getRequestObjectEncryptionEncValuesSupported() { - return requestObjectEncryptionEncValuesSupported; - } - - public void setRequestObjectEncryptionEncValuesSupported(List requestObjectEncryptionEncValuesSupported) { - this.requestObjectEncryptionEncValuesSupported = requestObjectEncryptionEncValuesSupported; - } - - public GetDiscoveryResponse tokenEndpointAuthMethodsSupported(List tokenEndpointAuthMethodsSupported) { - this.tokenEndpointAuthMethodsSupported = tokenEndpointAuthMethodsSupported; - return this; - } - - public GetDiscoveryResponse addTokenEndpointAuthMethodsSupportedItem(String tokenEndpointAuthMethodsSupportedItem) { - if (this.tokenEndpointAuthMethodsSupported == null) { - this.tokenEndpointAuthMethodsSupported = new ArrayList(); - } - this.tokenEndpointAuthMethodsSupported.add(tokenEndpointAuthMethodsSupportedItem); - return this; - } - - /** - * Get tokenEndpointAuthMethodsSupported - * @return tokenEndpointAuthMethodsSupported - **/ - @Schema(example = "[\"client_secret_basic\",\"client_secret_post\",\"client_secret_jwt\",\"private_key_jwt\"]", description = "") - public List getTokenEndpointAuthMethodsSupported() { - return tokenEndpointAuthMethodsSupported; - } - - public void setTokenEndpointAuthMethodsSupported(List tokenEndpointAuthMethodsSupported) { - this.tokenEndpointAuthMethodsSupported = tokenEndpointAuthMethodsSupported; - } - - public GetDiscoveryResponse tokenEndpointAuthSigningAlgValuesSupported(List tokenEndpointAuthSigningAlgValuesSupported) { - this.tokenEndpointAuthSigningAlgValuesSupported = tokenEndpointAuthSigningAlgValuesSupported; - return this; - } - - public GetDiscoveryResponse addTokenEndpointAuthSigningAlgValuesSupportedItem(String tokenEndpointAuthSigningAlgValuesSupportedItem) { - if (this.tokenEndpointAuthSigningAlgValuesSupported == null) { - this.tokenEndpointAuthSigningAlgValuesSupported = new ArrayList(); - } - this.tokenEndpointAuthSigningAlgValuesSupported.add(tokenEndpointAuthSigningAlgValuesSupportedItem); - return this; - } - - /** - * Get tokenEndpointAuthSigningAlgValuesSupported - * @return tokenEndpointAuthSigningAlgValuesSupported - **/ - @Schema(example = "[\"HS256\",\"HS384\",\"HS512\",\"RS256\",\"RS384\",\"RS512\",\"ES256\",\"ES384\",\"ES512\"]", description = "") - public List getTokenEndpointAuthSigningAlgValuesSupported() { - return tokenEndpointAuthSigningAlgValuesSupported; - } - - public void setTokenEndpointAuthSigningAlgValuesSupported(List tokenEndpointAuthSigningAlgValuesSupported) { - this.tokenEndpointAuthSigningAlgValuesSupported = tokenEndpointAuthSigningAlgValuesSupported; - } - - public GetDiscoveryResponse displayValuesSupported(List displayValuesSupported) { - this.displayValuesSupported = displayValuesSupported; - return this; - } - - public GetDiscoveryResponse addDisplayValuesSupportedItem(String displayValuesSupportedItem) { - if (this.displayValuesSupported == null) { - this.displayValuesSupported = new ArrayList(); - } - this.displayValuesSupported.add(displayValuesSupportedItem); - return this; - } - - /** - * Get displayValuesSupported - * @return displayValuesSupported - **/ - @Schema(example = "[\"page\",\"popup\"]", description = "") - public List getDisplayValuesSupported() { - return displayValuesSupported; - } - - public void setDisplayValuesSupported(List displayValuesSupported) { - this.displayValuesSupported = displayValuesSupported; - } - - public GetDiscoveryResponse claimTypesSupported(List claimTypesSupported) { - this.claimTypesSupported = claimTypesSupported; - return this; - } - - public GetDiscoveryResponse addClaimTypesSupportedItem(String claimTypesSupportedItem) { - if (this.claimTypesSupported == null) { - this.claimTypesSupported = new ArrayList(); - } - this.claimTypesSupported.add(claimTypesSupportedItem); - return this; - } - - /** - * Get claimTypesSupported - * @return claimTypesSupported - **/ - @Schema(example = "[\"normal\"]", description = "") - public List getClaimTypesSupported() { - return claimTypesSupported; - } - - public void setClaimTypesSupported(List claimTypesSupported) { - this.claimTypesSupported = claimTypesSupported; - } - - public GetDiscoveryResponse claimsSupported(List claimsSupported) { - this.claimsSupported = claimsSupported; - return this; - } - - public GetDiscoveryResponse addClaimsSupportedItem(String claimsSupportedItem) { - if (this.claimsSupported == null) { - this.claimsSupported = new ArrayList(); - } - this.claimsSupported.add(claimsSupportedItem); - return this; - } - - /** - * Get claimsSupported - * @return claimsSupported - **/ - @Schema(example = "[\"street_address\",\"country\",\"zoneinfo\",\"birthdate\",\"role\",\"gender\",\"formatted\",\"user_name\",\"phone_mobile_number\",\"preferred_username\",\"locale\",\"inum\",\"updated_at\",\"nickname\",\"email\",\"website\",\"email_verified\",\"profile\",\"locality\",\"phone_number_verified\",\"given_name\",\"middle_name\",\"picture\",\"name\",\"phone_number\",\"postal_code\",\"region\",\"family_name\"]", description = "") - public List getClaimsSupported() { - return claimsSupported; - } - - public void setClaimsSupported(List claimsSupported) { - this.claimsSupported = claimsSupported; - } - - public GetDiscoveryResponse idTokenTokenBindingCnfValuesSupported(List idTokenTokenBindingCnfValuesSupported) { - this.idTokenTokenBindingCnfValuesSupported = idTokenTokenBindingCnfValuesSupported; - return this; - } - - public GetDiscoveryResponse addIdTokenTokenBindingCnfValuesSupportedItem(String idTokenTokenBindingCnfValuesSupportedItem) { - if (this.idTokenTokenBindingCnfValuesSupported == null) { - this.idTokenTokenBindingCnfValuesSupported = new ArrayList(); - } - this.idTokenTokenBindingCnfValuesSupported.add(idTokenTokenBindingCnfValuesSupportedItem); - return this; - } - - /** - * Get idTokenTokenBindingCnfValuesSupported - * @return idTokenTokenBindingCnfValuesSupported - **/ - @Schema(example = "[\"tbh\"]", description = "") - public List getIdTokenTokenBindingCnfValuesSupported() { - return idTokenTokenBindingCnfValuesSupported; - } - - public void setIdTokenTokenBindingCnfValuesSupported(List idTokenTokenBindingCnfValuesSupported) { - this.idTokenTokenBindingCnfValuesSupported = idTokenTokenBindingCnfValuesSupported; - } - - public GetDiscoveryResponse serviceDocumentation(String serviceDocumentation) { - this.serviceDocumentation = serviceDocumentation; - return this; - } - - /** - * Get serviceDocumentation - * @return serviceDocumentation - **/ - @Schema(example = "http://", description = "") - public String getServiceDocumentation() { - return serviceDocumentation; - } - - public void setServiceDocumentation(String serviceDocumentation) { - this.serviceDocumentation = serviceDocumentation; - } - - public GetDiscoveryResponse claimsLocalesSupported(List claimsLocalesSupported) { - this.claimsLocalesSupported = claimsLocalesSupported; - return this; - } - - public GetDiscoveryResponse addClaimsLocalesSupportedItem(String claimsLocalesSupportedItem) { - if (this.claimsLocalesSupported == null) { - this.claimsLocalesSupported = new ArrayList(); - } - this.claimsLocalesSupported.add(claimsLocalesSupportedItem); - return this; - } - - /** - * Get claimsLocalesSupported - * @return claimsLocalesSupported - **/ - @Schema(example = "[\"en\"]", description = "") - public List getClaimsLocalesSupported() { - return claimsLocalesSupported; - } - - public void setClaimsLocalesSupported(List claimsLocalesSupported) { - this.claimsLocalesSupported = claimsLocalesSupported; - } - - public GetDiscoveryResponse uiLocalesSupported(List uiLocalesSupported) { - this.uiLocalesSupported = uiLocalesSupported; - return this; - } - - public GetDiscoveryResponse addUiLocalesSupportedItem(String uiLocalesSupportedItem) { - if (this.uiLocalesSupported == null) { - this.uiLocalesSupported = new ArrayList(); - } - this.uiLocalesSupported.add(uiLocalesSupportedItem); - return this; - } - - /** - * Get uiLocalesSupported - * @return uiLocalesSupported - **/ - @Schema(example = "[\"en\",\"es\"]", description = "") - public List getUiLocalesSupported() { - return uiLocalesSupported; - } - - public void setUiLocalesSupported(List uiLocalesSupported) { - this.uiLocalesSupported = uiLocalesSupported; - } - - public GetDiscoveryResponse claimsParameterSupported(Boolean claimsParameterSupported) { - this.claimsParameterSupported = claimsParameterSupported; - return this; - } - - /** - * Get claimsParameterSupported - * @return claimsParameterSupported - **/ - @Schema(example = "true", description = "") - public Boolean isClaimsParameterSupported() { - return claimsParameterSupported; - } - - public void setClaimsParameterSupported(Boolean claimsParameterSupported) { - this.claimsParameterSupported = claimsParameterSupported; - } - - public GetDiscoveryResponse requestParameterSupported(Boolean requestParameterSupported) { - this.requestParameterSupported = requestParameterSupported; - return this; - } - - /** - * Get requestParameterSupported - * @return requestParameterSupported - **/ - @Schema(example = "true", description = "") - public Boolean isRequestParameterSupported() { - return requestParameterSupported; - } - - public void setRequestParameterSupported(Boolean requestParameterSupported) { - this.requestParameterSupported = requestParameterSupported; - } - - public GetDiscoveryResponse requestUriParameterSupported(Boolean requestUriParameterSupported) { - this.requestUriParameterSupported = requestUriParameterSupported; - return this; - } - - /** - * Get requestUriParameterSupported - * @return requestUriParameterSupported - **/ - @Schema(example = "true", description = "") - public Boolean isRequestUriParameterSupported() { - return requestUriParameterSupported; - } - - public void setRequestUriParameterSupported(Boolean requestUriParameterSupported) { - this.requestUriParameterSupported = requestUriParameterSupported; - } - - public GetDiscoveryResponse requireRequestUriRegistration(Boolean requireRequestUriRegistration) { - this.requireRequestUriRegistration = requireRequestUriRegistration; - return this; - } - - /** - * Get requireRequestUriRegistration - * @return requireRequestUriRegistration - **/ - @Schema(example = "true", description = "") - public Boolean isRequireRequestUriRegistration() { - return requireRequestUriRegistration; - } - - public void setRequireRequestUriRegistration(Boolean requireRequestUriRegistration) { - this.requireRequestUriRegistration = requireRequestUriRegistration; - } - - public GetDiscoveryResponse tlsClientCertificateBoundAccessTokens(Boolean tlsClientCertificateBoundAccessTokens) { - this.tlsClientCertificateBoundAccessTokens = tlsClientCertificateBoundAccessTokens; - return this; - } - - /** - * Get tlsClientCertificateBoundAccessTokens - * @return tlsClientCertificateBoundAccessTokens - **/ - @Schema(example = "true", description = "") - public Boolean isTlsClientCertificateBoundAccessTokens() { - return tlsClientCertificateBoundAccessTokens; - } - - public void setTlsClientCertificateBoundAccessTokens(Boolean tlsClientCertificateBoundAccessTokens) { - this.tlsClientCertificateBoundAccessTokens = tlsClientCertificateBoundAccessTokens; - } - - public GetDiscoveryResponse frontChannelLogoutSupported(Boolean frontChannelLogoutSupported) { - this.frontChannelLogoutSupported = frontChannelLogoutSupported; - return this; - } - - /** - * Get frontChannelLogoutSupported - * @return frontChannelLogoutSupported - **/ - @Schema(example = "true", description = "") - public Boolean isFrontChannelLogoutSupported() { - return frontChannelLogoutSupported; - } - - public void setFrontChannelLogoutSupported(Boolean frontChannelLogoutSupported) { - this.frontChannelLogoutSupported = frontChannelLogoutSupported; - } - - public GetDiscoveryResponse frontChannelLogoutSessionSupported(Boolean frontChannelLogoutSessionSupported) { - this.frontChannelLogoutSessionSupported = frontChannelLogoutSessionSupported; - return this; - } - - /** - * Get frontChannelLogoutSessionSupported - * @return frontChannelLogoutSessionSupported - **/ - @Schema(example = "true", description = "") - public Boolean isFrontChannelLogoutSessionSupported() { - return frontChannelLogoutSessionSupported; - } - - public void setFrontChannelLogoutSessionSupported(Boolean frontChannelLogoutSessionSupported) { - this.frontChannelLogoutSessionSupported = frontChannelLogoutSessionSupported; - } - - public GetDiscoveryResponse opPolicyUri(String opPolicyUri) { - this.opPolicyUri = opPolicyUri; - return this; - } - - /** - * Get opPolicyUri - * @return opPolicyUri - **/ - @Schema(example = "http://", description = "") - public String getOpPolicyUri() { - return opPolicyUri; - } - - public void setOpPolicyUri(String opPolicyUri) { - this.opPolicyUri = opPolicyUri; - } - - public GetDiscoveryResponse opTosUri(String opTosUri) { - this.opTosUri = opTosUri; - return this; - } - - /** - * Get opTosUri - * @return opTosUri - **/ - @Schema(example = "http://", description = "") - public String getOpTosUri() { - return opTosUri; - } - - public void setOpTosUri(String opTosUri) { - this.opTosUri = opTosUri; - } - - public GetDiscoveryResponse scopeToClaimsMapping(Object scopeToClaimsMapping) { - this.scopeToClaimsMapping = scopeToClaimsMapping; - return this; - } - - /** - * Get scopeToClaimsMapping - * @return scopeToClaimsMapping - **/ - @Schema(example = "[{\"address\":[\"formatted\",\"postal_code\",\"street_address\",\"locality\",\"country\",\"region\"]},{\"owner\":[]},{\"manage\":[]},{\"profile\":[\"name\",\"family_name\",\"given_name\",\"middle_name\",\"nickname\",\"preferred_username\",\"profile\",\"picture\",\"website\",\"gender\",\"birthdate\",\"zoneinfo\",\"locale\",\"updated_at\"]},{\"mobile_phone\":[\"phone_mobile_number\"]},{\"phone\":[\"phone_number_verified\",\"phone_number\"]},{\"clientinfo\":[\"name\",\"inum\"]},{\"permission\":[\"role\"]},{\"rp\":[]},{\"email\":[\"email_verified\",\"email\"]},{\"casa\":[\"email\"]},{\"user_name\":[\"user_name\"]},{\"name\":[]},{\"openid\":[]},{\"uma_protection\":[]},{\"admin\":[]}]", description = "") - public Object getScopeToClaimsMapping() { - return scopeToClaimsMapping; - } - - public void setScopeToClaimsMapping(Object scopeToClaimsMapping) { - this.scopeToClaimsMapping = scopeToClaimsMapping; - } - - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - GetDiscoveryResponse getDiscoveryResponse = (GetDiscoveryResponse) o; - return Objects.equals(this.issuer, getDiscoveryResponse.issuer) && - Objects.equals(this.authorizationEndpoint, getDiscoveryResponse.authorizationEndpoint) && - Objects.equals(this.tokenEndpoint, getDiscoveryResponse.tokenEndpoint) && - Objects.equals(this.tokenRevocationEndpoint, getDiscoveryResponse.tokenRevocationEndpoint) && - Objects.equals(this.userInfoEndpoint, getDiscoveryResponse.userInfoEndpoint) && - Objects.equals(this.clientInfoEndpoint, getDiscoveryResponse.clientInfoEndpoint) && - Objects.equals(this.checkSessionIframe, getDiscoveryResponse.checkSessionIframe) && - Objects.equals(this.endSessionEndpoint, getDiscoveryResponse.endSessionEndpoint) && - Objects.equals(this.jwksUri, getDiscoveryResponse.jwksUri) && - Objects.equals(this.registrationEndpoint, getDiscoveryResponse.registrationEndpoint) && - Objects.equals(this.idGenerationEndpoint, getDiscoveryResponse.idGenerationEndpoint) && - Objects.equals(this.introspectionEndpoint, getDiscoveryResponse.introspectionEndpoint) && - Objects.equals(this.scopesSupported, getDiscoveryResponse.scopesSupported) && - Objects.equals(this.responseTypesSupported, getDiscoveryResponse.responseTypesSupported) && - Objects.equals(this.grantTypesSupported, getDiscoveryResponse.grantTypesSupported) && - Objects.equals(this.acrValuesSupported, getDiscoveryResponse.acrValuesSupported) && - Objects.equals(this.subjectTypesSupported, getDiscoveryResponse.subjectTypesSupported) && - Objects.equals(this.userInfoSigningAlgValuesSupported, getDiscoveryResponse.userInfoSigningAlgValuesSupported) && - Objects.equals(this.userInfoEncryptionAlgValuesSupported, getDiscoveryResponse.userInfoEncryptionAlgValuesSupported) && - Objects.equals(this.userInfoEncryptionEncValuesSupported, getDiscoveryResponse.userInfoEncryptionEncValuesSupported) && - Objects.equals(this.idTokenSigningAlgValuesSupported, getDiscoveryResponse.idTokenSigningAlgValuesSupported) && - Objects.equals(this.idTokenEncryptionAlgValuesSupported, getDiscoveryResponse.idTokenEncryptionAlgValuesSupported) && - Objects.equals(this.idTokenEncryptionEncValuesSupported, getDiscoveryResponse.idTokenEncryptionEncValuesSupported) && - Objects.equals(this.requestObjectSigningAlgValuesSupported, getDiscoveryResponse.requestObjectSigningAlgValuesSupported) && - Objects.equals(this.requestObjectEncryptionAlgValuesSupported, getDiscoveryResponse.requestObjectEncryptionAlgValuesSupported) && - Objects.equals(this.requestObjectEncryptionEncValuesSupported, getDiscoveryResponse.requestObjectEncryptionEncValuesSupported) && - Objects.equals(this.tokenEndpointAuthMethodsSupported, getDiscoveryResponse.tokenEndpointAuthMethodsSupported) && - Objects.equals(this.tokenEndpointAuthSigningAlgValuesSupported, getDiscoveryResponse.tokenEndpointAuthSigningAlgValuesSupported) && - Objects.equals(this.displayValuesSupported, getDiscoveryResponse.displayValuesSupported) && - Objects.equals(this.claimTypesSupported, getDiscoveryResponse.claimTypesSupported) && - Objects.equals(this.claimsSupported, getDiscoveryResponse.claimsSupported) && - Objects.equals(this.idTokenTokenBindingCnfValuesSupported, getDiscoveryResponse.idTokenTokenBindingCnfValuesSupported) && - Objects.equals(this.serviceDocumentation, getDiscoveryResponse.serviceDocumentation) && - Objects.equals(this.claimsLocalesSupported, getDiscoveryResponse.claimsLocalesSupported) && - Objects.equals(this.uiLocalesSupported, getDiscoveryResponse.uiLocalesSupported) && - Objects.equals(this.claimsParameterSupported, getDiscoveryResponse.claimsParameterSupported) && - Objects.equals(this.requestParameterSupported, getDiscoveryResponse.requestParameterSupported) && - Objects.equals(this.requestUriParameterSupported, getDiscoveryResponse.requestUriParameterSupported) && - Objects.equals(this.requireRequestUriRegistration, getDiscoveryResponse.requireRequestUriRegistration) && - Objects.equals(this.tlsClientCertificateBoundAccessTokens, getDiscoveryResponse.tlsClientCertificateBoundAccessTokens) && - Objects.equals(this.frontChannelLogoutSupported, getDiscoveryResponse.frontChannelLogoutSupported) && - Objects.equals(this.frontChannelLogoutSessionSupported, getDiscoveryResponse.frontChannelLogoutSessionSupported) && - Objects.equals(this.opPolicyUri, getDiscoveryResponse.opPolicyUri) && - Objects.equals(this.opTosUri, getDiscoveryResponse.opTosUri) && - Objects.equals(this.scopeToClaimsMapping, getDiscoveryResponse.scopeToClaimsMapping); - } - - @Override - public int hashCode() { - return Objects.hash(issuer, authorizationEndpoint, tokenEndpoint, tokenRevocationEndpoint, userInfoEndpoint, clientInfoEndpoint, checkSessionIframe, endSessionEndpoint, jwksUri, registrationEndpoint, idGenerationEndpoint, introspectionEndpoint, scopesSupported, responseTypesSupported, grantTypesSupported, acrValuesSupported, subjectTypesSupported, userInfoSigningAlgValuesSupported, userInfoEncryptionAlgValuesSupported, userInfoEncryptionEncValuesSupported, idTokenSigningAlgValuesSupported, idTokenEncryptionAlgValuesSupported, idTokenEncryptionEncValuesSupported, requestObjectSigningAlgValuesSupported, requestObjectEncryptionAlgValuesSupported, requestObjectEncryptionEncValuesSupported, tokenEndpointAuthMethodsSupported, tokenEndpointAuthSigningAlgValuesSupported, displayValuesSupported, claimTypesSupported, claimsSupported, idTokenTokenBindingCnfValuesSupported, serviceDocumentation, claimsLocalesSupported, uiLocalesSupported, claimsParameterSupported, requestParameterSupported, requestUriParameterSupported, requireRequestUriRegistration, tlsClientCertificateBoundAccessTokens, frontChannelLogoutSupported, frontChannelLogoutSessionSupported, opPolicyUri, opTosUri, scopeToClaimsMapping); - } - - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class GetDiscoveryResponse {\n"); - - sb.append(" issuer: ").append(toIndentedString(issuer)).append("\n"); - sb.append(" authorizationEndpoint: ").append(toIndentedString(authorizationEndpoint)).append("\n"); - sb.append(" tokenEndpoint: ").append(toIndentedString(tokenEndpoint)).append("\n"); - sb.append(" tokenRevocationEndpoint: ").append(toIndentedString(tokenRevocationEndpoint)).append("\n"); - sb.append(" userInfoEndpoint: ").append(toIndentedString(userInfoEndpoint)).append("\n"); - sb.append(" clientInfoEndpoint: ").append(toIndentedString(clientInfoEndpoint)).append("\n"); - sb.append(" checkSessionIframe: ").append(toIndentedString(checkSessionIframe)).append("\n"); - sb.append(" endSessionEndpoint: ").append(toIndentedString(endSessionEndpoint)).append("\n"); - sb.append(" jwksUri: ").append(toIndentedString(jwksUri)).append("\n"); - sb.append(" registrationEndpoint: ").append(toIndentedString(registrationEndpoint)).append("\n"); - sb.append(" idGenerationEndpoint: ").append(toIndentedString(idGenerationEndpoint)).append("\n"); - sb.append(" introspectionEndpoint: ").append(toIndentedString(introspectionEndpoint)).append("\n"); - sb.append(" scopesSupported: ").append(toIndentedString(scopesSupported)).append("\n"); - sb.append(" responseTypesSupported: ").append(toIndentedString(responseTypesSupported)).append("\n"); - sb.append(" grantTypesSupported: ").append(toIndentedString(grantTypesSupported)).append("\n"); - sb.append(" acrValuesSupported: ").append(toIndentedString(acrValuesSupported)).append("\n"); - sb.append(" subjectTypesSupported: ").append(toIndentedString(subjectTypesSupported)).append("\n"); - sb.append(" userInfoSigningAlgValuesSupported: ").append(toIndentedString(userInfoSigningAlgValuesSupported)).append("\n"); - sb.append(" userInfoEncryptionAlgValuesSupported: ").append(toIndentedString(userInfoEncryptionAlgValuesSupported)).append("\n"); - sb.append(" userInfoEncryptionEncValuesSupported: ").append(toIndentedString(userInfoEncryptionEncValuesSupported)).append("\n"); - sb.append(" idTokenSigningAlgValuesSupported: ").append(toIndentedString(idTokenSigningAlgValuesSupported)).append("\n"); - sb.append(" idTokenEncryptionAlgValuesSupported: ").append(toIndentedString(idTokenEncryptionAlgValuesSupported)).append("\n"); - sb.append(" idTokenEncryptionEncValuesSupported: ").append(toIndentedString(idTokenEncryptionEncValuesSupported)).append("\n"); - sb.append(" requestObjectSigningAlgValuesSupported: ").append(toIndentedString(requestObjectSigningAlgValuesSupported)).append("\n"); - sb.append(" requestObjectEncryptionAlgValuesSupported: ").append(toIndentedString(requestObjectEncryptionAlgValuesSupported)).append("\n"); - sb.append(" requestObjectEncryptionEncValuesSupported: ").append(toIndentedString(requestObjectEncryptionEncValuesSupported)).append("\n"); - sb.append(" tokenEndpointAuthMethodsSupported: ").append(toIndentedString(tokenEndpointAuthMethodsSupported)).append("\n"); - sb.append(" tokenEndpointAuthSigningAlgValuesSupported: ").append(toIndentedString(tokenEndpointAuthSigningAlgValuesSupported)).append("\n"); - sb.append(" displayValuesSupported: ").append(toIndentedString(displayValuesSupported)).append("\n"); - sb.append(" claimTypesSupported: ").append(toIndentedString(claimTypesSupported)).append("\n"); - sb.append(" claimsSupported: ").append(toIndentedString(claimsSupported)).append("\n"); - sb.append(" idTokenTokenBindingCnfValuesSupported: ").append(toIndentedString(idTokenTokenBindingCnfValuesSupported)).append("\n"); - sb.append(" serviceDocumentation: ").append(toIndentedString(serviceDocumentation)).append("\n"); - sb.append(" claimsLocalesSupported: ").append(toIndentedString(claimsLocalesSupported)).append("\n"); - sb.append(" uiLocalesSupported: ").append(toIndentedString(uiLocalesSupported)).append("\n"); - sb.append(" claimsParameterSupported: ").append(toIndentedString(claimsParameterSupported)).append("\n"); - sb.append(" requestParameterSupported: ").append(toIndentedString(requestParameterSupported)).append("\n"); - sb.append(" requestUriParameterSupported: ").append(toIndentedString(requestUriParameterSupported)).append("\n"); - sb.append(" requireRequestUriRegistration: ").append(toIndentedString(requireRequestUriRegistration)).append("\n"); - sb.append(" tlsClientCertificateBoundAccessTokens: ").append(toIndentedString(tlsClientCertificateBoundAccessTokens)).append("\n"); - sb.append(" frontChannelLogoutSupported: ").append(toIndentedString(frontChannelLogoutSupported)).append("\n"); - sb.append(" frontChannelLogoutSessionSupported: ").append(toIndentedString(frontChannelLogoutSessionSupported)).append("\n"); - sb.append(" opPolicyUri: ").append(toIndentedString(opPolicyUri)).append("\n"); - sb.append(" opTosUri: ").append(toIndentedString(opTosUri)).append("\n"); - sb.append(" scopeToClaimsMapping: ").append(toIndentedString(scopeToClaimsMapping)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - -} diff --git a/jans-client-api/gen-client/src/main/java/io/swagger/client/model/GetIssuerParams.java b/jans-client-api/gen-client/src/main/java/io/swagger/client/model/GetIssuerParams.java deleted file mode 100644 index 32c1b9e2694..00000000000 --- a/jans-client-api/gen-client/src/main/java/io/swagger/client/model/GetIssuerParams.java +++ /dev/null @@ -1,160 +0,0 @@ -/* - * jans-api-server - * jans-api-server - * - * OpenAPI spec version: 4.2 - * Contact: yuriyz@gluu.org - * - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen.git - * Do not edit the class manually. - */ - -package io.swagger.client.model; - -import java.util.Objects; -import java.util.Arrays; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import io.swagger.v3.oas.annotations.media.Schema; -import java.io.IOException; -/** - * GetIssuerParams - */ - - -public class GetIssuerParams { - @SerializedName("op_configuration_endpoint") - private String opConfigurationEndpoint = null; - - @SerializedName("op_host") - private String opHost = null; - - @SerializedName("op_discovery_path") - private String opDiscoveryPath = null; - - @SerializedName("resource") - private String resource = null; - - public GetIssuerParams opConfigurationEndpoint(String opConfigurationEndpoint) { - this.opConfigurationEndpoint = opConfigurationEndpoint; - return this; - } - - /** - * The openid configuration endpoint URL. If missing, then `op_host` must be defined. - * @return opConfigurationEndpoint - **/ - @Schema(example = "https://op.example.com/acme/.well-known/openid-configuration", required = true, description = "The openid configuration endpoint URL. If missing, then `op_host` must be defined.") - public String getOpConfigurationEndpoint() { - return opConfigurationEndpoint; - } - - public void setOpConfigurationEndpoint(String opConfigurationEndpoint) { - this.opConfigurationEndpoint = opConfigurationEndpoint; - } - - public GetIssuerParams opHost(String opHost) { - this.opHost = opHost; - return this; - } - - /** - * Deprecated in favor of `op_configuration_endpoint`. It will be removed in future version(s). Provide the URL of OpenID Provider (OP) in this field. If missing, then `op_configuration_endpoint` must be defined. - * @return opHost - **/ - @Schema(example = "https://", description = "Deprecated in favor of `op_configuration_endpoint`. It will be removed in future version(s). Provide the URL of OpenID Provider (OP) in this field. If missing, then `op_configuration_endpoint` must be defined.") - public String getOpHost() { - return opHost; - } - - public void setOpHost(String opHost) { - this.opHost = opHost; - } - - public GetIssuerParams opDiscoveryPath(String opDiscoveryPath) { - this.opDiscoveryPath = opDiscoveryPath; - return this; - } - - /** - * Deprecated in favor of `op_configuration_endpoint`. It will be removed in future version(s). Provide path to the OpenID Connect Provider's discovery document in this field. For example, if it is 'https://example.com/.well-known/openid-configuration' then the path is blank. But if it is 'https://example.com/oxauth/.well-known/openid-configuration' then the path is '/oxauth' - * @return opDiscoveryPath - **/ - @Schema(example = "/oxauth", description = "Deprecated in favor of `op_configuration_endpoint`. It will be removed in future version(s). Provide path to the OpenID Connect Provider's discovery document in this field. For example, if it is 'https://example.com/.well-known/openid-configuration' then the path is blank. But if it is 'https://example.com/oxauth/.well-known/openid-configuration' then the path is '/oxauth'") - public String getOpDiscoveryPath() { - return opDiscoveryPath; - } - - public void setOpDiscoveryPath(String opDiscoveryPath) { - this.opDiscoveryPath = opDiscoveryPath; - } - - public GetIssuerParams resource(String resource) { - this.resource = resource; - return this; - } - - /** - * Identifier for the target End-User that is the subject of the discovery request. - * @return resource - **/ - @Schema(example = "admin@jenkins-ldap.gluu.org", required = true, description = "Identifier for the target End-User that is the subject of the discovery request.") - public String getResource() { - return resource; - } - - public void setResource(String resource) { - this.resource = resource; - } - - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - GetIssuerParams getIssuerParams = (GetIssuerParams) o; - return Objects.equals(this.opConfigurationEndpoint, getIssuerParams.opConfigurationEndpoint) && - Objects.equals(this.opHost, getIssuerParams.opHost) && - Objects.equals(this.opDiscoveryPath, getIssuerParams.opDiscoveryPath) && - Objects.equals(this.resource, getIssuerParams.resource); - } - - @Override - public int hashCode() { - return Objects.hash(opConfigurationEndpoint, opHost, opDiscoveryPath, resource); - } - - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class GetIssuerParams {\n"); - - sb.append(" opConfigurationEndpoint: ").append(toIndentedString(opConfigurationEndpoint)).append("\n"); - sb.append(" opHost: ").append(toIndentedString(opHost)).append("\n"); - sb.append(" opDiscoveryPath: ").append(toIndentedString(opDiscoveryPath)).append("\n"); - sb.append(" resource: ").append(toIndentedString(resource)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - -} diff --git a/jans-client-api/gen-client/src/main/java/io/swagger/client/model/GetIssuerResponse.java b/jans-client-api/gen-client/src/main/java/io/swagger/client/model/GetIssuerResponse.java deleted file mode 100644 index 8653a55a9f6..00000000000 --- a/jans-client-api/gen-client/src/main/java/io/swagger/client/model/GetIssuerResponse.java +++ /dev/null @@ -1,125 +0,0 @@ -/* - * jans-api-server - * jans-api-server - * - * OpenAPI spec version: 4.2 - * Contact: yuriyz@gluu.org - * - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen.git - * Do not edit the class manually. - */ - -package io.swagger.client.model; - -import java.util.Objects; -import java.util.Arrays; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import io.swagger.client.model.WebFingerLink; -import io.swagger.v3.oas.annotations.media.Schema; -import java.io.IOException; -import java.util.ArrayList; -import java.util.List; -/** - * GetIssuerResponse - */ - - -public class GetIssuerResponse { - @SerializedName("subject") - private String subject = null; - - @SerializedName("links") - private List links = null; - - public GetIssuerResponse subject(String subject) { - this.subject = subject; - return this; - } - - /** - * Get subject - * @return subject - **/ - @Schema(example = "admin@jenkins-ldap.gluu.org", description = "") - public String getSubject() { - return subject; - } - - public void setSubject(String subject) { - this.subject = subject; - } - - public GetIssuerResponse links(List links) { - this.links = links; - return this; - } - - public GetIssuerResponse addLinksItem(WebFingerLink linksItem) { - if (this.links == null) { - this.links = new ArrayList(); - } - this.links.add(linksItem); - return this; - } - - /** - * Get links - * @return links - **/ - @Schema(description = "") - public List getLinks() { - return links; - } - - public void setLinks(List links) { - this.links = links; - } - - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - GetIssuerResponse getIssuerResponse = (GetIssuerResponse) o; - return Objects.equals(this.subject, getIssuerResponse.subject) && - Objects.equals(this.links, getIssuerResponse.links); - } - - @Override - public int hashCode() { - return Objects.hash(subject, links); - } - - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class GetIssuerResponse {\n"); - - sb.append(" subject: ").append(toIndentedString(subject)).append("\n"); - sb.append(" links: ").append(toIndentedString(links)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - -} diff --git a/jans-client-api/gen-client/src/main/java/io/swagger/client/model/GetJwksParams.java b/jans-client-api/gen-client/src/main/java/io/swagger/client/model/GetJwksParams.java deleted file mode 100644 index 2d125ab403b..00000000000 --- a/jans-client-api/gen-client/src/main/java/io/swagger/client/model/GetJwksParams.java +++ /dev/null @@ -1,137 +0,0 @@ -/* - * jans-api-server - * jans-api-server - * - * OpenAPI spec version: 4.2 - * Contact: yuriyz@gluu.org - * - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen.git - * Do not edit the class manually. - */ - -package io.swagger.client.model; - -import java.util.Objects; -import java.util.Arrays; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import io.swagger.v3.oas.annotations.media.Schema; -import java.io.IOException; -/** - * GetJwksParams - */ - - -public class GetJwksParams { - @SerializedName("op_configuration_endpoint") - private String opConfigurationEndpoint = null; - - @SerializedName("op_host") - private String opHost = null; - - @SerializedName("op_discovery_path") - private String opDiscoveryPath = null; - - public GetJwksParams opConfigurationEndpoint(String opConfigurationEndpoint) { - this.opConfigurationEndpoint = opConfigurationEndpoint; - return this; - } - - /** - * The openid configuration endpoint URL. If missing, then `op_host` must be defined. - * @return opConfigurationEndpoint - **/ - @Schema(example = "https://op.example.com/acme/.well-known/openid-configuration", required = true, description = "The openid configuration endpoint URL. If missing, then `op_host` must be defined.") - public String getOpConfigurationEndpoint() { - return opConfigurationEndpoint; - } - - public void setOpConfigurationEndpoint(String opConfigurationEndpoint) { - this.opConfigurationEndpoint = opConfigurationEndpoint; - } - - public GetJwksParams opHost(String opHost) { - this.opHost = opHost; - return this; - } - - /** - * Deprecated in favor of `op_configuration_endpoint`. It will be removed in future version(s). Provide the URL of OpenID Provider (OP) in this field. If missing, then `op_configuration_endpoint` must be defined. - * @return opHost - **/ - @Schema(example = "https://", description = "Deprecated in favor of `op_configuration_endpoint`. It will be removed in future version(s). Provide the URL of OpenID Provider (OP) in this field. If missing, then `op_configuration_endpoint` must be defined.") - public String getOpHost() { - return opHost; - } - - public void setOpHost(String opHost) { - this.opHost = opHost; - } - - public GetJwksParams opDiscoveryPath(String opDiscoveryPath) { - this.opDiscoveryPath = opDiscoveryPath; - return this; - } - - /** - * Deprecated in favor of `op_configuration_endpoint`. It will be removed in future version(s). Provide path to the OpenID Connect Provider's discovery document in this field. For example, if it is 'https://example.com/.well-known/openid-configuration' then the path is blank. But if it is 'https://example.com/oxauth/.well-known/openid-configuration' then the path is '/oxauth' - * @return opDiscoveryPath - **/ - @Schema(example = "/oxauth", description = "Deprecated in favor of `op_configuration_endpoint`. It will be removed in future version(s). Provide path to the OpenID Connect Provider's discovery document in this field. For example, if it is 'https://example.com/.well-known/openid-configuration' then the path is blank. But if it is 'https://example.com/oxauth/.well-known/openid-configuration' then the path is '/oxauth'") - public String getOpDiscoveryPath() { - return opDiscoveryPath; - } - - public void setOpDiscoveryPath(String opDiscoveryPath) { - this.opDiscoveryPath = opDiscoveryPath; - } - - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - GetJwksParams getJwksParams = (GetJwksParams) o; - return Objects.equals(this.opConfigurationEndpoint, getJwksParams.opConfigurationEndpoint) && - Objects.equals(this.opHost, getJwksParams.opHost) && - Objects.equals(this.opDiscoveryPath, getJwksParams.opDiscoveryPath); - } - - @Override - public int hashCode() { - return Objects.hash(opConfigurationEndpoint, opHost, opDiscoveryPath); - } - - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class GetJwksParams {\n"); - - sb.append(" opConfigurationEndpoint: ").append(toIndentedString(opConfigurationEndpoint)).append("\n"); - sb.append(" opHost: ").append(toIndentedString(opHost)).append("\n"); - sb.append(" opDiscoveryPath: ").append(toIndentedString(opDiscoveryPath)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - -} diff --git a/jans-client-api/gen-client/src/main/java/io/swagger/client/model/GetJwksResponse.java b/jans-client-api/gen-client/src/main/java/io/swagger/client/model/GetJwksResponse.java deleted file mode 100644 index 4fe618279ab..00000000000 --- a/jans-client-api/gen-client/src/main/java/io/swagger/client/model/GetJwksResponse.java +++ /dev/null @@ -1,99 +0,0 @@ -/* - * jans-api-server - * jans-api-server - * - * OpenAPI spec version: 4.2 - * Contact: yuriyz@gluu.org - * - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen.git - * Do not edit the class manually. - */ - -package io.swagger.client.model; - -import java.util.Objects; -import java.util.Arrays; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import io.swagger.client.model.JsonWebKey; -import io.swagger.v3.oas.annotations.media.Schema; -import java.io.IOException; -import java.util.ArrayList; -import java.util.List; -/** - * GetJwksResponse - */ - - -public class GetJwksResponse { - @SerializedName("keys") - private List keys = new ArrayList(); - - public GetJwksResponse keys(List keys) { - this.keys = keys; - return this; - } - - public GetJwksResponse addKeysItem(JsonWebKey keysItem) { - this.keys.add(keysItem); - return this; - } - - /** - * Get keys - * @return keys - **/ - @Schema(required = true, description = "") - public List getKeys() { - return keys; - } - - public void setKeys(List keys) { - this.keys = keys; - } - - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - GetJwksResponse getJwksResponse = (GetJwksResponse) o; - return Objects.equals(this.keys, getJwksResponse.keys); - } - - @Override - public int hashCode() { - return Objects.hash(keys); - } - - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class GetJwksResponse {\n"); - - sb.append(" keys: ").append(toIndentedString(keys)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - -} diff --git a/jans-client-api/gen-client/src/main/java/io/swagger/client/model/GetLogoutUriParams.java b/jans-client-api/gen-client/src/main/java/io/swagger/client/model/GetLogoutUriParams.java deleted file mode 100644 index 0908652ebfa..00000000000 --- a/jans-client-api/gen-client/src/main/java/io/swagger/client/model/GetLogoutUriParams.java +++ /dev/null @@ -1,183 +0,0 @@ -/* - * jans-api-server - * jans-api-server - * - * OpenAPI spec version: 4.2 - * Contact: yuriyz@gluu.org - * - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen.git - * Do not edit the class manually. - */ - -package io.swagger.client.model; - -import java.util.Objects; -import java.util.Arrays; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import io.swagger.v3.oas.annotations.media.Schema; -import java.io.IOException; -/** - * GetLogoutUriParams - */ - - -public class GetLogoutUriParams { - @SerializedName("rp_id") - private String rpId = null; - - @SerializedName("id_token_hint") - private String idTokenHint = null; - - @SerializedName("post_logout_redirect_uri") - private String postLogoutRedirectUri = null; - - @SerializedName("state") - private String state = null; - - @SerializedName("session_state") - private String sessionState = null; - - public GetLogoutUriParams rpId(String rpId) { - this.rpId = rpId; - return this; - } - - /** - * Get rpId - * @return rpId - **/ - @Schema(example = "bcad760f-91ba-46e1-a020-05e4281d91b6", required = true, description = "") - public String getRpId() { - return rpId; - } - - public void setRpId(String rpId) { - this.rpId = rpId; - } - - public GetLogoutUriParams idTokenHint(String idTokenHint) { - this.idTokenHint = idTokenHint; - return this; - } - - /** - * Get idTokenHint - * @return idTokenHint - **/ - @Schema(example = "eyJ0 ... NiJ9.eyJ1c ... I6IjIifX0.DeWt4Qu ... ZXso", required = true, description = "") - public String getIdTokenHint() { - return idTokenHint; - } - - public void setIdTokenHint(String idTokenHint) { - this.idTokenHint = idTokenHint; - } - - public GetLogoutUriParams postLogoutRedirectUri(String postLogoutRedirectUri) { - this.postLogoutRedirectUri = postLogoutRedirectUri; - return this; - } - - /** - * Get postLogoutRedirectUri - * @return postLogoutRedirectUri - **/ - @Schema(example = "https://client.example.org/cb", required = true, description = "") - public String getPostLogoutRedirectUri() { - return postLogoutRedirectUri; - } - - public void setPostLogoutRedirectUri(String postLogoutRedirectUri) { - this.postLogoutRedirectUri = postLogoutRedirectUri; - } - - public GetLogoutUriParams state(String state) { - this.state = state; - return this; - } - - /** - * Get state - * @return state - **/ - @Schema(required = true, description = "") - public String getState() { - return state; - } - - public void setState(String state) { - this.state = state; - } - - public GetLogoutUriParams sessionState(String sessionState) { - this.sessionState = sessionState; - return this; - } - - /** - * Get sessionState - * @return sessionState - **/ - @Schema(required = true, description = "") - public String getSessionState() { - return sessionState; - } - - public void setSessionState(String sessionState) { - this.sessionState = sessionState; - } - - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - GetLogoutUriParams getLogoutUriParams = (GetLogoutUriParams) o; - return Objects.equals(this.rpId, getLogoutUriParams.rpId) && - Objects.equals(this.idTokenHint, getLogoutUriParams.idTokenHint) && - Objects.equals(this.postLogoutRedirectUri, getLogoutUriParams.postLogoutRedirectUri) && - Objects.equals(this.state, getLogoutUriParams.state) && - Objects.equals(this.sessionState, getLogoutUriParams.sessionState); - } - - @Override - public int hashCode() { - return Objects.hash(rpId, idTokenHint, postLogoutRedirectUri, state, sessionState); - } - - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class GetLogoutUriParams {\n"); - - sb.append(" rpId: ").append(toIndentedString(rpId)).append("\n"); - sb.append(" idTokenHint: ").append(toIndentedString(idTokenHint)).append("\n"); - sb.append(" postLogoutRedirectUri: ").append(toIndentedString(postLogoutRedirectUri)).append("\n"); - sb.append(" state: ").append(toIndentedString(state)).append("\n"); - sb.append(" sessionState: ").append(toIndentedString(sessionState)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - -} diff --git a/jans-client-api/gen-client/src/main/java/io/swagger/client/model/GetLogoutUriResponse.java b/jans-client-api/gen-client/src/main/java/io/swagger/client/model/GetLogoutUriResponse.java deleted file mode 100644 index f37003a2cfa..00000000000 --- a/jans-client-api/gen-client/src/main/java/io/swagger/client/model/GetLogoutUriResponse.java +++ /dev/null @@ -1,91 +0,0 @@ -/* - * jans-api-server - * jans-api-server - * - * OpenAPI spec version: 4.2 - * Contact: yuriyz@gluu.org - * - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen.git - * Do not edit the class manually. - */ - -package io.swagger.client.model; - -import java.util.Objects; -import java.util.Arrays; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import io.swagger.v3.oas.annotations.media.Schema; -import java.io.IOException; -/** - * GetLogoutUriResponse - */ - - -public class GetLogoutUriResponse { - @SerializedName("uri") - private String uri = null; - - public GetLogoutUriResponse uri(String uri) { - this.uri = uri; - return this; - } - - /** - * Get uri - * @return uri - **/ - @Schema(example = "https:///oxauth/seam/resource/restv1/oxauth/end_session?id_token_hint=eyJraWQiOiI1YmM2ZGM3MS0xYjA1LTQ5YzMtYWU3MC0zYTg4Y2ZiMjQwN2QiLCJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJpc3MiOiJodHRwczovL2NlLWRldi5nbHV1Lm9yZyIsImF1ZCI6IkAhNUE1OC5BRTBELkQzODMuMUU0NiEwMDAxIUUzOEIuN0RCRSEwMDA4IUE3MTkuOTU4QS41QjdGLkVBQkMiLCJleHAiOjE0OTAwMTk5MjEsImlhdCI6MTQ5MDAxNjMyMSwibm9uY2UiOiJkNGdsbmtndHAxYWlqZ3JnY3V2cGp1N2k3cCIsImF1dGhfdGltZSI6MTQ5MDAxNjI3MiwiYXRfaGFzaCI6Im1Xa2NXQzZ6NC1qN0ZNX0ctX0tYMWciLCJveFZhbGlkYXRpb25VUkkiOiJodHRwczovL2NlLWRldi5nbHV1Lm9yZy9veGF1dGgvb3BpZnJhbWUiLCJveE9wZW5JRENvbm5lY3RWZXJzaW9uIjoib3BlbmlkY29ubmVjdC0xLjAiLCJzdWIiOiJONHRLRncyLVpDWTVWN0FhQmdpMnNHRWdDR0t0Tlg2LS01M2FQbmZFYk5zIn0.PvCdzPnMwqPNUw1bzd8tvzpJqYu-P2iCTnELr85ZaJTG8_Fdj3EruLgUBa-emeum3j29cFgdjFPx6WplfCV1GnehOieXjDiAAE85fy-stxXwII3xrva5ZjG0FnTYnJLoRmy0BWMjFC2IdCoISJI9imcfvmQmlvNmU0EjLS02cJf3JAaqEaM-FJWdQv8end9-Sq2bcp6ME3voRjV30ps_7jcDdlM_hW3M_e3RdrXYCDifbl_1jaNip5tb6_bLpgTADDoLT3fTvACRN057e2GCkSYdxvVhIjfDsjnOhk5n3TDcWedriu99H8-sNXyI_aBr3HAXd37CsgmdfIJcgUNJJw", required = true, description = "") - public String getUri() { - return uri; - } - - public void setUri(String uri) { - this.uri = uri; - } - - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - GetLogoutUriResponse getLogoutUriResponse = (GetLogoutUriResponse) o; - return Objects.equals(this.uri, getLogoutUriResponse.uri); - } - - @Override - public int hashCode() { - return Objects.hash(uri); - } - - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class GetLogoutUriResponse {\n"); - - sb.append(" uri: ").append(toIndentedString(uri)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - -} diff --git a/jans-client-api/gen-client/src/main/java/io/swagger/client/model/GetRequestObjectUriParams.java b/jans-client-api/gen-client/src/main/java/io/swagger/client/model/GetRequestObjectUriParams.java deleted file mode 100644 index 183bde708d3..00000000000 --- a/jans-client-api/gen-client/src/main/java/io/swagger/client/model/GetRequestObjectUriParams.java +++ /dev/null @@ -1,171 +0,0 @@ -/* - * jans-api-server - * jans-api-server - * - * OpenAPI spec version: 4.2 - * Contact: yuriyz@gluu.org - * - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen.git - * Do not edit the class manually. - */ - -package io.swagger.client.model; - -import java.util.Objects; -import java.util.Arrays; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import io.swagger.v3.oas.annotations.media.Schema; -import java.io.IOException; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -/** - * GetRequestObjectUriParams - */ - - -public class GetRequestObjectUriParams { - @SerializedName("rp_id") - private String rpId = null; - - @SerializedName("params") - private Map params = null; - - @SerializedName("request_object_signing_alg") - private String requestObjectSigningAlg = null; - - @SerializedName("rp_host_url") - private String rpHostUrl = null; - - public GetRequestObjectUriParams rpId(String rpId) { - this.rpId = rpId; - return this; - } - - /** - * Get rpId - * @return rpId - **/ - @Schema(example = "bcad760f-91ba-46e1-a020-05e4281d91b6", required = true, description = "") - public String getRpId() { - return rpId; - } - - public void setRpId(String rpId) { - this.rpId = rpId; - } - - public GetRequestObjectUriParams params(Map params) { - this.params = params; - return this; - } - - public GetRequestObjectUriParams putParamsItem(String key, Object paramsItem) { - if (this.params == null) { - this.params = new HashMap(); - } - this.params.put(key, paramsItem); - return this; - } - - /** - * Get params - * @return params - **/ - @Schema(description = "") - public Map getParams() { - return params; - } - - public void setParams(Map params) { - this.params = params; - } - - public GetRequestObjectUriParams requestObjectSigningAlg(String requestObjectSigningAlg) { - this.requestObjectSigningAlg = requestObjectSigningAlg; - return this; - } - - /** - * choose the JWS alg algorithm (JWA) that must be required by the Authorization Server. Valid values are none, HS256, HS384, HS512, RS256, RS384, RS512, ES256, ES384, ES512, PS256, PS384, PS512 - * @return requestObjectSigningAlg - **/ - @Schema(example = "RS256", description = "choose the JWS alg algorithm (JWA) that must be required by the Authorization Server. Valid values are none, HS256, HS384, HS512, RS256, RS384, RS512, ES256, ES384, ES512, PS256, PS384, PS512") - public String getRequestObjectSigningAlg() { - return requestObjectSigningAlg; - } - - public void setRequestObjectSigningAlg(String requestObjectSigningAlg) { - this.requestObjectSigningAlg = requestObjectSigningAlg; - } - - public GetRequestObjectUriParams rpHostUrl(String rpHostUrl) { - this.rpHostUrl = rpHostUrl; - return this; - } - - /** - * Get rpHostUrl - * @return rpHostUrl - **/ - @Schema(example = "https://", required = true, description = "") - public String getRpHostUrl() { - return rpHostUrl; - } - - public void setRpHostUrl(String rpHostUrl) { - this.rpHostUrl = rpHostUrl; - } - - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - GetRequestObjectUriParams getRequestObjectUriParams = (GetRequestObjectUriParams) o; - return Objects.equals(this.rpId, getRequestObjectUriParams.rpId) && - Objects.equals(this.params, getRequestObjectUriParams.params) && - Objects.equals(this.requestObjectSigningAlg, getRequestObjectUriParams.requestObjectSigningAlg) && - Objects.equals(this.rpHostUrl, getRequestObjectUriParams.rpHostUrl); - } - - @Override - public int hashCode() { - return Objects.hash(rpId, params, requestObjectSigningAlg, rpHostUrl); - } - - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class GetRequestObjectUriParams {\n"); - - sb.append(" rpId: ").append(toIndentedString(rpId)).append("\n"); - sb.append(" params: ").append(toIndentedString(params)).append("\n"); - sb.append(" requestObjectSigningAlg: ").append(toIndentedString(requestObjectSigningAlg)).append("\n"); - sb.append(" rpHostUrl: ").append(toIndentedString(rpHostUrl)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - -} diff --git a/jans-client-api/gen-client/src/main/java/io/swagger/client/model/GetRequestObjectUriResponse.java b/jans-client-api/gen-client/src/main/java/io/swagger/client/model/GetRequestObjectUriResponse.java deleted file mode 100644 index f04e531b81b..00000000000 --- a/jans-client-api/gen-client/src/main/java/io/swagger/client/model/GetRequestObjectUriResponse.java +++ /dev/null @@ -1,91 +0,0 @@ -/* - * jans-api-server - * jans-api-server - * - * OpenAPI spec version: 4.2 - * Contact: yuriyz@gluu.org - * - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen.git - * Do not edit the class manually. - */ - -package io.swagger.client.model; - -import java.util.Objects; -import java.util.Arrays; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import io.swagger.v3.oas.annotations.media.Schema; -import java.io.IOException; -/** - * GetRequestObjectUriResponse - */ - - -public class GetRequestObjectUriResponse { - @SerializedName("request_uri") - private String requestUri = null; - - public GetRequestObjectUriResponse requestUri(String requestUri) { - this.requestUri = requestUri; - return this; - } - - /** - * Get requestUri - * @return requestUri - **/ - @Schema(example = "https:///get-request-object/d871gpie16np0f5kfv936sc33k", required = true, description = "") - public String getRequestUri() { - return requestUri; - } - - public void setRequestUri(String requestUri) { - this.requestUri = requestUri; - } - - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - GetRequestObjectUriResponse getRequestObjectUriResponse = (GetRequestObjectUriResponse) o; - return Objects.equals(this.requestUri, getRequestObjectUriResponse.requestUri); - } - - @Override - public int hashCode() { - return Objects.hash(requestUri); - } - - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class GetRequestObjectUriResponse {\n"); - - sb.append(" requestUri: ").append(toIndentedString(requestUri)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - -} diff --git a/jans-client-api/gen-client/src/main/java/io/swagger/client/model/GetRpJwksResponse.java b/jans-client-api/gen-client/src/main/java/io/swagger/client/model/GetRpJwksResponse.java deleted file mode 100644 index 59e3756f28f..00000000000 --- a/jans-client-api/gen-client/src/main/java/io/swagger/client/model/GetRpJwksResponse.java +++ /dev/null @@ -1,99 +0,0 @@ -/* - * jans-api-server - * jans-api-server - * - * OpenAPI spec version: 4.2 - * Contact: yuriyz@gluu.org - * - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen.git - * Do not edit the class manually. - */ - -package io.swagger.client.model; - -import java.util.Objects; -import java.util.Arrays; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import io.swagger.client.model.JsonWebKey; -import io.swagger.v3.oas.annotations.media.Schema; -import java.io.IOException; -import java.util.ArrayList; -import java.util.List; -/** - * GetRpJwksResponse - */ - - -public class GetRpJwksResponse { - @SerializedName("keys") - private List keys = new ArrayList(); - - public GetRpJwksResponse keys(List keys) { - this.keys = keys; - return this; - } - - public GetRpJwksResponse addKeysItem(JsonWebKey keysItem) { - this.keys.add(keysItem); - return this; - } - - /** - * Get keys - * @return keys - **/ - @Schema(required = true, description = "") - public List getKeys() { - return keys; - } - - public void setKeys(List keys) { - this.keys = keys; - } - - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - GetRpJwksResponse getRpJwksResponse = (GetRpJwksResponse) o; - return Objects.equals(this.keys, getRpJwksResponse.keys); - } - - @Override - public int hashCode() { - return Objects.hash(keys); - } - - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class GetRpJwksResponse {\n"); - - sb.append(" keys: ").append(toIndentedString(keys)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - -} diff --git a/jans-client-api/gen-client/src/main/java/io/swagger/client/model/GetTokensByCodeParams.java b/jans-client-api/gen-client/src/main/java/io/swagger/client/model/GetTokensByCodeParams.java deleted file mode 100644 index a8296d90781..00000000000 --- a/jans-client-api/gen-client/src/main/java/io/swagger/client/model/GetTokensByCodeParams.java +++ /dev/null @@ -1,183 +0,0 @@ -/* - * jans-api-server - * jans-api-server - * - * OpenAPI spec version: 4.2 - * Contact: yuriyz@gluu.org - * - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen.git - * Do not edit the class manually. - */ - -package io.swagger.client.model; - -import java.util.Objects; -import java.util.Arrays; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import io.swagger.v3.oas.annotations.media.Schema; -import java.io.IOException; -/** - * GetTokensByCodeParams - */ - - -public class GetTokensByCodeParams { - @SerializedName("rp_id") - private String rpId = null; - - @SerializedName("code") - private String code = null; - - @SerializedName("state") - private String state = null; - - @SerializedName("authentication_method") - private String authenticationMethod = null; - - @SerializedName("algorithm") - private String algorithm = null; - - public GetTokensByCodeParams rpId(String rpId) { - this.rpId = rpId; - return this; - } - - /** - * Get rpId - * @return rpId - **/ - @Schema(example = "bcad760f-91ba-46e1-a020-05e4281d91b6", required = true, description = "") - public String getRpId() { - return rpId; - } - - public void setRpId(String rpId) { - this.rpId = rpId; - } - - public GetTokensByCodeParams code(String code) { - this.code = code; - return this; - } - - /** - * Get code - * @return code - **/ - @Schema(example = "0b9f1518-15aa-47b2-9477-d4c607447e18", required = true, description = "") - public String getCode() { - return code; - } - - public void setCode(String code) { - this.code = code; - } - - public GetTokensByCodeParams state(String state) { - this.state = state; - return this; - } - - /** - * Get state - * @return state - **/ - @Schema(example = "6q1ec90hn6ui4ipigv91hrbodj", required = true, description = "") - public String getState() { - return state; - } - - public void setState(String state) { - this.state = state; - } - - public GetTokensByCodeParams authenticationMethod(String authenticationMethod) { - this.authenticationMethod = authenticationMethod; - return this; - } - - /** - * if value is missed then basic authentication is used. Otherwise it's possible to set `private_key_jwt` value for Private Key authentication. - * @return authenticationMethod - **/ - @Schema(description = "if value is missed then basic authentication is used. Otherwise it's possible to set `private_key_jwt` value for Private Key authentication.") - public String getAuthenticationMethod() { - return authenticationMethod; - } - - public void setAuthenticationMethod(String authenticationMethod) { - this.authenticationMethod = authenticationMethod; - } - - public GetTokensByCodeParams algorithm(String algorithm) { - this.algorithm = algorithm; - return this; - } - - /** - * optional but is required if authentication_method=private_key_jwt. Valid values are none, HS256, HS384, HS512, RS256, RS384, RS512, ES256, ES384, ES512 - * @return algorithm - **/ - @Schema(description = "optional but is required if authentication_method=private_key_jwt. Valid values are none, HS256, HS384, HS512, RS256, RS384, RS512, ES256, ES384, ES512") - public String getAlgorithm() { - return algorithm; - } - - public void setAlgorithm(String algorithm) { - this.algorithm = algorithm; - } - - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - GetTokensByCodeParams getTokensByCodeParams = (GetTokensByCodeParams) o; - return Objects.equals(this.rpId, getTokensByCodeParams.rpId) && - Objects.equals(this.code, getTokensByCodeParams.code) && - Objects.equals(this.state, getTokensByCodeParams.state) && - Objects.equals(this.authenticationMethod, getTokensByCodeParams.authenticationMethod) && - Objects.equals(this.algorithm, getTokensByCodeParams.algorithm); - } - - @Override - public int hashCode() { - return Objects.hash(rpId, code, state, authenticationMethod, algorithm); - } - - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class GetTokensByCodeParams {\n"); - - sb.append(" rpId: ").append(toIndentedString(rpId)).append("\n"); - sb.append(" code: ").append(toIndentedString(code)).append("\n"); - sb.append(" state: ").append(toIndentedString(state)).append("\n"); - sb.append(" authenticationMethod: ").append(toIndentedString(authenticationMethod)).append("\n"); - sb.append(" algorithm: ").append(toIndentedString(algorithm)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - -} diff --git a/jans-client-api/gen-client/src/main/java/io/swagger/client/model/GetTokensByCodeResponse.java b/jans-client-api/gen-client/src/main/java/io/swagger/client/model/GetTokensByCodeResponse.java deleted file mode 100644 index a7db91726aa..00000000000 --- a/jans-client-api/gen-client/src/main/java/io/swagger/client/model/GetTokensByCodeResponse.java +++ /dev/null @@ -1,183 +0,0 @@ -/* - * jans-api-server - * jans-api-server - * - * OpenAPI spec version: 4.2 - * Contact: yuriyz@gluu.org - * - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen.git - * Do not edit the class manually. - */ - -package io.swagger.client.model; - -import java.util.Objects; -import java.util.Arrays; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import io.swagger.v3.oas.annotations.media.Schema; -import java.io.IOException; -/** - * GetTokensByCodeResponse - */ - - -public class GetTokensByCodeResponse { - @SerializedName("access_token") - private String accessToken = null; - - @SerializedName("expires_in") - private Integer expiresIn = null; - - @SerializedName("id_token") - private String idToken = null; - - @SerializedName("refresh_token") - private String refreshToken = null; - - @SerializedName("id_token_claims") - private Object idTokenClaims = null; - - public GetTokensByCodeResponse accessToken(String accessToken) { - this.accessToken = accessToken; - return this; - } - - /** - * Get accessToken - * @return accessToken - **/ - @Schema(example = "b75434ff-f465-4b70-92e4-b7ba6b6c58f2", required = true, description = "") - public String getAccessToken() { - return accessToken; - } - - public void setAccessToken(String accessToken) { - this.accessToken = accessToken; - } - - public GetTokensByCodeResponse expiresIn(Integer expiresIn) { - this.expiresIn = expiresIn; - return this; - } - - /** - * Get expiresIn - * @return expiresIn - **/ - @Schema(example = "299", required = true, description = "") - public Integer getExpiresIn() { - return expiresIn; - } - - public void setExpiresIn(Integer expiresIn) { - this.expiresIn = expiresIn; - } - - public GetTokensByCodeResponse idToken(String idToken) { - this.idToken = idToken; - return this; - } - - /** - * Get idToken - * @return idToken - **/ - @Schema(example = "eyJraWQiOiI5MTUyNTU1Ni04YmIwLTQ2MzYtYTFhYy05ZGVlNjlhMDBmYWUiLCJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJp", required = true, description = "") - public String getIdToken() { - return idToken; - } - - public void setIdToken(String idToken) { - this.idToken = idToken; - } - - public GetTokensByCodeResponse refreshToken(String refreshToken) { - this.refreshToken = refreshToken; - return this; - } - - /** - * Get refreshToken - * @return refreshToken - **/ - @Schema(example = "33d7988e-6ffb-4fe5-8c2a-0e158691d446", required = true, description = "") - public String getRefreshToken() { - return refreshToken; - } - - public void setRefreshToken(String refreshToken) { - this.refreshToken = refreshToken; - } - - public GetTokensByCodeResponse idTokenClaims(Object idTokenClaims) { - this.idTokenClaims = idTokenClaims; - return this; - } - - /** - * Get idTokenClaims - * @return idTokenClaims - **/ - @Schema(required = true, description = "") - public Object getIdTokenClaims() { - return idTokenClaims; - } - - public void setIdTokenClaims(Object idTokenClaims) { - this.idTokenClaims = idTokenClaims; - } - - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - GetTokensByCodeResponse getTokensByCodeResponse = (GetTokensByCodeResponse) o; - return Objects.equals(this.accessToken, getTokensByCodeResponse.accessToken) && - Objects.equals(this.expiresIn, getTokensByCodeResponse.expiresIn) && - Objects.equals(this.idToken, getTokensByCodeResponse.idToken) && - Objects.equals(this.refreshToken, getTokensByCodeResponse.refreshToken) && - Objects.equals(this.idTokenClaims, getTokensByCodeResponse.idTokenClaims); - } - - @Override - public int hashCode() { - return Objects.hash(accessToken, expiresIn, idToken, refreshToken, idTokenClaims); - } - - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class GetTokensByCodeResponse {\n"); - - sb.append(" accessToken: ").append(toIndentedString(accessToken)).append("\n"); - sb.append(" expiresIn: ").append(toIndentedString(expiresIn)).append("\n"); - sb.append(" idToken: ").append(toIndentedString(idToken)).append("\n"); - sb.append(" refreshToken: ").append(toIndentedString(refreshToken)).append("\n"); - sb.append(" idTokenClaims: ").append(toIndentedString(idTokenClaims)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - -} diff --git a/jans-client-api/gen-client/src/main/java/io/swagger/client/model/GetUserInfoParams.java b/jans-client-api/gen-client/src/main/java/io/swagger/client/model/GetUserInfoParams.java deleted file mode 100644 index d0fba9c4e67..00000000000 --- a/jans-client-api/gen-client/src/main/java/io/swagger/client/model/GetUserInfoParams.java +++ /dev/null @@ -1,137 +0,0 @@ -/* - * jans-api-server - * jans-api-server - * - * OpenAPI spec version: 4.2 - * Contact: yuriyz@gluu.org - * - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen.git - * Do not edit the class manually. - */ - -package io.swagger.client.model; - -import java.util.Objects; -import java.util.Arrays; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import io.swagger.v3.oas.annotations.media.Schema; -import java.io.IOException; -/** - * GetUserInfoParams - */ - - -public class GetUserInfoParams { - @SerializedName("rp_id") - private String rpId = null; - - @SerializedName("access_token") - private String accessToken = null; - - @SerializedName("id_token") - private String idToken = null; - - public GetUserInfoParams rpId(String rpId) { - this.rpId = rpId; - return this; - } - - /** - * Get rpId - * @return rpId - **/ - @Schema(example = "bcad760f-91ba-46e1-a020-05e4281d91b6", required = true, description = "") - public String getRpId() { - return rpId; - } - - public void setRpId(String rpId) { - this.rpId = rpId; - } - - public GetUserInfoParams accessToken(String accessToken) { - this.accessToken = accessToken; - return this; - } - - /** - * Get accessToken - * @return accessToken - **/ - @Schema(example = "88bba7f5-961c-4b71-8053-9ab35f1ad395", required = true, description = "") - public String getAccessToken() { - return accessToken; - } - - public void setAccessToken(String accessToken) { - this.accessToken = accessToken; - } - - public GetUserInfoParams idToken(String idToken) { - this.idToken = idToken; - return this; - } - - /** - * Get idToken - * @return idToken - **/ - @Schema(description = "") - public String getIdToken() { - return idToken; - } - - public void setIdToken(String idToken) { - this.idToken = idToken; - } - - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - GetUserInfoParams getUserInfoParams = (GetUserInfoParams) o; - return Objects.equals(this.rpId, getUserInfoParams.rpId) && - Objects.equals(this.accessToken, getUserInfoParams.accessToken) && - Objects.equals(this.idToken, getUserInfoParams.idToken); - } - - @Override - public int hashCode() { - return Objects.hash(rpId, accessToken, idToken); - } - - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class GetUserInfoParams {\n"); - - sb.append(" rpId: ").append(toIndentedString(rpId)).append("\n"); - sb.append(" accessToken: ").append(toIndentedString(accessToken)).append("\n"); - sb.append(" idToken: ").append(toIndentedString(idToken)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - -} diff --git a/jans-client-api/gen-client/src/main/java/io/swagger/client/model/IntrospectAccessTokenParams.java b/jans-client-api/gen-client/src/main/java/io/swagger/client/model/IntrospectAccessTokenParams.java deleted file mode 100644 index 4b888f23c0b..00000000000 --- a/jans-client-api/gen-client/src/main/java/io/swagger/client/model/IntrospectAccessTokenParams.java +++ /dev/null @@ -1,114 +0,0 @@ -/* - * jans-api-server - * jans-api-server - * - * OpenAPI spec version: 4.2 - * Contact: yuriyz@gluu.org - * - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen.git - * Do not edit the class manually. - */ - -package io.swagger.client.model; - -import java.util.Objects; -import java.util.Arrays; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import io.swagger.v3.oas.annotations.media.Schema; -import java.io.IOException; -/** - * IntrospectAccessTokenParams - */ - - -public class IntrospectAccessTokenParams { - @SerializedName("rp_id") - private String rpId = null; - - @SerializedName("access_token") - private String accessToken = null; - - public IntrospectAccessTokenParams rpId(String rpId) { - this.rpId = rpId; - return this; - } - - /** - * Get rpId - * @return rpId - **/ - @Schema(example = "bcad760f-91ba-46e1-a020-05e4281d91b6", required = true, description = "") - public String getRpId() { - return rpId; - } - - public void setRpId(String rpId) { - this.rpId = rpId; - } - - public IntrospectAccessTokenParams accessToken(String accessToken) { - this.accessToken = accessToken; - return this; - } - - /** - * Get accessToken - * @return accessToken - **/ - @Schema(example = "b75434ff-f465-4b70-92e4-b7ba6b6c58f2", required = true, description = "") - public String getAccessToken() { - return accessToken; - } - - public void setAccessToken(String accessToken) { - this.accessToken = accessToken; - } - - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - IntrospectAccessTokenParams introspectAccessTokenParams = (IntrospectAccessTokenParams) o; - return Objects.equals(this.rpId, introspectAccessTokenParams.rpId) && - Objects.equals(this.accessToken, introspectAccessTokenParams.accessToken); - } - - @Override - public int hashCode() { - return Objects.hash(rpId, accessToken); - } - - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class IntrospectAccessTokenParams {\n"); - - sb.append(" rpId: ").append(toIndentedString(rpId)).append("\n"); - sb.append(" accessToken: ").append(toIndentedString(accessToken)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - -} diff --git a/jans-client-api/gen-client/src/main/java/io/swagger/client/model/IntrospectAccessTokenResponse.java b/jans-client-api/gen-client/src/main/java/io/swagger/client/model/IntrospectAccessTokenResponse.java deleted file mode 100644 index e2f7c2187ba..00000000000 --- a/jans-client-api/gen-client/src/main/java/io/swagger/client/model/IntrospectAccessTokenResponse.java +++ /dev/null @@ -1,402 +0,0 @@ -/* - * jans-api-server - * jans-api-server - * - * OpenAPI spec version: 4.2 - * Contact: yuriyz@gluu.org - * - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen.git - * Do not edit the class manually. - */ - -package io.swagger.client.model; - -import java.util.Objects; -import java.util.Arrays; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import io.swagger.v3.oas.annotations.media.Schema; -import java.io.IOException; -import java.util.ArrayList; -import java.util.List; -/** - * IntrospectAccessTokenResponse - */ - - -public class IntrospectAccessTokenResponse { - @SerializedName("active") - private Boolean active = null; - - @SerializedName("client_id") - private String clientId = null; - - @SerializedName("username") - private String username = null; - - @SerializedName("scope") - private List scope = new ArrayList(); - - @SerializedName("token_type") - private String tokenType = null; - - @SerializedName("sub") - private String sub = null; - - @SerializedName("aud") - private String aud = null; - - @SerializedName("iss") - private String iss = null; - - @SerializedName("exp") - private Long exp = null; - - @SerializedName("iat") - private Long iat = null; - - @SerializedName("nbf") - private Long nbf = null; - - @SerializedName("jti") - private String jti = null; - - @SerializedName("acr_values") - private List acrValues = new ArrayList(); - - @SerializedName("extension_field") - private String extensionField = null; - - public IntrospectAccessTokenResponse active(Boolean active) { - this.active = active; - return this; - } - - /** - * Get active - * @return active - **/ - @Schema(example = "true", required = true, description = "") - public Boolean isActive() { - return active; - } - - public void setActive(Boolean active) { - this.active = active; - } - - public IntrospectAccessTokenResponse clientId(String clientId) { - this.clientId = clientId; - return this; - } - - /** - * Get clientId - * @return clientId - **/ - @Schema(example = "@!1736.179E.AA60.16B2!0001!8F7C.B9AB!0008!A2BB.9AE6.5F14.B387", required = true, description = "") - public String getClientId() { - return clientId; - } - - public void setClientId(String clientId) { - this.clientId = clientId; - } - - public IntrospectAccessTokenResponse username(String username) { - this.username = username; - return this; - } - - /** - * Get username - * @return username - **/ - @Schema(example = "John Black", required = true, description = "") - public String getUsername() { - return username; - } - - public void setUsername(String username) { - this.username = username; - } - - public IntrospectAccessTokenResponse scope(List scope) { - this.scope = scope; - return this; - } - - public IntrospectAccessTokenResponse addScopeItem(String scopeItem) { - this.scope.add(scopeItem); - return this; - } - - /** - * Get scope - * @return scope - **/ - @Schema(required = true, description = "") - public List getScope() { - return scope; - } - - public void setScope(List scope) { - this.scope = scope; - } - - public IntrospectAccessTokenResponse tokenType(String tokenType) { - this.tokenType = tokenType; - return this; - } - - /** - * Get tokenType - * @return tokenType - **/ - @Schema(example = "bearer", required = true, description = "") - public String getTokenType() { - return tokenType; - } - - public void setTokenType(String tokenType) { - this.tokenType = tokenType; - } - - public IntrospectAccessTokenResponse sub(String sub) { - this.sub = sub; - return this; - } - - /** - * Get sub - * @return sub - **/ - @Schema(example = "jblack", required = true, description = "") - public String getSub() { - return sub; - } - - public void setSub(String sub) { - this.sub = sub; - } - - public IntrospectAccessTokenResponse aud(String aud) { - this.aud = aud; - return this; - } - - /** - * Get aud - * @return aud - **/ - @Schema(example = "l238j323ds-23ij4", required = true, description = "") - public String getAud() { - return aud; - } - - public void setAud(String aud) { - this.aud = aud; - } - - public IntrospectAccessTokenResponse iss(String iss) { - this.iss = iss; - return this; - } - - /** - * Get iss - * @return iss - **/ - @Schema(example = "https://as.gluu.org/", required = true, description = "") - public String getIss() { - return iss; - } - - public void setIss(String iss) { - this.iss = iss; - } - - public IntrospectAccessTokenResponse exp(Long exp) { - this.exp = exp; - return this; - } - - /** - * number of seconds since January 1 1970 UTC, indicating when this token will expire - * @return exp - **/ - @Schema(example = "1535709072", required = true, description = "number of seconds since January 1 1970 UTC, indicating when this token will expire") - public Long getExp() { - return exp; - } - - public void setExp(Long exp) { - this.exp = exp; - } - - public IntrospectAccessTokenResponse iat(Long iat) { - this.iat = iat; - return this; - } - - /** - * number of seconds since January 1 1970 UTC, indicating when the token was issued at - * @return iat - **/ - @Schema(example = "1535709072", required = true, description = "number of seconds since January 1 1970 UTC, indicating when the token was issued at") - public Long getIat() { - return iat; - } - - public void setIat(Long iat) { - this.iat = iat; - } - - public IntrospectAccessTokenResponse nbf(Long nbf) { - this.nbf = nbf; - return this; - } - - /** - * number of seconds since January 1 1970 UTC, indicating when the token not to be used before - * @return nbf - **/ - @Schema(example = "1535709072", required = true, description = "number of seconds since January 1 1970 UTC, indicating when the token not to be used before") - public Long getNbf() { - return nbf; - } - - public void setNbf(Long nbf) { - this.nbf = nbf; - } - - public IntrospectAccessTokenResponse jti(String jti) { - this.jti = jti; - return this; - } - - /** - * a unique identifier for the JWT - * @return jti - **/ - @Schema(required = true, description = "a unique identifier for the JWT") - public String getJti() { - return jti; - } - - public void setJti(String jti) { - this.jti = jti; - } - - public IntrospectAccessTokenResponse acrValues(List acrValues) { - this.acrValues = acrValues; - return this; - } - - public IntrospectAccessTokenResponse addAcrValuesItem(String acrValuesItem) { - this.acrValues.add(acrValuesItem); - return this; - } - - /** - * Get acrValues - * @return acrValues - **/ - @Schema(example = "[\"basic\"]", required = true, description = "") - public List getAcrValues() { - return acrValues; - } - - public void setAcrValues(List acrValues) { - this.acrValues = acrValues; - } - - public IntrospectAccessTokenResponse extensionField(String extensionField) { - this.extensionField = extensionField; - return this; - } - - /** - * Get extensionField - * @return extensionField - **/ - @Schema(example = "twenty-seven", required = true, description = "") - public String getExtensionField() { - return extensionField; - } - - public void setExtensionField(String extensionField) { - this.extensionField = extensionField; - } - - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - IntrospectAccessTokenResponse introspectAccessTokenResponse = (IntrospectAccessTokenResponse) o; - return Objects.equals(this.active, introspectAccessTokenResponse.active) && - Objects.equals(this.clientId, introspectAccessTokenResponse.clientId) && - Objects.equals(this.username, introspectAccessTokenResponse.username) && - Objects.equals(this.scope, introspectAccessTokenResponse.scope) && - Objects.equals(this.tokenType, introspectAccessTokenResponse.tokenType) && - Objects.equals(this.sub, introspectAccessTokenResponse.sub) && - Objects.equals(this.aud, introspectAccessTokenResponse.aud) && - Objects.equals(this.iss, introspectAccessTokenResponse.iss) && - Objects.equals(this.exp, introspectAccessTokenResponse.exp) && - Objects.equals(this.iat, introspectAccessTokenResponse.iat) && - Objects.equals(this.nbf, introspectAccessTokenResponse.nbf) && - Objects.equals(this.jti, introspectAccessTokenResponse.jti) && - Objects.equals(this.acrValues, introspectAccessTokenResponse.acrValues) && - Objects.equals(this.extensionField, introspectAccessTokenResponse.extensionField); - } - - @Override - public int hashCode() { - return Objects.hash(active, clientId, username, scope, tokenType, sub, aud, iss, exp, iat, nbf, jti, acrValues, extensionField); - } - - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class IntrospectAccessTokenResponse {\n"); - - sb.append(" active: ").append(toIndentedString(active)).append("\n"); - sb.append(" clientId: ").append(toIndentedString(clientId)).append("\n"); - sb.append(" username: ").append(toIndentedString(username)).append("\n"); - sb.append(" scope: ").append(toIndentedString(scope)).append("\n"); - sb.append(" tokenType: ").append(toIndentedString(tokenType)).append("\n"); - sb.append(" sub: ").append(toIndentedString(sub)).append("\n"); - sb.append(" aud: ").append(toIndentedString(aud)).append("\n"); - sb.append(" iss: ").append(toIndentedString(iss)).append("\n"); - sb.append(" exp: ").append(toIndentedString(exp)).append("\n"); - sb.append(" iat: ").append(toIndentedString(iat)).append("\n"); - sb.append(" nbf: ").append(toIndentedString(nbf)).append("\n"); - sb.append(" jti: ").append(toIndentedString(jti)).append("\n"); - sb.append(" acrValues: ").append(toIndentedString(acrValues)).append("\n"); - sb.append(" extensionField: ").append(toIndentedString(extensionField)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - -} diff --git a/jans-client-api/gen-client/src/main/java/io/swagger/client/model/IntrospectRptParams.java b/jans-client-api/gen-client/src/main/java/io/swagger/client/model/IntrospectRptParams.java deleted file mode 100644 index c816de08445..00000000000 --- a/jans-client-api/gen-client/src/main/java/io/swagger/client/model/IntrospectRptParams.java +++ /dev/null @@ -1,114 +0,0 @@ -/* - * jans-api-server - * jans-api-server - * - * OpenAPI spec version: 4.2 - * Contact: yuriyz@gluu.org - * - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen.git - * Do not edit the class manually. - */ - -package io.swagger.client.model; - -import java.util.Objects; -import java.util.Arrays; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import io.swagger.v3.oas.annotations.media.Schema; -import java.io.IOException; -/** - * IntrospectRptParams - */ - - -public class IntrospectRptParams { - @SerializedName("rp_id") - private String rpId = null; - - @SerializedName("rpt") - private String rpt = null; - - public IntrospectRptParams rpId(String rpId) { - this.rpId = rpId; - return this; - } - - /** - * Get rpId - * @return rpId - **/ - @Schema(example = "bcad760f-91ba-46e1-a020-05e4281d91b6", required = true, description = "") - public String getRpId() { - return rpId; - } - - public void setRpId(String rpId) { - this.rpId = rpId; - } - - public IntrospectRptParams rpt(String rpt) { - this.rpt = rpt; - return this; - } - - /** - * Get rpt - * @return rpt - **/ - @Schema(required = true, description = "") - public String getRpt() { - return rpt; - } - - public void setRpt(String rpt) { - this.rpt = rpt; - } - - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - IntrospectRptParams introspectRptParams = (IntrospectRptParams) o; - return Objects.equals(this.rpId, introspectRptParams.rpId) && - Objects.equals(this.rpt, introspectRptParams.rpt); - } - - @Override - public int hashCode() { - return Objects.hash(rpId, rpt); - } - - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class IntrospectRptParams {\n"); - - sb.append(" rpId: ").append(toIndentedString(rpId)).append("\n"); - sb.append(" rpt: ").append(toIndentedString(rpt)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - -} diff --git a/jans-client-api/gen-client/src/main/java/io/swagger/client/model/IntrospectRptResponse.java b/jans-client-api/gen-client/src/main/java/io/swagger/client/model/IntrospectRptResponse.java deleted file mode 100644 index aee57d2e7f8..00000000000 --- a/jans-client-api/gen-client/src/main/java/io/swagger/client/model/IntrospectRptResponse.java +++ /dev/null @@ -1,305 +0,0 @@ -/* - * jans-api-server - * jans-api-server - * - * OpenAPI spec version: 4.2 - * Contact: yuriyz@gluu.org - * - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen.git - * Do not edit the class manually. - */ - -package io.swagger.client.model; - -import java.util.Objects; -import java.util.Arrays; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import io.swagger.v3.oas.annotations.media.Schema; -import java.io.IOException; -import java.util.ArrayList; -import java.util.List; -/** - * IntrospectRptResponse - */ - - -public class IntrospectRptResponse { - @SerializedName("active") - private Boolean active = null; - - @SerializedName("exp") - private Long exp = null; - - @SerializedName("iat") - private Long iat = null; - - @SerializedName("nbf") - private Long nbf = null; - - @SerializedName("client_id") - private String clientId = null; - - @SerializedName("sub") - private String sub = null; - - @SerializedName("aud") - private String aud = null; - - @SerializedName("iss") - private String iss = null; - - @SerializedName("jti") - private String jti = null; - - @SerializedName("permissions") - private List permissions = new ArrayList(); - - public IntrospectRptResponse active(Boolean active) { - this.active = active; - return this; - } - - /** - * Get active - * @return active - **/ - @Schema(example = "true", required = true, description = "") - public Boolean isActive() { - return active; - } - - public void setActive(Boolean active) { - this.active = active; - } - - public IntrospectRptResponse exp(Long exp) { - this.exp = exp; - return this; - } - - /** - * number of seconds since January 1 1970 UTC, indicating when this token will expire - * @return exp - **/ - @Schema(example = "1535709072", required = true, description = "number of seconds since January 1 1970 UTC, indicating when this token will expire") - public Long getExp() { - return exp; - } - - public void setExp(Long exp) { - this.exp = exp; - } - - public IntrospectRptResponse iat(Long iat) { - this.iat = iat; - return this; - } - - /** - * number of seconds since January 1 1970 UTC, indicating when the token was issued at - * @return iat - **/ - @Schema(example = "1535709072", required = true, description = "number of seconds since January 1 1970 UTC, indicating when the token was issued at") - public Long getIat() { - return iat; - } - - public void setIat(Long iat) { - this.iat = iat; - } - - public IntrospectRptResponse nbf(Long nbf) { - this.nbf = nbf; - return this; - } - - /** - * number of seconds since January 1 1970 UTC, indicating when the token not to be used before - * @return nbf - **/ - @Schema(example = "1535709072", required = true, description = "number of seconds since January 1 1970 UTC, indicating when the token not to be used before") - public Long getNbf() { - return nbf; - } - - public void setNbf(Long nbf) { - this.nbf = nbf; - } - - public IntrospectRptResponse clientId(String clientId) { - this.clientId = clientId; - return this; - } - - /** - * Get clientId - * @return clientId - **/ - @Schema(example = "@!DBE5.84F8.631A.9172!0001!CD07.49BE!0008!0ED4.C61D.6FA7.8F42", required = true, description = "") - public String getClientId() { - return clientId; - } - - public void setClientId(String clientId) { - this.clientId = clientId; - } - - public IntrospectRptResponse sub(String sub) { - this.sub = sub; - return this; - } - - /** - * Get sub - * @return sub - **/ - @Schema(description = "") - public String getSub() { - return sub; - } - - public void setSub(String sub) { - this.sub = sub; - } - - public IntrospectRptResponse aud(String aud) { - this.aud = aud; - return this; - } - - /** - * Get aud - * @return aud - **/ - @Schema(example = "@!DBE5.84F8.631A.9172!0001!CD07.49BE!0008!0ED4.C61D.6FA7.8F42", required = true, description = "") - public String getAud() { - return aud; - } - - public void setAud(String aud) { - this.aud = aud; - } - - public IntrospectRptResponse iss(String iss) { - this.iss = iss; - return this; - } - - /** - * Get iss - * @return iss - **/ - @Schema(example = "http://as.com", required = true, description = "") - public String getIss() { - return iss; - } - - public void setIss(String iss) { - this.iss = iss; - } - - public IntrospectRptResponse jti(String jti) { - this.jti = jti; - return this; - } - - /** - * Get jti - * @return jti - **/ - @Schema(description = "") - public String getJti() { - return jti; - } - - public void setJti(String jti) { - this.jti = jti; - } - - public IntrospectRptResponse permissions(List permissions) { - this.permissions = permissions; - return this; - } - - public IntrospectRptResponse addPermissionsItem(Object permissionsItem) { - this.permissions.add(permissionsItem); - return this; - } - - /** - * Get permissions - * @return permissions - **/ - @Schema(required = true, description = "") - public List getPermissions() { - return permissions; - } - - public void setPermissions(List permissions) { - this.permissions = permissions; - } - - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - IntrospectRptResponse introspectRptResponse = (IntrospectRptResponse) o; - return Objects.equals(this.active, introspectRptResponse.active) && - Objects.equals(this.exp, introspectRptResponse.exp) && - Objects.equals(this.iat, introspectRptResponse.iat) && - Objects.equals(this.nbf, introspectRptResponse.nbf) && - Objects.equals(this.clientId, introspectRptResponse.clientId) && - Objects.equals(this.sub, introspectRptResponse.sub) && - Objects.equals(this.aud, introspectRptResponse.aud) && - Objects.equals(this.iss, introspectRptResponse.iss) && - Objects.equals(this.jti, introspectRptResponse.jti) && - Objects.equals(this.permissions, introspectRptResponse.permissions); - } - - @Override - public int hashCode() { - return Objects.hash(active, exp, iat, nbf, clientId, sub, aud, iss, jti, permissions); - } - - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class IntrospectRptResponse {\n"); - - sb.append(" active: ").append(toIndentedString(active)).append("\n"); - sb.append(" exp: ").append(toIndentedString(exp)).append("\n"); - sb.append(" iat: ").append(toIndentedString(iat)).append("\n"); - sb.append(" nbf: ").append(toIndentedString(nbf)).append("\n"); - sb.append(" clientId: ").append(toIndentedString(clientId)).append("\n"); - sb.append(" sub: ").append(toIndentedString(sub)).append("\n"); - sb.append(" aud: ").append(toIndentedString(aud)).append("\n"); - sb.append(" iss: ").append(toIndentedString(iss)).append("\n"); - sb.append(" jti: ").append(toIndentedString(jti)).append("\n"); - sb.append(" permissions: ").append(toIndentedString(permissions)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - -} diff --git a/jans-client-api/gen-client/src/main/java/io/swagger/client/model/JsonWebKey.java b/jans-client-api/gen-client/src/main/java/io/swagger/client/model/JsonWebKey.java deleted file mode 100644 index 1f529ec613b..00000000000 --- a/jans-client-api/gen-client/src/main/java/io/swagger/client/model/JsonWebKey.java +++ /dev/null @@ -1,328 +0,0 @@ -/* - * jans-api-server - * jans-api-server - * - * OpenAPI spec version: 4.2 - * Contact: yuriyz@gluu.org - * - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen.git - * Do not edit the class manually. - */ - -package io.swagger.client.model; - -import java.util.Objects; -import java.util.Arrays; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import io.swagger.v3.oas.annotations.media.Schema; -import java.io.IOException; -import java.util.ArrayList; -import java.util.List; -/** - * JsonWebKey - */ - - -public class JsonWebKey { - @SerializedName("kid") - private String kid = null; - - @SerializedName("kty") - private String kty = null; - - @SerializedName("use") - private String use = null; - - @SerializedName("alg") - private String alg = null; - - @SerializedName("crv") - private String crv = null; - - @SerializedName("exp") - private Long exp = null; - - @SerializedName("x5c") - private List x5c = new ArrayList(); - - @SerializedName("n") - private String n = null; - - @SerializedName("e") - private String e = null; - - @SerializedName("x") - private String x = null; - - @SerializedName("y") - private String y = null; - - public JsonWebKey kid(String kid) { - this.kid = kid; - return this; - } - - /** - * Get kid - * @return kid - **/ - @Schema(required = true, description = "") - public String getKid() { - return kid; - } - - public void setKid(String kid) { - this.kid = kid; - } - - public JsonWebKey kty(String kty) { - this.kty = kty; - return this; - } - - /** - * Get kty - * @return kty - **/ - @Schema(required = true, description = "") - public String getKty() { - return kty; - } - - public void setKty(String kty) { - this.kty = kty; - } - - public JsonWebKey use(String use) { - this.use = use; - return this; - } - - /** - * Get use - * @return use - **/ - @Schema(required = true, description = "") - public String getUse() { - return use; - } - - public void setUse(String use) { - this.use = use; - } - - public JsonWebKey alg(String alg) { - this.alg = alg; - return this; - } - - /** - * Get alg - * @return alg - **/ - @Schema(required = true, description = "") - public String getAlg() { - return alg; - } - - public void setAlg(String alg) { - this.alg = alg; - } - - public JsonWebKey crv(String crv) { - this.crv = crv; - return this; - } - - /** - * Get crv - * @return crv - **/ - @Schema(description = "") - public String getCrv() { - return crv; - } - - public void setCrv(String crv) { - this.crv = crv; - } - - public JsonWebKey exp(Long exp) { - this.exp = exp; - return this; - } - - /** - * Get exp - * @return exp - **/ - @Schema(example = "1563964950485", required = true, description = "") - public Long getExp() { - return exp; - } - - public void setExp(Long exp) { - this.exp = exp; - } - - public JsonWebKey x5c(List x5c) { - this.x5c = x5c; - return this; - } - - public JsonWebKey addX5cItem(String x5cItem) { - this.x5c.add(x5cItem); - return this; - } - - /** - * Get x5c - * @return x5c - **/ - @Schema(required = true, description = "") - public List getX5c() { - return x5c; - } - - public void setX5c(List x5c) { - this.x5c = x5c; - } - - public JsonWebKey n(String n) { - this.n = n; - return this; - } - - /** - * Get n - * @return n - **/ - @Schema(description = "") - public String getN() { - return n; - } - - public void setN(String n) { - this.n = n; - } - - public JsonWebKey e(String e) { - this.e = e; - return this; - } - - /** - * Get e - * @return e - **/ - @Schema(description = "") - public String getE() { - return e; - } - - public void setE(String e) { - this.e = e; - } - - public JsonWebKey x(String x) { - this.x = x; - return this; - } - - /** - * Get x - * @return x - **/ - @Schema(description = "") - public String getX() { - return x; - } - - public void setX(String x) { - this.x = x; - } - - public JsonWebKey y(String y) { - this.y = y; - return this; - } - - /** - * Get y - * @return y - **/ - @Schema(description = "") - public String getY() { - return y; - } - - public void setY(String y) { - this.y = y; - } - - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - JsonWebKey jsonWebKey = (JsonWebKey) o; - return Objects.equals(this.kid, jsonWebKey.kid) && - Objects.equals(this.kty, jsonWebKey.kty) && - Objects.equals(this.use, jsonWebKey.use) && - Objects.equals(this.alg, jsonWebKey.alg) && - Objects.equals(this.crv, jsonWebKey.crv) && - Objects.equals(this.exp, jsonWebKey.exp) && - Objects.equals(this.x5c, jsonWebKey.x5c) && - Objects.equals(this.n, jsonWebKey.n) && - Objects.equals(this.e, jsonWebKey.e) && - Objects.equals(this.x, jsonWebKey.x) && - Objects.equals(this.y, jsonWebKey.y); - } - - @Override - public int hashCode() { - return Objects.hash(kid, kty, use, alg, crv, exp, x5c, n, e, x, y); - } - - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class JsonWebKey {\n"); - - sb.append(" kid: ").append(toIndentedString(kid)).append("\n"); - sb.append(" kty: ").append(toIndentedString(kty)).append("\n"); - sb.append(" use: ").append(toIndentedString(use)).append("\n"); - sb.append(" alg: ").append(toIndentedString(alg)).append("\n"); - sb.append(" crv: ").append(toIndentedString(crv)).append("\n"); - sb.append(" exp: ").append(toIndentedString(exp)).append("\n"); - sb.append(" x5c: ").append(toIndentedString(x5c)).append("\n"); - sb.append(" n: ").append(toIndentedString(n)).append("\n"); - sb.append(" e: ").append(toIndentedString(e)).append("\n"); - sb.append(" x: ").append(toIndentedString(x)).append("\n"); - sb.append(" y: ").append(toIndentedString(y)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - -} diff --git a/jans-client-api/gen-client/src/main/java/io/swagger/client/model/RegisterSiteParams.java b/jans-client-api/gen-client/src/main/java/io/swagger/client/model/RegisterSiteParams.java deleted file mode 100644 index e1089f7ec5e..00000000000 --- a/jans-client-api/gen-client/src/main/java/io/swagger/client/model/RegisterSiteParams.java +++ /dev/null @@ -1,1469 +0,0 @@ -/* - * jans-api-server - * jans-api-server - * - * OpenAPI spec version: 4.2 - * Contact: yuriyz@gluu.org - * - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen.git - * Do not edit the class manually. - */ - -package io.swagger.client.model; - -import java.util.Objects; -import java.util.Arrays; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import io.swagger.v3.oas.annotations.media.Schema; -import java.io.IOException; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -/** - * RegisterSiteParams - */ - - -public class RegisterSiteParams { - @SerializedName("redirect_uris") - private List redirectUris = new ArrayList(); - - @SerializedName("op_configuration_endpoint") - private String opConfigurationEndpoint = null; - - @SerializedName("op_host") - private String opHost = null; - - @SerializedName("op_discovery_path") - private String opDiscoveryPath = null; - - @SerializedName("post_logout_redirect_uris") - private List postLogoutRedirectUris = null; - - @SerializedName("response_types") - private List responseTypes = null; - - @SerializedName("grant_types") - private List grantTypes = null; - - @SerializedName("scope") - private List scope = null; - - @SerializedName("acr_values") - private List acrValues = null; - - @SerializedName("client_name") - private String clientName = null; - - @SerializedName("client_jwks_uri") - private String clientJwksUri = null; - - @SerializedName("client_token_endpoint_auth_method") - private String clientTokenEndpointAuthMethod = null; - - @SerializedName("client_token_endpoint_auth_signing_alg") - private String clientTokenEndpointAuthSigningAlg = null; - - @SerializedName("client_request_uris") - private List clientRequestUris = null; - - @SerializedName("client_frontchannel_logout_uri") - private String clientFrontchannelLogoutUri = null; - - @SerializedName("client_sector_identifier_uri") - private String clientSectorIdentifierUri = null; - - @SerializedName("contacts") - private List contacts = null; - - @SerializedName("ui_locales") - private List uiLocales = null; - - @SerializedName("claims_locales") - private List claimsLocales = null; - - @SerializedName("claims_redirect_uri") - private List claimsRedirectUri = null; - - @SerializedName("client_id") - private String clientId = null; - - @SerializedName("client_secret") - private String clientSecret = null; - - @SerializedName("access_token_as_jwt") - private Boolean accessTokenAsJwt = null; - - @SerializedName("access_token_signing_alg") - private String accessTokenSigningAlg = null; - - @SerializedName("rpt_as_jwt") - private Boolean rptAsJwt = null; - - @SerializedName("logo_uri") - private String logoUri = null; - - @SerializedName("client_uri") - private String clientUri = null; - - @SerializedName("policy_uri") - private String policyUri = null; - - @SerializedName("front_channel_logout_session_required") - private Boolean frontChannelLogoutSessionRequired = null; - - @SerializedName("tos_uri") - private String tosUri = null; - - @SerializedName("jwks") - private String jwks = null; - - @SerializedName("id_token_binding_cnf") - private String idTokenBindingCnf = null; - - @SerializedName("tls_client_auth_subject_dn") - private String tlsClientAuthSubjectDn = null; - - @SerializedName("run_introspection_script_beforeaccess_token_as_jwt_creation_and_include_claims") - private Boolean runIntrospectionScriptBeforeaccessTokenAsJwtCreationAndIncludeClaims = null; - - @SerializedName("id_token_signed_response_alg") - private String idTokenSignedResponseAlg = null; - - @SerializedName("id_token_encrypted_response_alg") - private String idTokenEncryptedResponseAlg = null; - - @SerializedName("id_token_encrypted_response_enc") - private String idTokenEncryptedResponseEnc = null; - - @SerializedName("user_info_signed_response_alg") - private String userInfoSignedResponseAlg = null; - - @SerializedName("user_info_encrypted_response_alg") - private String userInfoEncryptedResponseAlg = null; - - @SerializedName("user_info_encrypted_response_enc") - private String userInfoEncryptedResponseEnc = null; - - @SerializedName("request_object_signing_alg") - private String requestObjectSigningAlg = null; - - @SerializedName("request_object_encryption_alg") - private String requestObjectEncryptionAlg = null; - - @SerializedName("request_object_encryption_enc") - private String requestObjectEncryptionEnc = null; - - @SerializedName("default_max_age") - private Integer defaultMaxAge = null; - - @SerializedName("require_auth_time") - private Boolean requireAuthTime = null; - - @SerializedName("initiate_login_uri") - private String initiateLoginUri = null; - - @SerializedName("authorized_origins") - private List authorizedOrigins = null; - - @SerializedName("access_token_lifetime") - private Integer accessTokenLifetime = null; - - @SerializedName("software_id") - private String softwareId = null; - - @SerializedName("software_version") - private String softwareVersion = null; - - @SerializedName("software_statement") - private String softwareStatement = null; - - @SerializedName("custom_attributes") - private Map customAttributes = null; - - @SerializedName("sync_client_from_op") - private Boolean syncClientFromOp = null; - - @SerializedName("sync_client_period_in_seconds") - private Integer syncClientPeriodInSeconds = null; - - @SerializedName("allow_spontaneous_scopes") - private Boolean allowSpontaneousScopes = null; - - @SerializedName("spontaneous_scopes") - private List spontaneousScopes = null; - - public RegisterSiteParams redirectUris(List redirectUris) { - this.redirectUris = redirectUris; - return this; - } - - public RegisterSiteParams addRedirectUrisItem(String redirectUrisItem) { - this.redirectUris.add(redirectUrisItem); - return this; - } - - /** - * Provide the list of redirection URIs. The first URL is where the user will be redirected after successful authorization at the OpenID Connect Provider (OP). - * @return redirectUris - **/ - @Schema(example = "[\"https://client.example.org/cb\"]", required = true, description = "Provide the list of redirection URIs. The first URL is where the user will be redirected after successful authorization at the OpenID Connect Provider (OP).") - public List getRedirectUris() { - return redirectUris; - } - - public void setRedirectUris(List redirectUris) { - this.redirectUris = redirectUris; - } - - public RegisterSiteParams opConfigurationEndpoint(String opConfigurationEndpoint) { - this.opConfigurationEndpoint = opConfigurationEndpoint; - return this; - } - - /** - * The openid configuration endpoint URL. If missing, then either it must be present in defaults or `op_host` must be defined. - * @return opConfigurationEndpoint - **/ - @Schema(example = "https://op.example.com/acme/.well-known/openid-configuration", description = "The openid configuration endpoint URL. If missing, then either it must be present in defaults or `op_host` must be defined.") - public String getOpConfigurationEndpoint() { - return opConfigurationEndpoint; - } - - public void setOpConfigurationEndpoint(String opConfigurationEndpoint) { - this.opConfigurationEndpoint = opConfigurationEndpoint; - } - - public RegisterSiteParams opHost(String opHost) { - this.opHost = opHost; - return this; - } - - /** - * Deprecated in favor of `op_configuration_endpoint`. It will be removed in future version(s). Provide the URL of OpenID Provider (OP) in this field. If missing, then `op_configuration_endpoint` must be defined. - * @return opHost - **/ - @Schema(example = "https://", description = "Deprecated in favor of `op_configuration_endpoint`. It will be removed in future version(s). Provide the URL of OpenID Provider (OP) in this field. If missing, then `op_configuration_endpoint` must be defined.") - public String getOpHost() { - return opHost; - } - - public void setOpHost(String opHost) { - this.opHost = opHost; - } - - public RegisterSiteParams opDiscoveryPath(String opDiscoveryPath) { - this.opDiscoveryPath = opDiscoveryPath; - return this; - } - - /** - * Deprecated in favor of `op_configuration_endpoint`. It will be removed in future version(s). Provide path to the OpenID Connect Provider's discovery document in this field. For example, if it is 'https://example.com/.well-known/openid-configuration' then the path is blank. But if it is 'https://example.com/oxauth/.well-known/openid-configuration' then the path is '/oxauth' - * @return opDiscoveryPath - **/ - @Schema(example = "/oxauth", description = "Deprecated in favor of `op_configuration_endpoint`. It will be removed in future version(s). Provide path to the OpenID Connect Provider's discovery document in this field. For example, if it is 'https://example.com/.well-known/openid-configuration' then the path is blank. But if it is 'https://example.com/oxauth/.well-known/openid-configuration' then the path is '/oxauth'") - public String getOpDiscoveryPath() { - return opDiscoveryPath; - } - - public void setOpDiscoveryPath(String opDiscoveryPath) { - this.opDiscoveryPath = opDiscoveryPath; - } - - public RegisterSiteParams postLogoutRedirectUris(List postLogoutRedirectUris) { - this.postLogoutRedirectUris = postLogoutRedirectUris; - return this; - } - - public RegisterSiteParams addPostLogoutRedirectUrisItem(String postLogoutRedirectUrisItem) { - if (this.postLogoutRedirectUris == null) { - this.postLogoutRedirectUris = new ArrayList(); - } - this.postLogoutRedirectUris.add(postLogoutRedirectUrisItem); - return this; - } - - /** - * Provide the URLs supplied by the RP to request that the user be redirected to this location after a logout has been performed. - * @return postLogoutRedirectUris - **/ - @Schema(example = "[\"https://client.example.org/logout/page1\",\"https://client.example.org/logout/page2\",\"https://client.example.org/logout/page3\"]", description = "Provide the URLs supplied by the RP to request that the user be redirected to this location after a logout has been performed.") - public List getPostLogoutRedirectUris() { - return postLogoutRedirectUris; - } - - public void setPostLogoutRedirectUris(List postLogoutRedirectUris) { - this.postLogoutRedirectUris = postLogoutRedirectUris; - } - - public RegisterSiteParams responseTypes(List responseTypes) { - this.responseTypes = responseTypes; - return this; - } - - public RegisterSiteParams addResponseTypesItem(String responseTypesItem) { - if (this.responseTypes == null) { - this.responseTypes = new ArrayList(); - } - this.responseTypes.add(responseTypesItem); - return this; - } - - /** - * Provide a list of the OAuth 2.0 response_type values that the Client is declaring that it will restrict itself to using. If omitted, the default is that the Client will use only the code response type. - * @return responseTypes - **/ - @Schema(example = "[\"code\"]", description = "Provide a list of the OAuth 2.0 response_type values that the Client is declaring that it will restrict itself to using. If omitted, the default is that the Client will use only the code response type.") - public List getResponseTypes() { - return responseTypes; - } - - public void setResponseTypes(List responseTypes) { - this.responseTypes = responseTypes; - } - - public RegisterSiteParams grantTypes(List grantTypes) { - this.grantTypes = grantTypes; - return this; - } - - public RegisterSiteParams addGrantTypesItem(String grantTypesItem) { - if (this.grantTypes == null) { - this.grantTypes = new ArrayList(); - } - this.grantTypes.add(grantTypesItem); - return this; - } - - /** - * Provide a list of the OAuth 2.0 grant types that the Client is declaring that it will restrict itself to using. - * @return grantTypes - **/ - @Schema(example = "[\"authorization_code\",\"client_credentials\"]", description = "Provide a list of the OAuth 2.0 grant types that the Client is declaring that it will restrict itself to using.") - public List getGrantTypes() { - return grantTypes; - } - - public void setGrantTypes(List grantTypes) { - this.grantTypes = grantTypes; - } - - public RegisterSiteParams scope(List scope) { - this.scope = scope; - return this; - } - - public RegisterSiteParams addScopeItem(String scopeItem) { - if (this.scope == null) { - this.scope = new ArrayList(); - } - this.scope.add(scopeItem); - return this; - } - - /** - * Provide list of scope which are used during authentication to authorize access to resource. - * @return scope - **/ - @Schema(example = "[\"openid\"]", description = "Provide list of scope which are used during authentication to authorize access to resource.") - public List getScope() { - return scope; - } - - public void setScope(List scope) { - this.scope = scope; - } - - public RegisterSiteParams acrValues(List acrValues) { - this.acrValues = acrValues; - return this; - } - - public RegisterSiteParams addAcrValuesItem(String acrValuesItem) { - if (this.acrValues == null) { - this.acrValues = new ArrayList(); - } - this.acrValues.add(acrValuesItem); - return this; - } - - /** - * Provide Returns the Default requested Authentication Context Class Reference values. - * @return acrValues - **/ - @Schema(example = "[\"basic\"]", description = "Provide Returns the Default requested Authentication Context Class Reference values.") - public List getAcrValues() { - return acrValues; - } - - public void setAcrValues(List acrValues) { - this.acrValues = acrValues; - } - - public RegisterSiteParams clientName(String clientName) { - this.clientName = clientName; - return this; - } - - /** - * jans-client-api will generate its own non-human readable name by default if client_name is not specified - * @return clientName - **/ - @Schema(description = "jans-client-api will generate its own non-human readable name by default if client_name is not specified") - public String getClientName() { - return clientName; - } - - public void setClientName(String clientName) { - this.clientName = clientName; - } - - public RegisterSiteParams clientJwksUri(String clientJwksUri) { - this.clientJwksUri = clientJwksUri; - return this; - } - - /** - * Provide the URL for the Client's JSON Web Key Set (JWK) document containing key(s) that are used for signing requests to the OP. The JWK Set may also contain the Client's encryption keys(s) that are used by the OP to encrypt the responses to the Client. When both signing and encryption keys are made available, a use (Key Use) parameter value is required for all keys in the document to indicate each key's intended usage . - * @return clientJwksUri - **/ - @Schema(description = "Provide the URL for the Client's JSON Web Key Set (JWK) document containing key(s) that are used for signing requests to the OP. The JWK Set may also contain the Client's encryption keys(s) that are used by the OP to encrypt the responses to the Client. When both signing and encryption keys are made available, a use (Key Use) parameter value is required for all keys in the document to indicate each key's intended usage .") - public String getClientJwksUri() { - return clientJwksUri; - } - - public void setClientJwksUri(String clientJwksUri) { - this.clientJwksUri = clientJwksUri; - } - - public RegisterSiteParams clientTokenEndpointAuthMethod(String clientTokenEndpointAuthMethod) { - this.clientTokenEndpointAuthMethod = clientTokenEndpointAuthMethod; - return this; - } - - /** - * Provide the requested authentication method for the Token Endpoint. Valid values are none, client_secret_basic, client_secret_post, client_secret_jwt, private_key_jwt, access_token, tls_client_auth, self_signed_tls_client_auth. - * @return clientTokenEndpointAuthMethod - **/ - @Schema(description = "Provide the requested authentication method for the Token Endpoint. Valid values are none, client_secret_basic, client_secret_post, client_secret_jwt, private_key_jwt, access_token, tls_client_auth, self_signed_tls_client_auth.") - public String getClientTokenEndpointAuthMethod() { - return clientTokenEndpointAuthMethod; - } - - public void setClientTokenEndpointAuthMethod(String clientTokenEndpointAuthMethod) { - this.clientTokenEndpointAuthMethod = clientTokenEndpointAuthMethod; - } - - public RegisterSiteParams clientTokenEndpointAuthSigningAlg(String clientTokenEndpointAuthSigningAlg) { - this.clientTokenEndpointAuthSigningAlg = clientTokenEndpointAuthSigningAlg; - return this; - } - - /** - * Provide the Requested Client Authentication method for the Token Endpoint. Valid values are none, HS256, HS384, HS512, RS256, RS384, RS512, ES256, ES384, ES512, PS256, PS384, PS512. - * @return clientTokenEndpointAuthSigningAlg - **/ - @Schema(description = "Provide the Requested Client Authentication method for the Token Endpoint. Valid values are none, HS256, HS384, HS512, RS256, RS384, RS512, ES256, ES384, ES512, PS256, PS384, PS512.") - public String getClientTokenEndpointAuthSigningAlg() { - return clientTokenEndpointAuthSigningAlg; - } - - public void setClientTokenEndpointAuthSigningAlg(String clientTokenEndpointAuthSigningAlg) { - this.clientTokenEndpointAuthSigningAlg = clientTokenEndpointAuthSigningAlg; - } - - public RegisterSiteParams clientRequestUris(List clientRequestUris) { - this.clientRequestUris = clientRequestUris; - return this; - } - - public RegisterSiteParams addClientRequestUrisItem(String clientRequestUrisItem) { - if (this.clientRequestUris == null) { - this.clientRequestUris = new ArrayList(); - } - this.clientRequestUris.add(clientRequestUrisItem); - return this; - } - - /** - * Provide a list of request_uri values that are pre-registered by the Client for use at the Authorization Server. - * @return clientRequestUris - **/ - @Schema(description = "Provide a list of request_uri values that are pre-registered by the Client for use at the Authorization Server.") - public List getClientRequestUris() { - return clientRequestUris; - } - - public void setClientRequestUris(List clientRequestUris) { - this.clientRequestUris = clientRequestUris; - } - - public RegisterSiteParams clientFrontchannelLogoutUri(String clientFrontchannelLogoutUri) { - this.clientFrontchannelLogoutUri = clientFrontchannelLogoutUri; - return this; - } - - /** - * Provide frontchannel logout uri. - * @return clientFrontchannelLogoutUri - **/ - @Schema(description = "Provide frontchannel logout uri.") - public String getClientFrontchannelLogoutUri() { - return clientFrontchannelLogoutUri; - } - - public void setClientFrontchannelLogoutUri(String clientFrontchannelLogoutUri) { - this.clientFrontchannelLogoutUri = clientFrontchannelLogoutUri; - } - - public RegisterSiteParams clientSectorIdentifierUri(String clientSectorIdentifierUri) { - this.clientSectorIdentifierUri = clientSectorIdentifierUri; - return this; - } - - /** - * Provide the URL using the https scheme to be used in calculating Pseudonymous Identifiers by the OP. The URL references a file with a single JSON array of redirect_uri values. - * @return clientSectorIdentifierUri - **/ - @Schema(description = "Provide the URL using the https scheme to be used in calculating Pseudonymous Identifiers by the OP. The URL references a file with a single JSON array of redirect_uri values.") - public String getClientSectorIdentifierUri() { - return clientSectorIdentifierUri; - } - - public void setClientSectorIdentifierUri(String clientSectorIdentifierUri) { - this.clientSectorIdentifierUri = clientSectorIdentifierUri; - } - - public RegisterSiteParams contacts(List contacts) { - this.contacts = contacts; - return this; - } - - public RegisterSiteParams addContactsItem(String contactsItem) { - if (this.contacts == null) { - this.contacts = new ArrayList(); - } - this.contacts.add(contactsItem); - return this; - } - - /** - * Provide a list of e-mail addresses for people allowed to administer the information for this Client - * @return contacts - **/ - @Schema(example = "[\"foo_bar@spam.org\"]", description = "Provide a list of e-mail addresses for people allowed to administer the information for this Client") - public List getContacts() { - return contacts; - } - - public void setContacts(List contacts) { - this.contacts = contacts; - } - - public RegisterSiteParams uiLocales(List uiLocales) { - this.uiLocales = uiLocales; - return this; - } - - public RegisterSiteParams addUiLocalesItem(String uiLocalesItem) { - if (this.uiLocales == null) { - this.uiLocales = new ArrayList(); - } - this.uiLocales.add(uiLocalesItem); - return this; - } - - /** - * Provide ui_locales, which can be used to pass the localization from the client application to the server application in the authorize request. - * @return uiLocales - **/ - @Schema(description = "Provide ui_locales, which can be used to pass the localization from the client application to the server application in the authorize request.") - public List getUiLocales() { - return uiLocales; - } - - public void setUiLocales(List uiLocales) { - this.uiLocales = uiLocales; - } - - public RegisterSiteParams claimsLocales(List claimsLocales) { - this.claimsLocales = claimsLocales; - return this; - } - - public RegisterSiteParams addClaimsLocalesItem(String claimsLocalesItem) { - if (this.claimsLocales == null) { - this.claimsLocales = new ArrayList(); - } - this.claimsLocales.add(claimsLocalesItem); - return this; - } - - /** - * Provide claims_locales, which end-user's preferred languages and scripts for Claims being returned. - * @return claimsLocales - **/ - @Schema(description = "Provide claims_locales, which end-user's preferred languages and scripts for Claims being returned.") - public List getClaimsLocales() { - return claimsLocales; - } - - public void setClaimsLocales(List claimsLocales) { - this.claimsLocales = claimsLocales; - } - - public RegisterSiteParams claimsRedirectUri(List claimsRedirectUri) { - this.claimsRedirectUri = claimsRedirectUri; - return this; - } - - public RegisterSiteParams addClaimsRedirectUriItem(String claimsRedirectUriItem) { - if (this.claimsRedirectUri == null) { - this.claimsRedirectUri = new ArrayList(); - } - this.claimsRedirectUri.add(claimsRedirectUriItem); - return this; - } - - /** - * Get claimsRedirectUri - * @return claimsRedirectUri - **/ - @Schema(description = "") - public List getClaimsRedirectUri() { - return claimsRedirectUri; - } - - public void setClaimsRedirectUri(List claimsRedirectUri) { - this.claimsRedirectUri = claimsRedirectUri; - } - - public RegisterSiteParams clientId(String clientId) { - this.clientId = clientId; - return this; - } - - /** - * client id of existing client, ignores all other parameters and skips new client registration forcing to use existing client (client_secret is required if this parameter is set). - * @return clientId - **/ - @Schema(description = "client id of existing client, ignores all other parameters and skips new client registration forcing to use existing client (client_secret is required if this parameter is set).") - public String getClientId() { - return clientId; - } - - public void setClientId(String clientId) { - this.clientId = clientId; - } - - public RegisterSiteParams clientSecret(String clientSecret) { - this.clientSecret = clientSecret; - return this; - } - - /** - * client secret of existing client, must be used together with client_id - * @return clientSecret - **/ - @Schema(description = "client secret of existing client, must be used together with client_id") - public String getClientSecret() { - return clientSecret; - } - - public void setClientSecret(String clientSecret) { - this.clientSecret = clientSecret; - } - - public RegisterSiteParams accessTokenAsJwt(Boolean accessTokenAsJwt) { - this.accessTokenAsJwt = accessTokenAsJwt; - return this; - } - - /** - * specifies whether access_token should be return as JWT or not. Default value is false. - * @return accessTokenAsJwt - **/ - @Schema(description = "specifies whether access_token should be return as JWT or not. Default value is false.") - public Boolean isAccessTokenAsJwt() { - return accessTokenAsJwt; - } - - public void setAccessTokenAsJwt(Boolean accessTokenAsJwt) { - this.accessTokenAsJwt = accessTokenAsJwt; - } - - public RegisterSiteParams accessTokenSigningAlg(String accessTokenSigningAlg) { - this.accessTokenSigningAlg = accessTokenSigningAlg; - return this; - } - - /** - * sets signing algorithm used for JWT signing. Valid values are none, HS256, HS384, HS512, RS256, RS384, RS512, ES256, ES384, ES512, PS256, PS384, PS512 - * @return accessTokenSigningAlg - **/ - @Schema(description = "sets signing algorithm used for JWT signing. Valid values are none, HS256, HS384, HS512, RS256, RS384, RS512, ES256, ES384, ES512, PS256, PS384, PS512") - public String getAccessTokenSigningAlg() { - return accessTokenSigningAlg; - } - - public void setAccessTokenSigningAlg(String accessTokenSigningAlg) { - this.accessTokenSigningAlg = accessTokenSigningAlg; - } - - public RegisterSiteParams rptAsJwt(Boolean rptAsJwt) { - this.rptAsJwt = rptAsJwt; - return this; - } - - /** - * specifies whether RPT should be return as JWT or not. Default value is false. - * @return rptAsJwt - **/ - @Schema(description = "specifies whether RPT should be return as JWT or not. Default value is false.") - public Boolean isRptAsJwt() { - return rptAsJwt; - } - - public void setRptAsJwt(Boolean rptAsJwt) { - this.rptAsJwt = rptAsJwt; - } - - public RegisterSiteParams logoUri(String logoUri) { - this.logoUri = logoUri; - return this; - } - - /** - * specifies an URL that references a logo for the Client application. - * @return logoUri - **/ - @Schema(example = "https://client.example.org/logo.png", description = "specifies an URL that references a logo for the Client application.") - public String getLogoUri() { - return logoUri; - } - - public void setLogoUri(String logoUri) { - this.logoUri = logoUri; - } - - public RegisterSiteParams clientUri(String clientUri) { - this.clientUri = clientUri; - return this; - } - - /** - * specifies an URL of the home page of the Client. - * @return clientUri - **/ - @Schema(example = "https://client.example.org/page", description = "specifies an URL of the home page of the Client.") - public String getClientUri() { - return clientUri; - } - - public void setClientUri(String clientUri) { - this.clientUri = clientUri; - } - - public RegisterSiteParams policyUri(String policyUri) { - this.policyUri = policyUri; - return this; - } - - /** - * specifies an URL that the Relying Party Client provides to the End-User to read about the how the profile data will be used. - * @return policyUri - **/ - @Schema(example = "https://client.example.org/page", description = "specifies an URL that the Relying Party Client provides to the End-User to read about the how the profile data will be used.") - public String getPolicyUri() { - return policyUri; - } - - public void setPolicyUri(String policyUri) { - this.policyUri = policyUri; - } - - public RegisterSiteParams frontChannelLogoutSessionRequired(Boolean frontChannelLogoutSessionRequired) { - this.frontChannelLogoutSessionRequired = frontChannelLogoutSessionRequired; - return this; - } - - /** - * specifies if front channel logout session required. - * @return frontChannelLogoutSessionRequired - **/ - @Schema(example = "true", description = "specifies if front channel logout session required.") - public Boolean isFrontChannelLogoutSessionRequired() { - return frontChannelLogoutSessionRequired; - } - - public void setFrontChannelLogoutSessionRequired(Boolean frontChannelLogoutSessionRequired) { - this.frontChannelLogoutSessionRequired = frontChannelLogoutSessionRequired; - } - - public RegisterSiteParams tosUri(String tosUri) { - this.tosUri = tosUri; - return this; - } - - /** - * specifies an URL that the Relying Party Client provides to the End-User to read about the Relying Party's terms. - * @return tosUri - **/ - @Schema(example = "https://client.example.org/page", description = "specifies an URL that the Relying Party Client provides to the End-User to read about the Relying Party's terms.") - public String getTosUri() { - return tosUri; - } - - public void setTosUri(String tosUri) { - this.tosUri = tosUri; - } - - public RegisterSiteParams jwks(String jwks) { - this.jwks = jwks; - return this; - } - - /** - * Client's JSON Web Key Set (JWK) document, passed by value. The semantics of the jwks parameter are the same as the jwks_uri parameter, other than that the JWK Set is passed by value, rather than by reference. This parameter is intended only to be used by Clients that, for some reason, are unable to use the jwks_uri parameter, for instance, by native applications that might not have a location to host the contents of the JWK Set. If a Client can use jwks_uri, it must not use jwks. One significant downside of jwks is that it does not enable key rotation. The jwks_uri and jwks parameters must not be used together. - * @return jwks - **/ - @Schema(example = "{\"key1\": \"value1\", \"key2\": \"value2\"}", description = "Client's JSON Web Key Set (JWK) document, passed by value. The semantics of the jwks parameter are the same as the jwks_uri parameter, other than that the JWK Set is passed by value, rather than by reference. This parameter is intended only to be used by Clients that, for some reason, are unable to use the jwks_uri parameter, for instance, by native applications that might not have a location to host the contents of the JWK Set. If a Client can use jwks_uri, it must not use jwks. One significant downside of jwks is that it does not enable key rotation. The jwks_uri and jwks parameters must not be used together.") - public String getJwks() { - return jwks; - } - - public void setJwks(String jwks) { - this.jwks = jwks; - } - - public RegisterSiteParams idTokenBindingCnf(String idTokenBindingCnf) { - this.idTokenBindingCnf = idTokenBindingCnf; - return this; - } - - /** - * Get idTokenBindingCnf - * @return idTokenBindingCnf - **/ - @Schema(example = "4NRB1-0XZABZI9E6-5SM3R", description = "") - public String getIdTokenBindingCnf() { - return idTokenBindingCnf; - } - - public void setIdTokenBindingCnf(String idTokenBindingCnf) { - this.idTokenBindingCnf = idTokenBindingCnf; - } - - public RegisterSiteParams tlsClientAuthSubjectDn(String tlsClientAuthSubjectDn) { - this.tlsClientAuthSubjectDn = tlsClientAuthSubjectDn; - return this; - } - - /** - * Get tlsClientAuthSubjectDn - * @return tlsClientAuthSubjectDn - **/ - @Schema(example = "www.test.com", description = "") - public String getTlsClientAuthSubjectDn() { - return tlsClientAuthSubjectDn; - } - - public void setTlsClientAuthSubjectDn(String tlsClientAuthSubjectDn) { - this.tlsClientAuthSubjectDn = tlsClientAuthSubjectDn; - } - - public RegisterSiteParams runIntrospectionScriptBeforeaccessTokenAsJwtCreationAndIncludeClaims(Boolean runIntrospectionScriptBeforeaccessTokenAsJwtCreationAndIncludeClaims) { - this.runIntrospectionScriptBeforeaccessTokenAsJwtCreationAndIncludeClaims = runIntrospectionScriptBeforeaccessTokenAsJwtCreationAndIncludeClaims; - return this; - } - - /** - * choose to run introspection script before access_token_as_jwt creation and include claims. - * @return runIntrospectionScriptBeforeaccessTokenAsJwtCreationAndIncludeClaims - **/ - @Schema(example = "true", description = "choose to run introspection script before access_token_as_jwt creation and include claims.") - public Boolean isRunIntrospectionScriptBeforeaccessTokenAsJwtCreationAndIncludeClaims() { - return runIntrospectionScriptBeforeaccessTokenAsJwtCreationAndIncludeClaims; - } - - public void setRunIntrospectionScriptBeforeaccessTokenAsJwtCreationAndIncludeClaims(Boolean runIntrospectionScriptBeforeaccessTokenAsJwtCreationAndIncludeClaims) { - this.runIntrospectionScriptBeforeaccessTokenAsJwtCreationAndIncludeClaims = runIntrospectionScriptBeforeaccessTokenAsJwtCreationAndIncludeClaims; - } - - public RegisterSiteParams idTokenSignedResponseAlg(String idTokenSignedResponseAlg) { - this.idTokenSignedResponseAlg = idTokenSignedResponseAlg; - return this; - } - - /** - * choose the JWS alg algorithm (JWA) required for the ID Token issued to this client_id. Valid values are none, HS256, HS384, HS512, RS256, RS384, RS512, ES256, ES384, ES512, PS256, PS384, PS512 - * @return idTokenSignedResponseAlg - **/ - @Schema(description = "choose the JWS alg algorithm (JWA) required for the ID Token issued to this client_id. Valid values are none, HS256, HS384, HS512, RS256, RS384, RS512, ES256, ES384, ES512, PS256, PS384, PS512") - public String getIdTokenSignedResponseAlg() { - return idTokenSignedResponseAlg; - } - - public void setIdTokenSignedResponseAlg(String idTokenSignedResponseAlg) { - this.idTokenSignedResponseAlg = idTokenSignedResponseAlg; - } - - public RegisterSiteParams idTokenEncryptedResponseAlg(String idTokenEncryptedResponseAlg) { - this.idTokenEncryptedResponseAlg = idTokenEncryptedResponseAlg; - return this; - } - - /** - * choose the JWE alg algorithm (JWA) required for encrypting the ID Token issued to this client_id. Valid values are RSA1_5, RSA-OAEP, A128KW, A256KW - * @return idTokenEncryptedResponseAlg - **/ - @Schema(description = "choose the JWE alg algorithm (JWA) required for encrypting the ID Token issued to this client_id. Valid values are RSA1_5, RSA-OAEP, A128KW, A256KW") - public String getIdTokenEncryptedResponseAlg() { - return idTokenEncryptedResponseAlg; - } - - public void setIdTokenEncryptedResponseAlg(String idTokenEncryptedResponseAlg) { - this.idTokenEncryptedResponseAlg = idTokenEncryptedResponseAlg; - } - - public RegisterSiteParams idTokenEncryptedResponseEnc(String idTokenEncryptedResponseEnc) { - this.idTokenEncryptedResponseEnc = idTokenEncryptedResponseEnc; - return this; - } - - /** - * choose the JWE enc algorithm (JWA) required for symmetric encryption of the ID Token issued to this client_id. Valid values are A128CBC+HS256, A256CBC+HS512, A128GCM, A256GCM - * @return idTokenEncryptedResponseEnc - **/ - @Schema(description = "choose the JWE enc algorithm (JWA) required for symmetric encryption of the ID Token issued to this client_id. Valid values are A128CBC+HS256, A256CBC+HS512, A128GCM, A256GCM") - public String getIdTokenEncryptedResponseEnc() { - return idTokenEncryptedResponseEnc; - } - - public void setIdTokenEncryptedResponseEnc(String idTokenEncryptedResponseEnc) { - this.idTokenEncryptedResponseEnc = idTokenEncryptedResponseEnc; - } - - public RegisterSiteParams userInfoSignedResponseAlg(String userInfoSignedResponseAlg) { - this.userInfoSignedResponseAlg = userInfoSignedResponseAlg; - return this; - } - - /** - * choose the JWS alg algorithm (JWA) required for UserInfo responses. Valid values are none, HS256, HS384, HS512, RS256, RS384, RS512, ES256, ES384, ES512, PS256, PS384, PS512 - * @return userInfoSignedResponseAlg - **/ - @Schema(description = "choose the JWS alg algorithm (JWA) required for UserInfo responses. Valid values are none, HS256, HS384, HS512, RS256, RS384, RS512, ES256, ES384, ES512, PS256, PS384, PS512") - public String getUserInfoSignedResponseAlg() { - return userInfoSignedResponseAlg; - } - - public void setUserInfoSignedResponseAlg(String userInfoSignedResponseAlg) { - this.userInfoSignedResponseAlg = userInfoSignedResponseAlg; - } - - public RegisterSiteParams userInfoEncryptedResponseAlg(String userInfoEncryptedResponseAlg) { - this.userInfoEncryptedResponseAlg = userInfoEncryptedResponseAlg; - return this; - } - - /** - * choose the JWE alg algorithm (JWA) required for encrypting UserInfo responses. Valid values are RSA1_5, RSA_OAEP, A128KW, A256KW - * @return userInfoEncryptedResponseAlg - **/ - @Schema(description = "choose the JWE alg algorithm (JWA) required for encrypting UserInfo responses. Valid values are RSA1_5, RSA_OAEP, A128KW, A256KW") - public String getUserInfoEncryptedResponseAlg() { - return userInfoEncryptedResponseAlg; - } - - public void setUserInfoEncryptedResponseAlg(String userInfoEncryptedResponseAlg) { - this.userInfoEncryptedResponseAlg = userInfoEncryptedResponseAlg; - } - - public RegisterSiteParams userInfoEncryptedResponseEnc(String userInfoEncryptedResponseEnc) { - this.userInfoEncryptedResponseEnc = userInfoEncryptedResponseEnc; - return this; - } - - /** - * choose the JWE enc algorithm (JWA) required for symmetric encryption of UserInfo responses. Valid values are A128CBC+HS256, A256CBC+HS512, A128GCM, A256GCM - * @return userInfoEncryptedResponseEnc - **/ - @Schema(description = "choose the JWE enc algorithm (JWA) required for symmetric encryption of UserInfo responses. Valid values are A128CBC+HS256, A256CBC+HS512, A128GCM, A256GCM") - public String getUserInfoEncryptedResponseEnc() { - return userInfoEncryptedResponseEnc; - } - - public void setUserInfoEncryptedResponseEnc(String userInfoEncryptedResponseEnc) { - this.userInfoEncryptedResponseEnc = userInfoEncryptedResponseEnc; - } - - public RegisterSiteParams requestObjectSigningAlg(String requestObjectSigningAlg) { - this.requestObjectSigningAlg = requestObjectSigningAlg; - return this; - } - - /** - * choose the JWS alg algorithm (JWA) that must be required by the Authorization Server. Valid values are none, HS256, HS384, HS512, RS256, RS384, RS512, ES256, ES384, ES512, PS256, PS384, PS512 - * @return requestObjectSigningAlg - **/ - @Schema(description = "choose the JWS alg algorithm (JWA) that must be required by the Authorization Server. Valid values are none, HS256, HS384, HS512, RS256, RS384, RS512, ES256, ES384, ES512, PS256, PS384, PS512") - public String getRequestObjectSigningAlg() { - return requestObjectSigningAlg; - } - - public void setRequestObjectSigningAlg(String requestObjectSigningAlg) { - this.requestObjectSigningAlg = requestObjectSigningAlg; - } - - public RegisterSiteParams requestObjectEncryptionAlg(String requestObjectEncryptionAlg) { - this.requestObjectEncryptionAlg = requestObjectEncryptionAlg; - return this; - } - - /** - * choose the JWE alg algorithm (JWA) the RP is declaring that it may use for encrypting Request Objects sent to the OP. Valid values are RSA1_5, RSA_OAEP, A128KW, A256KW - * @return requestObjectEncryptionAlg - **/ - @Schema(description = "choose the JWE alg algorithm (JWA) the RP is declaring that it may use for encrypting Request Objects sent to the OP. Valid values are RSA1_5, RSA_OAEP, A128KW, A256KW") - public String getRequestObjectEncryptionAlg() { - return requestObjectEncryptionAlg; - } - - public void setRequestObjectEncryptionAlg(String requestObjectEncryptionAlg) { - this.requestObjectEncryptionAlg = requestObjectEncryptionAlg; - } - - public RegisterSiteParams requestObjectEncryptionEnc(String requestObjectEncryptionEnc) { - this.requestObjectEncryptionEnc = requestObjectEncryptionEnc; - return this; - } - - /** - * choose the JWE enc algorithm (JWA) the RP is declaring that it may use for encrypting Request Objects sent to the OP. Valid values are A128CBC+HS256, A256CBC+HS512, A128GCM, A256GCM - * @return requestObjectEncryptionEnc - **/ - @Schema(description = "choose the JWE enc algorithm (JWA) the RP is declaring that it may use for encrypting Request Objects sent to the OP. Valid values are A128CBC+HS256, A256CBC+HS512, A128GCM, A256GCM") - public String getRequestObjectEncryptionEnc() { - return requestObjectEncryptionEnc; - } - - public void setRequestObjectEncryptionEnc(String requestObjectEncryptionEnc) { - this.requestObjectEncryptionEnc = requestObjectEncryptionEnc; - } - - public RegisterSiteParams defaultMaxAge(Integer defaultMaxAge) { - this.defaultMaxAge = defaultMaxAge; - return this; - } - - /** - * specifies the Default Maximum Authentication Age. - * @return defaultMaxAge - **/ - @Schema(example = "1000000", description = "specifies the Default Maximum Authentication Age.") - public Integer getDefaultMaxAge() { - return defaultMaxAge; - } - - public void setDefaultMaxAge(Integer defaultMaxAge) { - this.defaultMaxAge = defaultMaxAge; - } - - public RegisterSiteParams requireAuthTime(Boolean requireAuthTime) { - this.requireAuthTime = requireAuthTime; - return this; - } - - /** - * specifies the Boolean value specifying whether the auth_time claim in the id_token is required. It is required when the value is true. The auth_time claim request in the request object overrides this setting. - * @return requireAuthTime - **/ - @Schema(example = "true", description = "specifies the Boolean value specifying whether the auth_time claim in the id_token is required. It is required when the value is true. The auth_time claim request in the request object overrides this setting.") - public Boolean isRequireAuthTime() { - return requireAuthTime; - } - - public void setRequireAuthTime(Boolean requireAuthTime) { - this.requireAuthTime = requireAuthTime; - } - - public RegisterSiteParams initiateLoginUri(String initiateLoginUri) { - this.initiateLoginUri = initiateLoginUri; - return this; - } - - /** - * specifies the URI using the https scheme that the authorization server can call to initiate a login at the client. - * @return initiateLoginUri - **/ - @Schema(example = "https://client.example.org/authorization/page", description = "specifies the URI using the https scheme that the authorization server can call to initiate a login at the client.") - public String getInitiateLoginUri() { - return initiateLoginUri; - } - - public void setInitiateLoginUri(String initiateLoginUri) { - this.initiateLoginUri = initiateLoginUri; - } - - public RegisterSiteParams authorizedOrigins(List authorizedOrigins) { - this.authorizedOrigins = authorizedOrigins; - return this; - } - - public RegisterSiteParams addAuthorizedOriginsItem(String authorizedOriginsItem) { - if (this.authorizedOrigins == null) { - this.authorizedOrigins = new ArrayList(); - } - this.authorizedOrigins.add(authorizedOriginsItem); - return this; - } - - /** - * specifies authorized JavaScript origins. - * @return authorizedOrigins - **/ - @Schema(description = "specifies authorized JavaScript origins.") - public List getAuthorizedOrigins() { - return authorizedOrigins; - } - - public void setAuthorizedOrigins(List authorizedOrigins) { - this.authorizedOrigins = authorizedOrigins; - } - - public RegisterSiteParams accessTokenLifetime(Integer accessTokenLifetime) { - this.accessTokenLifetime = accessTokenLifetime; - return this; - } - - /** - * specifies the Client-specific access token expiration. - * @return accessTokenLifetime - **/ - @Schema(example = "100000000", description = "specifies the Client-specific access token expiration.") - public Integer getAccessTokenLifetime() { - return accessTokenLifetime; - } - - public void setAccessTokenLifetime(Integer accessTokenLifetime) { - this.accessTokenLifetime = accessTokenLifetime; - } - - public RegisterSiteParams softwareId(String softwareId) { - this.softwareId = softwareId; - return this; - } - - /** - * specifies a unique identifier string (UUID) assigned by the client developer or software publisher used by registration endpoints to identify the client software to be dynamically registered. - * @return softwareId - **/ - @Schema(example = "4NRB1-0XZABZI9E6-5SM3R", description = "specifies a unique identifier string (UUID) assigned by the client developer or software publisher used by registration endpoints to identify the client software to be dynamically registered.") - public String getSoftwareId() { - return softwareId; - } - - public void setSoftwareId(String softwareId) { - this.softwareId = softwareId; - } - - public RegisterSiteParams softwareVersion(String softwareVersion) { - this.softwareVersion = softwareVersion; - return this; - } - - /** - * specifies a version identifier string for the client software identified by 'software_id'. The value of the 'software_version' should change on any update to the client software identified by the same 'software_id'. - * @return softwareVersion - **/ - @Schema(example = "2.1", description = "specifies a version identifier string for the client software identified by 'software_id'. The value of the 'software_version' should change on any update to the client software identified by the same 'software_id'.") - public String getSoftwareVersion() { - return softwareVersion; - } - - public void setSoftwareVersion(String softwareVersion) { - this.softwareVersion = softwareVersion; - } - - public RegisterSiteParams softwareStatement(String softwareStatement) { - this.softwareStatement = softwareStatement; - return this; - } - - /** - * specifies a software statement containing client metadata values about the client software as claims. This is a string value containing the entire signed JWT. - * @return softwareStatement - **/ - @Schema(description = "specifies a software statement containing client metadata values about the client software as claims. This is a string value containing the entire signed JWT.") - public String getSoftwareStatement() { - return softwareStatement; - } - - public void setSoftwareStatement(String softwareStatement) { - this.softwareStatement = softwareStatement; - } - - public RegisterSiteParams customAttributes(Map customAttributes) { - this.customAttributes = customAttributes; - return this; - } - - public RegisterSiteParams putCustomAttributesItem(String key, String customAttributesItem) { - if (this.customAttributes == null) { - this.customAttributes = new HashMap(); - } - this.customAttributes.put(key, customAttributesItem); - return this; - } - - /** - * specifies custom attribute map copy. - * @return customAttributes - **/ - @Schema(description = "specifies custom attribute map copy.") - public Map getCustomAttributes() { - return customAttributes; - } - - public void setCustomAttributes(Map customAttributes) { - this.customAttributes = customAttributes; - } - - public RegisterSiteParams syncClientFromOp(Boolean syncClientFromOp) { - this.syncClientFromOp = syncClientFromOp; - return this; - } - - /** - * specifies whether to sync client from OP. Default value is false. - * @return syncClientFromOp - **/ - @Schema(example = "false", description = "specifies whether to sync client from OP. Default value is false.") - public Boolean isSyncClientFromOp() { - return syncClientFromOp; - } - - public void setSyncClientFromOp(Boolean syncClientFromOp) { - this.syncClientFromOp = syncClientFromOp; - } - - public RegisterSiteParams syncClientPeriodInSeconds(Integer syncClientPeriodInSeconds) { - this.syncClientPeriodInSeconds = syncClientPeriodInSeconds; - return this; - } - - /** - * specifies period after which client can sync again with OP. Default value is 86400 (in seconds). - * @return syncClientPeriodInSeconds - **/ - @Schema(example = "86400", description = "specifies period after which client can sync again with OP. Default value is 86400 (in seconds).") - public Integer getSyncClientPeriodInSeconds() { - return syncClientPeriodInSeconds; - } - - public void setSyncClientPeriodInSeconds(Integer syncClientPeriodInSeconds) { - this.syncClientPeriodInSeconds = syncClientPeriodInSeconds; - } - - public RegisterSiteParams allowSpontaneousScopes(Boolean allowSpontaneousScopes) { - this.allowSpontaneousScopes = allowSpontaneousScopes; - return this; - } - - /** - * specifies whether to allow spontaneous scopes for client. The default value is false - * @return allowSpontaneousScopes - **/ - @Schema(example = "false", description = "specifies whether to allow spontaneous scopes for client. The default value is false") - public Boolean isAllowSpontaneousScopes() { - return allowSpontaneousScopes; - } - - public void setAllowSpontaneousScopes(Boolean allowSpontaneousScopes) { - this.allowSpontaneousScopes = allowSpontaneousScopes; - } - - public RegisterSiteParams spontaneousScopes(List spontaneousScopes) { - this.spontaneousScopes = spontaneousScopes; - return this; - } - - public RegisterSiteParams addSpontaneousScopesItem(String spontaneousScopesItem) { - if (this.spontaneousScopes == null) { - this.spontaneousScopes = new ArrayList(); - } - this.spontaneousScopes.add(spontaneousScopesItem); - return this; - } - - /** - * list of spontaneous scopes (regexp against which validation is performed). - * @return spontaneousScopes - **/ - @Schema(description = "list of spontaneous scopes (regexp against which validation is performed).") - public List getSpontaneousScopes() { - return spontaneousScopes; - } - - public void setSpontaneousScopes(List spontaneousScopes) { - this.spontaneousScopes = spontaneousScopes; - } - - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - RegisterSiteParams registerSiteParams = (RegisterSiteParams) o; - return Objects.equals(this.redirectUris, registerSiteParams.redirectUris) && - Objects.equals(this.opConfigurationEndpoint, registerSiteParams.opConfigurationEndpoint) && - Objects.equals(this.opHost, registerSiteParams.opHost) && - Objects.equals(this.opDiscoveryPath, registerSiteParams.opDiscoveryPath) && - Objects.equals(this.postLogoutRedirectUris, registerSiteParams.postLogoutRedirectUris) && - Objects.equals(this.responseTypes, registerSiteParams.responseTypes) && - Objects.equals(this.grantTypes, registerSiteParams.grantTypes) && - Objects.equals(this.scope, registerSiteParams.scope) && - Objects.equals(this.acrValues, registerSiteParams.acrValues) && - Objects.equals(this.clientName, registerSiteParams.clientName) && - Objects.equals(this.clientJwksUri, registerSiteParams.clientJwksUri) && - Objects.equals(this.clientTokenEndpointAuthMethod, registerSiteParams.clientTokenEndpointAuthMethod) && - Objects.equals(this.clientTokenEndpointAuthSigningAlg, registerSiteParams.clientTokenEndpointAuthSigningAlg) && - Objects.equals(this.clientRequestUris, registerSiteParams.clientRequestUris) && - Objects.equals(this.clientFrontchannelLogoutUri, registerSiteParams.clientFrontchannelLogoutUri) && - Objects.equals(this.clientSectorIdentifierUri, registerSiteParams.clientSectorIdentifierUri) && - Objects.equals(this.contacts, registerSiteParams.contacts) && - Objects.equals(this.uiLocales, registerSiteParams.uiLocales) && - Objects.equals(this.claimsLocales, registerSiteParams.claimsLocales) && - Objects.equals(this.claimsRedirectUri, registerSiteParams.claimsRedirectUri) && - Objects.equals(this.clientId, registerSiteParams.clientId) && - Objects.equals(this.clientSecret, registerSiteParams.clientSecret) && - Objects.equals(this.accessTokenAsJwt, registerSiteParams.accessTokenAsJwt) && - Objects.equals(this.accessTokenSigningAlg, registerSiteParams.accessTokenSigningAlg) && - Objects.equals(this.rptAsJwt, registerSiteParams.rptAsJwt) && - Objects.equals(this.logoUri, registerSiteParams.logoUri) && - Objects.equals(this.clientUri, registerSiteParams.clientUri) && - Objects.equals(this.policyUri, registerSiteParams.policyUri) && - Objects.equals(this.frontChannelLogoutSessionRequired, registerSiteParams.frontChannelLogoutSessionRequired) && - Objects.equals(this.tosUri, registerSiteParams.tosUri) && - Objects.equals(this.jwks, registerSiteParams.jwks) && - Objects.equals(this.idTokenBindingCnf, registerSiteParams.idTokenBindingCnf) && - Objects.equals(this.tlsClientAuthSubjectDn, registerSiteParams.tlsClientAuthSubjectDn) && - Objects.equals(this.runIntrospectionScriptBeforeaccessTokenAsJwtCreationAndIncludeClaims, registerSiteParams.runIntrospectionScriptBeforeaccessTokenAsJwtCreationAndIncludeClaims) && - Objects.equals(this.idTokenSignedResponseAlg, registerSiteParams.idTokenSignedResponseAlg) && - Objects.equals(this.idTokenEncryptedResponseAlg, registerSiteParams.idTokenEncryptedResponseAlg) && - Objects.equals(this.idTokenEncryptedResponseEnc, registerSiteParams.idTokenEncryptedResponseEnc) && - Objects.equals(this.userInfoSignedResponseAlg, registerSiteParams.userInfoSignedResponseAlg) && - Objects.equals(this.userInfoEncryptedResponseAlg, registerSiteParams.userInfoEncryptedResponseAlg) && - Objects.equals(this.userInfoEncryptedResponseEnc, registerSiteParams.userInfoEncryptedResponseEnc) && - Objects.equals(this.requestObjectSigningAlg, registerSiteParams.requestObjectSigningAlg) && - Objects.equals(this.requestObjectEncryptionAlg, registerSiteParams.requestObjectEncryptionAlg) && - Objects.equals(this.requestObjectEncryptionEnc, registerSiteParams.requestObjectEncryptionEnc) && - Objects.equals(this.defaultMaxAge, registerSiteParams.defaultMaxAge) && - Objects.equals(this.requireAuthTime, registerSiteParams.requireAuthTime) && - Objects.equals(this.initiateLoginUri, registerSiteParams.initiateLoginUri) && - Objects.equals(this.authorizedOrigins, registerSiteParams.authorizedOrigins) && - Objects.equals(this.accessTokenLifetime, registerSiteParams.accessTokenLifetime) && - Objects.equals(this.softwareId, registerSiteParams.softwareId) && - Objects.equals(this.softwareVersion, registerSiteParams.softwareVersion) && - Objects.equals(this.softwareStatement, registerSiteParams.softwareStatement) && - Objects.equals(this.customAttributes, registerSiteParams.customAttributes) && - Objects.equals(this.syncClientFromOp, registerSiteParams.syncClientFromOp) && - Objects.equals(this.syncClientPeriodInSeconds, registerSiteParams.syncClientPeriodInSeconds) && - Objects.equals(this.allowSpontaneousScopes, registerSiteParams.allowSpontaneousScopes) && - Objects.equals(this.spontaneousScopes, registerSiteParams.spontaneousScopes); - } - - @Override - public int hashCode() { - return Objects.hash(redirectUris, opConfigurationEndpoint, opHost, opDiscoveryPath, postLogoutRedirectUris, responseTypes, grantTypes, scope, acrValues, clientName, clientJwksUri, clientTokenEndpointAuthMethod, clientTokenEndpointAuthSigningAlg, clientRequestUris, clientFrontchannelLogoutUri, clientSectorIdentifierUri, contacts, uiLocales, claimsLocales, claimsRedirectUri, clientId, clientSecret, accessTokenAsJwt, accessTokenSigningAlg, rptAsJwt, logoUri, clientUri, policyUri, frontChannelLogoutSessionRequired, tosUri, jwks, idTokenBindingCnf, tlsClientAuthSubjectDn, runIntrospectionScriptBeforeaccessTokenAsJwtCreationAndIncludeClaims, idTokenSignedResponseAlg, idTokenEncryptedResponseAlg, idTokenEncryptedResponseEnc, userInfoSignedResponseAlg, userInfoEncryptedResponseAlg, userInfoEncryptedResponseEnc, requestObjectSigningAlg, requestObjectEncryptionAlg, requestObjectEncryptionEnc, defaultMaxAge, requireAuthTime, initiateLoginUri, authorizedOrigins, accessTokenLifetime, softwareId, softwareVersion, softwareStatement, customAttributes, syncClientFromOp, syncClientPeriodInSeconds, allowSpontaneousScopes, spontaneousScopes); - } - - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class RegisterSiteParams {\n"); - - sb.append(" redirectUris: ").append(toIndentedString(redirectUris)).append("\n"); - sb.append(" opConfigurationEndpoint: ").append(toIndentedString(opConfigurationEndpoint)).append("\n"); - sb.append(" opHost: ").append(toIndentedString(opHost)).append("\n"); - sb.append(" opDiscoveryPath: ").append(toIndentedString(opDiscoveryPath)).append("\n"); - sb.append(" postLogoutRedirectUris: ").append(toIndentedString(postLogoutRedirectUris)).append("\n"); - sb.append(" responseTypes: ").append(toIndentedString(responseTypes)).append("\n"); - sb.append(" grantTypes: ").append(toIndentedString(grantTypes)).append("\n"); - sb.append(" scope: ").append(toIndentedString(scope)).append("\n"); - sb.append(" acrValues: ").append(toIndentedString(acrValues)).append("\n"); - sb.append(" clientName: ").append(toIndentedString(clientName)).append("\n"); - sb.append(" clientJwksUri: ").append(toIndentedString(clientJwksUri)).append("\n"); - sb.append(" clientTokenEndpointAuthMethod: ").append(toIndentedString(clientTokenEndpointAuthMethod)).append("\n"); - sb.append(" clientTokenEndpointAuthSigningAlg: ").append(toIndentedString(clientTokenEndpointAuthSigningAlg)).append("\n"); - sb.append(" clientRequestUris: ").append(toIndentedString(clientRequestUris)).append("\n"); - sb.append(" clientFrontchannelLogoutUri: ").append(toIndentedString(clientFrontchannelLogoutUri)).append("\n"); - sb.append(" clientSectorIdentifierUri: ").append(toIndentedString(clientSectorIdentifierUri)).append("\n"); - sb.append(" contacts: ").append(toIndentedString(contacts)).append("\n"); - sb.append(" uiLocales: ").append(toIndentedString(uiLocales)).append("\n"); - sb.append(" claimsLocales: ").append(toIndentedString(claimsLocales)).append("\n"); - sb.append(" claimsRedirectUri: ").append(toIndentedString(claimsRedirectUri)).append("\n"); - sb.append(" clientId: ").append(toIndentedString(clientId)).append("\n"); - sb.append(" clientSecret: ").append(toIndentedString(clientSecret)).append("\n"); - sb.append(" accessTokenAsJwt: ").append(toIndentedString(accessTokenAsJwt)).append("\n"); - sb.append(" accessTokenSigningAlg: ").append(toIndentedString(accessTokenSigningAlg)).append("\n"); - sb.append(" rptAsJwt: ").append(toIndentedString(rptAsJwt)).append("\n"); - sb.append(" logoUri: ").append(toIndentedString(logoUri)).append("\n"); - sb.append(" clientUri: ").append(toIndentedString(clientUri)).append("\n"); - sb.append(" policyUri: ").append(toIndentedString(policyUri)).append("\n"); - sb.append(" frontChannelLogoutSessionRequired: ").append(toIndentedString(frontChannelLogoutSessionRequired)).append("\n"); - sb.append(" tosUri: ").append(toIndentedString(tosUri)).append("\n"); - sb.append(" jwks: ").append(toIndentedString(jwks)).append("\n"); - sb.append(" idTokenBindingCnf: ").append(toIndentedString(idTokenBindingCnf)).append("\n"); - sb.append(" tlsClientAuthSubjectDn: ").append(toIndentedString(tlsClientAuthSubjectDn)).append("\n"); - sb.append(" runIntrospectionScriptBeforeaccessTokenAsJwtCreationAndIncludeClaims: ").append(toIndentedString(runIntrospectionScriptBeforeaccessTokenAsJwtCreationAndIncludeClaims)).append("\n"); - sb.append(" idTokenSignedResponseAlg: ").append(toIndentedString(idTokenSignedResponseAlg)).append("\n"); - sb.append(" idTokenEncryptedResponseAlg: ").append(toIndentedString(idTokenEncryptedResponseAlg)).append("\n"); - sb.append(" idTokenEncryptedResponseEnc: ").append(toIndentedString(idTokenEncryptedResponseEnc)).append("\n"); - sb.append(" userInfoSignedResponseAlg: ").append(toIndentedString(userInfoSignedResponseAlg)).append("\n"); - sb.append(" userInfoEncryptedResponseAlg: ").append(toIndentedString(userInfoEncryptedResponseAlg)).append("\n"); - sb.append(" userInfoEncryptedResponseEnc: ").append(toIndentedString(userInfoEncryptedResponseEnc)).append("\n"); - sb.append(" requestObjectSigningAlg: ").append(toIndentedString(requestObjectSigningAlg)).append("\n"); - sb.append(" requestObjectEncryptionAlg: ").append(toIndentedString(requestObjectEncryptionAlg)).append("\n"); - sb.append(" requestObjectEncryptionEnc: ").append(toIndentedString(requestObjectEncryptionEnc)).append("\n"); - sb.append(" defaultMaxAge: ").append(toIndentedString(defaultMaxAge)).append("\n"); - sb.append(" requireAuthTime: ").append(toIndentedString(requireAuthTime)).append("\n"); - sb.append(" initiateLoginUri: ").append(toIndentedString(initiateLoginUri)).append("\n"); - sb.append(" authorizedOrigins: ").append(toIndentedString(authorizedOrigins)).append("\n"); - sb.append(" accessTokenLifetime: ").append(toIndentedString(accessTokenLifetime)).append("\n"); - sb.append(" softwareId: ").append(toIndentedString(softwareId)).append("\n"); - sb.append(" softwareVersion: ").append(toIndentedString(softwareVersion)).append("\n"); - sb.append(" softwareStatement: ").append(toIndentedString(softwareStatement)).append("\n"); - sb.append(" customAttributes: ").append(toIndentedString(customAttributes)).append("\n"); - sb.append(" syncClientFromOp: ").append(toIndentedString(syncClientFromOp)).append("\n"); - sb.append(" syncClientPeriodInSeconds: ").append(toIndentedString(syncClientPeriodInSeconds)).append("\n"); - sb.append(" allowSpontaneousScopes: ").append(toIndentedString(allowSpontaneousScopes)).append("\n"); - sb.append(" spontaneousScopes: ").append(toIndentedString(spontaneousScopes)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - -} diff --git a/jans-client-api/gen-client/src/main/java/io/swagger/client/model/RegisterSiteResponse.java b/jans-client-api/gen-client/src/main/java/io/swagger/client/model/RegisterSiteResponse.java deleted file mode 100644 index cb127b4ad3e..00000000000 --- a/jans-client-api/gen-client/src/main/java/io/swagger/client/model/RegisterSiteResponse.java +++ /dev/null @@ -1,275 +0,0 @@ -/* - * jans-api-server - * jans-api-server - * - * OpenAPI spec version: 4.2 - * Contact: yuriyz@gluu.org - * - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen.git - * Do not edit the class manually. - */ - -package io.swagger.client.model; - -import java.util.Objects; -import java.util.Arrays; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import io.swagger.v3.oas.annotations.media.Schema; -import java.io.IOException; -/** - * RegisterSiteResponse - */ - - -public class RegisterSiteResponse { - @SerializedName("rp_id") - private String rpId = null; - - @SerializedName("op_host") - private String opHost = null; - - @SerializedName("client_id") - private String clientId = null; - - @SerializedName("client_name") - private String clientName = null; - - @SerializedName("client_secret") - private String clientSecret = null; - - @SerializedName("client_registration_access_token") - private String clientRegistrationAccessToken = null; - - @SerializedName("client_registration_client_uri") - private String clientRegistrationClientUri = null; - - @SerializedName("client_id_issued_at") - private Integer clientIdIssuedAt = null; - - @SerializedName("client_secret_expires_at") - private Integer clientSecretExpiresAt = null; - - public RegisterSiteResponse rpId(String rpId) { - this.rpId = rpId; - return this; - } - - /** - * Get rpId - * @return rpId - **/ - @Schema(example = "bcad760f-91ba-46e1-a020-05e4281d91b6", required = true, description = "") - public String getRpId() { - return rpId; - } - - public void setRpId(String rpId) { - this.rpId = rpId; - } - - public RegisterSiteResponse opHost(String opHost) { - this.opHost = opHost; - return this; - } - - /** - * Get opHost - * @return opHost - **/ - @Schema(example = "https://", required = true, description = "") - public String getOpHost() { - return opHost; - } - - public void setOpHost(String opHost) { - this.opHost = opHost; - } - - public RegisterSiteResponse clientId(String clientId) { - this.clientId = clientId; - return this; - } - - /** - * Get clientId - * @return clientId - **/ - @Schema(example = "@!1736.179E.AA60.16B2!0001!8F7C.B9AB!0008!A2BB.9AE6.5F14.B387", description = "") - public String getClientId() { - return clientId; - } - - public void setClientId(String clientId) { - this.clientId = clientId; - } - - public RegisterSiteResponse clientName(String clientName) { - this.clientName = clientName; - return this; - } - - /** - * Get clientName - * @return clientName - **/ - @Schema(example = "TestClientName", description = "") - public String getClientName() { - return clientName; - } - - public void setClientName(String clientName) { - this.clientName = clientName; - } - - public RegisterSiteResponse clientSecret(String clientSecret) { - this.clientSecret = clientSecret; - return this; - } - - /** - * Get clientSecret - * @return clientSecret - **/ - @Schema(example = "f436b936-03fc-433f-9772-53c2bc9e1c74", description = "") - public String getClientSecret() { - return clientSecret; - } - - public void setClientSecret(String clientSecret) { - this.clientSecret = clientSecret; - } - - public RegisterSiteResponse clientRegistrationAccessToken(String clientRegistrationAccessToken) { - this.clientRegistrationAccessToken = clientRegistrationAccessToken; - return this; - } - - /** - * Get clientRegistrationAccessToken - * @return clientRegistrationAccessToken - **/ - @Schema(example = "d836df94-44b0-445a-848a-d43189839b17", description = "") - public String getClientRegistrationAccessToken() { - return clientRegistrationAccessToken; - } - - public void setClientRegistrationAccessToken(String clientRegistrationAccessToken) { - this.clientRegistrationAccessToken = clientRegistrationAccessToken; - } - - public RegisterSiteResponse clientRegistrationClientUri(String clientRegistrationClientUri) { - this.clientRegistrationClientUri = clientRegistrationClientUri; - return this; - } - - /** - * Get clientRegistrationClientUri - * @return clientRegistrationClientUri - **/ - @Schema(example = "https:///oxauth/restv1/register?client_id=@!1736.179E.AA60.16B2!0001!8F7C.B9AB!0008!A2BB.9AE6.5F14.B387", description = "") - public String getClientRegistrationClientUri() { - return clientRegistrationClientUri; - } - - public void setClientRegistrationClientUri(String clientRegistrationClientUri) { - this.clientRegistrationClientUri = clientRegistrationClientUri; - } - - public RegisterSiteResponse clientIdIssuedAt(Integer clientIdIssuedAt) { - this.clientIdIssuedAt = clientIdIssuedAt; - return this; - } - - /** - * Get clientIdIssuedAt - * @return clientIdIssuedAt - **/ - @Schema(example = "1501854943", description = "") - public Integer getClientIdIssuedAt() { - return clientIdIssuedAt; - } - - public void setClientIdIssuedAt(Integer clientIdIssuedAt) { - this.clientIdIssuedAt = clientIdIssuedAt; - } - - public RegisterSiteResponse clientSecretExpiresAt(Integer clientSecretExpiresAt) { - this.clientSecretExpiresAt = clientSecretExpiresAt; - return this; - } - - /** - * Get clientSecretExpiresAt - * @return clientSecretExpiresAt - **/ - @Schema(example = "1501941343", description = "") - public Integer getClientSecretExpiresAt() { - return clientSecretExpiresAt; - } - - public void setClientSecretExpiresAt(Integer clientSecretExpiresAt) { - this.clientSecretExpiresAt = clientSecretExpiresAt; - } - - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - RegisterSiteResponse registerSiteResponse = (RegisterSiteResponse) o; - return Objects.equals(this.rpId, registerSiteResponse.rpId) && - Objects.equals(this.opHost, registerSiteResponse.opHost) && - Objects.equals(this.clientId, registerSiteResponse.clientId) && - Objects.equals(this.clientName, registerSiteResponse.clientName) && - Objects.equals(this.clientSecret, registerSiteResponse.clientSecret) && - Objects.equals(this.clientRegistrationAccessToken, registerSiteResponse.clientRegistrationAccessToken) && - Objects.equals(this.clientRegistrationClientUri, registerSiteResponse.clientRegistrationClientUri) && - Objects.equals(this.clientIdIssuedAt, registerSiteResponse.clientIdIssuedAt) && - Objects.equals(this.clientSecretExpiresAt, registerSiteResponse.clientSecretExpiresAt); - } - - @Override - public int hashCode() { - return Objects.hash(rpId, opHost, clientId, clientName, clientSecret, clientRegistrationAccessToken, clientRegistrationClientUri, clientIdIssuedAt, clientSecretExpiresAt); - } - - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class RegisterSiteResponse {\n"); - - sb.append(" rpId: ").append(toIndentedString(rpId)).append("\n"); - sb.append(" opHost: ").append(toIndentedString(opHost)).append("\n"); - sb.append(" clientId: ").append(toIndentedString(clientId)).append("\n"); - sb.append(" clientName: ").append(toIndentedString(clientName)).append("\n"); - sb.append(" clientSecret: ").append(toIndentedString(clientSecret)).append("\n"); - sb.append(" clientRegistrationAccessToken: ").append(toIndentedString(clientRegistrationAccessToken)).append("\n"); - sb.append(" clientRegistrationClientUri: ").append(toIndentedString(clientRegistrationClientUri)).append("\n"); - sb.append(" clientIdIssuedAt: ").append(toIndentedString(clientIdIssuedAt)).append("\n"); - sb.append(" clientSecretExpiresAt: ").append(toIndentedString(clientSecretExpiresAt)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - -} diff --git a/jans-client-api/gen-client/src/main/java/io/swagger/client/model/RemoveSiteParams.java b/jans-client-api/gen-client/src/main/java/io/swagger/client/model/RemoveSiteParams.java deleted file mode 100644 index ef985385bd9..00000000000 --- a/jans-client-api/gen-client/src/main/java/io/swagger/client/model/RemoveSiteParams.java +++ /dev/null @@ -1,91 +0,0 @@ -/* - * jans-api-server - * jans-api-server - * - * OpenAPI spec version: 4.2 - * Contact: yuriyz@gluu.org - * - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen.git - * Do not edit the class manually. - */ - -package io.swagger.client.model; - -import java.util.Objects; -import java.util.Arrays; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import io.swagger.v3.oas.annotations.media.Schema; -import java.io.IOException; -/** - * RemoveSiteParams - */ - - -public class RemoveSiteParams { - @SerializedName("rp_id") - private String rpId = null; - - public RemoveSiteParams rpId(String rpId) { - this.rpId = rpId; - return this; - } - - /** - * Get rpId - * @return rpId - **/ - @Schema(example = "6F9619FF-8B86-D011-B42D-00CF4FC964FF", required = true, description = "") - public String getRpId() { - return rpId; - } - - public void setRpId(String rpId) { - this.rpId = rpId; - } - - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - RemoveSiteParams removeSiteParams = (RemoveSiteParams) o; - return Objects.equals(this.rpId, removeSiteParams.rpId); - } - - @Override - public int hashCode() { - return Objects.hash(rpId); - } - - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class RemoveSiteParams {\n"); - - sb.append(" rpId: ").append(toIndentedString(rpId)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - -} diff --git a/jans-client-api/gen-client/src/main/java/io/swagger/client/model/RemoveSiteResponse.java b/jans-client-api/gen-client/src/main/java/io/swagger/client/model/RemoveSiteResponse.java deleted file mode 100644 index ad4ceb3f7ee..00000000000 --- a/jans-client-api/gen-client/src/main/java/io/swagger/client/model/RemoveSiteResponse.java +++ /dev/null @@ -1,91 +0,0 @@ -/* - * jans-api-server - * jans-api-server - * - * OpenAPI spec version: 4.2 - * Contact: yuriyz@gluu.org - * - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen.git - * Do not edit the class manually. - */ - -package io.swagger.client.model; - -import java.util.Objects; -import java.util.Arrays; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import io.swagger.v3.oas.annotations.media.Schema; -import java.io.IOException; -/** - * RemoveSiteResponse - */ - - -public class RemoveSiteResponse { - @SerializedName("rp_id") - private String rpId = null; - - public RemoveSiteResponse rpId(String rpId) { - this.rpId = rpId; - return this; - } - - /** - * Get rpId - * @return rpId - **/ - @Schema(required = true, description = "") - public String getRpId() { - return rpId; - } - - public void setRpId(String rpId) { - this.rpId = rpId; - } - - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - RemoveSiteResponse removeSiteResponse = (RemoveSiteResponse) o; - return Objects.equals(this.rpId, removeSiteResponse.rpId); - } - - @Override - public int hashCode() { - return Objects.hash(rpId); - } - - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class RemoveSiteResponse {\n"); - - sb.append(" rpId: ").append(toIndentedString(rpId)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - -} diff --git a/jans-client-api/gen-client/src/main/java/io/swagger/client/model/RsResource.java b/jans-client-api/gen-client/src/main/java/io/swagger/client/model/RsResource.java deleted file mode 100644 index a9a806e7786..00000000000 --- a/jans-client-api/gen-client/src/main/java/io/swagger/client/model/RsResource.java +++ /dev/null @@ -1,168 +0,0 @@ -/* - * jans-api-server - * jans-api-server - * - * OpenAPI spec version: 4.2 - * Contact: yuriyz@gluu.org - * - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen.git - * Do not edit the class manually. - */ - -package io.swagger.client.model; - -import java.util.Objects; -import java.util.Arrays; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import io.swagger.client.model.Condition; -import io.swagger.v3.oas.annotations.media.Schema; -import java.io.IOException; -import java.util.ArrayList; -import java.util.List; -/** - * RsResource - */ - - -public class RsResource { - @SerializedName("path") - private String path = null; - - @SerializedName("conditions") - private List conditions = new ArrayList(); - - @SerializedName("exp") - private Long exp = null; - - @SerializedName("iat") - private Long iat = null; - - public RsResource path(String path) { - this.path = path; - return this; - } - - /** - * Get path - * @return path - **/ - @Schema(required = true, description = "") - public String getPath() { - return path; - } - - public void setPath(String path) { - this.path = path; - } - - public RsResource conditions(List conditions) { - this.conditions = conditions; - return this; - } - - public RsResource addConditionsItem(Condition conditionsItem) { - this.conditions.add(conditionsItem); - return this; - } - - /** - * Get conditions - * @return conditions - **/ - @Schema(required = true, description = "") - public List getConditions() { - return conditions; - } - - public void setConditions(List conditions) { - this.conditions = conditions; - } - - public RsResource exp(Long exp) { - this.exp = exp; - return this; - } - - /** - * Resource expiration date in terms of number of seconds since January 1 1970 UTC - * @return exp - **/ - @Schema(example = "1545709072", description = "Resource expiration date in terms of number of seconds since January 1 1970 UTC") - public Long getExp() { - return exp; - } - - public void setExp(Long exp) { - this.exp = exp; - } - - public RsResource iat(Long iat) { - this.iat = iat; - return this; - } - - /** - * Resource creation date in terms of number of seconds since January 1 1970 UTC - * @return iat - **/ - @Schema(example = "1535709072", description = "Resource creation date in terms of number of seconds since January 1 1970 UTC") - public Long getIat() { - return iat; - } - - public void setIat(Long iat) { - this.iat = iat; - } - - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - RsResource rsResource = (RsResource) o; - return Objects.equals(this.path, rsResource.path) && - Objects.equals(this.conditions, rsResource.conditions) && - Objects.equals(this.exp, rsResource.exp) && - Objects.equals(this.iat, rsResource.iat); - } - - @Override - public int hashCode() { - return Objects.hash(path, conditions, exp, iat); - } - - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class RsResource {\n"); - - sb.append(" path: ").append(toIndentedString(path)).append("\n"); - sb.append(" conditions: ").append(toIndentedString(conditions)).append("\n"); - sb.append(" exp: ").append(toIndentedString(exp)).append("\n"); - sb.append(" iat: ").append(toIndentedString(iat)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - -} diff --git a/jans-client-api/gen-client/src/main/java/io/swagger/client/model/UmaRpGetClaimsGatheringUrlParams.java b/jans-client-api/gen-client/src/main/java/io/swagger/client/model/UmaRpGetClaimsGatheringUrlParams.java deleted file mode 100644 index c0cdb02e1e4..00000000000 --- a/jans-client-api/gen-client/src/main/java/io/swagger/client/model/UmaRpGetClaimsGatheringUrlParams.java +++ /dev/null @@ -1,194 +0,0 @@ -/* - * jans-api-server - * jans-api-server - * - * OpenAPI spec version: 4.2 - * Contact: yuriyz@gluu.org - * - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen.git - * Do not edit the class manually. - */ - -package io.swagger.client.model; - -import java.util.Objects; -import java.util.Arrays; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import io.swagger.v3.oas.annotations.media.Schema; -import java.io.IOException; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -/** - * UmaRpGetClaimsGatheringUrlParams - */ - - -public class UmaRpGetClaimsGatheringUrlParams { - @SerializedName("rp_id") - private String rpId = null; - - @SerializedName("ticket") - private String ticket = null; - - @SerializedName("state") - private String state = null; - - @SerializedName("claims_redirect_uri") - private String claimsRedirectUri = null; - - @SerializedName("custom_parameters") - private Map customParameters = null; - - public UmaRpGetClaimsGatheringUrlParams rpId(String rpId) { - this.rpId = rpId; - return this; - } - - /** - * Get rpId - * @return rpId - **/ - @Schema(example = "bcad760f-91ba-46e1-a020-05e4281d91b6", required = true, description = "") - public String getRpId() { - return rpId; - } - - public void setRpId(String rpId) { - this.rpId = rpId; - } - - public UmaRpGetClaimsGatheringUrlParams ticket(String ticket) { - this.ticket = ticket; - return this; - } - - /** - * Get ticket - * @return ticket - **/ - @Schema(example = "fba00191-59ab-4ed6-ac99-a786a88a9f40", required = true, description = "") - public String getTicket() { - return ticket; - } - - public void setTicket(String ticket) { - this.ticket = ticket; - } - - public UmaRpGetClaimsGatheringUrlParams state(String state) { - this.state = state; - return this; - } - - /** - * Get state - * @return state - **/ - @Schema(description = "") - public String getState() { - return state; - } - - public void setState(String state) { - this.state = state; - } - - public UmaRpGetClaimsGatheringUrlParams claimsRedirectUri(String claimsRedirectUri) { - this.claimsRedirectUri = claimsRedirectUri; - return this; - } - - /** - * Get claimsRedirectUri - * @return claimsRedirectUri - **/ - @Schema(example = "https://client.example.com/cb", required = true, description = "") - public String getClaimsRedirectUri() { - return claimsRedirectUri; - } - - public void setClaimsRedirectUri(String claimsRedirectUri) { - this.claimsRedirectUri = claimsRedirectUri; - } - - public UmaRpGetClaimsGatheringUrlParams customParameters(Map customParameters) { - this.customParameters = customParameters; - return this; - } - - public UmaRpGetClaimsGatheringUrlParams putCustomParametersItem(String key, String customParametersItem) { - if (this.customParameters == null) { - this.customParameters = new HashMap(); - } - this.customParameters.put(key, customParametersItem); - return this; - } - - /** - * Get customParameters - * @return customParameters - **/ - @Schema(description = "") - public Map getCustomParameters() { - return customParameters; - } - - public void setCustomParameters(Map customParameters) { - this.customParameters = customParameters; - } - - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - UmaRpGetClaimsGatheringUrlParams umaRpGetClaimsGatheringUrlParams = (UmaRpGetClaimsGatheringUrlParams) o; - return Objects.equals(this.rpId, umaRpGetClaimsGatheringUrlParams.rpId) && - Objects.equals(this.ticket, umaRpGetClaimsGatheringUrlParams.ticket) && - Objects.equals(this.state, umaRpGetClaimsGatheringUrlParams.state) && - Objects.equals(this.claimsRedirectUri, umaRpGetClaimsGatheringUrlParams.claimsRedirectUri) && - Objects.equals(this.customParameters, umaRpGetClaimsGatheringUrlParams.customParameters); - } - - @Override - public int hashCode() { - return Objects.hash(rpId, ticket, state, claimsRedirectUri, customParameters); - } - - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class UmaRpGetClaimsGatheringUrlParams {\n"); - - sb.append(" rpId: ").append(toIndentedString(rpId)).append("\n"); - sb.append(" ticket: ").append(toIndentedString(ticket)).append("\n"); - sb.append(" state: ").append(toIndentedString(state)).append("\n"); - sb.append(" claimsRedirectUri: ").append(toIndentedString(claimsRedirectUri)).append("\n"); - sb.append(" customParameters: ").append(toIndentedString(customParameters)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - -} diff --git a/jans-client-api/gen-client/src/main/java/io/swagger/client/model/UmaRpGetClaimsGatheringUrlResponse.java b/jans-client-api/gen-client/src/main/java/io/swagger/client/model/UmaRpGetClaimsGatheringUrlResponse.java deleted file mode 100644 index fcaac65dff6..00000000000 --- a/jans-client-api/gen-client/src/main/java/io/swagger/client/model/UmaRpGetClaimsGatheringUrlResponse.java +++ /dev/null @@ -1,114 +0,0 @@ -/* - * jans-api-server - * jans-api-server - * - * OpenAPI spec version: 4.2 - * Contact: yuriyz@gluu.org - * - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen.git - * Do not edit the class manually. - */ - -package io.swagger.client.model; - -import java.util.Objects; -import java.util.Arrays; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import io.swagger.v3.oas.annotations.media.Schema; -import java.io.IOException; -/** - * UmaRpGetClaimsGatheringUrlResponse - */ - - -public class UmaRpGetClaimsGatheringUrlResponse { - @SerializedName("url") - private String url = null; - - @SerializedName("state") - private String state = null; - - public UmaRpGetClaimsGatheringUrlResponse url(String url) { - this.url = url; - return this; - } - - /** - * Get url - * @return url - **/ - @Schema(example = "https:///oxauth/restv1/uma/gather_claims?client_id@!1736.179E.AA60.16B2!0001!8F7C.B9AB!0008!4508.BF20.9B81.E904&ticket=fba00191-59ab-4ed6-ac99-a786a88a9f40&claims_redirect_uri=https://client.example.com/cb&state=d871gpie16np0f5kfv936sc33k", required = true, description = "") - public String getUrl() { - return url; - } - - public void setUrl(String url) { - this.url = url; - } - - public UmaRpGetClaimsGatheringUrlResponse state(String state) { - this.state = state; - return this; - } - - /** - * Get state - * @return state - **/ - @Schema(example = "d871gpie16np0f5kfv936sc33k", required = true, description = "") - public String getState() { - return state; - } - - public void setState(String state) { - this.state = state; - } - - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - UmaRpGetClaimsGatheringUrlResponse umaRpGetClaimsGatheringUrlResponse = (UmaRpGetClaimsGatheringUrlResponse) o; - return Objects.equals(this.url, umaRpGetClaimsGatheringUrlResponse.url) && - Objects.equals(this.state, umaRpGetClaimsGatheringUrlResponse.state); - } - - @Override - public int hashCode() { - return Objects.hash(url, state); - } - - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class UmaRpGetClaimsGatheringUrlResponse {\n"); - - sb.append(" url: ").append(toIndentedString(url)).append("\n"); - sb.append(" state: ").append(toIndentedString(state)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - -} diff --git a/jans-client-api/gen-client/src/main/java/io/swagger/client/model/UmaRpGetRptParams.java b/jans-client-api/gen-client/src/main/java/io/swagger/client/model/UmaRpGetRptParams.java deleted file mode 100644 index 071e64a196a..00000000000 --- a/jans-client-api/gen-client/src/main/java/io/swagger/client/model/UmaRpGetRptParams.java +++ /dev/null @@ -1,295 +0,0 @@ -/* - * jans-api-server - * jans-api-server - * - * OpenAPI spec version: 4.2 - * Contact: yuriyz@gluu.org - * - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen.git - * Do not edit the class manually. - */ - -package io.swagger.client.model; - -import java.util.Objects; -import java.util.Arrays; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import io.swagger.v3.oas.annotations.media.Schema; -import java.io.IOException; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -/** - * UmaRpGetRptParams - */ - - -public class UmaRpGetRptParams { - @SerializedName("rp_id") - private String rpId = null; - - @SerializedName("ticket") - private String ticket = null; - - @SerializedName("claim_token") - private String claimToken = null; - - @SerializedName("claim_token_format") - private String claimTokenFormat = null; - - @SerializedName("pct") - private String pct = null; - - @SerializedName("rpt") - private String rpt = null; - - @SerializedName("scope") - private List scope = null; - - @SerializedName("state") - private String state = null; - - @SerializedName("params") - private Map params = null; - - public UmaRpGetRptParams rpId(String rpId) { - this.rpId = rpId; - return this; - } - - /** - * Get rpId - * @return rpId - **/ - @Schema(example = "bcad760f-91ba-46e1-a020-05e4281d91b6", required = true, description = "") - public String getRpId() { - return rpId; - } - - public void setRpId(String rpId) { - this.rpId = rpId; - } - - public UmaRpGetRptParams ticket(String ticket) { - this.ticket = ticket; - return this; - } - - /** - * Get ticket - * @return ticket - **/ - @Schema(required = true, description = "") - public String getTicket() { - return ticket; - } - - public void setTicket(String ticket) { - this.ticket = ticket; - } - - public UmaRpGetRptParams claimToken(String claimToken) { - this.claimToken = claimToken; - return this; - } - - /** - * Get claimToken - * @return claimToken - **/ - @Schema(description = "") - public String getClaimToken() { - return claimToken; - } - - public void setClaimToken(String claimToken) { - this.claimToken = claimToken; - } - - public UmaRpGetRptParams claimTokenFormat(String claimTokenFormat) { - this.claimTokenFormat = claimTokenFormat; - return this; - } - - /** - * Get claimTokenFormat - * @return claimTokenFormat - **/ - @Schema(description = "") - public String getClaimTokenFormat() { - return claimTokenFormat; - } - - public void setClaimTokenFormat(String claimTokenFormat) { - this.claimTokenFormat = claimTokenFormat; - } - - public UmaRpGetRptParams pct(String pct) { - this.pct = pct; - return this; - } - - /** - * Get pct - * @return pct - **/ - @Schema(description = "") - public String getPct() { - return pct; - } - - public void setPct(String pct) { - this.pct = pct; - } - - public UmaRpGetRptParams rpt(String rpt) { - this.rpt = rpt; - return this; - } - - /** - * Get rpt - * @return rpt - **/ - @Schema(description = "") - public String getRpt() { - return rpt; - } - - public void setRpt(String rpt) { - this.rpt = rpt; - } - - public UmaRpGetRptParams scope(List scope) { - this.scope = scope; - return this; - } - - public UmaRpGetRptParams addScopeItem(String scopeItem) { - if (this.scope == null) { - this.scope = new ArrayList(); - } - this.scope.add(scopeItem); - return this; - } - - /** - * Get scope - * @return scope - **/ - @Schema(example = "[\"openid\"]", description = "") - public List getScope() { - return scope; - } - - public void setScope(List scope) { - this.scope = scope; - } - - public UmaRpGetRptParams state(String state) { - this.state = state; - return this; - } - - /** - * Get state - * @return state - **/ - @Schema(description = "") - public String getState() { - return state; - } - - public void setState(String state) { - this.state = state; - } - - public UmaRpGetRptParams params(Map params) { - this.params = params; - return this; - } - - public UmaRpGetRptParams putParamsItem(String key, String paramsItem) { - if (this.params == null) { - this.params = new HashMap(); - } - this.params.put(key, paramsItem); - return this; - } - - /** - * Get params - * @return params - **/ - @Schema(description = "") - public Map getParams() { - return params; - } - - public void setParams(Map params) { - this.params = params; - } - - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - UmaRpGetRptParams umaRpGetRptParams = (UmaRpGetRptParams) o; - return Objects.equals(this.rpId, umaRpGetRptParams.rpId) && - Objects.equals(this.ticket, umaRpGetRptParams.ticket) && - Objects.equals(this.claimToken, umaRpGetRptParams.claimToken) && - Objects.equals(this.claimTokenFormat, umaRpGetRptParams.claimTokenFormat) && - Objects.equals(this.pct, umaRpGetRptParams.pct) && - Objects.equals(this.rpt, umaRpGetRptParams.rpt) && - Objects.equals(this.scope, umaRpGetRptParams.scope) && - Objects.equals(this.state, umaRpGetRptParams.state) && - Objects.equals(this.params, umaRpGetRptParams.params); - } - - @Override - public int hashCode() { - return Objects.hash(rpId, ticket, claimToken, claimTokenFormat, pct, rpt, scope, state, params); - } - - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class UmaRpGetRptParams {\n"); - - sb.append(" rpId: ").append(toIndentedString(rpId)).append("\n"); - sb.append(" ticket: ").append(toIndentedString(ticket)).append("\n"); - sb.append(" claimToken: ").append(toIndentedString(claimToken)).append("\n"); - sb.append(" claimTokenFormat: ").append(toIndentedString(claimTokenFormat)).append("\n"); - sb.append(" pct: ").append(toIndentedString(pct)).append("\n"); - sb.append(" rpt: ").append(toIndentedString(rpt)).append("\n"); - sb.append(" scope: ").append(toIndentedString(scope)).append("\n"); - sb.append(" state: ").append(toIndentedString(state)).append("\n"); - sb.append(" params: ").append(toIndentedString(params)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - -} diff --git a/jans-client-api/gen-client/src/main/java/io/swagger/client/model/UmaRpGetRptResponse.java b/jans-client-api/gen-client/src/main/java/io/swagger/client/model/UmaRpGetRptResponse.java deleted file mode 100644 index a8250ae2586..00000000000 --- a/jans-client-api/gen-client/src/main/java/io/swagger/client/model/UmaRpGetRptResponse.java +++ /dev/null @@ -1,160 +0,0 @@ -/* - * jans-api-server - * jans-api-server - * - * OpenAPI spec version: 4.2 - * Contact: yuriyz@gluu.org - * - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen.git - * Do not edit the class manually. - */ - -package io.swagger.client.model; - -import java.util.Objects; -import java.util.Arrays; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import io.swagger.v3.oas.annotations.media.Schema; -import java.io.IOException; -/** - * UmaRpGetRptResponse - */ - - -public class UmaRpGetRptResponse { - @SerializedName("pct") - private String pct = null; - - @SerializedName("updated") - private Boolean updated = null; - - @SerializedName("access_token") - private String accessToken = null; - - @SerializedName("token_type") - private String tokenType = null; - - public UmaRpGetRptResponse pct(String pct) { - this.pct = pct; - return this; - } - - /** - * Get pct - * @return pct - **/ - @Schema(required = true, description = "") - public String getPct() { - return pct; - } - - public void setPct(String pct) { - this.pct = pct; - } - - public UmaRpGetRptResponse updated(Boolean updated) { - this.updated = updated; - return this; - } - - /** - * Get updated - * @return updated - **/ - @Schema(required = true, description = "") - public Boolean isUpdated() { - return updated; - } - - public void setUpdated(Boolean updated) { - this.updated = updated; - } - - public UmaRpGetRptResponse accessToken(String accessToken) { - this.accessToken = accessToken; - return this; - } - - /** - * Get accessToken - * @return accessToken - **/ - @Schema(example = "b75434ff-f465-4b70-92e4-b7ba6b6c58f2", required = true, description = "") - public String getAccessToken() { - return accessToken; - } - - public void setAccessToken(String accessToken) { - this.accessToken = accessToken; - } - - public UmaRpGetRptResponse tokenType(String tokenType) { - this.tokenType = tokenType; - return this; - } - - /** - * Get tokenType - * @return tokenType - **/ - @Schema(example = "bearer", required = true, description = "") - public String getTokenType() { - return tokenType; - } - - public void setTokenType(String tokenType) { - this.tokenType = tokenType; - } - - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - UmaRpGetRptResponse umaRpGetRptResponse = (UmaRpGetRptResponse) o; - return Objects.equals(this.pct, umaRpGetRptResponse.pct) && - Objects.equals(this.updated, umaRpGetRptResponse.updated) && - Objects.equals(this.accessToken, umaRpGetRptResponse.accessToken) && - Objects.equals(this.tokenType, umaRpGetRptResponse.tokenType); - } - - @Override - public int hashCode() { - return Objects.hash(pct, updated, accessToken, tokenType); - } - - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class UmaRpGetRptResponse {\n"); - - sb.append(" pct: ").append(toIndentedString(pct)).append("\n"); - sb.append(" updated: ").append(toIndentedString(updated)).append("\n"); - sb.append(" accessToken: ").append(toIndentedString(accessToken)).append("\n"); - sb.append(" tokenType: ").append(toIndentedString(tokenType)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - -} diff --git a/jans-client-api/gen-client/src/main/java/io/swagger/client/model/UmaRsCheckAccessParams.java b/jans-client-api/gen-client/src/main/java/io/swagger/client/model/UmaRsCheckAccessParams.java deleted file mode 100644 index 89c7c1aedab..00000000000 --- a/jans-client-api/gen-client/src/main/java/io/swagger/client/model/UmaRsCheckAccessParams.java +++ /dev/null @@ -1,193 +0,0 @@ -/* - * jans-api-server - * jans-api-server - * - * OpenAPI spec version: 4.2 - * Contact: yuriyz@gluu.org - * - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen.git - * Do not edit the class manually. - */ - -package io.swagger.client.model; - -import java.util.Objects; -import java.util.Arrays; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import io.swagger.v3.oas.annotations.media.Schema; -import java.io.IOException; -import java.util.ArrayList; -import java.util.List; -/** - * UmaRsCheckAccessParams - */ - - -public class UmaRsCheckAccessParams { - @SerializedName("rp_id") - private String rpId = null; - - @SerializedName("rpt") - private String rpt = null; - - @SerializedName("path") - private String path = null; - - @SerializedName("http_method") - private String httpMethod = null; - - @SerializedName("scopes") - private List scopes = null; - - public UmaRsCheckAccessParams rpId(String rpId) { - this.rpId = rpId; - return this; - } - - /** - * Get rpId - * @return rpId - **/ - @Schema(example = "bcad760f-91ba-46e1-a020-05e4281d91b6", required = true, description = "") - public String getRpId() { - return rpId; - } - - public void setRpId(String rpId) { - this.rpId = rpId; - } - - public UmaRsCheckAccessParams rpt(String rpt) { - this.rpt = rpt; - return this; - } - - /** - * Get rpt - * @return rpt - **/ - @Schema(required = true, description = "") - public String getRpt() { - return rpt; - } - - public void setRpt(String rpt) { - this.rpt = rpt; - } - - public UmaRsCheckAccessParams path(String path) { - this.path = path; - return this; - } - - /** - * Get path - * @return path - **/ - @Schema(required = true, description = "") - public String getPath() { - return path; - } - - public void setPath(String path) { - this.path = path; - } - - public UmaRsCheckAccessParams httpMethod(String httpMethod) { - this.httpMethod = httpMethod; - return this; - } - - /** - * Get httpMethod - * @return httpMethod - **/ - @Schema(required = true, description = "") - public String getHttpMethod() { - return httpMethod; - } - - public void setHttpMethod(String httpMethod) { - this.httpMethod = httpMethod; - } - - public UmaRsCheckAccessParams scopes(List scopes) { - this.scopes = scopes; - return this; - } - - public UmaRsCheckAccessParams addScopesItem(String scopesItem) { - if (this.scopes == null) { - this.scopes = new ArrayList(); - } - this.scopes.add(scopesItem); - return this; - } - - /** - * Get scopes - * @return scopes - **/ - @Schema(example = "[\"http://photoz.example.com/dev/actions/all\",\"http://photoz.example.com/dev/actions/add\"]", description = "") - public List getScopes() { - return scopes; - } - - public void setScopes(List scopes) { - this.scopes = scopes; - } - - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - UmaRsCheckAccessParams umaRsCheckAccessParams = (UmaRsCheckAccessParams) o; - return Objects.equals(this.rpId, umaRsCheckAccessParams.rpId) && - Objects.equals(this.rpt, umaRsCheckAccessParams.rpt) && - Objects.equals(this.path, umaRsCheckAccessParams.path) && - Objects.equals(this.httpMethod, umaRsCheckAccessParams.httpMethod) && - Objects.equals(this.scopes, umaRsCheckAccessParams.scopes); - } - - @Override - public int hashCode() { - return Objects.hash(rpId, rpt, path, httpMethod, scopes); - } - - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class UmaRsCheckAccessParams {\n"); - - sb.append(" rpId: ").append(toIndentedString(rpId)).append("\n"); - sb.append(" rpt: ").append(toIndentedString(rpt)).append("\n"); - sb.append(" path: ").append(toIndentedString(path)).append("\n"); - sb.append(" httpMethod: ").append(toIndentedString(httpMethod)).append("\n"); - sb.append(" scopes: ").append(toIndentedString(scopes)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - -} diff --git a/jans-client-api/gen-client/src/main/java/io/swagger/client/model/UmaRsCheckAccessResponse.java b/jans-client-api/gen-client/src/main/java/io/swagger/client/model/UmaRsCheckAccessResponse.java deleted file mode 100644 index 7f41f16afd1..00000000000 --- a/jans-client-api/gen-client/src/main/java/io/swagger/client/model/UmaRsCheckAccessResponse.java +++ /dev/null @@ -1,114 +0,0 @@ -/* - * jans-api-server - * jans-api-server - * - * OpenAPI spec version: 4.2 - * Contact: yuriyz@gluu.org - * - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen.git - * Do not edit the class manually. - */ - -package io.swagger.client.model; - -import java.util.Objects; -import java.util.Arrays; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import io.swagger.v3.oas.annotations.media.Schema; -import java.io.IOException; -/** - * UmaRsCheckAccessResponse - */ - - -public class UmaRsCheckAccessResponse { - @SerializedName("access") - private String access = null; - - @SerializedName("ticket") - private String ticket = null; - - public UmaRsCheckAccessResponse access(String access) { - this.access = access; - return this; - } - - /** - * Possible values are granted, denied - * @return access - **/ - @Schema(example = "granted", required = true, description = "Possible values are granted, denied") - public String getAccess() { - return access; - } - - public void setAccess(String access) { - this.access = access; - } - - public UmaRsCheckAccessResponse ticket(String ticket) { - this.ticket = ticket; - return this; - } - - /** - * Get ticket - * @return ticket - **/ - @Schema(required = true, description = "") - public String getTicket() { - return ticket; - } - - public void setTicket(String ticket) { - this.ticket = ticket; - } - - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - UmaRsCheckAccessResponse umaRsCheckAccessResponse = (UmaRsCheckAccessResponse) o; - return Objects.equals(this.access, umaRsCheckAccessResponse.access) && - Objects.equals(this.ticket, umaRsCheckAccessResponse.ticket); - } - - @Override - public int hashCode() { - return Objects.hash(access, ticket); - } - - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class UmaRsCheckAccessResponse {\n"); - - sb.append(" access: ").append(toIndentedString(access)).append("\n"); - sb.append(" ticket: ").append(toIndentedString(ticket)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - -} diff --git a/jans-client-api/gen-client/src/main/java/io/swagger/client/model/UmaRsModifyParams.java b/jans-client-api/gen-client/src/main/java/io/swagger/client/model/UmaRsModifyParams.java deleted file mode 100644 index edef6f69243..00000000000 --- a/jans-client-api/gen-client/src/main/java/io/swagger/client/model/UmaRsModifyParams.java +++ /dev/null @@ -1,193 +0,0 @@ -/* - * jans-api-server - * jans-api-server - * - * OpenAPI spec version: 4.2 - * Contact: yuriyz@gluu.org - * - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen.git - * Do not edit the class manually. - */ - -package io.swagger.client.model; - -import java.util.Objects; -import java.util.Arrays; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import io.swagger.v3.oas.annotations.media.Schema; -import java.io.IOException; -import java.util.ArrayList; -import java.util.List; -/** - * UmaRsModifyParams - */ - - -public class UmaRsModifyParams { - @SerializedName("rp_id") - private String rpId = null; - - @SerializedName("path") - private String path = null; - - @SerializedName("http_method") - private String httpMethod = null; - - @SerializedName("scopes") - private List scopes = null; - - @SerializedName("scope_expression") - private String scopeExpression = null; - - public UmaRsModifyParams rpId(String rpId) { - this.rpId = rpId; - return this; - } - - /** - * Get rpId - * @return rpId - **/ - @Schema(example = "bcad760f-91ba-46e1-a020-05e4281d91b6", required = true, description = "") - public String getRpId() { - return rpId; - } - - public void setRpId(String rpId) { - this.rpId = rpId; - } - - public UmaRsModifyParams path(String path) { - this.path = path; - return this; - } - - /** - * Get path - * @return path - **/ - @Schema(example = "/ws/document", required = true, description = "") - public String getPath() { - return path; - } - - public void setPath(String path) { - this.path = path; - } - - public UmaRsModifyParams httpMethod(String httpMethod) { - this.httpMethod = httpMethod; - return this; - } - - /** - * Get httpMethod - * @return httpMethod - **/ - @Schema(example = "POST", required = true, description = "") - public String getHttpMethod() { - return httpMethod; - } - - public void setHttpMethod(String httpMethod) { - this.httpMethod = httpMethod; - } - - public UmaRsModifyParams scopes(List scopes) { - this.scopes = scopes; - return this; - } - - public UmaRsModifyParams addScopesItem(String scopesItem) { - if (this.scopes == null) { - this.scopes = new ArrayList(); - } - this.scopes.add(scopesItem); - return this; - } - - /** - * Get scopes - * @return scopes - **/ - @Schema(description = "") - public List getScopes() { - return scopes; - } - - public void setScopes(List scopes) { - this.scopes = scopes; - } - - public UmaRsModifyParams scopeExpression(String scopeExpression) { - this.scopeExpression = scopeExpression; - return this; - } - - /** - * Get scopeExpression - * @return scopeExpression - **/ - @Schema(description = "") - public String getScopeExpression() { - return scopeExpression; - } - - public void setScopeExpression(String scopeExpression) { - this.scopeExpression = scopeExpression; - } - - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - UmaRsModifyParams umaRsModifyParams = (UmaRsModifyParams) o; - return Objects.equals(this.rpId, umaRsModifyParams.rpId) && - Objects.equals(this.path, umaRsModifyParams.path) && - Objects.equals(this.httpMethod, umaRsModifyParams.httpMethod) && - Objects.equals(this.scopes, umaRsModifyParams.scopes) && - Objects.equals(this.scopeExpression, umaRsModifyParams.scopeExpression); - } - - @Override - public int hashCode() { - return Objects.hash(rpId, path, httpMethod, scopes, scopeExpression); - } - - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class UmaRsModifyParams {\n"); - - sb.append(" rpId: ").append(toIndentedString(rpId)).append("\n"); - sb.append(" path: ").append(toIndentedString(path)).append("\n"); - sb.append(" httpMethod: ").append(toIndentedString(httpMethod)).append("\n"); - sb.append(" scopes: ").append(toIndentedString(scopes)).append("\n"); - sb.append(" scopeExpression: ").append(toIndentedString(scopeExpression)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - -} diff --git a/jans-client-api/gen-client/src/main/java/io/swagger/client/model/UmaRsModifyResponse.java b/jans-client-api/gen-client/src/main/java/io/swagger/client/model/UmaRsModifyResponse.java deleted file mode 100644 index c88079fd88a..00000000000 --- a/jans-client-api/gen-client/src/main/java/io/swagger/client/model/UmaRsModifyResponse.java +++ /dev/null @@ -1,91 +0,0 @@ -/* - * jans-api-server - * jans-api-server - * - * OpenAPI spec version: 4.2 - * Contact: yuriyz@gluu.org - * - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen.git - * Do not edit the class manually. - */ - -package io.swagger.client.model; - -import java.util.Objects; -import java.util.Arrays; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import io.swagger.v3.oas.annotations.media.Schema; -import java.io.IOException; -/** - * UmaRsModifyResponse - */ - - -public class UmaRsModifyResponse { - @SerializedName("rp_id") - private String rpId = null; - - public UmaRsModifyResponse rpId(String rpId) { - this.rpId = rpId; - return this; - } - - /** - * Get rpId - * @return rpId - **/ - @Schema(example = "bcad760f-91ba-46e1-a020-05e4281d91b6", required = true, description = "") - public String getRpId() { - return rpId; - } - - public void setRpId(String rpId) { - this.rpId = rpId; - } - - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - UmaRsModifyResponse umaRsModifyResponse = (UmaRsModifyResponse) o; - return Objects.equals(this.rpId, umaRsModifyResponse.rpId); - } - - @Override - public int hashCode() { - return Objects.hash(rpId); - } - - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class UmaRsModifyResponse {\n"); - - sb.append(" rpId: ").append(toIndentedString(rpId)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - -} diff --git a/jans-client-api/gen-client/src/main/java/io/swagger/client/model/UmaRsProtectParams.java b/jans-client-api/gen-client/src/main/java/io/swagger/client/model/UmaRsProtectParams.java deleted file mode 100644 index 661d0cb4844..00000000000 --- a/jans-client-api/gen-client/src/main/java/io/swagger/client/model/UmaRsProtectParams.java +++ /dev/null @@ -1,145 +0,0 @@ -/* - * jans-api-server - * jans-api-server - * - * OpenAPI spec version: 4.2 - * Contact: yuriyz@gluu.org - * - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen.git - * Do not edit the class manually. - */ - -package io.swagger.client.model; - -import java.util.Objects; -import java.util.Arrays; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import io.swagger.client.model.RsResource; -import io.swagger.v3.oas.annotations.media.Schema; -import java.io.IOException; -import java.util.ArrayList; -import java.util.List; -/** - * UmaRsProtectParams - */ - - -public class UmaRsProtectParams { - @SerializedName("rp_id") - private String rpId = null; - - @SerializedName("overwrite") - private Boolean overwrite = null; - - @SerializedName("resources") - private List resources = new ArrayList(); - - public UmaRsProtectParams rpId(String rpId) { - this.rpId = rpId; - return this; - } - - /** - * Get rpId - * @return rpId - **/ - @Schema(example = "bcad760f-91ba-46e1-a020-05e4281d91b6", required = true, description = "") - public String getRpId() { - return rpId; - } - - public void setRpId(String rpId) { - this.rpId = rpId; - } - - public UmaRsProtectParams overwrite(Boolean overwrite) { - this.overwrite = overwrite; - return this; - } - - /** - * Get overwrite - * @return overwrite - **/ - @Schema(required = true, description = "") - public Boolean isOverwrite() { - return overwrite; - } - - public void setOverwrite(Boolean overwrite) { - this.overwrite = overwrite; - } - - public UmaRsProtectParams resources(List resources) { - this.resources = resources; - return this; - } - - public UmaRsProtectParams addResourcesItem(RsResource resourcesItem) { - this.resources.add(resourcesItem); - return this; - } - - /** - * Get resources - * @return resources - **/ - @Schema(required = true, description = "") - public List getResources() { - return resources; - } - - public void setResources(List resources) { - this.resources = resources; - } - - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - UmaRsProtectParams umaRsProtectParams = (UmaRsProtectParams) o; - return Objects.equals(this.rpId, umaRsProtectParams.rpId) && - Objects.equals(this.overwrite, umaRsProtectParams.overwrite) && - Objects.equals(this.resources, umaRsProtectParams.resources); - } - - @Override - public int hashCode() { - return Objects.hash(rpId, overwrite, resources); - } - - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class UmaRsProtectParams {\n"); - - sb.append(" rpId: ").append(toIndentedString(rpId)).append("\n"); - sb.append(" overwrite: ").append(toIndentedString(overwrite)).append("\n"); - sb.append(" resources: ").append(toIndentedString(resources)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - -} diff --git a/jans-client-api/gen-client/src/main/java/io/swagger/client/model/UmaRsProtectResponse.java b/jans-client-api/gen-client/src/main/java/io/swagger/client/model/UmaRsProtectResponse.java deleted file mode 100644 index cffa17c0e42..00000000000 --- a/jans-client-api/gen-client/src/main/java/io/swagger/client/model/UmaRsProtectResponse.java +++ /dev/null @@ -1,91 +0,0 @@ -/* - * jans-api-server - * jans-api-server - * - * OpenAPI spec version: 4.2 - * Contact: yuriyz@gluu.org - * - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen.git - * Do not edit the class manually. - */ - -package io.swagger.client.model; - -import java.util.Objects; -import java.util.Arrays; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import io.swagger.v3.oas.annotations.media.Schema; -import java.io.IOException; -/** - * UmaRsProtectResponse - */ - - -public class UmaRsProtectResponse { - @SerializedName("rp_id") - private String rpId = null; - - public UmaRsProtectResponse rpId(String rpId) { - this.rpId = rpId; - return this; - } - - /** - * Get rpId - * @return rpId - **/ - @Schema(example = "bcad760f-91ba-46e1-a020-05e4281d91b6", required = true, description = "") - public String getRpId() { - return rpId; - } - - public void setRpId(String rpId) { - this.rpId = rpId; - } - - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - UmaRsProtectResponse umaRsProtectResponse = (UmaRsProtectResponse) o; - return Objects.equals(this.rpId, umaRsProtectResponse.rpId); - } - - @Override - public int hashCode() { - return Objects.hash(rpId); - } - - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class UmaRsProtectResponse {\n"); - - sb.append(" rpId: ").append(toIndentedString(rpId)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - -} diff --git a/jans-client-api/gen-client/src/main/java/io/swagger/client/model/UpdateSiteParams.java b/jans-client-api/gen-client/src/main/java/io/swagger/client/model/UpdateSiteParams.java deleted file mode 100644 index 47184f678e0..00000000000 --- a/jans-client-api/gen-client/src/main/java/io/swagger/client/model/UpdateSiteParams.java +++ /dev/null @@ -1,1357 +0,0 @@ -/* - * jans-api-server - * jans-api-server - * - * OpenAPI spec version: 4.2 - * Contact: yuriyz@gluu.org - * - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen.git - * Do not edit the class manually. - */ - -package io.swagger.client.model; - -import java.util.Objects; -import java.util.Arrays; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import io.swagger.v3.oas.annotations.media.Schema; -import java.io.IOException; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -/** - * UpdateSiteParams - */ - - -public class UpdateSiteParams { - @SerializedName("rp_id") - private String rpId = null; - - @SerializedName("redirect_uris") - private List redirectUris = null; - - @SerializedName("post_logout_redirect_uris") - private List postLogoutRedirectUris = null; - - @SerializedName("response_types") - private List responseTypes = null; - - @SerializedName("grant_types") - private List grantTypes = null; - - @SerializedName("scope") - private List scope = null; - - @SerializedName("acr_values") - private List acrValues = null; - - @SerializedName("client_jwks_uri") - private String clientJwksUri = null; - - @SerializedName("client_token_endpoint_auth_method") - private String clientTokenEndpointAuthMethod = null; - - @SerializedName("client_request_uris") - private List clientRequestUris = null; - - @SerializedName("client_sector_identifier_uri") - private String clientSectorIdentifierUri = null; - - @SerializedName("contacts") - private List contacts = null; - - @SerializedName("ui_locales") - private List uiLocales = null; - - @SerializedName("claims_locales") - private List claimsLocales = null; - - @SerializedName("access_token_as_jwt") - private Boolean accessTokenAsJwt = null; - - @SerializedName("access_token_signing_alg") - private String accessTokenSigningAlg = null; - - @SerializedName("rpt_as_jwt") - private Boolean rptAsJwt = null; - - @SerializedName("claims_redirect_uri") - private List claimsRedirectUri = null; - - @SerializedName("client_token_endpoint_auth_signing_alg") - private String clientTokenEndpointAuthSigningAlg = null; - - @SerializedName("client_name") - private String clientName = null; - - @SerializedName("logo_uri") - private String logoUri = null; - - @SerializedName("client_uri") - private String clientUri = null; - - @SerializedName("policy_uri") - private String policyUri = null; - - @SerializedName("front_channel_logout_session_required") - private Boolean frontChannelLogoutSessionRequired = null; - - @SerializedName("tos_uri") - private String tosUri = null; - - @SerializedName("jwks") - private String jwks = null; - - @SerializedName("id_token_binding_cnf") - private String idTokenBindingCnf = null; - - @SerializedName("tls_client_auth_subject_dn") - private String tlsClientAuthSubjectDn = null; - - @SerializedName("run_introspection_script_beforeaccess_token_as_jwt_creation_and_include_claims") - private Boolean runIntrospectionScriptBeforeaccessTokenAsJwtCreationAndIncludeClaims = null; - - @SerializedName("id_token_signed_response_alg") - private String idTokenSignedResponseAlg = null; - - @SerializedName("id_token_encrypted_response_alg") - private String idTokenEncryptedResponseAlg = null; - - @SerializedName("id_token_encrypted_response_enc") - private String idTokenEncryptedResponseEnc = null; - - @SerializedName("user_info_signed_response_alg") - private String userInfoSignedResponseAlg = null; - - @SerializedName("user_info_encrypted_response_alg") - private String userInfoEncryptedResponseAlg = null; - - @SerializedName("user_info_encrypted_response_enc") - private String userInfoEncryptedResponseEnc = null; - - @SerializedName("request_object_signing_alg") - private String requestObjectSigningAlg = null; - - @SerializedName("request_object_encryption_alg") - private String requestObjectEncryptionAlg = null; - - @SerializedName("request_object_encryption_enc") - private String requestObjectEncryptionEnc = null; - - @SerializedName("default_max_age") - private Integer defaultMaxAge = null; - - @SerializedName("require_auth_time") - private Boolean requireAuthTime = null; - - @SerializedName("initiate_login_uri") - private String initiateLoginUri = null; - - @SerializedName("authorized_origins") - private List authorizedOrigins = null; - - @SerializedName("access_token_lifetime") - private Integer accessTokenLifetime = null; - - @SerializedName("software_id") - private String softwareId = null; - - @SerializedName("software_version") - private String softwareVersion = null; - - @SerializedName("software_statement") - private String softwareStatement = null; - - @SerializedName("custom_attributes") - private Map customAttributes = null; - - @SerializedName("sync_client_from_op") - private Boolean syncClientFromOp = null; - - @SerializedName("sync_client_period_in_seconds") - private Integer syncClientPeriodInSeconds = null; - - @SerializedName("allow_spontaneous_scopes") - private Boolean allowSpontaneousScopes = null; - - @SerializedName("spontaneous_scopes") - private List spontaneousScopes = null; - - public UpdateSiteParams rpId(String rpId) { - this.rpId = rpId; - return this; - } - - /** - * Get rpId - * @return rpId - **/ - @Schema(example = "6F9619FF-8B86-D011-B42D-00CF4FC964FF", required = true, description = "") - public String getRpId() { - return rpId; - } - - public void setRpId(String rpId) { - this.rpId = rpId; - } - - public UpdateSiteParams redirectUris(List redirectUris) { - this.redirectUris = redirectUris; - return this; - } - - public UpdateSiteParams addRedirectUrisItem(String redirectUrisItem) { - if (this.redirectUris == null) { - this.redirectUris = new ArrayList(); - } - this.redirectUris.add(redirectUrisItem); - return this; - } - - /** - * Provide the list of redirection URIs. The first URL is where the user will be redirected after successful authorization at the OpenID Connect Provider (OP). - * @return redirectUris - **/ - @Schema(example = "[\"https://client.example.org/cb\"]", description = "Provide the list of redirection URIs. The first URL is where the user will be redirected after successful authorization at the OpenID Connect Provider (OP).") - public List getRedirectUris() { - return redirectUris; - } - - public void setRedirectUris(List redirectUris) { - this.redirectUris = redirectUris; - } - - public UpdateSiteParams postLogoutRedirectUris(List postLogoutRedirectUris) { - this.postLogoutRedirectUris = postLogoutRedirectUris; - return this; - } - - public UpdateSiteParams addPostLogoutRedirectUrisItem(String postLogoutRedirectUrisItem) { - if (this.postLogoutRedirectUris == null) { - this.postLogoutRedirectUris = new ArrayList(); - } - this.postLogoutRedirectUris.add(postLogoutRedirectUrisItem); - return this; - } - - /** - * Get postLogoutRedirectUris - * @return postLogoutRedirectUris - **/ - @Schema(example = "[\"https://client.example.org/logout/page1\",\"https://client.example.org/logout/page2\",\"https://client.example.org/logout/page3\"]", description = "") - public List getPostLogoutRedirectUris() { - return postLogoutRedirectUris; - } - - public void setPostLogoutRedirectUris(List postLogoutRedirectUris) { - this.postLogoutRedirectUris = postLogoutRedirectUris; - } - - public UpdateSiteParams responseTypes(List responseTypes) { - this.responseTypes = responseTypes; - return this; - } - - public UpdateSiteParams addResponseTypesItem(String responseTypesItem) { - if (this.responseTypes == null) { - this.responseTypes = new ArrayList(); - } - this.responseTypes.add(responseTypesItem); - return this; - } - - /** - * Get responseTypes - * @return responseTypes - **/ - @Schema(example = "[\"code\"]", description = "") - public List getResponseTypes() { - return responseTypes; - } - - public void setResponseTypes(List responseTypes) { - this.responseTypes = responseTypes; - } - - public UpdateSiteParams grantTypes(List grantTypes) { - this.grantTypes = grantTypes; - return this; - } - - public UpdateSiteParams addGrantTypesItem(String grantTypesItem) { - if (this.grantTypes == null) { - this.grantTypes = new ArrayList(); - } - this.grantTypes.add(grantTypesItem); - return this; - } - - /** - * Get grantTypes - * @return grantTypes - **/ - @Schema(example = "[\"authorization_code\",\"client_credentials\"]", description = "") - public List getGrantTypes() { - return grantTypes; - } - - public void setGrantTypes(List grantTypes) { - this.grantTypes = grantTypes; - } - - public UpdateSiteParams scope(List scope) { - this.scope = scope; - return this; - } - - public UpdateSiteParams addScopeItem(String scopeItem) { - if (this.scope == null) { - this.scope = new ArrayList(); - } - this.scope.add(scopeItem); - return this; - } - - /** - * Get scope - * @return scope - **/ - @Schema(example = "[\"openid\"]", description = "") - public List getScope() { - return scope; - } - - public void setScope(List scope) { - this.scope = scope; - } - - public UpdateSiteParams acrValues(List acrValues) { - this.acrValues = acrValues; - return this; - } - - public UpdateSiteParams addAcrValuesItem(String acrValuesItem) { - if (this.acrValues == null) { - this.acrValues = new ArrayList(); - } - this.acrValues.add(acrValuesItem); - return this; - } - - /** - * Get acrValues - * @return acrValues - **/ - @Schema(example = "[\"basic\"]", description = "") - public List getAcrValues() { - return acrValues; - } - - public void setAcrValues(List acrValues) { - this.acrValues = acrValues; - } - - public UpdateSiteParams clientJwksUri(String clientJwksUri) { - this.clientJwksUri = clientJwksUri; - return this; - } - - /** - * Get clientJwksUri - * @return clientJwksUri - **/ - @Schema(description = "") - public String getClientJwksUri() { - return clientJwksUri; - } - - public void setClientJwksUri(String clientJwksUri) { - this.clientJwksUri = clientJwksUri; - } - - public UpdateSiteParams clientTokenEndpointAuthMethod(String clientTokenEndpointAuthMethod) { - this.clientTokenEndpointAuthMethod = clientTokenEndpointAuthMethod; - return this; - } - - /** - * Get clientTokenEndpointAuthMethod - * @return clientTokenEndpointAuthMethod - **/ - @Schema(description = "") - public String getClientTokenEndpointAuthMethod() { - return clientTokenEndpointAuthMethod; - } - - public void setClientTokenEndpointAuthMethod(String clientTokenEndpointAuthMethod) { - this.clientTokenEndpointAuthMethod = clientTokenEndpointAuthMethod; - } - - public UpdateSiteParams clientRequestUris(List clientRequestUris) { - this.clientRequestUris = clientRequestUris; - return this; - } - - public UpdateSiteParams addClientRequestUrisItem(String clientRequestUrisItem) { - if (this.clientRequestUris == null) { - this.clientRequestUris = new ArrayList(); - } - this.clientRequestUris.add(clientRequestUrisItem); - return this; - } - - /** - * Get clientRequestUris - * @return clientRequestUris - **/ - @Schema(description = "") - public List getClientRequestUris() { - return clientRequestUris; - } - - public void setClientRequestUris(List clientRequestUris) { - this.clientRequestUris = clientRequestUris; - } - - public UpdateSiteParams clientSectorIdentifierUri(String clientSectorIdentifierUri) { - this.clientSectorIdentifierUri = clientSectorIdentifierUri; - return this; - } - - /** - * Get clientSectorIdentifierUri - * @return clientSectorIdentifierUri - **/ - @Schema(description = "") - public String getClientSectorIdentifierUri() { - return clientSectorIdentifierUri; - } - - public void setClientSectorIdentifierUri(String clientSectorIdentifierUri) { - this.clientSectorIdentifierUri = clientSectorIdentifierUri; - } - - public UpdateSiteParams contacts(List contacts) { - this.contacts = contacts; - return this; - } - - public UpdateSiteParams addContactsItem(String contactsItem) { - if (this.contacts == null) { - this.contacts = new ArrayList(); - } - this.contacts.add(contactsItem); - return this; - } - - /** - * Get contacts - * @return contacts - **/ - @Schema(example = "[\"foo_bar@spam.org\"]", description = "") - public List getContacts() { - return contacts; - } - - public void setContacts(List contacts) { - this.contacts = contacts; - } - - public UpdateSiteParams uiLocales(List uiLocales) { - this.uiLocales = uiLocales; - return this; - } - - public UpdateSiteParams addUiLocalesItem(String uiLocalesItem) { - if (this.uiLocales == null) { - this.uiLocales = new ArrayList(); - } - this.uiLocales.add(uiLocalesItem); - return this; - } - - /** - * Get uiLocales - * @return uiLocales - **/ - @Schema(description = "") - public List getUiLocales() { - return uiLocales; - } - - public void setUiLocales(List uiLocales) { - this.uiLocales = uiLocales; - } - - public UpdateSiteParams claimsLocales(List claimsLocales) { - this.claimsLocales = claimsLocales; - return this; - } - - public UpdateSiteParams addClaimsLocalesItem(String claimsLocalesItem) { - if (this.claimsLocales == null) { - this.claimsLocales = new ArrayList(); - } - this.claimsLocales.add(claimsLocalesItem); - return this; - } - - /** - * Get claimsLocales - * @return claimsLocales - **/ - @Schema(description = "") - public List getClaimsLocales() { - return claimsLocales; - } - - public void setClaimsLocales(List claimsLocales) { - this.claimsLocales = claimsLocales; - } - - public UpdateSiteParams accessTokenAsJwt(Boolean accessTokenAsJwt) { - this.accessTokenAsJwt = accessTokenAsJwt; - return this; - } - - /** - * specifies whether access_token should be return as JWT or not. Default value is false. - * @return accessTokenAsJwt - **/ - @Schema(description = "specifies whether access_token should be return as JWT or not. Default value is false.") - public Boolean isAccessTokenAsJwt() { - return accessTokenAsJwt; - } - - public void setAccessTokenAsJwt(Boolean accessTokenAsJwt) { - this.accessTokenAsJwt = accessTokenAsJwt; - } - - public UpdateSiteParams accessTokenSigningAlg(String accessTokenSigningAlg) { - this.accessTokenSigningAlg = accessTokenSigningAlg; - return this; - } - - /** - * sets signing algorithm used for JWT signing. Valid values are none, HS256, HS384, HS512, RS256, RS384, RS512, ES256, ES384, ES512 - * @return accessTokenSigningAlg - **/ - @Schema(description = "sets signing algorithm used for JWT signing. Valid values are none, HS256, HS384, HS512, RS256, RS384, RS512, ES256, ES384, ES512") - public String getAccessTokenSigningAlg() { - return accessTokenSigningAlg; - } - - public void setAccessTokenSigningAlg(String accessTokenSigningAlg) { - this.accessTokenSigningAlg = accessTokenSigningAlg; - } - - public UpdateSiteParams rptAsJwt(Boolean rptAsJwt) { - this.rptAsJwt = rptAsJwt; - return this; - } - - /** - * specifies whether RPT should be return as JWT or not. Default value is false. - * @return rptAsJwt - **/ - @Schema(description = "specifies whether RPT should be return as JWT or not. Default value is false.") - public Boolean isRptAsJwt() { - return rptAsJwt; - } - - public void setRptAsJwt(Boolean rptAsJwt) { - this.rptAsJwt = rptAsJwt; - } - - public UpdateSiteParams claimsRedirectUri(List claimsRedirectUri) { - this.claimsRedirectUri = claimsRedirectUri; - return this; - } - - public UpdateSiteParams addClaimsRedirectUriItem(String claimsRedirectUriItem) { - if (this.claimsRedirectUri == null) { - this.claimsRedirectUri = new ArrayList(); - } - this.claimsRedirectUri.add(claimsRedirectUriItem); - return this; - } - - /** - * Get claimsRedirectUri - * @return claimsRedirectUri - **/ - @Schema(description = "") - public List getClaimsRedirectUri() { - return claimsRedirectUri; - } - - public void setClaimsRedirectUri(List claimsRedirectUri) { - this.claimsRedirectUri = claimsRedirectUri; - } - - public UpdateSiteParams clientTokenEndpointAuthSigningAlg(String clientTokenEndpointAuthSigningAlg) { - this.clientTokenEndpointAuthSigningAlg = clientTokenEndpointAuthSigningAlg; - return this; - } - - /** - * Provide the Requested Client Authentication method for the Token Endpoint. Valid values are none, HS256, HS384, HS512, RS256, RS384, RS512, ES256, ES384, ES512, PS256, PS384, PS512. - * @return clientTokenEndpointAuthSigningAlg - **/ - @Schema(description = "Provide the Requested Client Authentication method for the Token Endpoint. Valid values are none, HS256, HS384, HS512, RS256, RS384, RS512, ES256, ES384, ES512, PS256, PS384, PS512.") - public String getClientTokenEndpointAuthSigningAlg() { - return clientTokenEndpointAuthSigningAlg; - } - - public void setClientTokenEndpointAuthSigningAlg(String clientTokenEndpointAuthSigningAlg) { - this.clientTokenEndpointAuthSigningAlg = clientTokenEndpointAuthSigningAlg; - } - - public UpdateSiteParams clientName(String clientName) { - this.clientName = clientName; - return this; - } - - /** - * rp will generate its own non-human readable name by default if client_name is not specified - * @return clientName - **/ - @Schema(description = "rp will generate its own non-human readable name by default if client_name is not specified") - public String getClientName() { - return clientName; - } - - public void setClientName(String clientName) { - this.clientName = clientName; - } - - public UpdateSiteParams logoUri(String logoUri) { - this.logoUri = logoUri; - return this; - } - - /** - * specifies an URL that references a logo for the Client application. - * @return logoUri - **/ - @Schema(example = "https://client.example.org/logo.png", description = "specifies an URL that references a logo for the Client application.") - public String getLogoUri() { - return logoUri; - } - - public void setLogoUri(String logoUri) { - this.logoUri = logoUri; - } - - public UpdateSiteParams clientUri(String clientUri) { - this.clientUri = clientUri; - return this; - } - - /** - * specifies an URL of the home page of the Client. - * @return clientUri - **/ - @Schema(example = "https://client.example.org/page", description = "specifies an URL of the home page of the Client.") - public String getClientUri() { - return clientUri; - } - - public void setClientUri(String clientUri) { - this.clientUri = clientUri; - } - - public UpdateSiteParams policyUri(String policyUri) { - this.policyUri = policyUri; - return this; - } - - /** - * specifies an URL that the Relying Party Client provides to the End-User to read about the how the profile data will be used. - * @return policyUri - **/ - @Schema(example = "https://client.example.org/page", description = "specifies an URL that the Relying Party Client provides to the End-User to read about the how the profile data will be used.") - public String getPolicyUri() { - return policyUri; - } - - public void setPolicyUri(String policyUri) { - this.policyUri = policyUri; - } - - public UpdateSiteParams frontChannelLogoutSessionRequired(Boolean frontChannelLogoutSessionRequired) { - this.frontChannelLogoutSessionRequired = frontChannelLogoutSessionRequired; - return this; - } - - /** - * specifies if front channel logout session required. - * @return frontChannelLogoutSessionRequired - **/ - @Schema(example = "true", description = "specifies if front channel logout session required.") - public Boolean isFrontChannelLogoutSessionRequired() { - return frontChannelLogoutSessionRequired; - } - - public void setFrontChannelLogoutSessionRequired(Boolean frontChannelLogoutSessionRequired) { - this.frontChannelLogoutSessionRequired = frontChannelLogoutSessionRequired; - } - - public UpdateSiteParams tosUri(String tosUri) { - this.tosUri = tosUri; - return this; - } - - /** - * specifies an URL that the Relying Party Client provides to the End-User to read about the Relying Party's terms. - * @return tosUri - **/ - @Schema(example = "https://client.example.org/page", description = "specifies an URL that the Relying Party Client provides to the End-User to read about the Relying Party's terms.") - public String getTosUri() { - return tosUri; - } - - public void setTosUri(String tosUri) { - this.tosUri = tosUri; - } - - public UpdateSiteParams jwks(String jwks) { - this.jwks = jwks; - return this; - } - - /** - * Client's JSON Web Key Set (JWK) document, passed by value. The semantics of the jwks parameter are the same as the jwks_uri parameter, other than that the JWK Set is passed by value, rather than by reference. This parameter is intended only to be used by Clients that, for some reason, are unable to use the jwks_uri parameter, for instance, by native applications that might not have a location to host the contents of the JWK Set. If a Client can use jwks_uri, it must not use jwks. One significant downside of jwks is that it does not enable key rotation. The jwks_uri and jwks parameters must not be used together. - * @return jwks - **/ - @Schema(example = "{\"key1\": \"value1\", \"key2\": \"value2\"}", description = "Client's JSON Web Key Set (JWK) document, passed by value. The semantics of the jwks parameter are the same as the jwks_uri parameter, other than that the JWK Set is passed by value, rather than by reference. This parameter is intended only to be used by Clients that, for some reason, are unable to use the jwks_uri parameter, for instance, by native applications that might not have a location to host the contents of the JWK Set. If a Client can use jwks_uri, it must not use jwks. One significant downside of jwks is that it does not enable key rotation. The jwks_uri and jwks parameters must not be used together.") - public String getJwks() { - return jwks; - } - - public void setJwks(String jwks) { - this.jwks = jwks; - } - - public UpdateSiteParams idTokenBindingCnf(String idTokenBindingCnf) { - this.idTokenBindingCnf = idTokenBindingCnf; - return this; - } - - /** - * Get idTokenBindingCnf - * @return idTokenBindingCnf - **/ - @Schema(example = "4NRB1-0XZABZI9E6-5SM3R", description = "") - public String getIdTokenBindingCnf() { - return idTokenBindingCnf; - } - - public void setIdTokenBindingCnf(String idTokenBindingCnf) { - this.idTokenBindingCnf = idTokenBindingCnf; - } - - public UpdateSiteParams tlsClientAuthSubjectDn(String tlsClientAuthSubjectDn) { - this.tlsClientAuthSubjectDn = tlsClientAuthSubjectDn; - return this; - } - - /** - * Get tlsClientAuthSubjectDn - * @return tlsClientAuthSubjectDn - **/ - @Schema(example = "www.test.com", description = "") - public String getTlsClientAuthSubjectDn() { - return tlsClientAuthSubjectDn; - } - - public void setTlsClientAuthSubjectDn(String tlsClientAuthSubjectDn) { - this.tlsClientAuthSubjectDn = tlsClientAuthSubjectDn; - } - - public UpdateSiteParams runIntrospectionScriptBeforeaccessTokenAsJwtCreationAndIncludeClaims(Boolean runIntrospectionScriptBeforeaccessTokenAsJwtCreationAndIncludeClaims) { - this.runIntrospectionScriptBeforeaccessTokenAsJwtCreationAndIncludeClaims = runIntrospectionScriptBeforeaccessTokenAsJwtCreationAndIncludeClaims; - return this; - } - - /** - * choose to run introspection script before access_token_as_jwt creation and include claims. - * @return runIntrospectionScriptBeforeaccessTokenAsJwtCreationAndIncludeClaims - **/ - @Schema(example = "true", description = "choose to run introspection script before access_token_as_jwt creation and include claims.") - public Boolean isRunIntrospectionScriptBeforeaccessTokenAsJwtCreationAndIncludeClaims() { - return runIntrospectionScriptBeforeaccessTokenAsJwtCreationAndIncludeClaims; - } - - public void setRunIntrospectionScriptBeforeaccessTokenAsJwtCreationAndIncludeClaims(Boolean runIntrospectionScriptBeforeaccessTokenAsJwtCreationAndIncludeClaims) { - this.runIntrospectionScriptBeforeaccessTokenAsJwtCreationAndIncludeClaims = runIntrospectionScriptBeforeaccessTokenAsJwtCreationAndIncludeClaims; - } - - public UpdateSiteParams idTokenSignedResponseAlg(String idTokenSignedResponseAlg) { - this.idTokenSignedResponseAlg = idTokenSignedResponseAlg; - return this; - } - - /** - * choose the JWS alg algorithm (JWA) required for the ID Token issued to this client_id. Valid values are none, HS256, HS384, HS512, RS256, RS384, RS512, ES256, ES384, ES512, PS256, PS384, PS512 - * @return idTokenSignedResponseAlg - **/ - @Schema(description = "choose the JWS alg algorithm (JWA) required for the ID Token issued to this client_id. Valid values are none, HS256, HS384, HS512, RS256, RS384, RS512, ES256, ES384, ES512, PS256, PS384, PS512") - public String getIdTokenSignedResponseAlg() { - return idTokenSignedResponseAlg; - } - - public void setIdTokenSignedResponseAlg(String idTokenSignedResponseAlg) { - this.idTokenSignedResponseAlg = idTokenSignedResponseAlg; - } - - public UpdateSiteParams idTokenEncryptedResponseAlg(String idTokenEncryptedResponseAlg) { - this.idTokenEncryptedResponseAlg = idTokenEncryptedResponseAlg; - return this; - } - - /** - * choose the JWE alg algorithm (JWA) required for encrypting the ID Token issued to this client_id. Valid values are RSA1_5, RSA-OAEP, A128KW, A256KW - * @return idTokenEncryptedResponseAlg - **/ - @Schema(description = "choose the JWE alg algorithm (JWA) required for encrypting the ID Token issued to this client_id. Valid values are RSA1_5, RSA-OAEP, A128KW, A256KW") - public String getIdTokenEncryptedResponseAlg() { - return idTokenEncryptedResponseAlg; - } - - public void setIdTokenEncryptedResponseAlg(String idTokenEncryptedResponseAlg) { - this.idTokenEncryptedResponseAlg = idTokenEncryptedResponseAlg; - } - - public UpdateSiteParams idTokenEncryptedResponseEnc(String idTokenEncryptedResponseEnc) { - this.idTokenEncryptedResponseEnc = idTokenEncryptedResponseEnc; - return this; - } - - /** - * choose the JWE enc algorithm (JWA) required for symmetric encryption of the ID Token issued to this client_id. Valid values are A128CBC+HS256, A256CBC+HS512, A128GCM, A256GCM - * @return idTokenEncryptedResponseEnc - **/ - @Schema(description = "choose the JWE enc algorithm (JWA) required for symmetric encryption of the ID Token issued to this client_id. Valid values are A128CBC+HS256, A256CBC+HS512, A128GCM, A256GCM") - public String getIdTokenEncryptedResponseEnc() { - return idTokenEncryptedResponseEnc; - } - - public void setIdTokenEncryptedResponseEnc(String idTokenEncryptedResponseEnc) { - this.idTokenEncryptedResponseEnc = idTokenEncryptedResponseEnc; - } - - public UpdateSiteParams userInfoSignedResponseAlg(String userInfoSignedResponseAlg) { - this.userInfoSignedResponseAlg = userInfoSignedResponseAlg; - return this; - } - - /** - * choose the JWS alg algorithm (JWA) required for UserInfo responses. Valid values are none, HS256, HS384, HS512, RS256, RS384, RS512, ES256, ES384, ES512, PS256, PS384, PS512 - * @return userInfoSignedResponseAlg - **/ - @Schema(description = "choose the JWS alg algorithm (JWA) required for UserInfo responses. Valid values are none, HS256, HS384, HS512, RS256, RS384, RS512, ES256, ES384, ES512, PS256, PS384, PS512") - public String getUserInfoSignedResponseAlg() { - return userInfoSignedResponseAlg; - } - - public void setUserInfoSignedResponseAlg(String userInfoSignedResponseAlg) { - this.userInfoSignedResponseAlg = userInfoSignedResponseAlg; - } - - public UpdateSiteParams userInfoEncryptedResponseAlg(String userInfoEncryptedResponseAlg) { - this.userInfoEncryptedResponseAlg = userInfoEncryptedResponseAlg; - return this; - } - - /** - * choose the JWE alg algorithm (JWA) required for encrypting UserInfo responses. Valid values are RSA1_5, RSA_OAEP, A128KW, A256KW - * @return userInfoEncryptedResponseAlg - **/ - @Schema(description = "choose the JWE alg algorithm (JWA) required for encrypting UserInfo responses. Valid values are RSA1_5, RSA_OAEP, A128KW, A256KW") - public String getUserInfoEncryptedResponseAlg() { - return userInfoEncryptedResponseAlg; - } - - public void setUserInfoEncryptedResponseAlg(String userInfoEncryptedResponseAlg) { - this.userInfoEncryptedResponseAlg = userInfoEncryptedResponseAlg; - } - - public UpdateSiteParams userInfoEncryptedResponseEnc(String userInfoEncryptedResponseEnc) { - this.userInfoEncryptedResponseEnc = userInfoEncryptedResponseEnc; - return this; - } - - /** - * choose the JWE enc algorithm (JWA) required for symmetric encryption of UserInfo responses. Valid values are A128CBC+HS256, A256CBC+HS512, A128GCM, A256GCM - * @return userInfoEncryptedResponseEnc - **/ - @Schema(description = "choose the JWE enc algorithm (JWA) required for symmetric encryption of UserInfo responses. Valid values are A128CBC+HS256, A256CBC+HS512, A128GCM, A256GCM") - public String getUserInfoEncryptedResponseEnc() { - return userInfoEncryptedResponseEnc; - } - - public void setUserInfoEncryptedResponseEnc(String userInfoEncryptedResponseEnc) { - this.userInfoEncryptedResponseEnc = userInfoEncryptedResponseEnc; - } - - public UpdateSiteParams requestObjectSigningAlg(String requestObjectSigningAlg) { - this.requestObjectSigningAlg = requestObjectSigningAlg; - return this; - } - - /** - * choose the JWS alg algorithm (JWA) that must be required by the Authorization Server. Valid values are none, HS256, HS384, HS512, RS256, RS384, RS512, ES256, ES384, ES512, PS256, PS384, PS512 - * @return requestObjectSigningAlg - **/ - @Schema(description = "choose the JWS alg algorithm (JWA) that must be required by the Authorization Server. Valid values are none, HS256, HS384, HS512, RS256, RS384, RS512, ES256, ES384, ES512, PS256, PS384, PS512") - public String getRequestObjectSigningAlg() { - return requestObjectSigningAlg; - } - - public void setRequestObjectSigningAlg(String requestObjectSigningAlg) { - this.requestObjectSigningAlg = requestObjectSigningAlg; - } - - public UpdateSiteParams requestObjectEncryptionAlg(String requestObjectEncryptionAlg) { - this.requestObjectEncryptionAlg = requestObjectEncryptionAlg; - return this; - } - - /** - * choose the JWE alg algorithm (JWA) the RP is declaring that it may use for encrypting Request Objects sent to the OP. Valid values are RSA1_5, RSA_OAEP, A128KW, A256KW - * @return requestObjectEncryptionAlg - **/ - @Schema(description = "choose the JWE alg algorithm (JWA) the RP is declaring that it may use for encrypting Request Objects sent to the OP. Valid values are RSA1_5, RSA_OAEP, A128KW, A256KW") - public String getRequestObjectEncryptionAlg() { - return requestObjectEncryptionAlg; - } - - public void setRequestObjectEncryptionAlg(String requestObjectEncryptionAlg) { - this.requestObjectEncryptionAlg = requestObjectEncryptionAlg; - } - - public UpdateSiteParams requestObjectEncryptionEnc(String requestObjectEncryptionEnc) { - this.requestObjectEncryptionEnc = requestObjectEncryptionEnc; - return this; - } - - /** - * choose the JWE enc algorithm (JWA) the RP is declaring that it may use for encrypting Request Objects sent to the OP. Valid values are A128CBC+HS256, A256CBC+HS512, A128GCM, A256GCM - * @return requestObjectEncryptionEnc - **/ - @Schema(description = "choose the JWE enc algorithm (JWA) the RP is declaring that it may use for encrypting Request Objects sent to the OP. Valid values are A128CBC+HS256, A256CBC+HS512, A128GCM, A256GCM") - public String getRequestObjectEncryptionEnc() { - return requestObjectEncryptionEnc; - } - - public void setRequestObjectEncryptionEnc(String requestObjectEncryptionEnc) { - this.requestObjectEncryptionEnc = requestObjectEncryptionEnc; - } - - public UpdateSiteParams defaultMaxAge(Integer defaultMaxAge) { - this.defaultMaxAge = defaultMaxAge; - return this; - } - - /** - * specifies the Default Maximum Authentication Age. - * @return defaultMaxAge - **/ - @Schema(example = "1000000", description = "specifies the Default Maximum Authentication Age.") - public Integer getDefaultMaxAge() { - return defaultMaxAge; - } - - public void setDefaultMaxAge(Integer defaultMaxAge) { - this.defaultMaxAge = defaultMaxAge; - } - - public UpdateSiteParams requireAuthTime(Boolean requireAuthTime) { - this.requireAuthTime = requireAuthTime; - return this; - } - - /** - * specifies the Boolean value specifying whether the auth_time claim in the id_token is required. It is required when the value is true. The auth_time claim request in the request object overrides this setting. - * @return requireAuthTime - **/ - @Schema(example = "true", description = "specifies the Boolean value specifying whether the auth_time claim in the id_token is required. It is required when the value is true. The auth_time claim request in the request object overrides this setting.") - public Boolean isRequireAuthTime() { - return requireAuthTime; - } - - public void setRequireAuthTime(Boolean requireAuthTime) { - this.requireAuthTime = requireAuthTime; - } - - public UpdateSiteParams initiateLoginUri(String initiateLoginUri) { - this.initiateLoginUri = initiateLoginUri; - return this; - } - - /** - * specifies the URI using the https scheme that the authorization server can call to initiate a login at the client. - * @return initiateLoginUri - **/ - @Schema(example = "https://client.example.org/authorization/page", description = "specifies the URI using the https scheme that the authorization server can call to initiate a login at the client.") - public String getInitiateLoginUri() { - return initiateLoginUri; - } - - public void setInitiateLoginUri(String initiateLoginUri) { - this.initiateLoginUri = initiateLoginUri; - } - - public UpdateSiteParams authorizedOrigins(List authorizedOrigins) { - this.authorizedOrigins = authorizedOrigins; - return this; - } - - public UpdateSiteParams addAuthorizedOriginsItem(String authorizedOriginsItem) { - if (this.authorizedOrigins == null) { - this.authorizedOrigins = new ArrayList(); - } - this.authorizedOrigins.add(authorizedOriginsItem); - return this; - } - - /** - * specifies authorized JavaScript origins. - * @return authorizedOrigins - **/ - @Schema(description = "specifies authorized JavaScript origins.") - public List getAuthorizedOrigins() { - return authorizedOrigins; - } - - public void setAuthorizedOrigins(List authorizedOrigins) { - this.authorizedOrigins = authorizedOrigins; - } - - public UpdateSiteParams accessTokenLifetime(Integer accessTokenLifetime) { - this.accessTokenLifetime = accessTokenLifetime; - return this; - } - - /** - * specifies the Client-specific access token expiration. - * @return accessTokenLifetime - **/ - @Schema(example = "100000000", description = "specifies the Client-specific access token expiration.") - public Integer getAccessTokenLifetime() { - return accessTokenLifetime; - } - - public void setAccessTokenLifetime(Integer accessTokenLifetime) { - this.accessTokenLifetime = accessTokenLifetime; - } - - public UpdateSiteParams softwareId(String softwareId) { - this.softwareId = softwareId; - return this; - } - - /** - * specifies a unique identifier string (UUID) assigned by the client developer or software publisher used by registration endpoints to identify the client software to be dynamically registered. - * @return softwareId - **/ - @Schema(example = "4NRB1-0XZABZI9E6-5SM3R", description = "specifies a unique identifier string (UUID) assigned by the client developer or software publisher used by registration endpoints to identify the client software to be dynamically registered.") - public String getSoftwareId() { - return softwareId; - } - - public void setSoftwareId(String softwareId) { - this.softwareId = softwareId; - } - - public UpdateSiteParams softwareVersion(String softwareVersion) { - this.softwareVersion = softwareVersion; - return this; - } - - /** - * specifies a version identifier string for the client software identified by 'software_id'. The value of the 'software_version' should change on any update to the client software identified by the same 'software_id'. - * @return softwareVersion - **/ - @Schema(example = "2.1", description = "specifies a version identifier string for the client software identified by 'software_id'. The value of the 'software_version' should change on any update to the client software identified by the same 'software_id'.") - public String getSoftwareVersion() { - return softwareVersion; - } - - public void setSoftwareVersion(String softwareVersion) { - this.softwareVersion = softwareVersion; - } - - public UpdateSiteParams softwareStatement(String softwareStatement) { - this.softwareStatement = softwareStatement; - return this; - } - - /** - * specifies a software statement containing client metadata values about the client software as claims. This is a string value containing the entire signed JWT. - * @return softwareStatement - **/ - @Schema(description = "specifies a software statement containing client metadata values about the client software as claims. This is a string value containing the entire signed JWT.") - public String getSoftwareStatement() { - return softwareStatement; - } - - public void setSoftwareStatement(String softwareStatement) { - this.softwareStatement = softwareStatement; - } - - public UpdateSiteParams customAttributes(Map customAttributes) { - this.customAttributes = customAttributes; - return this; - } - - public UpdateSiteParams putCustomAttributesItem(String key, String customAttributesItem) { - if (this.customAttributes == null) { - this.customAttributes = new HashMap(); - } - this.customAttributes.put(key, customAttributesItem); - return this; - } - - /** - * specifies custom attribute map copy. - * @return customAttributes - **/ - @Schema(description = "specifies custom attribute map copy.") - public Map getCustomAttributes() { - return customAttributes; - } - - public void setCustomAttributes(Map customAttributes) { - this.customAttributes = customAttributes; - } - - public UpdateSiteParams syncClientFromOp(Boolean syncClientFromOp) { - this.syncClientFromOp = syncClientFromOp; - return this; - } - - /** - * specifies whether to sync client from OP. Default value is false. - * @return syncClientFromOp - **/ - @Schema(example = "false", description = "specifies whether to sync client from OP. Default value is false.") - public Boolean isSyncClientFromOp() { - return syncClientFromOp; - } - - public void setSyncClientFromOp(Boolean syncClientFromOp) { - this.syncClientFromOp = syncClientFromOp; - } - - public UpdateSiteParams syncClientPeriodInSeconds(Integer syncClientPeriodInSeconds) { - this.syncClientPeriodInSeconds = syncClientPeriodInSeconds; - return this; - } - - /** - * specifies period after which client can sync again with OP. Default value is 86400 (in seconds). - * @return syncClientPeriodInSeconds - **/ - @Schema(example = "86400", description = "specifies period after which client can sync again with OP. Default value is 86400 (in seconds).") - public Integer getSyncClientPeriodInSeconds() { - return syncClientPeriodInSeconds; - } - - public void setSyncClientPeriodInSeconds(Integer syncClientPeriodInSeconds) { - this.syncClientPeriodInSeconds = syncClientPeriodInSeconds; - } - - public UpdateSiteParams allowSpontaneousScopes(Boolean allowSpontaneousScopes) { - this.allowSpontaneousScopes = allowSpontaneousScopes; - return this; - } - - /** - * specifies whether to allow spontaneous scopes for client. The default value is false - * @return allowSpontaneousScopes - **/ - @Schema(example = "false", description = "specifies whether to allow spontaneous scopes for client. The default value is false") - public Boolean isAllowSpontaneousScopes() { - return allowSpontaneousScopes; - } - - public void setAllowSpontaneousScopes(Boolean allowSpontaneousScopes) { - this.allowSpontaneousScopes = allowSpontaneousScopes; - } - - public UpdateSiteParams spontaneousScopes(List spontaneousScopes) { - this.spontaneousScopes = spontaneousScopes; - return this; - } - - public UpdateSiteParams addSpontaneousScopesItem(String spontaneousScopesItem) { - if (this.spontaneousScopes == null) { - this.spontaneousScopes = new ArrayList(); - } - this.spontaneousScopes.add(spontaneousScopesItem); - return this; - } - - /** - * list of spontaneous scopes (regexp against which validation is performed). - * @return spontaneousScopes - **/ - @Schema(description = "list of spontaneous scopes (regexp against which validation is performed).") - public List getSpontaneousScopes() { - return spontaneousScopes; - } - - public void setSpontaneousScopes(List spontaneousScopes) { - this.spontaneousScopes = spontaneousScopes; - } - - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - UpdateSiteParams updateSiteParams = (UpdateSiteParams) o; - return Objects.equals(this.rpId, updateSiteParams.rpId) && - Objects.equals(this.redirectUris, updateSiteParams.redirectUris) && - Objects.equals(this.postLogoutRedirectUris, updateSiteParams.postLogoutRedirectUris) && - Objects.equals(this.responseTypes, updateSiteParams.responseTypes) && - Objects.equals(this.grantTypes, updateSiteParams.grantTypes) && - Objects.equals(this.scope, updateSiteParams.scope) && - Objects.equals(this.acrValues, updateSiteParams.acrValues) && - Objects.equals(this.clientJwksUri, updateSiteParams.clientJwksUri) && - Objects.equals(this.clientTokenEndpointAuthMethod, updateSiteParams.clientTokenEndpointAuthMethod) && - Objects.equals(this.clientRequestUris, updateSiteParams.clientRequestUris) && - Objects.equals(this.clientSectorIdentifierUri, updateSiteParams.clientSectorIdentifierUri) && - Objects.equals(this.contacts, updateSiteParams.contacts) && - Objects.equals(this.uiLocales, updateSiteParams.uiLocales) && - Objects.equals(this.claimsLocales, updateSiteParams.claimsLocales) && - Objects.equals(this.accessTokenAsJwt, updateSiteParams.accessTokenAsJwt) && - Objects.equals(this.accessTokenSigningAlg, updateSiteParams.accessTokenSigningAlg) && - Objects.equals(this.rptAsJwt, updateSiteParams.rptAsJwt) && - Objects.equals(this.claimsRedirectUri, updateSiteParams.claimsRedirectUri) && - Objects.equals(this.clientTokenEndpointAuthSigningAlg, updateSiteParams.clientTokenEndpointAuthSigningAlg) && - Objects.equals(this.clientName, updateSiteParams.clientName) && - Objects.equals(this.logoUri, updateSiteParams.logoUri) && - Objects.equals(this.clientUri, updateSiteParams.clientUri) && - Objects.equals(this.policyUri, updateSiteParams.policyUri) && - Objects.equals(this.frontChannelLogoutSessionRequired, updateSiteParams.frontChannelLogoutSessionRequired) && - Objects.equals(this.tosUri, updateSiteParams.tosUri) && - Objects.equals(this.jwks, updateSiteParams.jwks) && - Objects.equals(this.idTokenBindingCnf, updateSiteParams.idTokenBindingCnf) && - Objects.equals(this.tlsClientAuthSubjectDn, updateSiteParams.tlsClientAuthSubjectDn) && - Objects.equals(this.runIntrospectionScriptBeforeaccessTokenAsJwtCreationAndIncludeClaims, updateSiteParams.runIntrospectionScriptBeforeaccessTokenAsJwtCreationAndIncludeClaims) && - Objects.equals(this.idTokenSignedResponseAlg, updateSiteParams.idTokenSignedResponseAlg) && - Objects.equals(this.idTokenEncryptedResponseAlg, updateSiteParams.idTokenEncryptedResponseAlg) && - Objects.equals(this.idTokenEncryptedResponseEnc, updateSiteParams.idTokenEncryptedResponseEnc) && - Objects.equals(this.userInfoSignedResponseAlg, updateSiteParams.userInfoSignedResponseAlg) && - Objects.equals(this.userInfoEncryptedResponseAlg, updateSiteParams.userInfoEncryptedResponseAlg) && - Objects.equals(this.userInfoEncryptedResponseEnc, updateSiteParams.userInfoEncryptedResponseEnc) && - Objects.equals(this.requestObjectSigningAlg, updateSiteParams.requestObjectSigningAlg) && - Objects.equals(this.requestObjectEncryptionAlg, updateSiteParams.requestObjectEncryptionAlg) && - Objects.equals(this.requestObjectEncryptionEnc, updateSiteParams.requestObjectEncryptionEnc) && - Objects.equals(this.defaultMaxAge, updateSiteParams.defaultMaxAge) && - Objects.equals(this.requireAuthTime, updateSiteParams.requireAuthTime) && - Objects.equals(this.initiateLoginUri, updateSiteParams.initiateLoginUri) && - Objects.equals(this.authorizedOrigins, updateSiteParams.authorizedOrigins) && - Objects.equals(this.accessTokenLifetime, updateSiteParams.accessTokenLifetime) && - Objects.equals(this.softwareId, updateSiteParams.softwareId) && - Objects.equals(this.softwareVersion, updateSiteParams.softwareVersion) && - Objects.equals(this.softwareStatement, updateSiteParams.softwareStatement) && - Objects.equals(this.customAttributes, updateSiteParams.customAttributes) && - Objects.equals(this.syncClientFromOp, updateSiteParams.syncClientFromOp) && - Objects.equals(this.syncClientPeriodInSeconds, updateSiteParams.syncClientPeriodInSeconds) && - Objects.equals(this.allowSpontaneousScopes, updateSiteParams.allowSpontaneousScopes) && - Objects.equals(this.spontaneousScopes, updateSiteParams.spontaneousScopes); - } - - @Override - public int hashCode() { - return Objects.hash(rpId, redirectUris, postLogoutRedirectUris, responseTypes, grantTypes, scope, acrValues, clientJwksUri, clientTokenEndpointAuthMethod, clientRequestUris, clientSectorIdentifierUri, contacts, uiLocales, claimsLocales, accessTokenAsJwt, accessTokenSigningAlg, rptAsJwt, claimsRedirectUri, clientTokenEndpointAuthSigningAlg, clientName, logoUri, clientUri, policyUri, frontChannelLogoutSessionRequired, tosUri, jwks, idTokenBindingCnf, tlsClientAuthSubjectDn, runIntrospectionScriptBeforeaccessTokenAsJwtCreationAndIncludeClaims, idTokenSignedResponseAlg, idTokenEncryptedResponseAlg, idTokenEncryptedResponseEnc, userInfoSignedResponseAlg, userInfoEncryptedResponseAlg, userInfoEncryptedResponseEnc, requestObjectSigningAlg, requestObjectEncryptionAlg, requestObjectEncryptionEnc, defaultMaxAge, requireAuthTime, initiateLoginUri, authorizedOrigins, accessTokenLifetime, softwareId, softwareVersion, softwareStatement, customAttributes, syncClientFromOp, syncClientPeriodInSeconds, allowSpontaneousScopes, spontaneousScopes); - } - - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class UpdateSiteParams {\n"); - - sb.append(" rpId: ").append(toIndentedString(rpId)).append("\n"); - sb.append(" redirectUris: ").append(toIndentedString(redirectUris)).append("\n"); - sb.append(" postLogoutRedirectUris: ").append(toIndentedString(postLogoutRedirectUris)).append("\n"); - sb.append(" responseTypes: ").append(toIndentedString(responseTypes)).append("\n"); - sb.append(" grantTypes: ").append(toIndentedString(grantTypes)).append("\n"); - sb.append(" scope: ").append(toIndentedString(scope)).append("\n"); - sb.append(" acrValues: ").append(toIndentedString(acrValues)).append("\n"); - sb.append(" clientJwksUri: ").append(toIndentedString(clientJwksUri)).append("\n"); - sb.append(" clientTokenEndpointAuthMethod: ").append(toIndentedString(clientTokenEndpointAuthMethod)).append("\n"); - sb.append(" clientRequestUris: ").append(toIndentedString(clientRequestUris)).append("\n"); - sb.append(" clientSectorIdentifierUri: ").append(toIndentedString(clientSectorIdentifierUri)).append("\n"); - sb.append(" contacts: ").append(toIndentedString(contacts)).append("\n"); - sb.append(" uiLocales: ").append(toIndentedString(uiLocales)).append("\n"); - sb.append(" claimsLocales: ").append(toIndentedString(claimsLocales)).append("\n"); - sb.append(" accessTokenAsJwt: ").append(toIndentedString(accessTokenAsJwt)).append("\n"); - sb.append(" accessTokenSigningAlg: ").append(toIndentedString(accessTokenSigningAlg)).append("\n"); - sb.append(" rptAsJwt: ").append(toIndentedString(rptAsJwt)).append("\n"); - sb.append(" claimsRedirectUri: ").append(toIndentedString(claimsRedirectUri)).append("\n"); - sb.append(" clientTokenEndpointAuthSigningAlg: ").append(toIndentedString(clientTokenEndpointAuthSigningAlg)).append("\n"); - sb.append(" clientName: ").append(toIndentedString(clientName)).append("\n"); - sb.append(" logoUri: ").append(toIndentedString(logoUri)).append("\n"); - sb.append(" clientUri: ").append(toIndentedString(clientUri)).append("\n"); - sb.append(" policyUri: ").append(toIndentedString(policyUri)).append("\n"); - sb.append(" frontChannelLogoutSessionRequired: ").append(toIndentedString(frontChannelLogoutSessionRequired)).append("\n"); - sb.append(" tosUri: ").append(toIndentedString(tosUri)).append("\n"); - sb.append(" jwks: ").append(toIndentedString(jwks)).append("\n"); - sb.append(" idTokenBindingCnf: ").append(toIndentedString(idTokenBindingCnf)).append("\n"); - sb.append(" tlsClientAuthSubjectDn: ").append(toIndentedString(tlsClientAuthSubjectDn)).append("\n"); - sb.append(" runIntrospectionScriptBeforeaccessTokenAsJwtCreationAndIncludeClaims: ").append(toIndentedString(runIntrospectionScriptBeforeaccessTokenAsJwtCreationAndIncludeClaims)).append("\n"); - sb.append(" idTokenSignedResponseAlg: ").append(toIndentedString(idTokenSignedResponseAlg)).append("\n"); - sb.append(" idTokenEncryptedResponseAlg: ").append(toIndentedString(idTokenEncryptedResponseAlg)).append("\n"); - sb.append(" idTokenEncryptedResponseEnc: ").append(toIndentedString(idTokenEncryptedResponseEnc)).append("\n"); - sb.append(" userInfoSignedResponseAlg: ").append(toIndentedString(userInfoSignedResponseAlg)).append("\n"); - sb.append(" userInfoEncryptedResponseAlg: ").append(toIndentedString(userInfoEncryptedResponseAlg)).append("\n"); - sb.append(" userInfoEncryptedResponseEnc: ").append(toIndentedString(userInfoEncryptedResponseEnc)).append("\n"); - sb.append(" requestObjectSigningAlg: ").append(toIndentedString(requestObjectSigningAlg)).append("\n"); - sb.append(" requestObjectEncryptionAlg: ").append(toIndentedString(requestObjectEncryptionAlg)).append("\n"); - sb.append(" requestObjectEncryptionEnc: ").append(toIndentedString(requestObjectEncryptionEnc)).append("\n"); - sb.append(" defaultMaxAge: ").append(toIndentedString(defaultMaxAge)).append("\n"); - sb.append(" requireAuthTime: ").append(toIndentedString(requireAuthTime)).append("\n"); - sb.append(" initiateLoginUri: ").append(toIndentedString(initiateLoginUri)).append("\n"); - sb.append(" authorizedOrigins: ").append(toIndentedString(authorizedOrigins)).append("\n"); - sb.append(" accessTokenLifetime: ").append(toIndentedString(accessTokenLifetime)).append("\n"); - sb.append(" softwareId: ").append(toIndentedString(softwareId)).append("\n"); - sb.append(" softwareVersion: ").append(toIndentedString(softwareVersion)).append("\n"); - sb.append(" softwareStatement: ").append(toIndentedString(softwareStatement)).append("\n"); - sb.append(" customAttributes: ").append(toIndentedString(customAttributes)).append("\n"); - sb.append(" syncClientFromOp: ").append(toIndentedString(syncClientFromOp)).append("\n"); - sb.append(" syncClientPeriodInSeconds: ").append(toIndentedString(syncClientPeriodInSeconds)).append("\n"); - sb.append(" allowSpontaneousScopes: ").append(toIndentedString(allowSpontaneousScopes)).append("\n"); - sb.append(" spontaneousScopes: ").append(toIndentedString(spontaneousScopes)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - -} diff --git a/jans-client-api/gen-client/src/main/java/io/swagger/client/model/UpdateSiteResponse.java b/jans-client-api/gen-client/src/main/java/io/swagger/client/model/UpdateSiteResponse.java deleted file mode 100644 index 8ab4927c474..00000000000 --- a/jans-client-api/gen-client/src/main/java/io/swagger/client/model/UpdateSiteResponse.java +++ /dev/null @@ -1,91 +0,0 @@ -/* - * jans-api-server - * jans-api-server - * - * OpenAPI spec version: 4.2 - * Contact: yuriyz@gluu.org - * - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen.git - * Do not edit the class manually. - */ - -package io.swagger.client.model; - -import java.util.Objects; -import java.util.Arrays; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import io.swagger.v3.oas.annotations.media.Schema; -import java.io.IOException; -/** - * UpdateSiteResponse - */ - - -public class UpdateSiteResponse { - @SerializedName("rp_id") - private String rpId = null; - - public UpdateSiteResponse rpId(String rpId) { - this.rpId = rpId; - return this; - } - - /** - * Get rpId - * @return rpId - **/ - @Schema(required = true, description = "") - public String getRpId() { - return rpId; - } - - public void setRpId(String rpId) { - this.rpId = rpId; - } - - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - UpdateSiteResponse updateSiteResponse = (UpdateSiteResponse) o; - return Objects.equals(this.rpId, updateSiteResponse.rpId); - } - - @Override - public int hashCode() { - return Objects.hash(rpId); - } - - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class UpdateSiteResponse {\n"); - - sb.append(" rpId: ").append(toIndentedString(rpId)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - -} diff --git a/jans-client-api/gen-client/src/main/java/io/swagger/client/model/WebFingerLink.java b/jans-client-api/gen-client/src/main/java/io/swagger/client/model/WebFingerLink.java deleted file mode 100644 index 9b9edf05ea0..00000000000 --- a/jans-client-api/gen-client/src/main/java/io/swagger/client/model/WebFingerLink.java +++ /dev/null @@ -1,114 +0,0 @@ -/* - * jans-api-server - * jans-api-server - * - * OpenAPI spec version: 4.2 - * Contact: yuriyz@gluu.org - * - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen.git - * Do not edit the class manually. - */ - -package io.swagger.client.model; - -import java.util.Objects; -import java.util.Arrays; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import io.swagger.v3.oas.annotations.media.Schema; -import java.io.IOException; -/** - * WebFingerLink - */ - - -public class WebFingerLink { - @SerializedName("rel") - private String rel = null; - - @SerializedName("href") - private String href = null; - - public WebFingerLink rel(String rel) { - this.rel = rel; - return this; - } - - /** - * Get rel - * @return rel - **/ - @Schema(required = true, description = "") - public String getRel() { - return rel; - } - - public void setRel(String rel) { - this.rel = rel; - } - - public WebFingerLink href(String href) { - this.href = href; - return this; - } - - /** - * Get href - * @return href - **/ - @Schema(required = true, description = "") - public String getHref() { - return href; - } - - public void setHref(String href) { - this.href = href; - } - - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - WebFingerLink webFingerLink = (WebFingerLink) o; - return Objects.equals(this.rel, webFingerLink.rel) && - Objects.equals(this.href, webFingerLink.href); - } - - @Override - public int hashCode() { - return Objects.hash(rel, href); - } - - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class WebFingerLink {\n"); - - sb.append(" rel: ").append(toIndentedString(rel)).append("\n"); - sb.append(" href: ").append(toIndentedString(href)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - -} diff --git a/jans-client-api/gen-client/src/test/java/io/swagger/client/api/AccessTokenAsJwtTest.java b/jans-client-api/gen-client/src/test/java/io/swagger/client/api/AccessTokenAsJwtTest.java deleted file mode 100644 index 1ab0afa0fd9..00000000000 --- a/jans-client-api/gen-client/src/test/java/io/swagger/client/api/AccessTokenAsJwtTest.java +++ /dev/null @@ -1,61 +0,0 @@ -package io.swagger.client.api; - -import com.google.common.base.Strings; -import com.google.common.collect.Lists; -import io.swagger.client.model.GetClientTokenParams; -import io.swagger.client.model.GetClientTokenResponse; -import io.swagger.client.model.RegisterSiteParams; -import io.swagger.client.model.RegisterSiteResponse; -import org.testng.annotations.Parameters; -import org.testng.annotations.Test; -import io.jans.as.model.common.GrantType; -import io.jans.as.model.jwt.Jwt; - -import static io.swagger.client.api.Tester.api; -import static org.testng.Assert.*; - - -/** - * @author Yuriy Zabrovarnyy - * @author Shoeb - */ -public class AccessTokenAsJwtTest { - - - @Parameters({"opHost", "redirectUrls", "postLogoutRedirectUrls"}) - @Test - public void testWithAccessTokenAsJwt(String opHost, String redirectUrls, String postLogoutRedirectUrls) throws Exception { - - final DevelopersApi apiClient = api(); - - final RegisterSiteParams siteParams = new io.swagger.client.model.RegisterSiteParams(); - siteParams.setOpHost(opHost); - siteParams.setRedirectUris(Lists.newArrayList(redirectUrls.split(" "))); - siteParams.setPostLogoutRedirectUris(Lists.newArrayList(postLogoutRedirectUrls.split(" "))); - siteParams.setScope(Lists.newArrayList("openid", "uma_protection", "profile")); - siteParams.setAccessTokenAsJwt(true); - siteParams.setGrantTypes(Lists.newArrayList( - GrantType.AUTHORIZATION_CODE.getValue(), - GrantType.CLIENT_CREDENTIALS.getValue())); - - final RegisterSiteResponse resp = apiClient.registerSite(siteParams); - assertNotNull(resp); - - final GetClientTokenParams tokenParams = new GetClientTokenParams(); - tokenParams.setOpHost(opHost); - tokenParams.setScope(Lists.newArrayList("openid")); - tokenParams.setClientId(resp.getClientId()); - tokenParams.setClientSecret(resp.getClientSecret()); - - GetClientTokenResponse tokenResponse = apiClient.getClientToken(tokenParams); - - assertNotNull(tokenResponse); - assertTrue(!Strings.isNullOrEmpty(tokenResponse.getAccessToken())); - - final Jwt parse = Jwt.parse(tokenResponse.getAccessToken()); - assertNotNull(parse); - System.out.println("access token as JWT: " + tokenResponse.getAccessToken() + ", claims: " + parse.getClaims()); - } - - -} diff --git a/jans-client-api/gen-client/src/test/java/io/swagger/client/api/BaseTestCase.java b/jans-client-api/gen-client/src/test/java/io/swagger/client/api/BaseTestCase.java deleted file mode 100644 index e028056f90d..00000000000 --- a/jans-client-api/gen-client/src/test/java/io/swagger/client/api/BaseTestCase.java +++ /dev/null @@ -1,10 +0,0 @@ -package io.swagger.client.api; - -import org.testng.annotations.Listeners; - -@Listeners(value = TestMethodListener.class) -public class BaseTestCase { - -} - - diff --git a/jans-client-api/gen-client/src/test/java/io/swagger/client/api/DifferentAuthServerTest.java b/jans-client-api/gen-client/src/test/java/io/swagger/client/api/DifferentAuthServerTest.java deleted file mode 100644 index ee6bc247cce..00000000000 --- a/jans-client-api/gen-client/src/test/java/io/swagger/client/api/DifferentAuthServerTest.java +++ /dev/null @@ -1,111 +0,0 @@ -package io.swagger.client.api; - -import io.swagger.client.ApiResponse; -import io.swagger.client.model.*; -import org.apache.commons.lang.StringUtils; -import io.jans.ca.common.CoreUtils; -import org.testng.Assert; -import org.testng.annotations.Parameters; -import org.testng.annotations.Test; - -import java.util.List; -import java.util.Map; - -import static io.swagger.client.api.Tester.api; -import static io.swagger.client.api.Tester.getAuthorization; -import static org.apache.commons.lang.StringUtils.isNotBlank; -import static org.testng.Assert.*; -import static org.testng.AssertJUnit.assertTrue; - -//Set `protect_commands_with_access_token` field to true in oxd-server.yml file -public class DifferentAuthServerTest { - - @Parameters({"opHost", "redirectUrls", "authServer", "userId", "userSecret"}) - @Test - public void getUserInfo_withDifferentAuthServer(String opHost, String redirectUrls, String authServer, String userId, String userSecret) throws Exception { - final DevelopersApi client = api(); - - final io.swagger.client.model.RegisterSiteResponse site = RegisterSiteTest.registerSite(client, opHost, redirectUrls); - final io.swagger.client.model.RegisterSiteResponse authServerResp = RegisterSiteTest.registerSite(client, authServer, redirectUrls); - final GetTokensByCodeResponse tokens = requestTokens(client, opHost, site, authServerResp, userId, userSecret, site.getClientId(), redirectUrls); - - final io.swagger.client.model.GetUserInfoParams params = new GetUserInfoParams(); - params.setRpId(site.getRpId()); - params.setAccessToken(tokens.getAccessToken()); - params.setIdToken(tokens.getIdToken()); - - final Map resp = client.getUserInfo(params, getAuthorization(authServerResp), authServerResp.getRpId()); - Assert.assertNotNull(resp); - assertFalse(resp.isEmpty()); - Assert.assertNotNull(resp.get("sub")); - } - - @Parameters({"redirectUrls", "opHost", "authServer", "rsProtect"}) - @Test - public void umaFullTest_withDifferentAuthServer(String redirectUrls, String opHost, String authServer, String rsProtect) throws Exception { - - final DevelopersApi client = api(); - - final RegisterSiteResponse site = RegisterSiteTest.registerSite(client, opHost, redirectUrls); - final RegisterSiteResponse authServerResp = RegisterSiteTest.registerSite(client, authServer, redirectUrls); - - protectResources(client, site, authServerResp, UmaFullTest.resourceList(rsProtect)); - - final UmaRsCheckAccessResponse checkAccess = checkAccess(client, site, authServerResp, null); - - final UmaRpGetRptParams params = new UmaRpGetRptParams(); - params.setRpId(site.getRpId()); - params.setTicket(checkAccess.getTicket()); - - final UmaRpGetRptResponse response = client.umaRpGetRpt(params, getAuthorization(authServerResp), authServerResp.getRpId()); - - Assert.assertNotNull(response); - - assertTrue(isNotBlank(response.getAccessToken())); - assertTrue(isNotBlank(response.getPct())); - } - - public static UmaRsProtectResponse protectResources(DevelopersApi client, RegisterSiteResponse site, RegisterSiteResponse authServerResp, List resources) throws Exception { - final UmaRsProtectParams params = new UmaRsProtectParams(); - params.setRpId(site.getRpId()); - params.setResources(resources); - - final UmaRsProtectResponse resp = client.umaRsProtect(params, getAuthorization(authServerResp), authServerResp.getRpId()); - assertNotNull(resp); - return resp; - } - - public static UmaRsCheckAccessResponse checkAccess(DevelopersApi client, RegisterSiteResponse site, RegisterSiteResponse authServer, List scopeList) throws Exception { - final UmaRsCheckAccessParams params = new UmaRsCheckAccessParams(); - params.setRpId(site.getRpId()); - params.setHttpMethod("GET"); - params.setPath("/ws/phone"); - params.setRpt("dummy"); - params.setScopes(scopeList); - - final ApiResponse apiResp = client.umaRsCheckAccessWithHttpInfo(params, getAuthorization(authServer), authServer.getRpId()); - - assertEquals(apiResp.getStatusCode(), 200) ; //fixme should be 401 - assertNotNull(apiResp.getData()); - assertTrue(StringUtils.isNotBlank(apiResp.getData().getAccess())); - - return apiResp.getData(); - } - - private GetTokensByCodeResponse requestTokens(DevelopersApi client, String opHost, io.swagger.client.model.RegisterSiteResponse site, io.swagger.client.model.RegisterSiteResponse authServer, String userId, String userSecret, String clientId, String redirectUrls) throws Exception { - - final String state = CoreUtils.secureRandomString(); - final String nonce = CoreUtils.secureRandomString(); - - final io.swagger.client.model.GetTokensByCodeParams params = new GetTokensByCodeParams(); - params.setRpId(site.getRpId()); - params.setCode(GetTokensByCodeTest.codeRequest(client, opHost, site.getRpId(), userId, userSecret, clientId, redirectUrls, state, nonce, getAuthorization(site))); - params.setState(state); - - final GetTokensByCodeResponse resp = client.getTokensByCode(params, getAuthorization(authServer), authServer.getRpId()); - Assert.assertNotNull(resp); - Tester.notEmpty(resp.getAccessToken()); - Tester.notEmpty(resp.getIdToken()); - return resp; - } -} diff --git a/jans-client-api/gen-client/src/test/java/io/swagger/client/api/GetAuthorizationUrlTest.java b/jans-client-api/gen-client/src/test/java/io/swagger/client/api/GetAuthorizationUrlTest.java deleted file mode 100644 index 9e76d4f6ffd..00000000000 --- a/jans-client-api/gen-client/src/test/java/io/swagger/client/api/GetAuthorizationUrlTest.java +++ /dev/null @@ -1,89 +0,0 @@ -package io.swagger.client.api; - -import com.google.common.collect.Lists; -import io.swagger.client.model.GetAuthorizationUrlParams; -import io.swagger.client.model.GetAuthorizationUrlResponse; -import io.swagger.client.model.RegisterSiteResponse; -import org.apache.commons.lang.StringUtils; -import io.jans.ca.common.CoreUtils; -import org.testng.annotations.Parameters; -import org.testng.annotations.Test; - -import java.util.Map; - -import static org.testng.Assert.assertEquals; -import static org.testng.AssertJUnit.assertNotNull; -import static org.testng.AssertJUnit.assertTrue; - -public class GetAuthorizationUrlTest { - @Parameters({"redirectUrls", "opHost"}) - @Test - public void test(String redirectUrls, String opHost) throws Exception { - DevelopersApi api = Tester.api(); - - final RegisterSiteResponse site = RegisterSiteTest.registerSite(api, opHost, redirectUrls); - final GetAuthorizationUrlParams commandParams = new GetAuthorizationUrlParams(); - commandParams.setRpId(site.getRpId()); - - final GetAuthorizationUrlResponse resp = api.getAuthorizationUrl(commandParams, Tester.getAuthorization(site), null); - assertNotNull(resp); - Tester.notEmpty(resp.getAuthorizationUrl()); - } - - @Parameters({"redirectUrls", "opHost", "state"}) - @Test - public void testWithCustomStateParameter(String redirectUrls, String opHost, String state) throws Exception { - DevelopersApi api = Tester.api(); - - final RegisterSiteResponse site = RegisterSiteTest.registerSite(api, opHost, redirectUrls); - final GetAuthorizationUrlParams commandParams = new GetAuthorizationUrlParams(); - commandParams.setRpId(site.getRpId()); - commandParams.setState(state); - - final GetAuthorizationUrlResponse resp = api.getAuthorizationUrl(commandParams, Tester.getAuthorization(site), null); - assertNotNull(resp); - Tester.notEmpty(resp.getAuthorizationUrl()); - - Map parameters = CoreUtils.splitQuery(resp.getAuthorizationUrl()); - assertTrue(StringUtils.isNotBlank(parameters.get("state"))); - assertEquals(parameters.get("state"), state); - } - - @Parameters({"redirectUrls", "opHost"}) - @Test - public void testWithNonceParameter(String redirectUrls, String opHost) throws Exception { - DevelopersApi api = Tester.api(); - - final RegisterSiteResponse site = RegisterSiteTest.registerSite(api, opHost, redirectUrls); - final GetAuthorizationUrlParams commandParams = new GetAuthorizationUrlParams(); - commandParams.setRpId(site.getRpId()); - commandParams.setNonce("dummy_nonce"); - - final GetAuthorizationUrlResponse resp = api.getAuthorizationUrl(commandParams, Tester.getAuthorization(site), null); - assertNotNull(resp); - Tester.notEmpty(resp.getAuthorizationUrl()); - - Map parameters = CoreUtils.splitQuery(resp.getAuthorizationUrl()); - assertTrue(StringUtils.isNotBlank(parameters.get("nonce"))); - assertEquals(parameters.get("nonce"), "dummy_nonce"); - } - - @Parameters({"redirectUrls", "opHost"}) - @Test - public void testWithResposeType(String redirectUrls, String opHost) throws Exception { - DevelopersApi api = Tester.api(); - - final RegisterSiteResponse site = RegisterSiteTest.registerSite(api, opHost, redirectUrls); - final GetAuthorizationUrlParams commandParams = new GetAuthorizationUrlParams(); - commandParams.setRpId(site.getRpId()); - commandParams.setResponseTypes(Lists.newArrayList("code", "token")); - - final GetAuthorizationUrlResponse resp = api.getAuthorizationUrl(commandParams, Tester.getAuthorization(site), null); - assertNotNull(resp); - Tester.notEmpty(resp.getAuthorizationUrl()); - - Map parameters = CoreUtils.splitQuery(resp.getAuthorizationUrl()); - assertTrue(parameters.get("response_type").contains("code")); - assertTrue(parameters.get("response_type").contains("token")); - } -} diff --git a/jans-client-api/gen-client/src/test/java/io/swagger/client/api/GetClientTokenTest.java b/jans-client-api/gen-client/src/test/java/io/swagger/client/api/GetClientTokenTest.java deleted file mode 100644 index de7fc7c7fdc..00000000000 --- a/jans-client-api/gen-client/src/test/java/io/swagger/client/api/GetClientTokenTest.java +++ /dev/null @@ -1,51 +0,0 @@ -package io.swagger.client.api; - -import com.google.common.collect.Lists; -import io.swagger.client.ApiException; -import io.swagger.client.model.GetClientTokenParams; -import io.swagger.client.model.GetClientTokenResponse; -import org.testng.annotations.Parameters; -import org.testng.annotations.Test; - -import static org.testng.Assert.assertNotNull; - - - -/** - * @author Yuriy Zabrovarnyy - * @author Shoeb - * @version 9/17/2018 - */ - -public class GetClientTokenTest { - - @Parameters({ "opHost"}) - @Test - public void getClientToken(String opHost) throws ApiException { - final GetClientTokenParams params = new GetClientTokenParams(); - params.setOpHost(opHost); - params.setScope(Lists.newArrayList("openid","jans_client_api")); - params.setClientId(Tester.getSetupData().getClientId()); - params.setClientSecret(Tester.getSetupData().getClientSecret()); - - GetClientTokenResponse resp = Tester.api().getClientToken(params); - assertNotNull(resp); - Tester.notEmpty(resp.getAccessToken()); - - } - - @Parameters({ "opConfigurationEndpoint"}) - @Test - public void getClientToken_withOpConfigurationEndpoint(String opConfigurationEndpoint) throws ApiException { - final GetClientTokenParams params = new GetClientTokenParams(); - params.setOpConfigurationEndpoint(opConfigurationEndpoint); - params.setScope(Lists.newArrayList("openid","jans_client_api")); - params.setClientId(Tester.getSetupData().getClientId()); - params.setClientSecret(Tester.getSetupData().getClientSecret()); - - GetClientTokenResponse resp = Tester.api().getClientToken(params); - assertNotNull(resp); - Tester.notEmpty(resp.getAccessToken()); - - } -} diff --git a/jans-client-api/gen-client/src/test/java/io/swagger/client/api/GetDiscoveryTest.java b/jans-client-api/gen-client/src/test/java/io/swagger/client/api/GetDiscoveryTest.java deleted file mode 100644 index d4c0c8d5dec..00000000000 --- a/jans-client-api/gen-client/src/test/java/io/swagger/client/api/GetDiscoveryTest.java +++ /dev/null @@ -1,36 +0,0 @@ -package io.swagger.client.api; - -import io.swagger.client.model.GetDiscoveryParams; -import io.swagger.client.model.GetDiscoveryResponse; -import org.testng.annotations.Parameters; -import org.testng.annotations.Test; -import static org.testng.AssertJUnit.assertNotNull; - -public class GetDiscoveryTest { - @Parameters({"opHost", "opDiscoveryPath"}) - @Test - public void test(String opHost, String opDiscoveryPath) throws Exception { - DevelopersApi api = Tester.api(); - - final GetDiscoveryParams commandParams = new GetDiscoveryParams(); - commandParams.setOpHost(opHost); - commandParams.setOpDiscoveryPath(opDiscoveryPath); - - final GetDiscoveryResponse resp = api.getDiscovery(commandParams); - assertNotNull(resp); - assertNotNull(resp.getIssuer()); - } - - @Parameters({"opConfigurationEndpoint"}) - @Test - public void test_withOpConfigurationEndpoint(String opConfigurationEndpoint) throws Exception { - DevelopersApi api = Tester.api(); - - final GetDiscoveryParams commandParams = new GetDiscoveryParams(); - commandParams.setOpConfigurationEndpoint(opConfigurationEndpoint); - - final GetDiscoveryResponse resp = api.getDiscovery(commandParams); - assertNotNull(resp); - assertNotNull(resp.getIssuer()); - } -} diff --git a/jans-client-api/gen-client/src/test/java/io/swagger/client/api/GetIssuerTest.java b/jans-client-api/gen-client/src/test/java/io/swagger/client/api/GetIssuerTest.java deleted file mode 100644 index d61bbf78878..00000000000 --- a/jans-client-api/gen-client/src/test/java/io/swagger/client/api/GetIssuerTest.java +++ /dev/null @@ -1,60 +0,0 @@ -package io.swagger.client.api; - -import io.swagger.client.model.GetIssuerParams; -import io.swagger.client.model.GetIssuerResponse; -import org.testng.annotations.Parameters; -import org.testng.annotations.Test; - -import static org.testng.AssertJUnit.assertEquals; -import static org.testng.AssertJUnit.assertNotNull; - -public class GetIssuerTest { - - @Parameters({"opHost", "emailWebfingerInput"}) - @Test(enabled = false) - public void emailInputTest(String opHost, String emailWebfingerInput) throws Exception { - DevelopersApi api = Tester.api(); - - final GetIssuerParams commandParams = new GetIssuerParams(); - commandParams.setResource(emailWebfingerInput); - commandParams.setOpHost(opHost); - final GetIssuerResponse resp = api.getIssuer(commandParams); - assertNotNull(resp); - assertEquals(resp.getSubject(), emailWebfingerInput); - resp.getLinks().forEach((link) -> { - assertEquals(link.getHref(), opHost); - }); - } - - @Parameters({"opHost", "urlWebfingerInput"}) - @Test(enabled = false) - public void urlInputTest(String opHost, String urlWebfingerInput) throws Exception { - DevelopersApi api = Tester.api(); - - final GetIssuerParams commandParams = new GetIssuerParams(); - commandParams.setResource(urlWebfingerInput); - commandParams.setOpHost(opHost); - final GetIssuerResponse resp = api.getIssuer(commandParams); - assertNotNull(resp); - assertEquals(resp.getSubject(), urlWebfingerInput); - resp.getLinks().forEach((link) -> { - assertEquals(link.getHref(), opHost); - }); - } - - @Parameters({"opHost", "hostnameWebfingerInput"}) - @Test(enabled = false) - public void hostnameInputTest(String opHost, String hostnameWebfingerInput) throws Exception { - DevelopersApi api = Tester.api(); - - final GetIssuerParams commandParams = new GetIssuerParams(); - commandParams.setResource(hostnameWebfingerInput); - commandParams.setOpHost(opHost); - final GetIssuerResponse resp = api.getIssuer(commandParams); - assertNotNull(resp); - assertEquals(resp.getSubject(), hostnameWebfingerInput); - resp.getLinks().forEach((link) -> { - assertEquals(link.getHref(), opHost); - }); - } -} diff --git a/jans-client-api/gen-client/src/test/java/io/swagger/client/api/GetJwksTest.java b/jans-client-api/gen-client/src/test/java/io/swagger/client/api/GetJwksTest.java deleted file mode 100644 index b1a76079086..00000000000 --- a/jans-client-api/gen-client/src/test/java/io/swagger/client/api/GetJwksTest.java +++ /dev/null @@ -1,74 +0,0 @@ -/* - All rights reserved -- Copyright 2015 Gluu Inc. -*/ -package io.swagger.client.api; - -import io.swagger.client.ApiException; -import io.swagger.client.model.GetJwksParams; -import io.swagger.client.model.GetJwksResponse; -import org.testng.annotations.Optional; -import org.testng.annotations.Parameters; -import org.testng.annotations.Test; - -import static io.swagger.client.api.Tester.api; -import static org.testng.Assert.*; - -/** - * Test for checking JSON Web Key Set functionality - * - * @author Shoeb - * @version 12/02/2018 - */ -public class GetJwksTest { - - @Test - @Parameters({"opHost", "opDiscoveryPath"}) - public void test(String opHost, @Optional String opDiscoveryPath) throws Exception { - - final DevelopersApi client = api(); - - final GetJwksParams params = new GetJwksParams(); - params.setOpHost(opHost); - params.setOpDiscoveryPath(opDiscoveryPath); - - final GetJwksResponse response = client.getJsonWebKeySet(params, Tester.getAuthorization(), null); - assertNotNull(response); - assertNotNull(response.getKeys()); - assertFalse(response.getKeys().isEmpty()); - - } - - @Test - @Parameters({"opConfigurationEndpoint"}) - public void test_withOpConfigurationEndpoint(String opConfigurationEndpoint) throws Exception { - - final DevelopersApi client = api(); - - final GetJwksParams params = new GetJwksParams(); - params.setOpConfigurationEndpoint(opConfigurationEndpoint); - - final GetJwksResponse response = client.getJsonWebKeySet(params, Tester.getAuthorization(), null); - assertNotNull(response); - assertNotNull(response.getKeys()); - assertFalse(response.getKeys().isEmpty()); - - } - - @Test - @Parameters({"opDiscoveryPath"}) - public void testWithNoOP(@Optional String opDiscoveryPath) throws Exception { - - final DevelopersApi client = api(); - - final GetJwksParams params = new GetJwksParams(); - params.setOpDiscoveryPath(opDiscoveryPath); - - try { - client.getJsonWebKeySetWithHttpInfo(params, Tester.getAuthorization(), null); - } catch (ApiException ex) { - assertEquals(ex.getCode(), 400); - } - - } - -} diff --git a/jans-client-api/gen-client/src/test/java/io/swagger/client/api/GetLogoutUrlTest.java b/jans-client-api/gen-client/src/test/java/io/swagger/client/api/GetLogoutUrlTest.java deleted file mode 100644 index 4ef17a15f42..00000000000 --- a/jans-client-api/gen-client/src/test/java/io/swagger/client/api/GetLogoutUrlTest.java +++ /dev/null @@ -1,76 +0,0 @@ -package io.swagger.client.api; - -import io.swagger.client.ApiException; -import io.swagger.client.model.GetLogoutUriParams; -import io.swagger.client.model.GetLogoutUriResponse; -import io.swagger.client.model.RegisterSiteResponse; - -import org.testng.annotations.Parameters; -import org.testng.annotations.Test; - -import java.net.URLEncoder; -import java.util.UUID; - -import static io.swagger.client.api.Tester.api; -import static org.testng.Assert.*; - -/** - * Dummy test because we can't check real session management which is handled via browser cookies. - * - * @author Yuriy Zabrovarnyy - * @author Shoeb - * @version 10/31/2018 - */ - -public class GetLogoutUrlTest { - - @Parameters({"opHost", "redirectUrls", "postLogoutRedirectUrl"}) - @Test - public void test(String opHost, String redirectUrls, String postLogoutRedirectUrl) throws Exception { - final DevelopersApi client = api(); - - final RegisterSiteResponse site = RegisterSiteTest.registerSite(client, opHost, redirectUrls, postLogoutRedirectUrl, "","","" ); - - final GetLogoutUriParams params = new GetLogoutUriParams(); - params.setRpId(site.getRpId()); - params.setIdTokenHint("dummy_token"); - params.setPostLogoutRedirectUri(postLogoutRedirectUrl); - params.setState(UUID.randomUUID().toString()); - params.setSessionState(UUID.randomUUID().toString()); // here must be real session instead of dummy UUID - - final GetLogoutUriResponse resp = client.getLogoutUri(params, Tester.getAuthorization(site), null); - assertNotNull(resp); - assertNotNull(resp.getUri()); - assertTrue(resp.getUri().contains(URLEncoder.encode(postLogoutRedirectUrl, "UTF-8"))); - } - - - @Test - public void testWithInvalidRpId() throws Exception { - final DevelopersApi client = api(); - - final GetLogoutUriParams params = new GetLogoutUriParams(); - params.setRpId(UUID.randomUUID().toString()); - - try { - client.getLogoutUri(params, Tester.getAuthorization(), null); - } catch (ApiException ex) { - assertEquals(ex.getCode(), 400); // fixme should be 404 (NOT_FOUND) instead of BAD_REQUEST, - } - } - - @Parameters({"opHost", "redirectUrls", "postLogoutRedirectUrl"}) - @Test - public void testWithNullRpId(String opHost, String redirectUrls, String postLogoutRedirectUrl) throws Exception { - final DevelopersApi client = api(); - final RegisterSiteResponse site = RegisterSiteTest.registerSite(client, opHost, redirectUrls, postLogoutRedirectUrl, "","","" ); - final GetLogoutUriParams params = new GetLogoutUriParams(); - params.setRpId(null); - try { - client.getLogoutUri(params, Tester.getAuthorization(site), site.getRpId()); - } catch (ApiException ex) { - assertEquals(ex.getCode(), 400); //BAD_REQUEST - } - } - -} diff --git a/jans-client-api/gen-client/src/test/java/io/swagger/client/api/GetRequestUriTest.java b/jans-client-api/gen-client/src/test/java/io/swagger/client/api/GetRequestUriTest.java deleted file mode 100644 index fdb0e025fb7..00000000000 --- a/jans-client-api/gen-client/src/test/java/io/swagger/client/api/GetRequestUriTest.java +++ /dev/null @@ -1,40 +0,0 @@ -package io.swagger.client.api; - -import io.swagger.client.model.*; -import io.jans.ca.common.Jackson2; -import org.testng.annotations.Parameters; -import org.testng.annotations.Test; - -import static org.testng.AssertJUnit.assertNotNull; - -public class GetRequestUriTest { - - @Parameters({"redirectUrls", "opHost", "host"}) - @Test - public void test(String redirectUrls, String opHost, String host) throws Exception { - DevelopersApi api = Tester.api(); - - final RegisterSiteResponse site = RegisterSiteTest.registerSite(api, opHost, redirectUrls); - - //jwks generation - final GetRpJwksResponse getRpJwksResponse = api.getRpJwks(); - //update site with jwks - UpdateSiteParams updateSiteParams = new UpdateSiteParams(); - updateSiteParams.setRpId(site.getRpId()); - updateSiteParams.setJwks(Jackson2.asJson(getRpJwksResponse)); - updateSiteParams.setRequestObjectSigningAlg("RS256"); - api.updateSite(updateSiteParams, Tester.getAuthorization(site), null); - //Request uri - GetRequestObjectUriParams getRequestUriParams = new GetRequestObjectUriParams(); - getRequestUriParams.setRpId(site.getRpId()); - getRequestUriParams.setRpHostUrl(Tester.getHost()); - GetRequestObjectUriResponse getRequestObjectUriResponse = api.getRequestObjectUri(getRequestUriParams, Tester.getAuthorization(site), null); - assertNotNull(getRequestObjectUriResponse.getRequestUri()); - - - //Get Request object - String requestObjectId = getRequestObjectUriResponse.getRequestUri().substring(getRequestObjectUriResponse.getRequestUri().lastIndexOf('/') + 1); - String requestObject = api.getRequestObject(requestObjectId); - assertNotNull(requestObject); - } -} diff --git a/jans-client-api/gen-client/src/test/java/io/swagger/client/api/GetRpJwksTest.java b/jans-client-api/gen-client/src/test/java/io/swagger/client/api/GetRpJwksTest.java deleted file mode 100644 index b5002f2de03..00000000000 --- a/jans-client-api/gen-client/src/test/java/io/swagger/client/api/GetRpJwksTest.java +++ /dev/null @@ -1,28 +0,0 @@ -package io.swagger.client.api; - -import io.swagger.client.model.GetJwksParams; -import io.swagger.client.model.GetJwksResponse; -import io.swagger.client.model.GetRpJwksResponse; -import org.testng.annotations.Optional; -import org.testng.annotations.Parameters; -import org.testng.annotations.Test; - -import static io.swagger.client.api.Tester.api; -import static org.testng.Assert.assertFalse; -import static org.testng.Assert.assertNotNull; - -public class GetRpJwksTest { - - @Test - @Parameters({"opHost"}) - public void test(String opHost) throws Exception { - - final DevelopersApi client = api(); - final GetRpJwksResponse response = client.getRpJwks(); - - assertNotNull(response); - assertNotNull(response.getKeys()); - assertFalse(response.getKeys().isEmpty()); - - } -} diff --git a/jans-client-api/gen-client/src/test/java/io/swagger/client/api/GetTokensByCodeTest.java b/jans-client-api/gen-client/src/test/java/io/swagger/client/api/GetTokensByCodeTest.java deleted file mode 100644 index 922a6d98cc8..00000000000 --- a/jans-client-api/gen-client/src/test/java/io/swagger/client/api/GetTokensByCodeTest.java +++ /dev/null @@ -1,142 +0,0 @@ -package io.swagger.client.api; - -import com.google.common.collect.Lists; -import com.google.gson.JsonElement; -import com.google.gson.JsonParser; -import com.squareup.okhttp.MediaType; -import com.squareup.okhttp.Request; -import com.squareup.okhttp.RequestBody; -import com.squareup.okhttp.Response; -import io.swagger.client.model.*; -import io.jans.as.model.common.AuthenticationMethod; -import io.jans.ca.common.CoreUtils; -import io.jans.ca.common.SeleniumTestUtils; -import org.testng.annotations.Parameters; -import org.testng.annotations.Test; -import org.testng.util.Strings; - -import static io.swagger.client.api.Tester.notEmpty; -import static org.testng.Assert.assertNotNull; - -/** - * Test class to test refresh token and related end points - * - * @author Yuriy Z - * @author Shoeb - * @version 5, Oct, 2018 - */ -public class GetTokensByCodeTest { - - private static final String AUTH_CODE_ENDPOINT = "/get-authorization-code"; - - @Parameters({"opHost", "redirectUrls", "userId", "userSecret"}) - @Test - public void test(String opHost, String redirectUrls, String userId, String userSecret) throws Exception { - - DevelopersApi client = Tester.api(); - - final RegisterSiteResponse site = RegisterSiteTest.registerSite(client, opHost, redirectUrls); - - GetTokensByCodeResponse tokensResponse = tokenByCode(client, site, opHost, userId, userSecret, site.getClientId(), redirectUrls, CoreUtils.secureRandomString()); - - refreshToken(tokensResponse, client, site); - } - - @Parameters({"opHost", "redirectUrls", "userId", "userSecret"}) - @Test - public void withAuthenticationMethod_shouldGetTokenInResponse(String opHost, String redirectUrls, String userId, String userSecret) throws Exception { - - DevelopersApi client = Tester.api(); - - final RegisterSiteResponse site = RegisterSiteTest.registerSite_withAuthenticationMethod(client, opHost, redirectUrls, redirectUrls, redirectUrls, "PS256", AuthenticationMethod.PRIVATE_KEY_JWT.toString()); - - GetTokensByCodeResponse tokensResponse = tokenByCode(client, site, opHost, userId, userSecret, site.getClientId(), redirectUrls, CoreUtils.secureRandomString(), AuthenticationMethod.PRIVATE_KEY_JWT.toString(), "PS256"); - - } - - private static void refreshToken(GetTokensByCodeResponse resp, DevelopersApi client, RegisterSiteResponse site) throws Exception { - notEmpty(resp.getRefreshToken()); - - final String authorization = Tester.getAuthorization(site); - - // refresh token - final GetAccessTokenByRefreshTokenParams refreshParams = new GetAccessTokenByRefreshTokenParams(); - refreshParams.setRpId(site.getRpId()); - refreshParams.setScope(Lists.newArrayList("openid")); - refreshParams.setRefreshToken(resp.getRefreshToken()); - - GetAccessTokenByRefreshTokenResponse refreshResponse = client.getAccessTokenByRefreshToken(refreshParams, authorization, null); - - assertNotNull(refreshResponse); - notEmpty(refreshResponse.getAccessToken()); - notEmpty(refreshResponse.getRefreshToken()); - } - - private static GetTokensByCodeResponse tokenByCode(DevelopersApi client, RegisterSiteResponse site, String opHost, String userId, String userSecret, String clientId, String redirectUrls, String nonce) throws Exception { - return tokenByCode(client, site, opHost, userId, userSecret, clientId, redirectUrls, nonce, null, null); - } - - private static GetTokensByCodeResponse tokenByCode(DevelopersApi client, RegisterSiteResponse site, String opHost, String userId, String userSecret, String clientId, String redirectUrls, String nonce, String authenticationMethod, String algorithm) throws Exception { - - final String state = CoreUtils.secureRandomString(); - final RegisterSiteResponse authServer = RegisterSiteTest.registerSite(client, opHost, redirectUrls); - final String authorizationStr = Tester.getAuthorization(authServer); - - final String code = codeRequest(client, opHost, site.getRpId(), userId, userSecret, clientId, redirectUrls, state, nonce, authorizationStr, authServer.getRpId()); - - notEmpty(code); - - final GetTokensByCodeParams params = new GetTokensByCodeParams(); - params.setRpId(site.getRpId()); - params.setCode(code); - params.setState(state); - params.setAuthenticationMethod(authenticationMethod); - params.setAlgorithm(algorithm); - - final GetTokensByCodeResponse resp = client.getTokensByCode(params, authorizationStr, authServer.getRpId()); - assertNotNull(resp); - notEmpty(resp.getAccessToken()); - notEmpty(resp.getIdToken()); - notEmpty(resp.getRefreshToken()); - return resp; - } - - public static String codeRequest(DevelopersApi client, String opHost, String rpId, String userId, String userSecret, String clientId, String redirectUrls, String state, - String nonce, String authorization) throws Exception { - return codeRequest(client, opHost, rpId, userId, userSecret, clientId, redirectUrls, state, nonce, authorization, null); - } - - public static String codeRequest(DevelopersApi client, String opHost, String rpId, String userId, String userSecret, String clientId, String redirectUrls, String state, - String nonce, String authorization, String authorizationRpId) throws Exception { - SeleniumTestUtils.authorizeClient(opHost, userId, userSecret, clientId, redirectUrls, state, nonce, null, null); - - final Request request = buildRequest(authorization, authorizationRpId, rpId, userId, userSecret, state, nonce, client); - - final Response response = client.getApiClient().getHttpClient().newCall(request).execute(); - - final JsonElement jsonResponse = new JsonParser().parse(response.body().string()); - - return jsonResponse.getAsJsonObject().get("code").getAsString(); - - } - - private static Request buildRequest(String authorization, String authorizationRpId, String rpId, String userId, String userSecret, String state, String nonce, DevelopersApi client) { - - final String json = "{\"rp_id\":\"" + rpId + "\",\"username\":\"" + userId + "\",\"password\":\"" + userSecret - + "\",\"state\":\"" + state + "\",\"nonce\":\"" + nonce + "\"}"; - - final RequestBody reqBody = RequestBody.create(MediaType.parse("application/json; charset=utf-8"), json); - - com.squareup.okhttp.Request.Builder request = new Request.Builder(); - if (!Strings.isNullOrEmpty(authorizationRpId)) { - request.addHeader("AuthorizationRpId", authorizationRpId); - } - return request - .addHeader("Authorization", authorization) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "application/json") - .method("POST", reqBody) - .url(client.getApiClient().getBasePath() + AUTH_CODE_ENDPOINT).build(); - } - -} diff --git a/jans-client-api/gen-client/src/test/java/io/swagger/client/api/GetUserInfoTest.java b/jans-client-api/gen-client/src/test/java/io/swagger/client/api/GetUserInfoTest.java deleted file mode 100644 index 32fca182a4e..00000000000 --- a/jans-client-api/gen-client/src/test/java/io/swagger/client/api/GetUserInfoTest.java +++ /dev/null @@ -1,79 +0,0 @@ -package io.swagger.client.api; - -import io.swagger.client.ApiResponse; -import io.swagger.client.model.GetTokensByCodeParams; -import io.swagger.client.model.GetTokensByCodeResponse; -import io.swagger.client.model.GetUserInfoParams; -import io.swagger.client.model.RegisterSiteResponse; -import io.jans.ca.common.CoreUtils; -import org.testng.annotations.Parameters; -import org.testng.annotations.Test; - -import java.util.Map; - -import static io.swagger.client.api.Tester.*; -import static org.testng.Assert.*; - - -/** - * @author Yuriy Zabrovarnyy - * @author Shoeb - * @version 10/25/2018 - */ - -public class GetUserInfoTest { - - @Parameters({"opHost", "redirectUrls", "userId", "userSecret"}) - @Test - public void test(String opHost, String redirectUrls, String userId, String userSecret) throws Exception { - final DevelopersApi client = api(); - - final RegisterSiteResponse site = RegisterSiteTest.registerSite(client, opHost, redirectUrls); - final GetTokensByCodeResponse tokens = requestTokens(client, opHost, site, userId, userSecret, site.getClientId(), redirectUrls); - - final GetUserInfoParams params = new GetUserInfoParams(); - params.setRpId(site.getRpId()); - params.setAccessToken(tokens.getAccessToken()); - params.setIdToken(tokens.getIdToken()); - - final Map resp = client.getUserInfo(params, getAuthorization(site), null); - assertNotNull(resp); - assertFalse(resp.isEmpty()); - assertNotNull(resp.get("sub")); - } - - @Parameters({"opHost", "redirectUrls"}) - @Test(enabled = false) - public void testWithInvalidToken(String opHost, String redirectUrls) throws Exception { - final DevelopersApi client = api(); - - final RegisterSiteResponse site = RegisterSiteTest.registerSite(client, opHost, redirectUrls); - - final GetUserInfoParams params = new GetUserInfoParams(); - params.setRpId(site.getRpId()); - params.setAccessToken("blahBlah"); // invalid token - - final ApiResponse> apiResponse = client.getUserInfoWithHttpInfo(params, getAuthorization(site), null); - assertEquals(apiResponse.getStatusCode(), 200); // fixme should be 401 - - assertNotNull(apiResponse.getData()); - assertNull(apiResponse.getData().get("sub")); - } - - private GetTokensByCodeResponse requestTokens(DevelopersApi client, String opHost, RegisterSiteResponse site, String userId, String userSecret, String clientId, String redirectUrls) throws Exception { - - final String state = CoreUtils.secureRandomString(); - final String nonce = CoreUtils.secureRandomString(); - - final GetTokensByCodeParams params = new GetTokensByCodeParams(); - params.setRpId(site.getRpId()); - params.setCode(GetTokensByCodeTest.codeRequest(client, opHost, site.getRpId(), userId, userSecret, clientId, redirectUrls, state, nonce, getAuthorization(site))); - params.setState(state); - - final GetTokensByCodeResponse resp = client.getTokensByCode(params, getAuthorization(site), null); - assertNotNull(resp); - notEmpty(resp.getAccessToken()); - notEmpty(resp.getIdToken()); - return resp; - } -} diff --git a/jans-client-api/gen-client/src/test/java/io/swagger/client/api/IntrospectAccessTokenTest.java b/jans-client-api/gen-client/src/test/java/io/swagger/client/api/IntrospectAccessTokenTest.java deleted file mode 100644 index 73283c90039..00000000000 --- a/jans-client-api/gen-client/src/test/java/io/swagger/client/api/IntrospectAccessTokenTest.java +++ /dev/null @@ -1,124 +0,0 @@ -package io.swagger.client.api; - -import com.google.common.collect.Lists; -import io.swagger.client.ApiException; -import io.swagger.client.ApiResponse; -import io.swagger.client.model.*; -import org.testng.annotations.Parameters; -import org.testng.annotations.Test; - -import static org.testng.Assert.*; - -/** - * @author yuriyz - * @author Shoeb - */ -public class IntrospectAccessTokenTest extends BaseTestCase { - - @Parameters({"opHost", "redirectUrls"}) - @Test - public void introspectAccessToken(String opHost, String redirectUrls) throws Exception { - DevelopersApi client = Tester.api(); - RegisterSiteResponse setupResponse = RegisterSiteTest.registerSite(client, opHost, redirectUrls); - GetClientTokenResponse tokenResponse = getGetClientTokenResponseData(opHost, client, setupResponse); - assertNotNull(tokenResponse); - final String accessToken = tokenResponse.getAccessToken(); - Tester.notEmpty(accessToken); - IntrospectAccessTokenParams introspectParams = new IntrospectAccessTokenParams(); - introspectParams.setRpId(setupResponse.getRpId()); - introspectParams.setAccessToken(accessToken); - // - final String authorization = "Bearer " + accessToken; - final IntrospectAccessTokenResponse iaTokenResponse = client.introspectAccessToken(introspectParams, authorization, null); - assertNotNull(iaTokenResponse); - assertTrue(iaTokenResponse.isActive()); - assertNotNull(iaTokenResponse.getIat()); - assertNotNull(iaTokenResponse.getExp()); - assertTrue(iaTokenResponse.getExp() >= iaTokenResponse.getIat()); - final Long nbf = iaTokenResponse.getNbf(); - if (nbf != null) { - assertTrue(nbf > iaTokenResponse.getIat()); - assertTrue(nbf < iaTokenResponse.getExp()); - } - } - - /* - According to open id spec, introspect access token API, for authorized request with an invalid - token, should not throw an error but should return the client as inactive. - */ - @Parameters({"opHost", "redirectUrls"}) - @Test - @ProtectionAccessTokenRequired - public void testWithInvalidToken(String opHost, String redirectUrls) throws Exception { - DevelopersApi client = Tester.api(); - RegisterSiteResponse setupData = RegisterSiteTest.registerSite(client, opHost, redirectUrls); - - GetClientTokenResponse tokenResponse = getGetClientTokenResponseData(opHost, client, setupData); - assertNotNull(tokenResponse); - final String accessToken = tokenResponse.getAccessToken(); - final String validHeader = "Bearer " + accessToken; - final String invalidToken = accessToken.concat("BlahBlah"); - - IntrospectAccessTokenParams iatParams = new IntrospectAccessTokenParams(); - iatParams.setAccessToken(invalidToken); - iatParams.setRpId(setupData.getRpId()); - try { - IntrospectAccessTokenResponse resp = client.introspectAccessToken(iatParams, validHeader, null); - - if (!resp.isActive()) { - return; - } - } catch (ApiException e) { - assertEquals(400, e.getCode()); - return; - } - throw new AssertionError("Got response while we expect failure because there is not such token on the server."); - - // return back to it after oxd is switched to oxauth 3.1.5 or later, see https://github.com/GluuFederation/oxAuth/issues/929 -// ApiResponse apiIatResponse = client.introspectAccessTokenWithHttpInfo(validHeader, iatParams); -// assertEquals(apiIatResponse.getStatusCode(), 200); -// assertNotNull(apiIatResponse.getData()); -// // verify client is NOT active -// assertFalse(apiIatResponse.getData().isActive()); - } - - @Parameters({"opHost", "redirectUrls"}) - @Test - @ProtectionAccessTokenRequired - public void testWithInvalidAuthorization(String opHost, String redirectUrls) throws Exception { - - DevelopersApi client = Tester.api(); - RegisterSiteResponse setupResponse = RegisterSiteTest.registerSite(client, opHost, redirectUrls); - - GetClientTokenResponse tokenResponseData = getGetClientTokenResponseData(opHost, client, setupResponse); - IntrospectAccessTokenParams introspectParams = new IntrospectAccessTokenParams(); - introspectParams.setRpId(setupResponse.getRpId()); - introspectParams.setAccessToken(tokenResponseData.getAccessToken()); - - final String invalidAuthString = "Bearer NotAuthorized"; - ApiResponse introApiResponse = null; - try { - introApiResponse = client.introspectAccessTokenWithHttpInfo(introspectParams, invalidAuthString, null); - } catch (ApiException e) { - assertEquals(403, e.getCode()); - return; - } - - assertEquals(403, introApiResponse.getStatusCode()); - assertNotNull(introApiResponse.getData()); - assertNull(introApiResponse.getData().getClientId()); - } - - private static GetClientTokenResponse getGetClientTokenResponseData(String opHost, DevelopersApi client, - RegisterSiteResponse setupResponse) throws ApiException { - final GetClientTokenParams params = new GetClientTokenParams(); - params.setOpHost(opHost); - params.setScope(Lists.newArrayList("openid", "jans_client_api")); - params.setClientId(setupResponse.getClientId()); - params.setClientSecret(setupResponse.getClientSecret()); - - final GetClientTokenResponse clientTokenResponse = client.getClientToken(params); - assertNotNull(clientTokenResponse); - return clientTokenResponse; - } -} diff --git a/jans-client-api/gen-client/src/test/java/io/swagger/client/api/ProtectionAccessTokenRequired.java b/jans-client-api/gen-client/src/test/java/io/swagger/client/api/ProtectionAccessTokenRequired.java deleted file mode 100644 index 11f3c98d76f..00000000000 --- a/jans-client-api/gen-client/src/test/java/io/swagger/client/api/ProtectionAccessTokenRequired.java +++ /dev/null @@ -1,16 +0,0 @@ -package io.swagger.client.api; - -import java.lang.annotation.ElementType; -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; -import java.lang.annotation.Target; - -/** - * Used to skip the test if protection access token configuration is set to false - * - * @author Shoeb - */ -@Retention(RetentionPolicy.RUNTIME) -@Target(ElementType.METHOD) -public @interface ProtectionAccessTokenRequired { -} diff --git a/jans-client-api/gen-client/src/test/java/io/swagger/client/api/RegisterSiteTest.java b/jans-client-api/gen-client/src/test/java/io/swagger/client/api/RegisterSiteTest.java deleted file mode 100644 index 2ca843e14f9..00000000000 --- a/jans-client-api/gen-client/src/test/java/io/swagger/client/api/RegisterSiteTest.java +++ /dev/null @@ -1,186 +0,0 @@ -package io.swagger.client.api; - -import com.google.common.base.Strings; -import com.google.common.collect.Lists; -import io.swagger.client.ApiException; -import io.swagger.client.model.RegisterSiteParams; -import io.swagger.client.model.RegisterSiteResponse; -import io.swagger.client.model.UpdateSiteParams; -import io.swagger.client.model.UpdateSiteResponse; -import io.jans.as.model.common.GrantType; -import io.jans.ca.common.Jackson2; -import org.testng.annotations.Parameters; -import org.testng.annotations.Test; -import org.testng.collections.Maps; - -import java.util.ArrayList; -import java.util.Calendar; -import java.util.Map; - -import static io.swagger.client.api.Tester.*; -import static org.testng.Assert.*; - - -/** - * @author Yuriy Zabrovarnyy - * @author Shoeb Khan - * @version 11/07/2018 - */ - -@Test -public class RegisterSiteTest { - - private String rpId = null; - - @Parameters({"opHost", "redirectUrls", "logoutUrl", "postLogoutRedirectUrls", "clientJwksUri", "accessTokenSigningAlg"}) - @Test - public void register(String opHost, String redirectUrls, String logoutUrl, String postLogoutRedirectUrls, String clientJwksUri, String accessTokenSigningAlg) throws Exception { - DevelopersApi client = api(); - - registerSite(client, opHost, redirectUrls, logoutUrl, postLogoutRedirectUrls, clientJwksUri, accessTokenSigningAlg); - - } - - @Parameters({"opConfigurationEndpoint", "redirectUrls", "logoutUrl", "postLogoutRedirectUrls", "clientJwksUri", "accessTokenSigningAlg"}) - @Test - public void register_withOpConfigurationEndpoint(String opConfigurationEndpoint, String redirectUrls, String logoutUrl, String postLogoutRedirectUrls, String clientJwksUri, String accessTokenSigningAlg) throws Exception { - DevelopersApi client = api(); - // more specific site registration - final RegisterSiteParams params = new RegisterSiteParams(); - params.setOpConfigurationEndpoint(opConfigurationEndpoint); - params.setPostLogoutRedirectUris(Lists.newArrayList(postLogoutRedirectUrls.split(" "))); - params.setClientFrontchannelLogoutUri(logoutUrl); - params.setRedirectUris(Lists.newArrayList(redirectUrls.split(" "))); - params.setAcrValues(new ArrayList<>()); - params.setScope(Lists.newArrayList("openid", "profile")); - params.setGrantTypes(Lists.newArrayList("authorization_code")); - params.setResponseTypes(Lists.newArrayList("code")); - - params.setLogoUri("https://client.example.org/logo.png"); - params.setClientUri("https://client.example.org/authorization/page3"); - params.setPolicyUri("https://client.example.org/authorization/page3"); - params.setFrontChannelLogoutSessionRequired(true); - params.setTosUri("https://localhost:5053/authorization/page3"); - params.setJwks("{\"key1\": \"value1\", \"key2\": \"value2\"}"); - params.setIdTokenBindingCnf("4NRB1-0XZABZI9E6-5SM3R"); - params.setTlsClientAuthSubjectDn("www.test.com"); - params.setDefaultMaxAge(100000000); - params.setRequireAuthTime(true); - params.setInitiateLoginUri("https://client.example.org/authorization/page2"); - params.setAuthorizedOrigins(Lists.newArrayList("beem://www.test.com", "fb://app.local.url")); - params.setAccessTokenLifetime(100000000); - params.setSoftwareId("4NRB1-0XZABZI9E6-5SM3R"); - params.setSoftwareVersion("2.0"); - - Map customAttributes = Maps.newHashMap(); - customAttributes.put("attr1", "val1"); - customAttributes.put("attr2", "val2"); - - params.setCustomAttributes(customAttributes); - - params.setIdTokenSignedResponseAlg("HS256"); - params.setIdTokenEncryptedResponseAlg("RSA1_5"); - params.setIdTokenEncryptedResponseEnc("A128CBC+HS256"); - params.setUserInfoSignedResponseAlg("HS256"); - params.setUserInfoEncryptedResponseAlg("RSA1_5"); - params.setUserInfoEncryptedResponseEnc("A128CBC+HS256"); - params.setRequestObjectSigningAlg("HS256"); - params.setRequestObjectEncryptionAlg("RSA1_5"); - params.setRequestObjectEncryptionEnc("A128CBC+HS256"); - - final RegisterSiteResponse resp = client.registerSite(params); - assertNotNull(resp); - assertNotNull(resp.getRpId()); - rpId = resp.getRpId(); - } - - @Test(dependsOnMethods = {"register"}) - public void update() throws Exception { - notEmpty(rpId); - Calendar calendar = Calendar.getInstance(); - calendar.add(Calendar.DAY_OF_YEAR, 1); - - // more specific site registration - final UpdateSiteParams params = new UpdateSiteParams(); - params.setRpId(rpId); - params.setScope(Lists.newArrayList("profile", "jans_client_api")); - - UpdateSiteResponse resp = api().updateSite(params, getAuthorization(), null); - assertNotNull(resp); - } - - public static RegisterSiteResponse registerSite(DevelopersApi apiClient, String opHost, String redirectUrls) throws Exception { - return registerSite(apiClient, opHost, redirectUrls, redirectUrls, "", "", ""); - } - - public static RegisterSiteResponse registerSite(DevelopersApi apiClient, String opHost, String redirectUrls, String logoutUri, String postLogoutRedirectUrls, String clientJwksUri, String accessTokenSigningAlg) throws Exception { - - final RegisterSiteParams params = new RegisterSiteParams(); - params.setOpHost(opHost); - params.setRedirectUris(Lists.newArrayList(redirectUrls.split(" "))); - params.setPostLogoutRedirectUris(Lists.newArrayList(postLogoutRedirectUrls.split(" "))); - params.setClientFrontchannelLogoutUri(logoutUri.split(" ")[0]); - params.setScope(Lists.newArrayList("openid", "uma_protection", "profile", "jans_client_api")); - params.setGrantTypes(Lists.newArrayList( - GrantType.AUTHORIZATION_CODE.getValue(), - GrantType.OXAUTH_UMA_TICKET.getValue(), - GrantType.CLIENT_CREDENTIALS.getValue())); - params.setClientJwksUri(clientJwksUri); - params.setResponseTypes(Lists.newArrayList("code", "id_token", "token")); - params.setAccessTokenSigningAlg(accessTokenSigningAlg); - final RegisterSiteResponse resp = apiClient.registerSite(params); - assertNotNull(resp); - assertTrue(!Strings.isNullOrEmpty(resp.getRpId())); - return resp; - } - - public static RegisterSiteResponse registerSite_withAuthenticationMethod(DevelopersApi apiClient, String opHost, String redirectUrls, String logoutUri, String postLogoutRedirectUrls, String algorithm, String authenticationMethod) throws Exception { - - final RegisterSiteParams params = new RegisterSiteParams(); - params.setOpHost(opHost); - params.setRedirectUris(Lists.newArrayList(redirectUrls.split(" "))); - params.setPostLogoutRedirectUris(Lists.newArrayList(postLogoutRedirectUrls.split(" "))); - params.setClientFrontchannelLogoutUri(logoutUri.split(" ")[0]); - params.setScope(Lists.newArrayList("openid", "uma_protection", "profile", "jans_client_api")); - params.setGrantTypes(Lists.newArrayList( - GrantType.AUTHORIZATION_CODE.getValue(), - GrantType.OXAUTH_UMA_TICKET.getValue(), - GrantType.CLIENT_CREDENTIALS.getValue())); - params.setResponseTypes(Lists.newArrayList("code", "id_token", "token")); - params.setIdTokenSignedResponseAlg(algorithm); - params.setClientTokenEndpointAuthSigningAlg(algorithm); - params.setClientTokenEndpointAuthMethod(authenticationMethod); - params.setJwks(Jackson2.asJson(apiClient.getRpJwks())); - final RegisterSiteResponse resp = apiClient.registerSite(params); - assertNotNull(resp); - assertTrue(!Strings.isNullOrEmpty(resp.getRpId())); - return resp; - } - - @Parameters({"opHost", "redirectUrls", "postLogoutRedirectUrls", "clientJwksUri"}) - @Test - public void registerWithInvalidAlgorithm(String opHost, String redirectUrls, String postLogoutRedirectUrls, String clientJwksUri) { - - final DevelopersApi client = api(); - - final RegisterSiteParams params = new RegisterSiteParams(); - params.setOpHost(opHost); - params.setRedirectUris(Lists.newArrayList(redirectUrls.split(" "))); - params.setPostLogoutRedirectUris(Lists.newArrayList(postLogoutRedirectUrls.split(" "))); - params.setScope(Lists.newArrayList("openid", "uma_protection", "profile", "jans_client_api")); - params.setGrantTypes(Lists.newArrayList( - GrantType.AUTHORIZATION_CODE.getValue(), - GrantType.OXAUTH_UMA_TICKET.getValue(), - GrantType.CLIENT_CREDENTIALS.getValue())); - params.setClientJwksUri(clientJwksUri); - params.setAccessTokenSigningAlg("blahBlah"); - - try { - client.registerSite(params); - } catch (ApiException ex) { - assertEquals(ex.getCode(), 400); //BAD Request - } - - } - -} diff --git a/jans-client-api/gen-client/src/test/java/io/swagger/client/api/RemoveSiteTest.java b/jans-client-api/gen-client/src/test/java/io/swagger/client/api/RemoveSiteTest.java deleted file mode 100644 index 662feabba48..00000000000 --- a/jans-client-api/gen-client/src/test/java/io/swagger/client/api/RemoveSiteTest.java +++ /dev/null @@ -1,48 +0,0 @@ -package io.swagger.client.api; - -import io.swagger.client.ApiException; -import io.swagger.client.model.RegisterSiteResponse; -import io.swagger.client.model.RemoveSiteParams; -import io.swagger.client.model.RemoveSiteResponse; -import org.apache.commons.lang.StringUtils; -import org.testng.annotations.Parameters; -import org.testng.annotations.Test; -import io.jans.ca.common.ErrorResponseCode; - -import java.util.UUID; - -import static org.testng.Assert.*; - -public class RemoveSiteTest { - - @Test - @Parameters({"opHost", "redirectUrls"}) - public void testRemoveSite(String opHost, String redirectUrls) throws Exception { - final DevelopersApi api = Tester.api(); - RegisterSiteResponse response = RegisterSiteTest.registerSite(api, opHost, redirectUrls); - - RemoveSiteParams params = new RemoveSiteParams(); - params.setRpId(response.getRpId()); - - RemoveSiteResponse removeResponse = api.removeSite(params, Tester.getAuthorization(response), null); - assertNotNull(removeResponse); - assertTrue(StringUtils.isNotEmpty(removeResponse.getRpId())); - } - - @Test - public void testRemoveSiteWithInvalidRpId() throws Exception { - final String someRandomId = UUID.randomUUID().toString(); - final DevelopersApi api = Tester.api(); - - RemoveSiteParams params = new RemoveSiteParams(); - params.setRpId(someRandomId); - try { - api.removeSite(params, Tester.getAuthorization(), null); - } catch (ApiException e) { - assertEquals(e.getCode(), 400); - assertEquals(Tester.asError(e).getError(), ErrorResponseCode.INVALID_RP_ID.getCode()); - return; - } - throw new AssertionError("Expected 400 error but got successful result."); - } -} diff --git a/jans-client-api/gen-client/src/test/java/io/swagger/client/api/RpGetRptTest.java b/jans-client-api/gen-client/src/test/java/io/swagger/client/api/RpGetRptTest.java deleted file mode 100644 index 615c2a1cdbf..00000000000 --- a/jans-client-api/gen-client/src/test/java/io/swagger/client/api/RpGetRptTest.java +++ /dev/null @@ -1,80 +0,0 @@ -package io.swagger.client.api; - -import io.swagger.client.model.RegisterSiteResponse; -import io.swagger.client.model.UmaRpGetRptParams; -import io.swagger.client.model.UmaRpGetRptResponse; -import io.swagger.client.model.UmaRsCheckAccessResponse; -import org.apache.commons.lang.StringUtils; -import org.testng.annotations.Parameters; -import org.testng.annotations.Test; - -import static io.swagger.client.api.Tester.api; -import static org.apache.commons.lang.StringUtils.isNotBlank; -import static org.testng.Assert.*; - -/** - * @author Yuriy Zabrovarnyy - * @author Shoeb - * - * @version 11/03/2018 - */ - -public class RpGetRptTest { - - @Parameters({"opHost", "redirectUrls", "rsProtect"}) - @Test - public void test(String opHost, String redirectUrls, String rsProtect) throws Exception { - - final DevelopersApi client = api(); - - final RegisterSiteResponse site = RegisterSiteTest.registerSite(client, opHost, redirectUrls); - final UmaRpGetRptResponse response = requestRpt(client, site, rsProtect); - - assertNotNull(response); - - } - - - @Parameters({"opHost", "redirectUrls", "rsProtect"}) - @Test - public void testWithSameRpt(String opHost, String redirectUrls, String rsProtect) throws Exception { - - final DevelopersApi client = api(); - - final RegisterSiteResponse site = RegisterSiteTest.registerSite(client, opHost, redirectUrls); - final UmaRpGetRptResponse firstResponse = requestRpt(client, site, rsProtect); - - final UmaRsCheckAccessResponse checkAccess = RsCheckAccessTest.checkAccess(client, site, null); - - final UmaRpGetRptParams params = new UmaRpGetRptParams(); - params.setRpId(site.getRpId()); - params.setTicket(checkAccess.getTicket()); - params.setRpt(firstResponse.getAccessToken()); - - final UmaRpGetRptResponse secondResponse = client.umaRpGetRpt(params, Tester.getAuthorization(site), null); - - assertNotNull(secondResponse); - assertEquals(secondResponse.getAccessToken(), firstResponse.getAccessToken()); - assertFalse(firstResponse.isUpdated()); - assertTrue(secondResponse.isUpdated()); - - } - - - private static UmaRpGetRptResponse requestRpt(DevelopersApi client, RegisterSiteResponse site, String rsProtect) throws Exception { - RsProtectTest.protectResources(client, site, UmaFullTest.resourceList(rsProtect)); - - final UmaRsCheckAccessResponse checkAccess = RsCheckAccessTest.checkAccess(client, site, null); - - final UmaRpGetRptParams params = new UmaRpGetRptParams(); - params.setRpId(site.getRpId()); - params.setTicket(checkAccess.getTicket()); - - final UmaRpGetRptResponse response = client.umaRpGetRpt(params, Tester.getAuthorization(site), null); - - assertNotNull(response); - assertTrue(isNotBlank(response.getAccessToken())); - assertTrue(isNotBlank(response.getPct())); - return response; - } -} diff --git a/jans-client-api/gen-client/src/test/java/io/swagger/client/api/RsCheckAccessTest.java b/jans-client-api/gen-client/src/test/java/io/swagger/client/api/RsCheckAccessTest.java deleted file mode 100644 index 217e1bf5aa5..00000000000 --- a/jans-client-api/gen-client/src/test/java/io/swagger/client/api/RsCheckAccessTest.java +++ /dev/null @@ -1,101 +0,0 @@ -package io.swagger.client.api; - -import io.swagger.client.ApiResponse; -import io.swagger.client.model.RegisterSiteResponse; -import io.swagger.client.model.UmaRsCheckAccessParams; -import io.swagger.client.model.UmaRsCheckAccessResponse; -import org.apache.commons.lang.StringUtils; -import org.testng.annotations.Parameters; -import org.testng.annotations.Test; -import org.testng.collections.Lists; - -import java.util.List; - -import static io.swagger.client.api.Tester.api; -import static org.testng.Assert.*; -import static org.testng.AssertJUnit.assertTrue; - - -/** - * @author Yuriy Zabrovarnyy - * @author Shoeb - * - * @version 11/02/2018 - */ - -public class RsCheckAccessTest { - - @Parameters({"opHost", "redirectUrls", "rsProtect"}) - @Test - public void withoutScopes_shouldPass(String opHost, String redirectUrls, String rsProtect) throws Exception { - - final DevelopersApi client = api(); - - final RegisterSiteResponse site = RegisterSiteTest.registerSite(client, opHost, redirectUrls); - - RsProtectTest.protectResources(client, site, UmaFullTest.resourceList(rsProtect)); - - checkAccess(client, site, null); - } - - @Parameters({"opHost", "redirectUrls", "rsProtect"}) - @Test - public void withCorrectScopes_shouldPass(String opHost, String redirectUrls, String rsProtect) throws Exception { - - final DevelopersApi client = api(); - - final RegisterSiteResponse site = RegisterSiteTest.registerSite(client, opHost, redirectUrls); - - RsProtectTest.protectResources(client, site, UmaFullTest.resourceList(rsProtect)); - - checkAccess(client, site, Lists.newArrayList("http://photoz.example.com/dev/actions/all","http://photoz.example.com/dev/actions/view")); - } - - @Parameters({"opHost", "redirectUrls", "rsProtect"}) - @Test - public void withIncorrectScopes_shouldThrowException(String opHost, String redirectUrls, String rsProtect) throws Exception { - - final DevelopersApi client = api(); - - final RegisterSiteResponse site = RegisterSiteTest.registerSite(client, opHost, redirectUrls); - - RsProtectTest.protectResources(client, site, UmaFullTest.resourceList(rsProtect)); - - checkAccessWithIncorrectScopes(client, site, Lists.newArrayList("/dev/actions/all","/dev/actions/view")); - } - - public static UmaRsCheckAccessResponse checkAccess(DevelopersApi client, RegisterSiteResponse site, List scopeList) throws Exception { - final UmaRsCheckAccessParams params = new UmaRsCheckAccessParams(); - params.setRpId(site.getRpId()); - params.setHttpMethod("GET"); - params.setPath("/ws/phone"); - params.setRpt("dummy"); - params.setScopes(scopeList); - - final ApiResponse apiResp = client.umaRsCheckAccessWithHttpInfo(params, Tester.getAuthorization(site), null); - - assertEquals(apiResp.getStatusCode(), 200) ; //fixme should be 401 - assertNotNull(apiResp.getData()); - assertTrue(StringUtils.isNotBlank(apiResp.getData().getAccess())); - - return apiResp.getData(); - } - - public static void checkAccessWithIncorrectScopes(DevelopersApi client, RegisterSiteResponse site, List scopeList) throws Exception { - final UmaRsCheckAccessParams params = new UmaRsCheckAccessParams(); - params.setRpId(site.getRpId()); - params.setHttpMethod("GET"); - params.setPath("/ws/phone"); - params.setRpt("dummy"); - params.setScopes(scopeList); - - try { - client.umaRsCheckAccessWithHttpInfo(params, Tester.getAuthorization(site), null); - assertTrue(false); - - } catch (Exception e) { - //test-case passed - } - - } -} diff --git a/jans-client-api/gen-client/src/test/java/io/swagger/client/api/RsModifyTest.java b/jans-client-api/gen-client/src/test/java/io/swagger/client/api/RsModifyTest.java deleted file mode 100644 index 48d4e6c1cda..00000000000 --- a/jans-client-api/gen-client/src/test/java/io/swagger/client/api/RsModifyTest.java +++ /dev/null @@ -1,70 +0,0 @@ -package io.swagger.client.api; - -import io.swagger.client.model.RegisterSiteResponse; -import io.swagger.client.model.RsResource; -import io.swagger.client.model.UmaRsModifyParams; -import io.swagger.client.model.UmaRsModifyResponse; -import io.jans.ca.common.Jackson2; -import org.testng.annotations.Parameters; -import org.testng.annotations.Test; -import org.testng.collections.Lists; - -import java.util.List; - -import static io.swagger.client.api.Tester.api; -import static io.swagger.client.api.Tester.getAuthorization; -import static org.testng.Assert.assertNotNull; - -public class RsModifyTest { - @Parameters({"redirectUrls", "opHost", "rsProtect"}) - @Test - public void protect(String redirectUrls, String opHost, String rsProtect) throws Exception { - - final DevelopersApi client = api(); - - final RegisterSiteResponse site = RegisterSiteTest.registerSite(client, opHost, redirectUrls); - - RsProtectTest.protectResources(client, site, UmaFullTest.resourceList(rsProtect)); - RsCheckAccessTest.checkAccess(client, site, null); - modifyResourcesWithScopes(client, site, UmaFullTest.resourceList(rsProtect)); - - } - - @Parameters({"redirectUrls", "opHost", "rsProtectScopeExpression", "correctScopeExpression"}) - @Test - public void protectWithScopeExpression(String redirectUrls, String opHost, String rsProtectScopeExpression, String correctScopeExpression) throws Exception { - final DevelopersApi client = api(); - - final RegisterSiteResponse site = RegisterSiteTest.registerSite(client, opHost, redirectUrls); - - RsProtectTest.protectResources(client, site, UmaFullTest.resourceList(rsProtectScopeExpression)); - RsCheckAccessTest.checkAccess(client, site, null); - modifyResourcesWithScopeExpression(client, site, UmaFullTest.resourceList(rsProtectScopeExpression), correctScopeExpression); - - } - - public static UmaRsModifyResponse modifyResourcesWithScopes(DevelopersApi client, RegisterSiteResponse site, List resources) throws Exception { - final UmaRsModifyParams params = new UmaRsModifyParams(); - params.setRpId(site.getRpId()); - RsResource rsResource = Jackson2.createJsonMapper().convertValue(resources.get(0), RsResource.class); - params.setHttpMethod(rsResource.getConditions().get(0).getHttpMethods().get(0)); - params.setPath(rsResource.getPath()); - params.setScopes(Lists.newArrayList("http://photoz.example.com/dev/actions/see")); - - final UmaRsModifyResponse resp = client.umaRsModify(params, getAuthorization(site), null); - assertNotNull(resp.getRpId()); - return resp; - } - - public static UmaRsModifyResponse modifyResourcesWithScopeExpression(DevelopersApi client, RegisterSiteResponse site, List resources, String correctScopeExpression) throws Exception { - final UmaRsModifyParams params = new UmaRsModifyParams(); - params.setRpId(site.getRpId()); - params.setHttpMethod("GET"); - params.setPath("/ws/phone"); - params.setScopeExpression(correctScopeExpression.replaceAll("'", "\"")); - - final UmaRsModifyResponse resp = client.umaRsModify(params, getAuthorization(site), null); - assertNotNull(resp.getRpId()); - return resp; - } -} diff --git a/jans-client-api/gen-client/src/test/java/io/swagger/client/api/RsProtectTest.java b/jans-client-api/gen-client/src/test/java/io/swagger/client/api/RsProtectTest.java deleted file mode 100644 index d5386e1ba67..00000000000 --- a/jans-client-api/gen-client/src/test/java/io/swagger/client/api/RsProtectTest.java +++ /dev/null @@ -1,135 +0,0 @@ -package io.swagger.client.api; - -import io.swagger.client.ApiException; -import io.swagger.client.ApiResponse; -import io.swagger.client.model.*; -import org.apache.commons.lang.StringUtils; -import org.testng.annotations.Parameters; -import org.testng.annotations.Test; - -import java.util.List; - -import static io.swagger.client.api.Tester.api; -import static io.swagger.client.api.Tester.getAuthorization; -import static org.testng.Assert.*; - -/** - * @author Yuriy Zabrovarnyy - * @author Shoeb - * @version 11/08/2018 - */ -public class RsProtectTest { - - @Parameters({"redirectUrls", "opHost", "rsProtect"}) - @Test - public void protect(String redirectUrls, String opHost, String rsProtect) throws Exception { - - final DevelopersApi client = api(); - - final RegisterSiteResponse site = RegisterSiteTest.registerSite(client, opHost, redirectUrls); - - protectResources(client, site, UmaFullTest.resourceList(rsProtect)); - RsCheckAccessTest.checkAccess(client, site, null); - - } - - @Parameters({"redirectUrls", "opHost", "rsProtectWithCreationExpiration"}) - @Test - public void protect_withResourceCreationExpiration(String redirectUrls, String opHost, String rsProtectWithCreationExpiration) throws Exception { - - final DevelopersApi client = api(); - - final RegisterSiteResponse site = RegisterSiteTest.registerSite(client, opHost, redirectUrls); - - protectResources(client, site, UmaFullTest.resourceList(rsProtectWithCreationExpiration)); - RsCheckAccessTest.checkAccess(client, site, null); - - } - - @Parameters({"redirectUrls", "opHost", "rsProtect"}) - @Test - public void overwriteFalse(String redirectUrls, String opHost, String rsProtect) throws Exception { - final DevelopersApi client = api(); - - final RegisterSiteResponse site = RegisterSiteTest.registerSite(client, opHost, redirectUrls); - - final List resources = UmaFullTest.resourceList(rsProtect); - protectResources(client, site, resources); - - final UmaRsProtectParams params = new UmaRsProtectParams(); - params.setRpId(site.getRpId()); - - params.setResources(resources); - - try { - final ApiResponse response = client.umaRsProtectWithHttpInfo(params, getAuthorization(site), null); - assertEquals(response.getStatusCode(), 400); - } catch (ApiException ex) { - assertEquals(ex.getCode(), 400); - } - - } - - @Parameters({"redirectUrls", "opHost", "rsProtect"}) - @Test - public void overwriteTrue(String redirectUrls, String opHost, String rsProtect) throws Exception { - final DevelopersApi client = api(); - - final RegisterSiteResponse site = RegisterSiteTest.registerSite(client, opHost, redirectUrls); - - final List resources = UmaFullTest.resourceList(rsProtect); - protectResources(client, site, resources); - - final UmaRsProtectParams params = new UmaRsProtectParams(); - params.setRpId(site.getRpId()); - params.setResources(resources); - params.setOverwrite(true); // force overwrite - - final UmaRsProtectResponse response = client.umaRsProtect(params, getAuthorization(site), null); - assertNotNull(response); - } - - @Parameters({"redirectUrls", "opHost", "rsProtectScopeExpression"}) - @Test - public void protectWithScopeExpression(String redirectUrls, String opHost, String rsProtectScopeExpression) throws Exception { - final DevelopersApi client = api(); - - final RegisterSiteResponse site = RegisterSiteTest.registerSite(client, opHost, redirectUrls); - - protectResources(client, site, UmaFullTest.resourceList(rsProtectScopeExpression)); - - RsCheckAccessTest.checkAccess(client, site, null); - - } - - @Parameters({"redirectUrls", "opHost", "rsProtectScopeExpressionSecond"}) - @Test - public void protectWithScopeExpressionSeconds(String redirectUrls, String opHost, String rsProtectScopeExpressionSecond) throws Exception { - final DevelopersApi client = api(); - - final RegisterSiteResponse site = RegisterSiteTest.registerSite(client, opHost, redirectUrls); - - protectResources(client, site, UmaFullTest.resourceList(rsProtectScopeExpressionSecond)); - - final UmaRsCheckAccessParams params = new UmaRsCheckAccessParams(); - params.setRpId(site.getRpId()); - params.setHttpMethod("GET"); - params.setPath("/GetAll"); - params.setRpt(""); - - final UmaRsCheckAccessResponse response = client.umaRsCheckAccess(params, getAuthorization(site), null); - - assertNotNull(response); - assertTrue(StringUtils.isNotBlank(response.getAccess())); - } - - public static UmaRsProtectResponse protectResources(DevelopersApi client, RegisterSiteResponse site, List resources) throws Exception { - final UmaRsProtectParams params = new UmaRsProtectParams(); - params.setRpId(site.getRpId()); - params.setResources(resources); - - final UmaRsProtectResponse resp = client.umaRsProtect(params, getAuthorization(site), null); - assertNotNull(resp); - return resp; - } -} diff --git a/jans-client-api/gen-client/src/test/java/io/swagger/client/api/SetUpTest.java b/jans-client-api/gen-client/src/test/java/io/swagger/client/api/SetUpTest.java deleted file mode 100644 index 88ff0201fb5..00000000000 --- a/jans-client-api/gen-client/src/test/java/io/swagger/client/api/SetUpTest.java +++ /dev/null @@ -1,46 +0,0 @@ -package io.swagger.client.api; - -import com.google.common.base.Preconditions; -import io.swagger.client.model.RegisterSiteResponse; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.testng.annotations.BeforeSuite; -import org.testng.annotations.Parameters; - -/** - * Main class to set up and tear down suite. - * - * @author Yuriy Zabrovarnyy - * @version 0.9, 21/08/2013 - */ - -public class SetUpTest { - - private static final Logger LOG = LoggerFactory.getLogger(SetUpTest.class); - - @Parameters({"host", "opHost", "redirectUrls"}) - @BeforeSuite - public static void beforeSuite(String host, String opHost, String redirectUrls) { - try { - LOG.debug("Running beforeSuite ..."); - Tester.setHost(host); - Tester.setOpHost(opHost); - - RegisterSiteResponse clientSetupInfo = RegisterSiteTest.registerSite(Tester.api(), opHost, redirectUrls); - Tester.setSetupData(clientSetupInfo); - - Preconditions.checkNotNull(Tester.getAuthorization()); - LOG.debug("Tester's authorization is set."); - - LOG.debug("Finished beforeSuite!"); - } catch (Exception e) { - LOG.error("Failed to start swagger suite.", e); - throw new AssertionError("Failed to start suite."); - } - } - - public static void setTokenProtectionEnabled(Boolean isTokenProtectionEnabled) { - Tester.setTokenProtectionEnabled(isTokenProtectionEnabled); - } - -} diff --git a/jans-client-api/gen-client/src/test/java/io/swagger/client/api/TestMethodListener.java b/jans-client-api/gen-client/src/test/java/io/swagger/client/api/TestMethodListener.java deleted file mode 100644 index 28779bf914b..00000000000 --- a/jans-client-api/gen-client/src/test/java/io/swagger/client/api/TestMethodListener.java +++ /dev/null @@ -1,36 +0,0 @@ -package io.swagger.client.api; - -import org.testng.IInvokedMethod; -import org.testng.IInvokedMethodListener; -import org.testng.ITestResult; -import org.testng.SkipException; - -import java.lang.reflect.Method; - -/** - * Listener class to be attached to test classes to augment test ng behavior - * - * @author Shoeb - */ -public class TestMethodListener implements IInvokedMethodListener { - - @Override - public void beforeInvocation(IInvokedMethod iInvokedMethod, ITestResult iTestResult) { - Method method = iTestResult.getMethod().getConstructorOrMethod().getMethod(); - if (method == null) { - return; - } - if (method.isAnnotationPresent(ProtectionAccessTokenRequired.class)) { - if (!Tester.isTokenProtectionEnabled()) { - iTestResult.setStatus(ITestResult.SKIP); - throw new SkipException("Skipping the test as protection access token is not enabled. Ignore the exception."); - } - } - } - - @Override - public void afterInvocation(IInvokedMethod iInvokedMethod, ITestResult iTestResult) { - - } - -} diff --git a/jans-client-api/gen-client/src/test/java/io/swagger/client/api/Tester.java b/jans-client-api/gen-client/src/test/java/io/swagger/client/api/Tester.java deleted file mode 100644 index 48fc01f7600..00000000000 --- a/jans-client-api/gen-client/src/test/java/io/swagger/client/api/Tester.java +++ /dev/null @@ -1,122 +0,0 @@ -package io.swagger.client.api; - -import com.google.common.base.Preconditions; -import com.google.common.base.Strings; -import com.google.common.collect.Lists; -import io.swagger.client.ApiClient; -import io.swagger.client.ApiException; -import io.swagger.client.model.GetClientTokenParams; -import io.swagger.client.model.GetClientTokenResponse; -import io.swagger.client.model.RegisterSiteResponse; -import io.jans.ca.common.ErrorResponse; -import io.jans.ca.common.Jackson2; - -import java.io.IOException; -import java.util.List; -import java.util.concurrent.TimeUnit; - -import static org.testng.Assert.assertTrue; -import static org.testng.AssertJUnit.assertNotNull; - - -/** - * @author yuriyz - */ -public class Tester { - - private static String AUTHORIZATION = ""; - private static String HOST; - private static String OP_HOST; - private static RegisterSiteResponse setupData; - private static boolean isTokenProtectionEnabled = false; - - private Tester() { - } - - public static DevelopersApi api() { - ApiClient apiClient = new ApiClient(); - apiClient.setBasePath(HOST); - - apiClient.setVerifyingSsl(false); - apiClient.setDebugging(true); - apiClient.getHttpClient().setConnectTimeout(10, TimeUnit.SECONDS); - - return new DevelopersApi(apiClient); - } - - public static void notEmpty(String str) { - assertTrue(str != null && !str.isEmpty()); - } - - public static void notEmpty(List str) { - assertTrue(str != null && !str.isEmpty() && str.get(0) != null && !str.get(0).isEmpty()); - } - - public static String getAuthorization() throws Exception { - Preconditions.checkNotNull(setupData); - if (Strings.isNullOrEmpty(AUTHORIZATION)) { - AUTHORIZATION = getAuthorization(setupData); - } - return AUTHORIZATION; - } - - /** - * Tests requiring register site operation to be performed before their execution better call this method instead of the overloaded no-arg method. - * This ensures, a new access token is generated for the new client site. - * - * Note:- This IS a requirement in case value of protect_commands_with_access_token is set to true in server configuration. - * - * @param siteResponseData - * @return access token for the provided site's client id - * @throws ApiException - */ - public static String getAuthorization(RegisterSiteResponse siteResponseData) throws ApiException { - final GetClientTokenParams params = new GetClientTokenParams(); - params.setOpHost(siteResponseData.getOpHost()); - params.setScope(Lists.newArrayList("openid", "jans_client_api")); - params.setClientId(siteResponseData.getClientId()); - params.setClientSecret(siteResponseData.getClientSecret()); - - GetClientTokenResponse resp = api().getClientToken(params); - assertNotNull(resp); - assertTrue(!Strings.isNullOrEmpty(resp.getAccessToken())); - - return "Bearer " + resp.getAccessToken(); - } - - public static String getHost() { - return HOST; - } - - public static void setHost(String host) { - HOST = host; - } - - public static void setOpHost(String opHost) { - OP_HOST = opHost; - } - - public static void setSetupData(RegisterSiteResponse setupData) { - Tester.setupData = setupData; - } - - public static void setTokenProtectionEnabled(Boolean isTokenProtectionEnabled) { - Tester.isTokenProtectionEnabled = isTokenProtectionEnabled; - } - - public static RegisterSiteResponse getSetupData() { - return setupData; - } - - public static Boolean isTokenProtectionEnabled() { - return isTokenProtectionEnabled; - } - - public static ErrorResponse asError(String entity) throws IOException { - return Jackson2.createJsonMapper().readValue(entity, ErrorResponse.class); - } - - public static ErrorResponse asError(ApiException e) throws IOException { - return asError(e.getResponseBody()); - } -} diff --git a/jans-client-api/gen-client/src/test/java/io/swagger/client/api/UmaFullTest.java b/jans-client-api/gen-client/src/test/java/io/swagger/client/api/UmaFullTest.java deleted file mode 100644 index f9ecb9ddeb9..00000000000 --- a/jans-client-api/gen-client/src/test/java/io/swagger/client/api/UmaFullTest.java +++ /dev/null @@ -1,119 +0,0 @@ -package io.swagger.client.api; - -import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.ObjectMapper; -import io.swagger.client.ApiException; -import io.swagger.client.model.RegisterSiteResponse; -import io.swagger.client.model.RsResource; -import io.swagger.client.model.UmaRpGetRptParams; -import io.swagger.client.model.UmaRpGetRptResponse; -import io.swagger.client.model.UmaRsCheckAccessResponse; -import io.jans.ca.common.Jackson2; -import org.testng.annotations.Parameters; -import org.testng.annotations.Test; - -import java.io.IOException; -import java.util.ArrayList; -import java.util.List; -import java.util.UUID; - -import static io.swagger.client.api.Tester.api; -import static org.apache.commons.lang.StringUtils.isNotBlank; -import static org.apache.commons.lang.StringUtils.replace; -import static org.testng.Assert.*; - -/** - * @author Yuriy Zabrovarnyy - * @author Shoeb - * - * @version 11/08/2018 - */ - -public class UmaFullTest { - - @Parameters({"redirectUrls", "opHost", "rsProtect"}) - @Test - public void test(String redirectUrls, String opHost, String rsProtect) throws Exception { - - final DevelopersApi client = api(); - - final RegisterSiteResponse site = RegisterSiteTest.registerSite(client, opHost, redirectUrls); - - RsProtectTest.protectResources(client, site, UmaFullTest.resourceList(rsProtect)); - - final UmaRsCheckAccessResponse checkAccess = RsCheckAccessTest.checkAccess(client, site, null); - - final UmaRpGetRptParams params = new UmaRpGetRptParams(); - params.setRpId(site.getRpId()); - params.setTicket(checkAccess.getTicket()); - - final UmaRpGetRptResponse response = client.umaRpGetRpt(params, Tester.getAuthorization(site), null); - - assertNotNull(response); - - assertTrue(isNotBlank(response.getAccessToken())); - assertTrue(isNotBlank(response.getPct())); - } - - @Parameters({"redirectUrls", "opHost", "rsProtect"}) - @Test - public void testWithInvalidTicket(String redirectUrls, String opHost, String rsProtect) throws Exception { - - final DevelopersApi client = api(); - - final RegisterSiteResponse site = RegisterSiteTest.registerSite(client, opHost, redirectUrls); - - RsProtectTest.protectResources(client, site, UmaFullTest.resourceList(rsProtect)); - - final UmaRpGetRptParams params = new UmaRpGetRptParams(); - params.setRpId(site.getRpId()); - params.setTicket(UUID.randomUUID().toString()); - - try { - client.umaRpGetRpt(params, Tester.getAuthorization(site), null); - } catch (ApiException ex) { - assertEquals(ex.getCode(), 400); // BAD REQUEST - } - - } - - - @Parameters({"redirectUrls", "opHost", "rsProtect"}) - @Test - public void testWithClaimTokenButNoTokenFormat(String redirectUrls, String opHost, String rsProtect) throws Exception { - - final DevelopersApi client = api(); - - final RegisterSiteResponse site = RegisterSiteTest.registerSite(client, opHost, redirectUrls); - - RsProtectTest.protectResources(client, site, UmaFullTest.resourceList(rsProtect)); - - final UmaRsCheckAccessResponse checkAccess = RsCheckAccessTest.checkAccess(client, site, null); - - final UmaRpGetRptParams params = new UmaRpGetRptParams(); - params.setRpId(site.getRpId()); - params.setTicket(checkAccess.getTicket()); - params.setClaimToken(Tester.getAuthorization(site)); - - try { - client.umaRpGetRpt(params, Tester.getAuthorization(site), null); - } catch (ApiException ex) { - assertEquals(ex.getCode(), 400); - } - - } - - public static List resourceList(String rsProtect) throws IOException { - rsProtect = replace(rsProtect, "'", "\""); - - final ObjectMapper jsonMapper = Jackson2.createJsonMapper(); - final JsonNode resourcesNode = jsonMapper.readTree(rsProtect).get(("resources")); - - if (resourcesNode != null) - return jsonMapper.treeToValue(resourcesNode, ArrayList.class); - - throw new IllegalArgumentException("Could not find test data for protected resources"); - - } - -} diff --git a/jans-client-api/gen-client/src/test/java/io/swagger/client/api/UmaGetClaimsGatheringUrlTest.java b/jans-client-api/gen-client/src/test/java/io/swagger/client/api/UmaGetClaimsGatheringUrlTest.java deleted file mode 100644 index 2c1d3eae614..00000000000 --- a/jans-client-api/gen-client/src/test/java/io/swagger/client/api/UmaGetClaimsGatheringUrlTest.java +++ /dev/null @@ -1,114 +0,0 @@ -package io.swagger.client.api; - -import io.swagger.client.model.RegisterSiteResponse; -import io.swagger.client.model.UmaRpGetClaimsGatheringUrlParams; -import io.swagger.client.model.UmaRpGetClaimsGatheringUrlResponse; -import io.swagger.client.model.UmaRsCheckAccessResponse; -import io.jans.ca.common.CoreUtils; -import org.testng.annotations.Parameters; -import org.testng.annotations.Test; -import org.testng.collections.Maps; - -import java.util.Map; - -import static org.apache.commons.lang.StringUtils.isNotBlank; -import static org.testng.Assert.assertEquals; -import static org.testng.Assert.assertTrue; - -/** - * @author yuriyz - * @author Shoeb - * @version 11/12/2018 - */ -public class UmaGetClaimsGatheringUrlTest { - - @Parameters({"opHost", "redirectUrls", "rsProtect", "paramRedirectUrl"}) - @Test - public void test(String opHost, String redirectUrls, String rsProtect, String paramRedirectUrl) throws Exception { - - final DevelopersApi client = Tester.api(); - final RegisterSiteResponse site = RegisterSiteTest.registerSite(client, opHost, redirectUrls); - - RsProtectTest.protectResources(client, site, UmaFullTest.resourceList(rsProtect)); - - final UmaRsCheckAccessResponse checkAccess = RsCheckAccessTest.checkAccess(client, site, null); - - final UmaRpGetClaimsGatheringUrlParams params = new UmaRpGetClaimsGatheringUrlParams(); - params.setRpId(site.getRpId()); - params.setTicket(checkAccess.getTicket()); - params.setClaimsRedirectUri(paramRedirectUrl); - - final UmaRpGetClaimsGatheringUrlResponse response = client.umaRpGetClaimsGatheringUrl(params, Tester.getAuthorization(site), null); - - final Map parameters = CoreUtils.splitQuery(response.getUrl()); - - assertTrue(isNotBlank(parameters.get("client_id"))); - assertTrue(isNotBlank(parameters.get("ticket"))); - assertTrue(isNotBlank(parameters.get("state"))); - assertTrue(isNotBlank(response.getState())); - assertEquals(paramRedirectUrl, parameters.get("claims_redirect_uri")); - } - - @Parameters({"opHost", "redirectUrls", "rsProtect", "paramRedirectUrl"}) - @Test - public void test_withCustomParameter(String opHost, String redirectUrls, String rsProtect, String paramRedirectUrl) throws Exception { - - final DevelopersApi client = Tester.api(); - final RegisterSiteResponse site = RegisterSiteTest.registerSite(client, opHost, redirectUrls); - - RsProtectTest.protectResources(client, site, UmaFullTest.resourceList(rsProtect)); - - final UmaRsCheckAccessResponse checkAccess = RsCheckAccessTest.checkAccess(client, site, null); - - final UmaRpGetClaimsGatheringUrlParams params = new UmaRpGetClaimsGatheringUrlParams(); - params.setRpId(site.getRpId()); - params.setTicket(checkAccess.getTicket()); - params.setClaimsRedirectUri(paramRedirectUrl); - - Map customParameterMap = Maps.newHashMap(); - customParameterMap.put("param1", "value1"); - customParameterMap.put("param2", "value2"); - params.setCustomParameters(customParameterMap); - - final UmaRpGetClaimsGatheringUrlResponse response = client.umaRpGetClaimsGatheringUrl(params, Tester.getAuthorization(site), null); - - final Map parameters = CoreUtils.splitQuery(response.getUrl()); - - assertTrue(isNotBlank(parameters.get("client_id"))); - assertTrue(isNotBlank(parameters.get("ticket"))); - assertTrue(isNotBlank(parameters.get("state"))); - assertTrue(isNotBlank(parameters.get("param1"))); - assertTrue(isNotBlank(parameters.get("param2"))); - assertTrue(isNotBlank(response.getState())); - assertEquals(paramRedirectUrl, parameters.get("claims_redirect_uri")); - } - - @Parameters({"opHost", "redirectUrls", "rsProtect", "state", "paramRedirectUrl"}) - @Test - public void test_withState(String opHost, String redirectUrls, String rsProtect, String state, String paramRedirectUrl) throws Exception { - - final DevelopersApi client = Tester.api(); - final RegisterSiteResponse site = RegisterSiteTest.registerSite(client, opHost, redirectUrls); - - RsProtectTest.protectResources(client, site, UmaFullTest.resourceList(rsProtect)); - - final UmaRsCheckAccessResponse checkAccess = RsCheckAccessTest.checkAccess(client, site, null); - - final UmaRpGetClaimsGatheringUrlParams params = new UmaRpGetClaimsGatheringUrlParams(); - params.setRpId(site.getRpId()); - params.setTicket(checkAccess.getTicket()); - params.setClaimsRedirectUri(paramRedirectUrl); - params.setState(state); - - final UmaRpGetClaimsGatheringUrlResponse response = client.umaRpGetClaimsGatheringUrl(params, Tester.getAuthorization(site), null); - - final Map parameters = CoreUtils.splitQuery(response.getUrl()); - - assertTrue(isNotBlank(parameters.get("client_id"))); - assertTrue(isNotBlank(parameters.get("ticket"))); - assertTrue(isNotBlank(parameters.get("state"))); - assertTrue(isNotBlank(response.getState())); - assertEquals(response.getState(), state); - assertEquals(paramRedirectUrl, parameters.get("claims_redirect_uri")); - } -} diff --git a/jans-client-api/gen-client/src/test/resources/java-swagger-config.json b/jans-client-api/gen-client/src/test/resources/java-swagger-config.json deleted file mode 100644 index 940dce79900..00000000000 --- a/jans-client-api/gen-client/src/test/resources/java-swagger-config.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "modelPackage" : "io.swagger.client.model", - "apiPackage" : "io.swagger.client.api", - "invokerPackage" : "io.swagger.client", - "groupId" : "org.gluu.oxd", - "artifactId" : "oxd-client", - "dateLibrary" : "java8" -} diff --git a/jans-client-api/gen-client/src/test/resources/properties/testng.properties b/jans-client-api/gen-client/src/test/resources/properties/testng.properties deleted file mode 100644 index 68652280b88..00000000000 --- a/jans-client-api/gen-client/src/test/resources/properties/testng.properties +++ /dev/null @@ -1,13 +0,0 @@ -## Developer test ng properties (convenient way to run separate test without suite) ## -host=localhost -port=8099 -opHost=http://localhost:8085 -#redirectUrl=https://client.example.com/cb -redirectUrl=https://gluu-dev.mediaocean.com/app1/ox_redirect.html -logoutUrl=https://client.example.com/logout -postLogoutRedirectUrl=https://client.example.com/logout -userId=test_user -userSecret=test_user_password -clientId=@!1111!0008!FF81!2D39 -clientSecret=6213e9b9-c46d-4008-8af1-03f918a8ade4 -rsProtect={"resources":[{"path":"/ws/phone","conditions":[{"httpMethods":["GET"],"scopes":["http://photoz.example.com/dev/actions/all","http://photoz.example.com/dev/actions/view"],"ticketScopes":["http://photoz.example.com/dev/actions/view"]},{"httpMethods":["PUT", "POST"],"scopes":["http://photoz.example.com/dev/actions/all","http://photoz.example.com/dev/actions/add"],"ticketScopes":["http://photoz.example.com/dev/actions/add"]},{"httpMethods":["DELETE"],"scopes":["http://photoz.example.com/dev/actions/all","http://photoz.example.com/dev/actions/remove"],"ticketScopes":["http://photoz.example.com/dev/actions/remove"]}]}]} \ No newline at end of file diff --git a/jans-client-api/gen-client/src/test/resources/testng.xml b/jans-client-api/gen-client/src/test/resources/testng.xml deleted file mode 100644 index 1e62cd3c60e..00000000000 --- a/jans-client-api/gen-client/src/test/resources/testng.xml +++ /dev/null @@ -1,137 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/jans-client-api/pom.xml b/jans-client-api/pom.xml deleted file mode 100644 index 0928329dc2b..00000000000 --- a/jans-client-api/pom.xml +++ /dev/null @@ -1,627 +0,0 @@ - - - 4.0.0 - - io.jans - jans-client-api-parent - pom - 1.0.3-SNAPSHOT - jans-client-api - - - - github - GitHub Packages - https://maven.pkg.github.com/JanssenProject/jans - - - - uma-rs-core - uma-rs-resteasy - common - client - gen-client - server - - - - 3.3.9 - 3.8.1 - true - 11 - 11 - UTF-8 - 3.0.0-M5 - - 31.1-jre - 11 - 11 - 1.0.3-SNAPSHOT - 4.0.3.Final - 11.0.8 - 4.7.5.Final - 2.10.1 - 1.7.25 - 7.0.1.Final - - 1.4.0.Final - 1.0.0.Alpha4 - 2.0.0.Final - 2.1.0.CR1 - 1.7.0.Alpha10 - 1.0.0.CR4 - 1.2.0 - - 2.1.0 - 4.4.0 - -Xms1024m -Xmx2048m -XX:+DisableExplicitGC - - JanssenProject_jans-client-api - ${project.groupId}:${project.artifactId} - janssenproject - https://sonarcloud.io - - - - ${maven.min-version} - - - - - mavencentral - maven central - https://repo1.maven.org/maven2 - - - jans - Janssen project repository - https://maven.jans.io/maven - - - bouncycastle - Bouncy Castle - https://repo1.maven.org/maven2/org/bouncycastle - - - repository.jboss.org - JBoss Repository - https://repository.jboss.org/nexus/content/groups/public-jboss/ - - - - - https://github.com/JanssenProject/jans-client-api - scm:git:git://github.com/JanssenProject/jans-client-api.git - scm:git:git@github.com:v/jans-client-api.git - - - - - - io.jans - jans-bom - ${jans.version} - import - pom - - - com.fasterxml.jackson - jackson-bom - ${jackson.version} - import - pom - - - - org.jboss.weld - weld-core-parent - ${weld.version} - import - pom - - - - - io.jans - uma-rs-resteasy - 1.0.0-SNAPSHOT - - - io.jans - jans-client-api-common - ${project.version} - - - io.jans - jans-client-api-server - ${project.version} - - - io.jans - jans-core-server - ${jans.version} - - - org.jboss.resteasy - * - - - - - io.jans - jans-auth-model - ${jans.version} - - - io.jans - jans-core-timer-weld - ${jans.version} - - - io.jans - jans-orm-annotation - ${jans.version} - - - io.jans - jans-core-util - ${jans.version} - - - org.jboss.resteasy - * - - - org.apache.jackrabbit - jackrabbit-core - - - - - io.jans - jans-core-model - ${jans.version} - - - org.jboss.resteasy - * - - - org.apache.jackrabbit - jackrabbit-core - - - - - io.jans - jans-auth-common - ${jans.version} - - - org.jboss.resteasy - * - - - org.apache.jackrabbit - jackrabbit-core - - - - - io.jans - jans-core-service - ${jans.version} - - - org.jboss.resteasy - * - - - - - io.jans - jans-client-api - ${project.version} - - - org.jboss.resteasy - * - - - - - io.jans - jans-orm-annotation - ${jans.version} - - - io.jans - jans-core-script - ${jans.version} - - - io.jans - jans-auth-persistence-model - ${jans.version} - - - - - org.bouncycastle - bcprov-jdk15on - 1.67 - - - org.bouncycastle - bcpkix-jdk15on - 1.67 - - - com.nimbusds - nimbus-jose-jwt - 9.11.1 - - - - - org.seleniumhq.selenium - selenium-java - ${selenium.version} - test - - - org.seleniumhq.selenium - selenium-remote-driver - ${selenium.version} - - - org.seleniumhq.selenium - selenium-support - ${selenium.version} - test - - - org.seleniumhq.selenium - selenium-api - ${selenium.version} - test - - - org.seleniumhq.selenium - htmlunit-driver - 3.63.0 - test - - - net.sourceforge.htmlunit - htmlunit-cssparser - 1.12.0 - test - - - - net.sourceforge.htmlunit - htmlunit - 2.63.0 - test - - - org.bitbucket.b_c - jose4j - 0.6.4 - test - - - - - org.jboss.resteasy - resteasy-client-microprofile - ${org.jboss.resteasy.client.microprofile.version} - - - - org.eclipse.jetty - jetty-webapp - ${jetty.version} - provided - - - org.eclipse.jetty - jetty-deploy - ${jetty.version} - provided - - - org.eclipse.jetty - jetty-annotations - ${jetty.version} - provided - - - org.eclipse.jetty - jetty-plus - ${jetty.version} - provided - - - org.eclipse.jetty - jetty-util - ${jetty.version} - - - org.eclipse.jetty - jetty-http - ${jetty.version} - - - org.apache.commons - commons-collections4 - 4.1 - - - com.google.guava - guava - ${guava.version} - - - - - org.jboss.arquillian - arquillian-bom - ${arquillian.version} - pom - import - - - - org.jboss.arquillian.graphene - graphene-webdriver - ${arquillian.graphene.version} - pom - test - - - org.jboss.arquillian.extension - arquillian-drone-bom - ${arquillian.drone.version} - pom - test - - - org.jboss.arquillian.extension - arquillian-drone-webdriver-depchain - ${arquillian.drone.version} - pom - test - - - javax.servlet - javax.servlet-api - 4.0.1 - test - - - commons-net - commons-net - 3.0 - - - - - - - - org.apache.maven.plugins - maven-clean-plugin - 2.5 - - - org.apache.maven.plugins - maven-compiler-plugin - ${compiler-plugin.version} - - true - - - - org.apache.maven.plugins - maven-deploy-plugin - 2.7 - - - org.apache.maven.plugins - maven-dependency-plugin - 2.8 - - - org.apache.maven.plugins - maven-install-plugin - 2.3.1 - - - org.apache.maven.plugins - maven-jar-plugin - 3.2.0 - - - org.apache.maven.plugins - maven-resources-plugin - 3.2.0 - - UTF-8 - - - - org.apache.maven.plugins - maven-site-plugin - 2.1.1 - - - org.apache.maven.plugins - maven-surefire-plugin - ${surefire-plugin.version} - - @{argLine} - - - false - false - - - - **/selenium/* - **/webdriver/* - **/xml/* - - - - target/test-classes/testng.xml - - - - projectVersion - ${project.version} - - - - - - org.codehaus.mojo - findbugs-maven-plugin - 3.0.4 - - - org.apache.maven.plugins - maven-war-plugin - 2.3 - - - org.eclipse.jetty - jetty-maven-plugin - ${jetty.version} - - - - org.apache.maven.plugins - maven-source-plugin - 2.1.2 - - - attach-sources - - jar - - - - - - org.apache.maven.plugins - maven-javadoc-plugin - - false - - - - - org.jacoco - jacoco-maven-plugin - ${jacoco.version} - - - prepare-agent-ut - - prepare-agent - - - ${project.build.directory}/jacoco-ut.exec - - - - prepare-agent-it - pre-integration-test - - prepare-agent - - - ${project.build.directory}/jacoco-it.exec - - - - jacoco-check - - check - - - - - PACKAGE - - - LINE - COVEREDRATIO - 0.50 - - - - - - - - report-ut - - report - - - ${project.build.directory}/jacoco-ut.exec - ${project.reporting.outputDirectory}/jacoco-ut - - - - - report-it - post-integration-test - - report - - - ${project.build.directory}/jacoco-it.exec - ${project.reporting.outputDirectory}/jacoco-it - - - - - - - - - - - - - set-configuration-name - - - !cfg - - - - default - - - - - development-build - - - development-build - true - - - - TRACE - true - - - - - \ No newline at end of file diff --git a/jans-client-api/server/conf/jans-couchbase.properties b/jans-client-api/server/conf/jans-couchbase.properties deleted file mode 100644 index 2f012e25fb8..00000000000 --- a/jans-client-api/server/conf/jans-couchbase.properties +++ /dev/null @@ -1,29 +0,0 @@ -servers: ${config.couchbase.couchbase_servers} - -connection.operation-tracing-enabled: false - -# If mutation tokens are enabled, they can be used for advanced durability requirements, -# as well as optimized RYOW consistency. -connection.mutation-tokens-enabled: false - -# Default scan consistency. Possible values are: not_bounded, request_plus, statement_plus -connection.scan-consistency: not_bounded - -auth.userName: ${config.couchbase.couchbase_server_user} -auth.userPassword: ${config.couchbase.encoded_couchbase_server_pw} - -buckets: ${config.couchbase.couchbase_buckets} - -bucket.default: ${config.couchbase.default_bucket} -bucket.jans_user.mapping: ${config.bucket.jans_user.mapping} -bucket.jans_site.mapping: ${config.bucket.jans_site.mapping} -bucket.jans_cache.mapping: ${config.bucket.jans_cache.mapping} -bucket.jans_token.mapping: ${config.bucket.jans_token.mapping} -bucket.jans_session.mapping: ${config.bucket.jans_session.mapping} - -password.encryption.method: ${config.couchbase.encryption_method} - -ssl.enable: ${config.couchbase.ssl_enabled} -ssl.trustStoreFile: ${config.couchbase.couchbaseTrustStoreFn} -ssl.trustStorePin: ${config.couchbase.encoded_couchbaseTrustStorePass} -ssl.trustStoreFormat: pkcs12 diff --git a/jans-client-api/server/conf/jans-ldap.properties b/jans-client-api/server/conf/jans-ldap.properties deleted file mode 100644 index e9be44cb76b..00000000000 --- a/jans-client-api/server/conf/jans-ldap.properties +++ /dev/null @@ -1,5 +0,0 @@ -bindDN=${config.ldap.bindDN} -bindPassword=${config.ldap.bindPassword} -servers=${config.ldap.servers} -maxconnections=${config.ldap.maxConnections} -useSSL=${config.ldap.useSSL} diff --git a/jans-client-api/server/conf/jans-spanner.properties b/jans-client-api/server/conf/jans-spanner.properties deleted file mode 100644 index 199cbe8e4c5..00000000000 --- a/jans-client-api/server/conf/jans-spanner.properties +++ /dev/null @@ -1,25 +0,0 @@ -connection.project=${config.spanner.connection.project} -connection.instance=${config.spanner.connection.instance} -connection.database=${config.spanner.connection.database} - -# Prefix connection.client-property.key=value will be coverterd to key=value -# This is reserved for future usage -#connection.client-property=clientPropertyValue - -# spanner creds or emulator -connection.emulator-host=${config.spanner.connection.emulator-host} - -# Password hash method -password.encryption.method=${config.spanner.password.encryption.method} - -# Max time needed to create connection pool in milliseconds -connection.pool.create-max-wait-time-millis=${config.spanner.connection.pool.create-max-wait-time-millis} - -# Maximum allowed statement result set size -statement.limit.default-maximum-result-size=${config.spanner.statement.limit.default-maximum-result-size} - -# Maximum allowed delete statement result set size -statement.limit.maximum-result-delete-size=${config.spanner.statement.limit.maximum-result-delete-size} - -binaryAttributes=${config.spanner.binaryAttributes} -certificateAttributes=${config.spanner.certificateAttributes} diff --git a/jans-client-api/server/conf/jans-sql.properties b/jans-client-api/server/conf/jans-sql.properties deleted file mode 100644 index 6fe38fde066..00000000000 --- a/jans-client-api/server/conf/jans-sql.properties +++ /dev/null @@ -1,25 +0,0 @@ -db.schema.name=${config.sql.db.schema.name} - -connection.uri=${config.sql.connection.uri} - -connection.driver-property.serverTimezone=${config.sql.connection.driver-property.serverTimezone} - -auth.userName=${config.sql.auth.userName} -auth.userPassword=${config.sql.auth.userPassword} - -# Password hash method -password.encryption.method=${config.sql.password.encryption.method} - -# Connection pool size -connection.pool.max-total=${config.sql.connection.pool.max-total} -connection.pool.max-idle=${config.sql.connection.pool.max-idle} -connection.pool.min-idle=${config.sql.connection.pool.min-idle} - -# Max time needed to create connection pool in milliseconds -connection.pool.create-max-wait-time-millis=${config.sql.connection.pool.create-max-wait-time-millis} - -# Max wait 20 seconds -connection.pool.max-wait-time-millis=${config.sql.connection.pool.max-wait-time-millis} - -# Allow to evict connection in pool after 30 minutes -connection.pool.min-evictable-idle-time-millis=${config.sql.connection.pool.min-evictable-idle-time-millis} diff --git a/jans-client-api/server/conf/jans.properties b/jans-client-api/server/conf/jans.properties deleted file mode 100644 index c7604f1aa3c..00000000000 --- a/jans-client-api/server/conf/jans.properties +++ /dev/null @@ -1,10 +0,0 @@ -persistence.type=${config.persistence.type} - -jansAuth_ConfigurationEntryDN=${config.generic.configurationEntryDN} -clientApi_ConfigurationEntryDN=${config.client.api.configurationEntryDN} - -confDir=${config.generic.confDir} -pythonModulesDir=/opt/jans/python/libs - -binaryAttributes=objectGUID -certificateAttributes=userCertificate diff --git a/jans-client-api/server/conf/salt b/jans-client-api/server/conf/salt deleted file mode 100644 index 0b11c3aed06..00000000000 --- a/jans-client-api/server/conf/salt +++ /dev/null @@ -1 +0,0 @@ -encodeSalt=${config.salt} \ No newline at end of file diff --git a/jans-client-api/server/pom.xml b/jans-client-api/server/pom.xml deleted file mode 100644 index 17e402cf850..00000000000 --- a/jans-client-api/server/pom.xml +++ /dev/null @@ -1,846 +0,0 @@ - - - - jans-client-api-parent - io.jans - 1.0.3-SNAPSHOT - - 4.0.0 - jans-client-api-server - war - 1.0.3-SNAPSHOT - jans-client-api-server - - - 11 - 11 - 8.0.1 - 2.1.210 - 3.0.2 - /etc/jans - - http://localhost:8081/jans-client-api-server/ - - - - - - jakarta.enterprise - jakarta.enterprise.cdi-api - - - jakarta.servlet - jakarta.servlet-api - compile - - - jakarta.servlet.jsp - jakarta.servlet.jsp-api - - - jakarta.websocket - jakarta.websocket-api - - - org.jboss.weld.servlet - weld-servlet-core - - - org.jboss.weld - weld-core-impl - - - com.google.protobuf - protobuf-java - - - - io.jans - jans-core-util - - - io.jans - jans-orm-standalone - - - io.jans - jans-core-model - - - io.jans - jans-auth-common - - - io.jans - jans-core-server - - - io.jans - jans-core-service - - - - io.jans - jans-core-timer-weld - - - io.jans - jans-auth-model - - - io.jans - jans-auth-persistence-model - - - io.jans - jans-core-script - - - io.jans - jans-client-api-common - ${project.version} - - - io.jans - jans-client-api-common - ${project.version} - - - org.slf4j - slf4j-log4j12 - - - test-jar - test - - - - io.jans - jans-client-api - ${project.version} - - - - - com.lightstep.tracer - lightstep-tracer-jre - 0.14.2 - - - com.google.protobuf - protobuf-java - - - - - io.jaegertracing - jaeger-core - 0.32.0 - - - io.opentracing.brave - brave-opentracing - 0.31.2 - - - io.zipkin.reporter2 - zipkin-reporter - 2.7.6 - - - io.zipkin.reporter2 - zipkin-sender-okhttp3 - 2.7.6 - - - - - org.bouncycastle - bcprov-jdk15on - - - org.bouncycastle - bcpkix-jdk15on - - - - org.hibernate - hibernate-validator-cdi - - - org.hibernate - hibernate-validator - - - - - org.jboss.resteasy - resteasy-cdi - - - org.jboss.resteasy - resteasy-client - - - org.jboss.resteasy - resteasy-servlet-initializer - - - org.jboss.resteasy - resteasy-jaxb-provider - - - org.jboss.resteasy - resteasy-jackson2-provider - - - org.jboss.resteasy - resteasy-json-p-provider - - - - - junit - junit - test - - - org.seleniumhq.selenium - selenium-remote-driver - test - - - org.seleniumhq.selenium - selenium-support - test - - - org.seleniumhq.selenium - htmlunit-driver - test - - - org.seleniumhq.selenium - selenium-api - test - - - net.sourceforge.htmlunit - htmlunit - - - net.sourceforge.htmlunit - htmlunit-cssparser - - - - - org.apache.commons - commons-collections4 - - - com.google.guava - guava - - - org.json - json - - - org.glassfish - jakarta.faces - - - org.glassfish - jakarta.json - - - com.h2database - h2 - ${h2.version} - - - redis.clients - jedis - 3.6.2 - - - - org.eclipse.jetty - jetty-deploy - - - org.eclipse.jetty - jetty-http - - - - - org.testng - testng - test - - - org.mockito - mockito-core - 3.2.4 - test - - - org.mockito - mockito-inline - 3.8.0 - test - - - - jakarta.websocket - jakarta.websocket-api - test - - - javax.xml.bind - jaxb-api - 2.3.1 - - - - - org.jboss.arquillian.testng - arquillian-testng-container - test - - - org.jboss.arquillian.extension - arquillian-rest-client-impl-3x - ${arquillian.rest.version} - test - - - org.eu.ingwar.tools - arquillian-suite-extension - ${arquillian.ingwar.tools.version} - test - - - - - org.jboss.arquillian.container - arquillian-container-test-impl-base - test - - - org.jboss.arquillian.container - arquillian-container-spi - ${arquillian.test.version} - test - - - org.jboss.arquillian.container - arquillian-container-test-spi - ${arquillian.test.version} - test - - - org.jboss.arquillian.testenricher - arquillian-testenricher-cdi - ${arquillian.test.version} - test - - - org.jboss.arquillian.test - arquillian-test-impl-base - ${arquillian.test.version} - - - org.jboss.arquillian.protocol - arquillian-protocol-servlet - test - - - - - org.jboss.shrinkwrap.resolver - shrinkwrap-resolver-depchain - pom - test - - - org.jboss.shrinkwrap.resolver - shrinkwrap-resolver-impl-maven - test - - - org.jboss.shrinkwrap.descriptors - shrinkwrap-descriptors-impl-javaee - test - - - javax.servlet - javax.servlet-api - - - - - - jans-client-api-server - - - profiles/${cfg}/config-build.properties - profiles/${cfg}/config-build-test.properties - - - - - src/main/resources - true - - **/*.xml - **/*.properties - **/*.json - META-INF/services/*.* - - - - - - - src/test/resources - true - - test.properties - *.* - - - - - - - org.apache.maven.plugins - maven-javadoc-plugin - - false - - - - - org.apache.maven.plugins - maven-install-plugin - - - install-jar - install - - install-file - - - jar - ${project.artifactId} - ${project.groupId} - ${project.version} - - ${project.build.directory}/${project.build.finalName}.jar - - - - - install-war - install - - install-file - - - war - ${project.artifactId} - ${project.groupId} - ${project.version} - - ${project.build.directory}/${project.build.finalName}.war - - - - - - - - org.apache.maven.plugins - maven-jar-plugin - - - make-a-jar - compile - - jar - - - - - test-jar - - - - - - - org.apache.maven.plugins - maven-resources-plugin - - - prepare-configuration-files - process-test-resources - - copy-resources - - - ${project.build.directory}/conf - - - ${basedir}/conf - true - - - - ${basedir}/profiles/${cfg}/config-client-api.properties - ${basedir}/profiles/${cfg}/config-client-api-sql.properties - ${basedir}/profiles/${cfg}/config-client-api-ldap.properties - - - - - - - - org.apache.maven.plugins - maven-surefire-plugin - - -Xms1024m -Xmx2048m -XX:MaxMetaspaceSize=512m -XX:+DisableExplicitGC - -Djans.base=${project.build.directory} - -Dlog.base=${project.build.directory} - - - - - - org.apache.maven.plugins - maven-war-plugin - - false - - - true - - - - ${buildNumber} - - - - - - - src/main/resources - true - - compile.properties - - - - src/main/webapp - true - - **/*.xml - **/*.properties - - - - src/main/webapp - false - - **/*.* - - - - - - - - - org.codehaus.mojo - buildnumber-maven-plugin - 1.1 - - - validate - - create - - - - - false - false - - - - - - org.eclipse.jetty - jetty-maven-plugin - - - ${project.build.directory}/${project.build.finalName}/WEB-INF/web.xml - - /jans - - - ${project.build.directory}/${project.build.finalName} - - 3 - - - - - - - - webapp - - - !webapp.disable - - - - - - jakarta.enterprise - jakarta.enterprise.cdi-api - - - - org.glassfish - jakarta.el - - - - jakarta.el - jakarta.el-api - - - - org.jboss.weld.servlet - weld-servlet-core - - - org.jboss.weld - weld-core-impl - - - jakarta.ejb - jakarta.ejb-api - - - - - org.jboss.arquillian.container - arquillian-jetty-embedded-11 - ${arquillian.jetty.embedded.11.version} - - - org.eclipse.jetty - jetty-webapp - test - - - org.eclipse.jetty - jetty-deploy - test - - - org.eclipse.jetty - jetty-annotations - test - - - org.eclipse.jetty - jetty-plus - test - - - org.eclipse.jetty - jetty-util - test - - - com.nimbusds - nimbus-jose-jwt - - - org.bitbucket.b_c - jose4j - - - - - - - org.apache.maven.plugins - maven-war-plugin - - - - true - - - ${buildNumber} - - ${git.branch} - - - - - - src/main/webapp - true - - **/*.xml - **/*.properties - - - - src/main/webapp - false - - **/*.* - - - - - - - - - - - webapp-jetty - - - !jetty.disable - - - - - - - org.apache.maven.plugins - maven-war-plugin - - - - - src/main/webapp - true - - **/*.xml - **/*.properties - - - - src/main/webapp - false - - **/*.* - - - - - src/main/webapp-jetty - true - - - - - - - - - - webapp-tomcat - - - tomcat.enable - - - - - - - org.apache.maven.plugins - maven-war-plugin - - - - - src/main/webapp - true - - **/*.xml - **/*.properties - - - - src/main/webapp - false - - **/*.* - - - - - src/main/webapp-tomcat - true - - - - - - - - - - jetty-embedded - - true - - jetty.embedded - - - - - - org.jboss.resteasy - resteasy-jaxrs - 3.0.21.Final - test - - - org.jboss.resteasy - resteasy-cdi - 3.0.21.Final - test - - - org.jboss.resteasy - resteasy-client - 3.0.21.Final - test - - - org.jboss.resteasy - resteasy-servlet-initializer - 3.0.21.Final - test - - - - - \ No newline at end of file diff --git a/jans-client-api/server/profiles/default/config-build-test.properties b/jans-client-api/server/profiles/default/config-build-test.properties deleted file mode 100644 index e8312f2d10e..00000000000 --- a/jans-client-api/server/profiles/default/config-build-test.properties +++ /dev/null @@ -1,5 +0,0 @@ -# The URL of your Jans installation -test.jans.auth.server.name=jenkins-dev1.jans.io -test.jans.auth.server.url=https://jenkins-dev1.jans.io -test.auth.user.uid=test_user -test.auth.user.password=test_user_password \ No newline at end of file diff --git a/jans-client-api/server/profiles/default/config-build.properties b/jans-client-api/server/profiles/default/config-build.properties deleted file mode 100644 index d58ca965980..00000000000 --- a/jans-client-api/server/profiles/default/config-build.properties +++ /dev/null @@ -1,3 +0,0 @@ -client.api.debug=false -log4j.default.log.level=INFO -weld.debug=false \ No newline at end of file diff --git a/jans-client-api/server/profiles/default/config-client-api-ldap.properties b/jans-client-api/server/profiles/default/config-client-api-ldap.properties deleted file mode 100644 index a87779c5c9e..00000000000 --- a/jans-client-api/server/profiles/default/config-client-api-ldap.properties +++ /dev/null @@ -1,6 +0,0 @@ -# LDAP -config.ldap.bindDN=cn=directory manager -config.ldap.bindPassword=gXhiiwqbHEplolsdTvhOBw== -config.ldap.servers=jenkins-ldap.jans.io:1636 -config.ldap.maxConnections=3 -config.ldap.useSSL=true diff --git a/jans-client-api/server/profiles/default/config-client-api-sql.properties b/jans-client-api/server/profiles/default/config-client-api-sql.properties deleted file mode 100644 index 5f7514de490..00000000000 --- a/jans-client-api/server/profiles/default/config-client-api-sql.properties +++ /dev/null @@ -1,21 +0,0 @@ -# SQL -config.sql.db.schema.name=jansdb -config.sql.connection.uri=jdbc:mysql://localhost:3306/jansdb -config.sql.connection.driver-property.serverTimezone=UTC-0400 -config.sql.auth.userName=jans -config.sql.auth.userPassword=SNrNadCCPC47bexyzaNQVg== - -# Password hash method -config.sql.password.encryption.method=SSHA-256 - -# Connection pool size -config.sql.connection.pool.max-total=40 -config.sql.connection.pool.max-idle=15 -config.sql.connection.pool.min-idle=5 - -# Max time needed to create connection pool in milliseconds -config.sql.connection.pool.create-max-wait-time-millis=20000 -# Max wait 20 seconds -config.sql.connection.pool.max-wait-time-millis=20000 -# Allow to evict connection in pool after 30 minutes -config.sql.connection.pool.min-evictable-idle-time-millis=1800000 \ No newline at end of file diff --git a/jans-client-api/server/profiles/default/config-client-api.properties b/jans-client-api/server/profiles/default/config-client-api.properties deleted file mode 100644 index 3074b8c5199..00000000000 --- a/jans-client-api/server/profiles/default/config-client-api.properties +++ /dev/null @@ -1,17 +0,0 @@ -config.persistence.type=sql -#config.salt=R9028eBrasfZcCzpwgrt1yQK -config.salt=JfyGMzru0VJEzT8VDW8QM8SV - -# Generic properties -config.generic.configurationEntryDN=ou=jans-auth,ou=configuration,o=jans -config.client.api.configurationEntryDN=ou=jans-client-api,ou=configuration,o=jans - -config.generic.createLdapConfigurationEntryIfNotExist=true -config.generic.confDir=/etc/jans/conf/ - -# Expiration time -config.client.authorization-code-lifetime=60 -config.client.dynamic-registration-expiration-time=120 -config.client.clean-service-interval=3600 - -config.uma.requester-permission-token-lifetime=600 \ No newline at end of file diff --git a/jans-client-api/server/profiles/jenkins-build.jans.io/config-build-test.properties b/jans-client-api/server/profiles/jenkins-build.jans.io/config-build-test.properties deleted file mode 100644 index 8967c655648..00000000000 --- a/jans-client-api/server/profiles/jenkins-build.jans.io/config-build-test.properties +++ /dev/null @@ -1,5 +0,0 @@ -# The URL of your Jans installation -test.jans.auth.server.name=jenkins-build.jans.io -test.jans.auth.server.url=https://jenkins-build.jans.io -test.auth.user.uid=test_user -test.auth.user.password=test_user_password \ No newline at end of file diff --git a/jans-client-api/server/profiles/jenkins-build.jans.io/config-build.properties b/jans-client-api/server/profiles/jenkins-build.jans.io/config-build.properties deleted file mode 100644 index d58ca965980..00000000000 --- a/jans-client-api/server/profiles/jenkins-build.jans.io/config-build.properties +++ /dev/null @@ -1,3 +0,0 @@ -client.api.debug=false -log4j.default.log.level=INFO -weld.debug=false \ No newline at end of file diff --git a/jans-client-api/server/profiles/jenkins-build.jans.io/config-client-api-ldap.properties b/jans-client-api/server/profiles/jenkins-build.jans.io/config-client-api-ldap.properties deleted file mode 100644 index a87779c5c9e..00000000000 --- a/jans-client-api/server/profiles/jenkins-build.jans.io/config-client-api-ldap.properties +++ /dev/null @@ -1,6 +0,0 @@ -# LDAP -config.ldap.bindDN=cn=directory manager -config.ldap.bindPassword=gXhiiwqbHEplolsdTvhOBw== -config.ldap.servers=jenkins-ldap.jans.io:1636 -config.ldap.maxConnections=3 -config.ldap.useSSL=true diff --git a/jans-client-api/server/profiles/jenkins-build.jans.io/config-client-api-sql.properties b/jans-client-api/server/profiles/jenkins-build.jans.io/config-client-api-sql.properties deleted file mode 100644 index 5f7514de490..00000000000 --- a/jans-client-api/server/profiles/jenkins-build.jans.io/config-client-api-sql.properties +++ /dev/null @@ -1,21 +0,0 @@ -# SQL -config.sql.db.schema.name=jansdb -config.sql.connection.uri=jdbc:mysql://localhost:3306/jansdb -config.sql.connection.driver-property.serverTimezone=UTC-0400 -config.sql.auth.userName=jans -config.sql.auth.userPassword=SNrNadCCPC47bexyzaNQVg== - -# Password hash method -config.sql.password.encryption.method=SSHA-256 - -# Connection pool size -config.sql.connection.pool.max-total=40 -config.sql.connection.pool.max-idle=15 -config.sql.connection.pool.min-idle=5 - -# Max time needed to create connection pool in milliseconds -config.sql.connection.pool.create-max-wait-time-millis=20000 -# Max wait 20 seconds -config.sql.connection.pool.max-wait-time-millis=20000 -# Allow to evict connection in pool after 30 minutes -config.sql.connection.pool.min-evictable-idle-time-millis=1800000 \ No newline at end of file diff --git a/jans-client-api/server/profiles/jenkins-build.jans.io/config-client-api.properties b/jans-client-api/server/profiles/jenkins-build.jans.io/config-client-api.properties deleted file mode 100644 index 3074b8c5199..00000000000 --- a/jans-client-api/server/profiles/jenkins-build.jans.io/config-client-api.properties +++ /dev/null @@ -1,17 +0,0 @@ -config.persistence.type=sql -#config.salt=R9028eBrasfZcCzpwgrt1yQK -config.salt=JfyGMzru0VJEzT8VDW8QM8SV - -# Generic properties -config.generic.configurationEntryDN=ou=jans-auth,ou=configuration,o=jans -config.client.api.configurationEntryDN=ou=jans-client-api,ou=configuration,o=jans - -config.generic.createLdapConfigurationEntryIfNotExist=true -config.generic.confDir=/etc/jans/conf/ - -# Expiration time -config.client.authorization-code-lifetime=60 -config.client.dynamic-registration-expiration-time=120 -config.client.clean-service-interval=3600 - -config.uma.requester-permission-token-lifetime=600 \ No newline at end of file diff --git a/jans-client-api/server/profiles/jenkins-dev1.jans.io/config-build-test.properties b/jans-client-api/server/profiles/jenkins-dev1.jans.io/config-build-test.properties deleted file mode 100644 index e8312f2d10e..00000000000 --- a/jans-client-api/server/profiles/jenkins-dev1.jans.io/config-build-test.properties +++ /dev/null @@ -1,5 +0,0 @@ -# The URL of your Jans installation -test.jans.auth.server.name=jenkins-dev1.jans.io -test.jans.auth.server.url=https://jenkins-dev1.jans.io -test.auth.user.uid=test_user -test.auth.user.password=test_user_password \ No newline at end of file diff --git a/jans-client-api/server/profiles/jenkins-dev1.jans.io/config-build.properties b/jans-client-api/server/profiles/jenkins-dev1.jans.io/config-build.properties deleted file mode 100644 index d58ca965980..00000000000 --- a/jans-client-api/server/profiles/jenkins-dev1.jans.io/config-build.properties +++ /dev/null @@ -1,3 +0,0 @@ -client.api.debug=false -log4j.default.log.level=INFO -weld.debug=false \ No newline at end of file diff --git a/jans-client-api/server/profiles/jenkins-dev1.jans.io/config-client-api-ldap.properties b/jans-client-api/server/profiles/jenkins-dev1.jans.io/config-client-api-ldap.properties deleted file mode 100644 index a87779c5c9e..00000000000 --- a/jans-client-api/server/profiles/jenkins-dev1.jans.io/config-client-api-ldap.properties +++ /dev/null @@ -1,6 +0,0 @@ -# LDAP -config.ldap.bindDN=cn=directory manager -config.ldap.bindPassword=gXhiiwqbHEplolsdTvhOBw== -config.ldap.servers=jenkins-ldap.jans.io:1636 -config.ldap.maxConnections=3 -config.ldap.useSSL=true diff --git a/jans-client-api/server/profiles/jenkins-dev1.jans.io/config-client-api-sql.properties b/jans-client-api/server/profiles/jenkins-dev1.jans.io/config-client-api-sql.properties deleted file mode 100644 index 5f7514de490..00000000000 --- a/jans-client-api/server/profiles/jenkins-dev1.jans.io/config-client-api-sql.properties +++ /dev/null @@ -1,21 +0,0 @@ -# SQL -config.sql.db.schema.name=jansdb -config.sql.connection.uri=jdbc:mysql://localhost:3306/jansdb -config.sql.connection.driver-property.serverTimezone=UTC-0400 -config.sql.auth.userName=jans -config.sql.auth.userPassword=SNrNadCCPC47bexyzaNQVg== - -# Password hash method -config.sql.password.encryption.method=SSHA-256 - -# Connection pool size -config.sql.connection.pool.max-total=40 -config.sql.connection.pool.max-idle=15 -config.sql.connection.pool.min-idle=5 - -# Max time needed to create connection pool in milliseconds -config.sql.connection.pool.create-max-wait-time-millis=20000 -# Max wait 20 seconds -config.sql.connection.pool.max-wait-time-millis=20000 -# Allow to evict connection in pool after 30 minutes -config.sql.connection.pool.min-evictable-idle-time-millis=1800000 \ No newline at end of file diff --git a/jans-client-api/server/profiles/jenkins-dev1.jans.io/config-client-api.properties b/jans-client-api/server/profiles/jenkins-dev1.jans.io/config-client-api.properties deleted file mode 100644 index 3074b8c5199..00000000000 --- a/jans-client-api/server/profiles/jenkins-dev1.jans.io/config-client-api.properties +++ /dev/null @@ -1,17 +0,0 @@ -config.persistence.type=sql -#config.salt=R9028eBrasfZcCzpwgrt1yQK -config.salt=JfyGMzru0VJEzT8VDW8QM8SV - -# Generic properties -config.generic.configurationEntryDN=ou=jans-auth,ou=configuration,o=jans -config.client.api.configurationEntryDN=ou=jans-client-api,ou=configuration,o=jans - -config.generic.createLdapConfigurationEntryIfNotExist=true -config.generic.confDir=/etc/jans/conf/ - -# Expiration time -config.client.authorization-code-lifetime=60 -config.client.dynamic-registration-expiration-time=120 -config.client.clean-service-interval=3600 - -config.uma.requester-permission-token-lifetime=600 \ No newline at end of file diff --git a/jans-client-api/server/scripts/ldap/clientApi_ConfigurationEntryDN.ldif b/jans-client-api/server/scripts/ldap/clientApi_ConfigurationEntryDN.ldif deleted file mode 100644 index e9dd25081dd..00000000000 --- a/jans-client-api/server/scripts/ldap/clientApi_ConfigurationEntryDN.ldif +++ /dev/null @@ -1,104 +0,0 @@ -dn:ou=jans-client-api,ou=configuration,o=jans - -jansConfDyn:{ - "loggingLevel":"INFO", - "loggingLayout":"text", - "externalLoggerConfiguration":"", - "disableJdkLogger":true, - "trustAllCerts": true, - "keyStorePath":"/opt/jans/jans-client-api/keys/client-api-server.keystore", - "keyStorePassword":"example", - "enableJwksGeneration": true, - "jwksExpirationInHours": 2400, - "jwksRegenerationIntervalInHours": 720, - "cryptProviderKeyStorePath": "/opt/jans/jans-client-api/keys/client-api-jwks.keystore", - "cryptProviderKeyStorePassword": "example", - "cryptProviderDnName": "CN=jans-client CA Certificates", - "mtlsEnabled": false, - "mtlsClientKeyStorePath": "", - "mtlsClientKeyStorePassword": "", - "bindIpAddresses":["*"], - "storage":"jans_server_configuration", - "storageConfiguration":{ - "baseDn":"o=jans", - "type":"/etc/jans/conf/jans.properties", - "connection":"/etc/jans/conf/jans-ldap.properties", - "salt":"/etc/jans/conf/salt" - }, - "migrationSourceFolderPath":"", - "addClientCredentialsGrantTypeAutomaticallyDuringClientRegistration":false, - "uma2AutoRegisterClaimsGatheringEndpointAsRedirectUriOfClient": false, - "supportGoogleLogout": true, - "fapiEnabled": false, - "dbCleanupIntervalInHours": 1, - "stateExpirationInMinutes": 10, - "nonceExpirationInMinutes": 10, - "encodeStateFromRequestParameter": false, - "encodeNonceFromRequestParameter": false, - "rpCacheExpirationInMinutes": 60, - "idTokenValidationCHashRequired": true, - "idTokenValidationAtHashRequired": true, - "acceptIdTokenWithoutSignature": true, - "validateUserInfoWithIdToken": true, - "encodeClientIdInAuthorizationUrl": true, - "defaultSiteConfig":{ - "op_configuration_endpoint":"", - "response_types":["code"], - "grant_type":["authorization_code"], - "acr_values":[""], - "scope":["openid", "profile", "email"], - "ui_locales":["en"], - "claims_locales":["en"], - "contacts":[], - "redirect_uris":[], - "logout_redirect_uris":[], - "client_name":"", - "client_jwks_uri":"", - "token_endpoint_auth_method":"", - "token_endpoint_auth_signing_alg":"", - "request_uris":[], - "front_channel_logout_uri":"", - "sector_identifier_uri":"", - "claims_redirect_uri":[], - "client_id":"", - "client_secret":"", - "trusted_client":false, - "access_token_as_jwt":false, - "access_token_signing_alg":"", - "rpt_as_jwt":false, - "logo_uri":"", - "client_uri":"", - "policy_uri":"", - "front_channel_logout_session_required":false, - "tos_uri":"", - "jwks":"", - "id_token_binding_cnf":"", - "tls_client_auth_subject_dn":"", - "run_introspection_script_beforeaccess_token_as_jwt_creation_and_include_claims":false, - "id_token_signed_response_alg":"", - "id_token_encrypted_response_alg":"", - "id_token_encrypted_response_enc":"", - "user_info_signed_response_alg":"", - "user_info_encrypted_response_alg":"", - "user_info_encrypted_response_enc":"", - "request_object_signing_alg":"", - "request_object_encryption_alg":"", - "request_object_encryption_enc":"", - "default_max_age":null, - "require_auth_time":false, - "initiate_login_uri":"", - "authorized_origins":[], - "access_token_lifetime":null, - "software_id":"", - "software_version":"", - "software_statement":"", - "custom_attributes":{} - } -} - -jansRevision:1 - -objectClass:top -objectClass:jansAppConf - -ou:jans-client-api diff --git a/jans-client-api/server/scripts/mysql/clientApi_ConfigurationEntryDN.sql b/jans-client-api/server/scripts/mysql/clientApi_ConfigurationEntryDN.sql deleted file mode 100644 index 1337c7d4fdb..00000000000 --- a/jans-client-api/server/scripts/mysql/clientApi_ConfigurationEntryDN.sql +++ /dev/null @@ -1,95 +0,0 @@ -INSERT INTO jansAppConf (doc_id,objectClass,dn,ou,jansEmail,jansSmtpConf,jansDbAuth,jansConfDyn,jansRevision) - VALUES ('jans-client-api','jansAppConf','ou=jans-client-api,ou=configuration,o=jans','jans-client-api','{ - "loggingLevel":"INFO", - "loggingLayout":"text", - "externalLoggerConfiguration":"", - "disableJdkLogger":true, - "trustAllCerts": true, - "keyStorePath":"/opt/jans/jans-client-api/keys/client-api-server.keystore", - "keyStorePassword":"example", - "enableJwksGeneration": true, - "jwksExpirationInHours": 2400, - "jwksRegenerationIntervalInHours": 720, - "cryptProviderKeyStorePath": "/opt/jans/jans-client-api/keys/client-api-jwks.keystore", - "cryptProviderKeyStorePassword": "example", - "cryptProviderDnName": "CN=jans-client CA Certificates", - "mtlsEnabled": false, - "mtlsClientKeyStorePath": "", - "mtlsClientKeyStorePassword": "", - "bindIpAddresses":["*"], - "storage":"h2", - "storageConfiguration":{ - "dbFileLocation":"/opt/jans/jans-client-api/data/rp_db" - }, - "migrationSourceFolderPath":"", - "addClientCredentialsGrantTypeAutomaticallyDuringClientRegistration":false, - "uma2AutoRegisterClaimsGatheringEndpointAsRedirectUriOfClient": false, - "supportGoogleLogout": true, - "fapiEnabled": false, - "dbCleanupIntervalInHours": 1, - "stateExpirationInMinutes": 10, - "nonceExpirationInMinutes": 10, - "encodeStateFromRequestParameter": false, - "encodeNonceFromRequestParameter": false, - "rpCacheExpirationInMinutes": 60, - "idTokenValidationCHashRequired": true, - "idTokenValidationAtHashRequired": true, - "acceptIdTokenWithoutSignature": true, - "validateUserInfoWithIdToken": true, - "encodeClientIdInAuthorizationUrl": true, - "defaultSiteConfig":{ - "op_configuration_endpoint":"", - "response_types":["code"], - "grant_type":["authorization_code"], - "acr_values":[""], - "scope":["openid", "profile", "email"], - "ui_locales":["en"], - "claims_locales":["en"], - "contacts":[], - "redirect_uris":[], - "logout_redirect_uris":[], - "client_name":"", - "client_jwks_uri":"", - "token_endpoint_auth_method":"", - "token_endpoint_auth_signing_alg":"", - "request_uris":[], - "front_channel_logout_uri":"", - "sector_identifier_uri":"", - "claims_redirect_uri":[], - "client_id":"", - "client_secret":"", - "trusted_client":false, - "access_token_as_jwt":false, - "access_token_signing_alg":"", - "rpt_as_jwt":false, - "logo_uri":"", - "client_uri":"", - "policy_uri":"", - "front_channel_logout_session_required":false, - "tos_uri":"", - "jwks":"", - "id_token_binding_cnf":"", - "tls_client_auth_subject_dn":"", - "run_introspection_script_beforeaccess_token_as_jwt_creation_and_include_claims":false, - "id_token_signed_response_alg":"", - "id_token_encrypted_response_alg":"", - "id_token_encrypted_response_enc":"", - "user_info_signed_response_alg":"", - "user_info_encrypted_response_alg":"", - "user_info_encrypted_response_enc":"", - "request_object_signing_alg":"", - "request_object_encryption_alg":"", - "request_object_encryption_enc":"", - "default_max_age":null, - "require_auth_time":false, - "initiate_login_uri":"", - "authorized_origins":[], - "access_token_lifetime":null, - "software_id":"", - "software_version":"", - "software_statement":"", - "custom_attributes":{} - } -} -',1); - diff --git a/jans-client-api/server/src/main/java/io/jans/ca/server/HttpException.java b/jans-client-api/server/src/main/java/io/jans/ca/server/HttpException.java deleted file mode 100644 index 57839f53196..00000000000 --- a/jans-client-api/server/src/main/java/io/jans/ca/server/HttpException.java +++ /dev/null @@ -1,52 +0,0 @@ -package io.jans.ca.server; - -import io.jans.ca.common.ErrorResponse; -import io.jans.ca.common.ErrorResponseCode; -import io.jans.ca.common.Jackson2; -import jakarta.ws.rs.WebApplicationException; -import jakarta.ws.rs.core.MediaType; -import jakarta.ws.rs.core.Response; - -import java.util.Objects; - -/** - * @author Yuriy Zabrovarnyy - */ -public class HttpException extends WebApplicationException { - - private final ErrorResponseCode code; - - public HttpException(ErrorResponseCode code) { - super(Response.status(code.getHttpStatus()).type(MediaType.APPLICATION_JSON_TYPE).entity(Jackson2.asJsonSilently(new ErrorResponse(code))).build()); - this.code = code; - } - - public ErrorResponseCode getCode() { - return code; - } - - public static HttpException internalError() { - return new HttpException(ErrorResponseCode.INTERNAL_ERROR_UNKNOWN); - } - - @Override - public boolean equals(Object o) { - if (this == o) return true; - if (o == null || getClass() != o.getClass()) return false; - HttpException that = (HttpException) o; - return code == that.code; - } - - @Override - public int hashCode() { - - return Objects.hash(code); - } - - @Override - public String toString() { - return "HttpException{" + - "code=" + code + - "} " + super.toString(); - } -} diff --git a/jans-client-api/server/src/main/java/io/jans/ca/server/Utils.java b/jans-client-api/server/src/main/java/io/jans/ca/server/Utils.java deleted file mode 100644 index 661d6b118aa..00000000000 --- a/jans-client-api/server/src/main/java/io/jans/ca/server/Utils.java +++ /dev/null @@ -1,187 +0,0 @@ -/** - * All rights reserved -- Copyright 2015 Gluu Inc. - */ -package io.jans.ca.server; - -import com.google.common.base.Joiner; -import com.google.common.base.Strings; -import io.jans.as.model.util.Util; -import io.jans.ca.common.ErrorResponseCode; -import io.jans.ca.server.rest.ApiApplication; -import org.apache.commons.codec.binary.Base64; -import org.apache.commons.lang.StringUtils; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import java.io.*; -import java.net.MalformedURLException; -import java.net.URL; -import java.net.URLDecoder; -import java.net.URLEncoder; -import java.util.*; -import java.util.stream.Collectors; - -/** - * Utility class with static methods. - * - * @author Yuriy Zabrovarnyy - */ -public class Utils { - - private static final Logger LOG = LoggerFactory.getLogger(Utils.class); - - private static final int ONE_HOUR_MILLIS = 60 * 60 * 1000; - - /** - * Application mode string - */ - private static final String APP_MODE = System.getProperty("app.mode"); - - /** - * Avoid instance creation. - */ - private Utils() { - } - - /** - * Returns whether app is in test mode. - * - * @return whether app is in test mode - */ - public static boolean isTestMode() { - return "test".equals(APP_MODE); - } - - public static String getUmaDiscoveryUrl(String p_amHost) { - return String.format("https://%s/.well-known/uma2-configuration", p_amHost); - } - - public static String joinAndUrlEncode(Collection list) throws UnsupportedEncodingException { - if (list == null || list.isEmpty()) { - return ""; - } - return encode(Joiner.on(" ").join(list)); - } - - public static String encode(String str) throws UnsupportedEncodingException { - return URLEncoder.encode(str, "UTF-8"); - } - - public static String decode(String str) throws UnsupportedEncodingException { - return URLDecoder.decode(str, "UTF-8"); - } - - public static int hoursDiff(Date earlierDate, Date laterDate) { - if (earlierDate == null || laterDate == null) { - return 0; - } - - int result = (int) ((laterDate.getTime() / ONE_HOUR_MILLIS) - (earlierDate.getTime() / ONE_HOUR_MILLIS)); - return result >= 0 ? result : 0; - } - - public static long date(Date date) { - return date != null ? date.getTime() / 1000 : 0; - } - - public static String encodeCredentials(String username, String password) throws UnsupportedEncodingException { - return Base64.encodeBase64String(Util.getBytes(username + ":" + password)); - } - - public static boolean isValidUrl(String url) { - if (StringUtils.isNotBlank(url)) { - try { - if (url.contains("#")) { - throw new HttpException(ErrorResponseCode.REDIRECT_URI_HAS_FRAGMENT_COMPONENT); - } - new URL(url); - return true; - } catch (MalformedURLException e) { - // ignore - } - } - return false; - } - - public static boolean isTrue(Boolean bool) { - return bool != null && bool; - } - - public static List stringToList(String source) { - return Arrays.asList(source.split("\\s+")); - } - - public static String mapAsStringWithEncodedValues(Map p_map) { - if (p_map != null && p_map.size() != 0) { - return p_map.entrySet().stream().map(e -> { - try { - return e.getKey() + "=" + encode(e.getValue()); - } catch (UnsupportedEncodingException e1) { - throw new RuntimeException(e1); - } - }).collect(Collectors.joining("&")); - } else { - return ""; - } - } - - public static Date addTimeToDate(Date date, int timeValue, int timeFormat) { - Calendar cal = Calendar.getInstance(); - cal.setTime(date); - cal.add(timeFormat, timeValue); - return cal.getTime(); - } - - public static Properties loadPropertiesFromFile(String filename, Properties props) { - - try (FileInputStream fileistream = new FileInputStream(filename)) { - if (props == null) { - props = new Properties(); - } - props.load(fileistream); - return props; - } catch (IOException | IllegalArgumentException e) { - throw new RuntimeException("Could not load properties from file " + filename, e); - } - } - - public static String getJansClientApiVersion() { - return !Strings.isNullOrEmpty(System.getProperty("projectVersion")) ? System.getProperty("projectVersion") : ApiApplication.class.getPackage().getImplementationVersion(); - } - - public static synchronized String readCompileProterty(String nameProperty) { - Properties prop = readCompileProperties(); - if (prop != null && prop.getProperty(nameProperty) != null) { - return prop.getProperty(nameProperty); - } else { - return null; - } - } - - public static Properties readCompileProperties() { - Properties prop = null; - File fileProperties = null; - try { - String fileName = "compile.properties"; - URL url = Utils.class - .getClassLoader() - .getResource(fileName); - if (url == null) { - throw new IllegalArgumentException(fileName + " is not found 1"); - } - fileProperties = new File(url.getFile()); - } catch (Exception e) { - LOG.error(e.getMessage(), e); - } - if (fileProperties != null) { - try (InputStream input = new FileInputStream(fileProperties)) { - prop = new Properties(); - // load a properties file - prop.load(input); - } catch (IOException ex) { - LOG.error(ex.getMessage(), ex); - } - } - return prop; - } -} diff --git a/jans-client-api/server/src/main/java/io/jans/ca/server/configuration/ApiAppConfiguration.java b/jans-client-api/server/src/main/java/io/jans/ca/server/configuration/ApiAppConfiguration.java deleted file mode 100644 index 80f228a0c16..00000000000 --- a/jans-client-api/server/src/main/java/io/jans/ca/server/configuration/ApiAppConfiguration.java +++ /dev/null @@ -1,523 +0,0 @@ -package io.jans.ca.server.configuration; - -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.databind.JsonNode; -import com.google.common.collect.Lists; -import io.jans.as.model.configuration.Configuration; -import io.jans.ca.common.proxy.ProxyConfiguration; -import io.jans.ca.server.configuration.model.Rp; - -import java.util.List; - -@JsonIgnoreProperties(ignoreUnknown = true) -public class ApiAppConfiguration implements Configuration { - - private String loggingLevel; - private String loggingLayout; - private String externalLoggerConfiguration; - private Boolean disableJdkLogger = true; - - //Jans Client Api properties - private String registerClientAppType = "web"; - private String registerClientResponesType = "code"; - private Boolean useClientAuthenticationForPat = true; - private Boolean trustAllCerts; - private String keyStorePath; - private String keyStorePassword; - private Boolean enableJwksGeneration = true; - private String cryptProviderKeyStorePath; - private String cryptProviderKeyStorePassword; - private String cryptProviderDnName; - private int jwksExpirationInHours = 720; - private int jwksRegenerationIntervalInHours = 720; - private Boolean supportGoogleLogout = true; - private int stateExpirationInMinutes = 5; - private int nonceExpirationInMinutes = 5; - private int requestObjectExpirationInMinutes = 5; - private int dbCleanupIntervalInHours = 1; - private int rpCacheExpirationInMinutes = 60; - private int publicOpKeyCacheExpirationInMinutes = 60; - private Boolean protectCommandsWithAccessToken = false; - private Boolean acceptIdTokenWithoutSignature = false; - private Boolean idTokenValidationCHashRequired = true; - private Boolean idTokenValidationAtHashRequired = true; - private Boolean idTokenValidationSHashRequired = false; - private Boolean validateUserInfoWithIdToken = false; - private Boolean uma2AutoRegisterClaimsGatheringEndpointAsRedirectUriOfClient; - private Boolean addClientCredentialsGrantTypeAutomaticallyDuringClientRegistration = true; - private String migrationSourceFolderPath; - private List allowedOpHosts = Lists.newArrayList(); - private String storage; - private JsonNode storageConfiguration; - private Rp defaultSiteConfig; - private ProxyConfiguration proxyConfiguration; - private List protectCommandsWithRpId; - private int persistenceManagerRemoveCount = 1000; - private List bindIpAddresses; - private List tlsVersion; - private List tlsSecureCipher; - private Boolean mtlsEnabled = false; - private String mtlsClientKeyStorePath; - private String mtlsClientKeyStorePassword; - private Boolean encodeStateFromRequestParameter = false; - private Boolean encodeNonceFromRequestParameter = false; - private Boolean fapiEnabled = false; - private int iatExpirationInHours = 1; - private Boolean encodeClientIdInAuthorizationUrl = false; - - public String getLoggingLevel() { - return loggingLevel; - } - - public void setLoggingLevel(String loggingLevel) { - this.loggingLevel = loggingLevel; - } - - public String getLoggingLayout() { - return loggingLayout; - } - - public void setLoggingLayout(String loggingLayout) { - this.loggingLayout = loggingLayout; - } - - public String getExternalLoggerConfiguration() { - return externalLoggerConfiguration; - } - - public void setExternalLoggerConfiguration(String externalLoggerConfiguration) { - this.externalLoggerConfiguration = externalLoggerConfiguration; - } - - public Boolean getDisableJdkLogger() { - return disableJdkLogger; - } - - public void setDisableJdkLogger(Boolean disableJdkLogger) { - this.disableJdkLogger = disableJdkLogger; - } - - public String getRegisterClientAppType() { - return registerClientAppType; - } - - public void setRegisterClientAppType(String registerClientAppType) { - this.registerClientAppType = registerClientAppType; - } - - public String getRegisterClientResponesType() { - return registerClientResponesType; - } - - public void setRegisterClientResponesType(String registerClientResponesType) { - this.registerClientResponesType = registerClientResponesType; - } - - public Boolean getUseClientAuthenticationForPat() { - return useClientAuthenticationForPat; - } - - public void setUseClientAuthenticationForPat(Boolean useClientAuthenticationForPat) { - this.useClientAuthenticationForPat = useClientAuthenticationForPat; - } - - public Boolean getTrustAllCerts() { - return trustAllCerts; - } - - public void setTrustAllCerts(Boolean trustAllCerts) { - this.trustAllCerts = trustAllCerts; - } - - public String getKeyStorePath() { - return keyStorePath; - } - - public void setKeyStorePath(String keyStorePath) { - this.keyStorePath = keyStorePath; - } - - public String getKeyStorePassword() { - return keyStorePassword; - } - - public void setKeyStorePassword(String keyStorePassword) { - this.keyStorePassword = keyStorePassword; - } - - public Boolean getEnableJwksGeneration() { - return enableJwksGeneration; - } - - public void setEnableJwksGeneration(Boolean enableJwksGeneration) { - this.enableJwksGeneration = enableJwksGeneration; - } - - public String getCryptProviderKeyStorePath() { - return cryptProviderKeyStorePath; - } - - public void setCryptProviderKeyStorePath(String cryptProviderKeyStorePath) { - this.cryptProviderKeyStorePath = cryptProviderKeyStorePath; - } - - public String getCryptProviderKeyStorePassword() { - return cryptProviderKeyStorePassword; - } - - public void setCryptProviderKeyStorePassword(String cryptProviderKeyStorePassword) { - this.cryptProviderKeyStorePassword = cryptProviderKeyStorePassword; - } - - public String getCryptProviderDnName() { - return cryptProviderDnName; - } - - public void setCryptProviderDnName(String cryptProviderDnName) { - this.cryptProviderDnName = cryptProviderDnName; - } - - public int getJwksExpirationInHours() { - return jwksExpirationInHours; - } - - public void setJwksExpirationInHours(int jwksExpirationInHours) { - this.jwksExpirationInHours = jwksExpirationInHours; - } - - public int getJwksRegenerationIntervalInHours() { - return jwksRegenerationIntervalInHours; - } - - public void setJwksRegenerationIntervalInHours(int jwksRegenerationIntervalInHours) { - this.jwksRegenerationIntervalInHours = jwksRegenerationIntervalInHours; - } - - public Boolean getSupportGoogleLogout() { - return supportGoogleLogout; - } - - public void setSupportGoogleLogout(Boolean supportGoogleLogout) { - this.supportGoogleLogout = supportGoogleLogout; - } - - public int getStateExpirationInMinutes() { - return stateExpirationInMinutes; - } - - public void setStateExpirationInMinutes(int stateExpirationInMinutes) { - this.stateExpirationInMinutes = stateExpirationInMinutes; - } - - public int getNonceExpirationInMinutes() { - return nonceExpirationInMinutes; - } - - public void setNonceExpirationInMinutes(int nonceExpirationInMinutes) { - this.nonceExpirationInMinutes = nonceExpirationInMinutes; - } - - public int getRequestObjectExpirationInMinutes() { - return requestObjectExpirationInMinutes; - } - - public void setRequestObjectExpirationInMinutes(int requestObjectExpirationInMinutes) { - this.requestObjectExpirationInMinutes = requestObjectExpirationInMinutes; - } - - public int getDbCleanupIntervalInHours() { - return dbCleanupIntervalInHours; - } - - public void setDbCleanupIntervalInHours(int dbCleanupIntervalInHours) { - this.dbCleanupIntervalInHours = dbCleanupIntervalInHours; - } - - public int getRpCacheExpirationInMinutes() { - return rpCacheExpirationInMinutes; - } - - public void setRpCacheExpirationInMinutes(int rpCacheExpirationInMinutes) { - this.rpCacheExpirationInMinutes = rpCacheExpirationInMinutes; - } - - public int getPublicOpKeyCacheExpirationInMinutes() { - return publicOpKeyCacheExpirationInMinutes; - } - - public void setPublicOpKeyCacheExpirationInMinutes(int publicOpKeyCacheExpirationInMinutes) { - this.publicOpKeyCacheExpirationInMinutes = publicOpKeyCacheExpirationInMinutes; - } - - public Boolean getProtectCommandsWithAccessToken() { - return protectCommandsWithAccessToken; - } - - public void setProtectCommandsWithAccessToken(Boolean protectCommandsWithAccessToken) { - this.protectCommandsWithAccessToken = protectCommandsWithAccessToken; - } - - public Boolean getAcceptIdTokenWithoutSignature() { - return acceptIdTokenWithoutSignature; - } - - public void setAcceptIdTokenWithoutSignature(Boolean acceptIdTokenWithoutSignature) { - this.acceptIdTokenWithoutSignature = acceptIdTokenWithoutSignature; - } - - public Boolean getIdTokenValidationCHashRequired() { - return idTokenValidationCHashRequired; - } - - public void setIdTokenValidationCHashRequired(Boolean idTokenValidationCHashRequired) { - this.idTokenValidationCHashRequired = idTokenValidationCHashRequired; - } - - public Boolean getIdTokenValidationAtHashRequired() { - return idTokenValidationAtHashRequired; - } - - public void setIdTokenValidationAtHashRequired(Boolean idTokenValidationAtHashRequired) { - this.idTokenValidationAtHashRequired = idTokenValidationAtHashRequired; - } - - public Boolean getIdTokenValidationSHashRequired() { - return idTokenValidationSHashRequired; - } - - public void setIdTokenValidationSHashRequired(Boolean idTokenValidationSHashRequired) { - this.idTokenValidationSHashRequired = idTokenValidationSHashRequired; - } - - public Boolean getValidateUserInfoWithIdToken() { - return validateUserInfoWithIdToken; - } - - public void setValidateUserInfoWithIdToken(Boolean validateUserInfoWithIdToken) { - this.validateUserInfoWithIdToken = validateUserInfoWithIdToken; - } - - public Boolean getUma2AutoRegisterClaimsGatheringEndpointAsRedirectUriOfClient() { - return uma2AutoRegisterClaimsGatheringEndpointAsRedirectUriOfClient; - } - - public void setUma2AutoRegisterClaimsGatheringEndpointAsRedirectUriOfClient(Boolean uma2AutoRegisterClaimsGatheringEndpointAsRedirectUriOfClient) { - this.uma2AutoRegisterClaimsGatheringEndpointAsRedirectUriOfClient = uma2AutoRegisterClaimsGatheringEndpointAsRedirectUriOfClient; - } - - public Boolean getAddClientCredentialsGrantTypeAutomaticallyDuringClientRegistration() { - return addClientCredentialsGrantTypeAutomaticallyDuringClientRegistration; - } - - public void setAddClientCredentialsGrantTypeAutomaticallyDuringClientRegistration(Boolean addClientCredentialsGrantTypeAutomaticallyDuringClientRegistration) { - this.addClientCredentialsGrantTypeAutomaticallyDuringClientRegistration = addClientCredentialsGrantTypeAutomaticallyDuringClientRegistration; - } - - public String getMigrationSourceFolderPath() { - return migrationSourceFolderPath; - } - - public void setMigrationSourceFolderPath(String migrationSourceFolderPath) { - this.migrationSourceFolderPath = migrationSourceFolderPath; - } - - public List getAllowedOpHosts() { - return allowedOpHosts; - } - - public void setAllowedOpHosts(List allowedOpHosts) { - this.allowedOpHosts = allowedOpHosts; - } - - public String getStorage() { - return storage; - } - - public void setStorage(String storage) { - this.storage = storage; - } - - public JsonNode getStorageConfiguration() { - return storageConfiguration; - } - - public void setStorageConfiguration(JsonNode storageConfiguration) { - this.storageConfiguration = storageConfiguration; - } - - public Rp getDefaultSiteConfig() { - return defaultSiteConfig; - } - - public void setDefaultSiteConfig(Rp defaultSiteConfig) { - this.defaultSiteConfig = defaultSiteConfig; - } - - public ProxyConfiguration getProxyConfiguration() { - return proxyConfiguration; - } - - public void setProxyConfiguration(ProxyConfiguration proxyConfiguration) { - this.proxyConfiguration = proxyConfiguration; - } - - public List getProtectCommandsWithRpId() { - return protectCommandsWithRpId; - } - - public void setProtectCommandsWithRpId(List protectCommandsWithRpId) { - this.protectCommandsWithRpId = protectCommandsWithRpId; - } - - public int getPersistenceManagerRemoveCount() { - return persistenceManagerRemoveCount; - } - - public void setPersistenceManagerRemoveCount(int persistenceManagerRemoveCount) { - this.persistenceManagerRemoveCount = persistenceManagerRemoveCount; - } - - public List getBindIpAddresses() { - return bindIpAddresses; - } - - public void setBindIpAddresses(List bindIpAddresses) { - this.bindIpAddresses = bindIpAddresses; - } - - public List getTlsVersion() { - return tlsVersion; - } - - public void setTlsVersion(List tlsVersion) { - this.tlsVersion = tlsVersion; - } - - public List getTlsSecureCipher() { - return tlsSecureCipher; - } - - public void setTlsSecureCipher(List tlsSecureCipher) { - this.tlsSecureCipher = tlsSecureCipher; - } - - public Boolean getMtlsEnabled() { - return mtlsEnabled; - } - - public void setMtlsEnabled(Boolean mtlsEnabled) { - this.mtlsEnabled = mtlsEnabled; - } - - public String getMtlsClientKeyStorePath() { - return mtlsClientKeyStorePath; - } - - public void setMtlsClientKeyStorePath(String mtlsClientKeyStorePath) { - this.mtlsClientKeyStorePath = mtlsClientKeyStorePath; - } - - public String getMtlsClientKeyStorePassword() { - return mtlsClientKeyStorePassword; - } - - public void setMtlsClientKeyStorePassword(String mtlsClientKeyStorePassword) { - this.mtlsClientKeyStorePassword = mtlsClientKeyStorePassword; - } - - public Boolean getEncodeStateFromRequestParameter() { - return encodeStateFromRequestParameter; - } - - public void setEncodeStateFromRequestParameter(Boolean encodeStateFromRequestParameter) { - this.encodeStateFromRequestParameter = encodeStateFromRequestParameter; - } - - public Boolean getEncodeNonceFromRequestParameter() { - return encodeNonceFromRequestParameter; - } - - public void setEncodeNonceFromRequestParameter(Boolean encodeNonceFromRequestParameter) { - this.encodeNonceFromRequestParameter = encodeNonceFromRequestParameter; - } - - public Boolean getFapiEnabled() { - return fapiEnabled; - } - - public void setFapiEnabled(Boolean fapiEnabled) { - this.fapiEnabled = fapiEnabled; - } - - public int getIatExpirationInHours() { - return iatExpirationInHours; - } - - public void setIatExpirationInHours(int iatExpirationInHours) { - this.iatExpirationInHours = iatExpirationInHours; - } - - public Boolean getEncodeClientIdInAuthorizationUrl() { - return encodeClientIdInAuthorizationUrl; - } - - public void setEncodeClientIdInAuthorizationUrl(Boolean encodeClientIdInAuthorizationUrl) { - this.encodeClientIdInAuthorizationUrl = encodeClientIdInAuthorizationUrl; - } - - @Override - public String toString() { - return "ApiAppConfiguration{" + - ", loggingLevel='" + loggingLevel + '\'' + - ", loggingLayout='" + loggingLayout + '\'' + - ", externalLoggerConfiguration='" + externalLoggerConfiguration + '\'' + - ", disableJdkLogger=" + disableJdkLogger + - ", registerClientAppType='" + registerClientAppType + '\'' + - ", registerClientResponesType='" + registerClientResponesType + '\'' + - ", useClientAuthenticationForPat=" + useClientAuthenticationForPat + - ", trustAllCerts=" + trustAllCerts + - ", keyStorePath='" + keyStorePath + '\'' + - ", keyStorePassword='" + keyStorePassword + '\'' + - ", enableJwksGeneration=" + enableJwksGeneration + - ", cryptProviderKeyStorePath='" + cryptProviderKeyStorePath + '\'' + - ", cryptProviderKeyStorePassword='" + cryptProviderKeyStorePassword + '\'' + - ", cryptProviderDnName='" + cryptProviderDnName + '\'' + - ", jwksExpirationInHours=" + jwksExpirationInHours + - ", jwksRegenerationIntervalInHours=" + jwksRegenerationIntervalInHours + - ", supportGoogleLogout=" + supportGoogleLogout + - ", stateExpirationInMinutes=" + stateExpirationInMinutes + - ", nonceExpirationInMinutes=" + nonceExpirationInMinutes + - ", requestObjectExpirationInMinutes=" + requestObjectExpirationInMinutes + - ", dbCleanupIntervalInHours=" + dbCleanupIntervalInHours + - ", rpCacheExpirationInMinutes=" + rpCacheExpirationInMinutes + - ", publicOpKeyCacheExpirationInMinutes=" + publicOpKeyCacheExpirationInMinutes + - ", protectCommandsWithAccessToken=" + protectCommandsWithAccessToken + - ", acceptIdTokenWithoutSignature=" + acceptIdTokenWithoutSignature + - ", idTokenValidationCHashRequired=" + idTokenValidationCHashRequired + - ", idTokenValidationAtHashRequired=" + idTokenValidationAtHashRequired + - ", idTokenValidationSHashRequired=" + idTokenValidationSHashRequired + - ", validateUserInfoWithIdToken=" + validateUserInfoWithIdToken + - ", uma2AuthRegisterClaimsGatheringEndpointAsRedirectUriOfClient=" + uma2AutoRegisterClaimsGatheringEndpointAsRedirectUriOfClient + - ", addClientCredentialsGrantTypeAutomaticallyDuringClientRegistration=" + addClientCredentialsGrantTypeAutomaticallyDuringClientRegistration + - ", migrationSourceFolderPath='" + migrationSourceFolderPath + '\'' + - ", allowedOpHosts=" + allowedOpHosts + - ", storage='" + storage + '\'' + - ", storageConfiguration=" + storageConfiguration + - ", defaultSiteConfig=" + defaultSiteConfig + - ", proxyConfiguration=" + proxyConfiguration + - ", protectCommandsWithRpId=" + protectCommandsWithRpId + - ", persistenceManagerRemoveCount=" + persistenceManagerRemoveCount + - ", bindIpAddresses=" + bindIpAddresses + - ", tlsVersion=" + tlsVersion + - ", tlsSecureCipher=" + tlsSecureCipher + - ", mtlsEnabled=" + mtlsEnabled + - ", mtlsClientKeyStorePath='" + mtlsClientKeyStorePath + '\'' + - ", mtlsClientKeyStorePassword='" + mtlsClientKeyStorePassword + '\'' + - ", encodeStateFromRequestParameter=" + encodeStateFromRequestParameter + - ", encodeNonceFromRequestParameter=" + encodeNonceFromRequestParameter + - ", fapiEnabled=" + fapiEnabled + - ", iatExpirationInHours=" + iatExpirationInHours + - ", encodeClientIdInAuthorizationUrl=" + encodeClientIdInAuthorizationUrl + - '}'; - } -} diff --git a/jans-client-api/server/src/main/java/io/jans/ca/server/configuration/AppInitializer.java b/jans-client-api/server/src/main/java/io/jans/ca/server/configuration/AppInitializer.java deleted file mode 100644 index a4fd2769c04..00000000000 --- a/jans-client-api/server/src/main/java/io/jans/ca/server/configuration/AppInitializer.java +++ /dev/null @@ -1,239 +0,0 @@ -package io.jans.ca.server.configuration; - -/* - * Janssen Project software is available under the MIT License (2008). See http://opensource.org/licenses/MIT for full text. - * - * Copyright (c) 2020, Janssen Project - */ - -import io.jans.as.common.service.common.ApplicationFactory; -import io.jans.as.model.util.SecurityProviderUtility; -import io.jans.ca.server.persistence.service.PersistenceServiceImpl; -import io.jans.ca.server.security.service.AuthorizationService; -import io.jans.ca.server.security.service.ClientApiAuthorizationService; -import io.jans.ca.server.service.RpService; -import io.jans.ca.server.service.logger.LoggerServiceImpl; -import io.jans.exception.ConfigurationException; -import io.jans.orm.PersistenceEntryManager; -import io.jans.orm.PersistenceEntryManagerFactory; -import io.jans.orm.model.PersistenceConfiguration; -import io.jans.orm.service.PersistanceFactoryService; -import io.jans.orm.util.properties.FileConfiguration; -import io.jans.service.PythonService; -import io.jans.service.cdi.event.LdapConfigurationReload; -import io.jans.service.cdi.util.CdiUtil; -import io.jans.service.timer.QuartzSchedulerManager; -import io.jans.util.StringHelper; -import io.jans.util.security.PropertiesDecrypter; -import io.jans.util.security.StringEncrypter; -import jakarta.enterprise.context.ApplicationScoped; -import jakarta.enterprise.context.BeforeDestroyed; -import jakarta.enterprise.context.Initialized; -import jakarta.enterprise.event.Observes; -import jakarta.enterprise.inject.Instance; -import jakarta.enterprise.inject.Produces; -import jakarta.enterprise.inject.spi.BeanManager; -import jakarta.inject.Inject; -import jakarta.inject.Named; -import jakarta.servlet.ServletContext; -import org.jboss.resteasy.plugins.providers.RegisterBuiltin; -import org.jboss.resteasy.plugins.providers.jackson.ResteasyJackson2Provider; -import org.jboss.resteasy.plugins.server.servlet.ResteasyContextParameters; -import org.jboss.resteasy.spi.ResteasyProviderFactory; -import org.slf4j.Logger; - -import java.util.Properties; - -@ApplicationScoped -public class AppInitializer { - - private static final int RETRIES = 15; - private static final int RETRY_INTERVAL = 15; - private static final String DEFAULT_CONF_BASE = "/etc/jans/conf"; - - @Inject - Logger logger; - @Inject - @Named(ApplicationFactory.PERSISTENCE_ENTRY_MANAGER_NAME) - Instance persistenceEntryManagerInstance; - @Inject - private Instance authorizationServiceInstance; - @Inject - BeanManager beanManager; - - @Inject - private StringEncrypter stringEncrypter; - - @Inject - private PersistanceFactoryService persistanceFactoryService; - - @Inject - private QuartzSchedulerManager quartzSchedulerManager; - - @Inject - ConfigurationFactory configurationFactory; - - @Inject - private PythonService pythonService; - - @Inject - private LoggerServiceImpl loggerService; - - @Inject - PersistenceConfiguration persistenceConfiguration; - @Inject - PersistenceServiceImpl persistenceService; - @Inject - RpService rpService; - - public void onStart(@Observes @Initialized(ApplicationScoped.class) Object init) { - - if (System.getProperties().containsKey("test.client.api.url")) { - return; - } - logger.info("============= STARTING CLIENT API APPLICATION ========================"); - logger.info("init:{}", init); - - // Resteasy config - Turn off the default patch filter - System.setProperty(ResteasyContextParameters.RESTEASY_PATCH_FILTER_DISABLED, "true"); - ResteasyProviderFactory instance = ResteasyProviderFactory.getInstance(); - RegisterBuiltin.register(instance); - instance.registerProvider(ResteasyJackson2Provider.class); - - // configuration - configurationFactory.create(); - persistenceEntryManagerInstance.get(); - this.createAuthorizationService(); - - // Initialize python interpreter - pythonService.initPythonInterpreter(configurationFactory.getBaseConfiguration().getString("pythonModulesDir", null)); - - // Start timer - initSchedulerService(); - - // Schedule timer tasks - loggerService.initTimer(); - - // Schedule timer tasks - configurationFactory.initTimer(); - - //Clear RP Test Data with System param - if (System.getProperties().containsKey("clearTestData")) { - clearRPTestData(); - } - - logger.info("============== CLIENT API APPLICATION IS UP AND RUNNING ==================="); - } - - @Produces - @ApplicationScoped - public ConfigurationFactory getConfigurationFactory() { - return configurationFactory; - } - - @Produces - @ApplicationScoped - @Named(ApplicationFactory.PERSISTENCE_ENTRY_MANAGER_NAME) - public PersistenceEntryManager createPersistenceEntryManager() throws InterruptedException { - - logger.debug("Obtaining PersistenceEntryManagerFactory from persistence API"); - FileConfiguration persistenceConfig = persistenceConfiguration.getConfiguration(); - Properties backendProperties = persistenceConfig.getProperties(); - PersistenceEntryManagerFactory factory = persistanceFactoryService.getPersistenceEntryManagerFactory(persistenceConfiguration); - - String type = factory.getPersistenceType(); - logger.info("Underlying database of type '{}' detected", type); - String file = String.format("%s/%s", DEFAULT_CONF_BASE, persistenceConfiguration.getFileName()); - logger.info("Using config file: {}", file); - - logger.debug("Decrypting backend properties"); - backendProperties = PropertiesDecrypter.decryptAllProperties(stringEncrypter, backendProperties); - - logger.info("Obtaining a Persistence EntryManager"); - int i = 0; - PersistenceEntryManager entryManager = null; - - do { - try { - logger.info("Read backend properties: {}", backendProperties); - i++; - entryManager = factory.createEntryManager(backendProperties); - logger.info("PersistenceEntryManager read: {}", entryManager); - } catch (Exception e) { - logger.warn("Unable to create persistence entry manager, retrying in {} seconds", RETRY_INTERVAL); - Thread.sleep(RETRY_INTERVAL * 1000L); - } - } while (entryManager == null && i < RETRIES); - - if (entryManager == null) { - logger.error("No EntryManager could be obtained"); - } - return entryManager; - - } - - @Produces - @ApplicationScoped - @Named("authorizationService") - private AuthorizationService createAuthorizationService() { - logger.info("============= AppInitializer::createAuthorizationService() ================ "); - try { - return authorizationServiceInstance.select(ClientApiAuthorizationService.class).get(); - } catch (Exception ex) { - if (logger.isErrorEnabled()) { - logger.error("Failed to create AuthorizationService instance - exception:{} ", ex); - } - throw new ConfigurationException("Failed to create AuthorizationService instance , ", ex); - } - } - - public void recreatePersistanceEntryManager(@Observes @LdapConfigurationReload String event) { - closePersistenceEntryManager(); - PersistenceEntryManager ldapEntryManager = persistenceEntryManagerInstance.get(); - persistenceEntryManagerInstance.destroy(ldapEntryManager); - logger.debug("Recreated instance {} with operation service: {} - event:{}", ldapEntryManager, ldapEntryManager.getOperationService(), event); - } - - private void closePersistenceEntryManager() { - PersistenceEntryManager oldInstance = CdiUtil.getContextBean(beanManager, PersistenceEntryManager.class, ApplicationFactory.PERSISTENCE_ENTRY_MANAGER_NAME); - if (oldInstance == null || oldInstance.getOperationService() == null) return; - - logger.debug("Attempting to destroy {} with operation service: {}", oldInstance, oldInstance.getOperationService()); - oldInstance.destroy(); - logger.debug("Destroyed {} with operation service: {}", oldInstance, oldInstance.getOperationService()); - } - - public void destroy(@Observes @BeforeDestroyed(ApplicationScoped.class) ServletContext context) { - logger.info("================================================================"); - logger.info("=========== jans-client-api service STOPPED =========================="); - logger.info("servletContext:{}", context); - - logger.info("================================================================"); - } - - protected void initSchedulerService() { - logger.debug("Initializing Scheduler Service"); - quartzSchedulerManager.start(); - - String disableScheduler = System.getProperties().getProperty("gluu.disable.scheduler"); - if (Boolean.parseBoolean(disableScheduler)) { - this.logger.warn("Suspending Quartz Scheduler Service..."); - quartzSchedulerManager.standby(); - } - } - - private void clearRPTestData() { - try { - String val = System.getProperty("clearTestData"); - if (val != null && !val.isEmpty() && Boolean.parseBoolean(val)) { - persistenceService.create(); - rpService.removeAllRps(); - rpService.load(); - } - } catch (Exception e) { - logger.error("Failed to execute clearTestData action", e); - } - } - - -} diff --git a/jans-client-api/server/src/main/java/io/jans/ca/server/configuration/ConfigurationFactory.java b/jans-client-api/server/src/main/java/io/jans/ca/server/configuration/ConfigurationFactory.java deleted file mode 100644 index df21e45b972..00000000000 --- a/jans-client-api/server/src/main/java/io/jans/ca/server/configuration/ConfigurationFactory.java +++ /dev/null @@ -1,442 +0,0 @@ -/* - * Janssen Project software is available under the MIT License (2008). See http://opensource.org/licenses/MIT for full text. - * - * Copyright (c) 2020, Janssen Project - */ - -package io.jans.ca.server.configuration; - -import io.jans.as.model.config.BaseDnConfiguration; -import io.jans.as.model.config.Constants; -import io.jans.as.model.config.StaticConfiguration; -import io.jans.as.model.configuration.Configuration; -import io.jans.as.model.util.SecurityProviderUtility; -import io.jans.ca.server.Utils; -import io.jans.ca.server.configuration.model.ApiConf; -import io.jans.ca.server.op.OpClientFactoryImpl; -import io.jans.ca.server.persistence.service.MainPersistenceService; -import io.jans.ca.server.service.*; -import io.jans.exception.ConfigurationException; -import io.jans.orm.PersistenceEntryManager; -import io.jans.orm.exception.BasePersistenceException; -import io.jans.orm.model.PersistenceConfiguration; -import io.jans.orm.service.PersistanceFactoryService; -import io.jans.service.cdi.async.Asynchronous; -import io.jans.service.cdi.event.*; -import io.jans.service.timer.event.TimerEvent; -import io.jans.service.timer.schedule.TimerSchedule; -import io.jans.util.StringHelper; -import io.jans.util.properties.FileConfiguration; -import io.jans.util.security.StringEncrypter; -import org.apache.commons.lang.StringUtils; -import org.slf4j.Logger; - -import jakarta.annotation.PostConstruct; -import jakarta.annotation.Priority; -import jakarta.enterprise.context.ApplicationScoped; -import jakarta.enterprise.event.Event; -import jakarta.enterprise.event.Observes; -import jakarta.enterprise.inject.Alternative; -import jakarta.enterprise.inject.Instance; -import jakarta.enterprise.inject.Produces; -import jakarta.inject.Inject; - -import java.io.*; -import java.util.concurrent.atomic.AtomicBoolean; - -/** - * @author Yuriy Movchan Date: 05/13/2020 - */ -@ApplicationScoped -@Alternative -@Priority(1) -public class ConfigurationFactory { - - public static final String CONFIGURATION_ENTRY_DN = "clientApi_ConfigurationEntryDN"; - public static final String JANS_BASE_CONFIG = "jans.base"; - - static { - if (System.getProperty(JANS_BASE_CONFIG) != null) { - BASE_DIR = System.getProperty(JANS_BASE_CONFIG); - } else if ((System.getProperty("catalina.base") != null) && (System.getProperty("catalina.base.ignore") == null)) { - BASE_DIR = System.getProperty("catalina.base"); - } else if (System.getProperty("catalina.home") != null) { - BASE_DIR = System.getProperty("catalina.home"); - } else if (System.getProperty("jboss.home.dir") != null) { - BASE_DIR = System.getProperty("jboss.home.dir"); - } else { - String jansBase = Utils.readCompileProterty("compile.jans.base"); - BASE_DIR = jansBase; - System.setProperty(JANS_BASE_CONFIG, jansBase); - } - } - - @Inject - private Logger log; - - @Inject - private Event timerEvent; - - @Inject - private Event configurationUpdateEvent; - - @Inject - private Event event; - - @Inject - private Instance persistenceEntryManagerInstance; - - @Inject - private PersistanceFactoryService persistanceFactoryService; - - @Inject - private Instance configurationInstance; - - @Inject - ValidationService validationService; - - @Inject - MainPersistenceService jansConfigurationService; - - @Inject - RpSyncService rpSyncService; - - @Inject - KeyGeneratorService keyGeneratorService; - - @Inject - DiscoveryService discoveryService; - - @Inject - RpService rpService; - - @Inject - StateService stateService; - - @Inject - UmaTokenService umaTokenService; - - @Inject - PublicOpKeyService publicOpKeyService; - - @Inject - RequestObjectService requestObjectService; - - @Inject - OpClientFactoryImpl opClientFactory; - - @Inject - IntrospectionService introspectionService; - - public static final String PERSISTENCE_CONFIGUARION_RELOAD_EVENT_TYPE = "persistenceConfigurationReloadEvent"; - public static final String BASE_CONFIGUARION_RELOAD_EVENT_TYPE = "baseConfigurationReloadEvent"; - private static final int DEFAULT_INTERVAL = 30; // 30 seconds - private AtomicBoolean isActive; - private long baseConfigurationFileLastModifiedTime; - - - // base dir - private static final String BASE_DIR; - private static final String DIR = BASE_DIR + File.separator + "conf" + File.separator; - - private static final String BASE_PROPERTIES_FILE = DIR + Constants.BASE_PROPERTIES_FILE_NAME; - private static final String APP_PROPERTIES_FILE = DIR + Constants.LDAP_PROPERTIES_FILE_NAME; - private static final String SALT_FILE_NAME = Constants.SALT_FILE_NAME; - - private String saltFilePath; - - private boolean apiConfigloaded = false; - - private FileConfiguration baseConfiguration; - - private PersistenceConfiguration persistenceConfiguration; - private ApiAppConfiguration dynamicConf; - private StaticConfiguration staticConf; - private String cryptoConfigurationSalt; - private long loadedRevision = -1; - private boolean loadedFromLdap = true; - - @Produces - @ApplicationScoped - private ServiceProvider getServiceProvider() { - ServiceProvider serviceProvider = new ServiceProvider(); - serviceProvider.setRpService(rpService); - serviceProvider.setConfigurationService(jansConfigurationService); - serviceProvider.setDiscoveryService(discoveryService); - serviceProvider.setValidationService(validationService); - serviceProvider.setHttpService(discoveryService.getHttpService()); - serviceProvider.setRpSyncService(rpSyncService); - serviceProvider.setStateService(stateService); - serviceProvider.setUmaTokenService(umaTokenService); - serviceProvider.setKeyGeneratorService(keyGeneratorService); - serviceProvider.setPublicOpKeyService(publicOpKeyService); - serviceProvider.setRequestObjectService(requestObjectService); - serviceProvider.setOpClientFactory(opClientFactory); - serviceProvider.setIntrospectionService(introspectionService); - return serviceProvider; - } - - @Produces - @ApplicationScoped - public PersistenceConfiguration getPersistenceConfiguration() { - return persistenceConfiguration; - } - - @Produces - @ApplicationScoped - public ApiAppConfiguration getAppConfiguration() { - return dynamicConf; - } - - @Produces - @ApplicationScoped - public StaticConfiguration getStaticConfiguration() { - return staticConf; - } - - @PostConstruct - public void init() { - log.info("Initializing ConfigurationFactory ..."); - this.isActive = new AtomicBoolean(true); - try { - log.info("---------PATH to file configuration: {}", APP_PROPERTIES_FILE); - this.persistenceConfiguration = persistanceFactoryService.loadPersistenceConfiguration(APP_PROPERTIES_FILE); - loadBaseConfiguration(); - - this.saltFilePath = confDir() + SALT_FILE_NAME; - loadCryptoConfigurationSalt(); - - installSecurityProvider(); - } finally { - this.isActive.set(false); - } - } - - public void create() { - log.info("Loading Configuration ..."); - if (!loadApiConfigFromDb()) { - log.error("Failed to load api configuration from persistence. Please fix it!!!."); - throw new ConfigurationException("Failed to load api configuration from persistence."); - } else { - log.info("Api Configuration loaded successfully - apiLoadedRevision:{}, ApiAppConfiguration:{}", this.loadedRevision, getAppConfiguration()); - } - } - - public void initTimer() { - log.debug("Initializing Configuration Timer"); - - final int delay = 30; - - timerEvent.fire(new TimerEvent(new TimerSchedule(delay, DEFAULT_INTERVAL), new ConfigurationEvent(), Scheduled.Literal.INSTANCE)); - } - - @Asynchronous - public void reloadConfigurationTimerEvent(@Observes @Scheduled ConfigurationEvent configurationEvent) { - if (this.isActive.get()) { - return; - } - - if (!this.isActive.compareAndSet(false, true)) { - return; - } - - try { - reloadConfiguration(); - } catch (Exception ex) { - log.error("Exception happened while reloading application configuration", ex); - } finally { - this.isActive.set(false); - } - } - - private void reloadConfiguration() { - // Reload LDAP configuration if needed - PersistenceConfiguration newPersistenceConfiguration = persistanceFactoryService.loadPersistenceConfiguration(APP_PROPERTIES_FILE); - - if (!StringHelper.equalsIgnoreCase(this.persistenceConfiguration.getFileName(), newPersistenceConfiguration.getFileName()) - || newPersistenceConfiguration.getLastModifiedTime() > this.persistenceConfiguration.getLastModifiedTime()) { - // Reload configuration only if it was modified - this.persistenceConfiguration = newPersistenceConfiguration; - event.select(LdapConfigurationReload.Literal.INSTANCE).fire(PERSISTENCE_CONFIGUARION_RELOAD_EVENT_TYPE); - } - - // Reload Base configuration if needed - File fileBaseConfiguration = new File(BASE_PROPERTIES_FILE); - if (fileBaseConfiguration.exists()) { - final long lastModified = fileBaseConfiguration.lastModified(); - if (lastModified > baseConfigurationFileLastModifiedTime) { - // Reload configuration only if it was modified - loadBaseConfiguration(); - event.select(BaseConfigurationReload.Literal.INSTANCE).fire(BASE_CONFIGUARION_RELOAD_EVENT_TYPE); - } - } - - if (!loadedFromLdap) { - return; - } - - reloadConfFromDb(); - } - - private boolean isApiRevisionIncreased() { - final ApiConf conf = loadConfigurationFromDb(getConfigurationDn(CONFIGURATION_ENTRY_DN), new ApiConf(), "jansRevision"); - if (conf == null) { - return false; - } - - log.trace("LDAP revision: {}, server revision: {}", conf.getRevision(), loadedRevision); - return conf.getRevision() > this.loadedRevision; - } - - private String confDir() { - log.info("PROPERTIES {}", System.getProperties()); - final String confDir = this.baseConfiguration.getString("confDir", null); - if (StringUtils.isNotBlank(confDir)) { - return confDir; - } - - return DIR; - } - - @Produces - @ApplicationScoped - public StringEncrypter getStringEncrypter() { - String encodeSalt = getCryptoConfigurationSalt(); - - if (StringHelper.isEmpty(encodeSalt)) { - throw new ConfigurationException("Encode salt isn't defined"); - } - - try { - return StringEncrypter.instance(encodeSalt); - } catch (StringEncrypter.EncryptionException ex) { - throw new ConfigurationException("Failed to create StringEncrypter instance"); - } - - } - - public FileConfiguration getBaseConfiguration() { - return baseConfiguration; - } - - public BaseDnConfiguration getBaseDn() { - return getStaticConfiguration().getBaseDn(); - } - - public String getCryptoConfigurationSalt() { - return cryptoConfigurationSalt; - } - - public boolean reloadConfFromDb() { - if (!isApiRevisionIncreased()) { - return false; - } - - return loadApiConfigFromDb(); - } - - private boolean loadApiConfigFromDb() { - log.info("Loading configuration from '{}' DB...", baseConfiguration.getString("persistence.type")); - try { - String dn = getConfigurationDn(CONFIGURATION_ENTRY_DN); - log.info("Dn used = '{}' ", dn); - final ApiConf apiConf = loadConfigurationFromDb(dn, new ApiConf()); - log.trace("ApiConf configuration '{}' DB...", apiConf); - - if (apiConf != null) { - initApiAuthConf(apiConf); - - // Destroy old configuration - if (this.apiConfigloaded) { - destroy(ApiAppConfiguration.class); - } - - this.apiConfigloaded = true; - configurationUpdateEvent.select(ConfigurationUpdate.Literal.INSTANCE).fire(dynamicConf); - - return true; - } - } catch (Exception ex) { - log.error("Unable to find api configuration in DB..." + ex.getMessage(), ex); - } - - return false; - } - - public void destroy(Class clazz) { - Instance confInstance = configurationInstance.select(clazz); - configurationInstance.destroy(confInstance.get()); - } - - private T loadConfigurationFromDb(String dn, T obj, String... returnAttributes) { - log.debug("loadConfigurationFromDb dn:{}, clazz:{}, returnAttributes:{}", dn, obj, returnAttributes); - final PersistenceEntryManager persistenceEntryManager = persistenceEntryManagerInstance.get(); - try { - return (T) persistenceEntryManager.find(dn, obj.getClass(), returnAttributes); - } catch (BasePersistenceException ex) { - log.error(ex.getMessage()); - return null; - } - } - - public String getConfigurationDn(String keyDn) { - return this.baseConfiguration.getString(keyDn); - } - - private void initApiAuthConf(ApiConf apiConf) { - log.debug("Initializing Api App Configuration From DB.... apiConf:{}", apiConf); - - if (apiConf == null) { - throw new ConfigurationException("Failed to load Api App Configuration From DB " + apiConf); - } - - log.info("ApiAppConfigurationFromDb = ...."); - if (apiConf.getDynamicConf() != null) { - dynamicConf = apiConf.getDynamicConf(); - } - - this.loadedRevision = apiConf.getRevision(); - log.debug("*** ConfigurationFactory::loadApiAppConfigurationFromDb() - apiAppConfiguration:{}, apiLoadedRevision:{} ", this.getAppConfiguration(), loadedRevision); - } - - private void loadBaseConfiguration() { - log.info("Loading base configuration - BASE_PROPERTIES_FILE:{}", BASE_PROPERTIES_FILE); - - this.baseConfiguration = createFileConfiguration(BASE_PROPERTIES_FILE, true); - this.baseConfigurationFileLastModifiedTime = new File(BASE_PROPERTIES_FILE).lastModified(); - - log.debug("Loaded base configuration:{}", this.baseConfiguration.getProperties()); - } - - public void loadCryptoConfigurationSalt() { - try { - FileConfiguration cryptoConfiguration = createFileConfiguration(saltFilePath, true); - - this.cryptoConfigurationSalt = cryptoConfiguration.getString("encodeSalt"); - } catch (Exception ex) { - throw new ConfigurationException("Failed to load configuration from " + saltFilePath, ex); - } - } - - private FileConfiguration createFileConfiguration(String fileName, boolean isMandatory) { - try { - return new FileConfiguration(fileName); - } catch (Exception ex) { - if (isMandatory) { - log.error("Failed to load configuration from {}", fileName, ex); - throw new ConfigurationException("Failed to load configuration from " + fileName, ex); - } - } - - return null; - } - - private void installSecurityProvider() { - try { - SecurityProviderUtility.installBCProvider(); - } catch (Exception ex) { - log.error("Failed to install BC provider properly", ex); - } - } - -} diff --git a/jans-client-api/server/src/main/java/io/jans/ca/server/configuration/LoggerProducer.java b/jans-client-api/server/src/main/java/io/jans/ca/server/configuration/LoggerProducer.java deleted file mode 100644 index bae7b7e258b..00000000000 --- a/jans-client-api/server/src/main/java/io/jans/ca/server/configuration/LoggerProducer.java +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Janssen Project software is available under the MIT License (2008). See http://opensource.org/licenses/MIT for full text. - * - * Copyright (c) 2020, Janssen Project - */ - -package io.jans.ca.server.configuration; - -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import jakarta.annotation.Priority; -import jakarta.enterprise.context.ApplicationScoped; -import jakarta.enterprise.inject.Alternative; -import jakarta.enterprise.inject.Produces; -import jakarta.enterprise.inject.spi.InjectionPoint; -import jakarta.inject.Named; - -@ApplicationScoped -@Named -@Alternative -@Priority(1) -public class LoggerProducer { - - @Produces - public Logger produceLogger(InjectionPoint injectionPoint) { - return LoggerFactory.getLogger(injectionPoint.getMember().getDeclaringClass().getName()); - } -} diff --git a/jans-client-api/server/src/main/java/io/jans/ca/server/configuration/model/ApiConf.java b/jans-client-api/server/src/main/java/io/jans/ca/server/configuration/model/ApiConf.java deleted file mode 100644 index 8f6f4b0c5e8..00000000000 --- a/jans-client-api/server/src/main/java/io/jans/ca/server/configuration/model/ApiConf.java +++ /dev/null @@ -1,67 +0,0 @@ -package io.jans.ca.server.configuration.model; - -import io.jans.as.model.config.StaticConfiguration; -import io.jans.ca.server.configuration.ApiAppConfiguration; -import io.jans.orm.annotation.*; - -@DataEntry -@ObjectClass("jansAppConf") -public class ApiConf { - - @DN - protected String dn; - - @JsonObject - @AttributeName(name = "jansConfStatic") - protected StaticConfiguration staticConf; - - @AttributeName(name = "jansRevision") - protected long revision; - - @JsonObject - @AttributeName(name = "jansConfDyn") - private ApiAppConfiguration dynamicConf; - - - public String getDn() { - return dn; - } - - public void setDn(String dn) { - this.dn = dn; - } - - public StaticConfiguration getStaticConf() { - return staticConf; - } - - public void setStaticConf(StaticConfiguration staticConf) { - this.staticConf = staticConf; - } - - public long getRevision() { - return revision; - } - - public void setRevision(long revision) { - this.revision = revision; - } - - public ApiAppConfiguration getDynamicConf() { - return dynamicConf; - } - - public void setDynamicConf(ApiAppConfiguration dynamicConf) { - this.dynamicConf = dynamicConf; - } - - @Override - public String toString() { - return "ApiConf{" + - "dn='" + dn + '\'' + - ", staticConf=" + staticConf + - ", revision=" + revision + - ", dynamicConf=" + dynamicConf + - '}'; - } -} diff --git a/jans-client-api/server/src/main/java/io/jans/ca/server/configuration/model/MinimumRp.java b/jans-client-api/server/src/main/java/io/jans/ca/server/configuration/model/MinimumRp.java deleted file mode 100644 index be246caf1e6..00000000000 --- a/jans-client-api/server/src/main/java/io/jans/ca/server/configuration/model/MinimumRp.java +++ /dev/null @@ -1,45 +0,0 @@ -package io.jans.ca.server.configuration.model; - - -import java.io.Serializable; - -/** - * @author Yuriy Zabrovarnyy - */ -public class MinimumRp implements Serializable { - - private String rpId; - private String clientName; - - public MinimumRp() { - } - - public MinimumRp(String rpId, String clientName) { - this.rpId = rpId; - this.clientName = clientName; - } - - public String getRpId() { - return rpId; - } - - public void setRpId(String rpId) { - this.rpId = rpId; - } - - public String getClientName() { - return clientName; - } - - public void setClientName(String clientName) { - this.clientName = clientName; - } - - @Override - public String toString() { - return "MinimumRp{" + - "rpId='" + rpId + '\'' + - ", clientName='" + clientName + '\'' + - '}'; - } -} diff --git a/jans-client-api/server/src/main/java/io/jans/ca/server/configuration/model/Rp.java b/jans-client-api/server/src/main/java/io/jans/ca/server/configuration/model/Rp.java deleted file mode 100644 index e0bef490aa1..00000000000 --- a/jans-client-api/server/src/main/java/io/jans/ca/server/configuration/model/Rp.java +++ /dev/null @@ -1,1129 +0,0 @@ -package io.jans.ca.server.configuration.model; - -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.google.common.collect.Lists; -import io.jans.as.model.register.RegisterRequestParam; -import org.apache.commons.lang.StringUtils; - -import java.io.Serializable; -import java.util.*; - -/** - * @author Yuriy Zabrovarnyy - */ - -@JsonIgnoreProperties(ignoreUnknown = true) -public class Rp implements Serializable { - - @JsonProperty(value = "rp_id") - private String rpId; - @JsonProperty(value = "op_host") - private String opHost; - @JsonProperty(value = "op_discovery_path") - private String opDiscoveryPath; - @JsonProperty(value = "op_configuration_endpoint") - private String opConfigurationEndpoint; - @JsonProperty(value = "id_token") - private String idToken; - @JsonProperty(value = "access_token") - private String accessToken; - @JsonProperty(value = "redirect_uri") - private String redirectUri; - @JsonProperty(value = "logout_redirect_uri") - private String postLogoutRedirectUri; - @JsonProperty(value = "logout_redirect_uris") - private List postLogoutRedirectUris; - @JsonProperty(value = "application_type") - private String applicationType; - @JsonProperty(value = "redirect_uris") - private List redirectUris; - @JsonProperty(value = "claims_redirect_uri") - private List claimsRedirectUri; - @JsonProperty(value = "response_types") - private List responseTypes; - @JsonProperty(value = "front_channel_logout_uri") - private String frontChannelLogoutUri; - @JsonProperty(value = "client_id") - private String clientId; - @JsonProperty(value = "client_secret") - private String clientSecret; - @JsonProperty(value = "client_registration_access_token") - private String clientRegistrationAccessToken; - @JsonProperty(value = "client_registration_client_uri") - private String clientRegistrationClientUri; - @JsonProperty(value = "client_id_issued_at") - private Date clientIdIssuedAt; - @JsonProperty(value = "client_secret_expires_at") - private Date clientSecretExpiresAt; - @JsonProperty(value = "client_name") - private String clientName; - @JsonProperty(value = "sector_identifier_uri") - private String sectorIdentifierUri; - @JsonProperty(value = "client_jwks_uri") - private String clientJwksUri; - @JsonProperty(value = "token_endpoint_auth_signing_alg") - private String tokenEndpointAuthSigningAlg; - @JsonProperty(value = "token_endpoint_auth_method") - private String tokenEndpointAuthMethod; - @JsonProperty(value = "scope") - private List scope; - @JsonProperty(value = "ui_locales") - private List uiLocales; - @JsonProperty(value = "claims_locales") - private List claimsLocales; - @JsonProperty(value = "acr_values") - private List acrValues; - @JsonProperty(value = "grant_types") - private List grantType; - @JsonProperty(value = "contacts") - private List contacts; - @JsonProperty(value = "user_id") - private String userId; - @JsonProperty(value = "user_secret") - private String userSecret; - @JsonProperty(value = "pat") - private String pat; - @JsonProperty(value = "pat_expires_in") - private Integer patExpiresIn; - @JsonProperty(value = "pat_created_at") - private Date patCreatedAt; - @JsonProperty(value = "pat_refresh_token") - private String patRefreshToken; - @JsonProperty(value = "uma_protected_resources") - private List umaProtectedResources = Lists.newArrayList(); - @JsonProperty(value = "oauth_token") - private String oauthToken; - @JsonProperty(value = "oauth_token_expires_in") - private Integer oauthTokenExpiresIn; - @JsonProperty(value = "oauth_token_created_at") - private Date oauthTokenCreatedAt; - @JsonProperty(value = "oauth_token_refresh_token") - private String oauthTokenRefreshToken; - @JsonProperty(value = "rpt") - private String rpt; - @JsonProperty(value = "rpt_token_type") - private String rptTokenType; - @JsonProperty(value = "rpt_pct") - private String rptPct; - @JsonProperty(value = "rpt_upgraded") - private Boolean rptUpgraded; - @JsonProperty(value = "rpt_expires_at") - private Date rptExpiresAt; - @JsonProperty(value = "rpt_created_at") - private Date rptCreatedAt; - @JsonProperty(value = "rp_programming_language") - private String rpProgrammingLanguage; - @JsonProperty(value = "access_token_as_jwt") - private Boolean accessTokenAsJwt = false; - @JsonProperty(value = "access_token_signing_alg") - private String accessTokenSigningAlg; - @JsonProperty(value = "rpt_as_jwt") - private Boolean rptAsJwt = false; - @JsonProperty(value = "front_channel_logout_session_required") - private Boolean frontChannelLogoutSessionRequired = false; - @JsonProperty(value = "run_introspection_script_beforeaccess_token_as_jwt_creation_and_include_claims") - private Boolean runIntrospectionScriptBeforeAccessTokenAsJwtCreationAndIncludeClaims = false; - @JsonProperty(value = "require_auth_time") - private Boolean requireAuthTime = false; - @JsonProperty(value = "logo_uri") - private String logoUri; - @JsonProperty(value = "client_uri") - private String clientUri; - @JsonProperty(value = "policy_uri") - private String policyUri; - @JsonProperty(value = "tos_uri") - private String tosUri; - @JsonProperty(value = "jwks") - private String jwks; - @JsonProperty(value = "id_token_binding_cnf") - private String idTokenBindingCnf; - @JsonProperty(value = "tls_client_auth_subject_dn") - private String tlsClientAuthSubjectDn; - @JsonProperty(value = "subject_type") - private String subjectType; - @JsonProperty(value = "id_token_signed_response_alg") - private String idTokenSignedResponseAlg; - @JsonProperty(value = "id_token_encrypted_response_alg") - private String idTokenEncryptedResponseAlg; - @JsonProperty(value = "id_token_encrypted_response_enc") - private String idTokenEncryptedResponseEnc; - @JsonProperty(value = "user_info_signed_response_alg") - private String userInfoSignedResponseAlg; - @JsonProperty(value = "user_info_encrypted_response_alg") - private String userInfoEncryptedResponseAlg; - @JsonProperty(value = "user_info_encrypted_response_enc") - private String userInfoEncryptedResponseEnc; - @JsonProperty(value = "request_object_signing_alg") - private String requestObjectSigningAlg; - @JsonProperty(value = "request_object_encryption_alg") - private String requestObjectEncryptionAlg; - @JsonProperty(value = "request_object_encryption_enc") - private String requestObjectEncryptionEnc; - @JsonProperty(value = "default_max_age") - private Integer defaultMaxAge; - @JsonProperty(value = "initiate_login_uri") - private String initiateLoginUri; - @JsonProperty(value = "authorized_origins") - private List authorizedOrigins; - @JsonProperty(value = "access_token_lifetime") - private Integer accessTokenLifetime; - @JsonProperty(value = "software_id") - private String softwareId; - @JsonProperty(value = "software_version") - private String softwareVersion; - @JsonProperty(value = "software_statement") - private String softwareStatement; - @JsonProperty(value = "custom_attributes") - private Map customAttributes = new HashMap<>(); - @JsonProperty(value = "request_uris") - private List requestUris; - @JsonProperty(value = "last_synced") - private Date lastSynced; - @JsonProperty(value = "sync_client_from_op") - private Boolean syncClientFromOp = false; - @JsonProperty(value = "sync_client_period_in_seconds") - private Integer syncClientPeriodInSeconds = 3600; - @JsonProperty(value = "allow_spontaneous_scopes") - private Boolean allowSpontaneousScopes = false; - @JsonProperty(value = "spontaneous_scopes") - private List spontaneousScopes; - - public Rp() { - } - - public Rp(Rp conf) { - this.rpId = conf.rpId; - - this.opHost = conf.opHost; - this.opDiscoveryPath = conf.opDiscoveryPath; - this.opConfigurationEndpoint = conf.opConfigurationEndpoint; - this.idToken = conf.idToken; - this.accessToken = conf.accessToken; - - this.redirectUri = conf.redirectUri; - this.postLogoutRedirectUri = conf.postLogoutRedirectUri; - this.postLogoutRedirectUris = conf.postLogoutRedirectUris; - this.applicationType = conf.applicationType; - this.redirectUris = conf.redirectUris; - this.claimsRedirectUri = conf.claimsRedirectUri; - this.responseTypes = conf.responseTypes; - this.frontChannelLogoutUri = conf.frontChannelLogoutUri; - - this.clientId = conf.clientId; - this.clientSecret = conf.clientSecret; - this.clientRegistrationAccessToken = conf.clientRegistrationAccessToken; - this.clientRegistrationClientUri = conf.clientRegistrationClientUri; - this.clientIdIssuedAt = conf.clientIdIssuedAt; - this.clientSecretExpiresAt = conf.clientSecretExpiresAt; - this.clientName = conf.clientName; - this.sectorIdentifierUri = conf.sectorIdentifierUri; - this.clientJwksUri = conf.clientJwksUri; - - this.tokenEndpointAuthSigningAlg = conf.tokenEndpointAuthSigningAlg; - this.tokenEndpointAuthMethod = conf.tokenEndpointAuthMethod; - - this.scope = conf.scope; - this.uiLocales = conf.uiLocales; - this.claimsLocales = conf.claimsLocales; - this.acrValues = conf.acrValues; - this.grantType = conf.grantType; - this.contacts = conf.contacts; - - this.userId = conf.userId; - this.userSecret = conf.userSecret; - - this.pat = conf.pat; - this.patExpiresIn = conf.patExpiresIn; - this.patCreatedAt = conf.patCreatedAt; - this.patRefreshToken = conf.patRefreshToken; - - this.oauthToken = conf.oauthToken; - this.oauthTokenExpiresIn = conf.oauthTokenExpiresIn; - this.oauthTokenCreatedAt = conf.oauthTokenCreatedAt; - this.oauthTokenRefreshToken = conf.oauthTokenRefreshToken; - - this.rpt = conf.rpt; - this.rptTokenType = conf.rptTokenType; - this.rptPct = conf.rptPct; - this.rptUpgraded = conf.rptUpgraded; - this.rptExpiresAt = conf.rptExpiresAt; - this.rptCreatedAt = conf.rptCreatedAt; - this.rptAsJwt = conf.rptAsJwt; - - this.umaProtectedResources = conf.umaProtectedResources; - this.rpProgrammingLanguage = conf.rpProgrammingLanguage; - this.accessTokenAsJwt = conf.accessTokenAsJwt; - this.accessTokenSigningAlg = conf.accessTokenSigningAlg; - this.frontChannelLogoutSessionRequired = conf.frontChannelLogoutSessionRequired; - this.runIntrospectionScriptBeforeAccessTokenAsJwtCreationAndIncludeClaims = conf.runIntrospectionScriptBeforeAccessTokenAsJwtCreationAndIncludeClaims; - this.requireAuthTime = conf.requireAuthTime; - - this.logoUri = conf.logoUri; - this.clientUri = conf.clientUri; - this.policyUri = conf.policyUri; - this.tosUri = conf.tosUri; - this.jwks = conf.jwks; - this.idTokenBindingCnf = conf.idTokenBindingCnf; - this.tlsClientAuthSubjectDn = conf.tlsClientAuthSubjectDn; - this.subjectType = conf.subjectType; - this.idTokenSignedResponseAlg = conf.idTokenSignedResponseAlg; - this.idTokenEncryptedResponseAlg = conf.idTokenEncryptedResponseAlg; - this.idTokenEncryptedResponseEnc = conf.idTokenEncryptedResponseEnc; - this.userInfoSignedResponseAlg = conf.userInfoSignedResponseAlg; - this.userInfoEncryptedResponseAlg = conf.userInfoEncryptedResponseAlg; - this.userInfoEncryptedResponseEnc = conf.userInfoEncryptedResponseEnc; - this.requestObjectSigningAlg = conf.requestObjectSigningAlg; - this.requestObjectEncryptionAlg = conf.requestObjectEncryptionAlg; - this.requestObjectEncryptionEnc = conf.requestObjectEncryptionEnc; - this.defaultMaxAge = conf.defaultMaxAge; - this.initiateLoginUri = conf.initiateLoginUri; - this.authorizedOrigins = conf.authorizedOrigins; - this.accessTokenLifetime = conf.accessTokenLifetime; - this.softwareId = conf.softwareId; - this.softwareVersion = conf.softwareVersion; - this.softwareStatement = conf.softwareStatement; - this.customAttributes = conf.customAttributes; - } - - public Boolean getAccessTokenAsJwt() { - return accessTokenAsJwt; - } - - public void setAccessTokenAsJwt(Boolean accessTokenAsJwt) { - this.accessTokenAsJwt = accessTokenAsJwt; - } - - public Boolean getRptAsJwt() { - return rptAsJwt; - } - - public void setRptAsJwt(Boolean rptAsJwt) { - this.rptAsJwt = rptAsJwt; - } - - public String getAccessTokenSigningAlg() { - return accessTokenSigningAlg; - } - - public void setAccessTokenSigningAlg(String accessTokenSigningAlg) { - this.accessTokenSigningAlg = accessTokenSigningAlg; - } - - public String getFrontChannelLogoutUri() { - return frontChannelLogoutUri; - } - - public void setFrontChannelLogoutUri(String frontChannelLogoutUri) { - this.frontChannelLogoutUri = frontChannelLogoutUri; - } - - public String getTokenEndpointAuthSigningAlg() { - return tokenEndpointAuthSigningAlg; - } - - public void setTokenEndpointAuthSigningAlg(String tokenEndpointAuthSigningAlg) { - this.tokenEndpointAuthSigningAlg = tokenEndpointAuthSigningAlg; - } - - public MinimumRp asMinimumRp() { - return new MinimumRp(rpId, clientName); - } - - public String getTokenEndpointAuthMethod() { - return tokenEndpointAuthMethod; - } - - public void setTokenEndpointAuthMethod(String tokenEndpointAuthMethod) { - this.tokenEndpointAuthMethod = tokenEndpointAuthMethod; - } - - public String getClientJwksUri() { - return clientJwksUri; - } - - public void setClientJwksUri(String clientJwksUri) { - this.clientJwksUri = clientJwksUri; - } - - public String getPatRefreshToken() { - return patRefreshToken; - } - - public void setPatRefreshToken(String patRefreshToken) { - this.patRefreshToken = patRefreshToken; - } - - public String getUserId() { - return userId; - } - - public void setUserId(String userId) { - this.userId = userId; - } - - public String getUserSecret() { - return userSecret; - } - - public void setUserSecret(String userSecret) { - this.userSecret = userSecret; - } - - public String getPat() { - return pat; - } - - public void setPat(String pat) { - this.pat = pat; - } - - public Integer getPatExpiresIn() { - return patExpiresIn; - } - - public void setPatExpiresIn(Integer patExpiresIn) { - this.patExpiresIn = patExpiresIn; - } - - public Date getPatCreatedAt() { - return patCreatedAt; - } - - public void setPatCreatedAt(Date patCreatedAt) { - this.patCreatedAt = patCreatedAt; - } - - public String getOauthToken() { - return oauthToken; - } - - public void setOauthToken(String oauthToken) { - this.oauthToken = oauthToken; - } - - public Integer getOauthTokenExpiresIn() { - return oauthTokenExpiresIn; - } - - public void setOauthTokenExpiresIn(Integer oauthTokenExpiresIn) { - this.oauthTokenExpiresIn = oauthTokenExpiresIn; - } - - public Date getOauthTokenCreatedAt() { - return oauthTokenCreatedAt; - } - - public void setOauthTokenCreatedAt(Date oauthTokenCreatedAt) { - this.oauthTokenCreatedAt = oauthTokenCreatedAt; - } - - public String getOauthTokenRefreshToken() { - return oauthTokenRefreshToken; - } - - public void setOauthTokenRefreshToken(String oauthTokenRefreshToken) { - this.oauthTokenRefreshToken = oauthTokenRefreshToken; - } - - public String getSectorIdentifierUri() { - return sectorIdentifierUri; - } - - public void setSectorIdentifierUri(String sectorIdentifierUri) { - this.sectorIdentifierUri = sectorIdentifierUri; - } - - public String getAccessToken() { - return accessToken; - } - - public void setAccessToken(String accessToken) { - this.accessToken = accessToken; - } - - public String getIdToken() { - return idToken; - } - - public void setIdToken(String idToken) { - this.idToken = idToken; - } - - public String getPostLogoutRedirectUri() { - return postLogoutRedirectUri; - } - - public void setPostLogoutRedirectUri(String postLogoutRedirectUri) { - this.postLogoutRedirectUri = postLogoutRedirectUri; - } - - public List getPostLogoutRedirectUris() { - return postLogoutRedirectUris; - } - - public void setPostLogoutRedirectUris(List postLogoutRedirectUris) { - this.postLogoutRedirectUris = postLogoutRedirectUris; - } - - public String getClientName() { - return clientName; - } - - public void setClientName(String clientName) { - this.clientName = clientName; - } - - public Date getClientIdIssuedAt() { - return clientIdIssuedAt; - } - - public void setClientIdIssuedAt(Date clientIdIssuedAt) { - this.clientIdIssuedAt = clientIdIssuedAt; - } - - public String getClientRegistrationAccessToken() { - return clientRegistrationAccessToken; - } - - public void setClientRegistrationAccessToken(String clientRegistrationAccessToken) { - this.clientRegistrationAccessToken = clientRegistrationAccessToken; - } - - public String getClientRegistrationClientUri() { - return clientRegistrationClientUri; - } - - public void setClientRegistrationClientUri(String clientRegistrationClientUri) { - this.clientRegistrationClientUri = clientRegistrationClientUri; - } - - public Date getClientSecretExpiresAt() { - return clientSecretExpiresAt; - } - - public void setClientSecretExpiresAt(Date clientSecretExpiresAt) { - this.clientSecretExpiresAt = clientSecretExpiresAt; - } - - public String getApplicationType() { - return applicationType; - } - - public void setApplicationType(String applicationType) { - this.applicationType = applicationType; - } - - public String getRedirectUri() { - return redirectUri; - } - - public void setRedirectUri(String redirectUri) { - this.redirectUri = redirectUri; - } - - public List getContacts() { - if (contacts == null) { - contacts = new ArrayList<>(); - } - return contacts; - } - - public void setContacts(List contacts) { - this.contacts = contacts; - } - - public List getAcrValues() { - if (acrValues == null) { - acrValues = new ArrayList<>(); - } - return acrValues; - } - - public void setAcrValues(List acrValues) { - this.acrValues = acrValues; - } - - public List getClaimsLocales() { - if (claimsLocales == null) { - claimsLocales = new ArrayList<>(); - } - return claimsLocales; - } - - public void setClaimsLocales(List claimsLocales) { - this.claimsLocales = claimsLocales; - } - - public String getClientId() { - return clientId; - } - - public void setClientId(String clientId) { - this.clientId = clientId; - } - - public String getClientSecret() { - return clientSecret; - } - - public void setClientSecret(String clientSecret) { - this.clientSecret = clientSecret; - } - - public List getGrantType() { - if (grantType == null) { - grantType = new ArrayList<>(); - } - return grantType; - } - - public void setGrantType(List grantType) { - this.grantType = grantType; - } - - public String getRpId() { - return rpId; - } - - public void setRpId(String rpId) { - this.rpId = rpId; - } - - public String getOpHost() { - return opHost; - } - - public String getOpConfigurationEndpoint() { - return opConfigurationEndpoint; - } - - public void setOpConfigurationEndpoint(String opConfigurationEndpoint) { - this.opConfigurationEndpoint = opConfigurationEndpoint; - } - - public String opHostWithoutProtocol() { - if (StringUtils.contains(opHost, "//")) { - return StringUtils.substringAfter(opHost, "//"); - } - return opHost; - } - - public void setOpHost(String opHost) { - this.opHost = opHost; - } - - public String getOpDiscoveryPath() { - return opDiscoveryPath; - } - - public void setOpDiscoveryPath(String opDiscoveryPath) { - this.opDiscoveryPath = opDiscoveryPath; - } - - public List getClaimsRedirectUri() { - if (claimsRedirectUri == null) { - claimsRedirectUri = new ArrayList<>(); - } - return claimsRedirectUri; - } - - public void setClaimsRedirectUri(List claimsRedirectUri) { - this.claimsRedirectUri = claimsRedirectUri; - } - - public List getRedirectUris() { - if (redirectUris == null) { - redirectUris = new ArrayList<>(); - } - return redirectUris; - } - - public void setRedirectUris(List redirectUris) { - this.redirectUris = redirectUris; - } - - public List getResponseTypes() { - if (responseTypes == null) { - responseTypes = new ArrayList<>(); - } - return responseTypes; - } - - public void setResponseTypes(List responseTypes) { - this.responseTypes = responseTypes; - } - - public List getScope() { - if (scope == null) { - scope = new ArrayList<>(); - } - return scope; - } - - public void setScope(List scope) { - this.scope = scope; - } - - public List getUiLocales() { - if (uiLocales == null) { - uiLocales = new ArrayList<>(); - } - return uiLocales; - } - - public void setUiLocales(List uiLocales) { - this.uiLocales = uiLocales; - } - - public List getUmaProtectedResources() { - if (umaProtectedResources == null) { - umaProtectedResources = Lists.newArrayList(); - } - return umaProtectedResources; - } - - public void setUmaProtectedResources(List umaProtectedResources) { - this.umaProtectedResources = umaProtectedResources; - } - - public String getRpProgrammingLanguage() { - return rpProgrammingLanguage; - } - - public void setRpProgrammingLanguage(String rpProgrammingLanguage) { - this.rpProgrammingLanguage = rpProgrammingLanguage; - } - - public String getRpt() { - return rpt; - } - - public void setRpt(String rpt) { - this.rpt = rpt; - } - - public Date getRptExpiresAt() { - return rptExpiresAt; - } - - public void setRptExpiresAt(Date rptExpiresAt) { - this.rptExpiresAt = rptExpiresAt; - } - - public String getRptTokenType() { - return rptTokenType; - } - - public void setRptTokenType(String rptTokenType) { - this.rptTokenType = rptTokenType; - } - - public String getRptPct() { - return rptPct; - } - - public void setRptPct(String rptPct) { - this.rptPct = rptPct; - } - - public Boolean getRptUpgraded() { - return rptUpgraded; - } - - public void setRptUpgraded(Boolean rptUpgraded) { - this.rptUpgraded = rptUpgraded; - } - - public Date getRptCreatedAt() { - return rptCreatedAt; - } - - public void setRptCreatedAt(Date rptCreatedAt) { - this.rptCreatedAt = rptCreatedAt; - } - - public Boolean getFrontChannelLogoutSessionRequired() { - return frontChannelLogoutSessionRequired; - } - - public void setFrontChannelLogoutSessionRequired(Boolean frontChannelLogoutSessionRequired) { - this.frontChannelLogoutSessionRequired = frontChannelLogoutSessionRequired; - } - - public Boolean getRunIntrospectionScriptBeforeAccessTokenAsJwtCreationAndIncludeClaims() { - return runIntrospectionScriptBeforeAccessTokenAsJwtCreationAndIncludeClaims; - } - - public void setRunIntrospectionScriptBeforeAccessTokenAsJwtCreationAndIncludeClaims(Boolean runIntrospectionScriptBeforeAccessTokenAsJwtCreationAndIncludeClaims) { - this.runIntrospectionScriptBeforeAccessTokenAsJwtCreationAndIncludeClaims = runIntrospectionScriptBeforeAccessTokenAsJwtCreationAndIncludeClaims; - } - - public Boolean getRequireAuthTime() { - return requireAuthTime; - } - - public void setRequireAuthTime(Boolean requireAuthTime) { - this.requireAuthTime = requireAuthTime; - } - - public UmaResource umaResource(String path, String httpMethod) { - List copy = Lists.newArrayList(umaProtectedResources); - Collections.reverse(copy); - - for (UmaResource resource : copy) { - if (path.equalsIgnoreCase(resource.getPath()) && resource.getHttpMethods() != null) { - for (String http : resource.getHttpMethods()) { - if (http.equalsIgnoreCase(httpMethod)) { - return resource; - } - } - } - } - return null; - } - - public String getLogoUri() { - return logoUri; - } - - public void setLogoUri(String logoUri) { - this.logoUri = logoUri; - } - - public String getClientUri() { - return clientUri; - } - - public void setClientUri(String clientUri) { - this.clientUri = clientUri; - } - - public String getPolicyUri() { - return policyUri; - } - - public void setPolicyUri(String policyUri) { - this.policyUri = policyUri; - } - - public String getTosUri() { - return tosUri; - } - - public void setTosUri(String tosUri) { - this.tosUri = tosUri; - } - - public String getJwks() { - return jwks; - } - - public void setJwks(String jwks) { - this.jwks = jwks; - } - - public String getIdTokenBindingCnf() { - return idTokenBindingCnf; - } - - public void setIdTokenBindingCnf(String idTokenBindingCnf) { - this.idTokenBindingCnf = idTokenBindingCnf; - } - - public String getTlsClientAuthSubjectDn() { - return tlsClientAuthSubjectDn; - } - - public void setTlsClientAuthSubjectDn(String tlsClientAuthSubjectDn) { - this.tlsClientAuthSubjectDn = tlsClientAuthSubjectDn; - } - - public String getSubjectType() { - return subjectType; - } - - public void setSubjectType(String subjectType) { - this.subjectType = subjectType; - } - - public String getIdTokenSignedResponseAlg() { - return idTokenSignedResponseAlg; - } - - public void setIdTokenSignedResponseAlg(String idTokenSignedResponseAlg) { - this.idTokenSignedResponseAlg = idTokenSignedResponseAlg; - } - - public String getIdTokenEncryptedResponseAlg() { - return idTokenEncryptedResponseAlg; - } - - public void setIdTokenEncryptedResponseAlg(String idTokenEncryptedResponseAlg) { - this.idTokenEncryptedResponseAlg = idTokenEncryptedResponseAlg; - } - - public String getIdTokenEncryptedResponseEnc() { - return idTokenEncryptedResponseEnc; - } - - public void setIdTokenEncryptedResponseEnc(String idTokenEncryptedResponseEnc) { - this.idTokenEncryptedResponseEnc = idTokenEncryptedResponseEnc; - } - - public String getUserInfoSignedResponseAlg() { - return userInfoSignedResponseAlg; - } - - public void setUserInfoSignedResponseAlg(String userInfoSignedResponseAlg) { - this.userInfoSignedResponseAlg = userInfoSignedResponseAlg; - } - - public String getUserInfoEncryptedResponseAlg() { - return userInfoEncryptedResponseAlg; - } - - public void setUserInfoEncryptedResponseAlg(String userInfoEncryptedResponseAlg) { - this.userInfoEncryptedResponseAlg = userInfoEncryptedResponseAlg; - } - - public String getUserInfoEncryptedResponseEnc() { - return userInfoEncryptedResponseEnc; - } - - public void setUserInfoEncryptedResponseEnc(String userInfoEncryptedResponseEnc) { - this.userInfoEncryptedResponseEnc = userInfoEncryptedResponseEnc; - } - - public String getRequestObjectSigningAlg() { - return requestObjectSigningAlg; - } - - public void setRequestObjectSigningAlg(String requestObjectSigningAlg) { - this.requestObjectSigningAlg = requestObjectSigningAlg; - } - - public String getRequestObjectEncryptionAlg() { - return requestObjectEncryptionAlg; - } - - public void setRequestObjectEncryptionAlg(String requestObjectEncryptionAlg) { - this.requestObjectEncryptionAlg = requestObjectEncryptionAlg; - } - - public String getRequestObjectEncryptionEnc() { - return requestObjectEncryptionEnc; - } - - public void setRequestObjectEncryptionEnc(String requestObjectEncryptionEnc) { - this.requestObjectEncryptionEnc = requestObjectEncryptionEnc; - } - - public Integer getDefaultMaxAge() { - return defaultMaxAge; - } - - public void setDefaultMaxAge(Integer defaultMaxAge) { - this.defaultMaxAge = defaultMaxAge; - } - - public String getInitiateLoginUri() { - return initiateLoginUri; - } - - public void setInitiateLoginUri(String initiateLoginUri) { - this.initiateLoginUri = initiateLoginUri; - } - - public List getAuthorizedOrigins() { - return authorizedOrigins; - } - - public void setAuthorizedOrigins(List authorizedOrigins) { - this.authorizedOrigins = authorizedOrigins; - } - - public Integer getAccessTokenLifetime() { - return accessTokenLifetime; - } - - public void setAccessTokenLifetime(Integer accessTokenLifetime) { - this.accessTokenLifetime = accessTokenLifetime; - } - - public String getSoftwareId() { - return softwareId; - } - - public void setSoftwareId(String softwareId) { - this.softwareId = softwareId; - } - - public String getSoftwareVersion() { - return softwareVersion; - } - - public void setSoftwareVersion(String softwareVersion) { - this.softwareVersion = softwareVersion; - } - - public String getSoftwareStatement() { - return softwareStatement; - } - - public void setSoftwareStatement(String softwareStatement) { - this.softwareStatement = softwareStatement; - } - - public Map getCustomAttributes() { - return customAttributes; - } - - public void setCustomAttributes(Map customAttributes) { - this.customAttributes = customAttributes; - } - - public void addCustomAttribute(String pName, String pValue) { - if (RegisterRequestParam.isCustomParameterValid(pName)) { - this.customAttributes.put(pName, pValue); - } - } - - public List getRequestUris() { - return requestUris; - } - - public void setRequestUris(List requestUris) { - this.requestUris = requestUris; - } - - public Date getLastSynced() { - return lastSynced; - } - - public void setLastSynced(Date lastSynced) { - this.lastSynced = lastSynced; - } - - public Boolean isSyncClientFromOp() { - return syncClientFromOp; - } - - public void setSyncClientFromOp(Boolean syncClientFromOp) { - this.syncClientFromOp = syncClientFromOp; - } - - public Integer getSyncClientPeriodInSeconds() { - return syncClientPeriodInSeconds; - } - - public void setSyncClientPeriodInSeconds(Integer syncClientPeriodInSeconds) { - this.syncClientPeriodInSeconds = syncClientPeriodInSeconds; - } - - public Boolean getAllowSpontaneousScopes() { - return allowSpontaneousScopes; - } - - public void setAllowSpontaneousScopes(Boolean allowSpontaneousScopes) { - this.allowSpontaneousScopes = allowSpontaneousScopes; - } - - public List getSpontaneousScopes() { - return spontaneousScopes; - } - - public void setSpontaneousScopes(List spontaneousScopes) { - this.spontaneousScopes = spontaneousScopes; - } - - @Override - public String toString() { - return "Rp{" + - "rpId='" + rpId + '\'' + - ", opHost='" + opHost + '\'' + - ", opDiscoveryPath='" + opDiscoveryPath + '\'' + - ", opConfigurationEndpoint='" + opConfigurationEndpoint + '\'' + - ", idToken='" + idToken + '\'' + - ", accessToken='" + accessToken + '\'' + - ", redirectUri='" + redirectUri + '\'' + - ", postLogoutRedirectUri='" + postLogoutRedirectUri + '\'' + - ", postLogoutRedirectUris='" + postLogoutRedirectUris + '\'' + - ", applicationType='" + applicationType + '\'' + - ", redirectUris=" + redirectUris + '\'' + - ", frontChannelLogoutUri=" + frontChannelLogoutUri + '\'' + - ", claimsRedirectUri=" + claimsRedirectUri + '\'' + - ", responseTypes=" + responseTypes + '\'' + - ", clientId='" + clientId + '\'' + - ", clientRegistrationAccessToken='" + clientRegistrationAccessToken + '\'' + - ", clientRegistrationClientUri='" + clientRegistrationClientUri + '\'' + - ", clientIdIssuedAt=" + clientIdIssuedAt + - ", clientSecretExpiresAt=" + clientSecretExpiresAt + - ", clientName='" + clientName + '\'' + - ", sectorIdentifierUri='" + sectorIdentifierUri + '\'' + - ", clientJwksUri='" + clientJwksUri + '\'' + - ", scope=" + scope + - ", uiLocales=" + uiLocales + - ", claimsLocales=" + claimsLocales + - ", acrValues=" + acrValues + - ", grantType=" + grantType + - ", contacts=" + contacts + - ", userId='" + userId + '\'' + - ", userSecret='" + userSecret + '\'' + - ", pat='" + pat + '\'' + - ", patExpiresIn=" + patExpiresIn + - ", patCreatedAt=" + patCreatedAt + - ", patRefreshToken='" + patRefreshToken + '\'' + - ", oauthToken='" + oauthToken + '\'' + - ", oauthTokenExpiresIn='" + oauthTokenExpiresIn + - ", oauthTokenCreatedAt='" + oauthTokenCreatedAt + - ", oauthTokenRefreshToken=''" + oauthTokenRefreshToken + '\'' + - ", umaProtectedResources='" + umaProtectedResources + - ", rpt='" + rpt + '\'' + - ", rptTokenType='" + rptTokenType + '\'' + - ", rptPct='" + rptPct + '\'' + - ", rptExpiresAt='" + rptExpiresAt + '\'' + - ", rptCreatedAt='" + rptCreatedAt + '\'' + - ", rptUpgraded='" + rptUpgraded + '\'' + - ", rptAsJwt='" + rptAsJwt + '\'' + - ", tokenEndpointAuthSigningAlg='" + tokenEndpointAuthSigningAlg + '\'' + - ", tokenEndpointAuthMethod='" + tokenEndpointAuthMethod + '\'' + - ", rpProgrammingLanguage='" + rpProgrammingLanguage + '\'' + - ", accessTokenAsJwt='" + accessTokenAsJwt + '\'' + - ", accessTokenSigningAlg='" + accessTokenSigningAlg + '\'' + - ", frontChannelLogoutSessionRequired='" + frontChannelLogoutSessionRequired + '\'' + - ", runIntrospectionScriptBeforeAccessTokenAsJwtCreationAndIncludeClaims='" + runIntrospectionScriptBeforeAccessTokenAsJwtCreationAndIncludeClaims + '\'' + - ", requireAuthTime='" + requireAuthTime + '\'' + - ", logoUri='" + logoUri + '\'' + - ", clientUri='" + clientUri + '\'' + - ", policyUri='" + policyUri + '\'' + - ", tosUri='" + tosUri + '\'' + - ", jwks='" + jwks + '\'' + - ", idTokenBindingCnf='" + idTokenBindingCnf + '\'' + - ", tlsClientAuthSubjectDn='" + tlsClientAuthSubjectDn + '\'' + - ", idTokenSignedResponseAlg='" + idTokenSignedResponseAlg + '\'' + - ", idTokenEncryptedResponseAlg='" + idTokenEncryptedResponseAlg + '\'' + - ", idTokenEncryptedResponseEnc='" + idTokenEncryptedResponseEnc + '\'' + - ", userInfoSignedResponseAlg='" + userInfoSignedResponseAlg + '\'' + - ", userInfoEncryptedResponseAlg='" + userInfoEncryptedResponseAlg + '\'' + - ", userInfoEncryptedResponseEnc='" + userInfoEncryptedResponseEnc + '\'' + - ", requestObjectSigningAlg='" + requestObjectSigningAlg + '\'' + - ", requestObjectEncryptionAlg='" + requestObjectEncryptionAlg + '\'' + - ", requestObjectEncryptionEnc='" + requestObjectEncryptionEnc + '\'' + - ", defaultMaxAge='" + defaultMaxAge + '\'' + - ", initiateLoginUri='" + initiateLoginUri + '\'' + - ", authorizedOrigins='" + authorizedOrigins + '\'' + - ", accessTokenLifetime='" + accessTokenLifetime + '\'' + - ", softwareId='" + softwareId + '\'' + - ", softwareVersion='" + softwareVersion + '\'' + - ", softwareStatement='" + softwareStatement + '\'' + - ", customAttributes='" + customAttributes + '\'' + - ", requestUris='" + requestUris + '\'' + - ", lastSynced='" + lastSynced + '\'' + - ", syncClientFromOp='" + syncClientFromOp + '\'' + - ", syncClientPeriodInSeconds='" + syncClientPeriodInSeconds + '\'' + - ", allowSpontaneousScopes='" + allowSpontaneousScopes + '\'' + - ", spontaneousScopes='" + spontaneousScopes + '\'' + - '}'; - } -} diff --git a/jans-client-api/server/src/main/java/io/jans/ca/server/configuration/model/UmaResource.java b/jans-client-api/server/src/main/java/io/jans/ca/server/configuration/model/UmaResource.java deleted file mode 100644 index f702ec0f350..00000000000 --- a/jans-client-api/server/src/main/java/io/jans/ca/server/configuration/model/UmaResource.java +++ /dev/null @@ -1,115 +0,0 @@ -package io.jans.ca.server.configuration.model; - -import com.google.common.collect.Lists; - -import java.io.Serializable; -import java.util.List; - -/** - * @author Yuriy Zabrovarnyy - * @version 0.9, 06/06/2016 - */ - -public class UmaResource implements Serializable { - - private String id; - private String path; - private List httpMethods = Lists.newArrayList(); - private List scopes = Lists.newArrayList(); - private List scopeExpressions = Lists.newArrayList(); - private List ticketScopes = Lists.newArrayList(); - private Integer iat = null; - private Integer exp = null; - - public List getScopeExpressions() { - if (scopeExpressions == null) { - scopeExpressions = Lists.newArrayList(); - } - return scopeExpressions; - } - - public void setScopeExpressions(List scopeExpressions) { - this.scopeExpressions = scopeExpressions; - } - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getPath() { - return path; - } - - public void setPath(String path) { - this.path = path; - } - - public List getHttpMethods() { - if (httpMethods == null) { - httpMethods = Lists.newArrayList(); - } - return httpMethods; - } - - public void setHttpMethods(List httpMethods) { - this.httpMethods = httpMethods; - } - - public List getScopes() { - if (scopes == null) { - scopes = Lists.newArrayList(); - } - return scopes; - } - - public void setScopes(List scopes) { - this.scopes = scopes; - } - - public List getTicketScopes() { - if (ticketScopes == null) { - ticketScopes = Lists.newArrayList(); - } - return ticketScopes; - } - - public void setTicketScopes(List ticketScopes) { - this.ticketScopes = ticketScopes; - } - - public Integer getIat() { - return iat; - } - - public void setIat(Integer iat) { - this.iat = iat; - } - - public Integer getExp() { - return exp; - } - - public void setExp(Integer exp) { - this.exp = exp; - } - - @Override - public String toString() { - final StringBuilder sb = new StringBuilder(); - sb.append("UmaResource"); - sb.append("{id='").append(id).append('\''); - sb.append(", path='").append(path).append('\''); - sb.append(", httpMethods=").append(httpMethods); - sb.append(", scopes=").append(scopes); - sb.append(", scopeExpressions=").append(scopeExpressions); - sb.append(", ticketScopes=").append(ticketScopes); - sb.append(", iat=").append(iat); - sb.append(", exp=").append(exp); - sb.append('}'); - return sb.toString(); - } -} diff --git a/jans-client-api/server/src/main/java/io/jans/ca/server/filter/AuthorizationFilter.java b/jans-client-api/server/src/main/java/io/jans/ca/server/filter/AuthorizationFilter.java deleted file mode 100644 index 1a036e463ad..00000000000 --- a/jans-client-api/server/src/main/java/io/jans/ca/server/filter/AuthorizationFilter.java +++ /dev/null @@ -1,82 +0,0 @@ -/* - * Janssen Project software is available under the MIT License (2008). See http://opensource.org/licenses/MIT for full text. - * - * Copyright (c) 2020, Janssen Project - */ - -package io.jans.ca.server.filter; - -import io.jans.ca.server.security.service.AuthorizationService; -import io.jans.ca.common.rest.ProtectedApi; -import jakarta.annotation.Priority; -import jakarta.inject.Inject; -import jakarta.servlet.http.HttpServletRequest; -import jakarta.ws.rs.Priorities; -import jakarta.ws.rs.container.ContainerRequestContext; -import jakarta.ws.rs.container.ContainerRequestFilter; -import jakarta.ws.rs.container.ResourceInfo; -import jakarta.ws.rs.core.Context; -import jakarta.ws.rs.core.HttpHeaders; -import jakarta.ws.rs.core.Response; -import jakarta.ws.rs.core.UriInfo; -import jakarta.ws.rs.ext.Provider; -import org.apache.commons.io.IOUtils; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import java.io.IOException; - -@Provider -@ProtectedApi -@Priority(Priorities.AUTHENTICATION) -public class AuthorizationFilter implements ContainerRequestFilter { - - private static final String AUTHENTICATION_SCHEME = "Bearer"; - private static final String AUTHORIZATION_RP_ID = "AuthorizationRpId"; - - private static final Logger log = LoggerFactory.getLogger(AuthorizationFilter.class); - - @Context - UriInfo info; - - @Context - HttpServletRequest request; - - @Context - private HttpHeaders httpHeaders; - - @Inject - AuthorizationService authorizationService; - - @SuppressWarnings({"all"}) - public void filter(ContainerRequestContext context) { - log.info("======================================================================="); - log.info("====== context = " + context + " , info.getAbsolutePath() = " + info.getAbsolutePath() - + " , info.getRequestUri() = " + info.getRequestUri() + "\n\n"); - log.info("====== info.getBaseUri()=" + info.getBaseUri() + " info.getPath()=" + info.getPath() - + " info.toString()=" + info.toString()); - log.info("====== request.getContextPath()=" + request.getContextPath() + " request.getRequestURI()=" - + request.getRequestURI() + " request.toString() " + request.toString()); - - log.info("======" + context.getMethod() + " " + info.getPath() + " FROM IP " + request.getRemoteAddr()); - log.info("======PERFORMING AUTHORIZATION========================================="); - String authorizationHeader = context.getHeaderString(HttpHeaders.AUTHORIZATION); - String authorizationRpIdHeader = context.getHeaderString(AUTHORIZATION_RP_ID); - - log.info("\n\n\n AuthorizationFilter::filter() - authorizationHeader = " + authorizationHeader + " , authorizationRpIdHeader = " - + authorizationRpIdHeader + " \n\n\n"); - try { - authorizationService.processAuthorization(info.getPath(), context.getMethod(), request.getRemoteAddr(), authorizationHeader, authorizationRpIdHeader); - log.info("======AUTHORIZATION GRANTED==========================================="); - } catch (Exception ex) { - log.error("======AUTHORIZATION FAILED ===========================================", ex); - abortWithUnauthorized(context, ex.getMessage()); - } - } - - private void abortWithUnauthorized(ContainerRequestContext requestContext, String errMsg) { - requestContext.abortWith(Response.status(Response.Status.UNAUTHORIZED).entity(errMsg) - .header(HttpHeaders.WWW_AUTHENTICATE, AUTHENTICATION_SCHEME).build()); - } - -} diff --git a/jans-client-api/server/src/main/java/io/jans/ca/server/introspection/BackCompatibleIntrospectionResponse.java b/jans-client-api/server/src/main/java/io/jans/ca/server/introspection/BackCompatibleIntrospectionResponse.java deleted file mode 100644 index 9f87c69b726..00000000000 --- a/jans-client-api/server/src/main/java/io/jans/ca/server/introspection/BackCompatibleIntrospectionResponse.java +++ /dev/null @@ -1,187 +0,0 @@ -package io.jans.ca.server.introspection; - -/* - * oxAuth is available under the MIT License (2008). See http://opensource.org/licenses/MIT for full text. - * - * Copyright (c) 2014, Gluu - */ - -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import org.jboss.resteasy.annotations.providers.jaxb.IgnoreMediaTypes; - -import java.util.ArrayList; -import java.util.Collection; -import java.util.Date; -import java.util.List; - -/** - * @author Yuriy Zabrovarnyy - * @version 0.9, 17/09/2013 - */ -@JsonPropertyOrder({"active", "scopes", "client_id", "username", "token_type", "exp", "iat", "sub", "aud", "iss", "jti", "acr_values"}) -// ignore jettison as it's recommended here: http://docs.jboss.org/resteasy/docs/2.3.4.Final/userguide/html/json.html -@IgnoreMediaTypes("application/*+json") -public class BackCompatibleIntrospectionResponse { - - @JsonProperty(value = "active") - private boolean active; // according spec, must be "active" http://tools.ietf.org/html/draft-richer-oauth-introspection-03#section-2.2 - @Deprecated // redundant, in spec we have just "scope", leave it for back compatiblity - @JsonProperty(value = "scopes") - private List scopes; - @JsonProperty(value = "scope") - private List scope; - @JsonProperty(value = "client_id") - private String clientId; - @JsonProperty(value = "username") - private String username; - @JsonProperty(value = "token_type") - private String tokenType; - @JsonProperty(value = "exp") - private Date expiresAt; - @JsonProperty(value = "iat") - private Date issuedAt; - @JsonProperty(value = "sub") - private String subject; - @JsonProperty(value = "aud") - private String audience; - @JsonProperty(value = "iss") - private String issuer; - @JsonProperty(value = "jti") - private String jti; - @JsonProperty(value = "acr_values") - private String acrValues; - - public BackCompatibleIntrospectionResponse() { - } - - public BackCompatibleIntrospectionResponse(boolean p_active) { - active = p_active; - } - - public String getAcrValues() { - return acrValues; - } - - public void setAcrValues(String p_authMode) { - acrValues = p_authMode; - } - - public boolean isActive() { - return active; - } - - public void setActive(boolean p_active) { - active = p_active; - } - - public List getScopes() { - return scopes; - } - - public void setScopes(Collection scopes) { - this.scopes = scopes != null ? new ArrayList(scopes) : new ArrayList(); - } - - public List getScope() { - if (scope == null) { - scope = new ArrayList<>(); - } - return scope; - } - - public void setScope(List scope) { - this.scope = scope; - } - - public Date getExpiresAt() { - return expiresAt != null ? new Date(expiresAt.getTime()) : null; - } - - public void setExpiresAt(Date p_expiresAt) { - expiresAt = p_expiresAt != null ? new Date(p_expiresAt.getTime()) : null; - } - - public Date getIssuedAt() { - return issuedAt != null ? new Date(issuedAt.getTime()) : null; - } - - public void setIssuedAt(Date p_issuedAt) { - issuedAt = p_issuedAt; - } - - public String getClientId() { - return clientId; - } - - public void setClientId(String clientId) { - this.clientId = clientId; - } - - public String getUsername() { - return username; - } - - public void setUsername(String username) { - this.username = username; - } - - public String getTokenType() { - return tokenType; - } - - public void setTokenType(String tokenType) { - this.tokenType = tokenType; - } - - public String getSubject() { - return subject; - } - - public void setSubject(String subject) { - this.subject = subject; - } - - public String getAudience() { - return audience; - } - - public void setAudience(String audience) { - this.audience = audience; - } - - public String getIssuer() { - return issuer; - } - - public void setIssuer(String issuer) { - this.issuer = issuer; - } - - public String getJti() { - return jti; - } - - public void setJti(String jti) { - this.jti = jti; - } - - @Override - public String toString() { - return "BackCompatibleIntrospectionResponse{" + - "active=" + active + - ", scopes=" + scopes + - ", scope=" + scope + - ", clientId='" + clientId + '\'' + - ", username='" + username + '\'' + - ", tokenType='" + tokenType + '\'' + - ", expiresAt=" + expiresAt + - ", issuedAt=" + issuedAt + - ", subject='" + subject + '\'' + - ", audience='" + audience + '\'' + - ", issuer='" + issuer + '\'' + - ", jti='" + jti + '\'' + - ", acrValues='" + acrValues + '\'' + - '}'; - } -} diff --git a/jans-client-api/server/src/main/java/io/jans/ca/server/introspection/BackCompatibleIntrospectionService.java b/jans-client-api/server/src/main/java/io/jans/ca/server/introspection/BackCompatibleIntrospectionService.java deleted file mode 100644 index c4980ddc92a..00000000000 --- a/jans-client-api/server/src/main/java/io/jans/ca/server/introspection/BackCompatibleIntrospectionService.java +++ /dev/null @@ -1,24 +0,0 @@ -package io.jans.ca.server.introspection; - -import jakarta.ws.rs.*; -import jakarta.ws.rs.core.MediaType; - -/** - * Back compatibility with AS 3.1.1 and earlier. - * - * @author yuriyz - */ -public interface BackCompatibleIntrospectionService { - - /** - * Returns introspection response for specified token. - * - * @param p_authorization authorization token - * @param p_token token to introspect - * @return introspection response - */ - @POST - @Consumes({MediaType.APPLICATION_JSON}) - @Produces({MediaType.APPLICATION_JSON}) - BackCompatibleIntrospectionResponse introspectToken(@HeaderParam("Authorization") String p_authorization, @FormParam("token") String p_token); -} diff --git a/jans-client-api/server/src/main/java/io/jans/ca/server/introspection/BadRptIntrospectionResponse.java b/jans-client-api/server/src/main/java/io/jans/ca/server/introspection/BadRptIntrospectionResponse.java deleted file mode 100644 index ab8b88c3645..00000000000 --- a/jans-client-api/server/src/main/java/io/jans/ca/server/introspection/BadRptIntrospectionResponse.java +++ /dev/null @@ -1,177 +0,0 @@ -package io.jans.ca.server.introspection; - -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import jakarta.xml.bind.annotation.XmlElement; -import jakarta.xml.bind.annotation.XmlRootElement; -import org.jboss.resteasy.annotations.providers.jaxb.IgnoreMediaTypes; - -import java.util.Date; -import java.util.List; - -/** - * @author yuriyz - */ -@IgnoreMediaTypes({"application/*+json"}) -@JsonPropertyOrder({"active", "exp", "iat", "nbf", "permissions", "client_id", "sub", "aud", "iss", "jti"}) -@XmlRootElement -@JsonIgnoreProperties( - ignoreUnknown = true -) -public class BadRptIntrospectionResponse { - private boolean active; - private Date expiresAt; - private Date issuedAt; - private Date nbf; - private String clientId; - private String sub; - private String aud; - private String iss; - private String jti; - private List permissions; - - public BadRptIntrospectionResponse() { - } - - public BadRptIntrospectionResponse(boolean status) { - this.active = status; - } - - @JsonProperty("aud") - @XmlElement( - name = "aud" - ) - public String getAud() { - return this.aud; - } - - public void setAud(String aud) { - this.aud = aud; - } - - @JsonProperty("iss") - @XmlElement( - name = "iss" - ) - public String getIss() { - return this.iss; - } - - public void setIss(String iss) { - this.iss = iss; - } - - @JsonProperty("jti") - @XmlElement( - name = "jti" - ) - public String getJti() { - return this.jti; - } - - public void setJti(String jti) { - this.jti = jti; - } - - @JsonProperty("sub") - @XmlElement( - name = "sub" - ) - public String getSub() { - return this.sub; - } - - public void setSub(String sub) { - this.sub = sub; - } - - @JsonProperty("client_id") - @XmlElement( - name = "client_id" - ) - public String getClientId() { - return this.clientId; - } - - public void setClientId(String clientId) { - this.clientId = clientId; - } - - @JsonProperty("active") - @XmlElement( - name = "active" - ) - public boolean getActive() { - return this.active; - } - - public void setActive(boolean status) { - this.active = status; - } - - @JsonProperty("nbf") - @XmlElement( - name = "nbf" - ) - public Date getNbf() { - return this.nbf; - } - - public void setNbf(Date nbf) { - this.nbf = nbf; - } - - @JsonProperty("exp") - @XmlElement( - name = "exp" - ) - public Date getExpiresAt() { - return this.expiresAt != null ? new Date(this.expiresAt.getTime()) : null; - } - - public void setExpiresAt(Date expirationDate) { - this.expiresAt = expirationDate != null ? new Date(expirationDate.getTime()) : null; - } - - @JsonProperty("iat") - @XmlElement( - name = "iat" - ) - public Date getIssuedAt() { - return this.issuedAt != null ? new Date(this.issuedAt.getTime()) : null; - } - - public void setIssuedAt(Date p_issuedAt) { - this.issuedAt = p_issuedAt != null ? new Date(p_issuedAt.getTime()) : null; - } - - @JsonProperty("permissions") - @XmlElement( - name = "permissions" - ) - public List getPermissions() { - return this.permissions; - } - - public void setPermissions(List p_permissions) { - this.permissions = p_permissions; - } - - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("RptStatusResponse"); - sb.append("{active=").append(this.active); - sb.append(", expiresAt=").append(this.expiresAt); - sb.append(", issuedAt=").append(this.issuedAt); - sb.append(", nbf=").append(this.nbf); - sb.append(", clientId=").append(this.clientId); - sb.append(", sub=").append(this.sub); - sb.append(", aud=").append(this.aud); - sb.append(", iss=").append(this.iss); - sb.append(", jti=").append(this.jti); - sb.append(", permissions=").append(this.permissions); - sb.append('}'); - return sb.toString(); - } -} diff --git a/jans-client-api/server/src/main/java/io/jans/ca/server/introspection/BadRptIntrospectionService.java b/jans-client-api/server/src/main/java/io/jans/ca/server/introspection/BadRptIntrospectionService.java deleted file mode 100644 index d68e6296c9a..00000000000 --- a/jans-client-api/server/src/main/java/io/jans/ca/server/introspection/BadRptIntrospectionService.java +++ /dev/null @@ -1,16 +0,0 @@ -package io.jans.ca.server.introspection; - -import io.jans.as.model.uma.UmaConstants; -import jakarta.ws.rs.*; - -/** - * @author yuriyz - */ -public interface BadRptIntrospectionService { - - @POST - @Produces({UmaConstants.JSON_MEDIA_TYPE}) - BadRptIntrospectionResponse requestRptStatus(@HeaderParam("Authorization") String authorization, - @FormParam("token") String rptAsString, - @FormParam("token_type_hint") String tokenTypeHint); -} diff --git a/jans-client-api/server/src/main/java/io/jans/ca/server/introspection/BadUmaPermission.java b/jans-client-api/server/src/main/java/io/jans/ca/server/introspection/BadUmaPermission.java deleted file mode 100644 index eaf1eaa7ccc..00000000000 --- a/jans-client-api/server/src/main/java/io/jans/ca/server/introspection/BadUmaPermission.java +++ /dev/null @@ -1,87 +0,0 @@ -package io.jans.ca.server.introspection; - -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import jakarta.xml.bind.annotation.XmlElement; -import jakarta.xml.bind.annotation.XmlRootElement; -import org.jboss.resteasy.annotations.providers.jaxb.IgnoreMediaTypes; - -import java.io.Serializable; -import java.util.Date; -import java.util.List; -import java.util.Map; - -@IgnoreMediaTypes({"application/*+json"}) -@JsonPropertyOrder({"resource_id", "resource_scopes", "exp"}) -@JsonIgnoreProperties( - ignoreUnknown = true -) -@XmlRootElement -public class BadUmaPermission implements Serializable { - - private String resourceId; - private List scopes; - private Date expiresAt; - private Map params; - - public BadUmaPermission() { - } - - public BadUmaPermission(String resourceId, List scopes) { - this.resourceId = resourceId; - this.scopes = scopes; - } - - @JsonProperty("resource_id") - @XmlElement( - name = "resource_id" - ) - public String getResourceId() { - return this.resourceId; - } - - public void setResourceId(String resourceId) { - this.resourceId = resourceId; - } - - @JsonProperty("resource_scopes") - @XmlElement( - name = "resource_scopes" - ) - public List getScopes() { - return this.scopes; - } - - public void setScopes(List scopes) { - this.scopes = scopes; - } - - @JsonProperty("exp") - @XmlElement( - name = "exp" - ) - public Date getExpiresAt() { - return this.expiresAt; - } - - public void setExpiresAt(Date expiresAt) { - this.expiresAt = expiresAt; - } - - @JsonProperty("params") - @XmlElement( - name = "params" - ) - public Map getParams() { - return this.params; - } - - public void setParams(Map params) { - this.params = params; - } - - public String toString() { - return "UmaPermission{resourceId=\'" + this.resourceId + '\'' + ", scopes=" + this.scopes + ", expiresAt=" + this.expiresAt + '}'; - } -} diff --git a/jans-client-api/server/src/main/java/io/jans/ca/server/introspection/ClientFactory.java b/jans-client-api/server/src/main/java/io/jans/ca/server/introspection/ClientFactory.java deleted file mode 100644 index 5310d555b52..00000000000 --- a/jans-client-api/server/src/main/java/io/jans/ca/server/introspection/ClientFactory.java +++ /dev/null @@ -1,70 +0,0 @@ -package io.jans.ca.server.introspection; - -import io.jans.as.client.service.IntrospectionService; -import io.jans.as.model.uma.UmaMetadata; -import jakarta.ws.rs.client.ClientBuilder; -import jakarta.ws.rs.core.UriBuilder; -import org.jboss.resteasy.client.jaxrs.ClientHttpEngine; -import org.jboss.resteasy.client.jaxrs.ResteasyClient; -import org.jboss.resteasy.client.jaxrs.ResteasyClientBuilder; -import org.jboss.resteasy.client.jaxrs.ResteasyWebTarget; - -/** - * @author yuriyz - */ -public class ClientFactory { - private final static ClientFactory INSTANCE = new ClientFactory(); - - private ClientFactory() { - } - - public static ClientFactory instance() { - return INSTANCE; - } - - public BackCompatibleIntrospectionService createBackCompatibleIntrospectionService(String url) { - final ResteasyClient client = (ResteasyClient) ClientBuilder.newClient(); - final ResteasyWebTarget target = client.target(UriBuilder.fromPath(url)); - - return target.proxy(BackCompatibleIntrospectionService.class); - } - - public BackCompatibleIntrospectionService createBackCompatibleIntrospectionService(String url, ClientHttpEngine clientEngine) { - final ResteasyClient client = ((ResteasyClientBuilder) ClientBuilder.newBuilder()).httpEngine(clientEngine).build(); - final ResteasyWebTarget target = client.target(UriBuilder.fromPath(url)); - return target.proxy(BackCompatibleIntrospectionService.class); - } - - public BadRptIntrospectionService createBadRptStatusService(UmaMetadata metadata) { - final ResteasyClient client = (ResteasyClient) ClientBuilder.newClient(); - final ResteasyWebTarget target = client.target(UriBuilder.fromPath(metadata.getIntrospectionEndpoint())); - - return target.proxy(BadRptIntrospectionService.class); - } - - public BadRptIntrospectionService createBadRptStatusService(UmaMetadata metadata, ClientHttpEngine clientEngine) { - final ResteasyClient client = ((ResteasyClientBuilder) ClientBuilder.newBuilder()).httpEngine(clientEngine).build(); - final ResteasyWebTarget target = client.target(UriBuilder.fromPath(metadata.getIntrospectionEndpoint())); - return target.proxy(BadRptIntrospectionService.class); - } - - public CorrectRptIntrospectionService createCorrectRptStatusService(UmaMetadata metadata) { - final ResteasyClient client = (ResteasyClient) ClientBuilder.newClient(); - final ResteasyWebTarget target = client.target(UriBuilder.fromPath(metadata.getIntrospectionEndpoint())); - - return target.proxy(CorrectRptIntrospectionService.class); - } - - public CorrectRptIntrospectionService createCorrectRptStatusService(UmaMetadata metadata, ClientHttpEngine clientEngine) { - final ResteasyClient client = ((ResteasyClientBuilder) ClientBuilder.newBuilder()).httpEngine(clientEngine).build(); - final ResteasyWebTarget target = client.target(UriBuilder.fromPath(metadata.getIntrospectionEndpoint())); - return target.proxy(CorrectRptIntrospectionService.class); - } - - public IntrospectionService createIntrospectionService(String introspectionEndpoint, ClientHttpEngine clientEngine) { - final ResteasyClient client = ((ResteasyClientBuilder) ClientBuilder.newBuilder()).httpEngine(clientEngine).build(); - final ResteasyWebTarget target = client.target(UriBuilder.fromPath(introspectionEndpoint)); - return target.proxy(IntrospectionService.class); - } - -} diff --git a/jans-client-api/server/src/main/java/io/jans/ca/server/introspection/CorrectRptIntrospectionService.java b/jans-client-api/server/src/main/java/io/jans/ca/server/introspection/CorrectRptIntrospectionService.java deleted file mode 100644 index 976752e9b19..00000000000 --- a/jans-client-api/server/src/main/java/io/jans/ca/server/introspection/CorrectRptIntrospectionService.java +++ /dev/null @@ -1,16 +0,0 @@ -package io.jans.ca.server.introspection; - -import io.jans.as.model.uma.UmaConstants; -import io.jans.ca.common.introspection.CorrectRptIntrospectionResponse; -import jakarta.ws.rs.*; - -/** - * @author yuriyz - */ -public interface CorrectRptIntrospectionService { - @POST - @Produces({UmaConstants.JSON_MEDIA_TYPE}) - CorrectRptIntrospectionResponse requestRptStatus(@HeaderParam("Authorization") String authorization, - @FormParam("token") String rptAsString, - @FormParam("token_type_hint") String tokenTypeHint); -} diff --git a/jans-client-api/server/src/main/java/io/jans/ca/server/mapper/RegisterRequestMapper.java b/jans-client-api/server/src/main/java/io/jans/ca/server/mapper/RegisterRequestMapper.java deleted file mode 100644 index 80f87fa175d..00000000000 --- a/jans-client-api/server/src/main/java/io/jans/ca/server/mapper/RegisterRequestMapper.java +++ /dev/null @@ -1,322 +0,0 @@ -package io.jans.ca.server.mapper; - -import com.google.common.base.Strings; -import io.jans.as.client.RegisterRequest; -import io.jans.as.model.common.AuthenticationMethod; -import io.jans.as.model.common.GrantType; -import io.jans.as.model.common.SubjectType; -import io.jans.as.model.crypto.encryption.BlockEncryptionAlgorithm; -import io.jans.as.model.crypto.encryption.KeyEncryptionAlgorithm; -import io.jans.as.model.crypto.signature.SignatureAlgorithm; -import io.jans.as.model.register.ApplicationType; -import io.jans.ca.server.configuration.model.Rp; -import org.apache.commons.collections.CollectionUtils; -import org.apache.commons.collections.MapUtils; -import org.apache.commons.lang.math.NumberUtils; - -import java.util.stream.Collectors; - -public class RegisterRequestMapper { - - private RegisterRequestMapper() { - } - - public static void fillRp(Rp rp, RegisterRequest request) { - - if (!Strings.isNullOrEmpty(request.getClientName())) { - rp.setClientName(request.getClientName()); - } - - rp.setApplicationType(safeToString(request.getApplicationType())); - rp.setTokenEndpointAuthSigningAlg(safeToString(request.getTokenEndpointAuthSigningAlg())); - - if (CollectionUtils.isNotEmpty(request.getGrantTypes())) { - rp.setGrantType(request.getGrantTypes().stream().map(item -> item.getValue()).collect(Collectors.toList())); - } - - rp.setFrontChannelLogoutUri(request.getFrontChannelLogoutUri()); - rp.setTokenEndpointAuthMethod(safeToString(request.getTokenEndpointAuthMethod())); - - if (CollectionUtils.isNotEmpty(request.getRequestUris())) { - rp.setRequestUris(request.getRequestUris()); - } - - if (!Strings.isNullOrEmpty(request.getSectorIdentifierUri())) { - rp.setSectorIdentifierUri(request.getSectorIdentifierUri()); - } - - if (CollectionUtils.isNotEmpty(request.getRedirectUris())) { - rp.setRedirectUris(request.getRedirectUris()); - rp.setRedirectUri(request.getRedirectUris().get(0)); - } - - rp.setAccessTokenAsJwt(request.getAccessTokenAsJwt()); - rp.setAccessTokenSigningAlg(safeToString(request.getAccessTokenSigningAlg())); - rp.setRptAsJwt(request.getRptAsJwt()); - - if (CollectionUtils.isNotEmpty(request.getResponseTypesStrings())) { - rp.setResponseTypes(request.getResponseTypesStrings()); - } - - if (CollectionUtils.isNotEmpty(request.getDefaultAcrValues())) { - rp.setAcrValues(request.getDefaultAcrValues()); - } - - if (CollectionUtils.isNotEmpty(request.getContacts())) { - rp.setContacts(request.getContacts()); - } - - if (CollectionUtils.isNotEmpty(request.getPostLogoutRedirectUris())) { - rp.setPostLogoutRedirectUris(request.getPostLogoutRedirectUris()); - } - - if (CollectionUtils.isNotEmpty(request.getScope())) { - rp.setScope(request.getScope()); - } - - if (!Strings.isNullOrEmpty(request.getLogoUri())) { - rp.setLogoUri(request.getLogoUri()); - } - - if (!Strings.isNullOrEmpty(request.getClientUri())) { - rp.setClientUri(request.getClientUri()); - } - - if (!Strings.isNullOrEmpty(request.getPolicyUri())) { - rp.setPolicyUri(request.getPolicyUri()); - } - rp.setFrontChannelLogoutSessionRequired(request.getFrontChannelLogoutSessionRequired()); - - if (!Strings.isNullOrEmpty(request.getTosUri())) { - rp.setTosUri(request.getTosUri()); - } - - if (!Strings.isNullOrEmpty(request.getJwks())) { - rp.setJwks(request.getJwks()); - } - - if (!Strings.isNullOrEmpty(request.getIdTokenTokenBindingCnf())) { - rp.setIdTokenBindingCnf(request.getIdTokenTokenBindingCnf()); - } - - if (!Strings.isNullOrEmpty(request.getTlsClientAuthSubjectDn())) { - rp.setTlsClientAuthSubjectDn(request.getTlsClientAuthSubjectDn()); - } - - rp.setSubjectType(safeToString(request.getSubjectType())); - rp.setRunIntrospectionScriptBeforeAccessTokenAsJwtCreationAndIncludeClaims(request.getRunIntrospectionScriptBeforeJwtCreation()); - rp.setIdTokenSignedResponseAlg(safeToString(request.getIdTokenSignedResponseAlg())); - rp.setIdTokenEncryptedResponseAlg(safeToString(request.getIdTokenEncryptedResponseAlg())); - rp.setIdTokenEncryptedResponseEnc(safeToString(request.getIdTokenEncryptedResponseEnc())); - rp.setUserInfoSignedResponseAlg(safeToString(request.getUserInfoSignedResponseAlg())); - rp.setUserInfoEncryptedResponseAlg(safeToString(request.getUserInfoEncryptedResponseAlg())); - rp.setUserInfoEncryptedResponseEnc(safeToString(request.getUserInfoEncryptedResponseEnc())); - rp.setRequestObjectSigningAlg(safeToString(request.getRequestObjectSigningAlg())); - rp.setRequestObjectEncryptionAlg(safeToString(request.getRequestObjectEncryptionAlg())); - rp.setRequestObjectEncryptionEnc(safeToString(request.getRequestObjectEncryptionEnc())); - rp.setDefaultMaxAge(safeToNumber(request.getDefaultMaxAge())); - - if (!Strings.isNullOrEmpty(request.getInitiateLoginUri())) { - rp.setInitiateLoginUri(request.getInitiateLoginUri()); - } - - if (CollectionUtils.isNotEmpty(request.getAuthorizedOrigins())) { - rp.setAuthorizedOrigins(request.getAuthorizedOrigins()); - } - - rp.setAccessTokenLifetime(safeToNumber(request.getAccessTokenLifetime())); - - if (!Strings.isNullOrEmpty(request.getSoftwareId())) { - rp.setSoftwareId(request.getSoftwareId()); - } - - if (!Strings.isNullOrEmpty(request.getSoftwareVersion())) { - rp.setSoftwareVersion(request.getSoftwareVersion()); - } - - if (!Strings.isNullOrEmpty(request.getSoftwareStatement())) { - rp.setSoftwareStatement(request.getSoftwareStatement()); - } - - if (MapUtils.isNotEmpty(request.getCustomAttributes())) { - request.getCustomAttributes().entrySet().stream().forEach(e -> { - rp.addCustomAttribute(e.getKey(), e.getValue()); - }); - } - - if (!Strings.isNullOrEmpty(request.getJwksUri())) { - rp.setClientJwksUri(request.getJwksUri()); - } - - if (CollectionUtils.isNotEmpty(request.getClaimsRedirectUris())) { - rp.setClaimsRedirectUri(request.getClaimsRedirectUris()); - } - - if (request.getAllowSpontaneousScopes() != null) { - rp.setAllowSpontaneousScopes(request.getAllowSpontaneousScopes()); - } - - if (CollectionUtils.isNotEmpty(request.getSpontaneousScopes())) { - rp.setSpontaneousScopes(request.getSpontaneousScopes()); - } - } - - public static RegisterRequest createRegisterRequest(Rp rp) { - final RegisterRequest request = new RegisterRequest(rp.getClientRegistrationAccessToken()); - - if (!Strings.isNullOrEmpty(rp.getClientName())) { - request.setClientName(rp.getClientName()); - } - - request.setApplicationType(ApplicationType.fromString(rp.getApplicationType())); - request.setTokenEndpointAuthSigningAlg(SignatureAlgorithm.fromString(rp.getTokenEndpointAuthSigningAlg())); - - if (CollectionUtils.isNotEmpty(rp.getGrantType())) { - request.setGrantTypes(rp.getGrantType().stream().map(item -> GrantType.fromString(item)).collect(Collectors.toList())); - } - - request.setFrontChannelLogoutUri(rp.getFrontChannelLogoutUri()); - request.setTokenEndpointAuthMethod(AuthenticationMethod.fromString(rp.getTokenEndpointAuthMethod())); - - if (CollectionUtils.isNotEmpty(rp.getRequestUris())) { - request.setRequestUris(rp.getRequestUris()); - } - - if (!Strings.isNullOrEmpty(rp.getSectorIdentifierUri())) { - request.setSectorIdentifierUri(rp.getSectorIdentifierUri()); - } - - if (CollectionUtils.isNotEmpty(rp.getRedirectUris())) { - request.setRedirectUris(rp.getRedirectUris()); - } - - request.setAccessTokenAsJwt(rp.getAccessTokenAsJwt()); - request.setAccessTokenSigningAlg(SignatureAlgorithm.fromString(rp.getAccessTokenSigningAlg())); - request.setRptAsJwt(rp.getRptAsJwt()); - - if (CollectionUtils.isNotEmpty(rp.getResponseTypes())) { - request.setResponseTypesStrings(rp.getResponseTypes()); - } - - if (CollectionUtils.isNotEmpty(rp.getAcrValues())) { - request.setDefaultAcrValues(rp.getAcrValues()); - } - - if (CollectionUtils.isNotEmpty(rp.getContacts())) { - request.setContacts(rp.getContacts()); - } - - if (CollectionUtils.isNotEmpty(rp.getPostLogoutRedirectUris())) { - request.setPostLogoutRedirectUris(rp.getPostLogoutRedirectUris()); - } - - if (CollectionUtils.isNotEmpty(rp.getScope())) { - request.setScope(rp.getScope()); - } - - if (!Strings.isNullOrEmpty(rp.getLogoUri())) { - request.setLogoUri(rp.getLogoUri()); - } - - if (!Strings.isNullOrEmpty(rp.getClientUri())) { - request.setClientUri(rp.getClientUri()); - } - - if (!Strings.isNullOrEmpty(rp.getPolicyUri())) { - request.setPolicyUri(rp.getPolicyUri()); - } - - request.setFrontChannelLogoutSessionRequired(rp.getFrontChannelLogoutSessionRequired()); - - if (!Strings.isNullOrEmpty(rp.getTosUri())) { - request.setTosUri(rp.getTosUri()); - } - - if (!Strings.isNullOrEmpty(rp.getJwks())) { - request.setJwks(rp.getJwks()); - } - - if (!Strings.isNullOrEmpty(rp.getIdTokenBindingCnf())) { - request.setIdTokenTokenBindingCnf(rp.getIdTokenBindingCnf()); - } - - if (!Strings.isNullOrEmpty(rp.getTlsClientAuthSubjectDn())) { - request.setTlsClientAuthSubjectDn(rp.getTlsClientAuthSubjectDn()); - } - - if (!Strings.isNullOrEmpty(rp.getSubjectType())) { - request.setSubjectType(SubjectType.fromString(rp.getSubjectType())); - } - - request.setRunIntrospectionScriptBeforeJwtCreation(rp.getRunIntrospectionScriptBeforeAccessTokenAsJwtCreationAndIncludeClaims()); - request.setIdTokenSignedResponseAlg(SignatureAlgorithm.fromString(rp.getIdTokenSignedResponseAlg())); - request.setIdTokenEncryptedResponseAlg(KeyEncryptionAlgorithm.fromName(rp.getIdTokenEncryptedResponseAlg())); - request.setIdTokenEncryptedResponseEnc(BlockEncryptionAlgorithm.fromName(rp.getIdTokenEncryptedResponseEnc())); - request.setUserInfoSignedResponseAlg(SignatureAlgorithm.fromString(rp.getUserInfoSignedResponseAlg())); - request.setUserInfoEncryptedResponseAlg(KeyEncryptionAlgorithm.fromName(rp.getUserInfoEncryptedResponseAlg())); - request.setUserInfoEncryptedResponseEnc(BlockEncryptionAlgorithm.fromName(rp.getUserInfoEncryptedResponseEnc())); - request.setRequestObjectSigningAlg(SignatureAlgorithm.fromString(rp.getRequestObjectSigningAlg())); - request.setRequestObjectEncryptionAlg(KeyEncryptionAlgorithm.fromName(rp.getRequestObjectEncryptionAlg())); - request.setRequestObjectEncryptionEnc(BlockEncryptionAlgorithm.fromName(rp.getRequestObjectEncryptionEnc())); - - request.setDefaultMaxAge(safeToNumber(rp.getDefaultMaxAge())); - - if (!Strings.isNullOrEmpty(rp.getInitiateLoginUri())) { - request.setInitiateLoginUri(rp.getInitiateLoginUri()); - } - - if (CollectionUtils.isNotEmpty(rp.getAuthorizedOrigins())) { - request.setAuthorizedOrigins(rp.getAuthorizedOrigins()); - } - - request.setAccessTokenLifetime(safeToNumber(rp.getAccessTokenLifetime())); - - if (!Strings.isNullOrEmpty(rp.getSoftwareId())) { - request.setSoftwareId(rp.getSoftwareId()); - } - - if (!Strings.isNullOrEmpty(rp.getSoftwareVersion())) { - request.setSoftwareVersion(rp.getSoftwareVersion()); - } - - if (!Strings.isNullOrEmpty(rp.getSoftwareStatement())) { - request.setSoftwareStatement(rp.getSoftwareStatement()); - } - - if (MapUtils.isNotEmpty(rp.getCustomAttributes())) { - rp.getCustomAttributes().entrySet().stream().forEach(e -> { - request.addCustomAttribute(e.getKey(), e.getValue()); - }); - } - - if (!Strings.isNullOrEmpty(rp.getClientJwksUri())) { - request.setJwksUri(rp.getClientJwksUri()); - } - - if (CollectionUtils.isNotEmpty(rp.getClaimsRedirectUri())) { - request.setClaimsRedirectUris(rp.getClaimsRedirectUri()); - } - - if (rp.getAllowSpontaneousScopes() != null) { - request.setAllowSpontaneousScopes(rp.getAllowSpontaneousScopes()); - } - - if (CollectionUtils.isNotEmpty(rp.getSpontaneousScopes())) { - request.setSpontaneousScopes(rp.getSpontaneousScopes()); - } - - return request; - } - - public static String safeToString(Object obj) { - if (obj == null) - return null; - return obj.toString(); - } - - public static Integer safeToNumber(Object obj) { - if (obj == null || !NumberUtils.isNumber(obj.toString())) - return null; - return Integer.valueOf(obj.toString()); - } -} diff --git a/jans-client-api/server/src/main/java/io/jans/ca/server/mapper/RegisterResponseMapper.java b/jans-client-api/server/src/main/java/io/jans/ca/server/mapper/RegisterResponseMapper.java deleted file mode 100644 index b97e7096776..00000000000 --- a/jans-client-api/server/src/main/java/io/jans/ca/server/mapper/RegisterResponseMapper.java +++ /dev/null @@ -1,288 +0,0 @@ -package io.jans.ca.server.mapper; - -import com.google.common.base.Objects; -import com.google.common.base.Strings; -import io.jans.as.client.RegisterRequest; -import io.jans.as.client.RegisterResponse; -import io.jans.ca.common.Jackson2; -import io.jans.ca.server.configuration.model.Rp; -import org.apache.commons.lang.StringUtils; - -import java.io.IOException; -import java.util.HashSet; -import java.util.List; - -public class RegisterResponseMapper { - - public static boolean fillRp(Rp rp, RegisterResponse response) throws IOException { - - Rp rpFromOP = createRp(response); - boolean isRpChanged = false; - - if (!StringUtils.equals(rpFromOP.getClientSecret(), rp.getClientSecret())) { - rp.setClientSecret(rpFromOP.getClientSecret()); - isRpChanged = true; - } - - if (!Objects.equal(rpFromOP.getClientSecretExpiresAt(), rp.getClientSecretExpiresAt())) { - rp.setClientSecretExpiresAt(rpFromOP.getClientSecretExpiresAt()); - isRpChanged = true; - } - - if (!StringUtils.equals(rpFromOP.getClientName(), rp.getClientName())) { - rp.setClientName(rpFromOP.getClientName()); - isRpChanged = true; - } - - if (!StringUtils.equals(rpFromOP.getTokenEndpointAuthSigningAlg(), rp.getTokenEndpointAuthSigningAlg())) { - rp.setTokenEndpointAuthSigningAlg(rpFromOP.getTokenEndpointAuthSigningAlg()); - isRpChanged = true; - } - - if (!isListsEqualIgnoringOrder(rpFromOP.getGrantType(), rp.getGrantType())) { - rp.setGrantType(rpFromOP.getGrantType()); - isRpChanged = true; - } - - if (!StringUtils.equals(rpFromOP.getFrontChannelLogoutUri(), rp.getFrontChannelLogoutUri())) { - rp.setFrontChannelLogoutUri(rpFromOP.getFrontChannelLogoutUri()); - isRpChanged = true; - } - - if (!StringUtils.equals(rpFromOP.getTokenEndpointAuthMethod(), rp.getTokenEndpointAuthMethod())) { - rp.setTokenEndpointAuthMethod(rpFromOP.getTokenEndpointAuthMethod()); - isRpChanged = true; - } - - if (!isListsEqualIgnoringOrder(rpFromOP.getRequestUris(), rp.getRequestUris())) { - rp.setRequestUris(rpFromOP.getRequestUris()); - isRpChanged = true; - } - - if (!StringUtils.equals(rpFromOP.getSectorIdentifierUri(), rp.getSectorIdentifierUri())) { - rp.setSectorIdentifierUri(rpFromOP.getSectorIdentifierUri()); - isRpChanged = true; - } - - if (!isListsEqualIgnoringOrder(rpFromOP.getRedirectUris(), rp.getRedirectUris())) { - rp.setRedirectUris(rpFromOP.getRedirectUris()); - isRpChanged = true; - } - - if (!Objects.equal(rpFromOP.getAccessTokenAsJwt(), rp.getAccessTokenAsJwt())) { - rp.setAccessTokenAsJwt(rpFromOP.getAccessTokenAsJwt()); - isRpChanged = true; - } - - if (!StringUtils.equals(rpFromOP.getAccessTokenSigningAlg(), rp.getAccessTokenSigningAlg())) { - rp.setAccessTokenSigningAlg(rpFromOP.getAccessTokenSigningAlg()); - isRpChanged = true; - } - - if (!Objects.equal(rpFromOP.getRptAsJwt(), rp.getRptAsJwt())) { - rp.setRptAsJwt(rpFromOP.getRptAsJwt()); - isRpChanged = true; - } - - if (!isListsEqualIgnoringOrder(rpFromOP.getResponseTypes(), rp.getResponseTypes())) { - rp.setResponseTypes(rpFromOP.getResponseTypes()); - isRpChanged = true; - } - - if (!isListsEqualIgnoringOrder(rpFromOP.getAcrValues(), rp.getAcrValues())) { - rp.setAcrValues(rpFromOP.getAcrValues()); - isRpChanged = true; - } - - if (!isListsEqualIgnoringOrder(rpFromOP.getContacts(), rp.getContacts())) { - rp.setContacts(rpFromOP.getContacts()); - isRpChanged = true; - } - - if (!isListsEqualIgnoringOrder(rpFromOP.getPostLogoutRedirectUris(), rp.getPostLogoutRedirectUris())) { - rp.setPostLogoutRedirectUris(rpFromOP.getPostLogoutRedirectUris()); - isRpChanged = true; - } - - if (!isListsEqualIgnoringOrder(rpFromOP.getScope(), rp.getScope())) { - rp.setScope(rpFromOP.getScope()); - isRpChanged = true; - } - - if (!StringUtils.equals(rpFromOP.getLogoUri(), rp.getLogoUri())) { - rp.setLogoUri(rpFromOP.getLogoUri()); - isRpChanged = true; - } - - if (!StringUtils.equals(rpFromOP.getClientUri(), rp.getClientUri())) { - rp.setClientUri(rpFromOP.getClientUri()); - isRpChanged = true; - } - - if (!StringUtils.equals(rpFromOP.getPolicyUri(), rp.getPolicyUri())) { - rp.setPolicyUri(rpFromOP.getPolicyUri()); - isRpChanged = true; - } - - if (!Objects.equal(rpFromOP.getFrontChannelLogoutSessionRequired(), rp.getFrontChannelLogoutSessionRequired())) { - rp.setFrontChannelLogoutSessionRequired(rpFromOP.getFrontChannelLogoutSessionRequired()); - isRpChanged = true; - } - - if (!StringUtils.equals(rpFromOP.getTosUri(), rp.getTosUri())) { - rp.setTosUri(rpFromOP.getTosUri()); - isRpChanged = true; - } - - if (!isJsonStringEqual(rpFromOP.getJwks(), rp.getJwks())) { - rp.setJwks(rpFromOP.getJwks()); - isRpChanged = true; - } - if (!StringUtils.equals(rpFromOP.getIdTokenBindingCnf(), rp.getIdTokenBindingCnf())) { - rp.setIdTokenBindingCnf(rpFromOP.getIdTokenBindingCnf()); - isRpChanged = true; - } - - if (!StringUtils.equals(rpFromOP.getTlsClientAuthSubjectDn(), rp.getTlsClientAuthSubjectDn())) { - rp.setTlsClientAuthSubjectDn(rpFromOP.getTlsClientAuthSubjectDn()); - isRpChanged = true; - } - - if (!StringUtils.equals(rpFromOP.getSubjectType(), rp.getSubjectType())) { - rp.setSubjectType(rpFromOP.getSubjectType()); - isRpChanged = true; - } - - if (!Objects.equal(rpFromOP.getRunIntrospectionScriptBeforeAccessTokenAsJwtCreationAndIncludeClaims(), rp.getRunIntrospectionScriptBeforeAccessTokenAsJwtCreationAndIncludeClaims())) { - rp.setRunIntrospectionScriptBeforeAccessTokenAsJwtCreationAndIncludeClaims(rpFromOP.getRunIntrospectionScriptBeforeAccessTokenAsJwtCreationAndIncludeClaims()); - isRpChanged = true; - } - - if (!StringUtils.equals(rpFromOP.getIdTokenSignedResponseAlg(), rp.getIdTokenSignedResponseAlg())) { - rp.setIdTokenSignedResponseAlg(rpFromOP.getIdTokenSignedResponseAlg()); - isRpChanged = true; - } - - if (!StringUtils.equals(rpFromOP.getIdTokenEncryptedResponseAlg(), rp.getIdTokenEncryptedResponseAlg())) { - rp.setIdTokenEncryptedResponseAlg(rpFromOP.getIdTokenEncryptedResponseAlg()); - isRpChanged = true; - } - - if (!StringUtils.equals(rpFromOP.getIdTokenEncryptedResponseEnc(), rp.getIdTokenEncryptedResponseEnc())) { - rp.setIdTokenEncryptedResponseEnc(rpFromOP.getIdTokenEncryptedResponseEnc()); - isRpChanged = true; - } - - if (!StringUtils.equals(rpFromOP.getUserInfoSignedResponseAlg(), rp.getUserInfoSignedResponseAlg())) { - rp.setUserInfoSignedResponseAlg(rpFromOP.getUserInfoSignedResponseAlg()); - isRpChanged = true; - } - - if (!StringUtils.equals(rpFromOP.getUserInfoEncryptedResponseAlg(), rp.getUserInfoEncryptedResponseAlg())) { - rp.setUserInfoEncryptedResponseAlg(rpFromOP.getUserInfoEncryptedResponseAlg()); - isRpChanged = true; - } - - if (!StringUtils.equals(rpFromOP.getUserInfoEncryptedResponseEnc(), rp.getUserInfoEncryptedResponseEnc())) { - rp.setUserInfoEncryptedResponseEnc(rpFromOP.getUserInfoEncryptedResponseEnc()); - isRpChanged = true; - } - - if (!StringUtils.equals(rpFromOP.getRequestObjectSigningAlg(), rp.getRequestObjectSigningAlg())) { - rp.setRequestObjectSigningAlg(rpFromOP.getRequestObjectSigningAlg()); - isRpChanged = true; - } - - if (!StringUtils.equals(rpFromOP.getRequestObjectSigningAlg(), rp.getRequestObjectSigningAlg())) { - rp.setRequestObjectSigningAlg(rpFromOP.getRequestObjectSigningAlg()); - isRpChanged = true; - } - - if (!StringUtils.equals(rpFromOP.getRequestObjectEncryptionAlg(), rp.getRequestObjectEncryptionAlg())) { - rp.setRequestObjectEncryptionAlg(rpFromOP.getRequestObjectEncryptionAlg()); - isRpChanged = true; - } - - if (!StringUtils.equals(rpFromOP.getRequestObjectEncryptionEnc(), rp.getRequestObjectEncryptionEnc())) { - rp.setRequestObjectEncryptionEnc(rpFromOP.getRequestObjectEncryptionEnc()); - isRpChanged = true; - } - - if (!Objects.equal(rpFromOP.getDefaultMaxAge(), rp.getDefaultMaxAge())) { - rp.setDefaultMaxAge(rpFromOP.getDefaultMaxAge()); - isRpChanged = true; - } - - if (!Objects.equal(rpFromOP.getRequireAuthTime(), rp.getRequireAuthTime())) { - rp.setRequireAuthTime(rpFromOP.getRequireAuthTime()); - isRpChanged = true; - } - - if (!StringUtils.equals(rpFromOP.getInitiateLoginUri(), rp.getInitiateLoginUri())) { - rp.setInitiateLoginUri(rpFromOP.getInitiateLoginUri()); - isRpChanged = true; - } - - if (!isListsEqualIgnoringOrder(rpFromOP.getAuthorizedOrigins(), rp.getAuthorizedOrigins())) { - rp.setAuthorizedOrigins(rpFromOP.getAuthorizedOrigins()); - isRpChanged = true; - } - - if (!Objects.equal(rpFromOP.getAccessTokenLifetime(), rp.getAccessTokenLifetime())) { - rp.setAccessTokenLifetime(rpFromOP.getAccessTokenLifetime()); - isRpChanged = true; - } - - if (!StringUtils.equals(rpFromOP.getSoftwareId(), rp.getSoftwareId())) { - rp.setSoftwareId(rpFromOP.getSoftwareId()); - isRpChanged = true; - } - - if (!StringUtils.equals(rpFromOP.getSoftwareVersion(), rp.getSoftwareVersion())) { - rp.setSoftwareVersion(rpFromOP.getSoftwareVersion()); - isRpChanged = true; - } - - if (!StringUtils.equals(rpFromOP.getSoftwareStatement(), rp.getSoftwareStatement())) { - rp.setSoftwareStatement(rpFromOP.getSoftwareStatement()); - isRpChanged = true; - } - - if (!StringUtils.equals(rpFromOP.getClientJwksUri(), rp.getClientJwksUri())) { - rp.setClientJwksUri(rpFromOP.getClientJwksUri()); - isRpChanged = true; - } - - if (!isListsEqualIgnoringOrder(rpFromOP.getClaimsRedirectUri(), rp.getClaimsRedirectUri())) { - rp.setClaimsRedirectUri(rpFromOP.getClaimsRedirectUri()); - isRpChanged = true; - } - - return isRpChanged; - } - - public static Rp createRp(RegisterResponse response) { - Rp rpFromRegisterResponse = new Rp(); - RegisterRequest request = RegisterRequest.fromJson(response.getEntity()); - - RegisterRequestMapper.fillRp(rpFromRegisterResponse, request); - rpFromRegisterResponse.setClientId(response.getClientId()); - rpFromRegisterResponse.setClientSecret(response.getClientSecret()); - rpFromRegisterResponse.setClientSecretExpiresAt(response.getClientSecretExpiresAt()); - - return rpFromRegisterResponse; - } - - public static boolean isListsEqualIgnoringOrder(List rps, List rpFromOP) { - if (rps == null || rps.isEmpty()) { - return rpFromOP == null || rpFromOP.isEmpty(); - } else if (rpFromOP != null) { - return new HashSet<>(rps).equals(new HashSet<>(rpFromOP)); - } - return false; - } - - public static boolean isJsonStringEqual(String rpParam, String rpFormOPparam) throws IOException { - return Strings.isNullOrEmpty(rpParam) ? Strings.isNullOrEmpty(rpFormOPparam) : Jackson2.createJsonMapperWithoutEmptyAttributes().readTree(rpParam).equals(Jackson2.createJsonMapperWithoutEmptyAttributes().readTree(rpFormOPparam)); - } -} diff --git a/jans-client-api/server/src/main/java/io/jans/ca/server/model/Pat.java b/jans-client-api/server/src/main/java/io/jans/ca/server/model/Pat.java deleted file mode 100644 index 6e057fd3940..00000000000 --- a/jans-client-api/server/src/main/java/io/jans/ca/server/model/Pat.java +++ /dev/null @@ -1,16 +0,0 @@ -package io.jans.ca.server.model; - -/** - * @author Yuriy Zabrovarnyy - * @version 0.9, 02/06/2016 - */ - -public class Pat extends Token { - - public Pat() { - } - - public Pat(String token, String refreshToken, int expiresIn) { - super(token, refreshToken, expiresIn); - } -} diff --git a/jans-client-api/server/src/main/java/io/jans/ca/server/model/Token.java b/jans-client-api/server/src/main/java/io/jans/ca/server/model/Token.java deleted file mode 100644 index 646f3bab5c4..00000000000 --- a/jans-client-api/server/src/main/java/io/jans/ca/server/model/Token.java +++ /dev/null @@ -1,74 +0,0 @@ -package io.jans.ca.server.model; - -/** - * UmaToken used for both AAT and PAT - * - * @author Yuriy Zabrovarnyy - * @version 0.9, 31/05/2016 - */ - -public class Token { - - private String token; - private String refreshToken; - private int expiresIn; - - public Token() { - } - - public Token(String token, String refreshToken, int expiresIn) { - this.token = token; - this.refreshToken = refreshToken; - this.expiresIn = expiresIn; - } - - public String getRefreshToken() { - return refreshToken; - } - - public void setRefreshToken(String refreshToken) { - this.refreshToken = refreshToken; - } - - public String getToken() { - return token; - } - - public void setToken(String token) { - this.token = token; - } - - public int getExpiresIn() { - return expiresIn; - } - - public void setExpiresIn(int expiresIn) { - this.expiresIn = expiresIn; - } - - @Override - public boolean equals(Object o) { - if (this == o) return true; - if (o == null || getClass() != o.getClass()) return false; - - Token umaToken = (Token) o; - - return token != null ? token.equals(umaToken.token) : umaToken.token == null; - } - - @Override - public int hashCode() { - return token != null ? token.hashCode() : 0; - } - - @Override - public String toString() { - final StringBuilder sb = new StringBuilder(); - sb.append("UmaToken"); - sb.append("{token='").append(token).append('\''); - sb.append(", refreshToken='").append(refreshToken).append('\''); - sb.append(", expiresIn=").append(expiresIn); - sb.append('}'); - return sb.toString(); - } -} diff --git a/jans-client-api/server/src/main/java/io/jans/ca/server/model/TokenFactory.java b/jans-client-api/server/src/main/java/io/jans/ca/server/model/TokenFactory.java deleted file mode 100644 index 9c8ba2b0f4b..00000000000 --- a/jans-client-api/server/src/main/java/io/jans/ca/server/model/TokenFactory.java +++ /dev/null @@ -1,20 +0,0 @@ -package io.jans.ca.server.model; - -import io.jans.as.model.uma.UmaScopeType; - -/** - * @author Yuriy Zabrovarnyy - */ - -public class TokenFactory { - - private TokenFactory() { - } - - public static Token newToken(UmaScopeType scopeType) { - if (scopeType == UmaScopeType.PROTECTION) { - return new Pat(); - } - return new Token(); - } -} diff --git a/jans-client-api/server/src/main/java/io/jans/ca/server/op/AuthorizationCodeFlowOperation.java b/jans-client-api/server/src/main/java/io/jans/ca/server/op/AuthorizationCodeFlowOperation.java deleted file mode 100644 index b42f346b017..00000000000 --- a/jans-client-api/server/src/main/java/io/jans/ca/server/op/AuthorizationCodeFlowOperation.java +++ /dev/null @@ -1,129 +0,0 @@ -/* - * All rights reserved -- Copyright 2015 Gluu Inc. - */ -package io.jans.ca.server.op; - -import com.google.common.collect.Lists; -import io.jans.as.client.*; -import io.jans.as.model.common.AuthenticationMethod; -import io.jans.as.model.common.GrantType; -import io.jans.as.model.common.Prompt; -import io.jans.as.model.common.ResponseType; -import io.jans.as.model.util.Util; -import io.jans.ca.common.params.AuthorizationCodeFlowParams; -import io.jans.ca.common.response.AuthorizationCodeFlowResponse; -import io.jans.ca.common.response.IOpResponse; -import io.jans.ca.server.service.DiscoveryService; -import jakarta.inject.Inject; -import jakarta.servlet.http.HttpServletRequest; -import jakarta.ws.rs.core.MediaType; -import org.apache.commons.lang.StringUtils; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; -import java.util.UUID; - -/** - * @author Yuriy Zabrovarnyy - * @version 0.9, 19/06/2015 - */ - -public class AuthorizationCodeFlowOperation extends BaseOperation { - - private static final Logger LOG = LoggerFactory.getLogger(AuthorizationCodeFlowOperation.class); - @Inject - DiscoveryService discoveryService; - - @Override - public IOpResponse execute(AuthorizationCodeFlowParams params, HttpServletRequest httpServletRequest) { - final OpenIdConfigurationResponse discovery = discoveryService.getConnectDiscoveryResponseByRpId(params.getRpId()); - if (discovery != null) { - return requestToken(discovery, params); - } - - return null; - } - - @Override - public Class getParameterClass() { - return AuthorizationCodeFlowParams.class; - } - - @Override - public String getReturnType() { - return MediaType.APPLICATION_JSON; - } - - private AuthorizationCodeFlowResponse requestToken(OpenIdConfigurationResponse discovery, AuthorizationCodeFlowParams params) { - // 1. Request authorization and receive the authorization code. - final List responseTypes = new ArrayList(); - responseTypes.add(ResponseType.CODE); - responseTypes.add(ResponseType.ID_TOKEN); - final List scopes = new ArrayList(); - scopes.add(params.getScope()); - - String nonce = params.getNonce(); - final AuthorizationRequest request = new AuthorizationRequest(responseTypes, params.getClientId(), scopes, params.getRedirectUrl(), nonce); - request.setState("af0ifjsldkj"); - request.setAuthUsername(params.getUserId()); - request.setAuthPassword(params.getUserSecret()); - request.getPrompts().add(Prompt.NONE); - request.setNonce(UUID.randomUUID().toString()); - request.setAcrValues(acrValues(params.getAcr())); - - final AuthorizeClient authorizeClient = new AuthorizeClient(discovery.getAuthorizationEndpoint()); - authorizeClient.setRequest(request); - authorizeClient.setExecutor(httpService.getClientEngine()); - final AuthorizationResponse response1 = authorizeClient.exec(); - - final String scope = response1.getScope(); - final String authorizationCode = response1.getCode(); - - if (Util.allNotBlank(authorizationCode)) { - - // 2. Request access token using the authorization code. - final TokenRequest tokenRequest = new TokenRequest(GrantType.AUTHORIZATION_CODE); - tokenRequest.setCode(authorizationCode); - tokenRequest.setRedirectUri(params.getRedirectUrl()); - tokenRequest.setAuthUsername(params.getClientId()); - tokenRequest.setAuthPassword(params.getClientSecret()); - tokenRequest.setAuthenticationMethod(AuthenticationMethod.CLIENT_SECRET_BASIC); - tokenRequest.setScope(scope); - - final TokenClient tokenClient1 = new TokenClient(discovery.getTokenEndpoint()); - tokenClient1.setExecutor(httpService.getClientEngine()); - tokenClient1.setRequest(tokenRequest); - final TokenResponse response2 = tokenClient1.exec(); - - if (response2.getStatus() == 200 || response2.getStatus() == 302) { // success or redirect - if (Util.allNotBlank(response2.getAccessToken(), response2.getRefreshToken())) { - final AuthorizationCodeFlowResponse opResponse = new AuthorizationCodeFlowResponse(); - opResponse.setAccessToken(response2.getAccessToken()); - opResponse.setIdToken(response2.getIdToken()); - opResponse.setRefreshToken(response2.getRefreshToken()); - opResponse.setAuthorizationCode(authorizationCode); - opResponse.setScope(scope); - opResponse.setExpiresIn(response2.getExpiresIn()); - return opResponse; - } - } - } else { - LOG.debug("Authorization code is blank."); - } - return null; - } - - private static List acrValues(String acr) { - List acrValues = Lists.newArrayList(); - if (StringUtils.isNotBlank(acr)) { - final String[] split = StringUtils.split(acr, " "); - if (split != null) { - acrValues.addAll(Arrays.asList(split)); - } - } - return acrValues; - } -} \ No newline at end of file diff --git a/jans-client-api/server/src/main/java/io/jans/ca/server/op/BaseOperation.java b/jans-client-api/server/src/main/java/io/jans/ca/server/op/BaseOperation.java deleted file mode 100644 index ed5ea923759..00000000000 --- a/jans-client-api/server/src/main/java/io/jans/ca/server/op/BaseOperation.java +++ /dev/null @@ -1,177 +0,0 @@ -/* - All rights reserved -- Copyright 2015 Gluu Inc. - */ -package io.jans.ca.server.op; - -import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.node.JsonNodeFactory; -import io.jans.as.model.crypto.AuthCryptoProvider; -import io.jans.as.model.util.Util; -import io.jans.ca.common.ErrorResponseCode; -import io.jans.ca.common.Jackson2; -import io.jans.ca.common.params.HasRpIdParams; -import io.jans.ca.common.params.IParams; -import io.jans.ca.common.response.IOpResponse; -import io.jans.ca.common.response.POJOResponse; -import io.jans.ca.server.HttpException; -import io.jans.ca.server.configuration.ApiAppConfiguration; -import io.jans.ca.server.configuration.model.Rp; -import io.jans.ca.server.persistence.service.MainPersistenceService; -import io.jans.ca.server.service.HttpService; -import io.jans.ca.server.service.RpSyncService; -import io.jans.ca.server.service.ValidationService; -import io.jans.ca.server.utils.Convertor; -import jakarta.enterprise.context.RequestScoped; -import jakarta.inject.Inject; -import jakarta.inject.Named; -import jakarta.servlet.http.HttpServletRequest; -import jakarta.ws.rs.ClientErrorException; -import jakarta.ws.rs.WebApplicationException; -import jakarta.ws.rs.core.MediaType; -import jakarta.ws.rs.core.Response; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import java.io.IOException; -import java.util.List; - -@RequestScoped -@Named -public abstract class BaseOperation implements IOperation { - - private static final Logger LOG = LoggerFactory.getLogger(BaseOperation.class); - - private static final String LOCALHOST_IP_ADDRESS = "127.0.0.1"; - - @Inject - ValidationService validationService; - @Inject - RpSyncService rpSyncService; - @Inject - HttpService httpService; - @Inject - MainPersistenceService jansConfigurationService; - - public Response process(String paramsAsString, HttpServletRequest httpRequest) { - String endPointUrl = httpRequest.getRequestURL().toString(); - LOG.info("Endpoint: {}", endPointUrl); - LOG.info("Request parameters: {}", paramsAsString); - - validateIpAddressAllowed(httpRequest.getRemoteAddr()); - - Object forJsonConversion = getObjectForJsonConversion(paramsAsString, getParameterClass(), httpRequest); - String response = null; - - if (getReturnType().equalsIgnoreCase(MediaType.APPLICATION_JSON)) { - response = Jackson2.asJsonSilently(forJsonConversion); - } else if (getReturnType().equalsIgnoreCase(MediaType.TEXT_PLAIN)) { - response = forJsonConversion.toString(); - } - - LOG.trace("Send back response: {}", response); - return Response.ok(response).build(); - } - - private Object getObjectForJsonConversion(String paramsAsString, Class paramsClass, HttpServletRequest httpRequest) { - LOG.trace("Command: {}", paramsAsString); - T params = read(safeToJson(paramsAsString), paramsClass); - JsonNode jsonNodeParams = JsonNodeFactory.instance.pojoNode(params); - - final IOpResponse response = internProcess(jsonNodeParams, httpRequest); - Object forJsonConversion = response; - if (response instanceof POJOResponse) { - forJsonConversion = ((POJOResponse) response).getNode(); - } - return forJsonConversion; - } - - private IOpResponse internProcess(JsonNode jsonNodeParams, HttpServletRequest httpRequest) { - try { - IParams iParams = Convertor.asParams(getParameterClass(), jsonNodeParams); - validationService.validate(iParams); - - IOpResponse operationResponse = execute((T) iParams, httpRequest); - if (operationResponse != null) { - return operationResponse; - } else { - LOG.error("No response from operation. Endpoint: {}", httpRequest.getRequestURL().toString()); - } - } catch (ClientErrorException e) { - throw new WebApplicationException(e.getResponse().readEntity(String.class), e.getResponse().getStatus()); - } catch (WebApplicationException e) { - LOG.error(e.getLocalizedMessage(), e); - throw e; - } catch (Throwable e) { - LOG.error(e.getMessage(), e); - } - throw HttpException.internalError(); - } - - public T read(String params, Class clazz) { - try { - return Jackson2.createJsonMapper().readValue(params, clazz); - } catch (IOException e) { - throw new WebApplicationException(Response.status(Response.Status.BAD_REQUEST).entity("Invalid parameters. Message: " + e.getMessage()).build()); - } - } - - private String safeToJson(String jsonString) { - return Util.isNullOrEmpty(jsonString) ? "{}" : jsonString; - } - - public Rp getRp(T params) { - if (params instanceof HasRpIdParams) { - validationService.validate((HasRpIdParams) params); - HasRpIdParams hasRpId = (HasRpIdParams) params; - return rpSyncService.getRp(hasRpId.getRpId()); - } - throw new HttpException(ErrorResponseCode.BAD_REQUEST_NO_RP_ID); - } - - private void validateIpAddressAllowed(String callerIpAddress) { - LOG.trace("Checking if caller ipAddress : {} is allowed to make request to jans_client_api.", callerIpAddress); - final ApiAppConfiguration conf = jansConfigurationService.find(); - List bindIpAddresses = conf.getBindIpAddresses(); - - //localhost as default bindAddress - if ((bindIpAddresses == null || bindIpAddresses.isEmpty()) && LOCALHOST_IP_ADDRESS.equalsIgnoreCase(callerIpAddress)) { - return; - } - //show error if ip_address of a remote caller is not set in `bind_ip_addresses` - if (bindIpAddresses == null || bindIpAddresses.isEmpty()) { - LOG.error("The caller is not allowed to make request to jans_client_api. To allow add ip_address of caller in `bind_ip_addresses` array of configuration."); - throw new HttpException(ErrorResponseCode.RP_ACCESS_DENIED); - } - //allow all ip_address - if (bindIpAddresses.contains("*")) { - return; - } - - if (bindIpAddresses.contains(callerIpAddress)) { - return; - } - LOG.error("The caller is not allowed to make request to jans_client_api. To allow add ip_address of caller in `bind_ip_addresses` array of configuration."); - throw new HttpException(ErrorResponseCode.RP_ACCESS_DENIED); - } - - public AuthCryptoProvider getCryptoProvider() throws Exception { - ApiAppConfiguration conf = getJansConfigurationService().find(); - return new AuthCryptoProvider(conf.getCryptProviderKeyStorePath(), conf.getCryptProviderKeyStorePassword(), conf.getCryptProviderDnName()); - } - - public HttpService getHttpService() { - return httpService; - } - - public MainPersistenceService getJansConfigurationService() { - return jansConfigurationService; - } - - public ValidationService getValidationService() { - return validationService; - } - - public RpSyncService getRpSyncService() { - return rpSyncService; - } -} diff --git a/jans-client-api/server/src/main/java/io/jans/ca/server/op/CheckAccessTokenOperation.java b/jans-client-api/server/src/main/java/io/jans/ca/server/op/CheckAccessTokenOperation.java deleted file mode 100644 index 9af4119a59d..00000000000 --- a/jans-client-api/server/src/main/java/io/jans/ca/server/op/CheckAccessTokenOperation.java +++ /dev/null @@ -1,82 +0,0 @@ -/* - * All rights reserved -- Copyright 2015 Gluu Inc. - */ -package io.jans.ca.server.op; - -import io.jans.as.client.JwkClient; -import io.jans.as.client.OpenIdConfigurationResponse; -import io.jans.as.model.crypto.signature.RSAPublicKey; -import io.jans.as.model.crypto.signature.SignatureAlgorithm; -import io.jans.as.model.jws.RSASigner; -import io.jans.as.model.jwt.Jwt; -import io.jans.as.model.jwt.JwtClaimName; -import io.jans.as.model.jwt.JwtHeaderName; -import io.jans.ca.common.params.CheckAccessTokenParams; -import io.jans.ca.common.response.CheckAccessTokenResponse; -import io.jans.ca.common.response.IOpResponse; -import io.jans.ca.server.service.DiscoveryService; -import jakarta.inject.Inject; -import jakarta.servlet.http.HttpServletRequest; -import jakarta.ws.rs.core.MediaType; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import java.util.Date; - -/** - * @author Yuriy Zabrovarnyy - * @version 0.9, 23/10/2013 - */ - -public class CheckAccessTokenOperation extends BaseOperation { - - private static final Logger LOG = LoggerFactory.getLogger(CheckAccessTokenOperation.class); - - @Inject - DiscoveryService discoveryService; - - @Override - public IOpResponse execute(CheckAccessTokenParams params, HttpServletRequest httpServletRequest) throws Exception { - final OpenIdConfigurationResponse discoveryResponse = discoveryService.getConnectDiscoveryResponseByRpId(params.getRpId()); - final String idToken = params.getIdToken(); - final String accessToken = params.getAccessToken(); - - final Jwt jwt = Jwt.parse(idToken); - - final Date issuedAt = jwt.getClaims().getClaimAsDate(JwtClaimName.ISSUED_AT); - final Date expiresAt = jwt.getClaims().getClaimAsDate(JwtClaimName.EXPIRATION_TIME); - - final CheckAccessTokenResponse opResponse = new CheckAccessTokenResponse(); - opResponse.setActive(isAccessTokenValid(accessToken, jwt, discoveryResponse)); - opResponse.setIssuedAt(issuedAt); - opResponse.setExpiresAt(expiresAt); - return opResponse; - } - - @Override - public Class getParameterClass() { - return CheckAccessTokenParams.class; - } - - @Override - public String getReturnType() { - return MediaType.APPLICATION_JSON; - } - - private boolean isAccessTokenValid(String p_accessToken, Jwt jwt, OpenIdConfigurationResponse discoveryResponse) { - try { - final String algorithm = jwt.getHeader().getClaimAsString(JwtHeaderName.ALGORITHM); - final String jwkUrl = discoveryResponse.getJwksUri(); - final String kid = jwt.getHeader().getClaimAsString(JwtHeaderName.KEY_ID); - - final SignatureAlgorithm signatureAlgorithm = SignatureAlgorithm.fromString(algorithm); - - final RSAPublicKey publicKey = JwkClient.getRSAPublicKey(jwkUrl, kid); - final RSASigner rsaSigner = new RSASigner(signatureAlgorithm, publicKey); - return rsaSigner.validateAccessToken(p_accessToken, jwt); - } catch (Exception e) { - LOG.error(e.getMessage(), e); - return false; - } - } -} diff --git a/jans-client-api/server/src/main/java/io/jans/ca/server/op/CheckIdTokenOperation.java b/jans-client-api/server/src/main/java/io/jans/ca/server/op/CheckIdTokenOperation.java deleted file mode 100644 index e52a454d645..00000000000 --- a/jans-client-api/server/src/main/java/io/jans/ca/server/op/CheckIdTokenOperation.java +++ /dev/null @@ -1,91 +0,0 @@ -package io.jans.ca.server.op; - -import io.jans.as.client.OpenIdConfigurationResponse; -import io.jans.as.model.common.ResponseType; -import io.jans.as.model.jwt.Jwt; -import io.jans.as.model.jwt.JwtClaimName; -import io.jans.ca.common.params.CheckIdTokenParams; -import io.jans.ca.common.response.CheckIdTokenResponse; -import io.jans.ca.common.response.IOpResponse; -import io.jans.ca.server.HttpException; -import io.jans.ca.server.Utils; -import io.jans.ca.server.configuration.model.Rp; -import io.jans.ca.server.service.DiscoveryService; -import io.jans.ca.server.service.PublicOpKeyService; -import jakarta.inject.Inject; -import jakarta.servlet.http.HttpServletRequest; -import jakarta.ws.rs.core.MediaType; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import java.util.List; - -/** - * @author Yuriy Zabrovarnyy - * @version 0.9, 18/10/2013 - */ - -public class CheckIdTokenOperation extends BaseOperation { - - private static final Logger LOG = LoggerFactory.getLogger(CheckIdTokenOperation.class); - - @Inject - DiscoveryService discoveryService; - @Inject - OpClientFactoryImpl opClientFactory; - @Inject - PublicOpKeyService publicOpKeyService; - - @Override - public IOpResponse execute(CheckIdTokenParams params, HttpServletRequest httpServletRequest) { - try { - OpenIdConfigurationResponse discoveryResponse = discoveryService.getConnectDiscoveryResponseByRpId(params.getRpId()); - - final Rp rp = getRp(params); - final String idToken = params.getIdToken(); - final Jwt jwt = Jwt.parse(idToken); - final Validator validator = new Validator.Builder() - .discoveryResponse(discoveryResponse) - .idToken(jwt) - .keyService(publicOpKeyService) - .opClientFactory(opClientFactory) - .rpServerConfiguration(getJansConfigurationService().find()) - .rp(rp) - .build(); - - //validate at_hash in id_token - validator.validateAccessToken(params.getAccessToken(), atHashCheckRequired(rp.getResponseTypes())); - //validate c_hash in id_token - validator.validateAuthorizationCode(params.getCode()); - //validate s_hash in id_token - validator.validateState(params.getState()); - - final CheckIdTokenResponse opResponse = new CheckIdTokenResponse(); - opResponse.setActive(validator.isIdTokenValid(params.getNonce())); - opResponse.setIssuedAt(Utils.date(jwt.getClaims().getClaimAsDate(JwtClaimName.ISSUED_AT))); - opResponse.setExpiresAt(Utils.date(jwt.getClaims().getClaimAsDate(JwtClaimName.EXPIRATION_TIME))); - opResponse.setClaims(jwt.getClaims().toMap()); - return opResponse; - } catch (HttpException e) { - throw e; - } catch (Exception e) { - LOG.error(e.getMessage(), e); - } - throw HttpException.internalError(); - } - - public static boolean atHashCheckRequired(List responseTypes) { - return responseTypes.stream().anyMatch(s -> ResponseType.fromString(s, " ").contains(ResponseType.TOKEN)); - } - - @Override - public Class getParameterClass() { - return CheckIdTokenParams.class; - } - - @Override - public String getReturnType() { - return MediaType.APPLICATION_JSON; - } - -} diff --git a/jans-client-api/server/src/main/java/io/jans/ca/server/op/GetAccessTokenByRefreshTokenOperation.java b/jans-client-api/server/src/main/java/io/jans/ca/server/op/GetAccessTokenByRefreshTokenOperation.java deleted file mode 100644 index b5f56b907eb..00000000000 --- a/jans-client-api/server/src/main/java/io/jans/ca/server/op/GetAccessTokenByRefreshTokenOperation.java +++ /dev/null @@ -1,93 +0,0 @@ -package io.jans.ca.server.op; - -import com.google.common.base.Strings; -import com.google.common.collect.Sets; -import io.jans.as.client.TokenClient; -import io.jans.as.client.TokenResponse; -import io.jans.as.model.util.Util; -import io.jans.ca.common.ErrorResponseCode; -import io.jans.ca.common.params.GetAccessTokenByRefreshTokenParams; -import io.jans.ca.common.response.GetClientTokenResponse; -import io.jans.ca.common.response.IOpResponse; -import io.jans.ca.server.HttpException; -import io.jans.ca.server.Utils; -import io.jans.ca.server.configuration.model.Rp; -import io.jans.ca.server.service.DiscoveryService; -import jakarta.enterprise.context.RequestScoped; -import jakarta.inject.Inject; -import jakarta.inject.Named; -import jakarta.servlet.http.HttpServletRequest; -import jakarta.ws.rs.core.MediaType; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import java.io.UnsupportedEncodingException; -import java.util.Set; - -@RequestScoped -@Named -public class GetAccessTokenByRefreshTokenOperation extends BaseOperation { - - private static final Logger LOG = LoggerFactory.getLogger(GetAccessTokenByRefreshTokenOperation.class); - - @Inject - DiscoveryService discoveryService; - - @Override - public IOpResponse execute(GetAccessTokenByRefreshTokenParams params, HttpServletRequest httpServletRequest) { - try { - validate(params); - final Rp rp = getRp(params); - final TokenClient tokenClient = new TokenClient(discoveryService.getConnectDiscoveryResponse(rp).getTokenEndpoint()); - tokenClient.setExecutor(discoveryService.getHttpService().getClientEngine()); - final TokenResponse tokenResponse = tokenClient.execRefreshToken(scopeAsString(params), params.getRefreshToken(), rp.getClientId(), rp.getClientSecret()); - if (tokenResponse != null) { - if (Util.allNotBlank(tokenResponse.getAccessToken())) { - GetClientTokenResponse response = new GetClientTokenResponse(); - response.setAccessToken(tokenResponse.getAccessToken()); - response.setExpiresIn(tokenResponse.getExpiresIn()); - response.setRefreshToken(tokenResponse.getRefreshToken()); - response.setScope(Utils.stringToList(tokenResponse.getScope())); - - return response; - } else { - LOG.error("access_token is blank in response, params: " + params + ", response: " + tokenResponse); - LOG.error("Please check AS logs for more details (oxauth.log for CE)."); - } - } else { - LOG.error("No response from TokenClient"); - } - } catch (HttpException e) { - throw e; - } catch (Exception e) { - LOG.error(e.getMessage(), e); - } - throw HttpException.internalError(); - } - - @Override - public Class getParameterClass() { - return GetAccessTokenByRefreshTokenParams.class; - } - - @Override - public String getReturnType() { - return MediaType.APPLICATION_JSON; - } - - private String scopeAsString(GetAccessTokenByRefreshTokenParams params) throws UnsupportedEncodingException { - Set scope = Sets.newHashSet(); - - scope.add("openid"); - if (params.getScope() != null) { - scope.addAll(params.getScope()); - } - return Utils.joinAndUrlEncode(scope); - } - - private void validate(GetAccessTokenByRefreshTokenParams params) { - if (Strings.isNullOrEmpty(params.getRefreshToken())) { - throw new HttpException(ErrorResponseCode.BAD_REQUEST_NO_REFRESH_TOKEN); - } - } -} diff --git a/jans-client-api/server/src/main/java/io/jans/ca/server/op/GetAuthorizationCodeOperation.java b/jans-client-api/server/src/main/java/io/jans/ca/server/op/GetAuthorizationCodeOperation.java deleted file mode 100644 index d7ded10894f..00000000000 --- a/jans-client-api/server/src/main/java/io/jans/ca/server/op/GetAuthorizationCodeOperation.java +++ /dev/null @@ -1,103 +0,0 @@ -package io.jans.ca.server.op; - -import com.google.common.base.Strings; -import com.google.common.collect.Lists; -import io.jans.as.client.AuthorizationRequest; -import io.jans.as.client.AuthorizationResponse; -import io.jans.as.client.AuthorizeClient; -import io.jans.as.model.common.Prompt; -import io.jans.as.model.common.ResponseType; -import io.jans.ca.common.ErrorResponseCode; -import io.jans.ca.common.params.GetAuthorizationCodeParams; -import io.jans.ca.common.response.GetAuthorizationCodeResponse; -import io.jans.ca.common.response.IOpResponse; -import io.jans.ca.server.HttpException; -import io.jans.ca.server.configuration.model.Rp; -import io.jans.ca.server.service.DiscoveryService; -import io.jans.ca.server.service.StateService; -import jakarta.enterprise.context.RequestScoped; -import jakarta.inject.Inject; -import jakarta.inject.Named; -import jakarta.servlet.http.HttpServletRequest; -import jakarta.ws.rs.core.MediaType; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import java.util.List; -import java.util.UUID; - -@RequestScoped -@Named -public class GetAuthorizationCodeOperation extends BaseOperation { - - private static final Logger LOG = LoggerFactory.getLogger(GetAuthorizationCodeOperation.class); - @Inject - DiscoveryService discoveryService; - @Inject - OpClientFactoryImpl opClientFactory; - @Inject - StateService stateService; - - @Override - public IOpResponse execute(GetAuthorizationCodeParams params, HttpServletRequest httpServletRequest) { - final Rp rp = getRp(params); - - String nonce = Strings.isNullOrEmpty(params.getNonce()) ? UUID.randomUUID().toString() : params.getNonce(); - String state = Strings.isNullOrEmpty(params.getState()) ? UUID.randomUUID().toString() : params.getState(); - - final AuthorizationRequest request = new AuthorizationRequest(responseTypes(rp.getResponseTypes()), - rp.getClientId(), rp.getScope(), rp.getRedirectUri(), nonce); - request.setState(state); - request.setAuthUsername(params.getUsername()); - request.setAuthPassword(params.getPassword()); - request.getPrompts().add(Prompt.NONE); - request.setAcrValues(acrValues(params, rp)); - - stateService.putNonce(nonce); - stateService.putState(state); - String authorizationEndPoint = discoveryService.getConnectDiscoveryResponse(rp).getAuthorizationEndpoint(); - LOG.info("Authorization Code Operation - rpId:{} authorizationEndPoint: {}", rp.getRpId(), authorizationEndPoint); - final AuthorizeClient authorizeClient = opClientFactory.createAuthorizeClient(authorizationEndPoint); - authorizeClient.setRequest(request); - final AuthorizationResponse response = authorizeClient.exec(); - - if (response != null && response.getCode() != null) { - if (!stateService.isExpiredObjectPresent(params.getState())) { - stateService.putState(params.getState()); - } - return new GetAuthorizationCodeResponse(response.getCode()); - } else { - LOG.error("Failed to get Authorization Code - rpId:{} authorizationEndPoint: {} - Check keystorePath, keystorePassword, signatureAlgorithms, jansConfWebKeys, and credentials", rp.getRpId(), authorizationEndPoint); - throw new HttpException(ErrorResponseCode.ERROR_AUTHORIZATION_CODE); - } - } - - @Override - public Class getParameterClass() { - return GetAuthorizationCodeParams.class; - } - - @Override - public String getReturnType() { - return MediaType.APPLICATION_JSON; - } - - private List acrValues(GetAuthorizationCodeParams params, Rp rp) { - List acrs = Lists.newArrayList(); - if (params.getAcrValues() != null && !params.getAcrValues().isEmpty()) { - acrs.addAll(params.getAcrValues()); - } - if (acrs.isEmpty() && rp.getAcrValues() != null && !rp.getAcrValues().isEmpty()) { - acrs.addAll(rp.getAcrValues()); - } - return acrs; - } - - private List responseTypes(List responseTypes) { - List result = Lists.newArrayList(); - for (String type : responseTypes) { - result.add(ResponseType.fromString(type)); - } - return result; - } -} diff --git a/jans-client-api/server/src/main/java/io/jans/ca/server/op/GetAuthorizationUrlOperation.java b/jans-client-api/server/src/main/java/io/jans/ca/server/op/GetAuthorizationUrlOperation.java deleted file mode 100644 index 8b74cac0d62..00000000000 --- a/jans-client-api/server/src/main/java/io/jans/ca/server/op/GetAuthorizationUrlOperation.java +++ /dev/null @@ -1,124 +0,0 @@ -package io.jans.ca.server.op; - -import com.google.common.base.Strings; -import com.google.common.collect.Lists; -import io.jans.as.model.authorize.AuthorizeRequestParam; -import io.jans.as.model.util.Util; -import io.jans.ca.common.ErrorResponseCode; -import io.jans.ca.common.ExpiredObjectType; -import io.jans.ca.common.params.GetAuthorizationUrlParams; -import io.jans.ca.common.response.GetAuthorizationUrlResponse; -import io.jans.ca.common.response.IOpResponse; -import io.jans.ca.server.HttpException; -import io.jans.ca.server.Utils; -import io.jans.ca.server.configuration.model.Rp; -import io.jans.ca.server.service.DiscoveryService; -import io.jans.ca.server.service.StateService; -import jakarta.enterprise.context.RequestScoped; -import jakarta.inject.Inject; -import jakarta.inject.Named; -import jakarta.servlet.http.HttpServletRequest; -import jakarta.ws.rs.core.MediaType; -import org.apache.commons.lang.StringUtils; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import java.util.ArrayList; -import java.util.List; - -@RequestScoped -@Named -public class GetAuthorizationUrlOperation extends BaseOperation { - - private static final Logger LOG = LoggerFactory.getLogger(GetAuthorizationUrlOperation.class); - @Inject - DiscoveryService discoveryService; - @Inject - StateService stateService; - - @Override - public IOpResponse execute(GetAuthorizationUrlParams params, HttpServletRequest httpServletRequest) throws Exception { - final Rp rp = getRp(params); - - String authorizationEndpoint = discoveryService.getConnectDiscoveryResponse(rp).getAuthorizationEndpoint(); - - List scope = Lists.newArrayList(); - if (params.getScope() != null && !params.getScope().isEmpty()) { - scope.addAll(params.getScope()); - } else if (rp.getScope() != null) { - scope.addAll(rp.getScope()); - } - - if (StringUtils.isNotBlank(params.getRedirectUri()) && !Utils.isValidUrl(params.getRedirectUri())) { - throw new HttpException(ErrorResponseCode.INVALID_REDIRECT_URI); - } - - if (StringUtils.isNotBlank(params.getRedirectUri()) && !rp.getRedirectUris().contains(params.getRedirectUri())) { - throw new HttpException(ErrorResponseCode.REDIRECT_URI_IS_NOT_REGISTERED); - } - - List responseTypes = Lists.newArrayList(); - if (params.getResponseTypes() != null && !params.getResponseTypes().isEmpty() - && rp.getResponseTypes().containsAll(params.getResponseTypes())) { - responseTypes.addAll(params.getResponseTypes()); - } else { - responseTypes.addAll(rp.getResponseTypes()); - } - - String state = StringUtils.isNotBlank(params.getState()) ? stateService.putState(stateService.encodeExpiredObject(params.getState(), ExpiredObjectType.STATE)) : stateService.generateState(); - String nonce = StringUtils.isNotBlank(params.getNonce()) ? stateService.putNonce(stateService.encodeExpiredObject(params.getNonce(), ExpiredObjectType.NONCE)) : stateService.generateNonce(); - boolean encodeClientIdInAuthorizationUrl = jansConfigurationService.find().getEncodeClientIdInAuthorizationUrl() != null ? jansConfigurationService.find().getEncodeClientIdInAuthorizationUrl().booleanValue() : false; - String clientId = encodeClientIdInAuthorizationUrl ? Utils.encode(rp.getClientId()) : rp.getClientId(); - String redirectUri = StringUtils.isNotBlank(params.getRedirectUri()) ? params.getRedirectUri() : rp.getRedirectUri(); - - authorizationEndpoint += "?response_type=" + Utils.joinAndUrlEncode(responseTypes); - authorizationEndpoint += "&client_id=" + clientId; - authorizationEndpoint += "&redirect_uri=" + redirectUri; - authorizationEndpoint += "&scope=" + Utils.joinAndUrlEncode(scope); - authorizationEndpoint += "&state=" + state; - authorizationEndpoint += "&nonce=" + nonce; - - String acrValues = Utils.joinAndUrlEncode(acrValues(rp, params)).trim(); - if (!Strings.isNullOrEmpty(acrValues)) { - authorizationEndpoint += "&acr_values=" + acrValues; - } - - if (!Strings.isNullOrEmpty(params.getPrompt())) { - authorizationEndpoint += "&prompt=" + params.getPrompt(); - } - if (!Strings.isNullOrEmpty(params.getHostedDomain())) { - authorizationEndpoint += "&hd=" + params.getHostedDomain(); - } - - if (params.getCustomParameters() != null && !params.getCustomParameters().isEmpty()) { - authorizationEndpoint += "&" + AuthorizeRequestParam.CUSTOM_RESPONSE_HEADERS + "=" + Utils.encode(Util.mapAsString(params.getCustomParameters())); - } - - if (params.getParams() != null && !params.getParams().isEmpty()) { - authorizationEndpoint += "&" + Utils.mapAsStringWithEncodedValues(params.getParams()); - } - - return new GetAuthorizationUrlResponse(authorizationEndpoint); - } - - private List acrValues(Rp rp, GetAuthorizationUrlParams params) { - List acrList = params.getAcrValues() != null && !params.getAcrValues().isEmpty() ? params.getAcrValues() : rp.getAcrValues(); - if (acrList != null) { - return acrList; - } else { - LOG.error("acr value is null for site: " + rp); - return new ArrayList<>(); - } - } - - @Override - public Class getParameterClass() { - return GetAuthorizationUrlParams.class; - } - - @Override - public String getReturnType() { - return MediaType.APPLICATION_JSON; - } - -} diff --git a/jans-client-api/server/src/main/java/io/jans/ca/server/op/GetClientTokenOperation.java b/jans-client-api/server/src/main/java/io/jans/ca/server/op/GetClientTokenOperation.java deleted file mode 100644 index cd0bf29716d..00000000000 --- a/jans-client-api/server/src/main/java/io/jans/ca/server/op/GetClientTokenOperation.java +++ /dev/null @@ -1,117 +0,0 @@ -package io.jans.ca.server.op; - -import com.google.common.collect.Sets; -import io.jans.as.client.TokenClient; -import io.jans.as.client.TokenRequest; -import io.jans.as.client.TokenResponse; -import io.jans.as.model.common.AuthenticationMethod; -import io.jans.as.model.common.GrantType; -import io.jans.as.model.crypto.signature.SignatureAlgorithm; -import io.jans.as.model.util.Util; -import io.jans.ca.common.ErrorResponseCode; -import io.jans.ca.common.params.GetClientTokenParams; -import io.jans.ca.common.response.GetClientTokenResponse; -import io.jans.ca.common.response.IOpResponse; -import io.jans.ca.server.HttpException; -import io.jans.ca.server.Utils; -import io.jans.ca.server.service.DiscoveryService; -import io.jans.ca.server.service.HttpService; -import jakarta.enterprise.context.RequestScoped; -import jakarta.inject.Inject; -import jakarta.inject.Named; -import jakarta.servlet.http.HttpServletRequest; -import jakarta.ws.rs.core.MediaType; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import java.io.UnsupportedEncodingException; -import java.util.Set; -@RequestScoped -@Named -public class GetClientTokenOperation extends BaseOperation { - - private static final Logger LOG = LoggerFactory.getLogger(GetClientTokenOperation.class); - - @Inject - DiscoveryService discoveryService; - @Inject - HttpService httpService; - @Inject - OpClientFactoryImpl opClientFactory; - - @Override - public IOpResponse execute(GetClientTokenParams params, HttpServletRequest httpRequest) { - try { - final AuthenticationMethod authenticationMethod = AuthenticationMethod.fromString(params.getAuthenticationMethod()); - final String tokenEndpoint = discoveryService.getConnectDiscoveryResponse(params.getOpConfigurationEndpoint(), params.getOpHost(), params.getOpDiscoveryPath()).getTokenEndpoint(); - final TokenClient tokenClient = opClientFactory.createTokenClient(tokenEndpoint); - tokenClient.setExecutor(httpService.getClientEngine()); - - final TokenResponse tokenResponse; - if (authenticationMethod == AuthenticationMethod.PRIVATE_KEY_JWT) { - LOG.trace("Getting client token with private_key_jwt client authentication ..."); - - SignatureAlgorithm algorithm = SignatureAlgorithm.fromString(params.getAlgorithm()); - if (algorithm == null) { - throw new HttpException(ErrorResponseCode.INVALID_SIGNATURE_ALGORITHM); - } - - TokenRequest tokenRequest = new TokenRequest(GrantType.CLIENT_CREDENTIALS); - tokenRequest.setScope(scopeAsString(params)); - tokenRequest.setAuthUsername(params.getClientId()); - tokenRequest.setAuthenticationMethod(AuthenticationMethod.PRIVATE_KEY_JWT); - tokenRequest.setAlgorithm(algorithm); - tokenRequest.setCryptoProvider(getCryptoProvider()); - tokenRequest.setKeyId(params.getKeyId()); - tokenRequest.setAudience(tokenEndpoint); - - tokenClient.setRequest(tokenRequest); - tokenResponse = tokenClient.exec(); - } else { - tokenResponse = tokenClient.execClientCredentialsGrant(scopeAsString(params), params.getClientId(), params.getClientSecret()); - } - if (tokenResponse != null) { - if (Util.allNotBlank(tokenResponse.getAccessToken())) { - GetClientTokenResponse response = new GetClientTokenResponse(); - response.setAccessToken(tokenResponse.getAccessToken()); - response.setExpiresIn(tokenResponse.getExpiresIn()); - response.setRefreshToken(tokenResponse.getRefreshToken()); - response.setScope(Utils.stringToList(tokenResponse.getScope())); - - return response; - } else { - LOG.error("access_token is blank in response, params: " + params + ", response: " + tokenResponse); - LOG.error("Please check AS logs for more details (oxauth.log for CE)."); - } - } else { - LOG.error("No response from TokenClient"); - LOG.error("Please check AS logs for more details (oxauth.log for CE)."); - } - } catch (HttpException e) { - throw e; - } catch (Exception e) { - LOG.error(e.getMessage(), e); - } - throw HttpException.internalError(); - } - - @Override - public Class getParameterClass() { - return GetClientTokenParams.class; - } - - @Override - public String getReturnType() { - return MediaType.APPLICATION_JSON; - } - - private String scopeAsString(GetClientTokenParams params) throws UnsupportedEncodingException { - Set scope = Sets.newHashSet(); - - scope.add("openid"); - if (params.getScope() != null) { - scope.addAll(params.getScope()); - } - return Utils.joinAndUrlEncode(scope); - } -} diff --git a/jans-client-api/server/src/main/java/io/jans/ca/server/op/GetDiscoveryOperation.java b/jans-client-api/server/src/main/java/io/jans/ca/server/op/GetDiscoveryOperation.java deleted file mode 100644 index 773f0b2e20a..00000000000 --- a/jans-client-api/server/src/main/java/io/jans/ca/server/op/GetDiscoveryOperation.java +++ /dev/null @@ -1,54 +0,0 @@ -package io.jans.ca.server.op; - -import io.jans.as.client.OpenIdConfigurationResponse; -import io.jans.ca.common.ErrorResponseCode; -import io.jans.ca.common.params.GetDiscoveryParams; -import io.jans.ca.common.response.GetDiscoveryResponse; -import io.jans.ca.common.response.IOpResponse; -import io.jans.ca.server.HttpException; -import io.jans.ca.server.service.DiscoveryService; -import jakarta.enterprise.context.RequestScoped; -import jakarta.inject.Inject; -import jakarta.inject.Named; -import jakarta.servlet.http.HttpServletRequest; -import jakarta.ws.rs.core.MediaType; -import org.apache.commons.beanutils.BeanUtils; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import java.lang.reflect.InvocationTargetException; - -@RequestScoped -@Named -public class GetDiscoveryOperation extends BaseOperation { - - private static final Logger LOG = LoggerFactory.getLogger(GetDiscoveryOperation.class); - - @Inject - DiscoveryService discoveryService; - - @Override - public IOpResponse execute(GetDiscoveryParams params, HttpServletRequest httpRequest) { - OpenIdConfigurationResponse discoveryResponse = discoveryService.getConnectDiscoveryResponse(params.getOpConfigurationEndpoint(), params.getOpHost(), params.getOpDiscoveryPath()); - - GetDiscoveryResponse response = new GetDiscoveryResponse(); - try { - BeanUtils.copyProperties(response, discoveryResponse); - return response; - } catch (IllegalAccessException | InvocationTargetException e) { - LOG.error("Error in creating op discovery configuration response ", e); - } - throw new HttpException(ErrorResponseCode.FAILED_TO_GET_DISCOVERY); - } - - @Override - public Class getParameterClass() { - return GetDiscoveryParams.class; - } - - @Override - public String getReturnType() { - return MediaType.APPLICATION_JSON; - } - -} diff --git a/jans-client-api/server/src/main/java/io/jans/ca/server/op/GetIssuerOperation.java b/jans-client-api/server/src/main/java/io/jans/ca/server/op/GetIssuerOperation.java deleted file mode 100644 index 4659ffce01c..00000000000 --- a/jans-client-api/server/src/main/java/io/jans/ca/server/op/GetIssuerOperation.java +++ /dev/null @@ -1,91 +0,0 @@ -package io.jans.ca.server.op; - -import io.jans.as.client.OpenIdConnectDiscoveryClient; -import io.jans.as.client.OpenIdConnectDiscoveryResponse; -import io.jans.as.model.discovery.WebFingerParam; -import io.jans.ca.common.ErrorResponseCode; -import io.jans.ca.common.params.GetIssuerParams; -import io.jans.ca.common.response.GetIssuerResponse; -import io.jans.ca.common.response.IOpResponse; -import io.jans.ca.server.HttpException; -import io.jans.ca.server.service.DiscoveryService; -import jakarta.inject.Inject; -import jakarta.servlet.http.HttpServletRequest; -import jakarta.ws.rs.core.MediaType; -import org.apache.commons.beanutils.BeanUtils; -import org.python.google.common.base.Strings; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import java.util.List; -import java.util.stream.Collectors; - -public class GetIssuerOperation extends BaseOperation { - - private static final Logger LOG = LoggerFactory.getLogger(GetIssuerOperation.class); - - @Inject - DiscoveryService discoveryService; - - public IOpResponse execute(GetIssuerParams params, HttpServletRequest httpServletRequest) { - validateParams(params); - GetIssuerResponse webfingerResponse = getWebfingerResponse(params.getResource()); - - String issuerFromDiscovery = discoveryService.getConnectDiscoveryResponse(params.getOpConfigurationEndpoint(), params.getOpHost(), params.getOpDiscoveryPath()).getIssuer(); - validateIssuer(webfingerResponse, issuerFromDiscovery); - - return webfingerResponse; - } - - private static GetIssuerResponse getWebfingerResponse(String resource) { - try { - OpenIdConnectDiscoveryClient client = new OpenIdConnectDiscoveryClient(resource); - OpenIdConnectDiscoveryResponse response = client.exec(); - if (response == null || Strings.isNullOrEmpty(response.getSubject()) || response.getLinks().isEmpty()) { - LOG.error("Error in fetching op discovery configuration response "); - throw new HttpException(ErrorResponseCode.FAILED_TO_GET_ISSUER); - } - - GetIssuerResponse webfingerResponse = new GetIssuerResponse(); - BeanUtils.copyProperties(webfingerResponse, response); - - return webfingerResponse; - - } catch (Exception e) { - LOG.error("Error in creating op discovery configuration response ", e); - throw new HttpException(ErrorResponseCode.FAILED_TO_GET_ISSUER); - } - } - - private static void validateParams(GetIssuerParams params) { - if (Strings.isNullOrEmpty(params.getOpHost()) && Strings.isNullOrEmpty(params.getOpConfigurationEndpoint())) { - LOG.error("Either 'op_configuration_endpoint' or 'op_host' should be provided."); - throw new HttpException(ErrorResponseCode.INVALID_OP_HOST_AND_CONFIGURATION_ENDPOINT); - } - - if (Strings.isNullOrEmpty(params.getResource())) { - LOG.error("The 'resource' is empty or not specified."); - throw new HttpException(ErrorResponseCode.BAD_REQUEST_NO_RESOURCE); - } - } - - private static void validateIssuer(GetIssuerResponse webfingerResponse, String issuerFromDiscovery) { - - List locations = webfingerResponse.getLinks().stream().filter(webFingerLink -> webFingerLink.getRel().equals(WebFingerParam.REL_VALUE)).map(webFingerLink -> webFingerLink.getHref()).collect(Collectors.toList()); - if (locations.stream().noneMatch(webFingerLink -> webFingerLink.equals(issuerFromDiscovery))) { - LOG.error("Discovered issuer not matched with issuer obtained from Webfinger. Got : {}, Expected : {}", issuerFromDiscovery, String.join(", ", locations)); - throw new HttpException(ErrorResponseCode.INVALID_ISSUER_DISCOVERED); - } - } - - @Override - public Class getParameterClass() { - return GetIssuerParams.class; - } - - @Override - public String getReturnType() { - return MediaType.APPLICATION_JSON; - } - -} diff --git a/jans-client-api/server/src/main/java/io/jans/ca/server/op/GetJwksOperation.java b/jans-client-api/server/src/main/java/io/jans/ca/server/op/GetJwksOperation.java deleted file mode 100644 index f9e6f335158..00000000000 --- a/jans-client-api/server/src/main/java/io/jans/ca/server/op/GetJwksOperation.java +++ /dev/null @@ -1,70 +0,0 @@ -/* - All rights reserved -- Copyright 2015 Gluu Inc. -*/ -package io.jans.ca.server.op; - -import io.jans.as.client.JwkClient; -import io.jans.as.client.JwkResponse; -import io.jans.as.client.OpenIdConfigurationResponse; -import io.jans.ca.common.ErrorResponseCode; -import io.jans.ca.common.params.GetJwksParams; -import io.jans.ca.common.response.GetJwksResponse; -import io.jans.ca.common.response.IOpResponse; -import io.jans.ca.common.response.POJOResponse; -import io.jans.ca.server.HttpException; -import io.jans.ca.server.service.DiscoveryService; -import jakarta.enterprise.context.RequestScoped; -import jakarta.inject.Inject; -import jakarta.inject.Named; -import jakarta.servlet.http.HttpServletRequest; -import jakarta.ws.rs.core.MediaType; -import org.apache.commons.lang.StringUtils; - -@RequestScoped -@Named -public class GetJwksOperation extends BaseOperation { - - @Inject - DiscoveryService discoveryService; - - @Override - public IOpResponse execute(GetJwksParams params, HttpServletRequest httpServletRequest) { - - if (StringUtils.isEmpty(params.getOpHost()) && StringUtils.isEmpty(params.getOpConfigurationEndpoint())) { - throw new HttpException(ErrorResponseCode.INVALID_OP_HOST_AND_CONFIGURATION_ENDPOINT); - } - - try { - - final OpenIdConfigurationResponse openIdConfigurationResponse = discoveryService.getConnectDiscoveryResponse(params.getOpConfigurationEndpoint(), params.getOpHost(), params.getOpDiscoveryPath()); - - final String jwksUri = openIdConfigurationResponse.getJwksUri(); - - final JwkClient jwkClient = new JwkClient(jwksUri); - jwkClient.setExecutor(discoveryService.getHttpService().getClientEngine()); - - final JwkResponse serverResponse = jwkClient.exec(); - - final GetJwksResponse response = new GetJwksResponse(); - - response.setKeys(serverResponse.getJwks().getKeys()); - - return new POJOResponse(response); - - } catch (Exception ex) { - throw new RuntimeException(ex); - } - - } - - @Override - public Class getParameterClass() { - return GetJwksParams.class; - } - - @Override - public String getReturnType() { - return MediaType.APPLICATION_JSON; - } - -} diff --git a/jans-client-api/server/src/main/java/io/jans/ca/server/op/GetLogoutUrlOperation.java b/jans-client-api/server/src/main/java/io/jans/ca/server/op/GetLogoutUrlOperation.java deleted file mode 100644 index adfe581f710..00000000000 --- a/jans-client-api/server/src/main/java/io/jans/ca/server/op/GetLogoutUrlOperation.java +++ /dev/null @@ -1,92 +0,0 @@ -package io.jans.ca.server.op; - -import com.google.common.base.Strings; -import io.jans.as.client.OpenIdConfigurationResponse; -import io.jans.ca.common.ErrorResponseCode; -import io.jans.ca.common.ExpiredObjectType; -import io.jans.ca.common.params.GetLogoutUrlParams; -import io.jans.ca.common.response.GetLogoutUriResponse; -import io.jans.ca.common.response.IOpResponse; -import io.jans.ca.server.HttpException; -import io.jans.ca.server.configuration.model.Rp; -import io.jans.ca.server.service.DiscoveryService; -import io.jans.ca.server.service.StateService; -import jakarta.enterprise.context.RequestScoped; -import jakarta.inject.Inject; -import jakarta.inject.Named; -import jakarta.servlet.http.HttpServletRequest; -import jakarta.ws.rs.core.MediaType; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import java.net.URLEncoder; - -@RequestScoped -@Named -public class GetLogoutUrlOperation extends BaseOperation { - - private static final String GOOGLE_OP_HOST = "https://accounts.google.com"; - - private static final Logger LOG = LoggerFactory.getLogger(GetLogoutUrlOperation.class); - - @Inject - DiscoveryService discoveryService; - @Inject - StateService stateService; - - @Override - public IOpResponse execute(GetLogoutUrlParams params, HttpServletRequest httpServletRequest) throws Exception { - final Rp rp = getRp(params); - - OpenIdConfigurationResponse discoveryResponse = discoveryService.getConnectDiscoveryResponse(rp); - String endSessionEndpoint = discoveryResponse.getEndSessionEndpoint(); - - String postLogoutRedirectUrl = params.getPostLogoutRedirectUri(); - if (Strings.isNullOrEmpty(postLogoutRedirectUrl)) { - postLogoutRedirectUrl = rp.getPostLogoutRedirectUri(); - } - if (Strings.isNullOrEmpty(postLogoutRedirectUrl)) { - postLogoutRedirectUrl = ""; - } - - if (Strings.isNullOrEmpty(endSessionEndpoint)) { - if (rp.getOpHost().startsWith(GOOGLE_OP_HOST) && getJansConfigurationService().find().getSupportGoogleLogout()) { - String logoutUrl = "https://www.google.com/accounts/Logout?continue=https://appengine.google.com/_ah/logout?continue=" + postLogoutRedirectUrl; - return new GetLogoutUriResponse(logoutUrl); - } - - LOG.error("Failed to get end_session_endpoint at: {}", discoveryService.getConnectDiscoveryUrl(rp)); - throw new HttpException(ErrorResponseCode.FAILED_TO_GET_END_SESSION_ENDPOINT); - } - - String uri = endSessionEndpoint; - if (!Strings.isNullOrEmpty(postLogoutRedirectUrl)) { - uri += separator(uri) + "post_logout_redirect_uri=" + URLEncoder.encode(postLogoutRedirectUrl, "UTF-8"); - } - if (!Strings.isNullOrEmpty(params.getState())) { - uri += separator(uri) + "state=" + stateService.encodeExpiredObject(params.getState(), ExpiredObjectType.STATE); - } - if (!Strings.isNullOrEmpty(params.getSessionState())) { - uri += separator(uri) + "session_state=" + params.getSessionState(); - } - if (!Strings.isNullOrEmpty(params.getIdTokenHint())) { - uri += separator(uri) + "id_token_hint=" + params.getIdTokenHint(); - } - - return new GetLogoutUriResponse(uri); - } - - @Override - public Class getParameterClass() { - return GetLogoutUrlParams.class; - } - - @Override - public String getReturnType() { - return MediaType.APPLICATION_JSON; - } - - private static String separator(String uri) { - return uri.contains("?") ? "&" : "?"; - } -} diff --git a/jans-client-api/server/src/main/java/io/jans/ca/server/op/GetRequestObjectOperation.java b/jans-client-api/server/src/main/java/io/jans/ca/server/op/GetRequestObjectOperation.java deleted file mode 100644 index 2cb7eedf712..00000000000 --- a/jans-client-api/server/src/main/java/io/jans/ca/server/op/GetRequestObjectOperation.java +++ /dev/null @@ -1,53 +0,0 @@ -package io.jans.ca.server.op; - -import com.google.common.base.Strings; -import io.jans.ca.common.ErrorResponseCode; -import io.jans.ca.common.ExpiredObject; -import io.jans.ca.common.params.StringParam; -import io.jans.ca.common.response.IOpResponse; -import io.jans.ca.common.response.POJOResponse; -import io.jans.ca.server.HttpException; -import io.jans.ca.server.service.RequestObjectService; -import jakarta.inject.Inject; -import jakarta.servlet.http.HttpServletRequest; -import jakarta.ws.rs.core.MediaType; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -public class GetRequestObjectOperation extends BaseOperation { - private static final Logger LOG = LoggerFactory.getLogger(GetRequestObjectOperation.class); - @Inject - RequestObjectService requestObjectService; - - @Override - public IOpResponse execute(StringParam params, HttpServletRequest httpServletRequest) { - - try { - ExpiredObject expiredObject = requestObjectService.get(params.getValue()); - - if (expiredObject == null || Strings.isNullOrEmpty(expiredObject.getValue())) { - LOG.error("Request Object not found. The `request_uri` has either expired or it does not exist."); - throw new HttpException(ErrorResponseCode.REQUEST_OBJECT_NOT_FOUND); - } - - return new POJOResponse(expiredObject.getValue()); - } catch (HttpException e) { - throw e; - } catch (Exception e) { - LOG.error("Error in fetching request object. The `request_uri` has either expired or it does not exist.", e); - throw new HttpException(ErrorResponseCode.REQUEST_OBJECT_NOT_FOUND); - } - - } - - @Override - public Class getParameterClass() { - return StringParam.class; - } - - @Override - public String getReturnType() { - return MediaType.TEXT_PLAIN; - } - -} diff --git a/jans-client-api/server/src/main/java/io/jans/ca/server/op/GetRequestObjectUriOperation.java b/jans-client-api/server/src/main/java/io/jans/ca/server/op/GetRequestObjectUriOperation.java deleted file mode 100644 index d7822eaebc2..00000000000 --- a/jans-client-api/server/src/main/java/io/jans/ca/server/op/GetRequestObjectUriOperation.java +++ /dev/null @@ -1,143 +0,0 @@ -package io.jans.ca.server.op; - -import com.google.common.base.Strings; -import io.jans.as.model.crypto.signature.SignatureAlgorithm; -import io.jans.as.model.jwk.Algorithm; -import io.jans.as.model.jwk.Use; -import io.jans.as.model.jwt.Jwt; -import io.jans.as.model.jwt.JwtType; -import io.jans.ca.common.ErrorResponseCode; -import io.jans.ca.common.params.GetRequestObjectUriParams; -import io.jans.ca.common.response.GetRequestObjectUriResponse; -import io.jans.ca.common.response.IOpResponse; -import io.jans.ca.server.HttpException; -import io.jans.ca.server.Utils; -import io.jans.ca.server.configuration.model.Rp; -import io.jans.ca.server.service.KeyGeneratorService; -import io.jans.ca.server.service.RequestObjectService; -import jakarta.inject.Inject; -import jakarta.servlet.http.HttpServletRequest; -import jakarta.ws.rs.core.MediaType; -import org.apache.commons.lang.StringUtils; -import org.json.JSONObject; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import java.util.Calendar; -import java.util.Date; -import java.util.Map; -import java.util.UUID; - -public class GetRequestObjectUriOperation extends BaseOperation { - - - private static final Logger LOG = LoggerFactory.getLogger(GetRequestObjectUriOperation.class); - - @Inject - KeyGeneratorService keyGeneratorService; - @Inject - RequestObjectService requestObjectService; - - public IOpResponse execute(GetRequestObjectUriParams params, HttpServletRequest httpServletRequest) { - - try { - validate(params); - final Rp rp = getRp(params); - - SignatureAlgorithm algo = SignatureAlgorithm.fromString(params.getRequestObjectSigningAlg()) != null ? SignatureAlgorithm.fromString(params.getRequestObjectSigningAlg()) : - SignatureAlgorithm.fromString(rp.getRequestObjectSigningAlg()); - - if (algo == null) { - LOG.error("`request_object_signing_alg` is required parameter in request. Please set this parameter if it is not set during client registration."); - throw new HttpException(ErrorResponseCode.INVALID_ALGORITHM); - } - - Jwt unsignedJwt = createRequestObject(algo, rp, params); - - //signing request object - Jwt signedJwt = keyGeneratorService.sign(unsignedJwt, rp.getClientSecret(), algo); - - //setting request object in Expired Object - String requestUriId = UUID.randomUUID().toString(); - requestObjectService.put(requestUriId, signedJwt.toString()); - - String requestUri = baseRequestUri(params.getRpHostUrl()) + requestUriId; - LOG.trace("RequestObject created successfully. request_uri : {} ", requestUri); - - GetRequestObjectUriResponse response = new GetRequestObjectUriResponse(); - response.setRequestUri(requestUri); - return response; - - } catch (HttpException e) { - throw e; - } catch (Exception e) { - LOG.error("Error in creating `request_uri` response ", e); - } - throw new HttpException(ErrorResponseCode.FAILED_TO_GET_REQUEST_URI); - } - - public Jwt createRequestObject(SignatureAlgorithm algo, Rp rp, GetRequestObjectUriParams params) { - Jwt jwt = new Jwt(); - //set header - jwt.getHeader().setType(JwtType.JWT); - try { - jwt.getHeader().setAlgorithm(algo); - String keyId = keyGeneratorService.getKeyId(Algorithm.fromString(algo.getName()), Use.SIGNATURE); - if (keyId != null) { - jwt.getHeader().setKeyId(keyId); - } - } catch (Exception e) { - LOG.error("Error in generating key Id.", e); - } - //set default claims - jwt.getClaims().setIssuer(rp.getClientId()); - jwt.getClaims().setAudience(rp.getOpHost()); - jwt.getClaims().setJwtId(UUID.randomUUID().toString()); - jwt.getClaims().setClaim("client_id", rp.getClientId()); - jwt.getClaims().setIssuedAt(new Date()); - jwt.getClaims().setExpirationTime(Utils.addTimeToDate(new Date(), getJansConfigurationService().find().getRequestObjectExpirationInMinutes(), Calendar.MINUTE)); - jwt.getClaims().setClaim("response_type", rp.getResponseTypes()); - jwt.getClaims().setClaim("rp_id", rp.getRpId()); - //set claims from params - if (params.getParams() != null && !params.getParams().isEmpty()) { - - Map claims = params.getParams(); - claims.forEach((key, value) -> { - if (value instanceof Map) { - jwt.getClaims().setClaim(key, (new JSONObject((Map) value))); - } else { - jwt.getClaims().setClaimObject(key, value, true); - } - }); - } - return jwt; - } - - private void validate(GetRequestObjectUriParams params) { - if (Strings.isNullOrEmpty(params.getRpHostUrl())) { - LOG.error("'rp_host_url' is empty or not specified."); - throw new HttpException(ErrorResponseCode.BAD_REQUEST_NO_RP_HOST); - } - } - - private String baseRequestUri(String rpHost) { - if (!rpHost.startsWith("http")) { - rpHost = "https://" + rpHost; - } - if (rpHost.endsWith("/")) { - rpHost = StringUtils.removeEnd(rpHost, "/"); - } - return rpHost + "/get-request-object/"; - } - - @Override - public Class getParameterClass() { - return GetRequestObjectUriParams.class; - } - - @Override - public String getReturnType() { - return MediaType.APPLICATION_JSON; - } - -} diff --git a/jans-client-api/server/src/main/java/io/jans/ca/server/op/GetRpJwksOperation.java b/jans-client-api/server/src/main/java/io/jans/ca/server/op/GetRpJwksOperation.java deleted file mode 100644 index 0c87d83061d..00000000000 --- a/jans-client-api/server/src/main/java/io/jans/ca/server/op/GetRpJwksOperation.java +++ /dev/null @@ -1,42 +0,0 @@ -package io.jans.ca.server.op; - -import io.jans.ca.common.params.GetJwksParams; -import io.jans.ca.common.response.IOpResponse; -import io.jans.ca.common.response.POJOResponse; -import io.jans.ca.server.HttpException; -import io.jans.ca.server.service.KeyGeneratorService; -import jakarta.enterprise.context.RequestScoped; -import jakarta.inject.Inject; -import jakarta.inject.Named; -import jakarta.servlet.http.HttpServletRequest; -import jakarta.ws.rs.core.MediaType; - -@RequestScoped -@Named -public class GetRpJwksOperation extends BaseOperation { - @Inject - KeyGeneratorService keyGeneratorService; - - @Override - public IOpResponse execute(GetJwksParams params, HttpServletRequest httpServletRequest) { - - try { - return new POJOResponse(keyGeneratorService.getKeys()); - } catch (HttpException e) { - throw e; - } catch (Exception e) { - throw new RuntimeException(e); - } - } - - @Override - public Class getParameterClass() { - return GetJwksParams.class; - } - - @Override - public String getReturnType() { - return MediaType.APPLICATION_JSON; - } - -} diff --git a/jans-client-api/server/src/main/java/io/jans/ca/server/op/GetRpOperation.java b/jans-client-api/server/src/main/java/io/jans/ca/server/op/GetRpOperation.java deleted file mode 100644 index 9b7ce5135ae..00000000000 --- a/jans-client-api/server/src/main/java/io/jans/ca/server/op/GetRpOperation.java +++ /dev/null @@ -1,58 +0,0 @@ -package io.jans.ca.server.op; - -import io.jans.ca.common.Jackson2; -import io.jans.ca.common.params.GetRpParams; -import io.jans.ca.common.response.GetRpResponse; -import io.jans.ca.common.response.IOpResponse; -import io.jans.ca.server.configuration.model.MinimumRp; -import io.jans.ca.server.configuration.model.Rp; -import io.jans.ca.server.service.RpService; -import jakarta.enterprise.context.RequestScoped; -import jakarta.inject.Inject; -import jakarta.inject.Named; -import jakarta.servlet.http.HttpServletRequest; -import jakarta.ws.rs.core.MediaType; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import java.util.ArrayList; -import java.util.List; - -@RequestScoped -@Named -public class GetRpOperation extends BaseOperation { - - private static final Logger LOG = LoggerFactory.getLogger(GetRpOperation.class); - @Inject - RpService rpService; - - @Override - public IOpResponse execute(GetRpParams params, HttpServletRequest httpServletRequest) { - if (params.getList() != null && params.getList()) { - List rps = new ArrayList<>(); - for (Rp rp : rpService.getRps().values()) { - rps.add(rp.asMinimumRp()); - } - return new GetRpResponse(Jackson2.createJsonMapper().valueToTree(rps)); - } - - Rp rp = getRpSyncService().getRp(params.getRpId()); - if (rp != null) { - return new GetRpResponse(Jackson2.createJsonMapper().valueToTree(rp)); - } else { - LOG.trace("Failed to find RP by rp_id: " + params.getRpId()); - } - return new GetRpResponse(); - } - - @Override - public Class getParameterClass() { - return GetRpParams.class; - } - - @Override - public String getReturnType() { - return MediaType.APPLICATION_JSON; - } - -} diff --git a/jans-client-api/server/src/main/java/io/jans/ca/server/op/GetTokensByCodeOperation.java b/jans-client-api/server/src/main/java/io/jans/ca/server/op/GetTokensByCodeOperation.java deleted file mode 100644 index 8348a9ffd79..00000000000 --- a/jans-client-api/server/src/main/java/io/jans/ca/server/op/GetTokensByCodeOperation.java +++ /dev/null @@ -1,180 +0,0 @@ -package io.jans.ca.server.op; - -import com.google.common.base.Strings; -import com.google.common.collect.Lists; -import io.jans.as.client.OpenIdConfigurationResponse; -import io.jans.as.client.TokenClient; -import io.jans.as.client.TokenRequest; -import io.jans.as.client.TokenResponse; -import io.jans.as.model.common.AuthenticationMethod; -import io.jans.as.model.common.GrantType; -import io.jans.as.model.crypto.signature.SignatureAlgorithm; -import io.jans.as.model.jwk.Algorithm; -import io.jans.as.model.jwk.Use; -import io.jans.as.model.jwt.Jwt; -import io.jans.ca.common.ErrorResponseCode; -import io.jans.ca.common.ExpiredObjectType; -import io.jans.ca.common.Jackson2; -import io.jans.ca.common.params.GetTokensByCodeParams; -import io.jans.ca.common.response.GetTokensByCodeResponse; -import io.jans.ca.common.response.IOpResponse; -import io.jans.ca.server.HttpException; -import io.jans.ca.server.configuration.model.Rp; -import io.jans.ca.server.service.*; -import jakarta.enterprise.context.RequestScoped; -import jakarta.inject.Inject; -import jakarta.inject.Named; -import jakarta.servlet.http.HttpServletRequest; -import jakarta.ws.rs.core.MediaType; -import org.python.jline.internal.Log; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -@RequestScoped -@Named -public class GetTokensByCodeOperation extends BaseOperation { - - private static final Logger LOG = LoggerFactory.getLogger(GetTokensByCodeOperation.class); - @Inject - StateService stateService; - @Inject - DiscoveryService discoveryService; - @Inject - RpService rpService; - @Inject - KeyGeneratorService keyGeneratorService; - @Inject - PublicOpKeyService publicOpKeyService; - @Inject - OpClientFactoryImpl opClientFactory; - - @Override - public IOpResponse execute(GetTokensByCodeParams params, HttpServletRequest httpServletRequest) throws Exception { - validate(params); - - final Rp rp = getRp(params); - OpenIdConfigurationResponse discoveryResponse = discoveryService.getConnectDiscoveryResponse(rp); - - final TokenRequest tokenRequest = new TokenRequest(GrantType.AUTHORIZATION_CODE); - tokenRequest.setCode(params.getCode()); - tokenRequest.setRedirectUri(rp.getRedirectUri()); - tokenRequest.setAuthUsername(rp.getClientId()); - AuthenticationMethod authenticationMethod = Strings.isNullOrEmpty(params.getAuthenticationMethod()) ? AuthenticationMethod.fromString(rp.getTokenEndpointAuthMethod()) : AuthenticationMethod.fromString(params.getAuthenticationMethod()); - - if (authenticationMethod == null) { - LOG.debug("TokenEndpointAuthMethod is either not set or not valid. Setting `client_secret_basic` as AuthenticationMethod. TokenEndpointAuthMethod : {} ", rp.getTokenEndpointAuthMethod()); - tokenRequest.setAuthenticationMethod(AuthenticationMethod.CLIENT_SECRET_BASIC); - } else { - tokenRequest.setAuthenticationMethod(authenticationMethod); - } - - if (Lists.newArrayList(AuthenticationMethod.PRIVATE_KEY_JWT, AuthenticationMethod.TLS_CLIENT_AUTH, AuthenticationMethod.SELF_SIGNED_TLS_CLIENT_AUTH).contains(authenticationMethod)) { - - Algorithm algorithm = Strings.isNullOrEmpty(params.getAlgorithm()) ? Algorithm.fromString(rp.getTokenEndpointAuthSigningAlg()) : Algorithm.fromString(params.getAlgorithm()); - if (algorithm == null) { - LOG.error("TokenEndpointAuthSigningAlg is either not set or not valid. TokenEndpointAuthSigningAlg : {} ", rp.getTokenEndpointAuthSigningAlg()); - throw new HttpException(ErrorResponseCode.INVALID_SIGNATURE_ALGORITHM); - } - - tokenRequest.setAlgorithm(SignatureAlgorithm.fromString(rp.getTokenEndpointAuthSigningAlg())); - boolean enabledJwksGeneration = jansConfigurationService.find().getEnableJwksGeneration().booleanValue(); - if (!enabledJwksGeneration) { - LOG.error("The Token Authentication Method is {}. Please set `enable_jwks_generation` (to `true`), `crypt_provider_key_store_path` and `crypt_provider_key_store_password` in `client-api-server.yml` to enable RP-jwks generation in jans-client-api.", authenticationMethod.toString()); - throw new HttpException(ErrorResponseCode.JWKS_GENERATION_DISABLE); - } - - tokenRequest.setCryptoProvider(keyGeneratorService.getCryptoProvider()); - tokenRequest.setKeyId(keyGeneratorService.getCryptoProvider().getKeyId(keyGeneratorService.getKeys(), algorithm, Use.SIGNATURE)); - tokenRequest.setAudience(discoveryResponse.getTokenEndpoint()); - } else { - tokenRequest.setAuthPassword(rp.getClientSecret()); - } - - final TokenClient tokenClient = opClientFactory.createTokenClient(discoveryResponse.getTokenEndpoint()); - tokenClient.setExecutor(httpService.getClientEngine()); - tokenClient.setRequest(tokenRequest); - final TokenResponse response = tokenClient.exec(); - - if (response.getStatus() == 200 || response.getStatus() == 302) { // success or redirect - - if (Strings.isNullOrEmpty(response.getIdToken())) { - LOG.error("id_token is not returned. Please check: 1) OP log file for error (oxauth.log) 2) whether 'openid' scope is present for 'get_authorization_url' command"); - LOG.error("Entity: " + response.getEntity()); - throw new HttpException(ErrorResponseCode.NO_ID_TOKEN_RETURNED); - } - - if (Strings.isNullOrEmpty(response.getAccessToken())) { - LOG.error("access_token is not returned"); - throw new HttpException(ErrorResponseCode.NO_ACCESS_TOKEN_RETURNED); - } - - final Jwt idToken = Jwt.parse(response.getIdToken()); - - final Validator validator = new Validator.Builder() - .discoveryResponse(discoveryResponse) - .idToken(idToken) - .keyService(publicOpKeyService) - .opClientFactory(opClientFactory) - .rpServerConfiguration(jansConfigurationService.find()) - .rp(rp) - .build(); - - String state = stateService.encodeExpiredObject(params.getState(), ExpiredObjectType.STATE); - - validator.validateNonce(stateService); - validator.validateIdToken(); - validator.validateAccessToken(response.getAccessToken()); - validator.validateState(state); - // persist tokens - rp.setIdToken(response.getIdToken()); - rp.setAccessToken(response.getAccessToken()); - rpService.update(rp); - stateService.deleteExpiredObjectsByKey(state); - - LOG.trace("Scope: " + response.getScope()); - - final GetTokensByCodeResponse opResponse = new GetTokensByCodeResponse(); - opResponse.setAccessToken(response.getAccessToken()); - opResponse.setIdToken(response.getIdToken()); - opResponse.setRefreshToken(response.getRefreshToken()); - opResponse.setExpiresIn(response.getExpiresIn() != null ? response.getExpiresIn() : -1); - opResponse.setIdTokenClaims(Jackson2.createJsonMapper().readTree(idToken.getClaims().toJsonString())); - return opResponse; - } else { - if (response.getStatus() == 400) { - throw new HttpException(ErrorResponseCode.BAD_REQUEST_INVALID_CODE); - } - LOG.error("Failed to get tokens because response code is: " + response.getScope()); - } - return null; - } - - @Override - public Class getParameterClass() { - return GetTokensByCodeParams.class; - } - - @Override - public String getReturnType() { - return MediaType.APPLICATION_JSON; - } - - private void validate(GetTokensByCodeParams params) { - - if (Strings.isNullOrEmpty(params.getCode())) { - throw new HttpException(ErrorResponseCode.BAD_REQUEST_NO_CODE); - } - if (Strings.isNullOrEmpty(params.getState())) { - throw new HttpException(ErrorResponseCode.BAD_REQUEST_NO_STATE); - } - try { - String keyExpiredObject = stateService.encodeExpiredObject(params.getState(), ExpiredObjectType.STATE); - if (!stateService.isExpiredObjectPresent(keyExpiredObject)) { - throw new HttpException(ErrorResponseCode.BAD_REQUEST_STATE_NOT_VALID); - } - } catch (Exception e) { - Log.error(e.getMessage(), e); - throw new HttpException(ErrorResponseCode.BAD_REQUEST_STATE_NOT_VALID); - } - } -} diff --git a/jans-client-api/server/src/main/java/io/jans/ca/server/op/GetUserInfoOperation.java b/jans-client-api/server/src/main/java/io/jans/ca/server/op/GetUserInfoOperation.java deleted file mode 100644 index 7987e0ba158..00000000000 --- a/jans-client-api/server/src/main/java/io/jans/ca/server/op/GetUserInfoOperation.java +++ /dev/null @@ -1,91 +0,0 @@ -package io.jans.ca.server.op; - -import com.google.common.base.Strings; -import io.jans.as.client.UserInfoClient; -import io.jans.as.client.UserInfoRequest; -import io.jans.as.client.UserInfoResponse; -import io.jans.as.model.jwt.Jwt; -import io.jans.as.model.jwt.JwtClaimName; -import io.jans.ca.common.ErrorResponseCode; -import io.jans.ca.common.Jackson2; -import io.jans.ca.common.params.GetUserInfoParams; -import io.jans.ca.common.response.IOpResponse; -import io.jans.ca.common.response.POJOResponse; -import io.jans.ca.server.HttpException; -import io.jans.ca.server.service.DiscoveryService; -import io.jans.ca.server.service.HttpService; -import jakarta.enterprise.context.RequestScoped; -import jakarta.inject.Inject; -import jakarta.inject.Named; -import jakarta.servlet.http.HttpServletRequest; -import jakarta.ws.rs.core.MediaType; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import java.io.IOException; - -@RequestScoped -@Named -public class GetUserInfoOperation extends BaseOperation { - - private static final Logger LOG = LoggerFactory.getLogger(GetUserInfoOperation.class); - @Inject - DiscoveryService discoveryService; - @Inject - OpClientFactoryImpl opClientFactory; - @Inject - HttpService httpService; - - @Override - public IOpResponse execute(GetUserInfoParams params, HttpServletRequest httpServletRequest) throws IOException { - getValidationService().validate(params); - - UserInfoClient client = opClientFactory.createUserInfoClient(discoveryService.getConnectDiscoveryResponseByRpId(params.getRpId()).getUserInfoEndpoint()); - client.setExecutor(httpService.getClientEngine()); - client.setRequest(new UserInfoRequest(params.getAccessToken())); - - final UserInfoResponse response = client.exec(); - //validate subject identifier of successful response - if (response.getStatus() == 200) { - validateSubjectIdentifier(params.getIdToken(), response); - } - - return new POJOResponse(Jackson2.createJsonMapper().readTree(response.getEntity())); - } - - public void validateSubjectIdentifier(String idToken, UserInfoResponse response) { - try { - boolean validateUserInfoWithIdToken = jansConfigurationService.find().getValidateUserInfoWithIdToken(); - if (!validateUserInfoWithIdToken) { - return; - } - - if (Strings.isNullOrEmpty(idToken)) { - return; - } - LOG.trace("Validating subject Identifier (`sub`) of userInfo response."); - String subjectIdentifier = response.getClaims().get("sub"); - final Jwt jwtIdToken = Jwt.parse(idToken); - if (!jwtIdToken.getClaims().getClaimAsString(JwtClaimName.SUBJECT_IDENTIFIER).equals(subjectIdentifier)) { - LOG.error("UserInfo `sub` value does not matches with `sub` value of ID_TOKEN.\n ID_TOKEN `sub`: {} \n UserInfo `sub`: {} ", jwtIdToken.getClaims().getClaimAsString(JwtClaimName.SUBJECT_IDENTIFIER), subjectIdentifier); - throw new HttpException(ErrorResponseCode.INVALID_SUBJECT_IDENTIFIER); - } - } catch (HttpException e) { - throw e; - } catch (Exception e) { - LOG.error("Error in matching `sub` value of UserInfo with `sub` value of ID_TOKEN.", e); - throw new HttpException(ErrorResponseCode.FAILED_TO_VERIFY_SUBJECT_IDENTIFIER); - } - } - - @Override - public Class getParameterClass() { - return GetUserInfoParams.class; - } - - @Override - public String getReturnType() { - return MediaType.APPLICATION_JSON; - } - -} diff --git a/jans-client-api/server/src/main/java/io/jans/ca/server/op/IOperation.java b/jans-client-api/server/src/main/java/io/jans/ca/server/op/IOperation.java deleted file mode 100644 index 8ce23296f59..00000000000 --- a/jans-client-api/server/src/main/java/io/jans/ca/server/op/IOperation.java +++ /dev/null @@ -1,22 +0,0 @@ -/* - * All rights reserved -- Copyright 2015 Gluu Inc. - */ -package io.jans.ca.server.op; - -import io.jans.ca.common.params.IParams; -import io.jans.ca.common.response.IOpResponse; -import jakarta.servlet.http.HttpServletRequest; - -public interface IOperation { - - /** - * Executes operations and produces response. - * - * @return command response - */ - IOpResponse execute(T params, HttpServletRequest httpRequest) throws Exception; - - Class getParameterClass(); - - String getReturnType(); -} diff --git a/jans-client-api/server/src/main/java/io/jans/ca/server/op/ImplicitFlowOperation.java b/jans-client-api/server/src/main/java/io/jans/ca/server/op/ImplicitFlowOperation.java deleted file mode 100644 index 5d2ae4a7213..00000000000 --- a/jans-client-api/server/src/main/java/io/jans/ca/server/op/ImplicitFlowOperation.java +++ /dev/null @@ -1,115 +0,0 @@ -/* - * All rights reserved -- Copyright 2015 Gluu Inc. - */ -package io.jans.ca.server.op; - -import com.google.api.client.util.Lists; -import io.jans.as.client.*; -import io.jans.as.model.common.AuthenticationMethod; -import io.jans.as.model.common.GrantType; -import io.jans.as.model.common.Prompt; -import io.jans.as.model.common.ResponseType; -import io.jans.as.model.util.Util; -import io.jans.ca.common.params.ImplicitFlowParams; -import io.jans.ca.common.response.IOpResponse; -import io.jans.ca.common.response.ImplicitFlowResponse; -import io.jans.ca.server.service.DiscoveryService; -import jakarta.inject.Inject; -import jakarta.servlet.http.HttpServletRequest; -import jakarta.ws.rs.core.MediaType; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import java.util.ArrayList; -import java.util.List; -import java.util.UUID; - -/** - * @author Yuriy Zabrovarnyy - * @version 0.9, 23/06/2015 - */ - -public class ImplicitFlowOperation extends BaseOperation { - - private static final Logger LOG = LoggerFactory.getLogger(ImplicitFlowOperation.class); - @Inject - DiscoveryService discoveryService; - - @Override - public IOpResponse execute(ImplicitFlowParams params, HttpServletRequest httpServletRequest) { - final OpenIdConfigurationResponse discovery = discoveryService.getConnectDiscoveryResponseByRpId(params.getRpId()); - if (discovery != null) { - return requestToken(discovery, params); - } - return null; - } - - private ImplicitFlowResponse requestToken(OpenIdConfigurationResponse discovery, ImplicitFlowParams params) { - // 1. Request authorization and receive the authorization code. - final List implicitResponseTypes = new ArrayList(); - implicitResponseTypes.add(ResponseType.CODE); - implicitResponseTypes.add(ResponseType.ID_TOKEN); - final List scopes = Lists.newArrayList(); - scopes.add(params.getScope()); - - String nonce = params.getNonce(); - final AuthorizationRequest implicitRequest = new AuthorizationRequest(implicitResponseTypes, params.getClientId(), scopes, params.getRedirectUrl(), nonce); - implicitRequest.setState("af0ifjsldkj"); - implicitRequest.setAuthUsername(params.getUserId()); - implicitRequest.setAuthPassword(params.getUserSecret()); - implicitRequest.getPrompts().add(Prompt.NONE); - implicitRequest.setNonce(UUID.randomUUID().toString()); - - final AuthorizeClient authorizeClient = new AuthorizeClient(discovery.getAuthorizationEndpoint()); - authorizeClient.setRequest(implicitRequest); - authorizeClient.setExecutor(getHttpService().getClientEngine()); - final AuthorizationResponse response1 = authorizeClient.exec(); - - final String scope = response1.getScope(); - final String authorizationCode = response1.getCode(); - - if (Util.allNotBlank(authorizationCode)) { - - // 2. Request access token using the authorization code. - final TokenRequest implicitTokenRequest = new TokenRequest(GrantType.AUTHORIZATION_CODE); - implicitTokenRequest.setCode(authorizationCode); - implicitTokenRequest.setRedirectUri(params.getRedirectUrl()); - implicitTokenRequest.setAuthUsername(params.getClientId()); - implicitTokenRequest.setAuthPassword(params.getClientSecret()); - implicitTokenRequest.setAuthenticationMethod(AuthenticationMethod.CLIENT_SECRET_BASIC); - implicitTokenRequest.setScope(scope); - - final TokenClient tokenClient1 = new TokenClient(discovery.getTokenEndpoint()); - tokenClient1.setExecutor(getHttpService().getClientEngine()); - tokenClient1.setRequest(implicitTokenRequest); - final TokenResponse response2 = tokenClient1.exec(); - - if (response2.getStatus() == 200 || response2.getStatus() == 302) { // success or redirect - if (Util.allNotBlank(response2.getAccessToken(), response2.getRefreshToken())) { - final ImplicitFlowResponse implicitFlowResponse = new ImplicitFlowResponse(); - implicitFlowResponse.setAccessToken(response2.getAccessToken()); - implicitFlowResponse.setIdToken(response2.getIdToken()); - implicitFlowResponse.setRefreshToken(response2.getRefreshToken()); - implicitFlowResponse.setAuthorizationCode(authorizationCode); - implicitFlowResponse.setScope(scope); - implicitFlowResponse.setExpiresIn(response2.getExpiresIn()); - return implicitFlowResponse; - } - } - } else { - LOG.debug("Authorization code is blank."); - } - return null; - } - - @Override - public Class getParameterClass() { - return ImplicitFlowParams.class; - } - - @Override - public String getReturnType() { - return MediaType.APPLICATION_JSON; - } - -} \ No newline at end of file diff --git a/jans-client-api/server/src/main/java/io/jans/ca/server/op/IntrospectAccessTokenOperation.java b/jans-client-api/server/src/main/java/io/jans/ca/server/op/IntrospectAccessTokenOperation.java deleted file mode 100644 index 401697fe538..00000000000 --- a/jans-client-api/server/src/main/java/io/jans/ca/server/op/IntrospectAccessTokenOperation.java +++ /dev/null @@ -1,43 +0,0 @@ -package io.jans.ca.server.op; - -import io.jans.as.model.common.IntrospectionResponse; -import io.jans.ca.common.params.IntrospectAccessTokenParams; -import io.jans.ca.common.response.IOpResponse; -import io.jans.ca.common.response.POJOResponse; -import io.jans.ca.server.service.IntrospectionService; -import jakarta.enterprise.context.RequestScoped; -import jakarta.inject.Inject; -import jakarta.inject.Named; -import jakarta.servlet.http.HttpServletRequest; -import jakarta.ws.rs.core.MediaType; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -@RequestScoped -@Named -public class IntrospectAccessTokenOperation extends BaseOperation { - - private static final Logger LOG = LoggerFactory.getLogger(IntrospectAccessTokenOperation.class); - @Inject - IntrospectionService introspectionService; - - @Override - public IOpResponse execute(IntrospectAccessTokenParams params, HttpServletRequest httpServletRequest) { - getValidationService().validate(params); - - IntrospectionResponse response = introspectionService.introspectToken(params.getRpId(), params.getAccessToken()); - - return new POJOResponse(response); - } - - @Override - public Class getParameterClass() { - return IntrospectAccessTokenParams.class; - } - - @Override - public String getReturnType() { - return MediaType.APPLICATION_JSON; - } - -} diff --git a/jans-client-api/server/src/main/java/io/jans/ca/server/op/IntrospectRptOperation.java b/jans-client-api/server/src/main/java/io/jans/ca/server/op/IntrospectRptOperation.java deleted file mode 100644 index 4fa3e5ec319..00000000000 --- a/jans-client-api/server/src/main/java/io/jans/ca/server/op/IntrospectRptOperation.java +++ /dev/null @@ -1,39 +0,0 @@ -package io.jans.ca.server.op; - -import io.jans.ca.common.introspection.CorrectRptIntrospectionResponse; -import io.jans.ca.common.params.IntrospectRptParams; -import io.jans.ca.common.response.IOpResponse; -import io.jans.ca.common.response.POJOResponse; -import io.jans.ca.server.service.IntrospectionService; -import jakarta.enterprise.context.RequestScoped; -import jakarta.inject.Inject; -import jakarta.inject.Named; -import jakarta.servlet.http.HttpServletRequest; -import jakarta.ws.rs.core.MediaType; - -@RequestScoped -@Named -public class IntrospectRptOperation extends BaseOperation { - - @Inject - IntrospectionService introspectionService; - - @Override - public IOpResponse execute(IntrospectRptParams params, HttpServletRequest httpServletRequest) { - getValidationService().validate(params); - - CorrectRptIntrospectionResponse response = introspectionService.introspectRpt(params.getRpId(), params.getRpt()); - return new POJOResponse(response); - } - - @Override - public Class getParameterClass() { - return IntrospectRptParams.class; - } - - @Override - public String getReturnType() { - return MediaType.APPLICATION_JSON; - } - -} diff --git a/jans-client-api/server/src/main/java/io/jans/ca/server/op/OpClientFactory.java b/jans-client-api/server/src/main/java/io/jans/ca/server/op/OpClientFactory.java deleted file mode 100644 index 9350b2a2a2f..00000000000 --- a/jans-client-api/server/src/main/java/io/jans/ca/server/op/OpClientFactory.java +++ /dev/null @@ -1,42 +0,0 @@ -package io.jans.ca.server.op; - -import io.jans.as.client.*; -import io.jans.as.client.uma.UmaClientFactory; -import io.jans.as.model.crypto.signature.RSAPublicKey; -import io.jans.as.model.crypto.signature.SignatureAlgorithm; -import io.jans.as.model.jws.RSASigner; -import io.jans.ca.rs.protect.resteasy.PatProvider; -import io.jans.ca.rs.protect.resteasy.ResourceRegistrar; -import io.jans.ca.rs.protect.resteasy.RptPreProcessInterceptor; -import io.jans.ca.rs.protect.resteasy.ServiceProvider; -import io.jans.ca.server.introspection.ClientFactory; -import jakarta.ws.rs.client.Invocation.Builder; -import org.jboss.resteasy.client.jaxrs.ClientHttpEngine; - -public interface OpClientFactory { - public TokenClient createTokenClient(String url); - - public TokenClient createTokenClientWithUmaProtectionScope(String url); - - public UserInfoClient createUserInfoClient(String url); - - public RegisterClient createRegisterClient(String url); - - public OpenIdConfigurationClient createOpenIdConfigurationClient(String url) throws Exception; - - public AuthorizeClient createAuthorizeClient(String url); - - public ResourceRegistrar createResourceRegistrar(PatProvider patProvider, ServiceProvider serviceProvider); - - public JwkClient createJwkClient(String url); - - public RSASigner createRSASigner(SignatureAlgorithm signatureAlgorithm, RSAPublicKey rsaPublicKey); - - public RptPreProcessInterceptor createRptPreProcessInterceptor(ResourceRegistrar resourceRegistrar); - - public ClientFactory createClientFactory(); - - public UmaClientFactory createUmaClientFactory(); - - public Builder createClientRequest(String uriTemplate, ClientHttpEngine engine) throws Exception; -} \ No newline at end of file diff --git a/jans-client-api/server/src/main/java/io/jans/ca/server/op/OpClientFactoryImpl.java b/jans-client-api/server/src/main/java/io/jans/ca/server/op/OpClientFactoryImpl.java deleted file mode 100644 index 6ebcb1e25c3..00000000000 --- a/jans-client-api/server/src/main/java/io/jans/ca/server/op/OpClientFactoryImpl.java +++ /dev/null @@ -1,84 +0,0 @@ -package io.jans.ca.server.op; - -import io.jans.as.client.*; -import io.jans.as.client.uma.UmaClientFactory; -import io.jans.as.model.crypto.signature.RSAPublicKey; -import io.jans.as.model.crypto.signature.SignatureAlgorithm; -import io.jans.as.model.jws.RSASigner; -import io.jans.ca.rs.protect.resteasy.PatProvider; -import io.jans.ca.rs.protect.resteasy.ResourceRegistrar; -import io.jans.ca.rs.protect.resteasy.RptPreProcessInterceptor; -import io.jans.ca.rs.protect.resteasy.ServiceProvider; -import io.jans.ca.server.introspection.ClientFactory; - -import jakarta.enterprise.context.ApplicationScoped; -import jakarta.ws.rs.client.Invocation.Builder; -import jakarta.ws.rs.core.UriBuilder; -import org.jboss.resteasy.client.jaxrs.ClientHttpEngine; -import org.jboss.resteasy.client.jaxrs.ResteasyClient; -import org.jboss.resteasy.client.jaxrs.ResteasyClientBuilder; -import org.jboss.resteasy.client.jaxrs.ResteasyWebTarget; - -@ApplicationScoped -public class OpClientFactoryImpl implements OpClientFactory { - - public OpClientFactoryImpl() { - } - - public TokenClient createTokenClient(String url) { - return new TokenClient(url); - } - - public TokenClient createTokenClientWithUmaProtectionScope(String url) { - return new TokenClient(url); - } - - public UserInfoClient createUserInfoClient(String url) { - return new UserInfoClient(url); - } - - public RegisterClient createRegisterClient(String url) { - return new RegisterClient(url); - } - - public OpenIdConfigurationClient createOpenIdConfigurationClient(String url) throws Exception{ - return new OpenIdConfigurationClient(url); - } - - public AuthorizeClient createAuthorizeClient(String url) { - return new AuthorizeClient(url); - } - - public ResourceRegistrar createResourceRegistrar(PatProvider patProvider, ServiceProvider serviceProvider) { - return new ResourceRegistrar(patProvider, serviceProvider); - } - - public ClientFactory createClientFactory() { - return ClientFactory.instance(); - } - - public UmaClientFactory createUmaClientFactory() { - return UmaClientFactory.instance(); - } - - public JwkClient createJwkClient(String url) { - return new JwkClient(url); - } - - public RSASigner createRSASigner(SignatureAlgorithm signatureAlgorithm, RSAPublicKey rsaPublicKey) { - return new RSASigner(signatureAlgorithm, rsaPublicKey); - } - - public RptPreProcessInterceptor createRptPreProcessInterceptor(ResourceRegistrar resourceRegistrar) { - return new RptPreProcessInterceptor(resourceRegistrar); - } - - public Builder createClientRequest(String uriTemplate, ClientHttpEngine clientEngine) throws Exception { - final ResteasyClient client = ((ResteasyClientBuilder) ResteasyClientBuilder.newBuilder()).httpEngine(clientEngine).build(); - final ResteasyWebTarget target = client.target(UriBuilder.fromPath(uriTemplate)); - - return target.request(); - - } - -} diff --git a/jans-client-api/server/src/main/java/io/jans/ca/server/op/RegisterSiteOperation.java b/jans-client-api/server/src/main/java/io/jans/ca/server/op/RegisterSiteOperation.java deleted file mode 100644 index 5203b4746ec..00000000000 --- a/jans-client-api/server/src/main/java/io/jans/ca/server/op/RegisterSiteOperation.java +++ /dev/null @@ -1,754 +0,0 @@ -package io.jans.ca.server.op; - -import com.google.common.base.Preconditions; -import com.google.common.base.Strings; -import com.google.common.collect.Lists; -import com.google.common.collect.Sets; -import io.jans.as.client.RegisterClient; -import io.jans.as.client.RegisterRequest; -import io.jans.as.client.RegisterResponse; -import io.jans.as.model.common.AuthenticationMethod; -import io.jans.as.model.common.GrantType; -import io.jans.as.model.common.SubjectType; -import io.jans.as.model.crypto.encryption.BlockEncryptionAlgorithm; -import io.jans.as.model.crypto.encryption.KeyEncryptionAlgorithm; -import io.jans.as.model.crypto.signature.SignatureAlgorithm; -import io.jans.as.model.register.ApplicationType; -import io.jans.as.model.uma.UmaMetadata; -import io.jans.ca.common.ErrorResponseCode; -import io.jans.ca.common.params.RegisterSiteParams; -import io.jans.ca.common.response.IOpResponse; -import io.jans.ca.common.response.RegisterSiteResponse; -import io.jans.ca.server.HttpException; -import io.jans.ca.server.Utils; -import io.jans.ca.server.configuration.model.Rp; -import io.jans.ca.server.mapper.RegisterRequestMapper; -import io.jans.ca.server.service.DiscoveryService; -import io.jans.ca.server.service.RpService; -import jakarta.inject.Inject; -import jakarta.servlet.http.HttpServletRequest; -import jakarta.ws.rs.core.MediaType; -import org.apache.commons.collections.CollectionUtils; -import org.apache.commons.lang.StringUtils; -import org.apache.commons.lang.math.NumberUtils; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import java.util.ArrayList; -import java.util.List; -import java.util.Set; -import java.util.UUID; - -/** - * @author Yuriy Zabrovarnyy - */ - -public class RegisterSiteOperation extends BaseOperation { - - private static final Logger LOG = LoggerFactory.getLogger(RegisterSiteOperation.class); - - private Rp rp; - - @Inject - RpService rpService; - @Inject - DiscoveryService discoveryService; - - - public RegisterSiteResponse execute_(RegisterSiteParams params) { - validateParametersAndFallbackIfNeeded(params); - - String rpId = UUID.randomUUID().toString(); - - LOG.info("Creating RP ..."); - persistRp(rpId, params); - - LOG.info("RP created: " + rp); - - RegisterSiteResponse response = new RegisterSiteResponse(); - response.setRpId(rpId); - response.setOpHost(rp.getOpHost()); - response.setClientId(rp.getClientId()); - response.setClientName(rp.getClientName()); - response.setClientSecret(rp.getClientSecret()); - response.setClientRegistrationAccessToken(rp.getClientRegistrationAccessToken()); - response.setClientRegistrationClientUri(rp.getClientRegistrationClientUri()); - response.setClientIdIssuedAt(Utils.date(rp.getClientIdIssuedAt())); - response.setClientSecretExpiresAt(Utils.date(rp.getClientSecretExpiresAt())); - return response; - } - - @Override - public IOpResponse execute(RegisterSiteParams params, HttpServletRequest httpRequest) { - try { - return execute_(params); - } catch (HttpException e) { - throw e; - } catch (Exception e) { - LOG.error(e.getMessage(), e); - } - throw HttpException.internalError(); - } - - @Override - public Class getParameterClass() { - return RegisterSiteParams.class; - } - - @Override - public String getReturnType() { - return MediaType.APPLICATION_JSON; - } - - private void validateParametersAndFallbackIfNeeded(RegisterSiteParams params) { - if (StringUtils.isNotBlank(params.getClientId()) && StringUtils.isBlank(params.getClientSecret())) { - throw new HttpException(ErrorResponseCode.INVALID_CLIENT_SECRET_REQUIRED); - } - - if (StringUtils.isNotBlank(params.getClientSecret()) && StringUtils.isBlank(params.getClientId())) { - throw new HttpException(ErrorResponseCode.INVALID_CLIENT_ID_REQUIRED); - } - - Rp fallback = rpService.defaultRp(); - - //op_configuration_endpoint - LOG.info("Either 'op_configuration_endpoint' or 'op_host' should be set. jans_client_api will now check which of these parameter is available."); - if (StringUtils.isBlank(params.getOpConfigurationEndpoint())) { - LOG.warn("'op_configuration_endpoint' is not set for parameter: " + params + ". Look up at configuration file for fallback of 'op_configuration_endpoint'."); - String fallbackOpConfigurationEndpoint = fallback.getOpConfigurationEndpoint(); - if (StringUtils.isNotBlank(fallbackOpConfigurationEndpoint)) { - LOG.warn("Fallback to op_configuration_endpoint: " + fallbackOpConfigurationEndpoint + ", from configuration file."); - params.setOpConfigurationEndpoint(fallbackOpConfigurationEndpoint); - } - } - - // op_host - if (Strings.isNullOrEmpty(params.getOpHost()) && Strings.isNullOrEmpty(params.getOpConfigurationEndpoint())) { - LOG.error("Either 'op_configuration_endpoint' or 'op_host' should be set. Parameter: " + params); - throw new HttpException(ErrorResponseCode.INVALID_OP_HOST_AND_CONFIGURATION_ENDPOINT); - } - - // grant_type - List grantTypes = Lists.newArrayList(); - - if (params.getGrantTypes() != null && !params.getGrantTypes().isEmpty()) { - grantTypes.addAll(params.getGrantTypes()); - } - - if (grantTypes.isEmpty() && fallback.getGrantType() != null && !fallback.getGrantType().isEmpty()) { - grantTypes.addAll(fallback.getGrantType()); - } - boolean addCredentials = jansConfigurationService.find().getAddClientCredentialsGrantTypeAutomaticallyDuringClientRegistration().booleanValue(); - if (!grantTypes.contains(GrantType.CLIENT_CREDENTIALS.getValue()) && addCredentials) { - grantTypes.add(GrantType.CLIENT_CREDENTIALS.getValue()); - } - - params.setGrantTypes(grantTypes); - - //post_logout_redirect_uri - if (params.getPostLogoutRedirectUris() != null && params.getPostLogoutRedirectUris().isEmpty() - && fallback.getPostLogoutRedirectUris() != null && !fallback.getPostLogoutRedirectUris().isEmpty()) { - params.setPostLogoutRedirectUris(fallback.getPostLogoutRedirectUris()); - } - - // response_type - List responseTypes = Lists.newArrayList(); - if (params.getResponseTypes() != null && !params.getResponseTypes().isEmpty()) { - responseTypes.addAll(params.getResponseTypes()); - } - if (responseTypes.isEmpty() && fallback.getResponseTypes() != null && !fallback.getResponseTypes().isEmpty()) { - responseTypes.addAll(fallback.getResponseTypes()); - } - if (responseTypes.isEmpty()) { - responseTypes.add("code"); - } - params.setResponseTypes(responseTypes); - - // redirect_uris - if (params.getRedirectUris() == null || params.getRedirectUris().isEmpty()) { - params.setRedirectUris(fallback.getRedirectUris()); - } - Set redirectUris = Sets.newLinkedHashSet(); - if (params.getRedirectUris() != null && !params.getRedirectUris().isEmpty() && params.getRedirectUris().stream().allMatch(uri -> Utils.isValidUrl(uri))) { - redirectUris.addAll(params.getRedirectUris()); - } else { - throw new HttpException(ErrorResponseCode.INVALID_REDIRECT_URI); - } - final Boolean autoRegister = jansConfigurationService.find().getUma2AutoRegisterClaimsGatheringEndpointAsRedirectUriOfClient(); - if (autoRegister != null && autoRegister && !redirectUris.isEmpty()) { - String first = redirectUris.iterator().next(); - if (first.contains(discoveryService.getConnectDiscoveryResponse(params.getOpConfigurationEndpoint(), params.getOpHost(), params.getOpDiscoveryPath()).getIssuer())) { - final UmaMetadata discovery = discoveryService.getUmaDiscovery(params.getOpConfigurationEndpoint(), params.getOpHost(), params.getOpDiscoveryPath()); - String autoRedirectUri = discovery.getClaimsInteractionEndpoint() + "?authentication=true"; - - LOG.trace("Register claims interaction endpoint as redirect_uri: " + autoRedirectUri); - redirectUris.add(autoRedirectUri); - } else { - LOG.trace("Skip auto registration of claims interaction endpoint as redirect_uri because OP host for different uri's is different which will not pass AS redirect_uri's validation (same host must be present)."); - } - } - params.setRedirectUris(Lists.newArrayList(redirectUris)); - - // claims_redirect_uri - if ((params.getClaimsRedirectUri() == null || params.getClaimsRedirectUri().isEmpty()) && (fallback.getClaimsRedirectUri() != null && !fallback.getClaimsRedirectUri().isEmpty())) { - params.setClaimsRedirectUri(fallback.getClaimsRedirectUri()); - } - Set claimsRedirectUris = Sets.newHashSet(); - if (params.getClaimsRedirectUri() != null && !params.getClaimsRedirectUri().isEmpty()) { - claimsRedirectUris.addAll(params.getClaimsRedirectUri()); - } - params.setClaimsRedirectUri(Lists.newArrayList(claimsRedirectUris)); - - // scope - if (params.getScope() == null || params.getScope().isEmpty()) { - params.setScope(fallback.getScope()); - } - if (params.getScope() == null || params.getScope().isEmpty()) { - throw new HttpException(ErrorResponseCode.INVALID_SCOPE); - } - - // acr_values - if (params.getAcrValues() == null || params.getAcrValues().isEmpty()) { - params.setAcrValues(fallback.getAcrValues()); - } - - // client_jwks_uri - if (Strings.isNullOrEmpty(params.getClientJwksUri()) && !Strings.isNullOrEmpty(fallback.getClientJwksUri())) { - params.setClientJwksUri(fallback.getClientJwksUri()); - } - - // contacts - if (params.getContacts() == null || params.getContacts().isEmpty()) { - params.setContacts(fallback.getContacts()); - } - - // ui_locales - if (params.getUiLocales() == null || params.getUiLocales().isEmpty()) { - params.setUiLocales(fallback.getUiLocales()); - } - - // claims_locales - if ((params.getClaimsLocales() == null || params.getClaimsLocales().isEmpty()) && (fallback.getClaimsLocales() != null && !fallback.getClaimsLocales().isEmpty())) { - params.setClaimsLocales(fallback.getClaimsLocales()); - } - - //client_name - if (StringUtils.isBlank(params.getClientName()) && StringUtils.isNotBlank(fallback.getClientName())) { - params.setClientName(fallback.getClientName()); - } - - //client_jwks_uri - if (StringUtils.isBlank(params.getClientJwksUri()) && StringUtils.isNotBlank(fallback.getClientJwksUri())) { - params.setClientJwksUri(fallback.getClientJwksUri()); - } - - //token_endpoint_auth_method - if (StringUtils.isBlank(params.getClientTokenEndpointAuthMethod()) && StringUtils.isNotBlank(fallback.getTokenEndpointAuthMethod())) { - params.setClientTokenEndpointAuthMethod(fallback.getTokenEndpointAuthMethod()); - } - - //token_endpoint_auth_signing_alg - if (StringUtils.isBlank(params.getClientTokenEndpointAuthSigningAlg()) && StringUtils.isNotBlank(fallback.getTokenEndpointAuthSigningAlg())) { - params.setClientTokenEndpointAuthSigningAlg(fallback.getTokenEndpointAuthSigningAlg()); - } - - //request_uris - if ((params.getClientRequestUris() == null || params.getClientRequestUris().isEmpty()) && (fallback.getRequestUris() != null && !fallback.getRequestUris().isEmpty())) { - params.setClientRequestUris(fallback.getRequestUris()); - } - - //front_channel_logout_uris - if (StringUtils.isBlank(params.getClientFrontchannelLogoutUri()) && StringUtils.isNotBlank(fallback.getFrontChannelLogoutUri())) { - params.setClientFrontchannelLogoutUri(fallback.getFrontChannelLogoutUri()); - } - - //sector_identifier_uri - if (StringUtils.isBlank(params.getClientSectorIdentifierUri()) && StringUtils.isNotBlank(fallback.getSectorIdentifierUri())) { - params.setClientSectorIdentifierUri(fallback.getSectorIdentifierUri()); - } - - //client_id - if (StringUtils.isBlank(params.getClientId()) && StringUtils.isNotBlank(fallback.getClientId())) { - params.setClientId(fallback.getClientId()); - } - - //client_secret - if (StringUtils.isBlank(params.getClientSecret()) && StringUtils.isNotBlank(fallback.getClientSecret())) { - params.setClientSecret(fallback.getClientSecret()); - } - - //access_token_signing_alg - if (StringUtils.isBlank(params.getAccessTokenSigningAlg()) && StringUtils.isNotBlank(fallback.getAccessTokenSigningAlg())) { - params.setAccessTokenSigningAlg(fallback.getAccessTokenSigningAlg()); - } - - //logo_uri - if (StringUtils.isBlank(params.getLogoUri()) && StringUtils.isNotBlank(fallback.getLogoUri())) { - params.setLogoUri(fallback.getLogoUri()); - } - - //client_uri - if (StringUtils.isBlank(params.getClientUri()) && StringUtils.isNotBlank(fallback.getClientUri())) { - params.setClientUri(fallback.getClientUri()); - } - - //policy_uri - if (StringUtils.isBlank(params.getPolicyUri()) && StringUtils.isNotBlank(fallback.getPolicyUri())) { - params.setPolicyUri(fallback.getPolicyUri()); - } - - //tos_uri - if (StringUtils.isBlank(params.getTosUri()) && StringUtils.isNotBlank(fallback.getTosUri())) { - params.setTosUri(fallback.getTosUri()); - } - - //jwks - if (StringUtils.isBlank(params.getJwks()) && StringUtils.isNotBlank(fallback.getJwks())) { - params.setJwks(fallback.getJwks()); - } - - //id_token_binding_cnf - if (StringUtils.isBlank(params.getIdTokenBindingCnf()) && StringUtils.isNotBlank(fallback.getIdTokenBindingCnf())) { - params.setIdTokenBindingCnf(fallback.getIdTokenBindingCnf()); - } - - //tls_client_auth_subject_dn - if (StringUtils.isBlank(params.getTlsClientAuthSubjectDn()) && StringUtils.isNotBlank(fallback.getTlsClientAuthSubjectDn())) { - params.setTlsClientAuthSubjectDn(fallback.getTlsClientAuthSubjectDn()); - } - - //id_token_signed_response_alg - if (StringUtils.isBlank(params.getIdTokenSignedResponseAlg()) && StringUtils.isNotBlank(fallback.getIdTokenSignedResponseAlg())) { - params.setIdTokenSignedResponseAlg(fallback.getIdTokenSignedResponseAlg()); - } - - //id_token_encrypted_response_alg - if (StringUtils.isBlank(params.getIdTokenEncryptedResponseAlg()) && StringUtils.isNotBlank(fallback.getIdTokenEncryptedResponseAlg())) { - params.setIdTokenEncryptedResponseAlg(fallback.getIdTokenEncryptedResponseAlg()); - } - - //id_token_encrypted_response_enc - if (StringUtils.isBlank(params.getIdTokenEncryptedResponseEnc()) && StringUtils.isNotBlank(fallback.getIdTokenEncryptedResponseEnc())) { - params.setIdTokenEncryptedResponseEnc(fallback.getIdTokenEncryptedResponseEnc()); - } - - //user_info_signed_response_alg - if (StringUtils.isBlank(params.getUserInfoSignedResponseAlg()) && StringUtils.isNotBlank(fallback.getUserInfoSignedResponseAlg())) { - params.setUserInfoSignedResponseAlg(fallback.getUserInfoSignedResponseAlg()); - } - - //user_info_encrypted_response_alg - if (StringUtils.isBlank(params.getUserInfoEncryptedResponseAlg()) && StringUtils.isNotBlank(fallback.getUserInfoEncryptedResponseAlg())) { - params.setUserInfoEncryptedResponseAlg(fallback.getUserInfoEncryptedResponseAlg()); - } - - //user_info_encrypted_response_enc - if (StringUtils.isBlank(params.getUserInfoEncryptedResponseEnc()) && StringUtils.isNotBlank(fallback.getUserInfoEncryptedResponseEnc())) { - params.setUserInfoEncryptedResponseEnc(fallback.getUserInfoEncryptedResponseEnc()); - } - - //request_object_signing_alg - if (StringUtils.isBlank(params.getRequestObjectSigningAlg()) && StringUtils.isNotBlank(fallback.getRequestObjectSigningAlg())) { - params.setRequestObjectSigningAlg(fallback.getRequestObjectSigningAlg()); - } - - //request_object_encryption_alg - if (StringUtils.isBlank(params.getRequestObjectEncryptionAlg()) && StringUtils.isNotBlank(fallback.getRequestObjectEncryptionAlg())) { - params.setRequestObjectEncryptionAlg(fallback.getRequestObjectEncryptionAlg()); - } - - //request_object_encryption_enc - if (StringUtils.isBlank(params.getRequestObjectEncryptionEnc()) && StringUtils.isNotBlank(fallback.getRequestObjectEncryptionEnc())) { - params.setRequestObjectEncryptionEnc(fallback.getRequestObjectEncryptionEnc()); - } - - //default_max_age - if (params.getDefaultMaxAge() == null && fallback.getDefaultMaxAge() != null) { - params.setDefaultMaxAge(fallback.getDefaultMaxAge()); - } - - //initiate_login_uri - if (StringUtils.isBlank(params.getInitiateLoginUri()) && StringUtils.isNotBlank(fallback.getInitiateLoginUri())) { - params.setInitiateLoginUri(fallback.getInitiateLoginUri()); - } - - //authorized_origins - if ((params.getAuthorizedOrigins() == null || params.getAuthorizedOrigins().isEmpty()) && (fallback.getAuthorizedOrigins() != null && !fallback.getAuthorizedOrigins().isEmpty())) { - params.setAuthorizedOrigins(fallback.getAuthorizedOrigins()); - } - - //access_token_lifetime - if (params.getAccessTokenLifetime() == null && fallback.getAccessTokenLifetime() != null) { - params.setAccessTokenLifetime(fallback.getAccessTokenLifetime()); - } - - //software_id - if (StringUtils.isBlank(params.getSoftwareId()) && StringUtils.isNotBlank(fallback.getSoftwareId())) { - params.setSoftwareId(fallback.getSoftwareId()); - } - - //software_version - if (StringUtils.isBlank(params.getSoftwareVersion()) && StringUtils.isNotBlank(fallback.getSoftwareVersion())) { - params.setSoftwareVersion(fallback.getSoftwareVersion()); - } - - //software_statement - if (StringUtils.isBlank(params.getSoftwareStatement()) && StringUtils.isNotBlank(fallback.getSoftwareStatement())) { - params.setSoftwareStatement(fallback.getSoftwareStatement()); - } - - //custom_attributes - if ((params.getCustomAttributes() == null || params.getCustomAttributes().isEmpty()) && (fallback.getCustomAttributes() != null && !fallback.getCustomAttributes().isEmpty())) { - params.setCustomAttributes(fallback.getCustomAttributes()); - } - - //access_token_as_jwt - if (params.getAccessTokenAsJwt() == null) { - params.setAccessTokenAsJwt(fallback.getAccessTokenAsJwt()); - } - - //rpt_as_jwt - if (params.getRptAsJwt() == null) { - params.setRptAsJwt(fallback.getRptAsJwt()); - } - - //front_channel_logout_session_required - if (params.getFrontChannelLogoutSessionRequired() == null) { - params.setFrontChannelLogoutSessionRequired(fallback.getFrontChannelLogoutSessionRequired()); - } - - //run_introspection_script_beforeaccess_token_as_jwt_creation_and_include_claims - if (params.getRunIntrospectionScriptBeforeAccessTokenAsJwtCreationAndIncludeClaims() == null) { - params.setRunIntrospectionScriptBeforeAccessTokenAsJwtCreationAndIncludeClaims(fallback.getRunIntrospectionScriptBeforeAccessTokenAsJwtCreationAndIncludeClaims()); - } - - //require_auth_time - if (params.getRequireAuthTime() == null) { - params.setRequireAuthTime(fallback.getRequireAuthTime()); - } - } - - private void persistRp(String rpId, RegisterSiteParams params) { - - try { - final RegisterRequest registerRequest = createRegisterClientRequest(params, rpId); - rp = createRp(registerRequest); - rp.setRpId(rpId); - rp.setApplicationType("web"); - rp.setOpHost(discoveryService.getConnectDiscoveryResponse(params.getOpConfigurationEndpoint(), params.getOpHost(), params.getOpDiscoveryPath()).getIssuer()); - rp.setOpDiscoveryPath(params.getOpDiscoveryPath()); - rp.setOpConfigurationEndpoint(params.getOpConfigurationEndpoint()); - rp.setUiLocales(params.getUiLocales()); - rp.setSyncClientFromOp(params.getSyncClientFromOp()); - rp.setSyncClientPeriodInSeconds(params.getSyncClientPeriodInSeconds()); - - if (!hasClient(params)) { - final RegisterResponse registerResponse = registerClient(params, registerRequest); - - rp.setClientId(registerResponse.getClientId()); - rp.setClientSecret(registerResponse.getClientSecret()); - rp.setClientRegistrationAccessToken(registerResponse.getRegistrationAccessToken()); - rp.setClientRegistrationClientUri(registerResponse.getRegistrationClientUri()); - rp.setClientIdIssuedAt(registerResponse.getClientIdIssuedAt()); - rp.setClientSecretExpiresAt(registerResponse.getClientSecretExpiresAt()); - } else { - rp.setClientId(params.getClientId()); - rp.setClientSecret(params.getClientSecret()); - } - - rpService.create(rp); - } catch (HttpException e) { - throw e; - } catch (Exception e) { - LOG.error("Failed to persist site configuration, params: " + params, e); - throw new RuntimeException(e); - } - } - - private boolean hasClient(RegisterSiteParams params) { - return !Strings.isNullOrEmpty(params.getClientId()) && !Strings.isNullOrEmpty(params.getClientSecret()); - } - - private RegisterResponse registerClient(RegisterSiteParams params, RegisterRequest request) { - String opHostEndpoint = Strings.isNullOrEmpty(params.getOpConfigurationEndpoint()) ? params.getOpHost() : params.getOpConfigurationEndpoint(); - Preconditions.checkState(!Strings.isNullOrEmpty(opHostEndpoint), "Both op_configuration_endpoint and op_host contains blank value. Please specify valid OP public address."); - - final String registrationEndpoint = discoveryService.getConnectDiscoveryResponse(params.getOpConfigurationEndpoint(), params.getOpHost(), params.getOpDiscoveryPath()).getRegistrationEndpoint(); - if (Strings.isNullOrEmpty(registrationEndpoint)) { - LOG.error("This OP (" + opHostEndpoint + ") does not provide registration_endpoint. It means that jans_client_api is not able dynamically register client. " + - "Therefore it is required to obtain/register client manually on OP site and provide client_id and client_secret to jans_client_api register_site command."); - throw new HttpException(ErrorResponseCode.NO_REGISTRATION_ENDPOINT); - } - - final RegisterClient registerClient = rpService.createRegisterClient(registrationEndpoint, request); - final RegisterResponse response = registerClient.exec(); - if (response != null) { - if (!Strings.isNullOrEmpty(response.getClientId()) && !Strings.isNullOrEmpty(response.getClientSecret())) { - LOG.trace("Registered client for site - client_id: " + response.getClientId() + ", claims: " + response.getClaims() + ", registration_client_uri:" + response.getRegistrationClientUri()); - return response; - } - LOG.error("ClientId: " + response.getClientId() + ", clientSecret: " + response.getClientSecret()); - if (Strings.isNullOrEmpty(response.getClientId())) { - LOG.error("`client_id` is not returned from OP host. Please check OP log file for error (oxauth.log)."); - throw new HttpException(ErrorResponseCode.NO_CLIENT_ID_RETURNED); - } - - if (Strings.isNullOrEmpty(response.getClientSecret())) { - LOG.error("`client_secret` is not returned from OP host. Please check: 1) OP log file for error (oxauth.log) 2) whether `returnClientSecretOnRead` configuration property is set to true on OP host."); - throw new HttpException(ErrorResponseCode.NO_CLIENT_SECRET_RETURNED); - } - - } else { - LOG.error("RegisterClient response is null."); - } - if (response != null && !Strings.isNullOrEmpty(response.getErrorDescription())) { - LOG.error(response.getErrorDescription()); - } - - throw new RuntimeException("Failed to register client for site. Details: " + (response != null ? response.getEntity() : "response is null")); - } - - private RegisterRequest createRegisterClientRequest(RegisterSiteParams params, String rpId) { - String clientName = "jans_client_api client for rp: " + rpId; - if (!Strings.isNullOrEmpty(params.getClientName())) { - clientName = params.getClientName(); - } - - final RegisterRequest request = new RegisterRequest(ApplicationType.WEB, clientName, params.getRedirectUris()); - request.setResponseTypesStrings(params.getResponseTypes()); - request.setJwksUri(params.getClientJwksUri()); - request.setClaimsRedirectUris(params.getClaimsRedirectUri() != null ? params.getClaimsRedirectUri() : new ArrayList()); - request.setPostLogoutRedirectUris(params.getPostLogoutRedirectUris() != null ? params.getPostLogoutRedirectUris() : Lists.newArrayList()); - request.setContacts(params.getContacts()); - request.setScope(params.getScope()); - request.setDefaultAcrValues(params.getAcrValues()); - - if (StringUtils.isNotBlank(params.getClientTokenEndpointAuthSigningAlg())) { - SignatureAlgorithm signatureAlgorithms = SignatureAlgorithm.fromString(params.getClientTokenEndpointAuthSigningAlg()); - if (signatureAlgorithms == null) { - LOG.error("Received invalid algorithm in `client_token_endpoint_auth_signing_alg` property. Value: " + params.getClientTokenEndpointAuthSigningAlg()); - throw new HttpException(ErrorResponseCode.INVALID_SIGNATURE_ALGORITHM); - } - request.setTokenEndpointAuthSigningAlg(signatureAlgorithms); - } - - if (StringUtils.isNotBlank(rpId)) { - request.addCustomAttribute("rp_id", rpId); - } - - List grantTypes = Lists.newArrayList(); - for (String grantType : params.getGrantTypes()) { - grantTypes.add(GrantType.fromString(grantType)); - } - request.setGrantTypes(grantTypes); - - if (StringUtils.isNotBlank(params.getClientFrontchannelLogoutUri())) { - request.setFrontChannelLogoutUri(params.getClientFrontchannelLogoutUri()); - } - - if (StringUtils.isNotBlank(params.getClientTokenEndpointAuthMethod())) { - final AuthenticationMethod authenticationMethod = AuthenticationMethod.fromString(params.getClientTokenEndpointAuthMethod()); - if (authenticationMethod != null) { - request.setTokenEndpointAuthMethod(authenticationMethod); - } - } - - if (params.getClientRequestUris() != null && !params.getClientRequestUris().isEmpty()) { - request.setRequestUris(params.getClientRequestUris()); - } - - if (!Strings.isNullOrEmpty(params.getClientSectorIdentifierUri())) { - request.setSectorIdentifierUri(params.getClientSectorIdentifierUri()); - } - - request.setAccessTokenAsJwt(params.getAccessTokenAsJwt()); - request.setAccessTokenSigningAlg(SignatureAlgorithm.fromString(params.getAccessTokenSigningAlg())); - request.setRptAsJwt(params.getRptAsJwt()); - - if (!Strings.isNullOrEmpty(params.getLogoUri())) { - request.setLogoUri(params.getLogoUri()); - } - - if (!Strings.isNullOrEmpty(params.getClientUri())) { - request.setClientUri(params.getClientUri()); - } - - if (!Strings.isNullOrEmpty(params.getPolicyUri())) { - request.setPolicyUri(params.getPolicyUri()); - } - - if (params.getFrontChannelLogoutSessionRequired() != null) { - request.setFrontChannelLogoutSessionRequired(params.getFrontChannelLogoutSessionRequired()); - } - - if (!Strings.isNullOrEmpty(params.getTosUri())) { - request.setTosUri(params.getTosUri()); - } - - if (!Strings.isNullOrEmpty(params.getJwks())) { - request.setJwks(params.getJwks()); - } - - if (!Strings.isNullOrEmpty(params.getIdTokenBindingCnf())) { - request.setIdTokenTokenBindingCnf(params.getIdTokenBindingCnf()); - } - - if (!Strings.isNullOrEmpty(params.getTlsClientAuthSubjectDn())) { - request.setTlsClientAuthSubjectDn(params.getTlsClientAuthSubjectDn()); - } - - if (!Strings.isNullOrEmpty(params.getSubjectType())) { - SubjectType subjectType = SubjectType.fromString(params.getSubjectType()); - if (subjectType == null) { - LOG.error("Received invalid values in `subject_type` property. Value: " + params.getSubjectType()); - throw new HttpException(ErrorResponseCode.INVALID_SUBJECT_TYPE); - } - request.setSubjectType(subjectType); - } - - if (params.getRunIntrospectionScriptBeforeAccessTokenAsJwtCreationAndIncludeClaims() != null) { - request.setRunIntrospectionScriptBeforeJwtCreation(params.getRunIntrospectionScriptBeforeAccessTokenAsJwtCreationAndIncludeClaims()); - } - - if (!Strings.isNullOrEmpty(params.getIdTokenSignedResponseAlg())) { - SignatureAlgorithm signatureAlgorithms = SignatureAlgorithm.fromString(params.getIdTokenSignedResponseAlg()); - if (signatureAlgorithms == null) { - LOG.error("Received invalid algorithm in `id_token_signed_response_alg` property. Value: " + params.getIdTokenSignedResponseAlg()); - throw new HttpException(ErrorResponseCode.INVALID_SIGNATURE_ALGORITHM); - } - - boolean acceptIdTokenWithoutSignature = jansConfigurationService.find().getAcceptIdTokenWithoutSignature().booleanValue(); - if (signatureAlgorithms == SignatureAlgorithm.NONE && !acceptIdTokenWithoutSignature) { - LOG.error("`ID_TOKEN` without signature is not allowed. To allow `ID_TOKEN` without signature set `accept_id_token_without_signature` field to 'true' in client-api-server.yml."); - throw new HttpException(ErrorResponseCode.ID_TOKEN_WITHOUT_SIGNATURE_NOT_ALLOWED); - } - - request.setIdTokenSignedResponseAlg(signatureAlgorithms); - } - - if (!Strings.isNullOrEmpty(params.getIdTokenEncryptedResponseAlg())) { - KeyEncryptionAlgorithm keyEncryptionAlgorithms = KeyEncryptionAlgorithm.fromName(params.getIdTokenEncryptedResponseAlg()); - if (keyEncryptionAlgorithms == null) { - LOG.error("Received invalid algorithm in `id_token_encrypted_response_alg` property. Value: " + params.getIdTokenEncryptedResponseAlg()); - throw new HttpException(ErrorResponseCode.INVALID_KEY_ENCRYPTION_ALGORITHM); - } - request.setIdTokenEncryptedResponseAlg(keyEncryptionAlgorithms); - } - - if (!Strings.isNullOrEmpty(params.getIdTokenEncryptedResponseEnc())) { - BlockEncryptionAlgorithm blockEncryptionAlgorithms = BlockEncryptionAlgorithm.fromName(params.getIdTokenEncryptedResponseEnc()); - if (blockEncryptionAlgorithms == null) { - LOG.error("Received invalid algorithm in `id_token_encrypted_response_enc` property. Value: " + params.getIdTokenEncryptedResponseEnc()); - throw new HttpException(ErrorResponseCode.INVALID_BLOCK_ENCRYPTION_ALGORITHM); - } - request.setIdTokenEncryptedResponseEnc(blockEncryptionAlgorithms); - } - - if (!Strings.isNullOrEmpty(params.getUserInfoSignedResponseAlg())) { - SignatureAlgorithm signatureAlgorithms = SignatureAlgorithm.fromString(params.getUserInfoSignedResponseAlg()); - if (signatureAlgorithms == null) { - LOG.error("Received invalid algorithm in `user_info_signed_response_alg` property. Value: " + params.getUserInfoSignedResponseAlg()); - throw new HttpException(ErrorResponseCode.INVALID_SIGNATURE_ALGORITHM); - } - request.setUserInfoSignedResponseAlg(signatureAlgorithms); - } - - if (!Strings.isNullOrEmpty(params.getUserInfoEncryptedResponseAlg())) { - KeyEncryptionAlgorithm keyEncryptionAlgorithms = KeyEncryptionAlgorithm.fromName(params.getUserInfoEncryptedResponseAlg()); - if (keyEncryptionAlgorithms == null) { - LOG.error("Received invalid algorithm in `user_info_encrypted_response_alg` property. Value: " + params.getUserInfoEncryptedResponseAlg()); - throw new HttpException(ErrorResponseCode.INVALID_KEY_ENCRYPTION_ALGORITHM); - } - request.setUserInfoEncryptedResponseAlg(keyEncryptionAlgorithms); - } - - if (!Strings.isNullOrEmpty(params.getUserInfoEncryptedResponseEnc())) { - BlockEncryptionAlgorithm blockEncryptionAlgorithms = BlockEncryptionAlgorithm.fromName(params.getUserInfoEncryptedResponseEnc()); - if (blockEncryptionAlgorithms == null) { - LOG.error("Received invalid algorithm in `user_info_encrypted_response_enc` property. Value: " + params.getUserInfoEncryptedResponseEnc()); - throw new HttpException(ErrorResponseCode.INVALID_BLOCK_ENCRYPTION_ALGORITHM); - } - request.setUserInfoEncryptedResponseEnc(blockEncryptionAlgorithms); - } - - if (!Strings.isNullOrEmpty(params.getRequestObjectSigningAlg())) { - SignatureAlgorithm signatureAlgorithms = SignatureAlgorithm.fromString(params.getRequestObjectSigningAlg()); - if (signatureAlgorithms == null) { - LOG.error("Received invalid algorithm in `request_object_signing_alg` property. Value: " + params.getRequestObjectSigningAlg()); - throw new HttpException(ErrorResponseCode.INVALID_SIGNATURE_ALGORITHM); - } - request.setRequestObjectSigningAlg(signatureAlgorithms); - } - - if (!Strings.isNullOrEmpty(params.getRequestObjectEncryptionAlg())) { - KeyEncryptionAlgorithm keyEncryptionAlgorithms = KeyEncryptionAlgorithm.fromName(params.getRequestObjectEncryptionAlg()); - if (keyEncryptionAlgorithms == null) { - LOG.error("Received invalid algorithm in `request_object_encryption_alg` property. Value: " + params.getRequestObjectEncryptionAlg()); - throw new HttpException(ErrorResponseCode.INVALID_KEY_ENCRYPTION_ALGORITHM); - } - request.setRequestObjectEncryptionAlg(keyEncryptionAlgorithms); - } - - if (!Strings.isNullOrEmpty(params.getRequestObjectEncryptionEnc())) { - BlockEncryptionAlgorithm blockEncryptionAlgorithms = BlockEncryptionAlgorithm.fromName(params.getRequestObjectEncryptionEnc()); - if (blockEncryptionAlgorithms == null) { - LOG.error("Received invalid algorithm in `request_object_encryption_enc` property. Value: " + params.getRequestObjectEncryptionEnc()); - throw new HttpException(ErrorResponseCode.INVALID_BLOCK_ENCRYPTION_ALGORITHM); - } - request.setRequestObjectEncryptionEnc(blockEncryptionAlgorithms); - } - - if (params.getDefaultMaxAge() != null && NumberUtils.isNumber(params.getDefaultMaxAge().toString())) { - request.setDefaultMaxAge(params.getDefaultMaxAge()); - } - - if (!Strings.isNullOrEmpty(params.getInitiateLoginUri())) { - request.setInitiateLoginUri(params.getInitiateLoginUri()); - } - - if (params.getAuthorizedOrigins() != null && !params.getAuthorizedOrigins().isEmpty()) { - request.setAuthorizedOrigins(params.getAuthorizedOrigins()); - } - - if (params.getAccessTokenLifetime() != null && NumberUtils.isNumber(params.getAccessTokenLifetime().toString())) { - request.setAccessTokenLifetime(params.getAccessTokenLifetime()); - } - - if (!Strings.isNullOrEmpty(params.getSoftwareId())) { - request.setSoftwareId(params.getSoftwareId()); - } - - if (!Strings.isNullOrEmpty(params.getSoftwareVersion())) { - request.setSoftwareVersion(params.getSoftwareVersion()); - } - - if (!Strings.isNullOrEmpty(params.getSoftwareStatement())) { - request.setSoftwareStatement(params.getSoftwareStatement()); - } - - if (params.getAllowSpontaneousScopes() != null) { - request.setAllowSpontaneousScopes(params.getAllowSpontaneousScopes()); - } - - if (CollectionUtils.isNotEmpty(params.getSpontaneousScopes())) { - request.setSpontaneousScopes(params.getSpontaneousScopes()); - } - - if (params.getCustomAttributes() != null && !params.getCustomAttributes().isEmpty()) { - params.getCustomAttributes().entrySet().removeIf(entry -> entry.getKey().contains("oxAuthTrustedClient")); - params.getCustomAttributes().entrySet().stream().forEach(e -> { - request.addCustomAttribute(e.getKey(), e.getValue()); - }); - } - - return request; - } - - private Rp createRp(RegisterRequest registerRequest) { - final Rp rp = new Rp(); - - RegisterRequestMapper.fillRp(rp, registerRequest); - - return rp; - } -} \ No newline at end of file diff --git a/jans-client-api/server/src/main/java/io/jans/ca/server/op/RemoveSiteOperation.java b/jans-client-api/server/src/main/java/io/jans/ca/server/op/RemoveSiteOperation.java deleted file mode 100644 index 1aaad233040..00000000000 --- a/jans-client-api/server/src/main/java/io/jans/ca/server/op/RemoveSiteOperation.java +++ /dev/null @@ -1,41 +0,0 @@ -package io.jans.ca.server.op; - -import io.jans.ca.common.ErrorResponseCode; -import io.jans.ca.common.params.RemoveSiteParams; -import io.jans.ca.common.response.IOpResponse; -import io.jans.ca.common.response.RemoveSiteResponse; -import io.jans.ca.server.HttpException; -import io.jans.ca.server.service.RpService; -import jakarta.enterprise.context.RequestScoped; -import jakarta.inject.Inject; -import jakarta.inject.Named; -import jakarta.servlet.http.HttpServletRequest; -import jakarta.ws.rs.core.MediaType; - -@RequestScoped -@Named -public class RemoveSiteOperation extends BaseOperation { - - @Inject - RpService rpService; - - @Override - public IOpResponse execute(RemoveSiteParams params, HttpServletRequest httpRequest) { - String rpId = getRp(params).getRpId(); - if (rpService.remove(rpId)) { - return new RemoveSiteResponse(rpId); - } - throw new HttpException(ErrorResponseCode.FAILED_TO_REMOVE_SITE); - } - - @Override - public Class getParameterClass() { - return RemoveSiteParams.class; - } - - @Override - public String getReturnType() { - return MediaType.APPLICATION_JSON; - } - -} diff --git a/jans-client-api/server/src/main/java/io/jans/ca/server/op/RpGetGetClaimsGatheringUrlOperation.java b/jans-client-api/server/src/main/java/io/jans/ca/server/op/RpGetGetClaimsGatheringUrlOperation.java deleted file mode 100644 index 1b31b8cc7ed..00000000000 --- a/jans-client-api/server/src/main/java/io/jans/ca/server/op/RpGetGetClaimsGatheringUrlOperation.java +++ /dev/null @@ -1,86 +0,0 @@ -package io.jans.ca.server.op; - -import com.google.common.collect.Lists; -import io.jans.as.model.uma.UmaMetadata; -import io.jans.ca.common.ErrorResponseCode; -import io.jans.ca.common.ExpiredObjectType; -import io.jans.ca.common.params.RpGetClaimsGatheringUrlParams; -import io.jans.ca.common.response.IOpResponse; -import io.jans.ca.common.response.RpGetClaimsGatheringUrlResponse; -import io.jans.ca.server.HttpException; -import io.jans.ca.server.Utils; -import io.jans.ca.server.configuration.model.Rp; -import io.jans.ca.server.service.DiscoveryService; -import io.jans.ca.server.service.StateService; -import jakarta.enterprise.context.RequestScoped; -import jakarta.inject.Inject; -import jakarta.inject.Named; -import jakarta.servlet.http.HttpServletRequest; -import jakarta.ws.rs.core.MediaType; -import org.apache.commons.lang.StringUtils; - -import java.util.List; -import java.util.Map; -import java.util.stream.Collectors; - -@RequestScoped -@Named -public class RpGetGetClaimsGatheringUrlOperation extends BaseOperation { - - @Inject - DiscoveryService discoveryService; - @Inject - StateService stateService; - - @Override - public IOpResponse execute(RpGetClaimsGatheringUrlParams params, HttpServletRequest httpServletRequest) throws Exception { - validate(params); - - final UmaMetadata metadata = discoveryService.getUmaDiscoveryByRpId(params.getRpId()); - final Rp rp = getRp(params); - final String state = StringUtils.isNotBlank(params.getState()) ? stateService.putState(stateService.encodeExpiredObject(params.getState(), ExpiredObjectType.STATE)) : stateService.generateState(); - - String url = metadata.getClaimsInteractionEndpoint() + - "?client_id=" + rp.getClientId() + - "&ticket=" + params.getTicket() + - "&claims_redirect_uri=" + params.getClaimsRedirectUri() + - "&state=" + state; - - if (params.getCustomParameters() != null && !params.getCustomParameters().isEmpty()) { - List paramsList = Lists.newArrayList("rp_id", "client_id", "ticket", "state", "claims_redirect_uri"); - - Map customParameterMap = params.getCustomParameters().entrySet() - .stream() - .filter(map -> !paramsList.contains(map.getKey())) - .collect(Collectors.toMap(map -> map.getKey(), map -> map.getValue())); - - if (!customParameterMap.isEmpty()) { - url += "&" + Utils.mapAsStringWithEncodedValues(customParameterMap); - } - } - - final RpGetClaimsGatheringUrlResponse r = new RpGetClaimsGatheringUrlResponse(); - r.setUrl(url); - r.setState(state); - return r; - } - - @Override - public Class getParameterClass() { - return RpGetClaimsGatheringUrlParams.class; - } - - @Override - public String getReturnType() { - return MediaType.APPLICATION_JSON; - } - - private void validate(RpGetClaimsGatheringUrlParams params) { - if (StringUtils.isBlank(params.getTicket())) { - throw new HttpException(ErrorResponseCode.NO_UMA_TICKET_PARAMETER); - } - if (StringUtils.isBlank(params.getClaimsRedirectUri())) { - throw new HttpException(ErrorResponseCode.NO_UMA_CLAIMS_REDIRECT_URI_PARAMETER); - } - } -} \ No newline at end of file diff --git a/jans-client-api/server/src/main/java/io/jans/ca/server/op/RpGetRptOperation.java b/jans-client-api/server/src/main/java/io/jans/ca/server/op/RpGetRptOperation.java deleted file mode 100644 index b7c21e3b552..00000000000 --- a/jans-client-api/server/src/main/java/io/jans/ca/server/op/RpGetRptOperation.java +++ /dev/null @@ -1,108 +0,0 @@ -/* - * All rights reserved -- Copyright 2015 Gluu Inc. - */ -package io.jans.ca.server.op; - -import io.jans.as.model.uma.UmaNeedInfoResponse; -import io.jans.as.model.util.Util; -import io.jans.ca.common.ErrorResponseCode; -import io.jans.ca.common.Jackson2; -import io.jans.ca.common.params.RpGetRptParams; -import io.jans.ca.common.response.IOpResponse; -import io.jans.ca.server.HttpException; -import io.jans.ca.server.service.UmaTokenService; -import jakarta.enterprise.context.RequestScoped; -import jakarta.inject.Inject; -import jakarta.inject.Named; -import jakarta.servlet.http.HttpServletRequest; -import jakarta.ws.rs.ClientErrorException; -import jakarta.ws.rs.WebApplicationException; -import jakarta.ws.rs.core.MediaType; -import jakarta.ws.rs.core.Response; -import jakarta.ws.rs.core.Response.Status; -import org.apache.commons.lang.StringUtils; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import java.io.IOException; - -@RequestScoped -@Named -public class RpGetRptOperation extends BaseOperation { - - private static final Logger LOG = LoggerFactory.getLogger(RpGetRptOperation.class); - @Inject - UmaTokenService umaTokenService; - - @Override - public IOpResponse execute(RpGetRptParams params, HttpServletRequest httpServletRequest) throws Exception { - try { - validate(params); - return umaTokenService.getRpt(params); - } catch (ClientErrorException ex) { - LOG.trace(ex.getMessage(), ex); - String entity = ex.getResponse().readEntity(String.class); - return handleRptError(ex.getResponse().getStatus(), entity); - } - } - - @Override - public Class getParameterClass() { - return RpGetRptParams.class; - } - - @Override - public String getReturnType() { - return MediaType.APPLICATION_JSON; - } - - public static IOpResponse handleRptError(int status, String entity) throws IOException { - final UmaNeedInfoResponse needInfo = parseNeedInfoSilently(entity); - if (needInfo != null) { - LOG.trace("Server response: " + entity); - throw new WebApplicationException(Response - .status(getErrorCode(needInfo)) - .type(MediaType.APPLICATION_JSON_TYPE) - .entity(Jackson2.asJson(needInfo)) - .build()); - } else { - LOG.trace("No need_info error, re-throw ..."); - throw new WebApplicationException(entity, status); - } - } - - private void validate(RpGetRptParams params) { - if (StringUtils.isBlank(params.getTicket())) { - throw new HttpException(ErrorResponseCode.NO_UMA_TICKET_PARAMETER); - } - - if ((StringUtils.isBlank(params.getClaimToken()) && StringUtils.isNotBlank(params.getClaimTokenFormat())) || - StringUtils.isNotBlank(params.getClaimToken()) && StringUtils.isBlank(params.getClaimTokenFormat())) { - throw new HttpException(ErrorResponseCode.INVALID_CLAIM_TOKEN_OR_CLAIM_TOKEN_FORMAT); - } - } - - private static Status getErrorCode(UmaNeedInfoResponse needInfo) { - if (StringUtils.isNotBlank(needInfo.getError())) { - switch (needInfo.getError().toLowerCase()) { - case "invalid_claim_token_format": - return Response.Status.BAD_REQUEST; - case "invalid_ticket": - return Response.Status.BAD_REQUEST; - default: - return Response.Status.FORBIDDEN; - } - } - return Response.Status.FORBIDDEN; - } - - private static UmaNeedInfoResponse parseNeedInfoSilently(String entity) { - try { - // expected need_info error : - // sample: {"error":"need_info","ticket":"c024311b-f451-41db-95aa-cd405f16eed4","required_claims":[{"issuer":["https://localhost:8443"],"name":"country","claim_token_format":["http://openid.net/specs/openid-connect-core-1_0.html#IDToken"],"claim_type":"string","friendly_name":"country"},{"issuer":["https://localhost:8443"],"name":"city","claim_token_format":["http://openid.net/specs/openid-connect-core-1_0.html#IDToken"],"claim_type":"string","friendly_name":"city"}],"redirect_user":"https://localhost:8443/restv1/uma/gather_claimsgathering_id=sampleClaimsGathering&&?gathering_id=sampleClaimsGathering&&"} - return Util.createJsonMapper().readValue(entity, UmaNeedInfoResponse.class); - } catch (Exception e) { - return null; - } - } -} diff --git a/jans-client-api/server/src/main/java/io/jans/ca/server/op/RsCheckAccessOperation.java b/jans-client-api/server/src/main/java/io/jans/ca/server/op/RsCheckAccessOperation.java deleted file mode 100644 index ee750b8cc09..00000000000 --- a/jans-client-api/server/src/main/java/io/jans/ca/server/op/RsCheckAccessOperation.java +++ /dev/null @@ -1,170 +0,0 @@ -package io.jans.ca.server.op; - -import com.google.common.base.Strings; -import io.jans.as.model.uma.JsonLogicNodeParser; -import io.jans.as.model.uma.PermissionTicket; -import io.jans.ca.common.CoreUtils; -import io.jans.ca.common.ErrorResponse; -import io.jans.ca.common.ErrorResponseCode; -import io.jans.ca.common.Jackson2; -import io.jans.ca.common.introspection.CorrectRptIntrospectionResponse; -import io.jans.ca.common.introspection.CorrectUmaPermission; -import io.jans.ca.common.params.RsCheckAccessParams; -import io.jans.ca.common.response.IOpResponse; -import io.jans.ca.common.response.RsCheckAccessResponse; -import io.jans.ca.rs.protect.resteasy.PatProvider; -import io.jans.ca.rs.protect.resteasy.ResourceRegistrar; -import io.jans.ca.rs.protect.resteasy.RptPreProcessInterceptor; -import io.jans.ca.rs.protect.resteasy.ServiceProvider; -import io.jans.ca.server.HttpException; -import io.jans.ca.server.configuration.model.Rp; -import io.jans.ca.server.configuration.model.UmaResource; -import io.jans.ca.server.service.IntrospectionService; -import io.jans.ca.server.service.UmaTokenService; -import jakarta.enterprise.context.RequestScoped; -import jakarta.inject.Inject; -import jakarta.inject.Named; -import jakarta.servlet.http.HttpServletRequest; -import jakarta.ws.rs.ClientErrorException; -import jakarta.ws.rs.WebApplicationException; -import jakarta.ws.rs.core.MediaType; -import jakarta.ws.rs.core.Response; -import org.apache.commons.collections.CollectionUtils; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import java.util.Collections; -import java.util.List; - -@RequestScoped -@Named -public class RsCheckAccessOperation extends BaseOperation { - - private static final Logger LOG = LoggerFactory.getLogger(RsCheckAccessOperation.class); - @Inject - UmaTokenService umaTokenService; - @Inject - IntrospectionService introspectionService; - @Inject - OpClientFactoryImpl opClientFactory; - - @Override - public IOpResponse execute(final RsCheckAccessParams params, HttpServletRequest httpServletRequest) throws Exception { - validate(params); - - Rp rp = getRp(params); - UmaResource resource = rp.umaResource(params.getPath(), params.getHttpMethod()); - if (resource == null) { - final ErrorResponse error = new ErrorResponse("invalid_request"); - error.setErrorDescription("Resource is not protected with path: " + params.getPath() + " and httpMethod: " + params.getHttpMethod() + - ". Please protect your resource first with uma_rs_protect command. Check details on " + CoreUtils.DOC_URL); - LOG.error(error.getErrorDescription()); - throw new WebApplicationException(Response - .status(Response.Status.BAD_REQUEST) - .type(MediaType.APPLICATION_JSON_TYPE) - .entity(Jackson2.asJson(error)) - .build()); - } - - PatProvider patProvider = new PatProvider() { - @Override - public String getPatToken() { - return umaTokenService.getPat(params.getRpId()).getToken(); - } - - @Override - public void clearPat() { - // do nothing - } - }; - - List requiredScopes = getRequiredScopes(params, resource); - - CorrectRptIntrospectionResponse status = introspectionService.introspectRpt(params.getRpId(), params.getRpt()); - - LOG.trace("RPT: " + params.getRpt() + ", status: " + status); - - if (!Strings.isNullOrEmpty(params.getRpt()) && status != null && status.getActive() && status.getPermissions() != null) { - for (CorrectUmaPermission permission : status.getPermissions()) { - boolean containsAny = !Collections.disjoint(requiredScopes, permission.getScopes()); - - LOG.trace("containsAny: " + containsAny + ", requiredScopes: " + requiredScopes + ", permissionScopes: " + permission.getScopes()); - - if (containsAny) { - if ((permission.getResourceId() != null && permission.getResourceId().equals(resource.getId()))) { // normal UMA - LOG.debug("RPT has enough permissions, access GRANTED. Path: " + params.getPath() + ", httpMethod:" + params.getHttpMethod() + ", site: " + rp); - return new RsCheckAccessResponse("granted"); - } - } - } - } - - - if (CollectionUtils.isEmpty(params.getScopes()) && !CollectionUtils.isEmpty(resource.getTicketScopes())) { - requiredScopes = resource.getTicketScopes(); - } - - final RptPreProcessInterceptor rptInterceptor = opClientFactory.createRptPreProcessInterceptor(new ResourceRegistrar(patProvider, new ServiceProvider(rp.getOpHost()))); - Response response = null; - try { - LOG.trace("Try to register ticket, scopes: " + requiredScopes + ", resourceId: " + resource.getId()); - response = rptInterceptor.registerTicketResponse(requiredScopes, resource.getId()); - } catch (ClientErrorException e) { - LOG.debug("Failed to register ticket. Entity: " + e.getResponse().readEntity(String.class) + ", status: " + e.getResponse().getStatus(), e); - if (e.getResponse().getStatus() == 400 || e.getResponse().getStatus() == 401) { - LOG.debug("Try maybe PAT is lost on AS, force refresh PAT and request ticket again ..."); - umaTokenService.obtainPat(params.getRpId()); // force to refresh PAT - response = rptInterceptor.registerTicketResponse(requiredScopes, resource.getId()); - } else { - throw e; - } - } catch (Exception e) { - LOG.error(e.getMessage(), e); - throw e; - } - - RsCheckAccessResponse opResponse = new RsCheckAccessResponse("denied"); - opResponse.setWwwAuthenticateHeader((String) response.getMetadata().getFirst("WWW-Authenticate")); - opResponse.setTicket(((PermissionTicket) response.getEntity()).getTicket()); - LOG.debug("Access denied for path: " + params.getPath() + " and httpMethod: " + params.getHttpMethod() + ". Ticket is registered: " + opResponse); - - return opResponse; - } - - @Override - public Class getParameterClass() { - return RsCheckAccessParams.class; - } - - @Override - public String getReturnType() { - return MediaType.APPLICATION_JSON; - } - - private List getRequiredScopes(RsCheckAccessParams params, UmaResource resource) { - - List resourceScopes = resource.getScopes(); - - if (resourceScopes.isEmpty()) { - LOG.trace("Not scopes in resource:" + resource + ", rpId: " + params.getRpId()); - if (!resource.getScopeExpressions().isEmpty() && JsonLogicNodeParser.isNodeValid(resource.getScopeExpressions().get(0))) { - resourceScopes = JsonLogicNodeParser.parseNode(resource.getScopeExpressions().get(0)).getData(); - LOG.trace("Set requiredScope from scope expression."); - } - } - - if (!CollectionUtils.isEmpty(params.getScopes())) { - return params.getScopes(); // we can't validate it because it can be spontaneous scope - } - return resourceScopes; - } - - private void validate(RsCheckAccessParams params) { - if (Strings.isNullOrEmpty(params.getHttpMethod())) { - throw new HttpException(ErrorResponseCode.NO_UMA_HTTP_METHOD); - } - if (Strings.isNullOrEmpty(params.getPath())) { - throw new HttpException(ErrorResponseCode.NO_UMA_PATH_PARAMETER); - } - } -} diff --git a/jans-client-api/server/src/main/java/io/jans/ca/server/op/RsModifyOperation.java b/jans-client-api/server/src/main/java/io/jans/ca/server/op/RsModifyOperation.java deleted file mode 100644 index 740e36ee208..00000000000 --- a/jans-client-api/server/src/main/java/io/jans/ca/server/op/RsModifyOperation.java +++ /dev/null @@ -1,186 +0,0 @@ -package io.jans.ca.server.op; - -import com.google.common.base.Strings; -import com.google.common.collect.Lists; -import io.jans.as.client.uma.UmaClientFactory; -import io.jans.as.client.uma.UmaResourceService; -import io.jans.as.model.uma.JsonLogicNodeParser; -import io.jans.as.model.uma.UmaMetadata; -import io.jans.as.model.uma.UmaResourceWithId; -import io.jans.ca.common.*; -import io.jans.ca.common.params.RsModifyParams; -import io.jans.ca.common.response.IOpResponse; -import io.jans.ca.common.response.RsModifyResponse; -import io.jans.ca.rs.protect.resteasy.PatProvider; -import io.jans.ca.server.HttpException; -import io.jans.ca.server.configuration.model.Rp; -import io.jans.ca.server.configuration.model.UmaResource; -import io.jans.ca.server.service.DiscoveryService; -import io.jans.ca.server.service.RpService; -import io.jans.ca.server.service.UmaTokenService; -import jakarta.enterprise.context.RequestScoped; -import jakarta.inject.Inject; -import jakarta.inject.Named; -import jakarta.servlet.http.HttpServletRequest; -import jakarta.ws.rs.ClientErrorException; -import jakarta.ws.rs.WebApplicationException; -import jakarta.ws.rs.core.MediaType; -import jakarta.ws.rs.core.Response; -import org.apache.commons.lang.StringUtils; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import java.util.List; -import java.util.stream.Collectors; - -@RequestScoped -@Named -public class RsModifyOperation extends BaseOperation { - - private static final Logger LOG = LoggerFactory.getLogger(RsModifyOperation.class); - - @Inject - UmaTokenService umaTokenService; - @Inject - DiscoveryService discoveryService; - @Inject - RpService rpService; - - @Override - public IOpResponse execute(final RsModifyParams params, HttpServletRequest httpServletRequest) throws Exception { - validate(params); - - Rp rp = getRp(params); - - PatProvider patProvider = new PatProvider() { - @Override - public String getPatToken() { - return umaTokenService.getPat(params.getRpId()).getToken(); - } - - @Override - public void clearPat() { - // do nothing - } - }; - - UmaResource umaResource = rp.umaResource(params.getPath(), params.getHttpMethod()); - if (umaResource == null) { - final ErrorResponse error = new ErrorResponse("invalid_request"); - error.setErrorDescription("Resource is not protected with path: " + params.getPath() + " and httpMethod: " + params.getHttpMethod() + - ". Please protect your resource first with uma_rs_modify command. Check details on " + CoreUtils.DOC_URL); - LOG.error(error.getErrorDescription()); - throw new WebApplicationException(Response - .status(Response.Status.BAD_REQUEST) - .type(MediaType.APPLICATION_JSON_TYPE) - .entity(Jackson2.asJson(error)) - .build()); - } - - UmaMetadata discovery = discoveryService.getUmaDiscoveryByRpId(params.getRpId()); - UmaResourceService resourceService = UmaClientFactory.instance().createResourceService(discovery, httpService.getClientEngine()); - - io.jans.as.model.uma.UmaResource opUmaResource = getResource(resourceService, params, umaResource.getId()); - - try { - String pat = umaTokenService.getPat(params.getRpId()).getToken(); - return update(pat, umaResource.getId(), rp, resourceService, opUmaResource); - } catch (ClientErrorException e) { - LOG.debug("Failed to update resource. Entity: " + e.getResponse().readEntity(String.class) + ", status: " + e.getResponse().getStatus(), e); - if (e.getResponse().getStatus() == 400 || e.getResponse().getStatus() == 401) { - LOG.debug("Try maybe PAT is lost on AS, force refresh PAT and re-try ..."); - return update(umaTokenService.obtainPat(params.getRpId()).getToken(), umaResource.getId(), rp, resourceService, opUmaResource); - } else { - throw e; - } - } catch (Exception e) { - LOG.error(e.getMessage(), e); - throw e; - } - } - - public RsModifyResponse update(String pat, String resourceId, Rp rp, UmaResourceService resourceService, io.jans.as.model.uma.UmaResource opUmaResource) { - resourceService.updateResource("Bearer " + pat, resourceId, opUmaResource); - updateRp(opUmaResource, rp, resourceId); - - return new RsModifyResponse(rp.getRpId()); - } - - private io.jans.as.model.uma.UmaResource getResource(UmaResourceService resourceService, RsModifyParams params, String resourceId) { - String pat = umaTokenService.getPat(params.getRpId()).getToken(); - UmaResourceWithId umaResourceWithId = resourceService.getResource("Bearer " + pat, resourceId); - - io.jans.as.model.uma.UmaResource umaResource = new io.jans.as.model.uma.UmaResource(); - umaResource.setDescription(umaResourceWithId.getDescription()); - umaResource.setIat(umaResourceWithId.getIat()); - umaResource.setIconUri(umaResourceWithId.getIconUri()); - umaResource.setName(umaResourceWithId.getName()); - umaResource.setScopes(params.getScopes()); - umaResource.setScopeExpression(null); - umaResource.setType(umaResourceWithId.getType()); - if (!Strings.isNullOrEmpty(params.getScopeExpression()) && !params.getScopeExpression().equals("null")) { - umaResource.setScopeExpression(params.getScopeExpression()); - umaResource.setScopes(JsonLogicNodeParser.parseNode(params.getScopeExpression().toString()).getData()); - } - - return umaResource; - } - - private void updateRp(io.jans.as.model.uma.UmaResource opUmaResource, Rp rp, String resourceId) { - List umaResourceList = rp.getUmaProtectedResources(); - - rp.setUmaProtectedResources(umaResourceList.stream().map(res -> { - if (res.getId().equals(resourceId)) { - res.setScopes(opUmaResource.getScopes()); - res.setTicketScopes(opUmaResource.getScopes()); - res.setScopeExpressions(null); - if (!Strings.isNullOrEmpty(opUmaResource.getScopeExpression()) && !opUmaResource.getScopeExpression().equals("null")) { - res.setScopeExpressions(Lists.newArrayList(opUmaResource.getScopeExpression())); - res.setTicketScopes(JsonLogicNodeParser.parseNode(opUmaResource.getScopeExpression().toString()).getData()); - res.setScopes(null); - } - } - return res; - }).collect(Collectors.toList())); - - rpService.update(rp); - } - - private void validate(RsModifyParams params) { - - if (Strings.isNullOrEmpty(params.getRpId())) { - throw new HttpException(ErrorResponseCode.BAD_REQUEST_NO_RP_ID); - } - - if (Strings.isNullOrEmpty(params.getHttpMethod())) { - throw new HttpException(ErrorResponseCode.NO_UMA_HTTP_METHOD); - } - - if (Strings.isNullOrEmpty(params.getPath())) { - throw new HttpException(ErrorResponseCode.NO_UMA_PATH_PARAMETER); - } - - if (!Strings.isNullOrEmpty(params.getScopeExpression())) { - String json = params.getScopeExpression(); - if (StringUtils.isNotBlank(json) && !json.equalsIgnoreCase("null")) { - boolean nodeValid = JsonLogicNodeParser.isNodeValid(json); - LOG.trace("Scope expression validator - Valid: " + nodeValid + ", expression: " + json); - if (!nodeValid) { - throw new HttpException(ErrorResponseCode.UMA_FAILED_TO_VALIDATE_SCOPE_EXPRESSION); - } - RsProtectOperation.validateScopeExpression(json); - } - } - } - - @Override - public Class getParameterClass() { - return RsModifyParams.class; - } - - @Override - public String getReturnType() { - return MediaType.APPLICATION_JSON; - } - -} diff --git a/jans-client-api/server/src/main/java/io/jans/ca/server/op/RsProtectOperation.java b/jans-client-api/server/src/main/java/io/jans/ca/server/op/RsProtectOperation.java deleted file mode 100644 index 168718e33b5..00000000000 --- a/jans-client-api/server/src/main/java/io/jans/ca/server/op/RsProtectOperation.java +++ /dev/null @@ -1,216 +0,0 @@ -package io.jans.ca.server.op; - -import com.fasterxml.jackson.databind.JsonNode; -import com.google.common.collect.Lists; -import com.google.common.collect.Sets; -import io.jans.as.client.uma.UmaClientFactory; -import io.jans.as.client.uma.UmaResourceService; -import io.jans.as.model.uma.JsonLogic; -import io.jans.as.model.uma.JsonLogicNode; -import io.jans.as.model.uma.JsonLogicNodeParser; -import io.jans.as.model.uma.UmaMetadata; -import io.jans.as.model.util.Util; -import io.jans.ca.common.ErrorResponseCode; -import io.jans.ca.common.params.RsProtectParams; -import io.jans.ca.common.response.IOpResponse; -import io.jans.ca.common.response.RsProtectResponse; -import io.jans.ca.rs.protect.Condition; -import io.jans.ca.rs.protect.ResourceValidator; -import io.jans.ca.rs.protect.RsResource; -import io.jans.ca.rs.protect.resteasy.Key; -import io.jans.ca.rs.protect.resteasy.PatProvider; -import io.jans.ca.rs.protect.resteasy.ResourceRegistrar; -import io.jans.ca.rs.protect.resteasy.ServiceProvider; -import io.jans.ca.server.HttpException; -import io.jans.ca.server.configuration.model.Rp; -import io.jans.ca.server.configuration.model.UmaResource; -import io.jans.ca.server.service.DiscoveryService; -import io.jans.ca.server.service.RpService; -import io.jans.ca.server.service.UmaTokenService; -import jakarta.enterprise.context.RequestScoped; -import jakarta.inject.Inject; -import jakarta.inject.Named; -import jakarta.servlet.http.HttpServletRequest; -import jakarta.ws.rs.ClientErrorException; -import jakarta.ws.rs.core.MediaType; -import org.apache.commons.lang.StringUtils; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import java.io.IOException; -import java.util.List; -import java.util.Map; -import java.util.Set; - -@RequestScoped -@Named -public class RsProtectOperation extends BaseOperation { - - private static final Logger LOG = LoggerFactory.getLogger(RsProtectOperation.class); - - @Inject - RpService rpService; - @Inject - UmaTokenService umaTokenService; - @Inject - OpClientFactoryImpl opClientFactory; - @Inject - DiscoveryService discoveryService; - - @Override - public IOpResponse execute(final RsProtectParams params, HttpServletRequest httpServletRequest) throws Exception { - validate(params); - - Rp rp = getRp(params); - - PatProvider patProvider = new PatProvider() { - @Override - public String getPatToken() { - return umaTokenService.getPat(params.getRpId()).getToken(); - } - - @Override - public void clearPat() { - // do nothing - } - }; - - ResourceRegistrar registrar = opClientFactory.createResourceRegistrar(patProvider, new ServiceProvider(rp.getOpHost())); - try { - registrar.register(params.getResources()); - } catch (ClientErrorException e) { - LOG.debug("Failed to register resource. Entity: " + e.getResponse().readEntity(String.class) + ", status: " + e.getResponse().getStatus(), e); - if (e.getResponse().getStatus() == 400 || e.getResponse().getStatus() == 401) { - LOG.debug("Try maybe PAT is lost on AS, force refresh PAT and re-try ..."); - umaTokenService.obtainPat(params.getRpId()); // force to refresh PAT - registrar.register(params.getResources()); - } else { - throw e; - } - } catch (Exception e) { - LOG.error(e.getMessage(), e); - throw e; - } - - persist(registrar, rp); - - return new RsProtectResponse(rp.getRpId()); - } - - @Override - public Class getParameterClass() { - return RsProtectParams.class; - } - - @Override - public String getReturnType() { - return MediaType.APPLICATION_JSON; - } - - private void persist(ResourceRegistrar registrar, Rp rp) throws IOException { - Map resourceMapCopy = registrar.getResourceMapCopy(); - - for (Map.Entry entry : registrar.getIdMapCopy().entrySet()) { - UmaResource resource = new UmaResource(); - resource.setId(entry.getValue()); - resource.setPath(entry.getKey().getPath()); - resource.setHttpMethods(entry.getKey().getHttpMethods()); - Set scopes = Sets.newHashSet(); - Set scopesForTicket = Sets.newHashSet(); - Set scopeExpressions = Sets.newHashSet(); - - RsResource rsResource = resourceMapCopy.get(entry.getKey()); - - for (String httpMethod : entry.getKey().getHttpMethods()) { - - List rsScopes = rsResource.scopes(httpMethod); - if (rsScopes != null) { - scopes.addAll(rsScopes); - } - scopesForTicket.addAll(rsResource.getScopesForTicket(httpMethod)); - - JsonNode scopeExpression = rsResource.getScopeExpression(httpMethod); - if (scopeExpression != null) { - scopeExpressions.add(scopeExpression.toString()); - } - } - - resource.setScopes(Lists.newArrayList(scopes)); - resource.setTicketScopes(Lists.newArrayList(scopesForTicket)); - resource.setScopeExpressions(Lists.newArrayList(scopeExpressions)); - - if (rsResource.getIat() != null && rsResource.getIat() > 0) { - resource.setIat(rsResource.getIat()); - } - - if (rsResource.getExp() != null && rsResource.getExp() > 0) { - resource.setExp(rsResource.getExp()); - } - rp.getUmaProtectedResources().add(resource); - } - - rpService.update(rp); - } - - private void validate(RsProtectParams params) { - if (params.getResources() == null || params.getResources().isEmpty()) { - throw new HttpException(ErrorResponseCode.NO_UMA_RESOURCES_TO_PROTECT); - } - if (!ResourceValidator.isHttpMethodUniqueInPath(params.getResources())) { - throw new HttpException(ErrorResponseCode.UMA_HTTP_METHOD_NOT_UNIQUE); - } - if (params.getResources() != null) { - for (RsResource resource : params.getResources()) { - if (resource.getConditions() != null) { - for (Condition condition : resource.getConditions()) { - if (condition.getScopeExpression() != null) { - String json = condition.getScopeExpression().toString(); - if (StringUtils.isNotBlank(json) && !json.equalsIgnoreCase("null")) { - boolean nodeValid = JsonLogicNodeParser.isNodeValid(json); - LOG.trace("Scope expression validator - Valid: " + nodeValid + ", expression: " + json); - if (!nodeValid) { - throw new HttpException(ErrorResponseCode.UMA_FAILED_TO_VALIDATE_SCOPE_EXPRESSION); - } - validateScopeExpression(json); - } - } - } - } - } - } - - Rp rp = getRp(params); - List existingUmaResources = rp.getUmaProtectedResources(); - if (existingUmaResources != null && !existingUmaResources.isEmpty()) { - if (params.getOverwrite() == null || !params.getOverwrite()) { - throw new HttpException(ErrorResponseCode.UMA_PROTECTION_FAILED_BECAUSE_RESOURCES_ALREADY_EXISTS); - } else { - // remove existing resources, overwrite=true - UmaMetadata discovery = discoveryService.getUmaDiscoveryByRpId(params.getRpId()); - String pat = umaTokenService.getPat(params.getRpId()).getToken(); - UmaResourceService resourceService = UmaClientFactory.instance().createResourceService(discovery, getHttpService().getClientEngine()); - for (UmaResource resource : existingUmaResources) { - - LOG.trace("Removing existing resource " + resource.getId() + " ..."); - resourceService.deleteResource("Bearer " + pat, resource.getId()); - LOG.trace("Removed existing resource " + resource.getId() + "."); - } - rp.getUmaProtectedResources().clear(); - rpService.updateSilently(rp); - } - } - } - - public static void validateScopeExpression(String scopeExpression) { - JsonLogicNode jsonLogicNode = JsonLogicNodeParser.parseNode(scopeExpression); - try { - Object scope = JsonLogic.applyObject(jsonLogicNode.getRule().toString(), Util.asJsonSilently(jsonLogicNode.getData())); - if (scope == null || !jsonLogicNode.getData().contains(scope.toString())) { - throw new HttpException(ErrorResponseCode.UMA_FAILED_TO_VALIDATE_SCOPE_EXPRESSION); - } - } catch (Exception e) { - LOG.trace("The scope expression is invalid. Please check the documentation and make sure it is a valid JsonLogic expression.", e); - throw new HttpException(ErrorResponseCode.UMA_FAILED_TO_VALIDATE_SCOPE_EXPRESSION); - } - } -} diff --git a/jans-client-api/server/src/main/java/io/jans/ca/server/op/UpdateSiteOperation.java b/jans-client-api/server/src/main/java/io/jans/ca/server/op/UpdateSiteOperation.java deleted file mode 100644 index afc8d6322dd..00000000000 --- a/jans-client-api/server/src/main/java/io/jans/ca/server/op/UpdateSiteOperation.java +++ /dev/null @@ -1,383 +0,0 @@ -package io.jans.ca.server.op; - -import com.google.common.base.Strings; -import com.google.common.collect.Lists; -import com.google.common.collect.Sets; -import io.jans.as.client.RegisterClient; -import io.jans.as.client.RegisterRequest; -import io.jans.as.client.RegisterResponse; -import io.jans.as.model.common.GrantType; -import io.jans.as.model.common.SubjectType; -import io.jans.as.model.crypto.encryption.BlockEncryptionAlgorithm; -import io.jans.as.model.crypto.encryption.KeyEncryptionAlgorithm; -import io.jans.as.model.crypto.signature.SignatureAlgorithm; -import io.jans.ca.common.ErrorResponseCode; -import io.jans.ca.common.params.UpdateSiteParams; -import io.jans.ca.common.response.IOpResponse; -import io.jans.ca.common.response.UpdateSiteResponse; -import io.jans.ca.server.HttpException; -import io.jans.ca.server.Utils; -import io.jans.ca.server.configuration.model.Rp; -import io.jans.ca.server.mapper.RegisterRequestMapper; -import io.jans.ca.server.service.RpService; -import jakarta.enterprise.context.RequestScoped; -import jakarta.inject.Inject; -import jakarta.inject.Named; -import jakarta.servlet.http.HttpServletRequest; -import jakarta.ws.rs.HttpMethod; -import jakarta.ws.rs.core.MediaType; -import org.apache.commons.collections.CollectionUtils; -import org.apache.commons.lang.StringUtils; -import org.apache.commons.lang.math.NumberUtils; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import java.util.List; -import java.util.Set; -import java.util.stream.Collectors; - -@RequestScoped -@Named -public class UpdateSiteOperation extends BaseOperation { - - private static final Logger LOG = LoggerFactory.getLogger(UpdateSiteOperation.class); - - private Rp rp; - - @Inject - RpService rpService; - - @Override - public IOpResponse execute(UpdateSiteParams params, HttpServletRequest httpServletRequest) { - rp = getRp(params); - - LOG.info("Updating rp ... rp: " + rp); - persistRp(rp, params); - - UpdateSiteResponse response = new UpdateSiteResponse(); - response.setRpId(rp.getRpId()); - return response; - } - - @Override - public Class getParameterClass() { - return UpdateSiteParams.class; - } - - @Override - public String getReturnType() { - return MediaType.APPLICATION_JSON; - } - - private void persistRp(Rp rp, UpdateSiteParams params) { - - try { - RegisterRequest registerRequest = createRegisterClientRequest(rp, params); - updateRegisteredClient(rp, registerRequest); - RegisterRequestMapper.fillRp(rp, registerRequest); - rpService.update(rp); - - LOG.info("RP updated: " + rp); - } catch (Exception e) { - throw new RuntimeException("Failed to persist RP, params: " + params, e); - } - } - - private void updateRegisteredClient(Rp rp, RegisterRequest registerRequest) { - if (StringUtils.isBlank(rp.getClientRegistrationClientUri())) { - LOG.error("Registration client url is blank."); - throw new HttpException(ErrorResponseCode.INVALID_REGISTRATION_CLIENT_URL); - } - - final RegisterClient registerClient = rpService.createRegisterClient(rp.getClientRegistrationClientUri(), registerRequest); - final RegisterResponse response = registerClient.exec(); - if (response != null) { - if (response.getStatus() == 200) { - LOG.trace("Client updated successfully. for rp - client_id: " + rp.getClientId()); - return; - } else { - LOG.error("Response is not OK (200)."); - } - } else { - LOG.error("RegisterClient response is null."); - } - if (!Strings.isNullOrEmpty(response.getErrorDescription())) { - LOG.error(response.getErrorDescription()); - } - - throw new RuntimeException("Failed to update client for rp. Details:" + response.getEntity()); - } - - private RegisterRequest createRegisterClientRequest(Rp rp, UpdateSiteParams params) { - - final RegisterRequest request = RegisterRequestMapper.createRegisterRequest(rp); - request.setHttpMethod(HttpMethod.PUT); // force update - - if (params.getResponseTypes() != null && !params.getResponseTypes().isEmpty()) { - request.setResponseTypesStrings(params.getResponseTypes()); - } - - if (params.getRptAsJwt() != null) { - request.setRptAsJwt(params.getRptAsJwt()); - } - - if (params.getGrantType() != null && !params.getGrantType().isEmpty()) { - request.setGrantTypes(params.getGrantType().stream().map(item -> GrantType.fromString(item)).collect(Collectors.toList())); - } - - - Set redirectUris = Sets.newLinkedHashSet(); - if (params.getRedirectUris() != null && !params.getRedirectUris().isEmpty()) { - if (!params.getRedirectUris().stream().allMatch(uri -> Utils.isValidUrl(uri))) { - throw new HttpException(ErrorResponseCode.INVALID_REDIRECT_URI); - } - - redirectUris.addAll(params.getRedirectUris()); - List redirectUriList = Lists.newArrayList(redirectUris); - request.setRedirectUris(redirectUriList); - } - - if (params.getAcrValues() != null && !params.getAcrValues().isEmpty()) { - request.setDefaultAcrValues(params.getAcrValues()); - } - - if (params.getClaimsRedirectUri() != null && !params.getClaimsRedirectUri().isEmpty()) { - request.setClaimsRedirectUris(params.getClaimsRedirectUri()); - } - - if (params.getAccessTokenAsJwt() != null) { - request.setAccessTokenAsJwt(params.getAccessTokenAsJwt()); - } - - if (params.getAccessTokenSigningAlg() != null) { - SignatureAlgorithm signatureAlgorithms = SignatureAlgorithm.fromString(params.getAccessTokenSigningAlg()); - if (signatureAlgorithms == null) { - LOG.error("Received invalid algorithm in `access_token_signing_alg` property. Value: " + params.getAccessTokenSigningAlg()); - throw new HttpException(ErrorResponseCode.INVALID_SIGNATURE_ALGORITHM); - } - request.setAccessTokenSigningAlg(signatureAlgorithms); - } - - if (!Strings.isNullOrEmpty(params.getClientJwksUri())) { - request.setJwksUri(params.getClientJwksUri()); - } - - if (params.getPostLogoutRedirectUris() != null && !params.getPostLogoutRedirectUris().isEmpty()) { - request.setPostLogoutRedirectUris(Lists.newArrayList(params.getPostLogoutRedirectUris())); - } - - if (params.getContacts() != null) { - request.setContacts(params.getContacts()); - } - - if (params.getScope() != null) { - request.setScope(params.getScope()); - } - - if (!Strings.isNullOrEmpty(params.getClientSectorIdentifierUri())) { - request.setSectorIdentifierUri(params.getClientSectorIdentifierUri()); - } - - if (!Strings.isNullOrEmpty(params.getClientFrontchannelLogoutUri())) { - request.setFrontChannelLogoutUri(params.getClientFrontchannelLogoutUri()); - } - - if (params.getClientRequestUris() != null && !params.getClientRequestUris().isEmpty()) { - request.setRequestUris(params.getClientRequestUris()); - } - - if (params.getClientTokenEndpointAuthSigningAlg() != null) { - SignatureAlgorithm signatureAlgorithms = SignatureAlgorithm.fromString(params.getClientTokenEndpointAuthSigningAlg()); - if (signatureAlgorithms == null) { - LOG.error("Received invalid algorithm in `client_token_endpoint_auth_signing_alg` property. Value: " + params.getClientTokenEndpointAuthSigningAlg()); - throw new HttpException(ErrorResponseCode.INVALID_SIGNATURE_ALGORITHM); - } - request.setTokenEndpointAuthSigningAlg(SignatureAlgorithm.fromString(params.getClientTokenEndpointAuthSigningAlg())); - } - - if (!Strings.isNullOrEmpty(params.getClientName())) { - request.setClientName(params.getClientName()); - } - - if (!Strings.isNullOrEmpty(params.getLogoUri())) { - request.setLogoUri(params.getLogoUri()); - } - - if (!Strings.isNullOrEmpty(params.getClientUri())) { - request.setClientUri(params.getClientUri()); - } - - if (!Strings.isNullOrEmpty(params.getPolicyUri())) { - request.setPolicyUri(params.getPolicyUri()); - } - - if (params.getFrontChannelLogoutSessionRequired() != null) { - request.setFrontChannelLogoutSessionRequired(params.getFrontChannelLogoutSessionRequired()); - } - - if (!Strings.isNullOrEmpty(params.getTosUri())) { - request.setTosUri(params.getTosUri()); - } - - if (!Strings.isNullOrEmpty(params.getJwks())) { - request.setJwks(params.getJwks()); - } - - if (!Strings.isNullOrEmpty(params.getIdTokenBindingCnf())) { - request.setIdTokenTokenBindingCnf(params.getIdTokenBindingCnf()); - } - - if (!Strings.isNullOrEmpty(params.getTlsClientAuthSubjectDn())) { - request.setTlsClientAuthSubjectDn(params.getTlsClientAuthSubjectDn()); - } - - if (!Strings.isNullOrEmpty(params.getSubjectType())) { - SubjectType subjectType = SubjectType.fromString(params.getSubjectType()); - if (subjectType == null) { - LOG.error("Received invalid values in `subject_type` property. Value: " + params.getSubjectType()); - throw new HttpException(ErrorResponseCode.INVALID_SUBJECT_TYPE); - } - request.setSubjectType(subjectType); - } - - if (params.getRunIntrospectionScriptBeforeAccessTokenAsJwtCreationAndIncludeClaims() != null) { - request.setRunIntrospectionScriptBeforeJwtCreation(params.getRunIntrospectionScriptBeforeAccessTokenAsJwtCreationAndIncludeClaims()); - } - - if (!Strings.isNullOrEmpty(params.getIdTokenSignedResponseAlg())) { - SignatureAlgorithm signatureAlgorithms = SignatureAlgorithm.fromString(params.getIdTokenSignedResponseAlg()); - if (signatureAlgorithms == null) { - LOG.error("Received invalid algorithm in `id_token_signed_response_alg` property. Value: " + params.getIdTokenSignedResponseAlg()); - throw new HttpException(ErrorResponseCode.INVALID_SIGNATURE_ALGORITHM); - } - - if (signatureAlgorithms == SignatureAlgorithm.NONE && !getJansConfigurationService().find().getAcceptIdTokenWithoutSignature()) { - LOG.error("`ID_TOKEN` without signature is not allowed. To allow `ID_TOKEN` without signature set `accept_id_token_without_signature` field to 'true' in client-api-server.yml."); - throw new HttpException(ErrorResponseCode.ID_TOKEN_WITHOUT_SIGNATURE_NOT_ALLOWED); - } - - request.setIdTokenSignedResponseAlg(signatureAlgorithms); - } - - if (!Strings.isNullOrEmpty(params.getIdTokenEncryptedResponseAlg())) { - KeyEncryptionAlgorithm keyEncryptionAlgorithms = KeyEncryptionAlgorithm.fromName(params.getIdTokenEncryptedResponseAlg()); - if (keyEncryptionAlgorithms == null) { - LOG.error("Received invalid algorithm in `id_token_encrypted_response_alg` property. Value: " + params.getIdTokenEncryptedResponseAlg()); - throw new HttpException(ErrorResponseCode.INVALID_KEY_ENCRYPTION_ALGORITHM); - } - request.setIdTokenEncryptedResponseAlg(keyEncryptionAlgorithms); - } - - if (!Strings.isNullOrEmpty(params.getIdTokenEncryptedResponseEnc())) { - BlockEncryptionAlgorithm blockEncryptionAlgorithms = BlockEncryptionAlgorithm.fromName(params.getIdTokenEncryptedResponseEnc()); - if (blockEncryptionAlgorithms == null) { - LOG.error("Received invalid algorithm in `id_token_encrypted_response_enc` property. Value: " + params.getIdTokenEncryptedResponseEnc()); - throw new HttpException(ErrorResponseCode.INVALID_BLOCK_ENCRYPTION_ALGORITHM); - } - request.setIdTokenEncryptedResponseEnc(blockEncryptionAlgorithms); - } - - if (!Strings.isNullOrEmpty(params.getUserInfoSignedResponseAlg())) { - SignatureAlgorithm signatureAlgorithms = SignatureAlgorithm.fromString(params.getUserInfoSignedResponseAlg()); - if (signatureAlgorithms == null) { - LOG.error("Received invalid algorithm in `user_info_signed_response_alg` property. Value: " + params.getUserInfoSignedResponseAlg()); - throw new HttpException(ErrorResponseCode.INVALID_SIGNATURE_ALGORITHM); - } - request.setUserInfoSignedResponseAlg(signatureAlgorithms); - } - - if (!Strings.isNullOrEmpty(params.getUserInfoEncryptedResponseAlg())) { - KeyEncryptionAlgorithm keyEncryptionAlgorithms = KeyEncryptionAlgorithm.fromName(params.getUserInfoEncryptedResponseAlg()); - if (keyEncryptionAlgorithms == null) { - LOG.error("Received invalid algorithm in `user_info_encrypted_response_alg` property. Value: " + params.getUserInfoEncryptedResponseAlg()); - throw new HttpException(ErrorResponseCode.INVALID_KEY_ENCRYPTION_ALGORITHM); - } - request.setUserInfoEncryptedResponseAlg(keyEncryptionAlgorithms); - } - - if (!Strings.isNullOrEmpty(params.getUserInfoEncryptedResponseEnc())) { - BlockEncryptionAlgorithm blockEncryptionAlgorithms = BlockEncryptionAlgorithm.fromName(params.getUserInfoEncryptedResponseEnc()); - if (blockEncryptionAlgorithms == null) { - LOG.error("Received invalid algorithm in `user_info_encrypted_response_enc` property. Value: " + params.getUserInfoEncryptedResponseEnc()); - throw new HttpException(ErrorResponseCode.INVALID_BLOCK_ENCRYPTION_ALGORITHM); - } - request.setUserInfoEncryptedResponseEnc(blockEncryptionAlgorithms); - } - - if (!Strings.isNullOrEmpty(params.getRequestObjectSigningAlg())) { - SignatureAlgorithm signatureAlgorithms = SignatureAlgorithm.fromString(params.getRequestObjectSigningAlg()); - if (signatureAlgorithms == null) { - LOG.error("Received invalid algorithm in `request_object_signing_alg` property. Value: " + params.getRequestObjectSigningAlg()); - throw new HttpException(ErrorResponseCode.INVALID_SIGNATURE_ALGORITHM); - } - request.setRequestObjectSigningAlg(signatureAlgorithms); - } - - if (!Strings.isNullOrEmpty(params.getRequestObjectEncryptionAlg())) { - KeyEncryptionAlgorithm keyEncryptionAlgorithms = KeyEncryptionAlgorithm.fromName(params.getRequestObjectEncryptionAlg()); - if (keyEncryptionAlgorithms == null) { - LOG.error("Received invalid algorithm in `request_object_encryption_alg` property. Value: " + params.getRequestObjectEncryptionAlg()); - throw new HttpException(ErrorResponseCode.INVALID_KEY_ENCRYPTION_ALGORITHM); - } - request.setRequestObjectEncryptionAlg(keyEncryptionAlgorithms); - } - - if (!Strings.isNullOrEmpty(params.getRequestObjectEncryptionEnc())) { - BlockEncryptionAlgorithm blockEncryptionAlgorithms = BlockEncryptionAlgorithm.fromName(params.getRequestObjectEncryptionEnc()); - if (blockEncryptionAlgorithms == null) { - LOG.error("Received invalid algorithm in `request_object_encryption_enc` property. Value: " + params.getRequestObjectEncryptionEnc()); - throw new HttpException(ErrorResponseCode.INVALID_BLOCK_ENCRYPTION_ALGORITHM); - } - request.setRequestObjectEncryptionEnc(blockEncryptionAlgorithms); - } - - if (params.getDefaultMaxAge() != null && NumberUtils.isNumber(params.getDefaultMaxAge().toString())) { - request.setDefaultMaxAge(params.getDefaultMaxAge()); - } - - if (!Strings.isNullOrEmpty(params.getInitiateLoginUri())) { - request.setInitiateLoginUri(params.getInitiateLoginUri()); - } - - if (params.getAuthorizedOrigins() != null && !params.getAuthorizedOrigins().isEmpty()) { - request.setAuthorizedOrigins(params.getAuthorizedOrigins()); - } - - if (params.getAccessTokenLifetime() != null && NumberUtils.isNumber(params.getAccessTokenLifetime().toString())) { - request.setAccessTokenLifetime(params.getAccessTokenLifetime()); - } - - if (!Strings.isNullOrEmpty(params.getSoftwareId())) { - request.setSoftwareId(params.getSoftwareId()); - } - - if (!Strings.isNullOrEmpty(params.getSoftwareVersion())) { - request.setSoftwareVersion(params.getSoftwareVersion()); - } - - if (!Strings.isNullOrEmpty(params.getSoftwareStatement())) { - request.setSoftwareStatement(params.getSoftwareStatement()); - } - - if (params.getAllowSpontaneousScopes() != null) { - request.setAllowSpontaneousScopes(params.getAllowSpontaneousScopes()); - } - - if (CollectionUtils.isNotEmpty(params.getSpontaneousScopes())) { - request.setSpontaneousScopes(params.getSpontaneousScopes()); - } - - if (params.getCustomAttributes() != null && !params.getCustomAttributes().isEmpty()) { - params.getCustomAttributes().entrySet().removeIf(entry -> entry.getKey().contains("oxAuthTrustedClient")); - params.getCustomAttributes().entrySet().stream().forEach(e -> { - request.addCustomAttribute(e.getKey(), e.getValue()); - }); - } - - if (StringUtils.isNotBlank(rp.getRpId())) { - request.addCustomAttribute("rp_id", rp.getRpId()); - } - - return request; - } -} \ No newline at end of file diff --git a/jans-client-api/server/src/main/java/io/jans/ca/server/op/ValidateOperation.java b/jans-client-api/server/src/main/java/io/jans/ca/server/op/ValidateOperation.java deleted file mode 100644 index f3fe1cc6d1f..00000000000 --- a/jans-client-api/server/src/main/java/io/jans/ca/server/op/ValidateOperation.java +++ /dev/null @@ -1,83 +0,0 @@ -package io.jans.ca.server.op; - -import com.google.common.base.Strings; -import io.jans.as.client.OpenIdConfigurationResponse; -import io.jans.as.model.jwt.Jwt; -import io.jans.ca.common.ErrorResponseCode; -import io.jans.ca.common.params.ValidateParams; -import io.jans.ca.common.response.IOpResponse; -import io.jans.ca.common.response.POJOResponse; -import io.jans.ca.server.HttpException; -import io.jans.ca.server.configuration.model.Rp; -import io.jans.ca.server.service.DiscoveryService; -import io.jans.ca.server.service.PublicOpKeyService; -import io.jans.ca.server.service.StateService; -import jakarta.enterprise.context.RequestScoped; -import jakarta.inject.Inject; -import jakarta.inject.Named; -import jakarta.servlet.http.HttpServletRequest; -import jakarta.ws.rs.core.MediaType; - -@RequestScoped -@Named -public class ValidateOperation extends BaseOperation { - - @Inject - DiscoveryService discoveryService; - @Inject - PublicOpKeyService publicOpKeyService; - @Inject - StateService stateService; - @Inject - OpClientFactoryImpl opClientFactory; - - @Override - public IOpResponse execute(ValidateParams params, HttpServletRequest httpServletRequest) throws Exception { - validateParams(params); - - Rp rp = getRp(params); - OpenIdConfigurationResponse discoveryResponse = discoveryService.getConnectDiscoveryResponseByRpId(params.getRpId()); - - final Jwt idToken = Jwt.parse(params.getIdToken()); - - final Validator validator = new Validator.Builder() - .discoveryResponse(discoveryResponse) - .idToken(idToken) - .keyService(publicOpKeyService) - .opClientFactory(opClientFactory) - .rpServerConfiguration(getJansConfigurationService().find()) - .rp(rp) - .build(); - validator.validateNonce(stateService); - validator.validateIdToken(rp.getClientId()); - validator.validateAccessToken(params.getAccessToken()); - validator.validateAuthorizationCode(params.getCode()); - - return new POJOResponse(""); - } - - @Override - public Class getParameterClass() { - return ValidateParams.class; - } - - @Override - public String getReturnType() { - return MediaType.APPLICATION_JSON; - } - - private void validateParams(ValidateParams params) { - if (Strings.isNullOrEmpty(params.getCode())) { - throw new HttpException(ErrorResponseCode.BAD_REQUEST_NO_CODE); - } - if (Strings.isNullOrEmpty(params.getState())) { - throw new HttpException(ErrorResponseCode.BAD_REQUEST_NO_STATE); - } - if (!stateService.isExpiredObjectPresent(params.getState())) { - throw new HttpException(ErrorResponseCode.BAD_REQUEST_STATE_NOT_VALID); - } - if (!Strings.isNullOrEmpty(params.getIdToken())) { - throw new HttpException(ErrorResponseCode.NO_ID_TOKEN_PARAM); - } - } -} diff --git a/jans-client-api/server/src/main/java/io/jans/ca/server/op/Validator.java b/jans-client-api/server/src/main/java/io/jans/ca/server/op/Validator.java deleted file mode 100644 index c48fc55f610..00000000000 --- a/jans-client-api/server/src/main/java/io/jans/ca/server/op/Validator.java +++ /dev/null @@ -1,415 +0,0 @@ -package io.jans.ca.server.op; - -import com.google.common.base.Preconditions; -import com.google.common.base.Strings; -import com.google.common.collect.Lists; -import io.jans.as.client.OpenIdConfigurationResponse; -import io.jans.as.model.crypto.signature.AlgorithmFamily; -import io.jans.as.model.crypto.signature.ECDSAPublicKey; -import io.jans.as.model.crypto.signature.RSAPublicKey; -import io.jans.as.model.crypto.signature.SignatureAlgorithm; -import io.jans.as.model.jwk.Use; -import io.jans.as.model.jws.AbstractJwsSigner; -import io.jans.as.model.jws.ECDSASigner; -import io.jans.as.model.jws.HMACSigner; -import io.jans.as.model.jwt.Jwt; -import io.jans.as.model.jwt.JwtClaimName; -import io.jans.as.model.jwt.JwtHeaderName; -import io.jans.ca.common.ErrorResponseCode; -import io.jans.ca.server.HttpException; -import io.jans.ca.server.configuration.ApiAppConfiguration; -import io.jans.ca.server.configuration.model.Rp; -import io.jans.ca.server.service.PublicOpKeyService; -import io.jans.ca.server.service.StateService; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import java.security.SignatureException; -import java.util.Date; -import java.util.List; -import java.util.concurrent.TimeUnit; - -/** - * @author Yuriy Zabrovarnyy - * @version 0.9, 14/03/2017 - */ - -public class Validator { - - private static final Logger LOG = LoggerFactory.getLogger(Validator.class); - - private final OpenIdConfigurationResponse discoveryResponse; - private ApiAppConfiguration configuration; - private AbstractJwsSigner jwsSigner; - private final Jwt idToken; - private OpClientFactory opClientFactory; - private final PublicOpKeyService keyService; - private final Rp rp; - - public OpenIdConfigurationResponse getDiscoveryResponse() { - return discoveryResponse; - } - - public ApiAppConfiguration getConfiguration() { - return configuration; - } - - public AbstractJwsSigner getJwsSigner() { - return jwsSigner; - } - - public OpClientFactory getOpClientFactory() { - return opClientFactory; - } - - public PublicOpKeyService getKeyService() { - return keyService; - } - - public Rp getRp() { - return rp; - } - - private Validator(Builder builder) { - this.discoveryResponse = builder.discoveryResponse; - this.configuration = builder.configuration; - this.idToken = builder.idToken; - this.opClientFactory = builder.opClientFactory; - this.keyService = builder.keyService; - this.rp = builder.rp; - this.jwsSigner = createJwsSigner(idToken, discoveryResponse, keyService, opClientFactory, rp, configuration); - } - - //Builder Class - public static class Builder { - - // required parameters - private OpenIdConfigurationResponse discoveryResponse; - private ApiAppConfiguration configuration; - private Jwt idToken; - private OpClientFactory opClientFactory; - private PublicOpKeyService keyService; - private Rp rp; - - public Builder() { - } - - public Builder discoveryResponse(OpenIdConfigurationResponse discoveryResponse) { - this.discoveryResponse = discoveryResponse; - return this; - } - - public Builder rpServerConfiguration(ApiAppConfiguration configuration) { - this.configuration = configuration; - return this; - } - - public Builder idToken(Jwt idToken) { - this.idToken = idToken; - return this; - } - - public Builder opClientFactory(OpClientFactory opClientFactory) { - this.opClientFactory = opClientFactory; - return this; - } - - public Builder keyService(PublicOpKeyService keyService) { - this.keyService = keyService; - return this; - } - - public Builder rp(Rp rp) { - this.rp = rp; - return this; - } - - public Validator build() { - Preconditions.checkNotNull(this.idToken); - Preconditions.checkNotNull(this.discoveryResponse); - - return new Validator(this); - } - } - - public void validateAccessToken(String accessToken) { - validateAccessToken(accessToken, false); - } - - // `at_hash` in ID_TOKEN is mandatory for response_type='id_token token' for Implicit Flow or response_type='code id_token token' for Hybrid Flow. - public void validateAccessToken(String accessToken, boolean atHashRequired) { - - if (!configuration.getIdTokenValidationAtHashRequired()) { - return; - } - - if (Strings.isNullOrEmpty(accessToken)) { - return; - } - - String atHash = idToken.getClaims().getClaimAsString("at_hash"); - if (Strings.isNullOrEmpty(atHash)) { - if (atHashRequired) { - LOG.error("`at_hash` is missing in `ID_TOKEN`."); - throw new HttpException(ErrorResponseCode.AT_HASH_NOT_FOUND); - } else { - LOG.warn("Skip access_token validation because corresponding id_token does not have at_hash claim. access_token: " + accessToken + ", id_token: " + idToken); - return; - } - } - if (!jwsSigner.validateAccessToken(accessToken, idToken)) { - LOG.error("Hash from id_token does not match hash of the access_token (at_hash). access_token:" + accessToken + ", idToken: " + idToken + ", at_hash:" + atHash); - throw new HttpException(ErrorResponseCode.INVALID_ACCESS_TOKEN_BAD_HASH); - } - } - - public void validateState(String state) { - - if (!configuration.getIdTokenValidationSHashRequired()) { - return; - } - - if (Strings.isNullOrEmpty(state)) { - return; - } - - String sHash = idToken.getClaims().getClaimAsString("s_hash"); - if (Strings.isNullOrEmpty(sHash)) { - LOG.error("`s_hash` is missing in `ID_TOKEN`."); - throw new HttpException(ErrorResponseCode.S_HASH_NOT_FOUND); - } - if (!jwsSigner.validateState(state, idToken)) { - LOG.error("Hash from id_token does not match hash of the state (s_hash). state:" + state + ", idToken: " + idToken + ", sHash:" + sHash); - throw new HttpException(ErrorResponseCode.INVALID_STATE_BAD_HASH); - } - } - - public void validateAuthorizationCode(String code) { - if (!configuration.getIdTokenValidationCHashRequired()) { - return; - } - - if (Strings.isNullOrEmpty(code)) { - return; - } - - if (Strings.isNullOrEmpty(idToken.getClaims().getClaimAsString("c_hash"))) { - LOG.error("`c_hash` is missing in `ID_TOKEN`."); - throw new HttpException(ErrorResponseCode.C_HASH_NOT_FOUND); - } - if (!jwsSigner.validateAuthorizationCode(code, idToken)) { - LOG.error("`Authorization code is invalid. Hash of authorization code does not match hash from id_token (c_hash)."); - throw new HttpException(ErrorResponseCode.INVALID_AUTHORIZATION_CODE_BAD_HASH); - } - } - - public static AbstractJwsSigner createJwsSigner(Jwt idToken, OpenIdConfigurationResponse discoveryResponse, PublicOpKeyService keyService, OpClientFactory opClientFactory, Rp rp, ApiAppConfiguration configuration) { - final String algorithm = idToken.getHeader().getClaimAsString(JwtHeaderName.ALGORITHM); - final SignatureAlgorithm signatureAlgorithm = SignatureAlgorithm.fromString(algorithm); - final String jwkUrl = discoveryResponse.getJwksUri(); - String kid = idToken.getHeader().getClaimAsString(JwtHeaderName.KEY_ID); - - if (signatureAlgorithm == null) - throw new HttpException(ErrorResponseCode.INVALID_ALGORITHM); - - if (Strings.isNullOrEmpty(kid) && (signatureAlgorithm.getFamily() == AlgorithmFamily.RSA || signatureAlgorithm.getFamily() == AlgorithmFamily.EC)) { - LOG.warn("Warning:`kid` is missing in id_token header. jans-client-apì will throw error if RP is unable to determine the key to used for `id_token` validation."); - } - if (signatureAlgorithm == SignatureAlgorithm.NONE) { - - if (!configuration.getAcceptIdTokenWithoutSignature()) { - LOG.error("`ID_TOKEN` without signature is not allowed. To allow `ID_TOKEN` without signature set `accept_id_token_without_signature` field to 'true' in client-api-server.yml."); - throw new HttpException(ErrorResponseCode.ID_TOKEN_WITHOUT_SIGNATURE_NOT_ALLOWED); - } - - return new AbstractJwsSigner(signatureAlgorithm) { - @Override - public String generateSignature(String signingInput) throws SignatureException { - return null; - } - - @Override - public boolean validateSignature(String signingInput, String signature) throws SignatureException { - return true; - } - }; - } else if (signatureAlgorithm.getFamily() == AlgorithmFamily.RSA) { - final RSAPublicKey publicKey = (RSAPublicKey) keyService.getPublicKey(jwkUrl, kid, signatureAlgorithm, Use.SIGNATURE); - return opClientFactory.createRSASigner(signatureAlgorithm, publicKey); - } else if (signatureAlgorithm.getFamily() == AlgorithmFamily.HMAC) { - return new HMACSigner(signatureAlgorithm, rp.getClientSecret()); - } else if (signatureAlgorithm.getFamily() == AlgorithmFamily.EC) { - final ECDSAPublicKey publicKey = (ECDSAPublicKey) keyService.getPublicKey(jwkUrl, kid, signatureAlgorithm, Use.SIGNATURE); - return new ECDSASigner(signatureAlgorithm, publicKey); - } - throw new HttpException(ErrorResponseCode.ALGORITHM_NOT_SUPPORTED); - } - - public void validateNonce(StateService stateService) { - final String nonceFromToken = idToken.getClaims().getClaimAsString(JwtClaimName.NONCE); - if (!stateService.isExpiredObjectPresent(nonceFromToken)) { - LOG.error("Nonce value from `id_token` is not registered with jans-client-apì."); - throw new HttpException(ErrorResponseCode.INVALID_NONCE); - } - } - - public boolean isIdTokenValid(String nonce) { - try { - validateIdToken(nonce); - return true; - } catch (Exception e) { - return false; - } - } - - public void validateIdToken() { - validateIdToken(null); - } - - public void validateIdToken(String nonce) { - try { - final String issuer = idToken.getClaims().getClaimAsString(JwtClaimName.ISSUER); - final String sub = idToken.getClaims().getClaimAsString(JwtClaimName.SUBJECT_IDENTIFIER); - final String nonceFromToken = idToken.getClaims().getClaimAsString(JwtClaimName.NONCE); - final String clientId = rp.getClientId(); - //validate nonce - if(configuration.getFapiEnabled() && Strings.isNullOrEmpty(nonceFromToken)) { - LOG.error("Nonce is missing from id_token."); - throw new HttpException(ErrorResponseCode.INVALID_ID_TOKEN_NO_NONCE); - } - - if (!Strings.isNullOrEmpty(nonce) && !nonceFromToken.endsWith(nonce)) { - LOG.error("ID Token has invalid nonce. Expected nonce: " + nonce + ", nonce from token is: " + nonceFromToken); - throw new HttpException(ErrorResponseCode.INVALID_ID_TOKEN_BAD_NONCE); - } - //validate audience - validateAudience(idToken, clientId); - - //validate subject identifier - if (Strings.isNullOrEmpty(sub)) { - LOG.error("ID Token is missing `sub` value."); - throw new HttpException(ErrorResponseCode.NO_SUBJECT_IDENTIFIER); - } - - //validate id_token issued at date - final Date issuedAt = idToken.getClaims().getClaimAsDate(JwtClaimName.ISSUED_AT); - if (issuedAt == null) { - LOG.error("`ISSUED_AT` date is either invalid or missing from `ID_TOKEN`."); - throw new HttpException(ErrorResponseCode.INVALID_ID_TOKEN_ISSUED_AT); - } - - final Date now = new Date(); - if (configuration.getFapiEnabled() && TimeUnit.MILLISECONDS.toHours(now.getTime() - issuedAt.getTime()) > configuration.getIatExpirationInHours()) { - LOG.error("`ISSUED_AT` date too far in the past. iat : " + issuedAt + " now : " + now + ")."); - throw new HttpException(ErrorResponseCode.INVALID_ID_TOKEN_OLD_ISSUED_AT); - } - - //validate id_token expire date - final Date expiresAt = idToken.getClaims().getClaimAsDate(JwtClaimName.EXPIRATION_TIME); - - if (expiresAt == null) { - LOG.error("EXPIRATION_TIME (`exp`) is either invalid or missing from `ID_TOKEN`."); - throw new HttpException(ErrorResponseCode.INVALID_ID_TOKEN_EXPIRATION_TIME); - } - - if (now.after(expiresAt)) { - LOG.error("ID Token is expired. (" + expiresAt + " is before " + now + ")."); - throw new HttpException(ErrorResponseCode.INVALID_ID_TOKEN_EXPIRED); - } - - // 1. validate issuer - if (Strings.isNullOrEmpty(issuer)) { - LOG.error("Issuer (`iss`) claim is missing from id_token."); - throw new HttpException(ErrorResponseCode.INVALID_ID_TOKEN_NO_ISSUER); - } - - if (!issuer.equals(discoveryResponse.getIssuer())) { - LOG.error("ID Token issuer is invalid. Token issuer: " + issuer + ", discovery issuer: " + discoveryResponse.getIssuer()); - throw new HttpException(ErrorResponseCode.INVALID_ID_TOKEN_BAD_ISSUER); - } - - //validate signature - final String algorithm = idToken.getHeader().getClaimAsString(JwtHeaderName.ALGORITHM); - final SignatureAlgorithm signatureAlgorithm = SignatureAlgorithm.fromString(algorithm); - //validate algorithm - if (!Strings.isNullOrEmpty(rp.getIdTokenSignedResponseAlg()) && - SignatureAlgorithm.fromString(rp.getIdTokenSignedResponseAlg()) != signatureAlgorithm) { - LOG.error("The algorithm used to sign the ID Token does not matches with `id_token_signed_response_alg` algorithm set during client registration.Expected: {}, Got: {}", rp.getIdTokenSignedResponseAlg(), algorithm); - throw new HttpException(ErrorResponseCode.INVALID_ID_TOKEN_INVALID_ALGORITHM); - } - if (signatureAlgorithm != SignatureAlgorithm.NONE) { - boolean signature = jwsSigner.validate(idToken); - - if (!signature) { - LOG.error("ID Token signature is invalid."); - throw new HttpException(ErrorResponseCode.INVALID_ID_TOKEN_BAD_SIGNATURE); - } - } - } catch (HttpException e) { - throw e; - } catch (Exception e) { - LOG.error(e.getMessage(), e); - throw new HttpException(ErrorResponseCode.INVALID_ID_TOKEN_UNKNOWN); - } - } - - //Added this method so that we can write the test cases - public static void validateAudience(Jwt idToken, String clientId) { - - final String audienceFromToken = idToken.getClaims().getClaimAsString(JwtClaimName.AUDIENCE); - - if (Strings.isNullOrEmpty(audienceFromToken)) { - LOG.error("The audience (`aud`) claim is missing from ID Token."); - throw new HttpException(ErrorResponseCode.INVALID_ID_TOKEN_NO_AUDIENCE); - } - - if (!clientId.equalsIgnoreCase(audienceFromToken)) { - List audAsList = idToken.getClaims().getClaimAsStringList(JwtClaimName.AUDIENCE); - - if (audAsList != null && !audAsList.isEmpty()) { - //check for element in list format - if (hasListAsElement(audAsList)) { - audAsList = arrStringToList(audAsList.get(0)); - } - - if (!audAsList.stream().anyMatch(aud -> clientId.equalsIgnoreCase(aud))) { - LOG.error("ID Token has invalid audience (string list). Expected audience: " + clientId + ", audience from token is: " + audAsList); - throw new HttpException(ErrorResponseCode.INVALID_ID_TOKEN_BAD_AUDIENCE); - } - - if (audAsList.size() > 1) { - String azpFromToken = idToken.getClaims().getClaimAsString(JwtClaimName.AUTHORIZED_PARTY); - //If the ID Token contains multiple audiences, the Client SHOULD verify that an azp Claim is present. - if(Strings.isNullOrEmpty(azpFromToken)) { - LOG.error("The ID Token has multiple audiences. Authorized party (`azp`) is missing in ID Token."); - throw new HttpException(ErrorResponseCode.INVALID_ID_TOKEN_NO_AUTHORIZED_PARTY); - } - //If an azp (authorized party) Claim is present, the Client SHOULD verify that its client_id is the Claim Value. If present, it MUST contain the OAuth 2.0 Client ID of this party. - if (!Strings.isNullOrEmpty(azpFromToken) && !azpFromToken.equalsIgnoreCase(clientId)) { - LOG.error("ID Token has invalid authorized party (string list). Expected authorized party: " + clientId + ", authorized party from token is: " + azpFromToken); - throw new HttpException(ErrorResponseCode.INVALID_ID_TOKEN_BAD_AUTHORIZED_PARTY); - } - } - } - } - } - - public static boolean hasListAsElement(List audAsList) { - if (audAsList.size() == 1 && audAsList.get(0).contains("[") && audAsList.get(0).contains("]")) { - return true; - } - return false; - } - - public static List arrStringToList(String input) { - if (!Strings.isNullOrEmpty(input)) { - input = input.replaceAll("\"", "").replaceAll("\\[", "").replaceAll("\\]", ""); - return Lists.newArrayList(input.split("\\s*,\\s*")); - } - throw new HttpException(ErrorResponseCode.INVALID_ID_TOKEN_BAD_AUDIENCE); - } - - public Jwt getIdToken() { - return idToken; - } -} diff --git a/jans-client-api/server/src/main/java/io/jans/ca/server/persistence/configuration/H2Configuration.java b/jans-client-api/server/src/main/java/io/jans/ca/server/persistence/configuration/H2Configuration.java deleted file mode 100644 index b69f6f00062..00000000000 --- a/jans-client-api/server/src/main/java/io/jans/ca/server/persistence/configuration/H2Configuration.java +++ /dev/null @@ -1,50 +0,0 @@ -package io.jans.ca.server.persistence.configuration; - -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; - -import java.io.Serializable; - -/** - * @author yuriyz - */ -@JsonIgnoreProperties( - ignoreUnknown = true -) -public class H2Configuration implements Serializable { - - private String dbFileLocation; - private String username; - private String password; - - public String getDbFileLocation() { - return dbFileLocation; - } - - public void setDbFileLocation(String dbFileLocation) { - this.dbFileLocation = dbFileLocation; - } - - public String getUsername() { - return username; - } - - public void setUsername(String username) { - this.username = username; - } - - public String getPassword() { - return password; - } - - public void setPassword(String password) { - this.password = password; - } - - @Override - public String toString() { - return "H2Configuration{" + - "dbFileLocation='" + dbFileLocation + '\'' + - ", username='" + username + '\'' + - '}'; - } -} diff --git a/jans-client-api/server/src/main/java/io/jans/ca/server/persistence/configuration/JDBCConfiguration.java b/jans-client-api/server/src/main/java/io/jans/ca/server/persistence/configuration/JDBCConfiguration.java deleted file mode 100644 index dac447e530d..00000000000 --- a/jans-client-api/server/src/main/java/io/jans/ca/server/persistence/configuration/JDBCConfiguration.java +++ /dev/null @@ -1,56 +0,0 @@ -package io.jans.ca.server.persistence.configuration; - -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; - -@JsonIgnoreProperties( - ignoreUnknown = true -) -public class JDBCConfiguration { - - private String driver; - private String jdbcUrl; - private String username; - private String password; - - public String getDriver() { - return driver; - } - - public void setDriver(String driver) { - this.driver = driver; - } - - public String getJdbcUrl() { - return jdbcUrl; - } - - public void setJdbcUrl(String jdbcUrl) { - this.jdbcUrl = jdbcUrl; - } - - public String getUsername() { - return username; - } - - public void setUsername(String username) { - this.username = username; - } - - public String getPassword() { - return password; - } - - public void setPassword(String password) { - this.password = password; - } - - @Override - public String toString() { - return "JDBCConfiguration{" + - "driver='" + driver + '\'' + - ", jdbcUrl='" + jdbcUrl + '\'' + - ", username='" + username + '\'' + - ", password='" + password + '\'' + - '}'; - } -} diff --git a/jans-client-api/server/src/main/java/io/jans/ca/server/persistence/modal/OrganizationBranch.java b/jans-client-api/server/src/main/java/io/jans/ca/server/persistence/modal/OrganizationBranch.java deleted file mode 100644 index 0e0245254c5..00000000000 --- a/jans-client-api/server/src/main/java/io/jans/ca/server/persistence/modal/OrganizationBranch.java +++ /dev/null @@ -1,43 +0,0 @@ -package io.jans.ca.server.persistence.modal; - -import io.jans.orm.annotation.AttributeName; -import io.jans.orm.annotation.DataEntry; -import io.jans.orm.annotation.ObjectClass; -import io.jans.orm.model.base.BaseEntry; - -import java.io.Serializable; - -@DataEntry -@ObjectClass("organization") -public class OrganizationBranch extends BaseEntry implements Serializable { - private static final long serialVersionUID = -1311006812730222719L; - - @AttributeName( - name = "o" - ) - private String organizationName; - - public OrganizationBranch() { - } - - public OrganizationBranch(String dn) { - this.setDn(dn); - } - - public OrganizationBranch(String dn, String organizationName) { - this(dn); - this.organizationName = organizationName; - } - - public String getOrganizationName() { - return organizationName; - } - - public void setOrganizationName(String organizationName) { - this.organizationName = organizationName; - } - - public String toString() { - return String.format("OrganizationBranch [organizationName=%s, toString()=%s]", this.organizationName, super.toString()); - } -} diff --git a/jans-client-api/server/src/main/java/io/jans/ca/server/persistence/modal/RpObject.java b/jans-client-api/server/src/main/java/io/jans/ca/server/persistence/modal/RpObject.java deleted file mode 100644 index b127fe7eac2..00000000000 --- a/jans-client-api/server/src/main/java/io/jans/ca/server/persistence/modal/RpObject.java +++ /dev/null @@ -1,57 +0,0 @@ -package io.jans.ca.server.persistence.modal; - -import io.jans.orm.annotation.*; - -import java.io.Serializable; - -@DataEntry -@ObjectClass("jansRp") -public class RpObject implements Serializable { - - @DN - private String dn; - @AttributeName(name = "jansId") - private String id; - @JsonObject - @AttributeName(name = "dat") - private String data; - - public RpObject(String dn, String id, String data) { - this.dn = dn; - this.id = id; - this.data = data; - } - - public RpObject() { - } - - public String getDn() { - return this.dn; - } - - public void setDn(String dn) { - this.dn = dn; - } - - public String getId() { - return this.id; - } - - public void setId(String id) { - this.id = id; - } - - public String getData() { - return this.data; - } - - public void setData(String data) { - this.data = data; - } - - public String toString() { - return "RpObject{dn='" + this.dn + '\'' + - ", id='" + this.id + '\'' + - ", data='" + this.data + '\'' + '}'; - } -} diff --git a/jans-client-api/server/src/main/java/io/jans/ca/server/persistence/providers/ClientApiPersistenceEntryManagerFactory.java b/jans-client-api/server/src/main/java/io/jans/ca/server/persistence/providers/ClientApiPersistenceEntryManagerFactory.java deleted file mode 100644 index 3f2fbe53e12..00000000000 --- a/jans-client-api/server/src/main/java/io/jans/ca/server/persistence/providers/ClientApiPersistenceEntryManagerFactory.java +++ /dev/null @@ -1,46 +0,0 @@ -package io.jans.ca.server.persistence.providers; - -import io.jans.exception.ConfigurationException; -import io.jans.orm.PersistenceEntryManager; -import io.jans.orm.PersistenceEntryManagerFactory; -import io.jans.orm.couchbase.impl.CouchbaseEntryManagerFactory; -import io.jans.orm.service.StandalonePersistanceFactoryService; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import java.util.Properties; - -public class ClientApiPersistenceEntryManagerFactory { - private static final Logger LOG = LoggerFactory.getLogger(ClientApiPersistenceEntryManagerFactory.class); - - private StandalonePersistanceFactoryService standalonePersistanceFactoryService; - - public ClientApiPersistenceEntryManagerFactory(){ - this.standalonePersistanceFactoryService = new StandalonePersistanceFactoryService(); - } - public final PersistenceEntryManager createPersistenceEntryManager(Properties properties, String persistenceType) { - - try { - PersistenceEntryManagerFactory persistenceEntryManagerFactory = this.standalonePersistanceFactoryService.getPersistenceEntryManagerFactory(persistenceType); - if (persistenceEntryManagerFactory.getPersistenceType().equalsIgnoreCase("couchbase")) { - ((CouchbaseEntryManagerFactory) persistenceEntryManagerFactory).create(); - } - Properties connProps = createConnectionProperties(properties, persistenceEntryManagerFactory.getPersistenceType()); - PersistenceEntryManager ret = persistenceEntryManagerFactory.createEntryManager(connProps); - if (ret == null) - throw new RuntimeException("Could not create persistence entry manager"); - return ret; - } catch (ConfigurationException e) { - throw new RuntimeException(e.getMessage(), e); - } - } - - private static final Properties createConnectionProperties(Properties properties, String connPrefix) { - - Properties connProps = new Properties(); - for (String propname : properties.stringPropertyNames()) { - connProps.setProperty(connPrefix + "#" + propname, properties.getProperty(propname)); - } - return connProps; - } -} diff --git a/jans-client-api/server/src/main/java/io/jans/ca/server/persistence/providers/H2PersistenceProvider.java b/jans-client-api/server/src/main/java/io/jans/ca/server/persistence/providers/H2PersistenceProvider.java deleted file mode 100644 index 6c29fbe0f94..00000000000 --- a/jans-client-api/server/src/main/java/io/jans/ca/server/persistence/providers/H2PersistenceProvider.java +++ /dev/null @@ -1,69 +0,0 @@ -package io.jans.ca.server.persistence.providers; - -import com.fasterxml.jackson.databind.JsonNode; -import com.google.common.base.Strings; -import io.jans.ca.common.Jackson2; -import io.jans.ca.server.configuration.ApiAppConfiguration; -import io.jans.ca.server.persistence.configuration.H2Configuration; -import org.h2.jdbcx.JdbcConnectionPool; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import java.sql.Connection; -import java.sql.SQLException; - -/** - * @author Yuriy Zabrovarnyy - * @version 0.9, 16/04/2017 - */ - -public class H2PersistenceProvider implements SqlPersistenceProvider { - - private static final Logger LOG = LoggerFactory.getLogger(H2PersistenceProvider.class); - - private ApiAppConfiguration configuration; - private JdbcConnectionPool pool = null; - - public H2PersistenceProvider(ApiAppConfiguration configuration) { - this.configuration = configuration; - } - - @Override - public void onCreate() { - H2Configuration h2Configuration = asH2Configuration(configuration); - setDefaultUsernamePasswordIfEmpty(h2Configuration); - pool = JdbcConnectionPool.create("jdbc:h2:file:" + h2Configuration.getDbFileLocation(), h2Configuration.getUsername(), h2Configuration.getPassword()); - } - - @Override - public void onDestroy() { - pool.dispose(); - } - - @Override - public Connection getConnection() throws SQLException { - return pool.getConnection(); - } - - public static H2Configuration asH2Configuration(ApiAppConfiguration configuration) { - try { - JsonNode node = configuration.getStorageConfiguration(); - if (node != null) { - return Jackson2.createJsonMapper().treeToValue(node, H2Configuration.class); - } - } catch (Exception e) { - LOG.error("Failed to parse H2Configuration.", e); - } - return new H2Configuration(); - } - - public void setDefaultUsernamePasswordIfEmpty(H2Configuration h2Configuration) { - if (Strings.isNullOrEmpty(h2Configuration.getUsername())) { - h2Configuration.setUsername("clientapi"); - } - - if (Strings.isNullOrEmpty(h2Configuration.getPassword())) { - h2Configuration.setPassword("clientapi"); - } - } -} diff --git a/jans-client-api/server/src/main/java/io/jans/ca/server/persistence/providers/JDBCPersistenceProvider.java b/jans-client-api/server/src/main/java/io/jans/ca/server/persistence/providers/JDBCPersistenceProvider.java deleted file mode 100644 index 43889a04c59..00000000000 --- a/jans-client-api/server/src/main/java/io/jans/ca/server/persistence/providers/JDBCPersistenceProvider.java +++ /dev/null @@ -1,95 +0,0 @@ -package io.jans.ca.server.persistence.providers; - -import com.fasterxml.jackson.core.JsonProcessingException; -import com.fasterxml.jackson.databind.JsonNode; -import com.google.common.base.Strings; -import io.jans.ca.common.Jackson2; -import io.jans.ca.server.configuration.ApiAppConfiguration; -import io.jans.ca.server.persistence.configuration.JDBCConfiguration; -import io.jans.ca.server.persistence.service.MainPersistenceService; -import org.apache.commons.dbcp.BasicDataSource; -import org.slf4j.Logger; - -import jakarta.enterprise.context.ApplicationScoped; -import jakarta.inject.Inject; - -import java.sql.Connection; -import java.sql.SQLException; - -import static io.jans.ca.server.configuration.ConfigurationFactory.CONFIGURATION_ENTRY_DN; - -@ApplicationScoped -public class JDBCPersistenceProvider implements SqlPersistenceProvider { - - @Inject - Logger logger; - - @Inject - MainPersistenceService jansConfigurationService; - private BasicDataSource dataSource = null; - - @Override - public void onCreate() { - try { - JDBCConfiguration jdbcConfiguration = asJDBCConfiguration(jansConfigurationService.find()); - validate(jdbcConfiguration); - - dataSource = new BasicDataSource(); - dataSource.setDriverClassName(jdbcConfiguration.getDriver()); - dataSource.setUrl(jdbcConfiguration.getJdbcUrl()); - dataSource.setUsername(jdbcConfiguration.getUsername()); - dataSource.setPassword(jdbcConfiguration.getPassword()); - - dataSource.setMinIdle(5); - dataSource.setMaxIdle(10); - dataSource.setMaxOpenPreparedStatements(100); - } catch (Exception e) { - logger.error("Error creating jdbc connection." + e.getMessage(), e); - } - } - - @Override - public void onDestroy() { - if (dataSource != null && !dataSource.isClosed()) { - try { - dataSource.close(); - } catch (SQLException e) { - logger.error("Failed to close JDBC dataSource.", e); - } - } - } - - @Override - public Connection getConnection() throws SQLException { - return dataSource.getConnection(); - } - - public JDBCConfiguration asJDBCConfiguration(ApiAppConfiguration configuration) throws IllegalArgumentException, JsonProcessingException { - JsonNode node = configuration.getStorageConfiguration(); - if (node != null) { - return Jackson2.createJsonMapper().treeToValue(node, JDBCConfiguration.class); - } - logger.error("JDBC Configuration not provided, check configuration: {}", CONFIGURATION_ENTRY_DN); - return null; - } - - private boolean validate(JDBCConfiguration jdbcConfiguration) { - if (jdbcConfiguration == null) { - logger.error("JDBC connection driver null or not provided."); - return false; - } - if (Strings.isNullOrEmpty(jdbcConfiguration.getDriver())) { - logger.error("JDBC connection driver not provided."); - return false; - } - if (Strings.isNullOrEmpty(jdbcConfiguration.getJdbcUrl())) { - logger.error("JDBC connection url not provided."); - return false; - } - if (Strings.isNullOrEmpty(jdbcConfiguration.getUsername())) { - logger.error("JDBC connection username not provided."); - return false; - } - return true; - } -} diff --git a/jans-client-api/server/src/main/java/io/jans/ca/server/persistence/providers/SqlPersistenceProvider.java b/jans-client-api/server/src/main/java/io/jans/ca/server/persistence/providers/SqlPersistenceProvider.java deleted file mode 100644 index 89242296c6c..00000000000 --- a/jans-client-api/server/src/main/java/io/jans/ca/server/persistence/providers/SqlPersistenceProvider.java +++ /dev/null @@ -1,18 +0,0 @@ -package io.jans.ca.server.persistence.providers; - -import java.sql.Connection; -import java.sql.SQLException; - -/** - * @author Yuriy Zabrovarnyy - * @version 0.9, 17/04/2017 - */ - -public interface SqlPersistenceProvider { - - void onCreate(); - - void onDestroy(); - - Connection getConnection() throws SQLException; -} diff --git a/jans-client-api/server/src/main/java/io/jans/ca/server/persistence/service/MainPersistenceService.java b/jans-client-api/server/src/main/java/io/jans/ca/server/persistence/service/MainPersistenceService.java deleted file mode 100644 index 760e48cf1e6..00000000000 --- a/jans-client-api/server/src/main/java/io/jans/ca/server/persistence/service/MainPersistenceService.java +++ /dev/null @@ -1,345 +0,0 @@ -/* - * Janssen Project software is available under the MIT License (2008). See http://opensource.org/licenses/MIT for full text. - * - * Copyright (c) 2020, Janssen Project - */ - -package io.jans.ca.server.persistence.service; - -import io.jans.as.common.service.common.ApplicationFactory; -import io.jans.as.persistence.model.configuration.GluuConfiguration; -import io.jans.ca.common.ExpiredObject; -import io.jans.ca.common.ExpiredObjectType; -import io.jans.ca.common.Jackson2; -import io.jans.ca.server.configuration.ApiAppConfiguration; -import io.jans.ca.server.configuration.ConfigurationFactory; -import io.jans.ca.server.configuration.model.ApiConf; -import io.jans.ca.server.configuration.model.Rp; -import io.jans.ca.server.persistence.modal.OrganizationBranch; -import io.jans.ca.server.persistence.modal.RpObject; -import io.jans.ca.server.service.MigrationService; -import io.jans.orm.PersistenceEntryManager; -import io.jans.orm.exception.EntryPersistenceException; -import io.jans.orm.model.base.SimpleBranch; -import io.jans.orm.search.filter.Filter; -import io.jans.util.StringHelper; -import jakarta.enterprise.context.ApplicationScoped; -import jakarta.inject.Inject; -import jakarta.inject.Named; -import org.slf4j.Logger; - -import java.util.*; - -import static io.jans.ca.server.configuration.ConfigurationFactory.CONFIGURATION_ENTRY_DN; - -/** - * @author Yuriy Zabrovarnyy - */ -@ApplicationScoped -public class MainPersistenceService implements PersistenceService { - - @Inject - @Named(ApplicationFactory.PERSISTENCE_ENTRY_MANAGER_NAME) - PersistenceEntryManager persistenceManager; - - @Inject - ConfigurationFactory configurationFactory; - - @Inject - Logger logger; - - private static final String BASE_DN = "o=jans"; - private static final String OU_CONFIGURATION = "configuration"; - private static final String OU_JANS_CLIENT_API = "jans-client-api"; - - private ApiAppConfiguration configuration; - - public ApiConf findConf() { - final String dn = configurationFactory.getConfigurationDn(CONFIGURATION_ENTRY_DN); - return persistenceManager.find(dn, ApiConf.class, null); - } - - public void mergeConfiguration(ApiConf conf) { - conf.setRevision(conf.getRevision() + 1); - persistenceManager.merge(conf); - } - - public void mergeGluuConfiguration(GluuConfiguration conf) { - persistenceManager.merge(conf); - } - - public ApiAppConfiguration find() { - return configurationFactory.getAppConfiguration(); - } - - public GluuConfiguration findGluuConfiguration() { - String configurationDn = findConf().getStaticConf().getBaseDn().getConfiguration(); - if (StringHelper.isEmpty(configurationDn)) { - return null; - } - return persistenceManager.find(GluuConfiguration.class, configurationDn); - } - - public String getPersistenceType() { - return configurationFactory.getBaseConfiguration().getString("persistence.type"); - } - - public void create() { - logger.debug("Creating JansPersistence for Api Client..."); - try { - this.configuration = find(); - prepareBranch(); - } catch (Exception e) { - throw new IllegalStateException("Error JansPersistence for Api Client", e); - } - } - - public void prepareBranch() { - - if (!this.persistenceManager.hasBranchesSupport(BASE_DN)) { - return; - } - //create `o=jans` if not present - if (!containsBranch(BASE_DN)) { - addOrganizationBranch(BASE_DN, null); - } - //create `ou=configuration,o=jans` if not present - if (!containsBranch(joinWithComma(ou(OU_CONFIGURATION), BASE_DN))) { - addBranch(joinWithComma(ou(OU_CONFIGURATION), BASE_DN), OU_CONFIGURATION); - } - //create `ou=client-api,ou=configuration,o=jans` if not present - if (!containsBranch(joinWithComma(ou(OU_JANS_CLIENT_API), ou(OU_CONFIGURATION), BASE_DN))) { - addBranch(joinWithComma(ou(OU_JANS_CLIENT_API), ou(OU_CONFIGURATION), BASE_DN), OU_JANS_CLIENT_API); - } - //create `ou=client-api,o=jans` if not present - if (!containsBranch(getClientApiDn())) { - addBranch(getClientApiDn(), "client-api"); - } - //create `ou=rp,ou=client-api,o=jans` if not present - if (!containsBranch(joinWithComma(getRpOu(), getClientApiDn()))) { - addBranch(joinWithComma(getRpOu(), getClientApiDn()), "rp"); - } - //create `ou=expiredObjects,ou=client-api,o=jans` if not present - if (!containsBranch(joinWithComma(getExpiredObjOu(), getClientApiDn()))) { - addBranch(joinWithComma(getExpiredObjOu(), getClientApiDn()), "expiredObjects"); - } - } - - private String joinWithComma(String... words) { - StringBuilder stringBuilder = new StringBuilder(); - String coma = ""; - for (String word : words) { - stringBuilder.append(coma + word); - coma = ","; - } - return stringBuilder.toString(); - } - - public boolean containsBranch(String dn) { - return this.persistenceManager.contains(dn, SimpleBranch.class); - } - - public void addOrganizationBranch(String dn, String oName) { - OrganizationBranch branch = new OrganizationBranch(); - branch.setOrganizationName(oName); - branch.setDn(dn); - - this.persistenceManager.persist(branch); - } - - public void addBranch(String dn, String ouName) { - SimpleBranch branch = new SimpleBranch(); - branch.setOrganizationalUnitName(ouName); - branch.setDn(dn); - - this.persistenceManager.persist(branch); - } - - public boolean create(Rp rp) { - try { - RpObject rpObj = new RpObject(getDnForRp(rp.getRpId()), rp.getRpId(), Jackson2.serializeWithoutNulls(rp)); - this.persistenceManager.persist(rpObj); - logger.debug("RP created successfully. RP : {} ", rp); - return true; - } catch (Exception e) { - logger.error("Failed to create RP: {} ", rp, e); - } - return false; - } - - public boolean createExpiredObject(ExpiredObject obj) { - try { - if (isExpiredObjectPresent(obj.getKey())) { - logger.warn("Expired_object already present. Object : {} ", obj.getKey()); - return true; - } - obj.setTypeString(obj.getType().getValue()); - obj.setDn(getDnForExpiredObj(obj.getKey())); - this.persistenceManager.persist(obj); - logger.debug("Expired_object created successfully. Object : {} ", obj.getKey()); - return true; - } catch (Exception e) { - logger.error("Failed to create ExpiredObject: {} ", obj.getKey(), e); - } - return false; - } - - public boolean update(Rp rp) { - try { - RpObject rpObj = new RpObject(getDnForRp(rp.getRpId()), rp.getRpId(), Jackson2.serializeWithoutNulls(rp)); - this.persistenceManager.merge(rpObj); - logger.debug("RP updated successfully. RP : {} ", rpObj); - return true; - } catch (Exception e) { - logger.error("Failed to update RP: {} ", rp, e); - } - return false; - } - - public Rp getRp(String rpId) { - try { - RpObject rpFromGluuPersistance = getRpObject(rpId); - - Rp rp = MigrationService.parseRp(rpFromGluuPersistance.getData()); - if (rp != null) { - logger.debug("Found RP id: {}, RP : {} ", rpId, rp); - return rp; - } - logger.error("Failed to fetch RP by id: {} ", rpId); - return null; - } catch (Exception e) { - logger.error("Failed to update rpId: {} ", rpId, e); - } - return null; - } - - private RpObject getRpObject(String rpId, String... returnAttributes) { - return this.persistenceManager.find(getDnForRp(rpId), RpObject.class, returnAttributes); - } - - public ExpiredObject getExpiredObject(String key) { - try { - ExpiredObject expiredObject = this.persistenceManager.find(getDnForExpiredObj(key), ExpiredObject.class, null); - if (expiredObject != null) { - expiredObject.setType(ExpiredObjectType.fromValue(expiredObject.getTypeString())); - logger.debug("Found ExpiredObject id: {} , ExpiredObject : {} ", key, expiredObject); - return expiredObject; - } - - logger.error("Failed to fetch ExpiredObject by id: {} ", key); - return null; - } catch (Exception e) { - if ((e instanceof EntryPersistenceException) && (e.getMessage().contains("Failed to find entry"))) { - logger.warn("Failed to fetch ExpiredObject by id: {}. {} ", key, e.getMessage()); - return null; - } - logger.error("Failed to fetch ExpiredObject by id: {} ", key, e); - } - return null; - } - - public boolean isExpiredObjectPresent(String key) { - return getExpiredObject(key) != null; - } - - public boolean removeAllRps() { - try { - this.persistenceManager.remove(joinWithComma(getRpOu(), getClientApiDn()), RpObject.class, null, this.configuration.getPersistenceManagerRemoveCount()); - logger.debug("Removed all Rps successfully. "); - return true; - } catch (Exception e) { - logger.error("Failed to remove all Rps", e); - } - return false; - } - - public Set getRps() { - Set result = new HashSet<>(); - try { - List rpObjects = this.persistenceManager.findEntries(joinWithComma(getRpOu(), getClientApiDn()), RpObject.class, null); - for (RpObject ele : rpObjects) { - Rp rp = MigrationService.parseRp(ele.getData()); - if (rp != null) { - result.add(rp); - } else { - logger.error("Failed to parse rp, id: {}, dn: {} ", ele.getId(), ele.getDn()); - } - } - return result; - } catch (Exception e) { - if ((e instanceof EntryPersistenceException) && (e.getMessage().contains("Failed to find entries"))) { - logger.warn("Failed to fetch RpObjects. {} ", e.getMessage()); - return new HashSet<>(); - } - logger.error("Failed to fetch rps. Error: {} ", e.getMessage(), e); - } - return result; - } - - public void destroy() { - this.persistenceManager.destroy(); - } - - public boolean remove(String rpId) { - try { - this.persistenceManager.remove(getDnForRp(rpId), RpObject.class); - - logger.debug("Removed rp successfully. rpId: {} ", rpId); - return true; - } catch (Exception e) { - logger.error("Failed to remove rp with rpId: {} ", rpId, e); - } - return false; - } - - public boolean deleteExpiredObjectsByKey(String key) { - try { - this.persistenceManager.remove(getDnForExpiredObj(key), ExpiredObject.class); - logger.debug("Removed expired_objects successfully: {} ", key); - return true; - } catch (Exception e) { - logger.error("Failed to remove expired_objects: {} ", key, e); - } - return false; - } - - public boolean deleteAllExpiredObjects() { - try { - final Calendar cal = Calendar.getInstance(); - final Date currentTime = cal.getTime(); - Filter exirationDateFilter = Filter.createLessOrEqualFilter("exp", this.persistenceManager.encodeTime(BASE_DN, currentTime)); - - this.persistenceManager.remove(joinWithComma(getExpiredObjOu(), getClientApiDn()), ExpiredObject.class, exirationDateFilter, this.configuration.getPersistenceManagerRemoveCount()); - logger.debug("Removed all expired_objects successfully. "); - return true; - } catch (Exception e) { - logger.error("Failed to remove expired_objects. ", e); - } - return false; - } - - public String getDnForRp(String rpId) { - return "jansId=" + joinWithComma(rpId, getRpOu(), getClientApiDn()); - } - - public String getDnForExpiredObj(String rpId) { - return "rpId=" + joinWithComma(rpId, getExpiredObjOu(), getClientApiDn()); - } - - public String ou(String ouName) { - return String.format("ou=%s", ouName); - } - - private String getClientApiDn() { - return joinWithComma(ou("client-api"), BASE_DN); - } - - private String getRpOu() { - return ou("rp"); - } - - private String getExpiredObjOu() { - return ou("expiredObjects"); - } - -} diff --git a/jans-client-api/server/src/main/java/io/jans/ca/server/persistence/service/PersistenceService.java b/jans-client-api/server/src/main/java/io/jans/ca/server/persistence/service/PersistenceService.java deleted file mode 100644 index fe3b22cd79d..00000000000 --- a/jans-client-api/server/src/main/java/io/jans/ca/server/persistence/service/PersistenceService.java +++ /dev/null @@ -1,38 +0,0 @@ -package io.jans.ca.server.persistence.service; - -import io.jans.ca.common.ExpiredObject; -import io.jans.ca.server.configuration.model.Rp; - -import java.util.Set; - -/** - * @author yuriyz - */ -public interface PersistenceService { - - void create(); - - boolean create(Rp rp); - - boolean createExpiredObject(ExpiredObject obj); - - boolean update(Rp rp); - - Rp getRp(String rpId); - - ExpiredObject getExpiredObject(String key); - - boolean isExpiredObjectPresent(String key); - - boolean removeAllRps(); - - Set getRps(); - - void destroy(); - - boolean remove(String rpId); - - boolean deleteExpiredObjectsByKey(String key); - - boolean deleteAllExpiredObjects(); -} diff --git a/jans-client-api/server/src/main/java/io/jans/ca/server/persistence/service/PersistenceServiceImpl.java b/jans-client-api/server/src/main/java/io/jans/ca/server/persistence/service/PersistenceServiceImpl.java deleted file mode 100644 index 8d8e903e650..00000000000 --- a/jans-client-api/server/src/main/java/io/jans/ca/server/persistence/service/PersistenceServiceImpl.java +++ /dev/null @@ -1,101 +0,0 @@ -package io.jans.ca.server.persistence.service; - -import io.jans.ca.common.ExpiredObject; -import io.jans.ca.server.configuration.ApiAppConfiguration; -import io.jans.ca.server.configuration.model.Rp; -import io.jans.ca.server.persistence.providers.H2PersistenceProvider; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import jakarta.enterprise.context.ApplicationScoped; -import jakarta.inject.Inject; - -import java.util.Set; - -/** - * @author Yuriy Zabrovarnyy - */ -@ApplicationScoped -public class PersistenceServiceImpl { - - private static final Logger LOG = LoggerFactory.getLogger(PersistenceServiceImpl.class); - @Inject - MainPersistenceService jansConfigurationService; - private PersistenceService persistenceService; - - public void create() { - persistenceService = createServiceInstance(); - persistenceService.create(); - } - - private PersistenceService getPersistenceService() { - if (persistenceService == null) { - create(); - } - return persistenceService; - } - - private PersistenceService createServiceInstance() { - ApiAppConfiguration apiConf = this.jansConfigurationService.find(); - String storage = apiConf.getStorage(); - switch (storage) { - case "jans_server_configuration": - return jansConfigurationService; - case "h2": - return new SqlPersistenceServiceImpl(new H2PersistenceProvider(apiConf)); - case "redis": - return new RedisPersistenceService(apiConf); - default: - LOG.error("Failed to recognize persistence provider. Unrecognized storage specified: {}, full api configuration: {}", storage, apiConf); - return jansConfigurationService; - } - } - - public boolean create(Rp rp) { - return getPersistenceService().create(rp); - } - - public boolean createExpiredObject(ExpiredObject obj) { - return getPersistenceService().createExpiredObject(obj); - } - - public ExpiredObject getExpiredObject(String key) { - return getPersistenceService().getExpiredObject(key); - } - - public boolean isExpiredObjectPresent(String key) { - return getPersistenceService().isExpiredObjectPresent(key); - } - - public boolean update(Rp rp) { - return getPersistenceService().update(rp); - } - - public Rp getRp(String rpId) { - return getPersistenceService().getRp(rpId); - } - - public boolean removeAllRps() { - return getPersistenceService().removeAllRps(); - } - - public Set getRps() { - return getPersistenceService().getRps(); - } - - public boolean deleteExpiredObjectsByKey(String key) { - return getPersistenceService().deleteExpiredObjectsByKey(key); - } - - public boolean deleteAllExpiredObjects() { - return getPersistenceService().deleteAllExpiredObjects(); - } - - public void destroy() { - getPersistenceService().destroy(); - } - - public boolean remove(String rpId) { - return getPersistenceService().remove(rpId); - } -} diff --git a/jans-client-api/server/src/main/java/io/jans/ca/server/persistence/service/RedisPersistenceService.java b/jans-client-api/server/src/main/java/io/jans/ca/server/persistence/service/RedisPersistenceService.java deleted file mode 100644 index 11bf9a28eb1..00000000000 --- a/jans-client-api/server/src/main/java/io/jans/ca/server/persistence/service/RedisPersistenceService.java +++ /dev/null @@ -1,192 +0,0 @@ -package io.jans.ca.server.persistence.service; - -import com.fasterxml.jackson.databind.JsonNode; -import com.google.common.base.Strings; -import com.google.common.collect.Sets; -import io.jans.ca.common.ExpiredObject; -import io.jans.ca.common.Jackson2; -import io.jans.ca.server.configuration.ApiAppConfiguration; -import io.jans.ca.server.configuration.model.Rp; -import io.jans.ca.server.service.MigrationService; -import io.jans.service.cache.AbstractRedisProvider; -import io.jans.service.cache.RedisConfiguration; -import io.jans.service.cache.RedisProviderFactory; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import java.io.IOException; -import java.util.Set; - -/** - * @author yuriyz - */ -public class RedisPersistenceService implements PersistenceService { - - private static final Logger LOG = LoggerFactory.getLogger(RedisPersistenceService.class); - - private final ApiAppConfiguration configuration; - private AbstractRedisProvider redisProvider; - - public RedisPersistenceService(ApiAppConfiguration configuration) { - this.configuration = configuration; - } - - @Override - public void create() { - LOG.debug("Creating RedisPersistenceService ..."); - - try { - RedisConfiguration redisConfiguration = asRedisConfiguration(configuration); - - redisProvider = RedisProviderFactory.create(redisConfiguration); - redisProvider.create(); - LOG.debug("RedisPersistenceService started."); - } catch (Exception e) { - throw new IllegalStateException("Error starting RedisPersistenceService", e); - } - } - - @Override - public boolean create(Rp rp) { - try { - put(rp.getRpId(), Jackson2.serializeWithoutNulls(rp)); - return true; - } catch (IOException e) { - LOG.error("Failed to create RP: " + rp, e); - return false; - } - } - - public boolean createExpiredObject(ExpiredObject obj) { - try { - int objectExpirationInMinutes = 0; - - switch (obj.getType()) { - case STATE: - objectExpirationInMinutes = configuration.getStateExpirationInMinutes(); - break; - case NONCE: - objectExpirationInMinutes = configuration.getNonceExpirationInMinutes(); - break; - case REQUEST_OBJECT: - objectExpirationInMinutes = configuration.getRequestObjectExpirationInMinutes(); - break; - case JWKS: - objectExpirationInMinutes = configuration.getJwksExpirationInHours() * 60; - break; - } - - put(objectExpirationInMinutes * 60, obj.getKey(), obj.getValue()); - return true; - } catch (Exception e) { - LOG.error("Failed to create ExpiredObject: " + obj.getKey(), e); - return false; - } - } - - @Override - public boolean update(Rp rp) { - try { - put(rp.getRpId(), Jackson2.serializeWithoutNulls(rp)); - return true; - } catch (IOException e) { - LOG.error("Failed to create RP: " + rp, e); - return false; - } - } - - @Override - public Rp getRp(String rpId) { - return MigrationService.parseRp(get(rpId)); - } - - public ExpiredObject getExpiredObject(String key) { - String value = (String) redisProvider.get(key); - - if (!Strings.isNullOrEmpty(value)) { - ExpiredObject expiredObjectFromDb = null; - try { - expiredObjectFromDb = Jackson2.createJsonMapper().readValue(value, ExpiredObject.class); - } catch (IOException e) { - LOG.error("Error in assigning json value to ExpiredObject value attribute.", e); - expiredObjectFromDb = new ExpiredObject(); - } - ExpiredObject expiredObject = new ExpiredObject(key, value, expiredObjectFromDb.getType(), expiredObjectFromDb.getIat(), expiredObjectFromDb.getExp()); - - return expiredObject; - } - return null; - } - - public boolean isExpiredObjectPresent(String key) { - return getExpiredObject(key) != null; - } - - @Override - public boolean removeAllRps() { - return false; - } - - @Override - public Set getRps() { - return Sets.newHashSet(); - } - - @Override - public void destroy() { - LOG.debug("Destroying RedisProvider"); - - redisProvider.destroy(); - - LOG.debug("Destroyed RedisProvider"); - } - - @Override - public boolean remove(String rpId) { - redisProvider.remove(rpId); - return true; - } - - public boolean deleteExpiredObjectsByKey(String key) { - redisProvider.remove(key); - return true; - } - - public boolean deleteAllExpiredObjects() { - //Implementation not required. - return true; - } - - - private void testConnection() { - put("testKey", "testValue"); - if (!"testValue".equals(get("testKey"))) { - throw new RuntimeException("Failed to connect to redis server. Storage configuration: " + configuration.getStorageConfiguration()); - } - } - - public void put(String key, String value) { - redisProvider.put(key, value); - } - - public void put(int expirationInSeconds, String key, String value) { - redisProvider.put(expirationInSeconds, key, value); - } - - public String get(String key) { - return (String) redisProvider.get(key); - } - - public static RedisConfiguration asRedisConfiguration(ApiAppConfiguration configuration) throws Exception { - return asRedisConfiguration(Jackson2.asOldNode(configuration.getStorageConfiguration())); - } - - public static RedisConfiguration asRedisConfiguration(JsonNode node) throws Exception { - try { - return Jackson2.createJsonMapper().treeToValue(node, RedisConfiguration.class); - } catch (Exception e) { - LOG.error("Failed to parse RedisConfiguration.", e); - throw e; - } - } -} diff --git a/jans-client-api/server/src/main/java/io/jans/ca/server/persistence/service/SqlPersistenceServiceImpl.java b/jans-client-api/server/src/main/java/io/jans/ca/server/persistence/service/SqlPersistenceServiceImpl.java deleted file mode 100644 index 2abe5706717..00000000000 --- a/jans-client-api/server/src/main/java/io/jans/ca/server/persistence/service/SqlPersistenceServiceImpl.java +++ /dev/null @@ -1,349 +0,0 @@ -package io.jans.ca.server.persistence.service; - -import com.google.common.base.Strings; -import io.jans.ca.common.ExpiredObject; -import io.jans.ca.common.ExpiredObjectType; -import io.jans.ca.common.Jackson2; -import io.jans.ca.server.configuration.model.Rp; -import io.jans.ca.server.persistence.providers.SqlPersistenceProvider; -import io.jans.ca.server.service.MigrationService; -import org.h2.util.IOUtils; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import java.sql.*; -import java.util.HashSet; -import java.util.Set; - -/** - * @author yuriyz - */ -public class SqlPersistenceServiceImpl implements PersistenceService { - - private static final Logger LOG = LoggerFactory.getLogger(SqlPersistenceServiceImpl.class); - - private SqlPersistenceProvider provider; - - public SqlPersistenceServiceImpl(SqlPersistenceProvider provider) { - this.provider = provider; - } - - public void create() { - provider.onCreate(); - - createSchema(); - } - - private void createSchema() { - Connection conn = null; - try { - conn = provider.getConnection(); - conn.setAutoCommit(false); - - Statement stmt = conn.createStatement(); - - stmt.addBatch("create table if not exists rp(id varchar(36) primary key, data varchar(50000))"); - stmt.addBatch("create table if not exists expired_objects( obj_key varchar(50), obj_value varchar(50000), type varchar(20), iat TIMESTAMP NULL DEFAULT NULL, exp TIMESTAMP NULL DEFAULT NULL)"); - - stmt.executeBatch(); - - stmt.close(); - conn.commit(); - - LOG.debug("Schema created successfully."); - } catch (Exception e) { - LOG.error("Failed to create schema. Error: " + e.getMessage(), e); - rollbackSilently(conn); - throw new RuntimeException(e); - } finally { - IOUtils.closeSilently(conn); - } - } - - public boolean createExpiredObject(ExpiredObject obj) { - Connection conn = null; - PreparedStatement query = null; - try { - conn = provider.getConnection(); - conn.setAutoCommit(false); - query = conn.prepareStatement("insert into expired_objects(obj_key, obj_value, type, iat, exp) values(?, ?, ?, ?, ?)"); - query.setString(1, obj.getKey().trim()); - query.setString(2, obj.getValue().trim()); - query.setString(3, obj.getType().getValue()); - query.setTimestamp(4, new Timestamp(obj.getIat().getTime())); - query.setTimestamp(5, new Timestamp(obj.getExp().getTime())); - query.executeUpdate(); - query.close(); - - conn.commit(); - LOG.debug("Expired_object created successfully. Object : " + obj.getKey()); - - return true; - } catch (Exception e) { - LOG.error("Failed to create Expired_object: " + obj.getKey(), e); - rollbackSilently(conn); - return false; - } finally { - IOUtils.closeSilently(query); - IOUtils.closeSilently(conn); - } - } - - public boolean create(Rp rp) { - Connection conn = null; - try { - conn = provider.getConnection(); - conn.setAutoCommit(false); - PreparedStatement query = conn.prepareStatement("insert into rp(id, data) values(?, ?)"); - query.setString(1, rp.getRpId()); - query.setString(2, Jackson2.serializeWithoutNulls(rp)); - query.executeUpdate(); - query.close(); - - conn.commit(); - LOG.debug("RP created successfully. RP : " + rp); - return true; - } catch (Exception e) { - LOG.error("Failed to create RP: " + rp, e); - rollbackSilently(conn); - return false; - } finally { - IOUtils.closeSilently(conn); - } - } - - public boolean update(Rp rp) { - Connection conn = null; - try { - conn = provider.getConnection(); - conn.setAutoCommit(false); - PreparedStatement query = conn.prepareStatement("update rp set data = ? where id = ?"); - query.setString(1, Jackson2.serializeWithoutNulls(rp)); - query.setString(2, rp.getRpId()); - query.executeUpdate(); - query.close(); - - conn.commit(); - LOG.debug("RP updated successfully. RP : " + rp); - return true; - } catch (Exception e) { - LOG.error("Failed to update RP: " + rp, e); - rollbackSilently(conn); - return false; - } finally { - IOUtils.closeSilently(conn); - } - } - - public Rp getRp(String rpId) { - Connection conn = null; - try { - conn = provider.getConnection(); - conn.setAutoCommit(false); - - PreparedStatement query = conn.prepareStatement("select id, data from rp where id = ?"); - query.setString(1, rpId); - ResultSet rs = query.executeQuery(); - - rs.next(); - String data = rs.getString("data"); - query.close(); - conn.commit(); - - Rp rp = MigrationService.parseRp(data); - if (rp != null) { - LOG.debug("Found RP id: " + rpId + ", RP : " + rp); - return rp; - } else { - LOG.error("Failed to fetch RP by id: " + rpId); - return null; - } - } catch (Exception e) { - LOG.error("Failed to find RP by id: " + rpId + ". Error: " + e.getMessage(), e); - rollbackSilently(conn); - return null; - } finally { - IOUtils.closeSilently(conn); - } - } - - public ExpiredObject getExpiredObject(String key) { - - Connection conn = null; - PreparedStatement query = null; - try { - conn = provider.getConnection(); - conn.setAutoCommit(false); - query = conn.prepareStatement("select obj_key, obj_value, type, iat, exp from expired_objects where obj_key = ?"); - query.setString(1, key.trim()); - ResultSet rs = query.executeQuery(); - ExpiredObject expiredObject = null; - - rs.next(); - if (!Strings.isNullOrEmpty(rs.getString("obj_key"))) { - expiredObject = new ExpiredObject(rs.getString("obj_key"), rs.getString("obj_value"), ExpiredObjectType.fromValue(rs.getString("type")), new java.util.Date(rs.getTimestamp("iat").getTime()), new java.util.Date(rs.getTimestamp("exp").getTime())); - } - - query.close(); - conn.commit(); - - if (expiredObject != null) { - LOG.debug("Found ExpiredObject: " + expiredObject.getKey()); - return expiredObject; - } else { - LOG.error("ExpiredObject not found: " + key); - return expiredObject; - } - } catch (Exception e) { - LOG.error("Failed to find ExpiredObject: " + key + ". Error: " + e.getMessage(), e); - rollbackSilently(conn); - return null; - } finally { - IOUtils.closeSilently(query); - IOUtils.closeSilently(conn); - } - } - - public boolean isExpiredObjectPresent(String key) { - return getExpiredObject(key) != null; - } - - public boolean removeAllRps() { - Connection conn = null; - try { - conn = provider.getConnection(); - conn.setAutoCommit(false); - PreparedStatement query = conn.prepareStatement("delete from rp"); - query.executeUpdate(); - query.close(); - - conn.commit(); - LOG.debug("All RPs are removed successfully."); - return true; - } catch (Exception e) { - LOG.error("Failed to drop all RPs", e); - rollbackSilently(conn); - return false; - } finally { - IOUtils.closeSilently(conn); - } - } - - public Set getRps() { - Connection conn = null; - try { - conn = provider.getConnection(); - conn.setAutoCommit(false); - - PreparedStatement query = conn.prepareStatement("select id, data from rp"); - ResultSet rs = query.executeQuery(); - - Set result = new HashSet<>(); - while (rs.next()) { - String id = rs.getString("id"); - String data = rs.getString("data"); - - Rp rp = MigrationService.parseRp(data); - if (rp != null) { - result.add(rp); - } else { - LOG.error("Failed to parse rp, id: " + id); - } - } - - query.close(); - conn.commit(); - LOG.info("Loaded " + result.size() + " RPs."); - return result; - } catch (Exception e) { - LOG.error("Failed to fetch rps. Error: " + e.getMessage(), e); - rollbackSilently(conn); - throw new RuntimeException(e); - } finally { - IOUtils.closeSilently(conn); - } - } - - public static void rollbackSilently(Connection conn) { - try { - conn.rollback(); - } catch (SQLException e) { - LOG.error("Failed to rollback transaction, error: " + e.getMessage(), e); - } - } - - public void destroy() { - provider.onDestroy(); - } - - @Override - public boolean remove(String rpId) { - Connection conn = null; - try { - conn = provider.getConnection(); - conn.setAutoCommit(false); - - PreparedStatement query = conn.prepareStatement("delete from rp where id = ?"); - query.setString(1, rpId); - query.executeUpdate(); - query.close(); - - conn.commit(); - LOG.debug("Removed rp successfully. rpId: " + rpId); - return true; - } catch (Exception e) { - LOG.error("Failed to remove rp with rpId: " + rpId, e); - rollbackSilently(conn); - return false; - } finally { - IOUtils.closeSilently(conn); - } - } - - public boolean deleteExpiredObjectsByKey(String key) { - Connection conn = null; - PreparedStatement query = null; - try { - conn = provider.getConnection(); - conn.setAutoCommit(false); - - query = conn.prepareStatement("delete from expired_objects where obj_key = ?"); - query.setString(1, key); - query.executeUpdate(); - query.close(); - - conn.commit(); - LOG.debug("Removed expired_objects successfully: " + key); - return true; - } catch (Exception e) { - LOG.error("Failed to remove expired_objects: " + key, e); - rollbackSilently(conn); - return false; - } finally { - IOUtils.closeSilently(query); - IOUtils.closeSilently(conn); - } - } - - public boolean deleteAllExpiredObjects() { - Connection conn = null; - try { - conn = provider.getConnection(); - conn.setAutoCommit(false); - - PreparedStatement query = conn.prepareStatement("delete from expired_objects where exp < CURRENT_TIMESTAMP()"); - query.executeUpdate(); - query.close(); - - conn.commit(); - LOG.debug("Removed expired_objects successfully. "); - return true; - } catch (Exception e) { - LOG.error("Failed to remove expired_objects. ", e); - rollbackSilently(conn); - return false; - } finally { - IOUtils.closeSilently(conn); - } - } -} diff --git a/jans-client-api/server/src/main/java/io/jans/ca/server/rest/ApiApplication.java b/jans-client-api/server/src/main/java/io/jans/ca/server/rest/ApiApplication.java deleted file mode 100644 index 3e6c5cf1435..00000000000 --- a/jans-client-api/server/src/main/java/io/jans/ca/server/rest/ApiApplication.java +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Janssen Project software is available under the MIT License (2008). See http://opensource.org/licenses/MIT for full text. - * - * Copyright (c) 2020, Janssen Project - */ - -package io.jans.ca.server.rest; - -import jakarta.ws.rs.ApplicationPath; -import jakarta.ws.rs.core.Application; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import java.util.HashSet; -import java.util.Set; - -@ApplicationPath("/") -public class ApiApplication extends Application { - - private static final Logger LOG = LoggerFactory.getLogger(ApiApplication.class); - - @Override - public Set> getClasses() { - HashSet> classes = new HashSet<>(); - LOG.info("--------------------------------DEPLOYING REST RESOURCES-------------------------------------------"); - classes.add(HealthCheckResource.class); - - classes.add(OAuth20Resource.class); - classes.add(OpenIdConnectResource.class); - classes.add(UMA2ResourceServerResource.class); - classes.add(UMA2RelyingPartyResource.class); - - classes.add(RpResource.class); - - return classes; - } -} diff --git a/jans-client-api/server/src/main/java/io/jans/ca/server/rest/BaseResource.java b/jans-client-api/server/src/main/java/io/jans/ca/server/rest/BaseResource.java deleted file mode 100644 index cf011680189..00000000000 --- a/jans-client-api/server/src/main/java/io/jans/ca/server/rest/BaseResource.java +++ /dev/null @@ -1,19 +0,0 @@ -package io.jans.ca.server.rest; - -import jakarta.inject.Inject; -import jakarta.servlet.http.HttpServletRequest; -import jakarta.ws.rs.core.Context; -import org.slf4j.Logger; - -public class BaseResource { - - @Inject - Logger logger; - - @Context - private HttpServletRequest httpRequest; - - public HttpServletRequest getHttpRequest() { - return httpRequest; - } -} diff --git a/jans-client-api/server/src/main/java/io/jans/ca/server/rest/HealthCheckResource.java b/jans-client-api/server/src/main/java/io/jans/ca/server/rest/HealthCheckResource.java deleted file mode 100644 index 2e766d82482..00000000000 --- a/jans-client-api/server/src/main/java/io/jans/ca/server/rest/HealthCheckResource.java +++ /dev/null @@ -1,64 +0,0 @@ -package io.jans.ca.server.rest; - -import io.jans.ca.server.Utils; -import io.jans.ca.server.configuration.model.ApiConf; -import io.jans.ca.server.persistence.service.MainPersistenceService; -import jakarta.inject.Inject; -import jakarta.ws.rs.GET; -import jakarta.ws.rs.Path; -import jakarta.ws.rs.Produces; -import jakarta.ws.rs.core.MediaType; -import jakarta.ws.rs.core.Response; -import org.json.JSONObject; -import org.slf4j.Logger; - -@Path("/health-check") -public class HealthCheckResource { - - @Inject - Logger logger; - @Inject - MainPersistenceService jansConfigurationService; - - private static final String LOG_STATUS = "log_status"; - private static final String CONFIG_STATUS = "config_status"; - - @GET - @Path("/") - @Produces(MediaType.APPLICATION_JSON) - public Response healthCheck() { - logger.debug("Api Health Check - Entry"); - - JSONObject clientApiStatusJson = new JSONObject(); - clientApiStatusJson.put("application", "jans-client-api"); - clientApiStatusJson.put("version", Utils.getJansClientApiVersion()); - clientApiStatusJson.put("status", "running"); - - try { - logger.error("Sample Error Test Log."); - clientApiStatusJson.put(LOG_STATUS, "ok"); - } catch (Exception e) { - clientApiStatusJson.put(LOG_STATUS, "fail"); - } - - try { - ApiConf dbConf = checkDatabaseConnection(); - if (dbConf != null) { - clientApiStatusJson.put(CONFIG_STATUS, "ok"); - } else { - clientApiStatusJson.put(CONFIG_STATUS, "config Not Found"); - } - } catch (Exception e) { - logger.error(e.getMessage(), e); - clientApiStatusJson.put(CONFIG_STATUS, "error Reading"); - } - - logger.debug("Api Health Check - jsonObject:{}", clientApiStatusJson); - - return Response.ok(clientApiStatusJson.toString(3)).build(); - } - - private ApiConf checkDatabaseConnection() { - return jansConfigurationService.findConf(); - } -} diff --git a/jans-client-api/server/src/main/java/io/jans/ca/server/rest/OAuth20Resource.java b/jans-client-api/server/src/main/java/io/jans/ca/server/rest/OAuth20Resource.java deleted file mode 100644 index 4b4d67e42dc..00000000000 --- a/jans-client-api/server/src/main/java/io/jans/ca/server/rest/OAuth20Resource.java +++ /dev/null @@ -1,146 +0,0 @@ -package io.jans.ca.server.rest; - -import io.jans.ca.server.op.*; -import io.jans.ca.common.rest.ProtectedApi; -import jakarta.inject.Inject; -import jakarta.ws.rs.*; -import jakarta.ws.rs.core.MediaType; -import jakarta.ws.rs.core.Response; - -@Path("/") -public class OAuth20Resource extends BaseResource { - - @Inject - GetDiscoveryOperation getDiscoveryOp; - @Inject - RegisterSiteOperation registerSiteOp; - @Inject - UpdateSiteOperation updateSiteOp; - @Inject - RemoveSiteOperation removeSiteOp; - @Inject - GetClientTokenOperation getClientTokenOp; - @Inject - GetAccessTokenByRefreshTokenOperation getAccessTokenByRefreshTokenOp; - @Inject - IntrospectAccessTokenOperation introspectAccessTokenOp; - @Inject - GetUserInfoOperation getUserInfoOp; - @Inject - GetJwksOperation getJwksOp; - @Inject - GetIssuerOperation getIssuerOp; - @Inject - CheckIdTokenOperation getCheckIdTokenOp; - @Inject - CheckAccessTokenOperation getCheckAccessTokenOp; - - @POST - @Path("/register-site") - @Produces(MediaType.APPLICATION_JSON) - public Response registerSite(String params) { - logger.info("Api Resource: /register-site Params: {}", params); - return registerSiteOp.process(params, getHttpRequest()); - } - - @POST - @Path("/update-site") - @Produces(MediaType.APPLICATION_JSON) - public Response updateSite(String params) { - logger.info("Api Resource: /update-site Params: {}", params); - return updateSiteOp.process(params, getHttpRequest()); - } - - @POST - @Path("/remove-site") - @Produces(MediaType.APPLICATION_JSON) - @Consumes(MediaType.APPLICATION_JSON) - public Response removeSite(String params) { - logger.info("Api Resource: /remove-site Params: {}", params); - return removeSiteOp.process(params, getHttpRequest()); - } - - @POST - @Path("/get-client-token") - @Produces(MediaType.APPLICATION_JSON) - public Response getClientToken(String params) { - logger.info("Api Resource: /get-client-token Params: {}", params); - return getClientTokenOp.process(params, getHttpRequest()); - } - - @POST - @ProtectedApi - @Path("/get-access-token-by-refresh-token") - @Produces(MediaType.APPLICATION_JSON) - @Consumes(MediaType.APPLICATION_JSON) - public Response getAccessTokenByRefreshToken(String params) { - logger.info("Api Resource: /get-access-token-by-refresh-token Params: {}", params); - return getAccessTokenByRefreshTokenOp.process(params, getHttpRequest()); - } - - @POST - @ProtectedApi - @Path("/introspect-access-token") - @Produces(MediaType.APPLICATION_JSON) - @Consumes(MediaType.APPLICATION_JSON) - public Response introspectAccessToken(String params) { - logger.info("Api Resource: /introspect-access-token Params: {}", params); - return introspectAccessTokenOp.process(params, getHttpRequest()); - } - - @POST - @ProtectedApi - @Path("/get-user-info") - @Produces(MediaType.APPLICATION_JSON) - @Consumes(MediaType.APPLICATION_JSON) - public Response getUserInfo(String params) { - logger.info("Api Resource: /get-user-info Params: {}", params); - return getUserInfoOp.process(params, getHttpRequest()); - } - - @POST - @Path("/get-jwks") - @Produces(MediaType.APPLICATION_JSON) - @Consumes(MediaType.APPLICATION_JSON) - public Response getJwks(String params) { - logger.info("Api Resource: /get-jwks Params: {}", params); - return getJwksOp.process(params, getHttpRequest()); - } - - @POST - @Path("/get-discovery") - @Produces(MediaType.APPLICATION_JSON) - public Response getDiscovery(String params) { - logger.info("Api Resource: /get-discovery Params: {}", params); - return getDiscoveryOp.process(params, getHttpRequest()); - } - - @POST - @ProtectedApi - @Path("/check-access-token") - @Produces(MediaType.APPLICATION_JSON) - @Consumes(MediaType.APPLICATION_JSON) - public Response checkAccessToken(String params) { - logger.info("Api Resource: /check-access-token Params: {}", params); - return getCheckAccessTokenOp.process(params, getHttpRequest()); - } - - @POST - @ProtectedApi - @Path("/check-id-token") - @Produces(MediaType.APPLICATION_JSON) - @Consumes(MediaType.APPLICATION_JSON) - public Response checkIdToken(String params) { - logger.info("Api Resource: /check-id-token Params: {}", params); - return getCheckIdTokenOp.process(params, getHttpRequest()); - } - - @POST - @Path("/get-issuer") - @Produces(MediaType.APPLICATION_JSON) - @Consumes(MediaType.APPLICATION_JSON) - public Response getIssuer(String params) { - logger.info("Api Resource: /get-issuer Params: {}", params); - return getIssuerOp.process(params, getHttpRequest()); - } -} diff --git a/jans-client-api/server/src/main/java/io/jans/ca/server/rest/OpenIdConnectResource.java b/jans-client-api/server/src/main/java/io/jans/ca/server/rest/OpenIdConnectResource.java deleted file mode 100644 index dde205aa3f4..00000000000 --- a/jans-client-api/server/src/main/java/io/jans/ca/server/rest/OpenIdConnectResource.java +++ /dev/null @@ -1,64 +0,0 @@ -package io.jans.ca.server.rest; - -import io.jans.ca.server.op.GetAuthorizationCodeOperation; -import io.jans.ca.server.op.GetAuthorizationUrlOperation; -import io.jans.ca.server.op.GetLogoutUrlOperation; -import io.jans.ca.server.op.GetTokensByCodeOperation; -import io.jans.ca.common.rest.ProtectedApi; -import jakarta.inject.Inject; -import jakarta.ws.rs.*; -import jakarta.ws.rs.core.MediaType; -import jakarta.ws.rs.core.Response; - -@Path("/") -public class OpenIdConnectResource extends BaseResource { - - @Inject - GetAuthorizationCodeOperation getAuthorizationCodeOp; - @Inject - GetAuthorizationUrlOperation getAuthorizationUrlOp; - @Inject - GetTokensByCodeOperation getTokensByCodeOp; - @Inject - GetLogoutUrlOperation getLogoutUrlOp; - - @POST - @ProtectedApi - @Path("/get-authorization-url") - @Produces(MediaType.APPLICATION_JSON) - @Consumes(MediaType.APPLICATION_JSON) - public Response getAuthorizationUrl(String params) { - logger.info("Api Resource: /get-authorization-url Params: {}", params); - return getAuthorizationUrlOp.process(params, getHttpRequest()); - } - - @POST - @ProtectedApi - @Path("/get-authorization-code") - @Produces(MediaType.APPLICATION_JSON) - @Consumes(MediaType.APPLICATION_JSON) - public Response getAuthorizationCode(String params) { - logger.info("Api Resource: /get-authorization-code Params: {}", params); - return getAuthorizationCodeOp.process(params, getHttpRequest()); - } - - @POST - @ProtectedApi - @Path("/get-tokens-by-code") - @Produces(MediaType.APPLICATION_JSON) - @Consumes(MediaType.APPLICATION_JSON) - public Response getTokenByCode(String params) { - logger.info("Api Resource: /get-tokens-by-code Params: {}", params); - return getTokensByCodeOp.process(params, getHttpRequest()); - } - - @POST - @ProtectedApi - @Path("/get-logout-uri") - @Produces(MediaType.APPLICATION_JSON) - @Consumes(MediaType.APPLICATION_JSON) - public Response getLogoutUri(String params) { - logger.info("Api Resource: /get-logout-uri Params: {}", params); - return getLogoutUrlOp.process(params, getHttpRequest()); - } -} diff --git a/jans-client-api/server/src/main/java/io/jans/ca/server/rest/RpResource.java b/jans-client-api/server/src/main/java/io/jans/ca/server/rest/RpResource.java deleted file mode 100644 index c966d63cc45..00000000000 --- a/jans-client-api/server/src/main/java/io/jans/ca/server/rest/RpResource.java +++ /dev/null @@ -1,68 +0,0 @@ -package io.jans.ca.server.rest; - -import io.jans.ca.common.params.StringParam; -import io.jans.ca.server.op.*; -import io.jans.ca.common.rest.ProtectedApi; -import jakarta.inject.Inject; -import jakarta.ws.rs.*; -import jakarta.ws.rs.core.MediaType; -import jakarta.ws.rs.core.Response; - -@Path("/") -public class RpResource extends BaseResource { - - @Inject - GetRpJwksOperation getRpJwksOp; - @Inject - GetRpOperation getRpOp; - @Inject - AuthorizationCodeFlowOperation authorizationCodeFlowOp; - @Inject - GetRequestObjectOperation getRequestObjectOp; - @Inject - GetRequestObjectUriOperation getRequestObjectUriOp; - - @GET - @Path("/get-rp-jwks") - @Produces(MediaType.APPLICATION_JSON) - public Response getRpJwks() { - logger.info("Api Resource: get-rp-jwks"); - return getRpJwksOp.process(null, getHttpRequest()); - } - - @POST - @Path("/get-rp") - @Produces(MediaType.APPLICATION_JSON) - public Response getRp(String params) { - logger.info("Api Resource: get-rp"); - return getRpOp.process(params, getHttpRequest()); - } - - @POST - @ProtectedApi - @Path("/authorization-code-flow") - @Produces(MediaType.APPLICATION_JSON) - @Consumes(MediaType.APPLICATION_JSON) - public Response authorizationCodeFlow(String params) { - logger.info("Api Resource: authorization-code-flow"); - return authorizationCodeFlowOp.process(params, getHttpRequest()); - } - - @GET - @Path("/get-request-object/{request_object_id}") - @Produces(MediaType.TEXT_PLAIN) - public Response getRequestObject(@PathParam("request_object_id") String value) { - logger.info("Api Resource: get-request-object/{}", value); - return getRequestObjectOp.process((new StringParam(value)).toJsonString(), getHttpRequest()); - } - - @POST - @ProtectedApi - @Path("/get-request-object-uri") - @Produces(MediaType.APPLICATION_JSON) - @Consumes(MediaType.APPLICATION_JSON) - public Response getRequestObjectUri(String params) { - logger.info("Api Resource: get-request-object-uri"); - return getRequestObjectUriOp.process(params, getHttpRequest()); - } -} diff --git a/jans-client-api/server/src/main/java/io/jans/ca/server/rest/UMA2RelyingPartyResource.java b/jans-client-api/server/src/main/java/io/jans/ca/server/rest/UMA2RelyingPartyResource.java deleted file mode 100644 index 1c1e9ebe397..00000000000 --- a/jans-client-api/server/src/main/java/io/jans/ca/server/rest/UMA2RelyingPartyResource.java +++ /dev/null @@ -1,42 +0,0 @@ -package io.jans.ca.server.rest; - -import io.jans.ca.server.op.RpGetGetClaimsGatheringUrlOperation; -import io.jans.ca.server.op.RpGetRptOperation; -import io.jans.ca.common.rest.ProtectedApi; -import jakarta.inject.Inject; -import jakarta.ws.rs.Consumes; -import jakarta.ws.rs.POST; -import jakarta.ws.rs.Path; -import jakarta.ws.rs.Produces; -import jakarta.ws.rs.core.MediaType; -import jakarta.ws.rs.core.Response; - -@Path("/") -public class UMA2RelyingPartyResource extends BaseResource { - - @Inject - RpGetRptOperation rpGetRptOp; - @Inject - RpGetGetClaimsGatheringUrlOperation rpGetGetClaimsGatheringUrlOp; - - @POST - @ProtectedApi - @Path("/uma-rp-get-rpt") - @Produces(MediaType.APPLICATION_JSON) - @Consumes(MediaType.APPLICATION_JSON) - public Response umaRpGetRpt(String params) { - logger.info("Api Resource: /uma-rp-get-rpt Params: {}", params); - return rpGetRptOp.process(params, getHttpRequest()); - } - - @POST - @ProtectedApi - @Path("/uma-rp-get-claims-gathering-url") - @Produces(MediaType.APPLICATION_JSON) - @Consumes(MediaType.APPLICATION_JSON) - public Response umaRpGetClaimsGatheringUrl(String params) { - logger.info("Api Resource: /uma-rp-get-claims-gathering-url Params: {}", params); - return rpGetGetClaimsGatheringUrlOp.process(params, getHttpRequest()); - } - -} diff --git a/jans-client-api/server/src/main/java/io/jans/ca/server/rest/UMA2ResourceServerResource.java b/jans-client-api/server/src/main/java/io/jans/ca/server/rest/UMA2ResourceServerResource.java deleted file mode 100644 index 989d7cffbe5..00000000000 --- a/jans-client-api/server/src/main/java/io/jans/ca/server/rest/UMA2ResourceServerResource.java +++ /dev/null @@ -1,67 +0,0 @@ -package io.jans.ca.server.rest; - -import io.jans.ca.server.op.IntrospectRptOperation; -import io.jans.ca.server.op.RsCheckAccessOperation; -import io.jans.ca.server.op.RsModifyOperation; -import io.jans.ca.server.op.RsProtectOperation; -import io.jans.ca.common.rest.ProtectedApi; -import jakarta.inject.Inject; -import jakarta.ws.rs.Consumes; -import jakarta.ws.rs.POST; -import jakarta.ws.rs.Path; -import jakarta.ws.rs.Produces; -import jakarta.ws.rs.core.MediaType; -import jakarta.ws.rs.core.Response; - -@Path("/") -public class UMA2ResourceServerResource extends BaseResource { - - @Inject - RsProtectOperation rsProtectOp; - @Inject - RsModifyOperation rsModifyOp; - @Inject - IntrospectRptOperation introspectRptOp; - @Inject - RsCheckAccessOperation rsCheckAccessOp; - - @POST - @ProtectedApi - @Path("/uma-rs-protect") - @Produces(MediaType.APPLICATION_JSON) - @Consumes(MediaType.APPLICATION_JSON) - public Response umaRsProtect(String params) { - logger.info("Api Resource: /uma-rs-protect Params: {}", params); - return rsProtectOp.process(params, getHttpRequest()); - } - - @POST - @ProtectedApi - @Path("/uma-rs-check-access") - @Produces(MediaType.APPLICATION_JSON) - @Consumes(MediaType.APPLICATION_JSON) - public Response umaRsCheckAccess(String params) { - logger.info("Api Resource: /uma-rs-check-access Params: {}", params); - return rsCheckAccessOp.process(params, getHttpRequest()); - } - - @POST - @ProtectedApi - @Path("/introspect-rpt") - @Produces(MediaType.APPLICATION_JSON) - @Consumes(MediaType.APPLICATION_JSON) - public Response introspectRpt(String params) { - logger.info("Api Resource: /introspect-rpt Params: {}", params); - return introspectRptOp.process(params, getHttpRequest()); - } - - @POST - @ProtectedApi - @Path("/uma-rs-modify") - @Produces(MediaType.APPLICATION_JSON) - @Consumes(MediaType.APPLICATION_JSON) - public Response umaRsModify(String params) { - logger.info("Api Resource: /uma-rs-modify Params: {}", params); - return rsModifyOp.process(params, getHttpRequest()); - } -} diff --git a/jans-client-api/server/src/main/java/io/jans/ca/server/security/service/AuthorizationRpIdParam.java b/jans-client-api/server/src/main/java/io/jans/ca/server/security/service/AuthorizationRpIdParam.java deleted file mode 100644 index 0066a1e0385..00000000000 --- a/jans-client-api/server/src/main/java/io/jans/ca/server/security/service/AuthorizationRpIdParam.java +++ /dev/null @@ -1,13 +0,0 @@ -package io.jans.ca.server.security.service; - -public class AuthorizationRpIdParam { - private String rpId; - - public String getRpId() { - return rpId; - } - - public void setRpId(String rpId) { - this.rpId = rpId; - } -} diff --git a/jans-client-api/server/src/main/java/io/jans/ca/server/security/service/AuthorizationService.java b/jans-client-api/server/src/main/java/io/jans/ca/server/security/service/AuthorizationService.java deleted file mode 100644 index 71a20c6409b..00000000000 --- a/jans-client-api/server/src/main/java/io/jans/ca/server/security/service/AuthorizationService.java +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Janssen Project software is available under the MIT License (2008). See http://opensource.org/licenses/MIT for full text. - * - * Copyright (c) 2020, Janssen Project - */ - -package io.jans.ca.server.security.service; - -import jakarta.inject.Inject; -import jakarta.ws.rs.core.Response; -import org.apache.commons.collections4.CollectionUtils; -import org.slf4j.Logger; - -import java.io.Serializable; -import java.util.List; - -public abstract class AuthorizationService implements Serializable { - - private static final long serialVersionUID = 4012335221233316230L; - - @Inject - transient Logger log; - - public abstract String processAuthorization(String path, String method, String remoteAddress, - String authorization, String authorizationRpId) throws Exception; - - protected Response getErrorResponse(Response.Status status, String detail) { - return Response.status(status).entity(detail).build(); - } - - public boolean isEqualCollection(List list1, List list2) { - return CollectionUtils.isEqualCollection(list1, list2); - } -} diff --git a/jans-client-api/server/src/main/java/io/jans/ca/server/security/service/ClientApiAuthorizationService.java b/jans-client-api/server/src/main/java/io/jans/ca/server/security/service/ClientApiAuthorizationService.java deleted file mode 100644 index 7ace631433b..00000000000 --- a/jans-client-api/server/src/main/java/io/jans/ca/server/security/service/ClientApiAuthorizationService.java +++ /dev/null @@ -1,116 +0,0 @@ -/* - * Janssen Project software is available under the MIT License (2008). See http://opensource.org/licenses/MIT for full text. - * - * Copyright (c) 2020, Janssen Project - */ - -package io.jans.ca.server.security.service; - -import io.jans.as.model.util.StringUtils; -import io.jans.as.model.util.Util; -import io.jans.ca.common.ErrorResponseCode; -import io.jans.ca.server.HttpException; -import io.jans.ca.server.configuration.ApiAppConfiguration; -import io.jans.ca.server.configuration.model.Rp; -import io.jans.ca.server.persistence.service.MainPersistenceService; -import io.jans.ca.server.service.RpSyncService; -import io.jans.ca.server.service.ValidationService; -import jakarta.annotation.Priority; -import jakarta.enterprise.context.ApplicationScoped; -import jakarta.enterprise.inject.Alternative; -import jakarta.inject.Inject; -import jakarta.inject.Named; -import jakarta.servlet.http.HttpServletRequest; -import jakarta.servlet.http.HttpServletResponse; -import jakarta.ws.rs.core.Context; -import org.slf4j.Logger; - -import java.io.Serializable; -import java.util.List; - -@ApplicationScoped -@Named("clientApiAuthorizationService") -@Alternative -@Priority(1) -public class ClientApiAuthorizationService extends AuthorizationService implements Serializable { - - private static final long serialVersionUID = 1L; - private static final String AUTHENTICATION_SCHEME = "Bearer "; - - @Inject - transient Logger LOG; - - @Context - transient HttpServletRequest request; - - @Context - transient HttpServletResponse response; - - @Inject - ValidationService validationService; - @Inject - RpSyncService rpSyncService; - - @Inject - MainPersistenceService jansConfigurationService; - - public String processAuthorization(String path, String method, String remoteAddress, - String authorization, String authorizationRpId) throws Exception { - LOG.debug("oAuth Authorization parameters , path:{}, method:{}, authorization: {}, authorizationRpId: {} ", - path, method, authorization, authorizationRpId); - - final ApiAppConfiguration conf = jansConfigurationService.find(); - - validateAuthorizationRpId(conf, authorizationRpId); - validateAccessToken(authorization, authorizationRpId); - - return "AUTHORIZATION SUCCESS"; - } - - private void validateAuthorizationRpId(ApiAppConfiguration conf, String authorizationRpId) { - - if (Util.isNullOrEmpty(authorizationRpId)) { - LOG.debug("`AuthorizationRpId` header is null or Empty"); - throw new HttpException(ErrorResponseCode.AUTHORIZATION_RP_ID_HEADER_NOT_FOUND); - } - - final Rp rp = rpSyncService.getRp(authorizationRpId); - - if (rp == null || Util.isNullOrEmpty(rp.getRpId())) { - LOG.debug("`rp_id` in `AuthorizationRpId` header is not registered in jans_client_api."); - throw new HttpException(ErrorResponseCode.AUTHORIZATION_RP_ID_NOT_FOUND); - } - - if (conf.getProtectCommandsWithRpId() == null || conf.getProtectCommandsWithRpId().isEmpty()) { - return; - } - - if (!conf.getProtectCommandsWithRpId().contains(authorizationRpId)) { - LOG.debug("`rp_id` in `AuthorizationRpId` header is invalid. The `AuthorizationRpId` header should contain `rp_id` from `protect_commands_with_rp_id` field in client-api-server.yml."); - throw new HttpException(ErrorResponseCode.INVALID_AUTHORIZATION_RP_ID); - } - } - - private void validateAccessToken(String authorization, String authorizationRpId) { - final String prefix = AUTHENTICATION_SCHEME; - final ApiAppConfiguration conf = jansConfigurationService.find(); - - if (conf.getProtectCommandsWithAccessToken() != null && !conf.getProtectCommandsWithAccessToken()) { - LOG.debug("Skip protection because protect_commands_with_access_token: false in configuration file."); - return; - } - - if (Util.isNullOrEmpty(authorization)) { - LOG.debug("No access token provided in Authorization header. Forbidden."); - throw new HttpException(ErrorResponseCode.BLANK_ACCESS_TOKEN); - } - - String accessToken = authorization.substring(prefix.length()); - if (Util.isNullOrEmpty(accessToken)) { - LOG.debug("No access token provided in Authorization header. Forbidden."); - throw new HttpException(ErrorResponseCode.BLANK_ACCESS_TOKEN); - } - validationService.validateAccessToken(accessToken, authorizationRpId); - } - -} \ No newline at end of file diff --git a/jans-client-api/server/src/main/java/io/jans/ca/server/service/DiscoveryService.java b/jans-client-api/server/src/main/java/io/jans/ca/server/service/DiscoveryService.java deleted file mode 100644 index c2d7a7f1ac4..00000000000 --- a/jans-client-api/server/src/main/java/io/jans/ca/server/service/DiscoveryService.java +++ /dev/null @@ -1,183 +0,0 @@ -/* - * All rights reserved -- Copyright 2015 Gluu Inc. - */ -package io.jans.ca.server.service; - -import com.google.common.base.Strings; -import io.jans.as.client.OpenIdConfigurationClient; -import io.jans.as.client.OpenIdConfigurationResponse; -import io.jans.as.model.uma.UmaMetadata; -import io.jans.ca.common.ErrorResponseCode; -import io.jans.ca.server.HttpException; -import io.jans.ca.server.configuration.model.Rp; -import io.jans.ca.server.op.OpClientFactoryImpl; -import jakarta.enterprise.context.ApplicationScoped; -import jakarta.inject.Inject; -import jakarta.ws.rs.WebApplicationException; -import jakarta.ws.rs.core.Response; -import org.apache.commons.lang.StringUtils; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import javax.net.ssl.SSLHandshakeException; -import java.io.IOException; -import java.util.concurrent.ConcurrentHashMap; -import java.util.concurrent.ConcurrentMap; - -/** - * @author Yuriy Zabrovarnyy - */ -@ApplicationScoped -public class DiscoveryService { - - /** - * Logger - */ - private static final Logger LOG = LoggerFactory.getLogger(DiscoveryService.class); - - public static final String WELL_KNOWN_CONNECT_PATH = "/.well-known/openid-configuration"; - - public static final String WELL_KNOWN_UMA_PATH = "/.well-known/uma2-configuration"; - - private final ConcurrentMap map = new ConcurrentHashMap(); - private final ConcurrentMap umaMap = new ConcurrentHashMap(); - @Inject - HttpService httpService; - @Inject - RpSyncService rpSyncService; - @Inject - ValidationService validationService; - @Inject - OpClientFactoryImpl opClientFactory; - - public OpenIdConfigurationResponse getConnectDiscoveryResponseByRpId(String rpId) { - validationService.notBlankRpId(rpId); - - Rp rp = rpSyncService.getRp(rpId); - return getConnectDiscoveryResponse(rp); - } - - public OpenIdConfigurationResponse getConnectDiscoveryResponse(Rp rp) { - return getConnectDiscoveryResponse(rp.getOpConfigurationEndpoint(), rp.getOpHost(), rp.getOpDiscoveryPath()); - } - - public OpenIdConfigurationResponse getConnectDiscoveryResponse(String opConfigurationEndpoint, String opHost, String opDiscoveryPath) { - return Strings.isNullOrEmpty(opConfigurationEndpoint) ? getConnectDiscoveryResponse(getConnectDiscoveryUrl(opHost, opDiscoveryPath)) - : getConnectDiscoveryResponse(opConfigurationEndpoint); - } - - public OpenIdConfigurationResponse getConnectDiscoveryResponse(String opConfigurationEndpoint) { - validationService.validateOpConfigurationEndpoint(opConfigurationEndpoint); - try { - final OpenIdConfigurationResponse r = map.get(opConfigurationEndpoint); - if (r != null) { - validationService.isOpHostAllowed(r.getIssuer()); - return r; - } - final OpenIdConfigurationClient client = opClientFactory.createOpenIdConfigurationClient(opConfigurationEndpoint); - client.setExecutor(httpService.getClientEngine()); - final OpenIdConfigurationResponse response = client.execOpenIdConfiguration(); - LOG.trace("Discovery response: {} ", response.getEntity()); - if (StringUtils.isNotBlank(response.getEntity())) { - map.put(opConfigurationEndpoint, response); - validationService.isOpHostAllowed(response.getIssuer()); - return response; - } else { - LOG.error("No response from discovery!"); - } - } catch (SSLHandshakeException e) { - LOG.error(e.getMessage(), e); - throw new HttpException(ErrorResponseCode.SSL_HANDSHAKE_ERROR); - } catch (IOException e) { - LOG.error(e.getMessage(), e); - throw new WebApplicationException(Response.status(Response.Status.INTERNAL_SERVER_ERROR).entity("Internal server error. Message: " + e.getMessage()).build()); - } catch (Exception e) { - LOG.error(e.getMessage(), e); - } - LOG.error("Unable to fetch discovery information for op_configuration_endpoint: {}", opConfigurationEndpoint); - throw new HttpException(ErrorResponseCode.NO_CONNECT_DISCOVERY_RESPONSE); - } - - public UmaMetadata getUmaDiscoveryByRpId(String rpId) { - validationService.notBlankRpId(rpId); - - Rp rp = rpSyncService.getRp(rpId); - return getUmaDiscovery(rp.getOpConfigurationEndpoint(), rp.getOpHost(), rp.getOpDiscoveryPath()); - } - - public UmaMetadata getUmaDiscovery(String opConfigurationEndpoint, String opHost, String opDiscoveryPath) { - return Strings.isNullOrEmpty(opConfigurationEndpoint) ? getUmaDiscovery(getConnectDiscoveryUrl(opHost, opDiscoveryPath)) - : getUmaDiscovery(opConfigurationEndpoint); - } - - public UmaMetadata getUmaDiscovery(String opConfigurationEndpoint) { - validationService.validateOpConfigurationEndpoint(opConfigurationEndpoint); - - try { - final UmaMetadata r = umaMap.get(opConfigurationEndpoint); - if (r != null) { - validationService.isOpHostAllowed(r.getIssuer()); - return r; - } - final UmaMetadata response = opClientFactory.createUmaClientFactory().createMetadataService( - getUmaDiscoveryUrl(opConfigurationEndpoint), httpService.getClientEngine()).getMetadata(); - LOG.trace("Uma discovery response: {} ", response); - umaMap.put(opConfigurationEndpoint, response); - validationService.isOpHostAllowed(response.getIssuer()); - return response; - - } catch (Exception e) { - LOG.error(e.getMessage(), e); - } - LOG.error("Unable to fetch UMA discovery information for op_configuration_endpoint: {}", opConfigurationEndpoint); - throw new HttpException(ErrorResponseCode.NO_UMA_DISCOVERY_RESPONSE); - } - - public String getConnectDiscoveryUrl(Rp rp) { - return getConnectDiscoveryUrl(rp.getOpHost(), rp.getOpDiscoveryPath()); - } - - public String getConnectDiscoveryUrl(String opHost, String opDiscoveryPath) { - String result = baseOpUrl(opHost); - if (StringUtils.isNotBlank(opDiscoveryPath)) { - result += opDiscoveryPath; - } - return result + WELL_KNOWN_CONNECT_PATH; - } - - public String getUmaDiscoveryUrl(String opHost, String opDiscoveryPath) { - String result = baseOpUrl(opHost); - if (StringUtils.isNotBlank(opDiscoveryPath)) { - result += opDiscoveryPath; - } - return result + WELL_KNOWN_UMA_PATH; - } - - public String getUmaDiscoveryUrl(String opConfigurationEndpoint) { - String result = baseOpUrl(opConfigurationEndpoint); - result = result.replace(WELL_KNOWN_CONNECT_PATH, WELL_KNOWN_UMA_PATH); - return result; - } - - private String baseOpUrl(String opHost) { - if (!opHost.startsWith("http")) { - opHost = "https://" + opHost; - } - if (opHost.endsWith("/")) { - opHost = StringUtils.removeEnd(opHost, "/"); - } - return opHost; - } - - public HttpService getHttpService() { - return httpService; - } - - public ValidationService getValidationService() { - return validationService; - } - - public OpClientFactoryImpl getOpClientFactory() { - return opClientFactory; - } -} diff --git a/jans-client-api/server/src/main/java/io/jans/ca/server/service/HttpService.java b/jans-client-api/server/src/main/java/io/jans/ca/server/service/HttpService.java deleted file mode 100644 index ae10973f2bf..00000000000 --- a/jans-client-api/server/src/main/java/io/jans/ca/server/service/HttpService.java +++ /dev/null @@ -1,113 +0,0 @@ -/** - * All rights reserved -- Copyright 2015 Gluu Inc. - */ -package io.jans.ca.server.service; - -import com.google.common.base.Strings; -import io.jans.ca.common.CoreUtils; -import io.jans.ca.common.proxy.ProxyConfiguration; -import io.jans.ca.server.configuration.ApiAppConfiguration; -import io.jans.ca.server.configuration.ConfigurationFactory; -import jakarta.enterprise.context.ApplicationScoped; -import jakarta.inject.Inject; -import org.apache.http.client.HttpClient; -import org.jboss.resteasy.client.jaxrs.ClientHttpEngine; -import org.jboss.resteasy.client.jaxrs.engines.ApacheHttpClient43Engine; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import java.io.File; -import java.util.List; -import java.util.Optional; - -/** - * @author Yuriy Zabrovarnyy - */ -@ApplicationScoped -public class HttpService { - - private static final Logger LOG = LoggerFactory.getLogger(HttpService.class); - @Inject - ConfigurationFactory configurationFactory; - - public HttpClient getHttpClient() { - ApiAppConfiguration configuration = configurationFactory.getAppConfiguration(); - final Optional proxyConfig = asProxyConfiguration(configuration); - final String[] tlsVersions = listToArray(configuration.getTlsVersion()); - final String[] tlsSecureCiphers = listToArray(configuration.getTlsSecureCipher()); - try { - validate(proxyConfig); - final Boolean trustAllCerts = configuration.getTrustAllCerts(); - if (trustAllCerts != null && trustAllCerts) { - LOG.trace("Created TRUST_ALL client."); - return CoreUtils.createHttpClientTrustAll(proxyConfig, tlsVersions, tlsSecureCiphers); - } - final String trustStorePath = configuration.getKeyStorePath(); - - if (Strings.isNullOrEmpty(trustStorePath)) { - return CoreUtils.createClientFallback(proxyConfig); - } - final File trustStoreFile = new File(trustStorePath); - - if (!trustStoreFile.exists()) { - LOG.error("ERROR in configuration. Trust store path is invalid! Please fix key_store_path in jans_client_api configuration"); - return CoreUtils.createClientFallback(proxyConfig); - } - //Perform mutual authentication over SSL if allowed - if (configuration.getMtlsEnabled()) { - final String mtlsClientKeyStorePath = configuration.getMtlsClientKeyStorePath(); - - if (Strings.isNullOrEmpty(mtlsClientKeyStorePath)) { - LOG.error("Mtls Client key store path is empty! Please fix mtls_client_key_store_path in jans_client_api configuration"); - return CoreUtils.createHttpClientWithKeyStore(trustStoreFile, configuration.getKeyStorePassword(), tlsVersions, tlsSecureCiphers, proxyConfig); - } - final File mtlsClientKeyStoreFile = new File(mtlsClientKeyStorePath); - if (!mtlsClientKeyStoreFile.exists()) { - LOG.error("ERROR in configuration. Mtls Client key stroe path is invalid! Please fix mtls_client_key_store_path in jans_client_api configuration"); - return CoreUtils.createHttpClientWithKeyStore(trustStoreFile, configuration.getKeyStorePassword(), tlsVersions, tlsSecureCiphers, proxyConfig); - } - return CoreUtils.createHttpClientForMutualAuthentication(trustStoreFile, configuration.getKeyStorePassword(), mtlsClientKeyStoreFile, configuration.getMtlsClientKeyStorePassword(), tlsVersions, tlsSecureCiphers, proxyConfig); - } - return CoreUtils.createHttpClientWithKeyStore(trustStoreFile, configuration.getKeyStorePassword(), tlsVersions, tlsSecureCiphers, proxyConfig); - } catch (Exception e) { - LOG.error(e.getMessage(), e); - LOG.error("Failed to create http client based on jans_client_api configuration. Creating default client..."); - } - return CoreUtils.createClientFallback(proxyConfig); - } - - private static Optional asProxyConfiguration(ApiAppConfiguration configuration) { - try { - ProxyConfiguration node = configuration.getProxyConfiguration(); - if (node != null) { - return Optional.ofNullable(node); - } - } catch (Exception e) { - LOG.error("Failed to parse ProxyConfiguration.", e); - } - return Optional.empty(); - } - - private void validate(Optional proxyConfiguration) { - - if (!proxyConfiguration.isPresent()) { - return; - } - - if (Strings.isNullOrEmpty(proxyConfiguration.get().getHost())) { - LOG.warn("Invalid proxy server `hostname` provided (empty or null). jans_client_api will connect to OP_HOST without proxy configuration."); - } - } - - public ClientHttpEngine getClientEngine() { - return new ApacheHttpClient43Engine(getHttpClient()); - } - - private static String[] listToArray(List input) { - if (input == null || input.isEmpty()) { - return null; - } - return input.stream().toArray(String[]::new); - - } -} \ No newline at end of file diff --git a/jans-client-api/server/src/main/java/io/jans/ca/server/service/IntrospectionService.java b/jans-client-api/server/src/main/java/io/jans/ca/server/service/IntrospectionService.java deleted file mode 100644 index 41cda9669b1..00000000000 --- a/jans-client-api/server/src/main/java/io/jans/ca/server/service/IntrospectionService.java +++ /dev/null @@ -1,155 +0,0 @@ -package io.jans.ca.server.service; - -import io.jans.as.model.common.IntrospectionResponse; -import io.jans.as.model.uma.UmaMetadata; -import io.jans.ca.common.introspection.CorrectRptIntrospectionResponse; -import io.jans.ca.common.introspection.CorrectUmaPermission; -import io.jans.ca.server.introspection.*; -import io.jans.ca.server.op.OpClientFactoryImpl; -import jakarta.enterprise.context.ApplicationScoped; -import jakarta.inject.Inject; -import jakarta.ws.rs.ClientErrorException; -import org.jboss.resteasy.spi.ReaderException; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import java.util.ArrayList; -import java.util.Date; -import java.util.List; - -/** - * @author yuriyz - */ -@ApplicationScoped -public class IntrospectionService { - - private static final Logger LOG = LoggerFactory.getLogger(IntrospectionService.class); - @Inject - HttpService httpService; - @Inject - UmaTokenService umaTokenService; - @Inject - DiscoveryService discoveryService; - @Inject - OpClientFactoryImpl opClientFactory; - - public IntrospectionResponse introspectToken(String rpId, String accessToken) { - return introspectToken(rpId, accessToken, true); - } - - private IntrospectionResponse introspectToken(String rpId, String accessToken, boolean retry) { - final String introspectionEndpoint = discoveryService.getConnectDiscoveryResponseByRpId(rpId).getIntrospectionEndpoint(); - LOG.info("Instrospection Endpoint: {}", introspectionEndpoint); - final io.jans.as.client.service.IntrospectionService introspectionService = ClientFactory.instance().createIntrospectionService(introspectionEndpoint, httpService.getClientEngine()); - - try { - String token = umaTokenService.getOAuthToken(rpId).getToken(); - LOG.info("Token instrospection: {}", token); - final IntrospectionResponse response = introspectionService.introspectToken(bearerToken(token), accessToken); - return response; // we need local variable to force convertion here - } catch (ClientErrorException e) { - int status = e.getResponse().getStatus(); - LOG.debug("Failed to introspect token. Entity: " + e.getResponse().readEntity(String.class) + ", status: " + status, e); - if (retry && (status == 400 || status == 401)) { - LOG.debug("Try maybe OAuthToken is lost on AS, force refresh OAuthToken and re-try ..."); - umaTokenService.obtainOauthToken(rpId); // force to refresh OAuthToken - return introspectToken(rpId, accessToken, false); - } else { - throw e; - } - } catch (Throwable e) { - LOG.trace("Exception during access token introspection.", e); - if (e instanceof ReaderException) { // dummy construction but checked JsonParseException is thrown inside jackson provider, so we don't have choice - // trying to handle compatiblity issue. - LOG.trace("Trying to handle compatibility issue ..."); - BackCompatibleIntrospectionService backCompatibleIntrospectionService = ClientFactory.instance().createBackCompatibleIntrospectionService(introspectionEndpoint, httpService.getClientEngine()); - BackCompatibleIntrospectionResponse backResponse = backCompatibleIntrospectionService.introspectToken(bearerToken(umaTokenService.getOAuthToken(rpId).getToken()), accessToken); - LOG.trace("Handled compatibility issue. Response: " + backResponse); - - IntrospectionResponse response = new IntrospectionResponse(); - response.setSub(backResponse.getSubject()); - response.setAudience(backResponse.getAudience()); - response.setTokenType(backResponse.getTokenType()); - response.setActive(backResponse.isActive()); - response.setScope(backResponse.getScopes()); - if (!backResponse.getScope().isEmpty()) { - response.setScope(backResponse.getScope()); - } - response.setIssuer(backResponse.getIssuer()); - response.setUsername(backResponse.getUsername()); - response.setClientId(backResponse.getClientId()); - response.setJti(backResponse.getJti()); - response.setAcrValues(backResponse.getAcrValues()); - response.setExpiresAt(dateToSeconds(backResponse.getExpiresAt())); - response.setIssuedAt(dateToSeconds(backResponse.getIssuedAt())); - - return response; - } - throw e; - } - } - - private String bearerToken(String token) { - return "Bearer " + token; - } - - public CorrectRptIntrospectionResponse introspectRpt(String rpId, String rpt) { - return introspectRpt(rpId, rpt, true); - } - - private CorrectRptIntrospectionResponse introspectRpt(String rpId, String rpt, boolean retry) { - final UmaMetadata metadata = discoveryService.getUmaDiscoveryByRpId(rpId); - - try { - final CorrectRptIntrospectionService introspectionService = opClientFactory.createClientFactory().createCorrectRptStatusService(metadata, httpService.getClientEngine()); - return introspectionService.requestRptStatus(bearerToken(umaTokenService.getPat(rpId).getToken()), rpt, ""); - } catch (ClientErrorException e) { - int httpStatus = e.getResponse().getStatus(); - if (retry && (httpStatus == 401 || httpStatus == 400 || httpStatus == 403)) { - umaTokenService.obtainPat(rpId).getToken(); - return introspectRpt(rpId, rpt, false); - } else { - throw e; - } - } catch (Throwable e) { - LOG.trace("Exception during rpt introspection, message: " + e.getMessage()); - if (e instanceof ReaderException) { // dummy construction but checked JsonParseException is thrown inside jackson provider, so we don't have choice - // trying to handle compatiblity issue. - LOG.trace("Trying to handle compatibility issue ..."); - BadRptIntrospectionService badService = ClientFactory.instance().createBadRptStatusService(metadata, httpService.getClientEngine()); - BadRptIntrospectionResponse badResponse = badService.requestRptStatus(bearerToken(umaTokenService.getPat(rpId).getToken()), rpt, ""); - - LOG.trace("Handled compatibility issue. Response: " + badResponse); - - final List permissions = new ArrayList<>(); - - CorrectRptIntrospectionResponse response = new CorrectRptIntrospectionResponse(); - response.setActive(badResponse.getActive()); - response.setClientId(badResponse.getClientId()); - response.setJti(badResponse.getJti()); - response.setExpiresAt(dateToSeconds(badResponse.getExpiresAt())); - response.setIssuedAt(dateToSeconds(badResponse.getIssuedAt())); - response.setNbf(dateToSeconds(badResponse.getNbf())); - response.setPermissions(permissions); - - if (badResponse.getPermissions() != null) { - for (BadUmaPermission badPermission : badResponse.getPermissions()) { - CorrectUmaPermission p = new CorrectUmaPermission(); - p.setExpiresAt(dateToSeconds(badPermission.getExpiresAt())); - p.setResourceId(badPermission.getResourceId()); - p.setScopes(badPermission.getScopes()); - - permissions.add(p); - } - } - - return response; - } - throw e; - } - } - - public static Integer dateToSeconds(Date date) { - return date != null ? (int) (date.getTime() / 1000) : null; - } -} diff --git a/jans-client-api/server/src/main/java/io/jans/ca/server/service/KeyGeneratorService.java b/jans-client-api/server/src/main/java/io/jans/ca/server/service/KeyGeneratorService.java deleted file mode 100644 index 414fc02fdf9..00000000000 --- a/jans-client-api/server/src/main/java/io/jans/ca/server/service/KeyGeneratorService.java +++ /dev/null @@ -1,209 +0,0 @@ -package io.jans.ca.server.service; - -import com.google.common.collect.Lists; -import io.jans.as.model.crypto.AbstractCryptoProvider; -import io.jans.as.model.crypto.AuthCryptoProvider; -import io.jans.as.model.crypto.signature.SignatureAlgorithm; -import io.jans.as.model.exception.CryptoProviderException; -import io.jans.as.model.exception.InvalidJwtException; -import io.jans.as.model.jwk.Algorithm; -import io.jans.as.model.jwk.JSONWebKey; -import io.jans.as.model.jwk.JSONWebKeySet; -import io.jans.as.model.jwk.Use; -import io.jans.as.model.jwt.Jwt; -import io.jans.as.model.util.Util; -import io.jans.ca.common.ErrorResponseCode; -import io.jans.ca.common.ExpiredObject; -import io.jans.ca.common.ExpiredObjectType; -import io.jans.ca.server.HttpException; -import io.jans.ca.server.configuration.ApiAppConfiguration; -import io.jans.ca.server.persistence.service.MainPersistenceService; -import io.jans.ca.server.persistence.service.PersistenceServiceImpl; -import jakarta.enterprise.context.ApplicationScoped; -import jakarta.inject.Inject; -import org.json.JSONObject; -import org.slf4j.Logger; - -import java.security.KeyStoreException; -import java.util.Calendar; -import java.util.Date; -import java.util.GregorianCalendar; -import java.util.List; - -@ApplicationScoped -public class KeyGeneratorService { - - @Inject - Logger logger; - - @Inject - PersistenceServiceImpl persistenceService; - - @Inject - MainPersistenceService jansConfigurationService; - - private JSONWebKeySet keys; - - public AbstractCryptoProvider getCryptoProvider() throws KeyStoreException { - ApiAppConfiguration configuration = getConfiguration(); - try { - return new AuthCryptoProvider(configuration.getCryptProviderKeyStorePath(), configuration.getCryptProviderKeyStorePassword(), configuration.getCryptProviderDnName()); - } catch (KeyStoreException e) { - logger.error("Failed to create CryptoProvider."); - throw e; - } - } - - private ApiAppConfiguration getConfiguration() { - return jansConfigurationService.find(); - } - - - public void generateKeys() throws KeyStoreException { - - List signatureAlgorithms = Lists.newArrayList(Algorithm.RS256, Algorithm.RS384, Algorithm.RS512, Algorithm.ES256, - Algorithm.ES384, Algorithm.ES512, Algorithm.PS256, Algorithm.PS384, Algorithm.PS512); - - List encryptionAlgorithms = Lists.newArrayList(Algorithm.RSA1_5, Algorithm.RSA_OAEP); - ApiAppConfiguration configuration = getConfiguration(); - try { - if (configuration.getEnableJwksGeneration()) { - JSONWebKeySet keySet = generateKeys(signatureAlgorithms, encryptionAlgorithms, configuration.getJwksExpirationInHours()); - saveKeysInStorage(keySet.toString()); - setKeys(keySet); - } - } catch (KeyStoreException e) { - logger.error("Failed to generate json web keys."); - throw e; - } - } - - private JSONWebKeySet generateKeys(List signatureAlgorithms, - List encryptionAlgorithms, int expirationHours) throws KeyStoreException { - logger.trace("Generating jwks keys..."); - JSONWebKeySet jwks = new JSONWebKeySet(); - - Calendar calendar = new GregorianCalendar(); - calendar.add(Calendar.HOUR, expirationHours); - - AbstractCryptoProvider cryptoProvider = getCryptoProvider(); - for (Algorithm algorithm : signatureAlgorithms) { - try { - JSONObject result = cryptoProvider.generateKey(algorithm, calendar.getTimeInMillis()); - - JSONWebKey key = JSONWebKey.fromJSONObject(result); - jwks.getKeys().add(key); - } catch (Exception ex) { - logger.error(ex.getMessage(), ex); - } - } - - for (Algorithm algorithm : encryptionAlgorithms) { - try { - JSONObject result = cryptoProvider.generateKey(algorithm, - calendar.getTimeInMillis()); - - JSONWebKey key = JSONWebKey.fromJSONObject(result); - jwks.getKeys().add(key); - } catch (Exception ex) { - logger.error(ex.getMessage(), ex); - } - } - - logger.trace("jwks generated successfully."); - return jwks; - } - - public Jwt sign(Jwt jwt, String sharedSecret, SignatureAlgorithm signatureAlgorithm) throws CryptoProviderException, KeyStoreException, InvalidJwtException { - try { - String signature = getCryptoProvider().sign(jwt.getSigningInput(), jwt.getHeader().getKeyId(), sharedSecret, signatureAlgorithm); - jwt.setEncodedSignature(signature); - return jwt; - } catch (CryptoProviderException | KeyStoreException | InvalidJwtException e) { - logger.error("Failed to sign signingInput."); - throw e; - } - } - - public JSONWebKeySet getKeys() throws KeyStoreException { - ApiAppConfiguration configuration = getConfiguration(); - if (configuration.getEnableJwksGeneration()) { - logger.info("Keys found: {}", keys); - if (keys != null && !keys.getKeys().isEmpty()) { - return this.keys; - } - //if keys not found then search in storage - JSONWebKeySet keyset = getKeysFromStorage(); - if (keyset != null && !keyset.getKeys().isEmpty()) { - this.keys = keyset; - return this.keys; - } - //generate new keys in case they do not exist - generateKeys(); - return this.keys; - } - logger.info("Relying party JWKS generation is disabled in running jans_client_api instance. To enable it set `enableJwksGeneration` field to true in ApiAppConfiguration."); - throw new HttpException(ErrorResponseCode.JWKS_GENERATION_DISABLE); - } - - public void setKeys(JSONWebKeySet keys) { - this.keys = keys; - } - - public String getKeyId(Algorithm algorithm, Use use) { - try { - AbstractCryptoProvider cryptoProvider = getCryptoProvider(); - final String kid = cryptoProvider.getKeyId(getKeys(), algorithm, use); - if (!cryptoProvider.getKeys().contains(kid)) { - return cryptoProvider.getKeyId(getKeys(), algorithm, use); - } - return kid; - - } catch (CryptoProviderException e) { - logger.error("Error in keyId generation", e); - } catch (KeyStoreException e) { - logger.error("Error in keystore", e); - } - return null; - } - - public void saveKeysInStorage(String jwks) { - persistenceService.createExpiredObject(new ExpiredObject(ExpiredObjectType.JWKS.getValue(), jwks, ExpiredObjectType.JWKS, getConfiguration().getJwksExpirationInHours() * 60)); - } - - public JSONWebKeySet getKeysFromStorage() { - ExpiredObject expiredObject = persistenceService.getExpiredObject(ExpiredObjectType.JWKS.getValue()); - logger.info("Expired Object found from Storage: {}", expiredObject); - if (expiredObject == null || Util.isNullOrEmpty(expiredObject.getValue())) { - return null; - } - - JSONObject keysInJson = new JSONObject(expiredObject.getValue()); - JSONWebKeySet keyset = JSONWebKeySet.fromJSONObject(keysInJson); - try { - if (hasKeysExpired(expiredObject)) { - logger.trace("The keys in storage got expired. Deleting the expired keys from storage."); - deleteKeysFromStorage(); - return null; - } - } catch (Exception e) { - logger.error("Error in reading expiry date or deleting expired keys from storage. Trying to delete the keys from storage.", e); - deleteKeysFromStorage(); - return null; - } - return keyset; - } - - public void deleteKeysFromStorage() { - persistenceService.deleteExpiredObjectsByKey(ExpiredObjectType.JWKS.getValue()); - } - - public boolean hasKeysExpired(ExpiredObject expiredObject) { - - long expirationDate = expiredObject.getExp().getTime(); - long today = new Date().getTime(); - long expiresInMinutes = (expirationDate - today) / (60 * 1000); - - return (expiresInMinutes <= 0); - } -} diff --git a/jans-client-api/server/src/main/java/io/jans/ca/server/service/MigrationService.java b/jans-client-api/server/src/main/java/io/jans/ca/server/service/MigrationService.java deleted file mode 100644 index 962cd413bf4..00000000000 --- a/jans-client-api/server/src/main/java/io/jans/ca/server/service/MigrationService.java +++ /dev/null @@ -1,45 +0,0 @@ -package io.jans.ca.server.service; - -import io.jans.ca.common.Jackson2; -import io.jans.ca.server.configuration.model.Rp; -import org.apache.commons.io.FileUtils; -import org.apache.commons.lang.StringUtils; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import java.io.File; -import java.io.IOException; - -/** - * @author yuriyz - */ -public class MigrationService { - - private MigrationService() { - - } - - private static final Logger LOG = LoggerFactory.getLogger(MigrationService.class); - - public static Rp parseRp(File file) { - try { - return parseRp(FileUtils.readFileToString(file)); - } catch (IOException e) { - LOG.error(e.getMessage(), e); - return null; - } - } - - public static Rp parseRp(String rpAsJson) { - try { - if (StringUtils.isBlank(rpAsJson)) { - return null; - } - return Jackson2.createJsonMapper().readValue(rpAsJson, Rp.class); - } catch (Exception e) { - LOG.error(e.getMessage(), e); - return null; - } - } - -} diff --git a/jans-client-api/server/src/main/java/io/jans/ca/server/service/PublicOpKeyService.java b/jans-client-api/server/src/main/java/io/jans/ca/server/service/PublicOpKeyService.java deleted file mode 100644 index ed0707846e9..00000000000 --- a/jans-client-api/server/src/main/java/io/jans/ca/server/service/PublicOpKeyService.java +++ /dev/null @@ -1,135 +0,0 @@ -package io.jans.ca.server.service; - -import com.google.common.base.Strings; -import com.google.common.cache.Cache; -import com.google.common.cache.CacheBuilder; -import com.google.common.collect.Lists; -import io.jans.as.client.JwkClient; -import io.jans.as.client.JwkResponse; -import io.jans.as.model.crypto.PublicKey; -import io.jans.as.model.crypto.signature.ECDSAPublicKey; -import io.jans.as.model.crypto.signature.RSAPublicKey; -import io.jans.as.model.crypto.signature.SignatureAlgorithm; -import io.jans.as.model.jwk.JSONWebKey; -import io.jans.as.model.jwk.JSONWebKeySet; -import io.jans.as.model.jwk.Use; -import io.jans.ca.server.op.OpClientFactory; -import io.jans.ca.server.persistence.service.MainPersistenceService; -import io.jans.util.Pair; -import jakarta.inject.Inject; -import org.jboss.resteasy.client.jaxrs.engines.ApacheHttpClient43Engine; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import java.util.List; -import java.util.Optional; -import java.util.concurrent.TimeUnit; - -/** - * @author Yuriy Zabrovarnyy - */ - -public class PublicOpKeyService { - - private static final Logger LOG = LoggerFactory.getLogger(PublicOpKeyService.class); - - private static Cache, PublicKey> cache; - @Inject - private HttpService httpService; - @Inject - OpClientFactory opClientFactory; - @Inject - MainPersistenceService jansConfigurationService; - - public PublicKey getPublicKey(String jwkSetUrl, String keyId, SignatureAlgorithm signatureAlgorithm, Use use) { - //Get keys from cache if present - Optional cachedKey = getCachedKey(jwkSetUrl, keyId, jansConfigurationService.find().getPublicOpKeyCacheExpirationInMinutes()); - - if (cachedKey.isPresent()) { - LOG.debug("Taken public key from cache. jwks_url: {}, kid : {} ", jwkSetUrl, keyId); - return cachedKey.get(); - } - //Request jwks from OP - JwkClient jwkClient = opClientFactory.createJwkClient(jwkSetUrl); - jwkClient.setExecutor(new ApacheHttpClient43Engine(httpService.getHttpClient())); - - JwkResponse jwkResponse = jwkClient.exec(); - if (jwkResponse == null || jwkResponse.getStatus() != 200) { - LOG.error("Failed to fetch public key from OP. Obtained Response : {}", (jwkResponse == null ? jwkResponse : jwkResponse.getStatus())); - throw new RuntimeException("Failed to fetch public key from OP. Obtained Response : " + (jwkResponse == null ? jwkResponse : jwkResponse.getStatus())); - } - - if (!Strings.isNullOrEmpty(keyId)) { - PublicKey publicKey = jwkResponse.getPublicKey(keyId); - if (publicKey != null) { - cache.put((new Pair<>(jwkSetUrl, keyId)), publicKey); - return publicKey; - } - - } else { - JSONWebKeySet jsonWebKeySet = jwkResponse.getJwks(); - List pks = Lists.newArrayList(); - for (JSONWebKey key : jsonWebKeySet.getKeys()) { - - if (key.getKty() == null) - continue; - - if (signatureAlgorithm.getFamily().toString().equals(key.getKty().toString()) && (use == null || use == key.getUse())) { - pks.add(getPublicKey(key)); - } - } - - if (pks.size() > 1) { - LOG.error("Multiple matching keys found in issuer's jwks_uri for algorithm : {}. `kid` must be provided in this case.", signatureAlgorithm.getName()); - throw new RuntimeException("Multiple matching keys found in issuer's jwks_uri for algorithm : " + signatureAlgorithm.getName() + ". `kid` must be provided in this case."); - } - - if (pks.size() == 1) { - if (!Strings.isNullOrEmpty(pks.get(0).getKeyId())) { - cache.put((new Pair<>(jwkSetUrl, pks.get(0).getKeyId())), pks.get(0)); - } - - return pks.get(0); - } - } - LOG.error("Failed to fetch public key from OP."); - throw new RuntimeException("Failed to fetch public key from OP."); - } - - private static Optional getCachedKey(String jwkSetUrl, String keyId, int keyCacheExpirationMinutes) { - if (Strings.isNullOrEmpty(keyId)) { - return Optional.empty(); - } - if (cache == null) { - cache = CacheBuilder.newBuilder() - .expireAfterWrite(keyCacheExpirationMinutes, TimeUnit.MINUTES) - .build(); - } - Pair mapKey = new Pair<>(jwkSetUrl, keyId); - return Optional.ofNullable(cache.getIfPresent(mapKey)); - } - - public PublicKey getPublicKey(JSONWebKey jsonWebKey) { - PublicKey publicKey = null; - - if (jsonWebKey != null) { - switch (jsonWebKey.getKty()) { - case RSA: - publicKey = new RSAPublicKey( - jsonWebKey.getN(), - jsonWebKey.getE()); - break; - case EC: - publicKey = new ECDSAPublicKey( - SignatureAlgorithm.fromString(jsonWebKey.getAlg().getParamName()), - jsonWebKey.getX(), - jsonWebKey.getY()); - break; - default: - break; - } - } - - return publicKey; - } -} diff --git a/jans-client-api/server/src/main/java/io/jans/ca/server/service/RequestObjectService.java b/jans-client-api/server/src/main/java/io/jans/ca/server/service/RequestObjectService.java deleted file mode 100644 index f11120432dd..00000000000 --- a/jans-client-api/server/src/main/java/io/jans/ca/server/service/RequestObjectService.java +++ /dev/null @@ -1,29 +0,0 @@ -package io.jans.ca.server.service; - -import io.jans.ca.common.ExpiredObject; -import io.jans.ca.common.ExpiredObjectType; -import io.jans.ca.server.persistence.service.MainPersistenceService; -import io.jans.ca.server.persistence.service.PersistenceService; -import jakarta.enterprise.context.ApplicationScoped; -import jakarta.inject.Inject; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -@ApplicationScoped -public class RequestObjectService { - private static final Logger LOG = LoggerFactory.getLogger(RequestObjectService.class); - - @Inject - PersistenceService persistenceService; - @Inject - MainPersistenceService configurationService; - - public void put(String requestUriId, String requestObject) { - persistenceService.createExpiredObject(new ExpiredObject(requestUriId, requestObject, ExpiredObjectType.REQUEST_OBJECT, configurationService.find().getRequestObjectExpirationInMinutes())); - } - - public ExpiredObject get(String requestUriId) { - return persistenceService.getExpiredObject(requestUriId); - } - -} diff --git a/jans-client-api/server/src/main/java/io/jans/ca/server/service/RpService.java b/jans-client-api/server/src/main/java/io/jans/ca/server/service/RpService.java deleted file mode 100644 index 923a256b85a..00000000000 --- a/jans-client-api/server/src/main/java/io/jans/ca/server/service/RpService.java +++ /dev/null @@ -1,158 +0,0 @@ -package io.jans.ca.server.service; - -import com.google.common.base.Preconditions; -import com.google.common.base.Strings; -import com.google.common.cache.Cache; -import com.google.common.cache.CacheBuilder; -import com.google.common.collect.Maps; -import io.jans.as.client.RegisterClient; -import io.jans.as.client.RegisterRequest; -import io.jans.ca.server.configuration.model.Rp; -import io.jans.ca.server.op.OpClientFactoryImpl; -import io.jans.ca.server.persistence.service.PersistenceServiceImpl; -import io.jans.ca.server.persistence.service.MainPersistenceService; -import org.apache.commons.lang.StringUtils; -import org.slf4j.Logger; - -import jakarta.enterprise.context.ApplicationScoped; -import jakarta.inject.Inject; - -import java.util.Map; -import java.util.Set; -import java.util.UUID; -import java.util.concurrent.TimeUnit; - -/** - * @author Yuriy Zabrovarnyy - */ -@ApplicationScoped -public class RpService { - - @Inject - Logger logger; - private static Cache rpCache; - - @Inject - MainPersistenceService jansConfigurationService; - - @Inject - ValidationService validationService; - @Inject - PersistenceServiceImpl persistenceService; - @Inject - OpClientFactoryImpl opClientFactory; - @Inject - HttpService httpService; - - private Cache getRpCache() { - if (rpCache != null) { - return rpCache; - } else { - return CacheBuilder.newBuilder() - .expireAfterWrite(jansConfigurationService.findConf() != null ? jansConfigurationService.find().getRpCacheExpirationInMinutes() : 60, TimeUnit.MINUTES) - .build(); - } - } - - public void removeAllRps() { - getRpCache().invalidateAll(); - persistenceService.removeAllRps(); - } - - public void load() { - Set rps = persistenceService.getRps(); - if (rps == null) - return; - - for (Rp rp : rps) { - put(rp); - } - } - - public Rp getRp(String rpId) { - Preconditions.checkNotNull(rpId); - Preconditions.checkState(!Strings.isNullOrEmpty(rpId)); - - Rp rp = getRpCache().getIfPresent(rpId); - if (rp == null) { - rp = persistenceService.getRp(rpId); - if (rp != null) { - getRpCache().put(rpId, rp); - } - } - rp = validationService.validate(rp); - return rp; - } - - public Map getRps() { - return Maps.newHashMap(getRpCache().asMap()); - } - - public void update(Rp rp) { - put(rp); - persistenceService.update(rp); - } - - public void updateSilently(Rp rp) { - try { - update(rp); - } catch (Exception e) { - logger.error("Failed to update site configuration: " + rp, e); - } - } - - public void create(Rp rp) { - if (StringUtils.isBlank(rp.getRpId())) { - rp.setRpId(UUID.randomUUID().toString()); - } - - if (getRpCache().getIfPresent(rp.getRpId()) == null) { - put(rp); - persistenceService.create(rp); - } else { - logger.error("RP already exists in database, rp_id: {}", rp.getRpId()); - } - } - - private Rp put(Rp rp) { - getRpCache().put(rp.getRpId(), rp); - return rp; - } - - public boolean remove(String rpId) { - boolean ok = persistenceService.remove(rpId); - if (ok) { - getRpCache().invalidate(rpId); - } - return ok; - } - - public Rp getRpByClientId(String clientId) { - for (Rp rp : getRpCache().asMap().values()) { - if (rp.getClientId().equalsIgnoreCase(clientId)) { - logger.trace("Found rp by client_id: {}, rp: {}", clientId, rp); - return rp; - } - } - return null; - } - - public Rp defaultRp() { - return jansConfigurationService.find().getDefaultSiteConfig(); - } - - public RegisterClient createRegisterClient(String registrationEndpoint, RegisterRequest registerRequest) { - RegisterClient registerClient = opClientFactory.createRegisterClient(registrationEndpoint); - registerClient.setRequest(registerRequest); - registerClient.setExecutor(httpService.getClientEngine()); - return registerClient; - } - - public MainPersistenceService getConfigurationService() { - return jansConfigurationService; - } - - public PersistenceServiceImpl getPersistenceService() { - return persistenceService; - } -} diff --git a/jans-client-api/server/src/main/java/io/jans/ca/server/service/RpSyncService.java b/jans-client-api/server/src/main/java/io/jans/ca/server/service/RpSyncService.java deleted file mode 100644 index 5cceece8c66..00000000000 --- a/jans-client-api/server/src/main/java/io/jans/ca/server/service/RpSyncService.java +++ /dev/null @@ -1,89 +0,0 @@ -package io.jans.ca.server.service; - -import io.jans.as.client.RegisterClient; -import io.jans.as.client.RegisterRequest; -import io.jans.as.client.RegisterResponse; -import io.jans.ca.server.Utils; -import io.jans.ca.server.configuration.model.Rp; -import io.jans.ca.server.mapper.RegisterResponseMapper; -import io.jans.ca.server.persistence.service.PersistenceServiceImpl; -import jakarta.enterprise.context.ApplicationScoped; -import jakarta.inject.Inject; -import jakarta.ws.rs.HttpMethod; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import java.util.Calendar; -import java.util.Date; - -@ApplicationScoped -public class RpSyncService { - @Inject - RpService rpService; - - @Inject - PersistenceServiceImpl persistenceService; - - private static final Logger LOG = LoggerFactory.getLogger(RpSyncService.class); - - public static boolean shouldSync(Rp rp) { - if (rp == null || !rp.isSyncClientFromOp()) - return false; - - if (rp.getLastSynced() == null) - return true; - - if ((Utils.addTimeToDate(rp.getLastSynced(), rp.getSyncClientPeriodInSeconds(), Calendar.SECOND).getTime() < new Date().getTime())) - return true; - - return false; - } - - public Rp getRp(String rpId) { - Rp rp = rpService.getRp(rpId); - if (!shouldSync(rp)) - return rp; - - return sync(rp); - } - - //this method added to skip the vadidations while running test cases. - public Rp getRpTest(String rpId) { - Rp rp = rpService.getRps().get(rpId); - if (!shouldSync(rp)) - return rp; - - return sync(rp); - } - - private Rp sync(Rp rp) { - if (!shouldSync(rp)) - return rp; - - try { - // read client with oxauth-client and update Rp object - final RegisterResponse response = readClientFromRp(rp.getClientRegistrationClientUri(), rp.getClientRegistrationAccessToken()); - - boolean isRpUpdated = RegisterResponseMapper.fillRp(rp, response); - if (isRpUpdated) { - rp.setLastSynced(new Date()); - persistenceService.update(rp); - LOG.debug("Successfully synced Rp object from OP. Rp: " + rp.toString()); - } - - return rp; - } catch (Exception e) { - LOG.error("Error in sync Rp object from OP: ", e); - return rp; - } - } - - public RegisterResponse readClientFromRp(String clientRegistrationClientUri, String clientRegistrationAccessToken) { - final RegisterRequest request = new RegisterRequest(clientRegistrationAccessToken); - request.setHttpMethod(HttpMethod.GET); - - final RegisterClient registerClient = new RegisterClient(clientRegistrationClientUri); - registerClient.setRequest(request); - return registerClient.exec(); - } -} diff --git a/jans-client-api/server/src/main/java/io/jans/ca/server/service/ServiceProvider.java b/jans-client-api/server/src/main/java/io/jans/ca/server/service/ServiceProvider.java deleted file mode 100644 index 1e5e7ecbd40..00000000000 --- a/jans-client-api/server/src/main/java/io/jans/ca/server/service/ServiceProvider.java +++ /dev/null @@ -1,130 +0,0 @@ -package io.jans.ca.server.service; - -import io.jans.ca.server.op.OpClientFactoryImpl; -import io.jans.ca.server.persistence.service.MainPersistenceService; - -public class ServiceProvider { - - private ValidationService validationService; - private MainPersistenceService jansConfigurationService; - private HttpService httpService; - private RpSyncService rpSyncService; - private DiscoveryService discoveryService; - private IntrospectionService introspectionService; - private RpService rpService; - private StateService stateService; - private UmaTokenService umaTokenService; - - private KeyGeneratorService keyGeneratorService; - private PublicOpKeyService publicOpKeyService; - - private RequestObjectService requestObjectService; - - private OpClientFactoryImpl opClientFactory; - - - - public ValidationService getValidationService() { - return validationService; - } - - public void setValidationService(ValidationService validationService) { - this.validationService = validationService; - } - - public void setConfigurationService(MainPersistenceService jansConfigurationService) { - this.jansConfigurationService = jansConfigurationService; - } - - public HttpService getHttpService() { - return httpService; - } - - public void setHttpService(HttpService httpService) { - this.httpService = httpService; - } - - public RpSyncService getRpSyncService() { - return rpSyncService; - } - - public void setRpSyncService(RpSyncService rpSyncService) { - this.rpSyncService = rpSyncService; - } - - public DiscoveryService getDiscoveryService() { - return discoveryService; - } - - public void setDiscoveryService(DiscoveryService discoveryService) { - this.discoveryService = discoveryService; - } - - public RpService getRpService() { - return rpService; - } - - public void setRpService(RpService rpService) { - this.rpService = rpService; - } - - public IntrospectionService getIntrospectionService() { - return introspectionService; - } - - public void setIntrospectionService(IntrospectionService introspectionService) { - this.introspectionService = introspectionService; - } - - public MainPersistenceService getJansConfigurationService() { - return jansConfigurationService; - } - - public StateService getStateService() { - return stateService; - } - - public void setStateService(StateService stateService) { - this.stateService = stateService; - } - - public UmaTokenService getUmaTokenService() { - return umaTokenService; - } - - public void setUmaTokenService(UmaTokenService umaTokenService) { - this.umaTokenService = umaTokenService; - } - - public KeyGeneratorService getKeyGeneratorService() { - return keyGeneratorService; - } - - public void setKeyGeneratorService(KeyGeneratorService keyGeneratorService) { - this.keyGeneratorService = keyGeneratorService; - } - - public PublicOpKeyService getPublicOpKeyService() { - return publicOpKeyService; - } - - public void setPublicOpKeyService(PublicOpKeyService publicOpKeyService) { - this.publicOpKeyService = publicOpKeyService; - } - - public RequestObjectService getRequestObjectService() { - return requestObjectService; - } - - public void setRequestObjectService(RequestObjectService requestObjectService) { - this.requestObjectService = requestObjectService; - } - - public void setOpClientFactory(OpClientFactoryImpl opClientFactory) { - this.opClientFactory = opClientFactory; - } - - public OpClientFactoryImpl getOpClientFactory() { - return opClientFactory; - } -} diff --git a/jans-client-api/server/src/main/java/io/jans/ca/server/service/StateService.java b/jans-client-api/server/src/main/java/io/jans/ca/server/service/StateService.java deleted file mode 100644 index 344f65c589d..00000000000 --- a/jans-client-api/server/src/main/java/io/jans/ca/server/service/StateService.java +++ /dev/null @@ -1,76 +0,0 @@ -package io.jans.ca.server.service; - -import io.jans.ca.common.ExpiredObject; -import io.jans.ca.common.ExpiredObjectType; -import io.jans.ca.server.Utils; -import io.jans.ca.server.persistence.service.PersistenceServiceImpl; -import io.jans.ca.server.persistence.service.MainPersistenceService; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import jakarta.enterprise.context.ApplicationScoped; -import jakarta.inject.Inject; -import java.io.UnsupportedEncodingException; -import java.math.BigInteger; -import java.security.SecureRandom; - -/** - * @author Yuriy Zabrovarnyy - */ -@ApplicationScoped -public class StateService { - - private static final Logger LOG = LoggerFactory.getLogger(StateService.class); - @Inject - PersistenceServiceImpl persistenceService; - @Inject - MainPersistenceService jansConfigurationService; - - private final SecureRandom random = new SecureRandom(); - - public String generateState() { - return putState(generateSecureString()); - } - - public String generateNonce() { - return putNonce(generateSecureString()); - } - - public String generateSecureString() { - return new BigInteger(130, random).toString(32); - } - - public boolean isExpiredObjectPresent(String key) { - return persistenceService.isExpiredObjectPresent(key); - } - - public void deleteExpiredObjectsByKey(String key) { - persistenceService.deleteExpiredObjectsByKey(key); - } - - public String putState(String state) { - persistenceService.createExpiredObject(new ExpiredObject(state, state, ExpiredObjectType.STATE, jansConfigurationService.find().getStateExpirationInMinutes())); - return state; - } - - public String putNonce(String nonce) { - persistenceService.createExpiredObject(new ExpiredObject(nonce, nonce, ExpiredObjectType.NONCE, jansConfigurationService.find().getNonceExpirationInMinutes())); - return nonce; - } - - public String encodeExpiredObject(String expiredObject, ExpiredObjectType type) throws UnsupportedEncodingException { - if (type == ExpiredObjectType.STATE && jansConfigurationService.find().getEncodeStateFromRequestParameter().booleanValue()) { - return Utils.encode(expiredObject); - } - - if (type == ExpiredObjectType.NONCE && jansConfigurationService.find().getEncodeNonceFromRequestParameter().booleanValue()) { - return Utils.encode(expiredObject); - } - - return expiredObject; - } - - public MainPersistenceService getConfigurationService() { - return jansConfigurationService; - } -} diff --git a/jans-client-api/server/src/main/java/io/jans/ca/server/service/UmaTokenService.java b/jans-client-api/server/src/main/java/io/jans/ca/server/service/UmaTokenService.java deleted file mode 100644 index 0bc7dad0c24..00000000000 --- a/jans-client-api/server/src/main/java/io/jans/ca/server/service/UmaTokenService.java +++ /dev/null @@ -1,389 +0,0 @@ -package io.jans.ca.server.service; - -import com.google.common.base.Strings; -import com.google.common.collect.Lists; -import io.jans.as.client.*; -import io.jans.as.model.common.AuthenticationMethod; -import io.jans.as.model.common.GrantType; -import io.jans.as.model.common.Prompt; -import io.jans.as.model.common.ResponseType; -import io.jans.as.model.uma.UmaMetadata; -import io.jans.as.model.uma.UmaScopeType; -import io.jans.as.model.uma.UmaTokenResponse; -import io.jans.as.model.util.Util; -import io.jans.ca.common.CoreUtils; -import io.jans.ca.common.ErrorResponseCode; -import io.jans.ca.common.Jackson2; -import io.jans.ca.common.introspection.CorrectRptIntrospectionResponse; -import io.jans.ca.common.params.RpGetRptParams; -import io.jans.ca.common.response.RpGetRptResponse; -import io.jans.ca.server.HttpException; -import io.jans.ca.server.Utils; -import io.jans.ca.server.configuration.ApiAppConfiguration; -import io.jans.ca.server.configuration.model.Rp; -import io.jans.ca.server.model.Pat; -import io.jans.ca.server.model.Token; -import io.jans.ca.server.model.TokenFactory; -import io.jans.ca.server.op.OpClientFactoryImpl; -import io.jans.ca.server.op.RpGetRptOperation; -import org.apache.commons.lang.StringUtils; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import jakarta.enterprise.context.ApplicationScoped; -import jakarta.inject.Inject; -import jakarta.ws.rs.client.Entity; -import jakarta.ws.rs.client.Invocation.Builder; -import jakarta.ws.rs.core.Form; -import jakarta.ws.rs.core.Response; -import java.io.IOException; -import java.util.*; - -/** - * @author Yuriy Zabrovarnyy - */ - -@ApplicationScoped -public class UmaTokenService { - - private static final Logger LOG = LoggerFactory.getLogger(UmaTokenService.class); - @Inject - RpService rpService; - @Inject - RpSyncService rpSyncService; - @Inject - ValidationService validationService; - @Inject - DiscoveryService discoveryService; - @Inject - HttpService httpService; - @Inject - ApiAppConfiguration configuration; - @Inject - StateService stateService; - @Inject - private OpClientFactoryImpl opClientFactory; - @Inject - IntrospectionService introspectionService; - - - public RpGetRptResponse getRpt(RpGetRptParams params) throws Exception { - Rp rp = rpSyncService.getRp(params.getRpId()); - UmaMetadata discovery = discoveryService.getUmaDiscoveryByRpId(params.getRpId()); - - if (!Strings.isNullOrEmpty(rp.getRpt()) && rp.getRptExpiresAt() != null) { - if (!CoreUtils.isExpired(rp.getRptExpiresAt())) { - LOG.debug("RPT from rp, RPT: " + rp.getRpt() + ", rp: " + rp); - - RpGetRptResponse result = new RpGetRptResponse(); - result.setRpt(rp.getRpt()); - result.setTokenType(rp.getRptTokenType()); - result.setPct(rp.getRptPct()); - result.setUpdated(rp.getRptUpgraded()); - return result; - } - } - - Builder client = opClientFactory.createClientRequest(discovery.getTokenEndpoint(), httpService.getClientEngine()); - client.header("Authorization", "Basic " + Utils.encodeCredentials(rp.getClientId(), rp.getClientSecret())); - - Form formRequest = new Form(); - formRequest.param("grant_type", GrantType.OXAUTH_UMA_TICKET.getValue()); - formRequest.param("ticket", params.getTicket()); - - if (params.getClaimToken() != null) { - formRequest.param("claim_token", params.getClaimToken()); - } - - if (params.getClaimTokenFormat() != null) { - formRequest.param("claim_token_format", params.getClaimTokenFormat()); - } - - if (params.getPct() != null) { - formRequest.param("pct", params.getPct()); - } - - if (params.getRpt() != null) { - formRequest.param("rpt", params.getRpt()); - } - - if (params.getScope() != null) { - formRequest.param("scope", Utils.joinAndUrlEncode(params.getScope())); - } - - if (params.getParams() != null && !params.getParams().isEmpty()) { - for (Map.Entry p : params.getParams().entrySet()) { - formRequest.param(p.getKey(), p.getValue()); - } - } - - Response response = null; - try { - response = client.buildPost(Entity.form(formRequest)).invoke(); - } catch (Exception e) { - LOG.error("Failed to receive RPT response for rp: " + rp, e); - throw new HttpException(ErrorResponseCode.FAILED_TO_GET_RPT); - } - - String entityResponse = null; - try { - entityResponse = response.readEntity(String.class); - } catch (Exception e) { - LOG.error("Failed to read RPT response for rp: " + rp, e); - throw new HttpException(ErrorResponseCode.FAILED_TO_GET_RPT); - } finally { - response.close(); - } - UmaTokenResponse tokenResponse = asTokenResponse(entityResponse); - - if (tokenResponse != null && StringUtils.isNotBlank(tokenResponse.getAccessToken())) { - CorrectRptIntrospectionResponse status = introspectionService.introspectRpt(params.getRpId(), tokenResponse.getAccessToken()); - - LOG.debug("RPT " + tokenResponse.getAccessToken() + ", status: " + status); - if (status.getActive()) { - LOG.debug("RPT is successfully obtained from AS. RPT: {}", tokenResponse.getAccessToken()); - - rp.setRpt(tokenResponse.getAccessToken()); - rp.setRptTokenType(tokenResponse.getTokenType()); - rp.setRptPct(tokenResponse.getPct()); - rp.setRptUpgraded(tokenResponse.getUpgraded()); - rp.setRptCreatedAt(new Date(status.getIssuedAt() * 1000)); - rp.setRptExpiresAt(new Date(status.getExpiresAt() * 1000)); - rpService.updateSilently(rp); - - RpGetRptResponse result = new RpGetRptResponse(); - result.setRpt(rp.getRpt()); - result.setTokenType(rp.getRptTokenType()); - result.setPct(rp.getRptPct()); - result.setUpdated(rp.getRptUpgraded()); - return result; - } - } else { - RpGetRptOperation.handleRptError(response.getStatus(), entityResponse); - } - - LOG.error("Failed to get RPT for rp: " + rp); - throw new HttpException(ErrorResponseCode.FAILED_TO_GET_RPT); - } - - private static UmaTokenResponse asTokenResponse(String entity) { - try { - return Jackson2.createJsonMapper().readValue(entity, UmaTokenResponse.class); - } catch (IOException e) { - return null; - } - } - - public Pat getPat(String rpId) { - validationService.notBlankRpId(rpId); - - Rp rp = rpSyncService.getRp(rpId); - - if (rp.getPat() != null && rp.getPatCreatedAt() != null && rp.getPatExpiresIn() != null && rp.getPatExpiresIn() > 0) { - Calendar expiredAt = Calendar.getInstance(); - expiredAt.setTime(rp.getPatCreatedAt()); - expiredAt.add(Calendar.SECOND, rp.getPatExpiresIn()); - - if (!CoreUtils.isExpired(expiredAt.getTime())) { - LOG.debug("PAT from site configuration, PAT: " + rp.getPat()); - return new Pat(rp.getPat(), "", rp.getPatExpiresIn()); - } - } - - return obtainPat(rpId); - } - - public Pat obtainPat(String rpId) { - Rp rp = rpSyncService.getRp(rpId); - Token token = obtainToken(rpId, UmaScopeType.PROTECTION, rp); - - rp.setPat(token.getToken()); - rp.setPatCreatedAt(new Date()); - rp.setPatExpiresIn(token.getExpiresIn()); - rp.setPatRefreshToken(token.getRefreshToken()); - - rpService.updateSilently(rp); - - return (Pat) token; - } - - public Token getOAuthToken(String rpId) { - validationService.notBlankRpId(rpId); - - Rp rp = rpSyncService.getRp(rpId); - - if (rp.getOauthToken() != null && rp.getOauthTokenCreatedAt() != null && rp.getOauthTokenExpiresIn() != null && rp.getOauthTokenExpiresIn() > 0) { - Calendar expiredAt = Calendar.getInstance(); - expiredAt.setTime(rp.getOauthTokenCreatedAt()); - expiredAt.add(Calendar.SECOND, rp.getOauthTokenExpiresIn()); - - if (!CoreUtils.isExpired(expiredAt.getTime())) { - LOG.debug("OauthToken from site configuration, OauthToken: " + rp.getOauthToken()); - return new Token(rp.getOauthToken(), "", rp.getOauthTokenExpiresIn()); - } - } - - return obtainOauthToken(rpId); - } - - public Token obtainOauthToken(String rpId) { - Rp rp = rpSyncService.getRp(rpId); - Token token = obtainToken(rpId, null, rp); - - rp.setOauthToken(token.getToken()); - rp.setOauthTokenCreatedAt(new Date()); - rp.setOauthTokenExpiresIn(token.getExpiresIn()); - rp.setOauthTokenRefreshToken(token.getRefreshToken()); - - rpService.updateSilently(rp); - - return token; - } - - private Token obtainToken(String rpId, UmaScopeType scopeType, Rp rp) { - - OpenIdConfigurationResponse discovery = discoveryService.getConnectDiscoveryResponseByRpId(rpId); - - final Token token; - if (useClientAuthentication(scopeType)) { - token = obtainTokenWithClientCredentials(discovery, rp, scopeType); - LOG.trace("Obtained token with client authentication: " + token); - } else { - token = obtainTokenWithUserCredentials(discovery, rp, scopeType); - LOG.trace("Obtained token with user credentials: " + token); - } - - return token; - } - - public boolean useClientAuthentication(UmaScopeType scopeType) { - if (scopeType == UmaScopeType.PROTECTION) { - return configuration.getUseClientAuthenticationForPat() != null && configuration.getUseClientAuthenticationForPat(); - } - return true; - } - - private Token obtainTokenWithClientCredentials(OpenIdConfigurationResponse discovery, Rp rp, UmaScopeType scopeType) { - final TokenClient tokenClient = opClientFactory.createTokenClientWithUmaProtectionScope(discovery.getTokenEndpoint()); - tokenClient.setExecutor(httpService.getClientEngine()); - final TokenResponse response = tokenClient.execClientCredentialsGrant(scopesAsString(scopeType), rp.getClientId(), rp.getClientSecret()); - if (response != null) { - if (Util.allNotBlank(response.getAccessToken())) { - if (scopeType != null && !response.getScope().contains(scopeType.getValue())) { - LOG.error("rp requested scope " + scopeType + " but AS returned access_token without that scope, token scopes :" + response.getScope()); - LOG.error("Please check AS(oxauth) configuration and make sure UMA scope (uma_protection) is enabled."); - throw new RuntimeException("rp requested scope " + scopeType + " but AS returned access_token without that scope, token scopes :" + response.getScope()); - } - - final Token opResponse = TokenFactory.newToken(scopeType); - opResponse.setToken(response.getAccessToken()); - opResponse.setRefreshToken(response.getRefreshToken()); - opResponse.setExpiresIn(response.getExpiresIn()); - return opResponse; - } else { - LOG.error("Token is blank in response, site: " + rp); - } - } else { - LOG.error("No response from TokenClient"); - } - throw new RuntimeException("Failed to obtain PAT."); - } - - private List scopes(UmaScopeType scopeType) { - final List scopes = new ArrayList(); - if (scopeType != null) { - scopes.add(scopeType.getValue()); - } - scopes.add("openid"); - return scopes; - } - - private String scopesAsString(UmaScopeType scopeType) { - String scopesAsString = ""; - for (String scope : scopes(scopeType)) { - scopesAsString += scope + " "; - } - return scopesAsString.trim(); - } - - private Token obtainTokenWithUserCredentials(OpenIdConfigurationResponse discovery, Rp rp, UmaScopeType scopeType) { - - // 1. Request authorization and receive the authorization code. - final List responseTypes = Lists.newArrayList(); - responseTypes.add(ResponseType.CODE); - responseTypes.add(ResponseType.ID_TOKEN); - - final String state = stateService.generateState(); - - final AuthorizationRequest request = new AuthorizationRequest(responseTypes, rp.getClientId(), scopes(scopeType), rp.getRedirectUri(), null); - request.setState(state); - request.setAuthUsername(rp.getUserId()); - request.setAuthPassword(rp.getUserSecret()); - request.getPrompts().add(Prompt.NONE); - - final AuthorizeClient authorizeClient = new AuthorizeClient(discovery.getAuthorizationEndpoint()); - authorizeClient.setExecutor(httpService.getClientEngine()); - authorizeClient.setRequest(request); - final AuthorizationResponse response1 = authorizeClient.exec(); - - final String scope = response1.getScope(); - final String authorizationCode = response1.getCode(); - if (!state.equals(response1.getState())) { - throw new HttpException(ErrorResponseCode.INVALID_STATE); - } - - if (Util.allNotBlank(authorizationCode)) { - - // 2. Request access token using the authorization code. - final TokenRequest tokenRequest = new TokenRequest(GrantType.AUTHORIZATION_CODE); - tokenRequest.setCode(authorizationCode); - tokenRequest.setRedirectUri(rp.getRedirectUri()); - tokenRequest.setAuthUsername(rp.getClientId()); - tokenRequest.setAuthPassword(rp.getClientSecret()); - tokenRequest.setAuthenticationMethod(AuthenticationMethod.CLIENT_SECRET_BASIC); - tokenRequest.setScope(scope); - - final TokenClient tokenClient1 = new TokenClient(discovery.getTokenEndpoint()); - tokenClient1.setRequest(tokenRequest); - tokenClient1.setExecutor(httpService.getClientEngine()); - final TokenResponse response2 = tokenClient1.exec(); - - if (response2.getStatus() == 200 && Util.allNotBlank(response2.getAccessToken())) { - final Token token = TokenFactory.newToken(scopeType); - token.setToken(response2.getAccessToken()); - token.setRefreshToken(response2.getRefreshToken()); - token.setExpiresIn(response2.getExpiresIn()); - return token; - } else { - LOG.error("Status: " + response2.getStatus() + ", Entity: " + response2.getEntity()); - } - } else { - LOG.debug("Authorization code is blank."); - } - throw new RuntimeException("Failed to obtain Token, scopeType: " + scopeType + ", site: " + rp); - } - - public HttpService getHttpService() { - return httpService; - } - - public OpClientFactoryImpl getOpClientFactory() { - return opClientFactory; - } - - public IntrospectionService getIntrospectionService() { - return introspectionService; - } - - public RpService getRpService() { - return rpService; - } - - public DiscoveryService getDiscoveryService() { - return discoveryService; - } - - public StateService getStateService() { - return stateService; - } -} \ No newline at end of file diff --git a/jans-client-api/server/src/main/java/io/jans/ca/server/service/ValidationService.java b/jans-client-api/server/src/main/java/io/jans/ca/server/service/ValidationService.java deleted file mode 100644 index 8b2e2ee30db..00000000000 --- a/jans-client-api/server/src/main/java/io/jans/ca/server/service/ValidationService.java +++ /dev/null @@ -1,206 +0,0 @@ -package io.jans.ca.server.service; - -import com.google.common.base.Strings; -import io.jans.as.model.common.IntrospectionResponse; -import io.jans.ca.common.ErrorResponseCode; -import io.jans.ca.common.params.*; -import io.jans.ca.server.HttpException; -import io.jans.ca.server.configuration.ApiAppConfiguration; -import io.jans.ca.server.configuration.model.Rp; -import io.jans.ca.server.persistence.service.MainPersistenceService; -import io.jans.util.Pair; -import org.apache.commons.lang.StringUtils; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import jakarta.enterprise.context.ApplicationScoped; -import jakarta.inject.Inject; -import java.net.MalformedURLException; -import java.net.URL; -import java.util.List; - -/** - * @author Yuriy Zabrovarnyy - */ -@ApplicationScoped -public class ValidationService { - - private static final Logger LOG = LoggerFactory.getLogger(ValidationService.class); - - @Inject - RpSyncService rpSyncService; - @Inject - RpService rpService; - @Inject - IntrospectionService introspectionService; - - @Inject - MainPersistenceService jansConfigurationService; - - private ApiAppConfiguration getConfiguration(){ - return jansConfigurationService.find(); - } - - private void notNull(IParams params) { - if (params == null) { - throw new HttpException(ErrorResponseCode.INTERNAL_ERROR_NO_PARAMS); - } - } - - public void notBlankRpId(String rpId) { - if (Strings.isNullOrEmpty(rpId)) { - throw new HttpException(ErrorResponseCode.BAD_REQUEST_NO_RP_ID); - } - } - - public void notBlankOpHost(String opHost) { - if (Strings.isNullOrEmpty(opHost)) { - throw new HttpException(ErrorResponseCode.INVALID_OP_HOST); - } - } - - public void validateOpConfigurationEndpoint(String opConfigurationEndpoint) { - if (Strings.isNullOrEmpty(opConfigurationEndpoint) || !opConfigurationEndpoint.contains(DiscoveryService.WELL_KNOWN_CONNECT_PATH)) { - throw new HttpException(ErrorResponseCode.INVALID_OP_CONFIGURATION_ENDPOINT); - } - } - - public void isOpHostAllowed(String opHost) { - List allowedOpHosts = getConfiguration().getAllowedOpHosts(); - if (!Strings.isNullOrEmpty(opHost) && !allowedOpHosts.isEmpty()) { - if (!allowedOpHosts.stream().anyMatch(allowedUrl -> { - try { - return (new URL(allowedUrl)).equals(new URL(opHost)); - } catch (MalformedURLException e) { - throw new HttpException(ErrorResponseCode.INVALID_ALLOWED_OP_HOST_URL); - } - } - )) { - throw new HttpException(ErrorResponseCode.RESTRICTED_OP_HOST); - } - } - } - - public Pair validate(IParams params) { - notNull(params); - if (isInstanceOfGetRpParamsWithList(params)) { - return new Pair(null, true); - } - - if (params instanceof HasRpIdParams) { - validate((HasRpIdParams) params); - } - - if (!(params instanceof RegisterSiteParams) && params instanceof HasRpIdParams) { - try { - String rpId = ((HasRpIdParams) params).getRpId(); - if (StringUtils.isNotBlank(rpId)) { - final Rp rp = rpSyncService.getRp(rpId); - if (rp != null) { - return new Pair<>(rp, false); - } - } - } catch (HttpException e) { - // ignore - } catch (Exception e) { - LOG.error("Failed to identify RP. Message: " + e.getMessage(), e); - } - } - if (params instanceof GetClientTokenParams) { - GetClientTokenParams p = (GetClientTokenParams) params; - String clientId = p.getClientId(); - Rp rp = rpService.getRpByClientId(clientId); - if (rp != null) { - return new Pair<>(rp, false); - } - } - if (params instanceof GetRpParams) { - GetRpParams p = (GetRpParams) params; - String rpId = p.getRpId(); - if (StringUtils.isNotBlank(rpId) && (p.getList() == null || !p.getList())) { - Rp rp = rpSyncService.getRp(rpId); - if (rp != null) { - return new Pair<>(rp, true); - } - } - } - return null; - } - - /** - * Returns whether has valid token - * - * @param accessToken - * @param rpId - */ - public void validateAccessToken(String accessToken, String rpId) { - - if (StringUtils.isBlank(accessToken)) { - throw new HttpException(ErrorResponseCode.BLANK_ACCESS_TOKEN); - } - - final Rp rp = rpSyncService.getRp(rpId); - - final IntrospectionResponse introspectionResponse = introspect(accessToken, rpId); - - LOG.trace("access_token: " + accessToken + ", introspection: " + introspectionResponse + ", clientId: " + rp.getClientId()); - if (StringUtils.isBlank(introspectionResponse.getClientId())) { - LOG.error("AS returned introspection response with empty/blank client_id which is required by jans_client_api. Please check your AS installation and make sure AS return client_id for introspection call (CE 3.1.0 or later)."); - throw new HttpException(ErrorResponseCode.NO_CLIENT_ID_IN_INTROSPECTION_RESPONSE); - } - if (!introspectionResponse.getScope().contains("jans_client_api")) { - LOG.error("access_token does not have `jans_client_api` scope. Make sure a) scope exists on AS b) register_site is registered with 'jans_client_api' scope c) get_client_token has 'jans_client_api' scope in request"); - throw new HttpException(ErrorResponseCode.ACCESS_TOKEN_INSUFFICIENT_SCOPE); - } - - if (introspectionResponse.getClientId().equals(rp.getClientId())) { - return; - } - LOG.error("No access token provided in Authorization header. Forbidden."); - throw new HttpException(ErrorResponseCode.INVALID_ACCESS_TOKEN); - } - - public IntrospectionResponse introspect(String accessToken, String rpId) { - if (StringUtils.isBlank(accessToken)) { - LOG.debug("access_token is blank. Command is protected by access_token, please provide valid token or otherwise switch off protection in configuration with protect_commands_with_access_token=false"); - throw new HttpException(ErrorResponseCode.BLANK_ACCESS_TOKEN); - } - - final Rp rp = rpSyncService.getRp(rpId); - - LOG.trace("Introspect token with rp: " + rp); - - final IntrospectionResponse response = introspectionService.introspectToken(rpId, accessToken); - - if (!response.isActive()) { - LOG.error("access_token is not active."); - throw new HttpException(ErrorResponseCode.INACTIVE_ACCESS_TOKEN); - } - return response; - } - - public void validate(HasRpIdParams params) { - notNull(params); - notBlankRpId(params.getRpId()); - } - - public Rp validate(Rp rp) { - if (rp == null) { - throw new HttpException(ErrorResponseCode.INVALID_RP_ID); - } - - notBlankRpId(rp.getRpId()); - notBlankOpHost(rp.getOpHost()); - isOpHostAllowed(rp.getOpHost()); - return rp; - } - - private static boolean isInstanceOfGetRpParamsWithList(IParams params) { - if (params instanceof GetRpParams) { - GetRpParams p = (GetRpParams) params; - return p.getList() != null && p.getList(); - } - return false; - } -} - diff --git a/jans-client-api/server/src/main/java/io/jans/ca/server/service/auth/AttributeServiceImpl.java b/jans-client-api/server/src/main/java/io/jans/ca/server/service/auth/AttributeServiceImpl.java deleted file mode 100644 index 8ca24d92d70..00000000000 --- a/jans-client-api/server/src/main/java/io/jans/ca/server/service/auth/AttributeServiceImpl.java +++ /dev/null @@ -1,14 +0,0 @@ -package io.jans.ca.server.service.auth; - -import io.jans.as.common.service.AttributeService; -import jakarta.enterprise.context.ApplicationScoped; - -@ApplicationScoped -public class AttributeServiceImpl extends AttributeService { - - - @Override - protected boolean isUseLocalCache() { - return false; - } -} \ No newline at end of file diff --git a/jans-client-api/server/src/main/java/io/jans/ca/server/service/auth/OrganizationServiceImpl.java b/jans-client-api/server/src/main/java/io/jans/ca/server/service/auth/OrganizationServiceImpl.java deleted file mode 100644 index dff19e18657..00000000000 --- a/jans-client-api/server/src/main/java/io/jans/ca/server/service/auth/OrganizationServiceImpl.java +++ /dev/null @@ -1,21 +0,0 @@ -package io.jans.ca.server.service.auth; - -import io.jans.model.ApplicationType; - -import jakarta.enterprise.context.ApplicationScoped; - -/** - * @author Yuriy Zabrovarnyy - */ -@ApplicationScoped -public class OrganizationServiceImpl extends io.jans.as.common.service.OrganizationService { - @Override - protected boolean isUseLocalCache() { - return false; - } - - public ApplicationType getApplicationType() { - //TODO: modify to JANS_CLIENT_API after merge - return ApplicationType.JANS_CONFIG_API; - } -} \ No newline at end of file diff --git a/jans-client-api/server/src/main/java/io/jans/ca/server/service/logger/LoggerServiceImpl.java b/jans-client-api/server/src/main/java/io/jans/ca/server/service/logger/LoggerServiceImpl.java deleted file mode 100644 index 0a75c2c4c83..00000000000 --- a/jans-client-api/server/src/main/java/io/jans/ca/server/service/logger/LoggerServiceImpl.java +++ /dev/null @@ -1,42 +0,0 @@ -package io.jans.ca.server.service.logger; - -import io.jans.ca.server.configuration.ApiAppConfiguration; -import jakarta.enterprise.context.ApplicationScoped; -import jakarta.inject.Inject; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -@ApplicationScoped -public class LoggerServiceImpl extends io.jans.service.logger.LoggerService { - - private static final Logger LOG = LoggerFactory.getLogger(LoggerServiceImpl.class); - - @Inject - private ApiAppConfiguration appConfiguration; - - - @Override - public boolean isDisableJdkLogger() { - LOG.info("Disable Jdk Logger : {}", appConfiguration.getDisableJdkLogger()); - return (appConfiguration.getDisableJdkLogger() != null) && appConfiguration.getDisableJdkLogger(); - } - - @Override - public String getLoggingLevel() { - return appConfiguration.getLoggingLevel(); - } - - @Override - public String getExternalLoggerConfiguration() { - LOG.info("Logger Configuration : {}", appConfiguration.getExternalLoggerConfiguration()); - return appConfiguration.getExternalLoggerConfiguration(); - } - - @Override - public String getLoggingLayout() { - return appConfiguration.getLoggingLayout(); - } - - -} - diff --git a/jans-client-api/server/src/main/java/io/jans/ca/server/utils/Convertor.java b/jans-client-api/server/src/main/java/io/jans/ca/server/utils/Convertor.java deleted file mode 100644 index 910f0812536..00000000000 --- a/jans-client-api/server/src/main/java/io/jans/ca/server/utils/Convertor.java +++ /dev/null @@ -1,57 +0,0 @@ -/** - * All rights reserved -- Copyright 2015 Gluu Inc. - */ -package io.jans.ca.server.utils; - -import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.node.POJONode; -import io.jans.ca.common.ErrorResponseCode; -import io.jans.ca.common.Jackson2; -import io.jans.ca.common.params.IParams; -import io.jans.ca.server.HttpException; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * Convenient static convertor. - * - * @author Yuriy Zabrovarnyy - */ - -public class Convertor { - - private static final Logger LOG = LoggerFactory.getLogger(Convertor.class); - - /** - * Avoid instance creation - */ - private Convertor() { - } - - /** - * Returns parameter object based on string representation. - * - * @param clazz parameter class - * @param parameter calss - * @return parameter object based on string representation - */ - public static T asParams(Class clazz, JsonNode jsonNodeParams) { - if (jsonNodeParams instanceof POJONode) { - return (T) ((POJONode) jsonNodeParams).getPojo(); - } - final String paramsAsString = jsonNodeParams != null ? jsonNodeParams.toString() : ""; - try { - T params = Jackson2.createJsonMapper().readValue(paramsAsString, clazz); - if (params == null) { - throw new HttpException(ErrorResponseCode.INTERNAL_ERROR_NO_PARAMS); - } - return params; - } catch (HttpException e) { - throw e; - } catch (Exception e) { - LOG.error(e.getMessage(), e); - } - LOG.error("Unable to parse string to params, string: {}", paramsAsString); - throw new HttpException(ErrorResponseCode.INTERNAL_ERROR_NO_PARAMS); - } -} diff --git a/jans-client-api/server/src/main/resources/META-INF/beans.xml b/jans-client-api/server/src/main/resources/META-INF/beans.xml deleted file mode 100644 index e246e2768f1..00000000000 --- a/jans-client-api/server/src/main/resources/META-INF/beans.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - \ No newline at end of file diff --git a/jans-client-api/server/src/main/resources/META-INF/services/jakarta.ws.rs.ext.Providers b/jans-client-api/server/src/main/resources/META-INF/services/jakarta.ws.rs.ext.Providers deleted file mode 100644 index 4cc92f1a8fa..00000000000 --- a/jans-client-api/server/src/main/resources/META-INF/services/jakarta.ws.rs.ext.Providers +++ /dev/null @@ -1 +0,0 @@ -io.jans.ca.server.filter.AuthorizationFilter \ No newline at end of file diff --git a/jans-client-api/server/src/main/resources/client-api-conf-test-h2.json b/jans-client-api/server/src/main/resources/client-api-conf-test-h2.json deleted file mode 100644 index a35224c346e..00000000000 --- a/jans-client-api/server/src/main/resources/client-api-conf-test-h2.json +++ /dev/null @@ -1,93 +0,0 @@ -{ - "loggingLevel":"INFO", - "loggingLayout":"text", - "externalLoggerConfiguration":"", - "disableJdkLogger":true, - "trustAllCerts": true, - "keyStorePath":"/opt/jans/jans-client-api/keys/client-api-server.keystore", - "keyStorePassword":"example", - "enableJwksGeneration": true, - "jwksExpirationInHours": 2400, - "jwksRegenerationIntervalInHours": 720, - "cryptProviderKeyStorePath": "/opt/jans/jans-client-api/keys/client-api-jwks.keystore", - "cryptProviderKeyStorePassword": "example", - "cryptProviderDnName": "CN=jans-client CA Certificates", - "mtlsEnabled": false, - "mtlsClientKeyStorePath": "", - "mtlsClientKeyStorePassword": "", - "bindIpAddresses":["*"], - "storage":"h2", - "storageConfiguration":{ - "dbFileLocation":"/opt/jans/jans-client-api/data/rp_db" - }, - "protectCommandsWithAccessToken":true, - "migrationSourceFolderPath":"", - "addClientCredentialsGrantTypeAutomaticallyDuringClientRegistration":false, - "uma2AutoRegisterClaimsGatheringEndpointAsRedirectUriOfClient": false, - "supportGoogleLogout": true, - "fapiEnabled": false, - "dbCleanupIntervalInHours": 1, - "stateExpirationInMinutes": 10, - "nonceExpirationInMinutes": 10, - "encodeStateFromRequestParameter": false, - "encodeNonceFromRequestParameter": false, - "rpCacheExpirationInMinutes": 60, - "idTokenValidationCHashRequired": true, - "idTokenValidationAtHashRequired": true, - "acceptIdTokenWithoutSignature": true, - "validateUserInfoWithIdToken": true, - "encodeClientIdInAuthorizationUrl": true, - "defaultSiteConfig":{ - "op_configuration_endpoint":"", - "response_types":["code"], - "grant_type":["authorization_code"], - "acr_values":[""], - "scope":["openid", "profile", "email"], - "ui_locales":["en"], - "claims_locales":["en"], - "contacts":[], - "redirect_uris":[], - "logout_redirect_uris":[], - "client_name":"", - "client_jwks_uri":"", - "token_endpoint_auth_method":"", - "token_endpoint_auth_signing_alg":"", - "request_uris":[], - "front_channel_logout_uri":"", - "sector_identifier_uri":"", - "claims_redirect_uri":[], - "client_id":"", - "client_secret":"", - "trusted_client":false, - "access_token_as_jwt":false, - "access_token_signing_alg":"", - "rpt_as_jwt":false, - "logo_uri":"", - "client_uri":"", - "policy_uri":"", - "front_channel_logout_session_required":false, - "tos_uri":"", - "jwks":"", - "id_token_binding_cnf":"", - "tls_client_auth_subject_dn":"", - "run_introspection_script_beforeaccess_token_as_jwt_creation_and_include_claims":false, - "id_token_signed_response_alg":"", - "id_token_encrypted_response_alg":"", - "id_token_encrypted_response_enc":"", - "user_info_signed_response_alg":"", - "user_info_encrypted_response_alg":"", - "user_info_encrypted_response_enc":"", - "request_object_signing_alg":"", - "request_object_encryption_alg":"", - "request_object_encryption_enc":"", - "default_max_age":null, - "require_auth_time":false, - "initiate_login_uri":"", - "authorized_origins":[], - "access_token_lifetime":null, - "software_id":"", - "software_version":"", - "software_statement":"", - "custom_attributes":{} - } -} \ No newline at end of file diff --git a/jans-client-api/server/src/main/resources/client-api-conf-test.json b/jans-client-api/server/src/main/resources/client-api-conf-test.json deleted file mode 100644 index dc18dfff296..00000000000 --- a/jans-client-api/server/src/main/resources/client-api-conf-test.json +++ /dev/null @@ -1,92 +0,0 @@ -{ - "loggingLevel":"INFO", - "loggingLayout":"text", - "externalLoggerConfiguration":"", - "disableJdkLogger":true, - "trustAllCerts": true, - "keyStorePath":"/opt/jans/jans-client-api/keys/client-api-server.keystore", - "keyStorePassword":"example", - "enableJwksGeneration": true, - "jwksExpirationInHours": 2400, - "jwksRegenerationIntervalInHours": 720, - "cryptProviderKeyStorePath": "/opt/jans/jans-client-api/keys/client-api-jwks.keystore", - "cryptProviderKeyStorePassword": "example", - "cryptProviderDnName": "CN=jans-client CA Certificates", - "mtlsEnabled": false, - "mtlsClientKeyStorePath": "", - "mtlsClientKeyStorePassword": "", - "bindIpAddresses":["*"], - "storage":"jans_server_configuration", - "storageConfiguration":{ - }, - "protectCommandsWithAccessToken":true, - "migrationSourceFolderPath":"", - "addClientCredentialsGrantTypeAutomaticallyDuringClientRegistration":false, - "uma2AutoRegisterClaimsGatheringEndpointAsRedirectUriOfClient": false, - "supportGoogleLogout": true, - "fapiEnabled": false, - "dbCleanupIntervalInHours": 1, - "stateExpirationInMinutes": 10, - "nonceExpirationInMinutes": 10, - "encodeStateFromRequestParameter": false, - "encodeNonceFromRequestParameter": false, - "rpCacheExpirationInMinutes": 60, - "idTokenValidationCHashRequired": true, - "idTokenValidationAtHashRequired": true, - "acceptIdTokenWithoutSignature": true, - "validateUserInfoWithIdToken": true, - "encodeClientIdInAuthorizationUrl": true, - "defaultSiteConfig":{ - "op_configuration_endpoint":"", - "response_types":["code"], - "grant_type":["authorization_code"], - "acr_values":[""], - "scope":["openid", "profile", "email"], - "ui_locales":["en"], - "claims_locales":["en"], - "contacts":[], - "redirect_uris":[], - "logout_redirect_uris":[], - "client_name":"", - "client_jwks_uri":"", - "token_endpoint_auth_method":"", - "token_endpoint_auth_signing_alg":"", - "request_uris":[], - "front_channel_logout_uri":"", - "sector_identifier_uri":"", - "claims_redirect_uri":[], - "client_id":"", - "client_secret":"", - "trusted_client":false, - "access_token_as_jwt":false, - "access_token_signing_alg":"", - "rpt_as_jwt":false, - "logo_uri":"", - "client_uri":"", - "policy_uri":"", - "front_channel_logout_session_required":false, - "tos_uri":"", - "jwks":"", - "id_token_binding_cnf":"", - "tls_client_auth_subject_dn":"", - "run_introspection_script_beforeaccess_token_as_jwt_creation_and_include_claims":false, - "id_token_signed_response_alg":"", - "id_token_encrypted_response_alg":"", - "id_token_encrypted_response_enc":"", - "user_info_signed_response_alg":"", - "user_info_encrypted_response_alg":"", - "user_info_encrypted_response_enc":"", - "request_object_signing_alg":"", - "request_object_encryption_alg":"", - "request_object_encryption_enc":"", - "default_max_age":null, - "require_auth_time":false, - "initiate_login_uri":"", - "authorized_origins":[], - "access_token_lifetime":null, - "software_id":"", - "software_version":"", - "software_statement":"", - "custom_attributes":{} - } -} \ No newline at end of file diff --git a/jans-client-api/server/src/main/resources/compile.properties b/jans-client-api/server/src/main/resources/compile.properties deleted file mode 100644 index ba6844b93f7..00000000000 --- a/jans-client-api/server/src/main/resources/compile.properties +++ /dev/null @@ -1,2 +0,0 @@ -compile.jans.base=${compile.jans.base} -compile.log.base=${compile.log.base} \ No newline at end of file diff --git a/jans-client-api/server/src/main/resources/log4j2.xml b/jans-client-api/server/src/main/resources/log4j2.xml deleted file mode 100644 index cbe3f1188f7..00000000000 --- a/jans-client-api/server/src/main/resources/log4j2.xml +++ /dev/null @@ -1,113 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/jans-client-api/server/src/main/resources/quartz.properties b/jans-client-api/server/src/main/resources/quartz.properties deleted file mode 100644 index 12cef917f4a..00000000000 --- a/jans-client-api/server/src/main/resources/quartz.properties +++ /dev/null @@ -1,4 +0,0 @@ -org.quartz.scheduler.instanceName=JansConfigScheduler -org.quartz.threadPool.threadCount=5 -org.quartz.jobStore.class=org.quartz.simpl.RAMJobStore -org.quartz.scheduler.skipUpdateCheck=true diff --git a/jans-client-api/server/src/main/resources/swagger.yaml b/jans-client-api/server/src/main/resources/swagger.yaml deleted file mode 100644 index f55f9112eae..00000000000 --- a/jans-client-api/server/src/main/resources/swagger.yaml +++ /dev/null @@ -1,2886 +0,0 @@ -# raw swagger spec link: -# https://raw.githubusercontent.com/JanssenProject/jans-client-api/master/server/src/main/resources/swagger.yaml -# https://gluu.org/swagger-ui/?url=https://raw.githubusercontent.com/JanssenProject/jans-client-api/master/server/src/main/resources/swagger.yaml -openapi: 3.0.1 -info: - title: jans-client-api-server - description: jans-client-api-server - contact: - email: yuriyz@gluu.org - license: - name: License - url: https://github.com/JanssenProject/jans-client-api/blob/master/LICENSE - version: "4.2" -servers: -- url: https://gluu.org/ -tags: -- name: developers - description: Operations available to regular developers -paths: - /health-check: - get: - tags: - - developers - summary: Health Check - description: Health Check endpoint is for quick check whether jans-client-api is - alive. - operationId: health-check - responses: - 200: - description: OK - content: {} - /register-site: - post: - tags: - - developers - summary: Register Site - description: Registers site at jans-client-api - operationId: register-site - requestBody: - content: - application/json: - schema: - title: RegisterSiteParams - required: - - redirect_uris - type: object - properties: - redirect_uris: - type: array - description: Provide the list of redirection URIs. The first URL - is where the user will be redirected after successful authorization - at the OpenID Connect Provider (OP). - example: - - https://client.example.org/cb - items: - type: string - op_configuration_endpoint: - type: string - example: https://op.example.com/acme/.well-known/openid-configuration - description: The openid configuration endpoint URL. If missing, then either - it must be present in defaults or `op_host` must be defined. - op_host: - type: string - description: Deprecated in favor of `op_configuration_endpoint`. It will be - removed in future version(s). Provide the URL of OpenID Provider (OP) in this - field. If missing, then `op_configuration_endpoint` must be defined. - deprecated: true - example: https:// - op_discovery_path: - type: string - example: /oxauth - deprecated: true - description: Deprecated in favor of `op_configuration_endpoint`. It will be - removed in future version(s). Provide path to the OpenID Connect Provider's - discovery document in this field. For example, if it is - 'https://example.com/.well-known/openid-configuration' then the path is blank. - But if it is 'https://example.com/oxauth/.well-known/openid-configuration' - then the path is '/oxauth' - post_logout_redirect_uris: - type: array - description: Provide the URLs supplied by the RP to request that - the user be redirected to this location after a logout has been - performed. - example: - - https://client.example.org/logout/page1 - - https://client.example.org/logout/page2 - - https://client.example.org/logout/page3 - items: - type: string - response_types: - type: array - description: Provide a list of the OAuth 2.0 response_type values - that the Client is declaring that it will restrict itself to using. - If omitted, the default is that the Client will use only the code - response type. - example: - - code - items: - type: string - grant_types: - type: array - description: Provide a list of the OAuth 2.0 grant types that the - Client is declaring that it will restrict itself to using. - example: - - authorization_code - - client_credentials - items: - type: string - scope: - type: array - description: Provide list of scope which are used during authentication - to authorize access to resource. - example: - - openid - items: - type: string - acr_values: - type: array - description: Provide Returns the Default requested Authentication - Context Class Reference values. - example: - - basic - items: - type: string - client_name: - type: string - description: jans-client-api will generate its own non-human readable name by - default if client_name is not specified - client_jwks_uri: - type: string - description: Provide the URL for the Client's JSON Web Key Set (JWK) - document containing key(s) that are used for signing requests - to the OP. The JWK Set may also contain the Client's encryption - keys(s) that are used by the OP to encrypt the responses to the - Client. When both signing and encryption keys are made available, - a use (Key Use) parameter value is required for all keys in the - document to indicate each key's intended usage . - client_token_endpoint_auth_method: - type: string - description: Provide the requested authentication method for the - Token Endpoint. Valid values are none, client_secret_basic, client_secret_post, - client_secret_jwt, private_key_jwt, access_token, tls_client_auth, - self_signed_tls_client_auth. - client_token_endpoint_auth_signing_alg: - type: string - description: Provide the Requested Client Authentication method - for the Token Endpoint. Valid values are none, HS256, HS384, HS512, - RS256, RS384, RS512, ES256, ES384, ES512, PS256, PS384, PS512. - client_request_uris: - type: array - description: Provide a list of request_uri values that are pre-registered - by the Client for use at the Authorization Server. - items: - type: string - client_frontchannel_logout_uri: - type: string - description: Provide frontchannel logout uri. - client_sector_identifier_uri: - type: string - description: Provide the URL using the https scheme to be used in - calculating Pseudonymous Identifiers by the OP. The URL references - a file with a single JSON array of redirect_uri values. - contacts: - type: array - description: Provide a list of e-mail addresses for people allowed - to administer the information for this Client - example: - - foo_bar@spam.org - items: - type: string - ui_locales: - type: array - description: Provide ui_locales, which can be used to pass the localization - from the client application to the server application in the authorize - request. - items: - type: string - claims_locales: - type: array - description: Provide claims_locales, which end-user's preferred - languages and scripts for Claims being returned. - items: - type: string - claims_redirect_uri: - type: array - items: - type: string - client_id: - type: string - description: client id of existing client, ignores all other parameters - and skips new client registration forcing to use existing client - (client_secret is required if this parameter is set). - client_secret: - type: string - description: client secret of existing client, must be used together - with client_id - access_token_as_jwt: - type: boolean - description: specifies whether access_token should be return as - JWT or not. Default value is false. - access_token_signing_alg: - type: string - description: sets signing algorithm used for JWT signing. Valid - values are none, HS256, HS384, HS512, RS256, RS384, RS512, ES256, - ES384, ES512, PS256, PS384, PS512 - rpt_as_jwt: - type: boolean - description: specifies whether RPT should be return as JWT or not. - Default value is false. - logo_uri: - type: string - description: specifies an URL that references a logo for the Client - application. - example: https://client.example.org/logo.png - client_uri: - type: string - description: specifies an URL of the home page of the Client. - example: https://client.example.org/page - policy_uri: - type: string - description: specifies an URL that the Relying Party Client provides - to the End-User to read about the how the profile data will be - used. - example: https://client.example.org/page - front_channel_logout_session_required: - type: boolean - description: specifies if front channel logout session required. - example: true - tos_uri: - type: string - description: specifies an URL that the Relying Party Client provides - to the End-User to read about the Relying Party's terms. - example: https://client.example.org/page - jwks: - type: string - description: Client's JSON Web Key Set (JWK) document, passed by - value. The semantics of the jwks parameter are the same as the - jwks_uri parameter, other than that the JWK Set is passed by value, - rather than by reference. This parameter is intended only to be - used by Clients that, for some reason, are unable to use the jwks_uri - parameter, for instance, by native applications that might not - have a location to host the contents of the JWK Set. If a Client - can use jwks_uri, it must not use jwks. One significant downside - of jwks is that it does not enable key rotation. The jwks_uri - and jwks parameters must not be used together. - example: '{"key1": "value1", "key2": "value2"}' - id_token_binding_cnf: - type: string - example: 4NRB1-0XZABZI9E6-5SM3R - tls_client_auth_subject_dn: - type: string - example: www.test.com - run_introspection_script_beforeaccess_token_as_jwt_creation_and_include_claims: - type: boolean - description: choose to run introspection script before access_token_as_jwt - creation and include claims. - example: true - id_token_signed_response_alg: - type: string - description: choose the JWS alg algorithm (JWA) required for the - ID Token issued to this client_id. Valid values are none, HS256, - HS384, HS512, RS256, RS384, RS512, ES256, ES384, ES512, PS256, - PS384, PS512 - id_token_encrypted_response_alg: - type: string - description: choose the JWE alg algorithm (JWA) required for encrypting - the ID Token issued to this client_id. Valid values are RSA1_5, - RSA-OAEP, A128KW, A256KW - id_token_encrypted_response_enc: - type: string - description: choose the JWE enc algorithm (JWA) required for symmetric - encryption of the ID Token issued to this client_id. Valid values - are A128CBC+HS256, A256CBC+HS512, A128GCM, A256GCM - user_info_signed_response_alg: - type: string - description: choose the JWS alg algorithm (JWA) required for UserInfo - responses. Valid values are none, HS256, HS384, HS512, RS256, - RS384, RS512, ES256, ES384, ES512, PS256, PS384, PS512 - user_info_encrypted_response_alg: - type: string - description: choose the JWE alg algorithm (JWA) required for encrypting - UserInfo responses. Valid values are RSA1_5, RSA_OAEP, A128KW, - A256KW - user_info_encrypted_response_enc: - type: string - description: choose the JWE enc algorithm (JWA) required for symmetric - encryption of UserInfo responses. Valid values are A128CBC+HS256, - A256CBC+HS512, A128GCM, A256GCM - request_object_signing_alg: - type: string - description: choose the JWS alg algorithm (JWA) that must be required - by the Authorization Server. Valid values are none, HS256, HS384, - HS512, RS256, RS384, RS512, ES256, ES384, ES512, PS256, PS384, - PS512 - request_object_encryption_alg: - type: string - description: choose the JWE alg algorithm (JWA) the RP is declaring - that it may use for encrypting Request Objects sent to the OP. - Valid values are RSA1_5, RSA_OAEP, A128KW, A256KW - request_object_encryption_enc: - type: string - description: choose the JWE enc algorithm (JWA) the RP is declaring - that it may use for encrypting Request Objects sent to the OP. - Valid values are A128CBC+HS256, A256CBC+HS512, A128GCM, A256GCM - default_max_age: - type: integer - description: specifies the Default Maximum Authentication Age. - example: 1000000 - require_auth_time: - type: boolean - description: specifies the Boolean value specifying whether the - auth_time claim in the id_token is required. It is required when - the value is true. The auth_time claim request in the request - object overrides this setting. - example: true - initiate_login_uri: - type: string - description: specifies the URI using the https scheme that the authorization - server can call to initiate a login at the client. - example: https://client.example.org/authorization/page - authorized_origins: - type: array - description: specifies authorized JavaScript origins. - items: - type: string - example: "" - access_token_lifetime: - type: integer - description: specifies the Client-specific access token expiration. - example: 100000000 - software_id: - type: string - description: specifies a unique identifier string (UUID) assigned - by the client developer or software publisher used by registration - endpoints to identify the client software to be dynamically registered. - example: 4NRB1-0XZABZI9E6-5SM3R - software_version: - type: string - description: specifies a version identifier string for the client - software identified by 'software_id'. The value of the 'software_version' - should change on any update to the client software identified - by the same 'software_id'. - example: "2.1" - software_statement: - type: string - description: specifies a software statement containing client metadata - values about the client software as claims. This is a string value - containing the entire signed JWT. - custom_attributes: - type: object - additionalProperties: - type: string - description: specifies custom attribute map copy. - sync_client_from_op: - type: boolean - description: specifies whether to sync client from OP. Default value - is false. - example: false - sync_client_period_in_seconds: - type: integer - description: specifies period after which client can sync again - with OP. Default value is 86400 (in seconds). - example: 86400 - allow_spontaneous_scopes: - type: boolean - description: specifies whether to allow spontaneous scopes for client. - The default value is false - example: false - spontaneous_scopes: - type: array - description: list of spontaneous scopes (regexp against which validation - is performed). - items: - type: string - example: ["^transaction:.+$", "^/user/[^/]+/.+$"] - required: false - responses: - 200: - description: OK - content: - application/json: - schema: - title: RegisterSiteResponse - required: - - op_host - - rp_id - type: object - properties: - rp_id: - type: string - example: bcad760f-91ba-46e1-a020-05e4281d91b6 - op_host: - type: string - example: https:// - client_id: - type: string - example: '@!1736.179E.AA60.16B2!0001!8F7C.B9AB!0008!A2BB.9AE6.5F14.B387' - client_name: - type: string - example: TestClientName - client_secret: - type: string - example: f436b936-03fc-433f-9772-53c2bc9e1c74 - client_registration_access_token: - type: string - example: d836df94-44b0-445a-848a-d43189839b17 - client_registration_client_uri: - type: string - example: https:///oxauth/restv1/register?client_id=@!1736.179E.AA60.16B2!0001!8F7C.B9AB!0008!A2BB.9AE6.5F14.B387 - client_id_issued_at: - type: integer - example: 1501854943 - client_secret_expires_at: - type: integer - example: 1501941343 - 400: - description: Invalid parameters are provided to endpoint. - content: - application/json: - schema: - $ref: '#/components/schemas/ErrorResponse' - 403: - description: Forbidden. Invalid access token provided in Authorization header. - content: - application/json: - schema: - $ref: '#/components/schemas/ErrorResponse' - 500: - description: Internal error occured. Please check client-api.log file for - details (usually located in /var/log/client-api/client-api.log). - content: - application/json: - schema: - $ref: '#/components/schemas/ErrorResponse' - x-codegen-request-body-name: RegisterSiteParams - /get-client-token: - post: - tags: - - developers - summary: Get Client Token - description: Gets Client Token - operationId: get-client-token - requestBody: - content: - application/json: - schema: - title: GetClientTokenParams - required: - - client_id - - client_secret - - op_configuration_endpoint - type: object - properties: - op_configuration_endpoint: - type: string - example: https://op.example.com/acme/.well-known/openid-configuration - description: The openid configuration endpoint URL. If missing, then - `op_host` must be defined. - op_host: - type: string - example: https:// - deprecated: true - description: Deprecated in favor of `op_configuration_endpoint`. It will be - removed in future version(s). Provide the URL of OpenID Provider (OP) in this - field. If missing, then `op_configuration_endpoint` must be defined. - op_discovery_path: - type: string - example: /oxauth - deprecated: true - description: Deprecated in favor of `op_configuration_endpoint`. It will be - removed in future version(s). Provide path to the OpenID Connect Provider's - discovery document in this field. For example, if it is - 'https://example.com/.well-known/openid-configuration' then the path is blank. - But if it is 'https://example.com/oxauth/.well-known/openid-configuration' - then the path is '/oxauth' - scope: - type: array - example: - - openid - items: - type: string - client_id: - type: string - example: '@!1736.179E.AA60.16B2!0001!8F7C.B9AB!0008!A2BB.9AE6.5F14.B387' - client_secret: - type: string - example: f436b936-03fc-433f-9772-53c2bc9e1c74 - authentication_method: - type: string - description: if value is missed then basic authentication is used. - Otherwise it's possible to set `private_key_jwt` value for Private - Key authentication. - algorithm: - type: string - description: optional but is required if authentication_method=private_key_jwt. - Valid values are none, HS256, HS384, HS512, RS256, RS384, RS512, - ES256, ES384, ES512 - key_id: - type: string - description: optional but is required if authentication_method=private_key_jwt. - It has to be valid key id from key store. - required: false - responses: - 200: - description: OK - content: - application/json: - schema: - title: GetClientTokenResponse - required: - - access_token - - expires_in - - refresh_token - - scope - type: object - properties: - scope: - type: array - example: - - openid - - rp - items: - type: string - access_token: - type: string - example: b75434ff-f465-4b70-92e4-b7ba6b6c58f2 - expires_in: - type: integer - example: 299 - refresh_token: - type: string - 400: - description: Invalid parameters are provided to endpoint. - content: - application/json: - schema: - $ref: '#/components/schemas/ErrorResponse' - 403: - description: Forbidden. Invalid access token provided in Authorization header. - content: - application/json: - schema: - $ref: '#/components/schemas/ErrorResponse' - 500: - description: Internal error occured. Please check client-api.log file for - details (usually located in /var/log/client-api/client-api.log). - content: - application/json: - schema: - $ref: '#/components/schemas/ErrorResponse' - x-codegen-request-body-name: GetClientTokenParams - /introspect-access-token: - post: - tags: - - developers - summary: Introspect Access Token - description: Introspect Access Token - operationId: introspect-access-token - parameters: - - name: Authorization - in: header - schema: - type: string - - name: AuthorizationRpId - in: header - schema: - type: string - requestBody: - content: - application/json: - schema: - title: IntrospectAccessTokenParams - required: - - access_token - - rp_id - type: object - properties: - rp_id: - type: string - example: bcad760f-91ba-46e1-a020-05e4281d91b6 - access_token: - type: string - example: b75434ff-f465-4b70-92e4-b7ba6b6c58f2 - required: false - responses: - 200: - description: OK - content: - application/json: - schema: - title: IntrospectAccessTokenResponse - required: - - acr_values - - active - - aud - - client_id - - exp - - extension_field - - iat - - iss - - jti - - nbf - - scope - - sub - - token_type - - username - type: object - properties: - active: - type: boolean - example: true - client_id: - type: string - example: '@!1736.179E.AA60.16B2!0001!8F7C.B9AB!0008!A2BB.9AE6.5F14.B387' - username: - type: string - example: John Black - scope: - type: array - items: - type: string - token_type: - type: string - example: bearer - sub: - type: string - example: jblack - aud: - type: string - example: l238j323ds-23ij4 - iss: - type: string - example: https://as.gluu.org/ - exp: - type: integer - description: number of seconds since January 1 1970 UTC, indicating - when this token will expire - format: int64 - example: 1535709072 - iat: - type: integer - description: number of seconds since January 1 1970 UTC, indicating - when the token was issued at - format: int64 - example: 1535709072 - nbf: - type: integer - description: number of seconds since January 1 1970 UTC, indicating - when the token not to be used before - format: int64 - example: 1535709072 - jti: - type: string - description: a unique identifier for the JWT - acr_values: - type: array - example: - - basic - items: - type: string - extension_field: - type: string - example: twenty-seven - 400: - description: Invalid parameters are provided to endpoint. - content: - application/json: - schema: - $ref: '#/components/schemas/ErrorResponse' - 403: - description: Forbidden. Invalid access token provided in Authorization header. - content: - application/json: - schema: - $ref: '#/components/schemas/ErrorResponse' - 500: - description: Internal error occured. Please check client-api.log file for - details (usually located in /var/log/client-api/client-api.log). - content: - application/json: - schema: - $ref: '#/components/schemas/ErrorResponse' - x-codegen-request-body-name: IntrospectAccessTokenParams - /update-site: - post: - tags: - - developers - summary: Update Site - description: Updates site at jans-client-api-server. If something changes in a pre-registered - client, you can use this API to update your client in the OP. - operationId: update-site - parameters: - - name: Authorization - in: header - schema: - type: string - - name: AuthorizationRpId - in: header - schema: - type: string - requestBody: - content: - application/json: - schema: - title: UpdateSiteParams - required: - - rp_id - type: object - properties: - rp_id: - type: string - example: 6F9619FF-8B86-D011-B42D-00CF4FC964FF - redirect_uris: - type: array - description: Provide the list of redirection URIs. The first URL - is where the user will be redirected after successful authorization - at the OpenID Connect Provider (OP). - example: - - https://client.example.org/cb - items: - type: string - post_logout_redirect_uris: - type: array - example: - - https://client.example.org/logout/page1 - - https://client.example.org/logout/page2 - - https://client.example.org/logout/page3 - items: - type: string - response_types: - type: array - example: - - code - items: - type: string - grant_types: - type: array - example: - - authorization_code - - client_credentials - items: - type: string - scope: - type: array - example: - - openid - items: - type: string - acr_values: - type: array - example: - - basic - items: - type: string - client_jwks_uri: - type: string - client_token_endpoint_auth_method: - type: string - client_request_uris: - type: array - items: - type: string - client_sector_identifier_uri: - type: string - contacts: - type: array - example: - - foo_bar@spam.org - items: - type: string - ui_locales: - type: array - items: - type: string - claims_locales: - type: array - items: - type: string - access_token_as_jwt: - type: boolean - description: specifies whether access_token should be return as - JWT or not. Default value is false. - access_token_signing_alg: - type: string - description: sets signing algorithm used for JWT signing. Valid - values are none, HS256, HS384, HS512, RS256, RS384, RS512, ES256, - ES384, ES512 - rpt_as_jwt: - type: boolean - description: specifies whether RPT should be return as JWT or not. - Default value is false. - claims_redirect_uri: - type: array - items: - type: string - client_token_endpoint_auth_signing_alg: - type: string - description: Provide the Requested Client Authentication method - for the Token Endpoint. Valid values are none, HS256, HS384, HS512, - RS256, RS384, RS512, ES256, ES384, ES512, PS256, PS384, PS512. - client_name: - type: string - description: rp will generate its own non-human readable name by - default if client_name is not specified - logo_uri: - type: string - description: specifies an URL that references a logo for the Client - application. - example: https://client.example.org/logo.png - client_uri: - type: string - description: specifies an URL of the home page of the Client. - example: https://client.example.org/page - policy_uri: - type: string - description: specifies an URL that the Relying Party Client provides - to the End-User to read about the how the profile data will be - used. - example: https://client.example.org/page - front_channel_logout_session_required: - type: boolean - description: specifies if front channel logout session required. - example: true - tos_uri: - type: string - description: specifies an URL that the Relying Party Client provides - to the End-User to read about the Relying Party's terms. - example: https://client.example.org/page - jwks: - type: string - description: Client's JSON Web Key Set (JWK) document, passed by - value. The semantics of the jwks parameter are the same as the - jwks_uri parameter, other than that the JWK Set is passed by value, - rather than by reference. This parameter is intended only to be - used by Clients that, for some reason, are unable to use the jwks_uri - parameter, for instance, by native applications that might not - have a location to host the contents of the JWK Set. If a Client - can use jwks_uri, it must not use jwks. One significant downside - of jwks is that it does not enable key rotation. The jwks_uri - and jwks parameters must not be used together. - example: '{"key1": "value1", "key2": "value2"}' - id_token_binding_cnf: - type: string - example: 4NRB1-0XZABZI9E6-5SM3R - tls_client_auth_subject_dn: - type: string - example: www.test.com - run_introspection_script_beforeaccess_token_as_jwt_creation_and_include_claims: - type: boolean - description: choose to run introspection script before access_token_as_jwt - creation and include claims. - example: true - id_token_signed_response_alg: - type: string - description: choose the JWS alg algorithm (JWA) required for the - ID Token issued to this client_id. Valid values are none, HS256, - HS384, HS512, RS256, RS384, RS512, ES256, ES384, ES512, PS256, - PS384, PS512 - id_token_encrypted_response_alg: - type: string - description: choose the JWE alg algorithm (JWA) required for encrypting - the ID Token issued to this client_id. Valid values are RSA1_5, - RSA-OAEP, A128KW, A256KW - id_token_encrypted_response_enc: - type: string - description: choose the JWE enc algorithm (JWA) required for symmetric - encryption of the ID Token issued to this client_id. Valid values - are A128CBC+HS256, A256CBC+HS512, A128GCM, A256GCM - user_info_signed_response_alg: - type: string - description: choose the JWS alg algorithm (JWA) required for UserInfo - responses. Valid values are none, HS256, HS384, HS512, RS256, - RS384, RS512, ES256, ES384, ES512, PS256, PS384, PS512 - user_info_encrypted_response_alg: - type: string - description: choose the JWE alg algorithm (JWA) required for encrypting - UserInfo responses. Valid values are RSA1_5, RSA_OAEP, A128KW, - A256KW - user_info_encrypted_response_enc: - type: string - description: choose the JWE enc algorithm (JWA) required for symmetric - encryption of UserInfo responses. Valid values are A128CBC+HS256, - A256CBC+HS512, A128GCM, A256GCM - request_object_signing_alg: - type: string - description: choose the JWS alg algorithm (JWA) that must be required - by the Authorization Server. Valid values are none, HS256, HS384, - HS512, RS256, RS384, RS512, ES256, ES384, ES512, PS256, PS384, - PS512 - request_object_encryption_alg: - type: string - description: choose the JWE alg algorithm (JWA) the RP is declaring - that it may use for encrypting Request Objects sent to the OP. - Valid values are RSA1_5, RSA_OAEP, A128KW, A256KW - request_object_encryption_enc: - type: string - description: choose the JWE enc algorithm (JWA) the RP is declaring - that it may use for encrypting Request Objects sent to the OP. - Valid values are A128CBC+HS256, A256CBC+HS512, A128GCM, A256GCM - default_max_age: - type: integer - description: specifies the Default Maximum Authentication Age. - example: 1000000 - require_auth_time: - type: boolean - description: specifies the Boolean value specifying whether the - auth_time claim in the id_token is required. It is required when - the value is true. The auth_time claim request in the request - object overrides this setting. - example: true - initiate_login_uri: - type: string - description: specifies the URI using the https scheme that the authorization - server can call to initiate a login at the client. - example: https://client.example.org/authorization/page - authorized_origins: - type: array - description: specifies authorized JavaScript origins. - items: - type: string - example: "" - access_token_lifetime: - type: integer - description: specifies the Client-specific access token expiration. - example: 100000000 - software_id: - type: string - description: specifies a unique identifier string (UUID) assigned - by the client developer or software publisher used by registration - endpoints to identify the client software to be dynamically registered. - example: 4NRB1-0XZABZI9E6-5SM3R - software_version: - type: string - description: specifies a version identifier string for the client - software identified by 'software_id'. The value of the 'software_version' - should change on any update to the client software identified - by the same 'software_id'. - example: "2.1" - software_statement: - type: string - description: specifies a software statement containing client metadata - values about the client software as claims. This is a string value - containing the entire signed JWT. - custom_attributes: - type: object - additionalProperties: - type: string - description: specifies custom attribute map copy. - sync_client_from_op: - type: boolean - description: specifies whether to sync client from OP. Default value - is false. - example: false - sync_client_period_in_seconds: - type: integer - description: specifies period after which client can sync again - with OP. Default value is 86400 (in seconds). - example: 86400 - allow_spontaneous_scopes: - type: boolean - description: specifies whether to allow spontaneous scopes for client. - The default value is false - example: false - spontaneous_scopes: - type: array - description: list of spontaneous scopes (regexp against which validation - is performed). - items: - type: string - example: ["^transaction:.+$", "^/user/[^/]+/.+$"] - required: false - responses: - 200: - description: OK - content: - application/json: - schema: - title: UpdateSiteResponse - required: - - rp_id - type: object - properties: - rp_id: - $ref: '#/components/schemas/rp_id' - 400: - description: Invalid parameters are provided to endpoint. - content: - application/json: - schema: - $ref: '#/components/schemas/ErrorResponse' - 403: - description: Forbidden. Invalid access token provided in Authorization header. - content: - application/json: - schema: - $ref: '#/components/schemas/ErrorResponse' - 500: - description: Internal error occured. Please check client-api.log file for - details (usually located in /var/log/client-api/client-api.log). - content: - application/json: - schema: - $ref: '#/components/schemas/ErrorResponse' - x-codegen-request-body-name: UpdateSiteParams - /remove-site: - post: - tags: - - developers - summary: Remove Site - description: Removes site from jans-client-api-server - operationId: remove-site - parameters: - - name: Authorization - in: header - schema: - type: string - - name: AuthorizationRpId - in: header - schema: - type: string - requestBody: - content: - application/json: - schema: - title: RemoveSiteParams - required: - - rp_id - type: object - properties: - rp_id: - type: string - example: 6F9619FF-8B86-D011-B42D-00CF4FC964FF - required: false - responses: - 200: - description: OK - content: - application/json: - schema: - title: RemoveSiteResponse - required: - - rp_id - type: object - properties: - rp_id: - $ref: '#/components/schemas/rp_id' - 400: - description: Invalid parameters are provided to endpoint. - content: - application/json: - schema: - $ref: '#/components/schemas/ErrorResponse' - 403: - description: Forbidden. Invalid access token provided in Authorization header. - content: - application/json: - schema: - $ref: '#/components/schemas/ErrorResponse' - 500: - description: Internal error occured. Please check client-api.log file for - details (usually located in /var/log/client-api/client-api.log). - content: - application/json: - schema: - $ref: '#/components/schemas/ErrorResponse' - x-codegen-request-body-name: RemoveSiteParams - /get-authorization-url: - post: - tags: - - developers - summary: Get Authorization Url - description: Gets authorization url - operationId: get-authorization-url - parameters: - - name: Authorization - in: header - schema: - type: string - - name: AuthorizationRpId - in: header - schema: - type: string - requestBody: - content: - application/json: - schema: - title: GetAuthorizationUrlParams - required: - - rp_id - type: object - properties: - rp_id: - type: string - example: bcad760f-91ba-46e1-a020-05e4281d91b6 - scope: - type: array - example: - - openid - items: - type: string - acr_values: - type: array - example: - - basic - items: - type: string - prompt: - type: string - state: - type: string - nonce: - type: string - redirect_uri: - type: string - example: https://client.example.org/cb - response_types: - type: array - description: Provide a list of the OAuth 2.0 response_type values - that the Client is declaring that it will restrict itself to using. - If omitted, the default is that the Client will use only the code - response type. - example: - - code - items: - type: string - custom_parameters: - type: object - additionalProperties: - type: string - params: - type: object - additionalProperties: - type: string - required: false - responses: - 200: - description: OK - content: - application/json: - schema: - title: GetAuthorizationUrlResponse - required: - - authorization_url - type: object - properties: - authorization_url: - type: string - example: https:///oxauth/restv1/authorize?response_type=code&client_id=@!1736.179E.AA60.16B2!0001!8F7C.B9AB!0008!8A36.24E1.97DE.F4EF&redirect_uri=https://192.168.200.95/&scope=openid+profile+email+uma_protection+uma_authorization&state=473ot4nuqb4ubeokc139raur13&nonce=lbrdgorr974q66q6q9g454iccm - 400: - description: Invalid parameters are provided to endpoint. - content: - application/json: - schema: - $ref: '#/components/schemas/ErrorResponse' - 403: - description: Forbidden. Invalid access token provided in Authorization header. - content: - application/json: - schema: - $ref: '#/components/schemas/ErrorResponse' - 500: - description: Internal error occured. Please check client-api.log file for - details (usually located in /var/log/client-api/client-api.log). - content: - application/json: - schema: - $ref: '#/components/schemas/ErrorResponse' - x-codegen-request-body-name: GetAuthorizationUrlParams - /get-tokens-by-code: - post: - tags: - - developers - summary: Get Tokens By Code - description: Get tokens by code - operationId: get-tokens-by-code - parameters: - - name: Authorization - in: header - schema: - type: string - - name: AuthorizationRpId - in: header - schema: - type: string - requestBody: - content: - application/json: - schema: - title: GetTokensByCodeParams - required: - - code - - rp_id - - state - type: object - properties: - rp_id: - type: string - example: bcad760f-91ba-46e1-a020-05e4281d91b6 - code: - type: string - example: 0b9f1518-15aa-47b2-9477-d4c607447e18 - state: - type: string - example: 6q1ec90hn6ui4ipigv91hrbodj - authentication_method: - type: string - description: if value is missed then basic authentication is used. - Otherwise it's possible to set `private_key_jwt` value for Private - Key authentication. - algorithm: - type: string - description: optional but is required if authentication_method=private_key_jwt. - Valid values are none, HS256, HS384, HS512, RS256, RS384, RS512, - ES256, ES384, ES512 - required: false - responses: - 200: - description: OK - content: - application/json: - schema: - title: GetTokensByCodeResponse - required: - - access_token - - expires_in - - id_token - - id_token_claims - - refresh_token - type: object - properties: - access_token: - type: string - example: b75434ff-f465-4b70-92e4-b7ba6b6c58f2 - expires_in: - type: integer - example: 299 - id_token: - type: string - example: eyJraWQiOiI5MTUyNTU1Ni04YmIwLTQ2MzYtYTFhYy05ZGVlNjlhMDBmYWUiLCJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJp - refresh_token: - type: string - example: 33d7988e-6ffb-4fe5-8c2a-0e158691d446 - id_token_claims: - type: object - properties: {} - 400: - description: Invalid parameters are provided to endpoint. - content: - application/json: - schema: - $ref: '#/components/schemas/ErrorResponse' - 403: - description: Forbidden. Invalid access token provided in Authorization header. - content: - application/json: - schema: - $ref: '#/components/schemas/ErrorResponse' - 500: - description: Internal error occured. Please check client-api.log file for - details (usually located in /var/log/client-api/client-api.log). - content: - application/json: - schema: - $ref: '#/components/schemas/ErrorResponse' - x-codegen-request-body-name: GetTokensByCodeParams - /get-user-info: - post: - tags: - - developers - summary: Get User Info - description: Get User Info - operationId: get-user-info - parameters: - - name: Authorization - in: header - schema: - type: string - - name: AuthorizationRpId - in: header - schema: - type: string - requestBody: - content: - application/json: - schema: - title: GetUserInfoParams - required: - - access_token - - rp_id - type: object - properties: - rp_id: - type: string - example: bcad760f-91ba-46e1-a020-05e4281d91b6 - access_token: - type: string - example: 88bba7f5-961c-4b71-8053-9ab35f1ad395 - id_token: - type: string - required: false - responses: - 200: - description: OK - content: - application/json: - schema: - title: GetUserInfoResponse - type: object - additionalProperties: - type: object - properties: {} - 400: - description: Invalid parameters are provided to endpoint. - content: - application/json: - schema: - $ref: '#/components/schemas/ErrorResponse' - 403: - description: Forbidden. Invalid access token provided in Authorization header. - content: - application/json: - schema: - $ref: '#/components/schemas/ErrorResponse' - 500: - description: Internal error occured. Please check client-api.log file for - details (usually located in /var/log/client-api/client-api.log). - content: - application/json: - schema: - $ref: '#/components/schemas/ErrorResponse' - x-codegen-request-body-name: GetUserInfoParams - /get-logout-uri: - post: - tags: - - developers - summary: Get Logout URL - description: Get Logout URL - operationId: get-logout-uri - parameters: - - name: Authorization - in: header - schema: - type: string - - name: AuthorizationRpId - in: header - schema: - type: string - requestBody: - content: - application/json: - schema: - title: GetLogoutUriParams - required: - - id_token_hint - - rp_id - - post_logout_redirect_uri - - session_state - - state - type: object - properties: - rp_id: - type: string - example: bcad760f-91ba-46e1-a020-05e4281d91b6 - id_token_hint: - type: string - example: eyJ0 ... NiJ9.eyJ1c ... I6IjIifX0.DeWt4Qu ... ZXso - post_logout_redirect_uri: - type: string - example: https://client.example.org/cb - state: - type: string - session_state: - type: string - required: false - responses: - 200: - description: OK - content: - application/json: - schema: - title: GetLogoutUriResponse - required: - - uri - type: object - properties: - uri: - type: string - example: https:///oxauth/seam/resource/restv1/oxauth/end_session?id_token_hint=eyJraWQiOiI1YmM2ZGM3MS0xYjA1LTQ5YzMtYWU3MC0zYTg4Y2ZiMjQwN2QiLCJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJpc3MiOiJodHRwczovL2NlLWRldi5nbHV1Lm9yZyIsImF1ZCI6IkAhNUE1OC5BRTBELkQzODMuMUU0NiEwMDAxIUUzOEIuN0RCRSEwMDA4IUE3MTkuOTU4QS41QjdGLkVBQkMiLCJleHAiOjE0OTAwMTk5MjEsImlhdCI6MTQ5MDAxNjMyMSwibm9uY2UiOiJkNGdsbmtndHAxYWlqZ3JnY3V2cGp1N2k3cCIsImF1dGhfdGltZSI6MTQ5MDAxNjI3MiwiYXRfaGFzaCI6Im1Xa2NXQzZ6NC1qN0ZNX0ctX0tYMWciLCJveFZhbGlkYXRpb25VUkkiOiJodHRwczovL2NlLWRldi5nbHV1Lm9yZy9veGF1dGgvb3BpZnJhbWUiLCJveE9wZW5JRENvbm5lY3RWZXJzaW9uIjoib3BlbmlkY29ubmVjdC0xLjAiLCJzdWIiOiJONHRLRncyLVpDWTVWN0FhQmdpMnNHRWdDR0t0Tlg2LS01M2FQbmZFYk5zIn0.PvCdzPnMwqPNUw1bzd8tvzpJqYu-P2iCTnELr85ZaJTG8_Fdj3EruLgUBa-emeum3j29cFgdjFPx6WplfCV1GnehOieXjDiAAE85fy-stxXwII3xrva5ZjG0FnTYnJLoRmy0BWMjFC2IdCoISJI9imcfvmQmlvNmU0EjLS02cJf3JAaqEaM-FJWdQv8end9-Sq2bcp6ME3voRjV30ps_7jcDdlM_hW3M_e3RdrXYCDifbl_1jaNip5tb6_bLpgTADDoLT3fTvACRN057e2GCkSYdxvVhIjfDsjnOhk5n3TDcWedriu99H8-sNXyI_aBr3HAXd37CsgmdfIJcgUNJJw - 400: - description: Invalid parameters are provided to endpoint. - content: - application/json: - schema: - $ref: '#/components/schemas/ErrorResponse' - 403: - description: Forbidden. Invalid access token provided in Authorization header. - content: - application/json: - schema: - $ref: '#/components/schemas/ErrorResponse' - 500: - description: Internal error occured. Please check client-api.log file for - details (usually located in /var/log/client-api/client-api.log). - content: - application/json: - schema: - $ref: '#/components/schemas/ErrorResponse' - x-codegen-request-body-name: GetLogoutUriParams - /get-access-token-by-refresh-token: - post: - tags: - - developers - summary: Get Access Token By Refresh Token - description: Get Access Token By Refresh Token - operationId: get-access-token-by-refresh-token - parameters: - - name: Authorization - in: header - schema: - type: string - - name: AuthorizationRpId - in: header - schema: - type: string - requestBody: - content: - application/json: - schema: - title: GetAccessTokenByRefreshTokenParams - required: - - rp_id - - refresh_token - - scope - type: object - properties: - rp_id: - type: string - example: bcad760f-91ba-46e1-a020-05e4281d91b6 - refresh_token: - type: string - example: 33d7988e-6ffb-4fe5-8c2a-0e158691d446 - scope: - type: array - example: - - openid - items: - type: string - required: false - responses: - 200: - description: OK - content: - application/json: - schema: - title: GetAccessTokenByRefreshTokenResponse - required: - - access_token - - expires_in - - refresh_token - - scope - type: object - properties: - scope: - type: array - example: - - openid - - profile - - uma_protection - - email - items: - type: string - access_token: - type: string - example: b75434ff-f465-4b70-92e4-b7ba6b6c58f2 - expires_in: - type: integer - example: 299 - refresh_token: - type: string - example: 33d7988e-6ffb-4fe5-8c2a-0e158691d446 - 400: - description: Invalid parameters are provided to endpoint. - content: - application/json: - schema: - $ref: '#/components/schemas/ErrorResponse' - 403: - description: Forbidden. Invalid access token provided in Authorization header. - content: - application/json: - schema: - $ref: '#/components/schemas/ErrorResponse' - 500: - description: Internal error occured. Please check client-api.log file for - details (usually located in /var/log/client-api/client-api.log). - content: - application/json: - schema: - $ref: '#/components/schemas/ErrorResponse' - x-codegen-request-body-name: GetAccessTokenByRefreshTokenParams - /uma-rs-protect: - post: - tags: - - developers - summary: UMA RS Protect Resources - description: UMA RS Protect Resources. It's important to have a single HTTP - method, mentioned only once within a given path in JSON, otherwise, the operation - will fail. - operationId: uma-rs-protect - parameters: - - name: Authorization - in: header - schema: - type: string - - name: AuthorizationRpId - in: header - schema: - type: string - requestBody: - content: - application/json: - schema: - title: UmaRsProtectParams - required: - - overwrite - - rp_id - - resources - type: object - properties: - rp_id: - type: string - example: bcad760f-91ba-46e1-a020-05e4281d91b6 - overwrite: - type: boolean - resources: - type: array - items: - $ref: '#/components/schemas/RsResource' - required: false - responses: - 200: - description: OK - content: - application/json: - schema: - title: UmaRsProtectResponse - required: - - rp_id - type: object - properties: - rp_id: - type: string - example: bcad760f-91ba-46e1-a020-05e4281d91b6 - 400: - description: Invalid parameters are provided to endpoint. - content: - application/json: - schema: - $ref: '#/components/schemas/ErrorResponse' - 403: - description: Forbidden. Invalid access token provided in Authorization header. - content: - application/json: - schema: - $ref: '#/components/schemas/ErrorResponse' - 500: - description: Internal error occured. Please check client-api.log file for - details (usually located in /var/log/client-api/client-api.log). - content: - application/json: - schema: - $ref: '#/components/schemas/ErrorResponse' - x-codegen-request-body-name: UmaRsProtectParams - /uma-rs-modify: - post: - tags: - - developers - summary: UMA RS Modify Resources - description: UMA RS Modify Resource. This end-point can be used to modify one - resource at a time from whole set of UMA resources of cient. - operationId: uma-rs-modify - parameters: - - name: Authorization - in: header - schema: - type: string - - name: AuthorizationRpId - in: header - schema: - type: string - requestBody: - content: - application/json: - schema: - title: UmaRsModifyParams - required: - - http_method - - rp_id - - path - type: object - properties: - rp_id: - type: string - example: bcad760f-91ba-46e1-a020-05e4281d91b6 - path: - type: string - example: /ws/document - http_method: - type: string - example: POST - scopes: - type: array - items: - type: string - example: http://photoz.example.com/dev/actions/view - scope_expression: - type: string - required: false - responses: - 200: - description: OK - content: - application/json: - schema: - title: UmaRsModifyResponse - required: - - rp_id - type: object - properties: - rp_id: - type: string - example: bcad760f-91ba-46e1-a020-05e4281d91b6 - 400: - description: Invalid parameters are provided to endpoint. - content: - application/json: - schema: - $ref: '#/components/schemas/ErrorResponse' - 403: - description: Forbidden. Invalid access token provided in Authorization header. - content: - application/json: - schema: - $ref: '#/components/schemas/ErrorResponse' - 500: - description: Internal error occured. Please check client-api.log file for - details (usually located in /var/log/client-api/client-api.log). - content: - application/json: - schema: - $ref: '#/components/schemas/ErrorResponse' - x-codegen-request-body-name: UmaRsModifyParams - /uma-rs-check-access: - post: - tags: - - developers - summary: UMA RS Check Access - description: UMA RS Check Access - operationId: uma-rs-check-access - parameters: - - name: Authorization - in: header - schema: - type: string - - name: AuthorizationRpId - in: header - schema: - type: string - requestBody: - content: - application/json: - schema: - title: UmaRsCheckAccessParams - required: - - http_method - - rp_id - - path - - rpt - type: object - properties: - rp_id: - type: string - example: bcad760f-91ba-46e1-a020-05e4281d91b6 - rpt: - type: string - path: - type: string - http_method: - type: string - scopes: - type: array - example: - - http://photoz.example.com/dev/actions/all - - http://photoz.example.com/dev/actions/add - items: - type: string - required: false - responses: - 200: - description: OK - content: - application/json: - schema: - title: UmaRsCheckAccessResponse - required: - - access - - ticket - type: object - properties: - access: - type: string - description: Possible values are granted, denied - example: granted - ticket: - type: string - 400: - description: Invalid parameters are provided to endpoint. - content: - application/json: - schema: - $ref: '#/components/schemas/ErrorResponse' - 403: - description: Forbidden. Invalid access token provided in Authorization header. - content: - application/json: - schema: - $ref: '#/components/schemas/ErrorResponse' - 500: - description: Internal error occured. Please check client-api.log file for - details (usually located in /var/log/client-api/client-api.log). - content: - application/json: - schema: - $ref: '#/components/schemas/ErrorResponse' - x-codegen-request-body-name: UmaRsCheckAccessParams - /introspect-rpt: - post: - tags: - - developers - summary: Introspect RPT - description: Introspect RPT - operationId: introspect-rpt - parameters: - - name: Authorization - in: header - schema: - type: string - - name: AuthorizationRpId - in: header - schema: - type: string - requestBody: - content: - application/json: - schema: - title: IntrospectRptParams - required: - - rp_id - - rpt - type: object - properties: - rp_id: - type: string - example: bcad760f-91ba-46e1-a020-05e4281d91b6 - rpt: - type: string - required: false - responses: - 200: - description: OK - content: - application/json: - schema: - title: IntrospectRptResponse - required: - - active - - aud - - client_id - - exp - - iat - - iss - - nbf - - permissions - type: object - properties: - active: - type: boolean - example: true - exp: - type: integer - description: number of seconds since January 1 1970 UTC, indicating - when this token will expire - format: int64 - example: 1535709072 - iat: - type: integer - description: number of seconds since January 1 1970 UTC, indicating - when the token was issued at - format: int64 - example: 1535709072 - nbf: - type: integer - description: number of seconds since January 1 1970 UTC, indicating - when the token not to be used before - format: int64 - example: 1535709072 - client_id: - type: string - example: '@!DBE5.84F8.631A.9172!0001!CD07.49BE!0008!0ED4.C61D.6FA7.8F42' - sub: - type: string - aud: - type: string - example: '@!DBE5.84F8.631A.9172!0001!CD07.49BE!0008!0ED4.C61D.6FA7.8F42' - iss: - type: string - example: http://as.com - jti: - type: string - permissions: - type: array - items: - type: object - properties: {} - 400: - description: Invalid parameters are provided to endpoint. - content: - application/json: - schema: - $ref: '#/components/schemas/ErrorResponse' - 403: - description: Forbidden. Invalid access token provided in Authorization header. - content: - application/json: - schema: - $ref: '#/components/schemas/ErrorResponse' - 500: - description: Internal error occured. Please check client-api.log file for - details (usually located in /var/log/client-api/client-api.log). - content: - application/json: - schema: - $ref: '#/components/schemas/ErrorResponse' - x-codegen-request-body-name: IntrospectRptParams - /uma-rp-get-rpt: - post: - tags: - - developers - summary: UMA RP Get RPT - description: UMA RP Get RPT - operationId: uma-rp-get-rpt - parameters: - - name: Authorization - in: header - schema: - type: string - - name: AuthorizationRpId - in: header - schema: - type: string - requestBody: - content: - application/json: - schema: - title: UmaRpGetRptParams - required: - - rp_id - - ticket - type: object - properties: - rp_id: - type: string - example: bcad760f-91ba-46e1-a020-05e4281d91b6 - ticket: - type: string - claim_token: - type: string - claim_token_format: - type: string - pct: - type: string - rpt: - type: string - scope: - type: array - example: - - openid - items: - type: string - state: - type: string - params: - type: object - additionalProperties: - type: string - required: false - responses: - 200: - description: OK - content: - application/json: - schema: - title: UmaRpGetRptResponse - required: - - access_token - - pct - - token_type - - updated - type: object - properties: - pct: - type: string - updated: - type: boolean - access_token: - type: string - example: b75434ff-f465-4b70-92e4-b7ba6b6c58f2 - token_type: - type: string - example: bearer - 400: - description: Invalid parameters are provided to endpoint. - content: - application/json: - schema: - $ref: '#/components/schemas/ErrorResponse' - 403: - description: Forbidden. Invalid access token provided in Authorization header. - content: - application/json: - schema: - $ref: '#/components/schemas/ErrorResponse' - 500: - description: Internal error occured. Please check client-api.log file for - details (usually located in /var/log/client-api/client-api.log). - content: - application/json: - schema: - $ref: '#/components/schemas/ErrorResponse' - x-codegen-request-body-name: UmaRpGetRptParams - /uma-rp-get-claims-gathering-url: - post: - tags: - - developers - summary: UMA RP Get Claims Gathering URL - description: UMA RP Get Claims Gathering URL - operationId: uma-rp-get-claims-gathering-url - parameters: - - name: Authorization - in: header - schema: - type: string - - name: AuthorizationRpId - in: header - schema: - type: string - requestBody: - content: - application/json: - schema: - title: UmaRpGetClaimsGatheringUrlParams - required: - - claims_redirect_uri - - rp_id - - ticket - type: object - properties: - rp_id: - type: string - example: bcad760f-91ba-46e1-a020-05e4281d91b6 - ticket: - type: string - example: fba00191-59ab-4ed6-ac99-a786a88a9f40 - state: - type: string - claims_redirect_uri: - type: string - example: https://client.example.com/cb - custom_parameters: - type: object - additionalProperties: - type: string - required: false - responses: - 200: - description: OK - content: - application/json: - schema: - title: UmaRpGetClaimsGatheringUrlResponse - required: - - state - - url - type: object - properties: - url: - type: string - example: https:///oxauth/restv1/uma/gather_claims?client_id@!1736.179E.AA60.16B2!0001!8F7C.B9AB!0008!4508.BF20.9B81.E904&ticket=fba00191-59ab-4ed6-ac99-a786a88a9f40&claims_redirect_uri=https://client.example.com/cb&state=d871gpie16np0f5kfv936sc33k - state: - type: string - example: d871gpie16np0f5kfv936sc33k - 400: - description: Invalid parameters are provided to endpoint. - content: - application/json: - schema: - $ref: '#/components/schemas/ErrorResponse' - 403: - description: Forbidden. Invalid access token provided in Authorization header. - content: - application/json: - schema: - $ref: '#/components/schemas/ErrorResponse' - 500: - description: Internal error occured. Please check client-api.log file for - details (usually located in /var/log/client-api/client-api.log). - content: - application/json: - schema: - $ref: '#/components/schemas/ErrorResponse' - x-codegen-request-body-name: UmaRpGetClaimsGatheringUrlParams - /get-jwks: - post: - tags: - - developers - summary: Get JSON Web Key Set - description: Get JSON Web Key Set - operationId: get-json-web-key-set - parameters: - - name: Authorization - in: header - schema: - type: string - - name: AuthorizationRpId - in: header - schema: - type: string - requestBody: - content: - application/json: - schema: - title: GetJwksParams - required: - - op_configuration_endpoint - type: object - properties: - op_configuration_endpoint: - type: string - example: https://op.example.com/acme/.well-known/openid-configuration - description: The openid configuration endpoint URL. If missing, - then `op_host` must be defined. - op_host: - type: string - example: https:// - deprecated: true - description: Deprecated in favor of `op_configuration_endpoint`. It will be - removed in future version(s). Provide the URL of OpenID Provider (OP) in this - field. If missing, then `op_configuration_endpoint` must be defined. - op_discovery_path: - type: string - example: /oxauth - deprecated: true - description: Deprecated in favor of `op_configuration_endpoint`. It will be - removed in future version(s). Provide path to the OpenID Connect Provider's - discovery document in this field. For example, if it is - 'https://example.com/.well-known/openid-configuration' then the path is blank. - But if it is 'https://example.com/oxauth/.well-known/openid-configuration' - then the path is '/oxauth' - required: false - responses: - 200: - description: OK - content: - application/json: - schema: - title: GetJwksResponse - required: - - keys - type: object - properties: - keys: - type: array - items: - $ref: '#/components/schemas/JsonWebKey' - 400: - description: Invalid parameters are provided to endpoint. - content: - application/json: - schema: - $ref: '#/components/schemas/ErrorResponse' - 403: - description: Forbidden. Invalid access token provided in Authorization header. - content: - application/json: - schema: - $ref: '#/components/schemas/ErrorResponse' - 500: - description: Internal error occured. Please check client-api.log file for - details (usually located in /var/log/client-api/client-api.log). - content: - application/json: - schema: - $ref: '#/components/schemas/ErrorResponse' - x-codegen-request-body-name: GetJwksParams - /get-issuer: - post: - tags: - - developers - summary: Get Issuer - description: Get Issuer - operationId: get-issuer - requestBody: - content: - application/json: - schema: - title: GetIssuerParams - required: - - op_configuration_endpoint - - resource - type: object - properties: - op_configuration_endpoint: - type: string - example: https://op.example.com/acme/.well-known/openid-configuration - description: The openid configuration endpoint URL. If missing, - then `op_host` must be defined. - op_host: - type: string - example: https:// - deprecated: true - description: Deprecated in favor of `op_configuration_endpoint`. It will be - removed in future version(s). Provide the URL of OpenID Provider (OP) in this - field. If missing, then `op_configuration_endpoint` must be defined. - op_discovery_path: - type: string - example: /oxauth - deprecated: true - description: Deprecated in favor of `op_configuration_endpoint`. It will be - removed in future version(s). Provide path to the OpenID Connect Provider's - discovery document in this field. For example, if it is - 'https://example.com/.well-known/openid-configuration' then the path is blank. - But if it is 'https://example.com/oxauth/.well-known/openid-configuration' - then the path is '/oxauth' - resource: - type: string - example: admin@jenkins-ldap.gluu.org - description: Identifier for the target End-User that is the subject of the - discovery request. - required: false - responses: - 200: - description: OK - content: - application/json: - schema: - title: GetIssuerResponse - type: object - properties: - subject: - type: string - example: admin@jenkins-ldap.gluu.org - links: - type: array - items: - $ref: '#/components/schemas/WebFingerLink' - 400: - description: Invalid parameters are provided to endpoint. - content: - application/json: - schema: - $ref: '#/components/schemas/ErrorResponse' - 403: - description: Forbidden. Invalid access token provided in Authorization header. - content: - application/json: - schema: - $ref: '#/components/schemas/ErrorResponse' - 500: - description: Internal error occured. Please check client-api.log file for - details (usually located in /var/log/client-api/client-api.log). - content: - application/json: - schema: - $ref: '#/components/schemas/ErrorResponse' - x-codegen-request-body-name: GetJwksParams - /get-discovery: - post: - tags: - - developers - summary: Get OP Discovery Configuration - description: Get OP Discovery Configuration - operationId: get-discovery - requestBody: - content: - application/json: - schema: - title: GetDiscoveryParams - required: - - op_configuration_endpoint - type: object - properties: - op_configuration_endpoint: - type: string - example: https://op.example.com/acme/.well-known/openid-configuration - description: The openid configuration endpoint URL. If missing, - then `op_host` must be defined. - op_host: - type: string - example: https:// - deprecated: true - description: Deprecated in favor of `op_configuration_endpoint`. It will be - removed in future version(s). Provide the URL of OpenID Provider (OP) in this - field. If missing, then `op_configuration_endpoint` must be defined. - op_discovery_path: - type: string - example: /oxauth - deprecated: true - description: Deprecated in favor of `op_configuration_endpoint`. It will be - removed in future version(s). Provide path to the OpenID Connect Provider's - discovery document in this field. For example, if it is - 'https://example.com/.well-known/openid-configuration' then the path is blank. - But if it is 'https://example.com/oxauth/.well-known/openid-configuration' - then the path is '/oxauth' - required: false - responses: - 200: - description: OK - content: - application/json: - schema: - title: GetDiscoveryResponse - type: object - properties: - issuer: - type: string - example: https:// - authorization_endpoint: - type: string - example: https:///oxauth/restv1/authorize - token_endpoint: - type: string - example: https:///oxauth/restv1/token - token_revocation_endpoint: - type: string - example: https:///oxauth/restv1/token/v1 - user_info_endpoint: - type: string - example: https:///oxauth/restv1/userinfo - client_info_endpoint: - type: string - example: https:///oxauth/restv1/clientinfo - check_session_iframe: - type: string - example: https:///oxauth/opiframe.htm - end_session_endpoint: - type: string - example: https:///oxauth/restv1/end_session - jwks_uri: - type: string - example: https:///oxauth/restv1/jwks - registration_endpoint: - type: string - example: https:///oxauth/restv1/register - id_generation_endpoint: - type: string - example: https:///oxauth/restv1/id - introspection_endpoint: - type: string - example: https:///oxauth/restv1/introspection - scopes_supported: - type: array - example: - - owner - - casa - - address - - clientinfo - - user_name - - openid - - profile - - uma_protection - - admin - - permission - - manage - - phone - - mobile_phone - - name - - rp - - email - items: - type: string - response_types_supported: - type: array - example: - - token id_token - - token code id_token - - token - - token code - - code - - code id_token - - id_token - items: - type: string - grant_types_supported: - type: array - example: - - authorization_code - - refresh_token - - urn:ietf:params:oauth:grant-type:uma-ticket - - password - - implicit - - client_credentials - items: - type: string - acr_values_supported: - type: array - example: - - u2f - - super_gluu - - otp - - auth_ldap_server - items: - type: string - subject_types_supported: - type: array - example: - - public - - pairwise - items: - type: string - user_info_signing_alg_values_supported: - type: array - example: - - HS256 - - HS384 - - HS512 - - RS256 - - RS384 - - RS512 - - ES256 - - ES384 - - ES512 - items: - type: string - user_info_encryption_alg_values_supported: - type: array - example: - - RSA1_5 - - RSA-OAEP - - A128KW - - A256KW - items: - type: string - user_info_encryption_enc_values_supported: - type: array - example: - - RSA1_5 - - RSA-OAEP - - A128KW - - A256KW - items: - type: string - id_token_signing_alg_values_supported: - type: array - example: - - none - - HS256 - - HS384 - - HS512 - - RS256 - - RS384 - - RS512 - - ES256 - - ES384 - - ES512 - items: - type: string - id_token_encryption_alg_values_supported: - type: array - example: - - RSA1_5 - - RSA-OAEP - - A128KW - - A256KW - items: - type: string - id_token_encryption_enc_values_supported: - type: array - example: - - A128CBC+HS256 - - A256CBC+HS512 - - A128GCM - - A256GCM - items: - type: string - request_object_signing_alg_values_supported: - type: array - example: - - none - - HS256 - - HS384 - - HS512 - - RS256 - - RS384 - - RS512 - - ES256 - - ES384 - - ES512 - items: - type: string - request_object_encryption_alg_values_supported: - type: array - example: - - RSA1_5 - - RSA-OAEP - - A128KW - - A256KW - items: - type: string - request_object_encryption_enc_values_supported: - type: array - example: - - A128CBC+HS256 - - A256CBC+HS512 - - A128GCM - - A256GCM - items: - type: string - token_endpoint_auth_methods_supported: - type: array - example: - - client_secret_basic - - client_secret_post - - client_secret_jwt - - private_key_jwt - items: - type: string - token_endpoint_auth_signing_alg_values_supported: - type: array - example: - - HS256 - - HS384 - - HS512 - - RS256 - - RS384 - - RS512 - - ES256 - - ES384 - - ES512 - items: - type: string - display_values_supported: - type: array - example: - - page - - popup - items: - type: string - claim_types_supported: - type: array - example: - - normal - items: - type: string - claims_supported: - type: array - example: - - street_address - - country - - zoneinfo - - birthdate - - role - - gender - - formatted - - user_name - - phone_mobile_number - - preferred_username - - locale - - inum - - updated_at - - nickname - - email - - website - - email_verified - - profile - - locality - - phone_number_verified - - given_name - - middle_name - - picture - - name - - phone_number - - postal_code - - region - - family_name - items: - type: string - id_token_token_binding_cnf_values_supported: - type: array - example: - - tbh - items: - type: string - service_documentation: - type: string - example: http:// - claims_locales_supported: - type: array - example: - - en - items: - type: string - ui_locales_supported: - type: array - example: - - en - - es - items: - type: string - claims_parameter_supported: - type: boolean - example: true - request_parameter_supported: - type: boolean - example: true - request_uri_parameter_supported: - type: boolean - example: true - require_request_uri_registration: - type: boolean - example: true - tls_client_certificate_bound_access_tokens: - type: boolean - example: true - front_channel_logout_supported: - type: boolean - example: true - front_channel_logout_session_supported: - type: boolean - example: true - op_policy_uri: - type: string - example: http:// - op_tos_uri: - type: string - example: http:// - scope_to_claims_mapping: - type: object - properties: {} - example: - - address: - - formatted - - postal_code - - street_address - - locality - - country - - region - - owner: [] - - manage: [] - - profile: - - name - - family_name - - given_name - - middle_name - - nickname - - preferred_username - - profile - - picture - - website - - gender - - birthdate - - zoneinfo - - locale - - updated_at - - mobile_phone: - - phone_mobile_number - - phone: - - phone_number_verified - - phone_number - - clientinfo: - - name - - inum - - permission: - - role - - rp: [] - - email: - - email_verified - - email - - casa: - - email - - user_name: - - user_name - - name: [] - - openid: [] - - uma_protection: [] - - admin: [] - 400: - description: Invalid parameters are provided to endpoint. - content: - application/json: - schema: - $ref: '#/components/schemas/ErrorResponse' - 403: - description: Forbidden. Invalid access token provided in Authorization header. - content: - application/json: - schema: - $ref: '#/components/schemas/ErrorResponse' - 500: - description: Internal error occured. Please check client-api.log file for - details (usually located in /var/log/client-api/client-api.log). - content: - application/json: - schema: - $ref: '#/components/schemas/ErrorResponse' - x-codegen-request-body-name: GetDiscoveryParams - /get-rp-jwks: - get: - tags: - - developers - summary: Get Rp JWKS - description: Get Rp JWKS - operationId: get-rp-jwks - responses: - 200: - description: OK - content: - application/json: - schema: - title: GetRpJwksResponse - required: - - keys - type: object - properties: - keys: - type: array - items: - $ref: '#/components/schemas/JsonWebKey' - 500: - description: Internal error occured. Please check client-api.log file for - details (usually located in /var/log/client-api/client-api.log). - content: - application/json: - schema: - $ref: '#/components/schemas/ErrorResponse' - x-codegen-request-body-name: GetJwksParams - /get-request-object-uri: - post: - tags: - - developers - summary: Get Request Object Uri - description: Get Request Object Uri - operationId: get-request-object-uri - parameters: - - name: Authorization - in: header - schema: - type: string - - name: AuthorizationRpId - in: header - schema: - type: string - requestBody: - content: - application/json: - schema: - title: GetRequestObjectUriParams - required: - - rp_id - - rp_host_url - type: object - properties: - rp_id: - type: string - example: bcad760f-91ba-46e1-a020-05e4281d91b6 - params: - type: object - additionalProperties: - type: object - request_object_signing_alg: - type: string - example: RS256 - description: choose the JWS alg algorithm (JWA) that must be required - by the Authorization Server. Valid values are none, HS256, HS384, - HS512, RS256, RS384, RS512, ES256, ES384, ES512, PS256, PS384, - PS512 - rp_host_url: - type: string - example: https:// - required: false - responses: - 200: - description: OK - content: - application/json: - schema: - title: GetRequestObjectUriResponse - required: - - request_uri - type: object - properties: - request_uri: - type: string - example: https:///get-request-object/d871gpie16np0f5kfv936sc33k - 400: - description: Invalid parameters are provided to endpoint. - content: - application/json: - schema: - $ref: '#/components/schemas/ErrorResponse' - 403: - description: Forbidden. Invalid access token provided in Authorization header. - content: - application/json: - schema: - $ref: '#/components/schemas/ErrorResponse' - 500: - description: Internal error occured. Please check client-api.log file for - details (usually located in /var/log/client-api/client-api.log). - content: - application/json: - schema: - $ref: '#/components/schemas/ErrorResponse' - x-codegen-request-body-name: GetRequestObjectUriResponse - /get-request-object/{request_object_id}: - get: - tags: - - developers - summary: Get Request Object - description: Get Request Object - operationId: get-request-object - parameters: - - in: path - name: request_object_id - schema: - type: string - required: true - description: request object id - responses: - 200: - description: OK - content: - text/plain: - schema: - type: string - example: eyJraWQiOiIyN2QyMGU2Zi1mNjZlLTQzZTUtOGY5Yi0yNDE3YTRjMjQ1YjB - fc2lnX3JzMjU2IiwidHlwIjoiSldUIiwiYWxnIjoiUlMyNTYifQ.eyJhdWQiOiJodHRw - czovL2plbmtpbnMtbGRhcC5nbHV1Lm9yZyIsImlzcyI6IjJmOTk4OWY1LWU4MjAtNGQ5 - Yi1iYzAzLWZlZmU4ZDU0YmU4NSIsInJlc3BvbnNlX3R5cGUiOlsiY29kZSJdLCJzdGF0Z - SI6IjEya2E0IiwiZXhwIjoxNTkzNjk0OTU2LCJveGRfaWQiOiJhNzMxODdmZi0zODJiLT - Q0YzgtYjEzMi0zYjE0YjYwNWY0OTQiLCJpYXQiOjE1OTM2OTQ2NTYsImp0aSI6IjQ5NzF - jMWE4LThmYmEtNDExMS1iYWQxLWQ4NmI0MTdiYzBmMCIsImNsaWVudF9pZCI6IjJmOTk4O - WY1LWU4MjAtNGQ5Yi1iYzAzLWZlZmU4ZDU0YmU4NSJ9.TIuQm4aj8X2wX9g8aiHs62Y_5y - U3sz5jh-PW3egzFIZ99N7TDkYXf6-NM_F9UuFiA8aO7Yjjrl1xjrhmonQxpZ56e2Gyd4-h - YI8oTINy2l3iGHNE9Ss7ypZ-PblI7eNoHoshFziCM7VhhBFbOqqxwG8tQ4lxvbcI-BXN_d - uxHLvfy7uMrCo1KKyB0TTjqEt5ik1O0V2UPmYqRkN1mObZJvYAA9-vxa5AMu3mf7Wj8CNl - FL4pgx_mwo3NTU23_TErL_nI6vf_gfC0UJanGCmUE5hWC_lY9QJi01VRMMNdXVIYUtXtoE - F3y4dh77CZuvM9CMVj4g0WBro006UUiC21ow - 404: - description: Request object not found. - content: - text/plain: - schema: - $ref: '#/components/schemas/ErrorResponse' - 500: - description: Internal error occured. Please check client-api.log file for - details (usually located in /var/log/client-api/client-api.log). - content: - text/plain: - schema: - $ref: '#/components/schemas/ErrorResponse' -components: - schemas: - rp_id: - type: string - example: bcad760f-91ba-46e1-a020-05e4281d91b6 - Condition: - required: - - httpMethods - - scope_expression - - scopes - - ticketScopes - type: object - properties: - httpMethods: - type: array - items: - type: string - scopes: - type: array - items: - type: string - scope_expression: - type: array - items: - type: string - ticketScopes: - type: array - items: - type: string - RsResource: - required: - - conditions - - path - type: object - properties: - path: - type: string - conditions: - type: array - items: - $ref: '#/components/schemas/Condition' - exp: - type: integer - description: Resource expiration date in terms of number of seconds - since January 1 1970 UTC - format: int64 - example: 1545709072 - iat: - type: integer - description: Resource creation date in terms of number of seconds - since January 1 1970 UTC - format: int64 - example: 1535709072 - JsonWebKey: - required: - - alg - - exp - - key_ops - - kid - - kty - - use - - x5c - - x5t - - x5u - type: object - properties: - kid: - type: string - kty: - type: string - use: - type: string - alg: - type: string - crv: - type: string - exp: - type: integer - format: int64 - example: 1563964950485 - x5c: - type: array - items: - type: string - n: - type: string - e: - type: string - x: - type: string - y: - type: string - ErrorResponse: - required: - - error - - error_description - type: object - properties: - error: - type: string - error_description: - type: string - details: - type: string - WebFingerLink: - required: - - rel - - href - type: object - properties: - rel: - type: string - href: - type: string - - diff --git a/jans-client-api/server/src/main/webapp-jetty/WEB-INF/jetty-env.xml b/jans-client-api/server/src/main/webapp-jetty/WEB-INF/jetty-env.xml deleted file mode 100644 index d3bee4c1271..00000000000 --- a/jans-client-api/server/src/main/webapp-jetty/WEB-INF/jetty-env.xml +++ /dev/null @@ -1,15 +0,0 @@ - - - - - - BeanManager - - - jakarta.enterprise.inject.spi.BeanManager - org.jboss.weld.resources.ManagerObjectFactory - - - - - \ No newline at end of file diff --git a/jans-client-api/server/src/main/webapp-jetty/WEB-INF/jetty-web.xml b/jans-client-api/server/src/main/webapp-jetty/WEB-INF/jetty-web.xml deleted file mode 100644 index 8948544ec35..00000000000 --- a/jans-client-api/server/src/main/webapp-jetty/WEB-INF/jetty-web.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - -org.eclipse.jetty.util.Decorator - - - -org.eclipse.jetty.util.DecoratedObjectFactory - - - -org.eclipse.jetty.server.handler.ContextHandler. - - - -org.eclipse.jetty.server.handler.ContextHandler - - - -org.eclipse.jetty.servlet.ServletContextHandler - - - - \ No newline at end of file diff --git a/jans-client-api/server/src/main/webapp-jetty/WEB-INF/web.xml b/jans-client-api/server/src/main/webapp-jetty/WEB-INF/web.xml deleted file mode 100644 index 0ecec1f250d..00000000000 --- a/jans-client-api/server/src/main/webapp-jetty/WEB-INF/web.xml +++ /dev/null @@ -1,47 +0,0 @@ - - - Jans client server - - - - resteasy.patchfilter.disabled - true - - - - - org.eclipse.jetty.servlet.Default.dirAllowed - false - - - - - org.jboss.weld.development - ${weld.debug} - - - - org.jboss.weld.environment.servlet.Listener - - - - - org.jboss.resteasy.plugins.server.servlet.ResteasyBootstrap - - - - - Object factory for the CDI Bean Manager - BeanManager - jakarta.enterprise.inject.spi.BeanManager - - - - - - - - diff --git a/jans-client-api/server/src/main/webapp-tomcat/META-INF/context.xml b/jans-client-api/server/src/main/webapp-tomcat/META-INF/context.xml deleted file mode 100644 index 5b869f54611..00000000000 --- a/jans-client-api/server/src/main/webapp-tomcat/META-INF/context.xml +++ /dev/null @@ -1,18 +0,0 @@ - - - - - - - - - - - - diff --git a/jans-client-api/server/src/main/webapp/index.jsp b/jans-client-api/server/src/main/webapp/index.jsp deleted file mode 100644 index e7e51cf4a93..00000000000 --- a/jans-client-api/server/src/main/webapp/index.jsp +++ /dev/null @@ -1 +0,0 @@ -<% out.print("Jans Client - Api"); %> \ No newline at end of file diff --git a/jans-client-api/server/src/test/java/io/jans/ca/server/JansUnitTestsListener.java b/jans-client-api/server/src/test/java/io/jans/ca/server/JansUnitTestsListener.java deleted file mode 100644 index 93e5f2a2af8..00000000000 --- a/jans-client-api/server/src/test/java/io/jans/ca/server/JansUnitTestsListener.java +++ /dev/null @@ -1,78 +0,0 @@ -/* - * Janssen Project software is available under the Apache License (2004). See http://www.apache.org/licenses/ for full text. - * - * Copyright (c) 2021, Janssen Project - */ -package io.jans.ca.server; - -import com.google.common.base.Throwables; -import org.testng.ITestContext; -import org.testng.ITestListener; -import org.testng.ITestResult; -import org.testng.Reporter; - -/** - * @author Sergey Manoylo - * @version December 29, 2021 - */ -public class JansUnitTestsListener implements ITestListener { - - @Override - public void onTestStart(ITestResult result) { - Reporter.log("Test STARTED: " + getTestInfo(result), true); - } - - @Override - public void onTestSuccess(ITestResult result) { - Reporter.log("Test SUCCESS: " + getTestInfo(result), true); - Reporter.log("", true); - } - - @Override - public void onTestFailure(ITestResult result) { - Reporter.log("Test FAILED: " + getTestInfo(result), true); - testFailed(result); - } - - @Override - public void onTestSkipped(ITestResult result) { - Reporter.log("Test SKIPPED: " + getTestInfo(result), true); - Reporter.log("", true); - } - - @Override - public void onTestFailedButWithinSuccessPercentage(ITestResult result) { - Reporter.log("Test FAILED with Success Percentage: " + getTestInfo(result), true); - testFailed(result); - } - - @Override - public void onStart(ITestContext context) { - } - - @Override - public void onFinish(ITestContext context) { - } - - private void testFailed(ITestResult result) { - Object[] parameters = result.getParameters(); - if(parameters != null) { - Reporter.log("Test Parameters: ", true); - for(Object parameter : parameters) { - Reporter.log("parameter = " + parameter, true); - } - } - Throwable throwable = result.getThrowable(); - if(throwable != null) { - Reporter.log("", true); - Reporter.log("Exception: ", true); - Reporter.log(Throwables.getStackTraceAsString(result.getThrowable()), true); - Reporter.log("", true); - } - } - - private String getTestInfo(ITestResult result) { - return result.getInstanceName() + "." + result.getName(); - } - -} diff --git a/jans-client-api/server/src/test/java/io/jans/ca/server/SetUpTest.java b/jans-client-api/server/src/test/java/io/jans/ca/server/SetUpTest.java deleted file mode 100644 index 9894c15e3bc..00000000000 --- a/jans-client-api/server/src/test/java/io/jans/ca/server/SetUpTest.java +++ /dev/null @@ -1,40 +0,0 @@ -package io.jans.ca.server; - -import com.google.common.base.Preconditions; -import io.jans.ca.common.response.RegisterSiteResponse; -import io.jans.ca.server.arquillian.ClientIterfaceImpl; -import io.jans.ca.server.tests.PathTestEndPoint; -import io.jans.ca.server.tests.SetupClientTest; -import jakarta.ws.rs.client.Invocation; -import jakarta.ws.rs.core.Response; -import org.jboss.resteasy.client.jaxrs.ResteasyClientBuilder; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.testng.Assert; - -public class SetUpTest { - - private static final Logger LOG = LoggerFactory.getLogger(SetUpTest.class); - - public static void beforeSuite(String url, String host, String opHost, String redirectUrls) { - try { - - RegisterSiteResponse setupClient = SetupClientTest.setupClient(Tester.newClient(url), opHost, redirectUrls); - Tester.setSetupClient(setupClient, host, opHost); - LOG.debug("SETUP_CLIENT is set in Tester."); - - Preconditions.checkNotNull(Tester.getSetupAuthorization(url)); - LOG.debug("Tester's authorization is set."); - - LOG.debug("Finished beforeSuite!"); - } catch (Exception e) { - LOG.error("Failed to start suite.", e); - throw new AssertionError("Failed to start suite."); - } - } - - public static void afterSuite() { - LOG.debug("Running afterSuite ... SetupTest"); - } - -} diff --git a/jans-client-api/server/src/test/java/io/jans/ca/server/TestUtils.java b/jans-client-api/server/src/test/java/io/jans/ca/server/TestUtils.java deleted file mode 100644 index d05ac44df5e..00000000000 --- a/jans-client-api/server/src/test/java/io/jans/ca/server/TestUtils.java +++ /dev/null @@ -1,62 +0,0 @@ -package io.jans.ca.server; - -import com.fasterxml.jackson.databind.AnnotationIntrospector; -import com.fasterxml.jackson.databind.ObjectMapper; -import com.fasterxml.jackson.databind.introspect.JacksonAnnotationIntrospector; -import com.fasterxml.jackson.module.jaxb.JaxbAnnotationIntrospector; -import io.jans.ca.common.ErrorResponse; -import io.jans.ca.common.Jackson2; -import jakarta.ws.rs.WebApplicationException; -import org.apache.commons.io.IOUtils; -import org.apache.commons.lang.StringUtils; - -import java.io.IOException; -import java.io.InputStream; -import java.util.List; - -import static org.testng.AssertJUnit.assertTrue; - -/** - * @author Yuriy Zabrovarnyy - * @version 0.9, 21/08/2013 - */ - -public class TestUtils { - - private TestUtils() { - } - - public static void notEmpty(String str) { - assertTrue(StringUtils.isNotBlank(str)); - } - - public static void notEmpty(List str) { - assertTrue(str != null && !str.isEmpty() && StringUtils.isNotBlank(str.get(0))); - } - - public static ErrorResponse asError(WebApplicationException e) throws IOException { - final Object entity = e.getResponse().getEntity(); - String entityAsString = null; - if (entity instanceof String) { - entityAsString = (String) entity; - } else if (entity instanceof InputStream) { - entityAsString = IOUtils.toString((InputStream) entity, "UTF-8"); - } else { - throw new RuntimeException("Failed to identify type of the entity"); - } - System.out.println(entityAsString); - return Jackson2.createJsonMapper().readValue(entityAsString, ErrorResponse.class); - } - - public static ObjectMapper createJsonMapper() { - final AnnotationIntrospector jaxb = new JaxbAnnotationIntrospector(); - final AnnotationIntrospector jackson = new JacksonAnnotationIntrospector(); - - final AnnotationIntrospector pair = AnnotationIntrospector.pair(jackson, jaxb); - - final ObjectMapper mapper = new ObjectMapper(); - mapper.getDeserializationConfig().with(pair); - mapper.getSerializationConfig().with(pair); - return mapper; - } -} diff --git a/jans-client-api/server/src/test/java/io/jans/ca/server/Tester.java b/jans-client-api/server/src/test/java/io/jans/ca/server/Tester.java deleted file mode 100644 index e7cd596d16c..00000000000 --- a/jans-client-api/server/src/test/java/io/jans/ca/server/Tester.java +++ /dev/null @@ -1,141 +0,0 @@ -package io.jans.ca.server; - -import com.google.common.base.Preconditions; -import com.google.common.base.Strings; -import com.google.common.collect.Lists; -import io.jans.as.model.common.GrantType; -import io.jans.ca.client.ClientInterface; -import io.jans.ca.common.params.GetClientTokenParams; -import io.jans.ca.common.params.RegisterSiteParams; -import io.jans.ca.common.response.GetClientTokenResponse; -import io.jans.ca.common.response.RegisterSiteResponse; -import io.jans.ca.server.arquillian.ClientIterfaceImpl; -import io.jans.ca.server.arquillian.ConfigurableTest; -import io.jans.ca.server.op.RegisterSiteOperation; -import io.jans.ca.server.tests.SetupClientTest; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import java.util.List; -import java.util.Map; - -import static io.jans.ca.server.tests.SetupClientTest.assertResponse; -import static org.testng.AssertJUnit.assertNotNull; -import static org.testng.AssertJUnit.assertTrue; - -/** - * @author Yuriy Zabrovarnyy - * @version 0.9, 05/10/2015 - */ - -public class Tester { - - private static final Logger LOG = LoggerFactory.getLogger(Tester.class); - - private Tester() { - } - - private static String AUTHORIZATION = ""; - private static RegisterSiteResponse SETUP_CLIENT; - private static String HOST; - private static String OP_HOST; - - private static Map MAP_TEST_PARAMS; - - public static ClientInterface newClient(String targeHosttUrl) { - return ClientIterfaceImpl.getInstanceClient(targeHosttUrl); - } - - public static String getSetupAuthorization(String url) { - Preconditions.checkNotNull(SETUP_CLIENT); - if (Strings.isNullOrEmpty(AUTHORIZATION)) { - LOG.info("------------------------- INITIALIZING AUTHORIZATION FOR CLIENT_SETUP --------------------------------"); - final GetClientTokenParams params = new GetClientTokenParams(); - params.setOpHost(OP_HOST); - params.setScope(Lists.newArrayList("openid")); - params.setClientId(Tester.getSetupClient(url).getClientId()); - params.setClientSecret(Tester.getSetupClient(url).getClientSecret()); - - GetClientTokenResponse resp = Tester.newClient(url).getClientToken(params); - assertNotNull(resp); - assertTrue(!Strings.isNullOrEmpty(resp.getAccessToken())); - - AUTHORIZATION = "Bearer " + resp.getAccessToken(); - } - return AUTHORIZATION; - } - - public static String getAuthorization(String url, RegisterSiteResponse site) { - final GetClientTokenParams params = new GetClientTokenParams(); - params.setScope(Lists.newArrayList("openid", "jans_client_api")); - params.setOpHost(site.getOpHost()); - params.setClientId(site.getClientId()); - params.setClientSecret(site.getClientSecret()); - - GetClientTokenResponse resp = Tester.newClient(url).getClientToken(params); - assertNotNull(resp); - assertTrue(!Strings.isNullOrEmpty(resp.getAccessToken())); - - return "Bearer " + resp.getAccessToken(); - } - - public static String getAuthorization(String url, RegisterSiteResponse site, List scopes) { - final GetClientTokenParams params = new GetClientTokenParams(); - params.setScope(scopes); - params.setOpHost(site.getOpHost()); - params.setClientId(site.getClientId()); - params.setClientSecret(site.getClientSecret()); - - GetClientTokenResponse resp = Tester.newClient(url).getClientToken(params); - assertNotNull(resp); - assertTrue(!Strings.isNullOrEmpty(resp.getAccessToken())); - - return "Bearer " + resp.getAccessToken(); - } - - public static RegisterSiteResponse getSetupClient(String url) { - if (SETUP_CLIENT == null) { - SETUP_CLIENT = setupClient(url); - } - return SETUP_CLIENT; - } - - public static void setSetupClient(RegisterSiteResponse setupClient, String host, String opHost) { - SETUP_CLIENT = setupClient; - HOST = host; - OP_HOST = opHost; - } - - public static void setSetupTestParams(Map hmTestParams) { - MAP_TEST_PARAMS = hmTestParams; - } - - public static String getTestParam(String nameParam) { - if (MAP_TEST_PARAMS != null) { - return MAP_TEST_PARAMS.get(nameParam); - } else { - return null; - } - } - - public static boolean testWithExternalApiUrl() { - return System.getProperties().containsKey("test.client.api.url"); - } - - public static String readExternalApiUrl() { - if (testWithExternalApiUrl()) { - return System.getProperties().getProperty("test.client.api.url"); - } - return null; - } - - public static RegisterSiteResponse setupClient(String url) { - LOG.info("------------------------- INITIALIZING CLIENT_SETUP --------------------------------"); - String opHost = Tester.getTestParam("opHost"); - String redirectUrls = Tester.getTestParam("redirectUrls"); - RegisterSiteResponse setupClient = SetupClientTest.setupClient(Tester.newClient(url), opHost, redirectUrls); - Tester.setSetupClient(setupClient, null, opHost); - LOG.debug("SETUP_CLIENT is set in Tester."); - return setupClient; - } -} diff --git a/jans-client-api/server/src/test/java/io/jans/ca/server/arquillian/BaseTest.java b/jans-client-api/server/src/test/java/io/jans/ca/server/arquillian/BaseTest.java deleted file mode 100644 index 5e37000c982..00000000000 --- a/jans-client-api/server/src/test/java/io/jans/ca/server/arquillian/BaseTest.java +++ /dev/null @@ -1,84 +0,0 @@ -/* - * Janssen Project software is available under the Apache License (2004). See http://www.apache.org/licenses/ for full text. - * - * Copyright (c) 2020, Janssen Project - */ - -package io.jans.ca.server.arquillian; - -import io.jans.ca.client.ClientInterface; -import io.jans.ca.server.Tester; -import jakarta.ws.rs.core.Response; -import org.testng.Assert; - -import java.net.URI; -import java.util.List; -import java.util.Map; - -/** - * @author Javier Rojas - * @author Yuriy Movchan Date: 10.10.2011 - */ -public abstract class BaseTest extends ConfigurableTest { - - public static void showTitle(String title) { - title = "TEST: " + title; - - System.out.println("#######################################################"); - System.out.println(title); - System.out.println("#######################################################"); - } - - public static void showTitle(String title, String targetHostApi) { - title = "TEST: " + title; - - System.out.println("#######################################################"); - System.out.println(title); - System.out.println("Target host Client Api: " + targetHostApi); - System.out.println("#######################################################"); - } - - public static void fails(Throwable e) { - Assert.fail(e.getMessage(), e); - } - - public static void output(String msg) { - System.out.println(msg); - } - - public void showResponse(String title, Response response) { - showResponse(title, response, null); - } - - public static void showResponse(String title, Response response, Object entity) { - System.out.println(" "); - System.out.println("RESPONSE FOR: " + title); - System.out.println(response.getStatus()); - for (Map.Entry> headers : response.getHeaders().entrySet()) { - String headerName = headers.getKey(); - System.out.println(headerName + ": " + headers.getValue()); - } - - if (entity != null) { - System.out.println(entity.toString().replace("\\n", "\n")); - } - System.out.println(" "); - System.out.println("Status message: " + response.getStatus()); - } - - public static String getApiTagetURL(URI uriArquillianTestServer) { - if (Tester.testWithExternalApiUrl()) { - return Tester.readExternalApiUrl(); - } else if (uriArquillianTestServer != null) { - return uriArquillianTestServer.toString(); - } else { - return null; - } - } - - public static ClientInterface getClientInterface(URI uriArquillianTestServer) { - String urlEndPoint = getApiTagetURL(uriArquillianTestServer); - return Tester.newClient(urlEndPoint); - } - -} \ No newline at end of file diff --git a/jans-client-api/server/src/test/java/io/jans/ca/server/arquillian/ClientIterfaceImpl.java b/jans-client-api/server/src/test/java/io/jans/ca/server/arquillian/ClientIterfaceImpl.java deleted file mode 100644 index 4fd40afeb96..00000000000 --- a/jans-client-api/server/src/test/java/io/jans/ca/server/arquillian/ClientIterfaceImpl.java +++ /dev/null @@ -1,589 +0,0 @@ -package io.jans.ca.server.arquillian; - -import com.fasterxml.jackson.databind.JsonNode; -import io.jans.as.model.uma.UmaConstants; -import io.jans.ca.client.ClientInterface; -import io.jans.ca.client.GetTokensByCodeResponse2; -import io.jans.ca.client.RsProtectParams2; -import io.jans.ca.common.Jackson2; -import io.jans.ca.common.introspection.CorrectRptIntrospectionResponse; -import io.jans.ca.common.params.*; -import io.jans.ca.common.response.*; -import io.jans.ca.server.tests.PathTestEndPoint; -import jakarta.ws.rs.BadRequestException; -import jakarta.ws.rs.client.Entity; -import jakarta.ws.rs.client.Invocation; -import jakarta.ws.rs.client.WebTarget; -import jakarta.ws.rs.core.Response; -import org.jboss.resteasy.client.jaxrs.ResteasyClientBuilder; - -import java.util.List; -import java.util.Map; - -import static org.testng.Assert.assertEquals; -import static org.testng.Assert.fail; - -public class ClientIterfaceImpl implements ClientInterface { - - protected String targeHostUrl = ""; - - public static ClientIterfaceImpl getInstanceClient(String targeHostUrl) { - ClientIterfaceImpl result = new ClientIterfaceImpl(); - result.targeHostUrl = targeHostUrl; - return result; - } - - private WebTarget webTarget(String pathEndPoint) { - return ResteasyClientBuilder.newClient().target(targeHostUrl + pathEndPoint); - } - - private Invocation.Builder requestBuilder(String pathEndPoint) { - return webTarget(pathEndPoint).request(); - } - - private Entity toPostParam(Object param) { - String json = null; - try { - json = Jackson2.asJson(param); - } catch (Exception e) { - e.printStackTrace(); - fail(); - } - return Entity.json(json); - } - - private String readResponse(String endPoint, Response response) { - String entity = response.readEntity(String.class); - showResponse(endPoint, response, entity); - assertEquals(response.getStatus(), 200, "Unexpected response code."); - return entity; - } - - private String readResponseNoVerifyOk(String endPoint, Response response) { - String entity = response.readEntity(String.class); - showResponse(endPoint, response, entity); - return entity; - } - - @Override - public String healthCheck() { - Invocation.Builder builder = requestBuilder(PathTestEndPoint.HEALT_CHECK); - Response response = builder.get(); - String entity = response.readEntity(String.class); - - showResponse("healthCheck", response, entity); - assertEquals(response.getStatus(), 200, "Unexpected response code."); - return entity; - } - - @Override - public JsonNode getRpJwks() { - WebTarget webTarget = webTarget(PathTestEndPoint.GET_RP_JWKS); - Invocation.Builder builder = webTarget.request(); - builder.header("Accept", UmaConstants.JSON_MEDIA_TYPE); - builder.header("Content-Type", UmaConstants.JSON_MEDIA_TYPE); - Response response = builder.get(); - String json = readResponse(webTarget.getUri().toString(), response); - try { - return Jackson2.createJsonMapper().readValue(json, JsonNode.class); - } catch (Exception e) { - e.printStackTrace(); - fail(); - } - return null; - } - - @Override - public String getRequestObject(String value) { - Invocation.Builder builder = requestBuilder(PathTestEndPoint.GET_REQUEST_OBJECT + value); - Response response = builder.get(); - String entity = response.readEntity(String.class); - - showResponse("getRequestObject", response, entity); - assertEquals(response.getStatus(), 200, "Unexpected response code."); - return entity; - } - - @Override - public GetClientTokenResponse getClientToken(GetClientTokenParams params) { - WebTarget webTarget = webTarget(PathTestEndPoint.GET_CLIENT_TOKEN); - Invocation.Builder builder = webTarget.request(); - builder.header("Accept", UmaConstants.JSON_MEDIA_TYPE); - builder.header("Content-Type", UmaConstants.JSON_MEDIA_TYPE); - Response response = builder.post(toPostParam(params)); - String json = readResponse(webTarget.getUri().toString(), response); - try { - return Jackson2.createJsonMapper().readValue(json, GetClientTokenResponse.class); - } catch (Exception e) { - e.printStackTrace(); - fail(); - } - return null; - } - - @Override - public IntrospectAccessTokenResponse introspectAccessToken(String authorization, String authorizationRpId, IntrospectAccessTokenParams params) { - WebTarget webTarget = webTarget(PathTestEndPoint.INSTROSPECT_ACCESS_TOKEN); - Invocation.Builder builder = webTarget.request(); - builder.header("Accept", UmaConstants.JSON_MEDIA_TYPE); - builder.header("Content-Type", UmaConstants.JSON_MEDIA_TYPE); - builder.header("Authorization", authorization); - builder.header("AuthorizationRpId", authorizationRpId); - Response response = builder.post(toPostParam(params)); - String json = readResponse(webTarget.getUri().toString(), response); - try { - return Jackson2.createJsonMapper().readValue(json, IntrospectAccessTokenResponse.class); - } catch (Exception e) { - e.printStackTrace(); - fail(); - } - return null; - } - - @Override - public CorrectRptIntrospectionResponse introspectRpt(String authorization, String authorizationRpId, IntrospectRptParams params) { - WebTarget webTarget = webTarget(PathTestEndPoint.INSTROSPECT_RPT); - Invocation.Builder builder = webTarget.request(); - builder.header("Accept", UmaConstants.JSON_MEDIA_TYPE); - builder.header("Content-Type", UmaConstants.JSON_MEDIA_TYPE); - builder.header("Authorization", authorization); - builder.header("AuthorizationRpId", authorizationRpId); - Response response = builder.post(toPostParam(params)); - String json = readResponse(webTarget.getUri().toString(), response); - try { - return Jackson2.createJsonMapper().readValue(json, CorrectRptIntrospectionResponse.class); - } catch (Exception e) { - e.printStackTrace(); - fail(); - } - return null; - } - - @Override - public RegisterSiteResponse registerSite(RegisterSiteParams params) { - WebTarget webTarget = webTarget(PathTestEndPoint.REGISTER_SITE); - Invocation.Builder builder = webTarget.request(); - builder.header("Accept", UmaConstants.JSON_MEDIA_TYPE); - builder.header("Content-Type", UmaConstants.JSON_MEDIA_TYPE); - Response response = builder.post(toPostParam(params)); - String json = readResponse(webTarget.getUri().toString(), response); - try { - return Jackson2.createJsonMapper().readValue(json, RegisterSiteResponse.class); - } catch (Exception e) { - e.printStackTrace(); - fail(); - } - return null; - } - - @Override - public UpdateSiteResponse updateSite(String authorization, String authorizationRpId, UpdateSiteParams params) { - WebTarget webTarget = webTarget(PathTestEndPoint.UPDATE_SITE); - Invocation.Builder builder = webTarget.request(); - builder.header("Accept", UmaConstants.JSON_MEDIA_TYPE); - builder.header("Content-Type", UmaConstants.JSON_MEDIA_TYPE); - builder.header("Authorization", authorization); - builder.header("AuthorizationRpId", authorizationRpId); - Response response = builder.post(toPostParam(params)); - String json = readResponse(webTarget.getUri().toString(), response); - try { - return Jackson2.createJsonMapper().readValue(json, UpdateSiteResponse.class); - } catch (Exception e) { - e.printStackTrace(); - fail(); - } - return null; - } - - @Override - public RemoveSiteResponse removeSite(String authorization, String authorizationRpId, RemoveSiteParams params) { - WebTarget webTarget = webTarget(PathTestEndPoint.REMOVE_SITE); - Invocation.Builder builder = webTarget.request(); - builder.header("Accept", UmaConstants.JSON_MEDIA_TYPE); - builder.header("Content-Type", UmaConstants.JSON_MEDIA_TYPE); - builder.header("Authorization", authorization); - builder.header("AuthorizationRpId", authorizationRpId); - Response response = builder.post(toPostParam(params)); - String json = readResponse(webTarget.getUri().toString(), response); - try { - return Jackson2.createJsonMapper().readValue(json, RemoveSiteResponse.class); - } catch (Exception e) { - e.printStackTrace(); - fail(); - } - return null; - } - - @Override - public GetAuthorizationUrlResponse getAuthorizationUrl(String authorization, String authorizationRpId, GetAuthorizationUrlParams params) { - WebTarget webTarget = webTarget(PathTestEndPoint.GET_AUTHORIZATION_URL); - Invocation.Builder builder = webTarget.request(); - builder.header("Accept", UmaConstants.JSON_MEDIA_TYPE); - builder.header("Content-Type", UmaConstants.JSON_MEDIA_TYPE); - builder.header("Authorization", authorization); - builder.header("AuthorizationRpId", authorizationRpId); - Response response = builder.post(toPostParam(params)); - String json = readResponse(webTarget.getUri().toString(), response); - try { - return Jackson2.createJsonMapper().readValue(json, GetAuthorizationUrlResponse.class); - } catch (Exception e) { - e.printStackTrace(); - fail(); - } - return null; - } - - @Override - public GetAuthorizationCodeResponse getAuthorizationCode(String authorization, String authorizationRpId, GetAuthorizationCodeParams params) { - WebTarget webTarget = webTarget(PathTestEndPoint.GET_AUTHORIZATION_CODE); - Invocation.Builder builder = webTarget.request(); - builder.header("Accept", UmaConstants.JSON_MEDIA_TYPE); - builder.header("Content-Type", UmaConstants.JSON_MEDIA_TYPE); - builder.header("Authorization", authorization); - builder.header("AuthorizationRpId", authorizationRpId); - Response response = builder.post(toPostParam(params)); - String json = readResponse(webTarget.getUri().toString(), response); - try { - return Jackson2.createJsonMapper().readValue(json, GetAuthorizationCodeResponse.class); - } catch (Exception e) { - e.printStackTrace(); - fail(); - } - return null; - } - - @Override - public GetTokensByCodeResponse2 getTokenByCode(String authorization, String authorizationRpId, GetTokensByCodeParams params) { - WebTarget webTarget = webTarget(PathTestEndPoint.GET_TOKENS_BY_CODE); - Invocation.Builder builder = webTarget.request(); - builder.header("Accept", UmaConstants.JSON_MEDIA_TYPE); - builder.header("Content-Type", UmaConstants.JSON_MEDIA_TYPE); - builder.header("Authorization", authorization); - builder.header("AuthorizationRpId", authorizationRpId); - Response response = builder.post(toPostParam(params)); - String json = readResponseNoVerifyOk(webTarget.getUri().toString(), response); - try { - return Jackson2.createJsonMapper().readValue(json, GetTokensByCodeResponse2.class); - } catch (Exception e) { - e.printStackTrace(); - fail(); - } - return null; - } - - @Override - public JsonNode getUserInfo(String authorization, String authorizationRpId, GetUserInfoParams params) { - WebTarget webTarget = webTarget(PathTestEndPoint.GET_USER_INFO); - Invocation.Builder builder = webTarget.request(); - builder.header("Accept", UmaConstants.JSON_MEDIA_TYPE); - builder.header("Content-Type", UmaConstants.JSON_MEDIA_TYPE); - builder.header("Authorization", authorization); - builder.header("AuthorizationRpId", authorizationRpId); - Response response = builder.post(toPostParam(params)); - String json = readResponse(webTarget.getUri().toString(), response); - try { - return Jackson2.createJsonMapper().readValue(json, JsonNode.class); - } catch (Exception e) { - e.printStackTrace(); - fail(); - } - return null; - } - - @Override - public GetLogoutUriResponse getLogoutUri(String authorization, String authorizationRpId, GetLogoutUrlParams params) { - WebTarget webTarget = webTarget(PathTestEndPoint.GET_LOGOUT_URI); - Invocation.Builder builder = webTarget.request(); - builder.header("Accept", UmaConstants.JSON_MEDIA_TYPE); - builder.header("Content-Type", UmaConstants.JSON_MEDIA_TYPE); - builder.header("Authorization", authorization); - builder.header("AuthorizationRpId", authorizationRpId); - Response response = builder.post(toPostParam(params)); - String json = readResponse(webTarget.getUri().toString(), response); - try { - return Jackson2.createJsonMapper().readValue(json, GetLogoutUriResponse.class); - } catch (Exception e) { - e.printStackTrace(); - fail(); - } - return null; - } - - @Override - public GetClientTokenResponse getAccessTokenByRefreshToken(String authorization, String authorizationRpId, GetAccessTokenByRefreshTokenParams params) { - WebTarget webTarget = webTarget(PathTestEndPoint.GET_ACCESS_TOKEN_BY_REFRESH); - Invocation.Builder builder = webTarget.request(); - builder.header("Accept", UmaConstants.JSON_MEDIA_TYPE); - builder.header("Content-Type", UmaConstants.JSON_MEDIA_TYPE); - builder.header("Authorization", authorization); - builder.header("AuthorizationRpId", authorizationRpId); - Response response = builder.post(toPostParam(params)); - String json = readResponse(webTarget.getUri().toString(), response); - try { - return Jackson2.createJsonMapper().readValue(json, GetClientTokenResponse.class); - } catch (Exception e) { - e.printStackTrace(); - fail(); - } - return null; - } - - @Override - public RsProtectResponse umaRsProtect(String authorization, String authorizationRpId, RsProtectParams2 params) { - WebTarget webTarget = webTarget(PathTestEndPoint.UMA_RS_PROTECT); - Invocation.Builder builder = webTarget.request(); - builder.header("Accept", UmaConstants.JSON_MEDIA_TYPE); - builder.header("Content-Type", UmaConstants.JSON_MEDIA_TYPE); - builder.header("Authorization", authorization); - builder.header("AuthorizationRpId", authorizationRpId); - Response response = builder.post(toPostParam(params)); - String json = readResponseNoVerifyOk(webTarget.getUri().toString(), response); - try { - return Jackson2.createJsonMapper().readValue(json, RsProtectResponse.class); - } catch (Exception e) { - e.printStackTrace(); - fail(); - } - return null; - } - - @Override - public RsModifyResponse umaRsModify(String authorization, String authorizationRpId, RsModifyParams params) { - WebTarget webTarget = webTarget(PathTestEndPoint.UMA_RS_MODIFY); - Invocation.Builder builder = webTarget.request(); - builder.header("Accept", UmaConstants.JSON_MEDIA_TYPE); - builder.header("Content-Type", UmaConstants.JSON_MEDIA_TYPE); - builder.header("Authorization", authorization); - builder.header("AuthorizationRpId", authorizationRpId); - Response response = builder.post(toPostParam(params)); - String json = readResponse(webTarget.getUri().toString(), response); - try { - return Jackson2.createJsonMapper().readValue(json, RsModifyResponse.class); - } catch (Exception e) { - e.printStackTrace(); - fail(); - } - return null; - } - - @Override - public RsCheckAccessResponse umaRsCheckAccess(String authorization, String authorizationRpId, RsCheckAccessParams params) { - WebTarget webTarget = webTarget(PathTestEndPoint.UMA_RS_CHECK_ACCESS); - Invocation.Builder builder = webTarget.request(); - builder.header("Accept", UmaConstants.JSON_MEDIA_TYPE); - builder.header("Content-Type", UmaConstants.JSON_MEDIA_TYPE); - builder.header("Authorization", authorization); - builder.header("AuthorizationRpId", authorizationRpId); - Response response = builder.post(toPostParam(params)); - String json = readResponseNoVerifyOk(webTarget.getUri().toString(), response); - try { - return Jackson2.createJsonMapper().readValue(json, RsCheckAccessResponse.class); - } catch (Exception e) { - e.printStackTrace(); - fail(); - } - return null; - } - - @Override - public RpGetRptResponse umaRpGetRpt(String authorization, String authorizationRpId, RpGetRptParams params) { - WebTarget webTarget = webTarget(PathTestEndPoint.UMA_RP_GET_RPT); - Invocation.Builder builder = webTarget.request(); - builder.header("Accept", UmaConstants.JSON_MEDIA_TYPE); - builder.header("Content-Type", UmaConstants.JSON_MEDIA_TYPE); - builder.header("Authorization", authorization); - builder.header("AuthorizationRpId", authorizationRpId); - Response response = builder.post(toPostParam(params)); - String json = readResponseNoVerifyOk(webTarget.getUri().toString(), response); - try { - return Jackson2.createJsonMapper().readValue(json, RpGetRptResponse.class); - } catch (Exception e) { - e.printStackTrace(); - fail(); - } - return null; - } - - @Override - public RpGetClaimsGatheringUrlResponse umaRpGetClaimsGatheringUrl(String authorization, String authorizationRpId, RpGetClaimsGatheringUrlParams params) { - WebTarget webTarget = webTarget(PathTestEndPoint.UMA_RP_GET_CLAIMS_GATHERING_URL); - Invocation.Builder builder = webTarget.request(); - builder.header("Accept", UmaConstants.JSON_MEDIA_TYPE); - builder.header("Content-Type", UmaConstants.JSON_MEDIA_TYPE); - builder.header("Authorization", authorization); - builder.header("AuthorizationRpId", authorizationRpId); - Response response = builder.post(toPostParam(params)); - String json = readResponse(webTarget.getUri().toString(), response); - try { - return Jackson2.createJsonMapper().readValue(json, RpGetClaimsGatheringUrlResponse.class); - } catch (Exception e) { - e.printStackTrace(); - fail(); - } - return null; - } - - @Override - public AuthorizationCodeFlowResponse authorizationCodeFlow(String authorization, String authorizationRpId, AuthorizationCodeFlowParams params) { - WebTarget webTarget = webTarget(PathTestEndPoint.AUTHORIZATION_CODE_FLOW); - Invocation.Builder builder = webTarget.request(); - builder.header("Accept", UmaConstants.JSON_MEDIA_TYPE); - builder.header("Content-Type", UmaConstants.JSON_MEDIA_TYPE); - builder.header("Authorization", authorization); - builder.header("AuthorizationRpId", authorizationRpId); - Response response = builder.post(toPostParam(params)); - String json = readResponse(webTarget.getUri().toString(), response); - try { - return Jackson2.createJsonMapper().readValue(json, AuthorizationCodeFlowResponse.class); - } catch (Exception e) { - e.printStackTrace(); - fail(); - } - return null; - } - - @Override - public CheckAccessTokenResponse checkAccessToken(String authorization, String authorizationRpId, CheckAccessTokenParams params) { - WebTarget webTarget = webTarget(PathTestEndPoint.CHECK_ACCESS_TOKEN); - Invocation.Builder builder = webTarget.request(); - builder.header("Accept", UmaConstants.JSON_MEDIA_TYPE); - builder.header("Content-Type", UmaConstants.JSON_MEDIA_TYPE); - builder.header("Authorization", authorization); - builder.header("AuthorizationRpId", authorizationRpId); - Response response = builder.post(toPostParam(params)); - String json = readResponse(webTarget.getUri().toString(), response); - try { - return Jackson2.createJsonMapper().readValue(json, CheckAccessTokenResponse.class); - } catch (Exception e) { - e.printStackTrace(); - fail(); - } - return null; - } - - @Override - public CheckIdTokenResponse checkIdToken(String authorization, String authorizationRpId, CheckIdTokenParams params) { - WebTarget webTarget = webTarget(PathTestEndPoint.CHECK_ID_TOKEN); - Invocation.Builder builder = webTarget.request(); - builder.header("Accept", UmaConstants.JSON_MEDIA_TYPE); - builder.header("Content-Type", UmaConstants.JSON_MEDIA_TYPE); - builder.header("Authorization", authorization); - builder.header("AuthorizationRpId", authorizationRpId); - Response response = builder.post(toPostParam(params)); - String json = readResponse(webTarget.getUri().toString(), response); - try { - return Jackson2.createJsonMapper().readValue(json, CheckIdTokenResponse.class); - } catch (Exception e) { - e.printStackTrace(); - fail(); - } - return null; - } - - @Override - public String getRp(String authorization, String authorizationRpId, GetRpParams params) { - WebTarget webTarget = webTarget(PathTestEndPoint.GET_RP); - Invocation.Builder builder = webTarget.request(); - builder.header("Accept", UmaConstants.JSON_MEDIA_TYPE); - builder.header("Content-Type", UmaConstants.JSON_MEDIA_TYPE); - builder.header("Authorization", authorization); - builder.header("AuthorizationRpId", authorizationRpId); - Response response = builder.post(toPostParam(params)); - String json = readResponse(webTarget.getUri().toString(), response); - return json; - } - - @Override - public GetJwksResponse getJwks(String authorization, String authorizationRpId, GetJwksParams params) { - WebTarget webTarget = webTarget(PathTestEndPoint.GET_JSON_WEB_KEY_SET); - Invocation.Builder builder = webTarget.request(); - builder.header("Accept", UmaConstants.JSON_MEDIA_TYPE); - builder.header("Content-Type", UmaConstants.JSON_MEDIA_TYPE); - builder.header("Authorization", authorization); - builder.header("AuthorizationRpId", authorizationRpId); - Response response = builder.post(toPostParam(params)); - String json = readResponse(webTarget.getUri().toString(), response); - try { - return Jackson2.createJsonMapper().readValue(json, GetJwksResponse.class); - } catch (Exception e) { - e.printStackTrace(); - fail(); - } - return null; - } - - @Override - public GetDiscoveryResponse getDiscovery(GetDiscoveryParams params) { - WebTarget webTarget = webTarget(PathTestEndPoint.GET_DISCOVERY); - Invocation.Builder builder = webTarget.request(); - builder.header("Accept", UmaConstants.JSON_MEDIA_TYPE); - builder.header("Content-Type", UmaConstants.JSON_MEDIA_TYPE); - Response response = builder.post(toPostParam(params)); - String json = readResponse(webTarget.getUri().toString(), response); - try { - return Jackson2.createJsonMapper().readValue(json, GetDiscoveryResponse.class); - } catch (Exception e) { - e.printStackTrace(); - fail(); - } - return null; - } - - @Override - public GetIssuerResponse getIssuer(GetIssuerParams params) { - WebTarget webTarget = webTarget(PathTestEndPoint.GET_ISSUER); - Invocation.Builder builder = webTarget.request(); - builder.header("Accept", UmaConstants.JSON_MEDIA_TYPE); - builder.header("Content-Type", UmaConstants.JSON_MEDIA_TYPE); - Response response = builder.post(toPostParam(params)); - String json = readResponse(webTarget.getUri().toString(), response); - try { - return Jackson2.createJsonMapper().readValue(json, GetIssuerResponse.class); - } catch (Exception e) { - e.printStackTrace(); - fail(); - } - return null; - } - - @Override - public GetRequestObjectUriResponse getRequestObjectUri(String authorization, String authorizationRpId, GetRequestObjectUriParams params) { - WebTarget webTarget = webTarget(PathTestEndPoint.GET_REQUEST_OBJECT_URI); - Invocation.Builder builder = webTarget.request(); - builder.header("Accept", UmaConstants.JSON_MEDIA_TYPE); - builder.header("Content-Type", UmaConstants.JSON_MEDIA_TYPE); - builder.header("Authorization", authorization); - builder.header("AuthorizationRpId", authorizationRpId); - Response response = builder.post(toPostParam(params)); - String json = readResponse(webTarget.getUri().toString(), response); - try { - return Jackson2.createJsonMapper().readValue(json, GetRequestObjectUriResponse.class); - } catch (Exception e) { - e.printStackTrace(); - fail(); - } - return null; - } - - @Override - public String getApitargetURL() { - return targeHostUrl; - } - - public static void showResponse(String title, Response response, Object entity) { - System.out.println(" "); - System.out.println("RESPONSE FOR: " + title); - System.out.println(response.getStatus()); - for (Map.Entry> headers : response.getHeaders().entrySet()) { - String headerName = headers.getKey(); - System.out.println(headerName + ": " + headers.getValue()); - } - - if (entity != null) { - System.out.println(entity.toString().replace("\\n", "\n")); - } - System.out.println(" "); - System.out.println("Status message: " + response.getStatus()); - } - -} diff --git a/jans-client-api/server/src/test/java/io/jans/ca/server/arquillian/ConfigurableTest.java b/jans-client-api/server/src/test/java/io/jans/ca/server/arquillian/ConfigurableTest.java deleted file mode 100644 index bc1197cbfca..00000000000 --- a/jans-client-api/server/src/test/java/io/jans/ca/server/arquillian/ConfigurableTest.java +++ /dev/null @@ -1,163 +0,0 @@ -/* - * Janssen Project software is available under the Apache License (2004). See http://www.apache.org/licenses/ for full text. - * - * Copyright (c) 2020, Janssen Project - */ - -package io.jans.ca.server.arquillian; - -import io.jans.ca.server.Tester; -import io.jans.util.StringHelper; -import io.jans.util.properties.FileConfiguration; -import org.apache.commons.io.IOUtils; -import org.eu.ingwar.tools.arquillian.extension.suite.annotations.ArquillianSuiteDeployment; -import org.jboss.arquillian.container.test.api.Deployment; -import org.jboss.arquillian.testng.Arquillian; -import org.jboss.shrinkwrap.api.Archive; -import org.jboss.shrinkwrap.api.spec.WebArchive; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.testng.ITestContext; -import org.testng.Reporter; -import org.testng.annotations.AfterSuite; -import org.testng.annotations.BeforeSuite; - -import java.io.FileInputStream; -import java.io.IOException; -import java.util.HashMap; -import java.util.Map; -import java.util.Map.Entry; -import java.util.Properties; -import java.util.Stack; - -/** - * Base class for all seam test which require external configuration - * - * @author Yuriy Movchan - * @author Sergey Manoylo - * @version December 29, 2021 - */ -@ArquillianSuiteDeployment -public abstract class ConfigurableTest extends Arquillian { - - public static FileConfiguration testData; - public boolean initialized = false; - - private static final Logger LOG = LoggerFactory.getLogger(ConfigurableTest.class); - - @Deployment -// @OverProtocol("Servlet 3.0") - public static Archive createDeployment() { - return Deployments.createDeployment(); - } - - @BeforeSuite - public void initTestSuite(ITestContext context) throws IOException { - if (initialized) { - return; - } - - Reporter.log("Invoked init test suite method", true); - - String propertiesFile = context.getCurrentXmlTest().getParameter("propertiesFile"); - if (StringHelper.isEmpty(propertiesFile)) { - propertiesFile = "target/test-classes/testng.properties"; - } - - // Load test parameters - FileInputStream conf = new FileInputStream(propertiesFile); - Properties prop; - try { - prop = new Properties(); - prop.load(conf); - } finally { - IOUtils.closeQuietly(conf); - } - - Map parameters = new HashMap(); - for (Entry entry : prop.entrySet()) { - Object key = entry.getKey(); - Object value = entry.getValue(); - - if (StringHelper.isEmptyString(key) || StringHelper.isEmptyString(value)) { - continue; - } - parameters.put(key.toString(), value.toString()); - } - - // Override test parameters - context.getSuite().getXmlSuite().setParameters(parameters); - Tester.setSetupTestParams(parameters); - - LOG.debug("Finished beforeSuite!"); - initialized = true; - } - - @AfterSuite - public void finishTestSuite(ITestContext context) { - Reporter.log("Invoked stop test suite method", true); - } - - /** - * Data Provider, that returns correct arrays, which should be used, when JEE testing platform Arquillian is used. - * - * @author Sergey Manoylo - * @version December 29, 2021 - */ - public static class ArquillianDataProvider { - - private static final Map calls = new HashMap(); // contains map: data provider - number of call (counter value) of the function 'provide' - - /** - * Constructor. - *

- * Private, so only public static functions should be called. - */ - private ArquillianDataProvider() { - } - - /** - * Returns Array of Data, that should be used by testing framework TestNG. - *

- * This function returns two-dimensional array, when this function - * is called 1-st time for some defined provider name. - *

- * This function returns row of the two-dimensional array, when this function - * is called 2-nd - N-st time. - * Number of the row of the two-dimensional array, == (number of call - 1). - * - * @param providerName Provider Name. - * @param providerData Data of the provider (two-dimensional array). - * @return current array (two-dimensional array or row). - */ - public synchronized static Object[][] provide(final String providerName, final Object[][] providerData) { - if (calls.containsKey(providerName)) { - // get instance and increase calls counter - Object[][] testCase = new Object[][]{providerData[calls.get(providerName)]}; - calls.put(providerName, (calls.get(providerName) + 1) % providerData.length); - return testCase; - } else { - calls.put(providerName, 0); - return providerData; - } - } - - /** - * Clears counter of calls for all providers. - */ - public synchronized static void initCalls() { - calls.clear(); - } - - /** - * Clears counter of calls for some provider. - * - * @param providerName Provider Name. - */ - public synchronized static void initCalls(final String providerName) { - calls.put(providerName, 0); - } - - } - -} diff --git a/jans-client-api/server/src/test/java/io/jans/ca/server/arquillian/Deployments.java b/jans-client-api/server/src/test/java/io/jans/ca/server/arquillian/Deployments.java deleted file mode 100644 index 77b4b615930..00000000000 --- a/jans-client-api/server/src/test/java/io/jans/ca/server/arquillian/Deployments.java +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Janssen Project software is available under the Apache License (2004). See http://www.apache.org/licenses/ for full text. - * - * Copyright (c) 2020, Janssen Project - */ - -package io.jans.ca.server.arquillian; - -import org.jboss.shrinkwrap.api.ShrinkWrap; -import org.jboss.shrinkwrap.api.asset.EmptyAsset; -import org.jboss.shrinkwrap.api.spec.WebArchive; - -import java.io.File; - -/** - * Creates a deployment from a build Web Archive using ShrinkWrap ZipImporter - * - * @author Yuriy Movchan - */ -public class Deployments { - - public static WebArchive createDeployment() { - final WebArchive war = ShrinkWrap.create(WebArchive.class, "jans-client-api-server.war") - .addAsWebInfResource("jetty-env.xml").addAsWebInfResource(EmptyAsset.INSTANCE, "beans.xml") - .setWebXML("web.xml"); - try { - File dir = new File("src/main/webapp"); - addFiles(war, dir); - } catch (Exception e) { - e.printStackTrace(); - } - return war; - } - - private static void addFiles(WebArchive war, File dir) { - final File[] files = dir.listFiles(); - if (files == null) - return; - - for (File f : files) { - if (f.isFile()) { - war.addAsWebResource(f, f.getPath().replace("\\", "/").substring("src/main/webapp/".length())); - } else { - addFiles(war, f); - } - } - } - -} diff --git a/jans-client-api/server/src/test/java/io/jans/ca/server/arquillian/TestApiApplication.java b/jans-client-api/server/src/test/java/io/jans/ca/server/arquillian/TestApiApplication.java deleted file mode 100644 index 3b3ab6d807a..00000000000 --- a/jans-client-api/server/src/test/java/io/jans/ca/server/arquillian/TestApiApplication.java +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Janssen Project software is available under the MIT License (2008). See http://opensource.org/licenses/MIT for full text. - * - * Copyright (c) 2020, Janssen Project - */ - -package io.jans.ca.server.arquillian; - -import io.jans.ca.server.Tester; -import io.jans.ca.server.rest.*; -import jakarta.ws.rs.core.Application; -import jakarta.ws.rs.ext.Provider; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import java.util.HashSet; -import java.util.Set; - -@Provider -public class TestApiApplication extends Application { - private static final Logger LOG = LoggerFactory.getLogger(TestApiApplication.class); - - @Override - public Set> getClasses() { - HashSet> classes = new HashSet>(); - if (Tester.testWithExternalApiUrl()) { - return classes; - } - LOG.info("----------------DEPLOYING TEST REST RESOURCES---------------------"); - - classes.add(HealthCheckResource.class); - - classes.add(OAuth20Resource.class); - classes.add(OpenIdConnectResource.class); - classes.add(UMA2ResourceServerResource.class); - classes.add(UMA2RelyingPartyResource.class); - - classes.add(RpResource.class); - - return classes; - } - -} diff --git a/jans-client-api/server/src/test/java/io/jans/ca/server/manual/NotAllowedTest.java b/jans-client-api/server/src/test/java/io/jans/ca/server/manual/NotAllowedTest.java deleted file mode 100644 index d604eec1fd9..00000000000 --- a/jans-client-api/server/src/test/java/io/jans/ca/server/manual/NotAllowedTest.java +++ /dev/null @@ -1,59 +0,0 @@ -package io.jans.ca.server.manual; - -import com.google.common.base.Strings; -import com.google.common.collect.Lists; -import io.jans.ca.client.ClientInterface; -import io.jans.ca.client.RsProtectParams2; -import io.jans.ca.common.Jackson2; -import io.jans.ca.common.params.RegisterSiteParams; -import io.jans.ca.common.response.RegisterSiteResponse; -import io.jans.ca.common.response.RsProtectResponse; -import io.jans.ca.server.Tester; - -import java.io.IOException; - -import static org.testng.AssertJUnit.assertNotNull; -import static org.testng.AssertJUnit.assertTrue; - -/** - * @author Yuriy Zabrovarnyy - * @version 0.9, 07/11/2016 - */ - -public class NotAllowedTest { - - private static final String HOST = "http://localhost:8084"; - - private static final String rsProtect = "{\"resources\":[{\"path\":\"/scim\",\"conditions\":[{\"httpMethods\":[\"GET\"],\"scopes\":[\"https://scim-test.gluu.org/identity/seam/resource/restv1/scim/vas1\"],\"ticketScopes\":[\"https://scim-test.gluu.org/identity/seam/resource/restv1/scim/vas1\"]}]}]}"; - - public static void main(String[] args) throws IOException { - - ClientInterface client = Tester.newClient(HOST); - - RegisterSiteResponse site = registerSite(client); - - final RsProtectParams2 params = new RsProtectParams2(); - params.setRpId(site.getRpId()); - params.setResources(Jackson2.createJsonMapper().readTree(rsProtect)); - - final RsProtectResponse resp = client.umaRsProtect(Tester.getAuthorization(client.getApitargetURL(), site), null, params); - assertNotNull(resp); - } - - public static RegisterSiteResponse registerSite(ClientInterface client) { - - final RegisterSiteParams params = new RegisterSiteParams(); - params.setOpHost("https://ce-dev.gluu.org"); - params.setRedirectUris(Lists.newArrayList("https://192.168.200.58:5053")); - params.setScope(Lists.newArrayList("openid", "profile", "email", "address", "clientinfo", "mobile_phone", "phone", "uma_protection")); - params.setPostLogoutRedirectUris(Lists.newArrayList("https://192.168.200.58:5053")); - params.setClientFrontchannelLogoutUri("https://192.168.200.58:5053/logout"); - params.setAcrValues(Lists.newArrayList("gplus", "basic", "duo", "u2f")); - params.setGrantTypes(Lists.newArrayList("authorization_code")); - - final RegisterSiteResponse resp = client.registerSite(params); - assertNotNull(resp); - assertTrue(!Strings.isNullOrEmpty(resp.getRpId())); - return resp; - } -} diff --git a/jans-client-api/server/src/test/java/io/jans/ca/server/service/RpServiceTest.java b/jans-client-api/server/src/test/java/io/jans/ca/server/service/RpServiceTest.java deleted file mode 100644 index 9594de0e3e8..00000000000 --- a/jans-client-api/server/src/test/java/io/jans/ca/server/service/RpServiceTest.java +++ /dev/null @@ -1,162 +0,0 @@ -package io.jans.ca.server.service; - -import io.jans.ca.common.ErrorResponseCode; -import io.jans.ca.common.Jackson2; -import io.jans.ca.server.HttpException; -import io.jans.ca.server.configuration.model.Rp; -import io.jans.ca.server.persistence.service.PersistenceService; -import jakarta.inject.Inject; -import org.testng.annotations.AfterSuite; -import org.testng.annotations.BeforeClass; -import org.testng.annotations.BeforeSuite; -import org.testng.annotations.Test; -import org.testng.collections.Lists; - -import java.io.IOException; -import java.util.UUID; -import java.util.concurrent.ExecutorService; -import java.util.concurrent.Executors; - -import static org.testng.AssertJUnit.assertEquals; -import static org.testng.AssertJUnit.assertNotNull; - -/** - * @author Yuriy Zabrovarnyy - * @version 0.9, 05/10/2015 - */ -public class RpServiceTest { - - private static ExecutorService EXECUTOR_SERVICE; - - @Inject - RpService rpService; - @Inject - PersistenceService persistenceService; - @Inject - ValidationService validationService; - - @BeforeClass - public void setUp() throws IOException { - persistenceService.create(); - rpService.removeAllRps(); - rpService.load(); - } - - @BeforeSuite - public void setUpSuite() { - EXECUTOR_SERVICE = Executors.newFixedThreadPool(200); - } - - @AfterSuite - public void tearDownSuite() { - rpService.removeAllRps(); - persistenceService.destroy(); - EXECUTOR_SERVICE.shutdown(); - } - - @Test(enabled = false) - public void load() { - assertEquals(rpService.getRps().size(), 1); - } - - @Test - public void persist() throws Exception { - Rp rp = newRp(); - - rpService.create(rp); - assertEquals(rpService.getRps().size(), 1); - - rp.setClientName("Updated name"); - rpService.update(rp); - - assertEquals(persistenceService.getRp(rp.getRpId()).getClientName(), "Updated name"); - assertEquals(persistenceService.getRp(rp.getRpId()).getClientName(), "Updated name"); - } - - @Test - public void remove() throws Exception { - Rp rp = newRp(); - - rpService.create(rp); - assertNotNull(persistenceService.getRp(rp.getRpId())); - - rp.setClientName("Updated name"); - rpService.update(rp); - - assertEquals(persistenceService.getRp(rp.getRpId()).getClientName(), "Updated name"); - assertEquals(persistenceService.getRp(rp.getRpId()).getClientName(), "Updated name"); - - rpService.remove(rp.getRpId()); - try { - rp = persistenceService.getRp(rp.getRpId()); - validationService.validate(rp); - throw new AssertionError("RP is not removed."); - } catch (HttpException e) { - assertEquals(e.getCode(), ErrorResponseCode.INVALID_RP_ID); - } - } - - @Test(invocationCount = 10, threadPoolSize = 10, enabled = false) - public void stressTest() throws IOException { - - final Rp rp = rpService.defaultRp(); - rp.setRpId(UUID.randomUUID().toString()); - rp.setPat(UUID.randomUUID().toString()); - - rpService.create(rp); - - for (int i = 0; i < 11; i++) { - EXECUTOR_SERVICE.submit(new Runnable() { - @Override - public void run() { - try { - rp.setPat(UUID.randomUUID().toString()); - rpService.update(rp); - System.out.println("Updated PAT: " + rp.getPat() + ", for site: " + rp.getRpId()); - } catch (Throwable e) { - throw new AssertionError("Failed to update configuration: " + rp.getRpId()); - } - } - }); - } - } - - @Test - public void testNullFieldsAreSkipped() throws IOException { - Rp rp = newRp(); - String expectedJson = "{\"rp_id\":\"" + rp.getRpId() + "\",\"op_host\":\"test.gluu.org\",\"response_types\":[\"code\"],\"scope\":[\"openid\",\"profile\",\"email\"],\"ui_locales\":[\"en\"],\"claims_locales\":[\"en\"],\"acr_values\":[\"\"],\"access_token_as_jwt\":false,\"rpt_as_jwt\":false,\"front_channel_logout_session_required\":false,\"run_introspection_script_beforeaccess_token_as_jwt_creation_and_include_claims\":false,\"require_auth_time\":false,\"allow_spontaneous_scopes\":false,\"sync_client_from_op\":false,\"sync_client_period_in_seconds\":3600}"; - assertEquals(Jackson2.createRpMapper().readTree(expectedJson), Jackson2.createRpMapper().readTree(Jackson2.serializeWithoutNulls(rp))); - } - - @Test - public void testNonNullFieldsAreAlwaysPresent() throws IOException { - Rp rp = createRpWithNotNullFields(); - //here make sure expectedJson contains all non null values, to make sure serialization is correct. - String expectedJson = "{\"rp_id\":\"test_rp_id\",\"op_host\":\"https://test.gluu.org\",\"redirect_uri\":\"https://localhost:5053/authorization\",\"application_type\":\"web\",\"redirect_uris\":[\"https://localhost:5053/authorization\",\"https://localhost:5053/authorization/page1\",\"https://localhost:5053/authorization/page2\"],\"response_types\":[\"code\"],\"client_id\":\"test_client_id\",\"client_secret\":\"test_client_secret\",\"client_registration_access_token\":\"test_client_registration_access_token\",\"client_registration_client_uri\":\"https://test.gluu.org/oxauth/restv1/register?client_id=test_client_id\",\"scope\":[\"openid\",\"profile\",\"email\"],\"ui_locales\":[\"en\"],\"claims_locales\":[\"en\"],\"acr_values\":[\"\"],\"access_token_as_jwt\":false,\"rpt_as_jwt\":false,\"front_channel_logout_session_required\":false,\"run_introspection_script_beforeaccess_token_as_jwt_creation_and_include_claims\":false,\"require_auth_time\":false,\"allow_spontaneous_scopes\":false,\"sync_client_from_op\":false,\"sync_client_period_in_seconds\":3600}"; - assertEquals(Jackson2.createRpMapper().readTree(expectedJson), Jackson2.createRpMapper().readTree(Jackson2.serializeWithoutNulls(rp))); - } - - public Rp newRp() throws IOException { - Rp rp = new Rp(rpService.defaultRp()); - rp.setRpId(UUID.randomUUID().toString()); - rp.setOpHost("test.gluu.org"); - return rp; - } - - public Rp createRpWithNotNullFields() throws IOException { - Rp rp = new Rp(rpService.defaultRp()); - rp.setRpId("test_rp_id"); - rp.setOpHost("https://test.gluu.org"); - rp.setRedirectUri("https://localhost:5053/authorization"); - rp.setApplicationType("web"); - rp.setRedirectUris(Lists.newArrayList("https://localhost:5053/authorization", - "https://localhost:5053/authorization/page1", - "https://localhost:5053/authorization/page2")); - rp.setResponseTypes(Lists.newArrayList("code")); - rp.setClientId("test_client_id"); - rp.setClientSecret("test_client_secret"); - rp.setClientRegistrationAccessToken("test_client_registration_access_token"); - rp.setClientRegistrationClientUri("https://test.gluu.org/oxauth/restv1/register?client_id=test_client_id"); - return rp; - } -} diff --git a/jans-client-api/server/src/test/java/io/jans/ca/server/service/ValidatorTest.java b/jans-client-api/server/src/test/java/io/jans/ca/server/service/ValidatorTest.java deleted file mode 100644 index f5b47d069fe..00000000000 --- a/jans-client-api/server/src/test/java/io/jans/ca/server/service/ValidatorTest.java +++ /dev/null @@ -1,86 +0,0 @@ -package io.jans.ca.server.service; - -import io.jans.as.model.exception.InvalidJwtException; -import io.jans.as.model.jwt.Jwt; -import io.jans.ca.server.HttpException; -import io.jans.ca.server.op.Validator; -import org.testng.annotations.Test; - -import static org.testng.AssertJUnit.assertFalse; -import static org.testng.AssertJUnit.assertTrue; - -public class ValidatorTest { - - @Test - public void tokenWithMultiAudAndAzp_shouldBeValid() throws InvalidJwtException { - //"azp":"6b578a9b-7513-477a-9a7f-1343b487caf8" - final Jwt idToken = Jwt.parse("eyJraWQiOiJjZmFiMzRlYy0xNjhkLTQ4OTUtODRiOC0xZjAyNzgwNDkxYzciLCJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJhdF9oYXNoIjoiMnI1clZ2STdpMWxfcnNXZUV4bGRuUSIsImF1ZCI6WyI2YjU3OGE5Yi03NTEzLTQ3N2EtOWE3Zi0xMzQzYjQ4N2NhZjgiLCJhbm90aGVyX2F1ZCJdLCJhenAiOiI2YjU3OGE5Yi03NTEzLTQ3N2EtOWE3Zi0xMzQzYjQ4N2NhZjgiLCJzdWIiOiJzLV9aaXJWdDdOT0RkbldEQVVHcmpUMnFVWndLNmNYVGhiOXFWOTl2LXRnIiwiYXV0aF90aW1lIjoxNTY4MTg1MzI3LCJpc3MiOiJodHRwczovL2R1bW15LWlzc3Vlci5vcmciLCJleHAiOjE5NjgxODg5MzAsImlhdCI6MTU2ODE4NTMzMCwibm9uY2UiOiI3cjQ2dXQ2ZW11OWdpMTFnbjgwNDR1bTY0MCIsIm94T3BlbklEQ29ubmVjdFZlcnNpb24iOiJvcGVuaWRjb25uZWN0LTEuMCJ9.Q1WsYrrMx4Uo7ZT5X840yuPljdRM5AU1otNAlc7-XcCUWB2yzdHZ5ptNdcGUEKr3bHLN4f-YyBC4n6Yea60eFxTkjXKGpGJESRU690xJ_OHb69DzHXiRnbtBRcHRMUgra5CBC4WNqyTRc0SBJFGOVuNAceNyVLSP7zPXgGNQHcA"); - String clientId = "6b578a9b-7513-477a-9a7f-1343b487caf8"; - try { - Validator.validateAudience(idToken, clientId); - } catch (Exception e) { - assertFalse(e instanceof HttpException); - } - } - - @Test - public void tokenWithSingleAudArrayAndNoAzp_shouldBeValid() throws InvalidJwtException { - final Jwt idToken = Jwt.parse("eyJraWQiOiJjZmFiMzRlYy0xNjhkLTQ4OTUtODRiOC0xZjAyNzgwNDkxYzciLCJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJhdF9oYXNoIjoiMnI1clZ2STdpMWxfcnNXZUV4bGRuUSIsImF1ZCI6WyI2YjU3OGE5Yi03NTEzLTQ3N2EtOWE3Zi0xMzQzYjQ4N2NhZjgiXSwic3ViIjoicy1fWmlyVnQ3Tk9EZG5XREFVR3JqVDJxVVp3SzZjWFRoYjlxVjk5di10ZyIsImF1dGhfdGltZSI6MTU2ODE4NTMyNywiaXNzIjoiaHR0cHM6Ly9kdW1teS1pc3N1ZXIub3JnIiwiZXhwIjoxOTY4MTg4OTMwLCJpYXQiOjE1NjgxODUzMzAsIm5vbmNlIjoiN3I0NnV0NmVtdTlnaTExZ244MDQ0dW02NDAiLCJveE9wZW5JRENvbm5lY3RWZXJzaW9uIjoib3BlbmlkY29ubmVjdC0xLjAifQ.cP6DGPkYYnzDTHrH04F4Q48cPqH2T4R4RjGJmLr5QGA1pUYOOxvLj8Ak0EqmzV_83Zy0wgvyzFCv0xdi06BguUgnM4u6LL8V0hLzrdHIwJHvz5L5Gqbvs5Vg61CpP409lo0sHUN08zfN_WU3EWXK6JlSvFtE59jWSJWBF5pmLX4"); - String clientId = "6b578a9b-7513-477a-9a7f-1343b487caf8"; - try { - Validator.validateAudience(idToken, clientId); - } catch (Exception e) { - assertFalse(e instanceof HttpException); - } - } - - @Test - public void tokenWithSingleAudStringAndNoAzp_shouldBeValid() throws InvalidJwtException { - //"aud": "6b578a9b-7513-477a-9a7f-1343b487caf8", - final Jwt idToken = Jwt.parse("eyJraWQiOiJjZmFiMzRlYy0xNjhkLTQ4OTUtODRiOC0xZjAyNzgwNDkxYzciLCJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJhdF9oYXNoIjoiMnI1clZ2STdpMWxfcnNXZUV4bGRuUSIsImF1ZCI6IjZiNTc4YTliLTc1MTMtNDc3YS05YTdmLTEzNDNiNDg3Y2FmOCIsInN1YiI6InMtX1ppclZ0N05PRGRuV0RBVUdyalQycVVad0s2Y1hUaGI5cVY5OXYtdGciLCJhdXRoX3RpbWUiOjE1NjgxODUzMjcsImlzcyI6Imh0dHBzOi8vZHVtbXktaXNzdWVyLm9yZyIsImV4cCI6MTk2ODE4ODkzMCwiaWF0IjoxNTY4MTg1MzMwLCJub25jZSI6IjdyNDZ1dDZlbXU5Z2kxMWduODA0NHVtNjQwIiwib3hPcGVuSURDb25uZWN0VmVyc2lvbiI6Im9wZW5pZGNvbm5lY3QtMS4wIn0.PqnRiAhXqdeTbW1_JdRl6rLDMn36ists9Eq1n_2vOKYjGs_VxxkcdQfCt93KfC3WqEObhjlKDzwp6YUXi_7Wqta58ftUz0FU2jB7np3mq5m8lY_hKVhoZJMvxzMbCkiH-8jwtq9MZKEw3qyrwQEHQ0l21tograWD80gRedaQuD4"); - String clientId = "6b578a9b-7513-477a-9a7f-1343b487caf8"; - try { - Validator.validateAudience(idToken, clientId); - } catch (Exception e) { - assertFalse(e instanceof HttpException); - } - } - - @Test - public void tokenWithNAzpNotClientId_shouldNotValid() throws InvalidJwtException { - //"azp":"Not_equal_to_client_id" - final Jwt idToken = Jwt.parse("eyJraWQiOiJjZmFiMzRlYy0xNjhkLTQ4OTUtODRiOC0xZjAyNzgwNDkxYzciLCJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJhdF9oYXNoIjoiMnI1clZ2STdpMWxfcnNXZUV4bGRuUSIsImF1ZCI6WyI2YjU3OGE5Yi03NTEzLTQ3N2EtOWE3Zi0xMzQzYjQ4N2NhZjgiLCJhbm90aGVyX2F1ZCJdLCJhenAiOiJOb3RfZXF1YWxfdG9fY2xpZW50X2lkIiwic3ViIjoicy1fWmlyVnQ3Tk9EZG5XREFVR3JqVDJxVVp3SzZjWFRoYjlxVjk5di10ZyIsImF1dGhfdGltZSI6MTU2ODE4NTMyNywiaXNzIjoiaHR0cHM6Ly9kdW1teS1pc3N1ZXIub3JnIiwiZXhwIjoxOTY4MTg4OTMwLCJpYXQiOjE1NjgxODUzMzAsIm5vbmNlIjoiN3I0NnV0NmVtdTlnaTExZ244MDQ0dW02NDAiLCJveE9wZW5JRENvbm5lY3RWZXJzaW9uIjoib3BlbmlkY29ubmVjdC0xLjAifQ.Tnw-jF4p7VHgIE2_wcuP7WxRqtGFw2pmKltIri63hznYikYFC4frUZcJ44OKCt_tki2ZJY6EDhM1o9cPEz-_Vt-gsavfyDc711xlgNaPOBjGasdPvx5iilPLIogy4BXB4T3ROgqQpLQZf-00AQBBsrpZX5I2VJtLcyJL6_l3bKw"); - String clientId = "6b578a9b-7513-477a-9a7f-1343b487caf8"; - try { - Validator.validateAudience(idToken, clientId); - assertTrue(false); - } catch (Exception e) { - if (e instanceof HttpException) { - HttpException httpException = (HttpException)e; - assertTrue(httpException.getCode().getCode().equals("invalid_id_token_bad_authorized_party")); - } - } - } - // Test case to test issue#178 - @Test - public void tokenWithAudArrayStringWithOneElement_shouldBeValid() throws InvalidJwtException { - final Jwt idToken = Jwt.parse("eyJraWQiOiJjZmFiMzRlYy0xNjhkLTQ4OTUtODRiOC0xZjAyNzgwNDkxYzciLCJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJhdF9oYXNoIjoiMnI1clZ2STdpMWxfcnNXZUV4bGRuUSIsImF1ZCI6IltcIjZiNTc4YTliLTc1MTMtNDc3YS05YTdmLTEzNDNiNDg3Y2FmOFwiXSIsInN1YiI6InMtX1ppclZ0N05PRGRuV0RBVUdyalQycVVad0s2Y1hUaGI5cVY5OXYtdGciLCJhdXRoX3RpbWUiOjE1NjgxODUzMjcsImlzcyI6Imh0dHBzOi8vZHVtbXktaXNzdWVyLm9yZyIsImV4cCI6MTk2ODE4ODkzMCwiaWF0IjoxNTY4MTg1MzMwLCJub25jZSI6IjdyNDZ1dDZlbXU5Z2kxMWduODA0NHVtNjQwIiwib3hPcGVuSURDb25uZWN0VmVyc2lvbiI6Im9wZW5pZGNvbm5lY3QtMS4wIn0.bFgbYtgt5OA2hdwAXXCwaVMUYprArsGoURJgaA0d-YfsDYu8HU9zVDraDhflSc2Wg9uMv4RAKqEfldDwLIRIocGk5XwjyeOHFAWAlDMeDSPUAWy7d7oNGwPrRNZu37RUT1ncRS9ZAIsOhtJjflUTD0J12DeD-wT_V6Jpv8jn3Mo"); - String clientId = "6b578a9b-7513-477a-9a7f-1343b487caf8"; - try { - Validator.validateAudience(idToken, clientId); - } catch (Exception e) { - assertFalse(e instanceof HttpException); - } - } - // Test case to test issue#178 - @Test - public void tokenWithAudArrayStringWithMultiElements_shouldBeValid() throws InvalidJwtException { - final Jwt idToken = Jwt.parse("eyJraWQiOiJjZmFiMzRlYy0xNjhkLTQ4OTUtODRiOC0xZjAyNzgwNDkxYzciLCJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJhdF9oYXNoIjoiMnI1clZ2STdpMWxfcnNXZUV4bGRuUSIsImF1ZCI6IltcIjZiNTc4YTliLTc1MTMtNDc3YS05YTdmLTEzNDNiNDg3Y2FmOFwiLFwiYW5vdGhlcl9lbGVtZW50XCJdIiwiYXpwIjoiNmI1NzhhOWItNzUxMy00NzdhLTlhN2YtMTM0M2I0ODdjYWY4Iiwic3ViIjoicy1fWmlyVnQ3Tk9EZG5XREFVR3JqVDJxVVp3SzZjWFRoYjlxVjk5di10ZyIsImF1dGhfdGltZSI6MTU2ODE4NTMyNywiaXNzIjoiaHR0cHM6Ly9kdW1teS1pc3N1ZXIub3JnIiwiZXhwIjoxOTY4MTg4OTMwLCJpYXQiOjE1NjgxODUzMzAsIm5vbmNlIjoiN3I0NnV0NmVtdTlnaTExZ244MDQ0dW02NDAiLCJveE9wZW5JRENvbm5lY3RWZXJzaW9uIjoib3BlbmlkY29ubmVjdC0xLjAifQ.EFHmgED3QNxgQHBvp2Emptd1E-N80wEcyUNFz5WcmSGfatPSPtG7sX7eRgZXTqAsO2WkknCWR2PthLEa4pHG3yDsiMjNn3-7WJ8I1_4yZiJ95MzrBzPDWn8KlSUTq8xHrv724YK4mTkYTkAkBAwbqcMu7EiZJAt-4Nqk9VvO4Nw"); - String clientId = "6b578a9b-7513-477a-9a7f-1343b487caf8"; - try { - Validator.validateAudience(idToken, clientId); - } catch (Exception e) { - assertFalse(e instanceof HttpException); - } - } -} diff --git a/jans-client-api/server/src/test/java/io/jans/ca/server/tests/AccessTokenAsJwtTest.java b/jans-client-api/server/src/test/java/io/jans/ca/server/tests/AccessTokenAsJwtTest.java deleted file mode 100644 index b49a3f3dbd7..00000000000 --- a/jans-client-api/server/src/test/java/io/jans/ca/server/tests/AccessTokenAsJwtTest.java +++ /dev/null @@ -1,63 +0,0 @@ -package io.jans.ca.server.tests; - -import com.google.common.collect.Lists; -import io.jans.as.model.common.GrantType; -import io.jans.as.model.exception.InvalidJwtException; -import io.jans.as.model.jwt.Jwt; -import io.jans.ca.common.params.GetClientTokenParams; -import io.jans.ca.common.params.RegisterSiteParams; -import io.jans.ca.common.response.GetClientTokenResponse; -import io.jans.ca.common.response.RegisterSiteResponse; -import io.jans.ca.server.Tester; -import io.jans.ca.server.arquillian.BaseTest; -import org.jboss.arquillian.test.api.ArquillianResource; -import org.testng.annotations.Parameters; -import org.testng.annotations.Test; - -import java.net.URI; - -import static io.jans.ca.server.TestUtils.notEmpty; -import static io.jans.ca.server.tests.SetupClientTest.assertResponse; -import static org.testng.AssertJUnit.assertNotNull; - -/** - * @author Yuriy Zabrovarnyy - */ -public class AccessTokenAsJwtTest extends BaseTest { - - @ArquillianResource - URI url; - - @Parameters({"host", "opHost", "redirectUrls", "postLogoutRedirectUrls"}) - @Test - public void getClientToken(String host, String opHost, String redirectUrls, String postLogoutRedirectUrls) throws InvalidJwtException { - String hostTargetURL = getApiTagetURL(url); - final RegisterSiteParams params = new RegisterSiteParams(); - params.setOpHost(opHost); - params.setRedirectUris(Lists.newArrayList(redirectUrls.split(" "))); - params.setPostLogoutRedirectUris(Lists.newArrayList(postLogoutRedirectUrls.split(" "))); - params.setScope(Lists.newArrayList("openid", "uma_protection", "profile")); - params.setAccessTokenAsJwt(true); - params.setGrantTypes(Lists.newArrayList( - GrantType.AUTHORIZATION_CODE.getValue(), - GrantType.CLIENT_CREDENTIALS.getValue())); - - final RegisterSiteResponse resp = Tester.newClient(hostTargetURL).registerSite(params); - assertResponse(resp); - - final GetClientTokenParams tokenParams = new GetClientTokenParams(); - tokenParams.setOpHost(opHost); - tokenParams.setScope(Lists.newArrayList("openid")); - tokenParams.setClientId(resp.getClientId()); - tokenParams.setClientSecret(resp.getClientSecret()); - - GetClientTokenResponse tokenResponse = Tester.newClient(hostTargetURL).getClientToken(tokenParams); - - assertNotNull(tokenResponse); - notEmpty(tokenResponse.getAccessToken()); - - final Jwt parse = Jwt.parse(tokenResponse.getAccessToken()); - assertNotNull(parse); - System.out.println("access token as JWT: " + tokenResponse.getAccessToken() + ", claims: " + parse.getClaims()); - } -} diff --git a/jans-client-api/server/src/test/java/io/jans/ca/server/tests/AuthorizationCodeFlowTest.java b/jans-client-api/server/src/test/java/io/jans/ca/server/tests/AuthorizationCodeFlowTest.java deleted file mode 100644 index bb47f2ceaa6..00000000000 --- a/jans-client-api/server/src/test/java/io/jans/ca/server/tests/AuthorizationCodeFlowTest.java +++ /dev/null @@ -1,57 +0,0 @@ -package io.jans.ca.server.tests; - -import io.jans.ca.client.ClientInterface; -import io.jans.ca.common.params.AuthorizationCodeFlowParams; -import io.jans.ca.common.response.AuthorizationCodeFlowResponse; -import io.jans.ca.common.response.RegisterSiteResponse; -import io.jans.ca.server.TestUtils; -import io.jans.ca.server.Tester; -import io.jans.ca.server.arquillian.BaseTest; -import org.jboss.arquillian.test.api.ArquillianResource; -import org.testng.annotations.Parameters; -import org.testng.annotations.Test; - -import java.net.URI; -import java.util.UUID; - -import static org.testng.AssertJUnit.assertNotNull; - -/** - * @author Yuriy Zabrovarnyy - * @version 0.9, 23/06/2015 - */ - -public class AuthorizationCodeFlowTest extends BaseTest { - - @ArquillianResource - URI url; - - @Parameters({"host", "opHost", "redirectUrls", "clientId", "clientSecret", "userId", "userSecret"}) - @Test(enabled = false) - public void test(String host, String opHost, String redirectUrls, String clientId, String clientSecret, String userId, String userSecret) { - String hostTargetURL = getApiTagetURL(url); - - ClientInterface client = Tester.newClient(hostTargetURL); - RegisterSiteResponse site = RegisterSiteTest.registerSite(client, opHost, redirectUrls); - - final AuthorizationCodeFlowParams params = new AuthorizationCodeFlowParams(); - params.setRpId(site.getRpId()); - params.setClientId(clientId); - params.setClientSecret(clientSecret); - params.setNonce(UUID.randomUUID().toString()); - params.setRedirectUrl(redirectUrls.split(" ")[0]); - params.setScope("openid"); - params.setUserId(userId); - params.setUserSecret(userSecret); - - String strAuthorization = Tester.getAuthorization(hostTargetURL, site); - final AuthorizationCodeFlowResponse resp = client.authorizationCodeFlow(strAuthorization, params.getRpId(), params); - assertNotNull(resp); - - TestUtils.notEmpty(resp.getAccessToken()); - TestUtils.notEmpty(resp.getAuthorizationCode()); - TestUtils.notEmpty(resp.getIdToken()); - TestUtils.notEmpty(resp.getRefreshToken()); - TestUtils.notEmpty(resp.getScope()); - } -} diff --git a/jans-client-api/server/src/test/java/io/jans/ca/server/tests/CheckAccessTokenTest.java b/jans-client-api/server/src/test/java/io/jans/ca/server/tests/CheckAccessTokenTest.java deleted file mode 100644 index 4664a9e6631..00000000000 --- a/jans-client-api/server/src/test/java/io/jans/ca/server/tests/CheckAccessTokenTest.java +++ /dev/null @@ -1,53 +0,0 @@ -package io.jans.ca.server.tests; - -import io.jans.ca.client.ClientInterface; -import io.jans.ca.client.GetTokensByCodeResponse2; -import io.jans.ca.common.CoreUtils; -import io.jans.ca.common.params.CheckAccessTokenParams; -import io.jans.ca.common.response.CheckAccessTokenResponse; -import io.jans.ca.common.response.RegisterSiteResponse; -import io.jans.ca.server.Tester; -import io.jans.ca.server.arquillian.BaseTest; -import org.jboss.arquillian.test.api.ArquillianResource; -import org.testng.annotations.Parameters; -import org.testng.annotations.Test; - -import java.net.URI; - -import static org.testng.AssertJUnit.assertNotNull; -import static org.testng.AssertJUnit.assertTrue; - -/** - * @author Yuriy Zabrovarnyy - * @version 0.9, 23/10/2013 - */ - -public class CheckAccessTokenTest extends BaseTest { - @ArquillianResource - URI url; - - @Parameters({"host", "redirectUrls", "userId", "userSecret", "opHost"}) - @Test - public void test(String host, String redirectUrls, String userId, String userSecret, String opHost) { - String hostTargetURL = getApiTagetURL(url); - - ClientInterface client = Tester.newClient(hostTargetURL); - String nonce = CoreUtils.secureRandomString(); - String state = CoreUtils.secureRandomString(); - RegisterSiteResponse site = RegisterSiteTest.registerSite(client, opHost, redirectUrls); - GetTokensByCodeResponse2 response = GetTokensByCodeTest.tokenByCode(client, site, opHost, userId, userSecret, site.getClientId(), redirectUrls, nonce, state); - - final CheckAccessTokenParams params = new CheckAccessTokenParams(); - params.setAccessToken(response.getAccessToken()); - params.setIdToken(response.getIdToken()); - params.setRpId(site.getRpId()); - - String strAuthorization = Tester.getAuthorization(hostTargetURL, site); - final CheckAccessTokenResponse checkR = client.checkAccessToken(strAuthorization, params.getRpId(), params); - assertNotNull(checkR); - assertTrue(checkR.isActive()); - assertNotNull(checkR.getExpiresAt()); - assertNotNull(checkR.getIssuedAt()); - } - -} diff --git a/jans-client-api/server/src/test/java/io/jans/ca/server/tests/CheckIdTokenTest.java b/jans-client-api/server/src/test/java/io/jans/ca/server/tests/CheckIdTokenTest.java deleted file mode 100644 index 7e2eb65a90a..00000000000 --- a/jans-client-api/server/src/test/java/io/jans/ca/server/tests/CheckIdTokenTest.java +++ /dev/null @@ -1,65 +0,0 @@ -package io.jans.ca.server.tests; - -import io.jans.ca.client.ClientInterface; -import io.jans.ca.client.GetTokensByCodeResponse2; -import io.jans.ca.common.CoreUtils; -import io.jans.ca.common.params.CheckIdTokenParams; -import io.jans.ca.common.response.CheckIdTokenResponse; -import io.jans.ca.common.response.RegisterSiteResponse; -import io.jans.ca.server.Tester; -import io.jans.ca.server.arquillian.BaseTest; -import org.jboss.arquillian.test.api.ArquillianResource; -import org.testng.annotations.Parameters; -import org.testng.annotations.Test; - -import java.net.URI; -import java.util.List; -import java.util.Map; - -import static org.testng.AssertJUnit.assertNotNull; -import static org.testng.AssertJUnit.assertTrue; - -/** - * @author Yuriy Zabrovarnyy - * @version 0.9, 21/10/2013 - */ - -public class CheckIdTokenTest extends BaseTest { - @ArquillianResource - URI url; - - @Parameters({"host", "opHost", "redirectUrls", "userId", "userSecret"}) - @Test - public void test(String host, String opHost, String redirectUrls, String userId, String userSecret) { - String hostTargetURL = getApiTagetURL(url); - - ClientInterface client = Tester.newClient(hostTargetURL); - - RegisterSiteResponse site = RegisterSiteTest.registerSite(client, opHost, redirectUrls); - String state = CoreUtils.secureRandomString(); - String nonce = CoreUtils.secureRandomString(); - GetTokensByCodeResponse2 response = GetTokensByCodeTest.tokenByCode(client, site, opHost, userId, userSecret, site.getClientId(), redirectUrls, nonce, state); - - final CheckIdTokenParams params = new CheckIdTokenParams(); - params.setRpId(site.getRpId()); - params.setIdToken(response.getIdToken()); - params.setNonce(nonce); - - String strAuthorization = Tester.getAuthorization(hostTargetURL, site); - final CheckIdTokenResponse checkR = client.checkIdToken(strAuthorization, params.getRpId(), params); - assertNotNull(checkR); - assertTrue(checkR.isActive()); - assertNotNull(checkR.getExpiresAt()); - assertNotNull(checkR.getIssuedAt()); - assertNotNull(checkR.getClaims()); - - final Map> claims = checkR.getClaims(); - assertClaim(claims, "aud"); - assertClaim(claims, "iss"); - } - - public static void assertClaim(Map> p_claims, String p_claimName) { - final List claimValueList = p_claims.get(p_claimName); - assertTrue(claimValueList != null && !claimValueList.isEmpty()); - } -} diff --git a/jans-client-api/server/src/test/java/io/jans/ca/server/tests/DifferentAuthServerTest.java b/jans-client-api/server/src/test/java/io/jans/ca/server/tests/DifferentAuthServerTest.java deleted file mode 100644 index 35856b75edb..00000000000 --- a/jans-client-api/server/src/test/java/io/jans/ca/server/tests/DifferentAuthServerTest.java +++ /dev/null @@ -1,95 +0,0 @@ -package io.jans.ca.server.tests; - -import com.fasterxml.jackson.databind.JsonNode; -import com.google.common.collect.Lists; -import io.jans.as.model.common.GrantType; -import io.jans.ca.client.ClientInterface; -import io.jans.ca.client.GetTokensByCodeResponse2; -import io.jans.ca.common.CoreUtils; -import io.jans.ca.common.params.GetTokensByCodeParams; -import io.jans.ca.common.params.GetUserInfoParams; -import io.jans.ca.common.params.RegisterSiteParams; -import io.jans.ca.common.params.RpGetRptParams; -import io.jans.ca.common.response.RegisterSiteResponse; -import io.jans.ca.common.response.RpGetRptResponse; -import io.jans.ca.common.response.RsCheckAccessResponse; -import io.jans.ca.server.Tester; -import io.jans.ca.server.arquillian.BaseTest; -import org.apache.commons.lang.StringUtils; -import org.jboss.arquillian.test.api.ArquillianResource; -import org.testng.Assert; -import org.testng.annotations.Parameters; -import org.testng.annotations.Test; - -import java.net.URI; - -import static io.jans.ca.server.TestUtils.notEmpty; -import static org.testng.Assert.assertTrue; -import static org.testng.AssertJUnit.assertNotNull; - -//Set `protect_commands_with_access_token` field to true in config register -public class DifferentAuthServerTest extends BaseTest { - - @ArquillianResource - private URI url; - - @Parameters({"host", "opHost", "otherAuthServer", "redirectUrls", "userId", "userSecret", "opConfigurationEndpoint"}) - @Test - public void getUserInfo_withDifferentAuthServer(String host, String opHost, String otherAuthServer, String redirectUrls, String userId, String userSecret, String opConfigurationEndpoint) { - - ClientInterface client = getClientInterface(url); - RegisterSiteResponse site = RegisterSiteTest.registerSite(client, opHost, redirectUrls); - RegisterSiteResponse authServerResp = RegisterSiteTest.registerSite(client, otherAuthServer, redirectUrls, redirectUrls, "", opConfigurationEndpoint); - - final GetTokensByCodeResponse2 tokens = requestTokens(client, opHost, site, authServerResp, userId, userSecret, site.getClientId(), redirectUrls); - - GetUserInfoParams params = new GetUserInfoParams(); - params.setRpId(site.getRpId()); - params.setAccessToken(tokens.getAccessToken()); - params.setIdToken(tokens.getIdToken()); - - final JsonNode resp = client.getUserInfo(Tester.getAuthorization(client.getApitargetURL(), authServerResp), authServerResp.getRpId(), params); - assertNotNull(resp); - assertNotNull(resp.get("sub")); - } - - @Parameters({"host", "otherAuthServer", "redirectUrls", "opHost", "rsProtect", "opConfigurationEndpoint"}) - @Test - public void umaFullTest_withDifferentAuthServer(String host, String otherAuthServer, String redirectUrls, String opHost, String rsProtect, String opConfigurationEndpoint) throws Exception { - - ClientInterface client = getClientInterface(url); - - RegisterSiteResponse site = RegisterSiteTest.registerSite(client, opHost, redirectUrls); - RegisterSiteResponse authServerResp = RegisterSiteTest.registerSite(client, otherAuthServer, redirectUrls, redirectUrls, "", opConfigurationEndpoint); - - RsProtectTest.protectResources(client, site, UmaFullTest.resourceList(rsProtect).getResources()); - - final RsCheckAccessResponse checkAccess = RsCheckAccessTest.checkAccess(client, site, null); - - final RpGetRptParams params = new RpGetRptParams(); - params.setRpId(site.getRpId()); - params.setTicket(checkAccess.getTicket()); - - final RpGetRptResponse response = client.umaRpGetRpt(Tester.getAuthorization(client.getApitargetURL(), authServerResp), authServerResp.getRpId(), params); - - Assert.assertNotNull(response); - assertTrue(StringUtils.isNotBlank(response.getRpt())); - assertTrue(StringUtils.isNotBlank(response.getPct())); - } - - private GetTokensByCodeResponse2 requestTokens(ClientInterface client, String opHost, RegisterSiteResponse site, RegisterSiteResponse authServer, String userId, String userSecret, String clientId, String redirectUrls) { - - final String state = CoreUtils.secureRandomString(); - final String nonce = CoreUtils.secureRandomString(); - final GetTokensByCodeParams params = new GetTokensByCodeParams(); - params.setRpId(site.getRpId()); - params.setCode(GetTokensByCodeTest.codeRequest(client, opHost, site, userId, userSecret, clientId, redirectUrls, state, nonce)); - params.setState(state); - - final GetTokensByCodeResponse2 resp = client.getTokenByCode(Tester.getAuthorization(client.getApitargetURL(), authServer), authServer.getRpId(), params); - assertNotNull(resp); - notEmpty(resp.getAccessToken()); - notEmpty(resp.getIdToken()); - return resp; - } -} diff --git a/jans-client-api/server/src/test/java/io/jans/ca/server/tests/GetAuthorizationUrlTest.java b/jans-client-api/server/src/test/java/io/jans/ca/server/tests/GetAuthorizationUrlTest.java deleted file mode 100644 index 753fd8a6b03..00000000000 --- a/jans-client-api/server/src/test/java/io/jans/ca/server/tests/GetAuthorizationUrlTest.java +++ /dev/null @@ -1,149 +0,0 @@ -package io.jans.ca.server.tests; - -import com.google.common.collect.Lists; -import io.jans.ca.client.ClientInterface; -import io.jans.ca.common.CoreUtils; -import io.jans.ca.common.params.GetAuthorizationUrlParams; -import io.jans.ca.common.response.GetAuthorizationUrlResponse; -import io.jans.ca.common.response.RegisterSiteResponse; -import io.jans.ca.server.Tester; -import io.jans.ca.server.arquillian.BaseTest; -import org.apache.commons.lang.StringUtils; -import org.jboss.arquillian.test.api.ArquillianResource; -import org.testng.annotations.Parameters; -import org.testng.annotations.Test; - -import java.io.IOException; -import java.net.URI; -import java.util.HashMap; -import java.util.Map; - -import static io.jans.ca.server.TestUtils.notEmpty; -import static org.testng.Assert.assertEquals; -import static org.testng.AssertJUnit.assertNotNull; -import static org.testng.AssertJUnit.assertTrue; - -public class GetAuthorizationUrlTest extends BaseTest { - - @ArquillianResource - private URI url; - - @Parameters({"host", "redirectUrls", "opHost"}) - @Test - public void test(String host, String redirectUrls, String opHost) { - ClientInterface client = getClientInterface(url); - - final RegisterSiteResponse site = RegisterSiteTest.registerSite(client, opHost, redirectUrls); - final GetAuthorizationUrlParams commandParams = new GetAuthorizationUrlParams(); - commandParams.setRpId(site.getRpId()); - - final GetAuthorizationUrlResponse resp = client.getAuthorizationUrl(Tester.getAuthorization(getApiTagetURL(url), site), commandParams.getRpId(), commandParams); - assertNotNull(resp); - notEmpty(resp.getAuthorizationUrl()); - } - - @Parameters({"host", "opHost", "redirectUrls", "postLogoutRedirectUrl", "logoutUrl", "paramRedirectUrl"}) - @Test - public void testWithParameterAuthorizationUrl(String host, String opHost, String redirectUrls, String postLogoutRedirectUrl, String logoutUrl, String paramRedirectUrl) { - ClientInterface client = getClientInterface(url); - - final RegisterSiteResponse site = RegisterSiteTest.registerSite(client, opHost, redirectUrls, postLogoutRedirectUrl, - logoutUrl, false); - final GetAuthorizationUrlParams commandParams = new GetAuthorizationUrlParams(); - commandParams.setRpId(site.getRpId()); - commandParams.setRedirectUri(paramRedirectUrl); - - final GetAuthorizationUrlResponse resp = client.getAuthorizationUrl(Tester.getAuthorization(getApiTagetURL(url), site), commandParams.getRpId(), commandParams); - assertNotNull(resp); - notEmpty(resp.getAuthorizationUrl()); - assertTrue(resp.getAuthorizationUrl().contains(paramRedirectUrl)); - } - - @Parameters({"host", "redirectUrls", "opHost"}) - @Test - public void testWithResponseType(String host, String redirectUrls, String opHost) throws IOException { - ClientInterface client = getClientInterface(url); - - final RegisterSiteResponse site = RegisterSiteTest.registerSite(client, opHost, redirectUrls); - final GetAuthorizationUrlParams commandParams = new GetAuthorizationUrlParams(); - commandParams.setRpId(site.getRpId()); - commandParams.setResponseTypes(Lists.newArrayList("code", "token")); - - final GetAuthorizationUrlResponse resp = client.getAuthorizationUrl(Tester.getAuthorization(getApiTagetURL(url), site), commandParams.getRpId(), commandParams); - assertNotNull(resp); - notEmpty(resp.getAuthorizationUrl()); - - Map parameters = CoreUtils.splitQuery(resp.getAuthorizationUrl()); - assertTrue(parameters.get("response_type").contains("code")); - assertTrue(parameters.get("response_type").contains("token")); - } - - @Parameters({"host", "redirectUrls", "opHost"}) - @Test - public void testWithParams(String host, String redirectUrls, String opHost) throws IOException { - ClientInterface client = getClientInterface(url); - - final RegisterSiteResponse site = RegisterSiteTest.registerSite(client, opHost, redirectUrls); - final GetAuthorizationUrlParams commandParams = new GetAuthorizationUrlParams(); - commandParams.setRpId(site.getRpId()); - - Map params = new HashMap<>(); - params.put("max_age", "70"); - params.put("is_valid", "true"); - commandParams.setParams(params); - - final GetAuthorizationUrlResponse resp = client.getAuthorizationUrl(Tester.getAuthorization(getApiTagetURL(url), site), commandParams.getRpId(), commandParams); - notEmpty(resp.getAuthorizationUrl()); - - Map parameters = CoreUtils.splitQuery(resp.getAuthorizationUrl()); - - assertTrue(StringUtils.isNotBlank(parameters.get("max_age"))); - assertEquals(parameters.get("max_age"), "70"); - assertTrue(StringUtils.isNotBlank(parameters.get("is_valid"))); - assertEquals(parameters.get("is_valid"), "true"); - assertNotNull(resp); - } - - - @Parameters({"host", "opHost", "redirectUrls", "postLogoutRedirectUrl", "logoutUrl", "paramRedirectUrl", "state"}) - @Test - public void testWithCustomStateParameter(String host, String opHost, String redirectUrls, String postLogoutRedirectUrl, String logoutUrl, String paramRedirectUrl, String state) throws IOException { - ClientInterface client = getClientInterface(url); - - final RegisterSiteResponse site = RegisterSiteTest.registerSite(client, opHost, redirectUrls, postLogoutRedirectUrl, logoutUrl, false); - final GetAuthorizationUrlParams commandParams = new GetAuthorizationUrlParams(); - commandParams.setRpId(site.getRpId()); - commandParams.setRedirectUri(paramRedirectUrl); - commandParams.setState(state); - - final GetAuthorizationUrlResponse resp = client.getAuthorizationUrl(Tester.getAuthorization(getApiTagetURL(url), site), commandParams.getRpId(), commandParams); - assertNotNull(resp); - notEmpty(resp.getAuthorizationUrl()); - assertTrue(resp.getAuthorizationUrl().contains(paramRedirectUrl)); - - Map parameters = CoreUtils.splitQuery(resp.getAuthorizationUrl()); - assertTrue(StringUtils.isNotBlank(parameters.get("state"))); - assertEquals(parameters.get("state"), state); - } - - @Parameters({"host", "opHost", "redirectUrls", "postLogoutRedirectUrl", "logoutUrl", "paramRedirectUrl"}) - @Test - public void testWithNonceParameter(String host, String opHost, String redirectUrls, String postLogoutRedirectUrl, String logoutUrl, String paramRedirectUrl) throws IOException { - ClientInterface client = getClientInterface(url); - - final RegisterSiteResponse site = RegisterSiteTest.registerSite(client, opHost, redirectUrls, postLogoutRedirectUrl, logoutUrl, false); - final GetAuthorizationUrlParams commandParams = new GetAuthorizationUrlParams(); - commandParams.setRpId(site.getRpId()); - commandParams.setRedirectUri(paramRedirectUrl); - commandParams.setNonce("dummy_nonce"); - - final GetAuthorizationUrlResponse resp = client.getAuthorizationUrl(Tester.getAuthorization(getApiTagetURL(url), site), commandParams.getRpId(), commandParams); - assertNotNull(resp); - notEmpty(resp.getAuthorizationUrl()); - assertTrue(resp.getAuthorizationUrl().contains(paramRedirectUrl)); - - Map parameters = CoreUtils.splitQuery(resp.getAuthorizationUrl()); - assertTrue(StringUtils.isNotBlank(parameters.get("nonce"))); - assertEquals(parameters.get("nonce"), "dummy_nonce"); - } -} diff --git a/jans-client-api/server/src/test/java/io/jans/ca/server/tests/GetClientTokenTest.java b/jans-client-api/server/src/test/java/io/jans/ca/server/tests/GetClientTokenTest.java deleted file mode 100644 index 74a9b1e33ff..00000000000 --- a/jans-client-api/server/src/test/java/io/jans/ca/server/tests/GetClientTokenTest.java +++ /dev/null @@ -1,57 +0,0 @@ -package io.jans.ca.server.tests; - -import com.google.common.collect.Lists; -import io.jans.ca.common.params.GetClientTokenParams; -import io.jans.ca.common.response.GetClientTokenResponse; -import io.jans.ca.server.Tester; -import io.jans.ca.server.arquillian.BaseTest; -import org.jboss.arquillian.test.api.ArquillianResource; -import org.testng.annotations.Parameters; -import org.testng.annotations.Test; - -import java.net.URI; - -import static io.jans.ca.server.TestUtils.notEmpty; -import static org.testng.AssertJUnit.assertNotNull; - -/** - * @author Yuriy Zabrovarnyy - * @version 0.9, 31/03/2017 - */ - -public class GetClientTokenTest extends BaseTest { - - @ArquillianResource - private URI url; - - @Parameters({"host", "opHost"}) - @Test - public void getClientToken(String host, String opHost) { - final GetClientTokenParams params = new GetClientTokenParams(); - params.setOpHost(opHost); - params.setScope(Lists.newArrayList("openid")); - params.setClientId(Tester.getSetupClient(getApiTagetURL(url)).getClientId()); - params.setClientSecret(Tester.getSetupClient(getApiTagetURL(url)).getClientSecret()); - - GetClientTokenResponse resp = getClientInterface(url).getClientToken(params); - - assertNotNull(resp); - notEmpty(resp.getAccessToken()); - - } - - @Parameters({"host", "opConfigurationEndpoint"}) - @Test - public void getClientToken_withOpConfigurationEndpoint(String host, String opConfigurationEndpoint) { - final GetClientTokenParams params = new GetClientTokenParams(); - params.setOpConfigurationEndpoint(opConfigurationEndpoint); - params.setScope(Lists.newArrayList("openid")); - params.setClientId(Tester.getSetupClient(getApiTagetURL(url)).getClientId()); - params.setClientSecret(Tester.getSetupClient(getApiTagetURL(url)).getClientSecret()); - - GetClientTokenResponse resp = getClientInterface(url).getClientToken(params); - - assertNotNull(resp); - notEmpty(resp.getAccessToken()); - } -} diff --git a/jans-client-api/server/src/test/java/io/jans/ca/server/tests/GetDiscoveryTest.java b/jans-client-api/server/src/test/java/io/jans/ca/server/tests/GetDiscoveryTest.java deleted file mode 100644 index d37a787baee..00000000000 --- a/jans-client-api/server/src/test/java/io/jans/ca/server/tests/GetDiscoveryTest.java +++ /dev/null @@ -1,47 +0,0 @@ -package io.jans.ca.server.tests; - -import io.jans.ca.client.ClientInterface; -import io.jans.ca.common.params.GetDiscoveryParams; -import io.jans.ca.common.response.GetDiscoveryResponse; -import io.jans.ca.server.Tester; -import io.jans.ca.server.arquillian.BaseTest; -import org.jboss.arquillian.test.api.ArquillianResource; -import org.testng.annotations.Parameters; -import org.testng.annotations.Test; - -import java.net.URI; - -import static org.testng.AssertJUnit.assertNotNull; - -public class GetDiscoveryTest extends BaseTest { - - @ArquillianResource - private URI url; - - @Parameters({"host", "opHost", "opDiscoveryPath"}) - @Test - public void test(String host, String opHost, String opDiscoveryPath) { - ClientInterface client = getClientInterface(url); - - final GetDiscoveryParams commandParams = new GetDiscoveryParams(); - commandParams.setOpHost(opHost); - commandParams.setOpDiscoveryPath(opDiscoveryPath); - - final GetDiscoveryResponse resp = client.getDiscovery(commandParams); - assertNotNull(resp); - assertNotNull(resp.getIssuer()); - } - - @Parameters({"host", "opConfigurationEndpoint"}) - @Test - public void test_withOpConfigurationEndpoint(String host, String opConfigurationEndpoint) { - ClientInterface client = getClientInterface(url); - - final GetDiscoveryParams commandParams = new GetDiscoveryParams(); - commandParams.setOpConfigurationEndpoint(opConfigurationEndpoint); - - final GetDiscoveryResponse resp = client.getDiscovery(commandParams); - assertNotNull(resp); - assertNotNull(resp.getIssuer()); - } -} diff --git a/jans-client-api/server/src/test/java/io/jans/ca/server/tests/GetIssuerTest.java b/jans-client-api/server/src/test/java/io/jans/ca/server/tests/GetIssuerTest.java deleted file mode 100644 index 8954a473424..00000000000 --- a/jans-client-api/server/src/test/java/io/jans/ca/server/tests/GetIssuerTest.java +++ /dev/null @@ -1,71 +0,0 @@ -package io.jans.ca.server.tests; - -import io.jans.ca.client.ClientInterface; -import io.jans.ca.common.params.GetIssuerParams; -import io.jans.ca.common.response.GetIssuerResponse; -import io.jans.ca.server.Tester; -import io.jans.ca.server.arquillian.BaseTest; -import org.jboss.arquillian.test.api.ArquillianResource; -import org.testng.annotations.Parameters; -import org.testng.annotations.Test; - -import java.net.URI; - -import static org.testng.AssertJUnit.assertEquals; -import static org.testng.AssertJUnit.assertNotNull; - -public class GetIssuerTest extends BaseTest { - @ArquillianResource - URI url; - - @Parameters({"host", "opHost", "emailWebfingerInput"}) - @Test(enabled = false) - public void emailInputTest(String host, String opHost, String emailWebfingerInput) { - String hostTargetURL = getApiTagetURL(url); - ClientInterface client = Tester.newClient(hostTargetURL); - - final GetIssuerParams params = new GetIssuerParams(); - params.setResource(emailWebfingerInput); - params.setOpHost(opHost); - final GetIssuerResponse resp = client.getIssuer(params); - assertNotNull(resp); - assertEquals(resp.getSubject(), emailWebfingerInput); - resp.getLinks().forEach((link) -> { - assertEquals(link.getHref(), opHost); - }); - } - - @Parameters({"host", "opHost", "urlWebfingerInput"}) - @Test(enabled = false) - public void urlInputTest(String host, String opHost, String urlWebfingerInput) { - String hostTargetURL = getApiTagetURL(url); - ClientInterface client = Tester.newClient(hostTargetURL); - - final GetIssuerParams params = new GetIssuerParams(); - params.setResource(urlWebfingerInput); - params.setOpHost(opHost); - final GetIssuerResponse resp = client.getIssuer(params); - assertNotNull(resp); - assertEquals(resp.getSubject(), urlWebfingerInput); - resp.getLinks().forEach((link) -> { - assertEquals(link.getHref(), opHost); - }); - } - - @Parameters({"host", "opHost", "hostnameWebfingerInput"}) - @Test - public void hostnameInputTest(String host, String opHost, String hostnameWebfingerInput) { - String hostTargetURL = getApiTagetURL(url); - ClientInterface client = Tester.newClient(hostTargetURL); - - final GetIssuerParams params = new GetIssuerParams(); - params.setResource(hostnameWebfingerInput); - params.setOpHost(opHost); - final GetIssuerResponse resp = client.getIssuer(params); - assertNotNull(resp); - assertEquals(resp.getSubject(), hostnameWebfingerInput); - resp.getLinks().forEach((link) -> { - assertEquals(link.getHref(), opHost); - }); - } -} diff --git a/jans-client-api/server/src/test/java/io/jans/ca/server/tests/GetJwksTest.java b/jans-client-api/server/src/test/java/io/jans/ca/server/tests/GetJwksTest.java deleted file mode 100644 index aed0cd13bfc..00000000000 --- a/jans-client-api/server/src/test/java/io/jans/ca/server/tests/GetJwksTest.java +++ /dev/null @@ -1,63 +0,0 @@ -/* - All rights reserved -- Copyright 2015 Gluu Inc. -*/ -package io.jans.ca.server.tests; - -import io.jans.ca.client.ClientInterface; -import io.jans.ca.common.params.GetJwksParams; -import io.jans.ca.common.response.GetJwksResponse; -import io.jans.ca.server.Tester; -import io.jans.ca.server.arquillian.BaseTest; -import org.jboss.arquillian.test.api.ArquillianResource; -import org.testng.annotations.Optional; -import org.testng.annotations.Parameters; -import org.testng.annotations.Test; - -import java.net.URI; - -import static org.testng.Assert.assertFalse; -import static org.testng.Assert.assertNotNull; - -/** - * Test for checking JSON Web Key Set functionality - * - * @author Shoeb - * @version 12/01/2018 - */ - -public class GetJwksTest extends BaseTest { - - @ArquillianResource - private URI url; - - @Test(enabled = false) - @Parameters({"host", "opHost", "opDiscoveryPath"}) - public void test(String host, String opHost, @Optional String opDiscoveryPath) { - - final ClientInterface client = getClientInterface(url); - - final GetJwksParams params = new GetJwksParams(); - params.setOpHost(opHost); - params.setOpDiscoveryPath(opDiscoveryPath); - - final GetJwksResponse response = client.getJwks(Tester.getSetupAuthorization(client.getApitargetURL()), null, params); - assertNotNull(response); - assertNotNull(response.getKeys()); - assertFalse(response.getKeys().isEmpty()); - } - - @Test - @Parameters({"host", "opConfigurationEndpoint"}) - public void test_withOpConfigurationEndpoint(String host, String opConfigurationEndpoint) { - - final ClientInterface client = getClientInterface(url); - - final GetJwksParams params = new GetJwksParams(); - params.setOpConfigurationEndpoint(opConfigurationEndpoint); - - final GetJwksResponse response = client.getJwks(Tester.getSetupAuthorization(client.getApitargetURL()), null, params); - assertNotNull(response); - assertNotNull(response.getKeys()); - assertFalse(response.getKeys().isEmpty()); - } -} diff --git a/jans-client-api/server/src/test/java/io/jans/ca/server/tests/GetLogoutUrlTest.java b/jans-client-api/server/src/test/java/io/jans/ca/server/tests/GetLogoutUrlTest.java deleted file mode 100644 index 1bfb178a330..00000000000 --- a/jans-client-api/server/src/test/java/io/jans/ca/server/tests/GetLogoutUrlTest.java +++ /dev/null @@ -1,44 +0,0 @@ -package io.jans.ca.server.tests; - -import io.jans.ca.client.ClientInterface; -import io.jans.ca.common.params.GetLogoutUrlParams; -import io.jans.ca.common.response.GetLogoutUriResponse; -import io.jans.ca.common.response.RegisterSiteResponse; -import io.jans.ca.server.Tester; -import io.jans.ca.server.arquillian.BaseTest; -import org.jboss.arquillian.test.api.ArquillianResource; -import org.testng.annotations.Parameters; -import org.testng.annotations.Test; - -import java.io.IOException; -import java.net.URI; -import java.net.URLEncoder; -import java.util.UUID; - -import static org.testng.AssertJUnit.assertNotNull; -import static org.testng.AssertJUnit.assertTrue; - -public class GetLogoutUrlTest extends BaseTest { - - @ArquillianResource - private URI url; - - @Parameters({"host", "opHost", "redirectUrls", "postLogoutRedirectUrl"}) - @Test - public void test(String host, String opHost, String redirectUrls, String postLogoutRedirectUrl) throws IOException { - ClientInterface client = getClientInterface(url); - - final RegisterSiteResponse site = RegisterSiteTest.registerSite(client, opHost, redirectUrls, postLogoutRedirectUrl, "", false); - - final GetLogoutUrlParams params = new GetLogoutUrlParams(); - params.setRpId(site.getRpId()); - params.setIdTokenHint("dummy_token"); - params.setPostLogoutRedirectUri(postLogoutRedirectUrl); - params.setState(UUID.randomUUID().toString()); - params.setSessionState(UUID.randomUUID().toString()); // here must be real session instead of dummy UUID - - final GetLogoutUriResponse resp = client.getLogoutUri(Tester.getAuthorization(getApiTagetURL(url), site), params.getRpId(), params); - assertNotNull(resp); - assertTrue(resp.getUri().contains(URLEncoder.encode(postLogoutRedirectUrl, "UTF-8"))); - } -} diff --git a/jans-client-api/server/src/test/java/io/jans/ca/server/tests/GetRequestUriTest.java b/jans-client-api/server/src/test/java/io/jans/ca/server/tests/GetRequestUriTest.java deleted file mode 100644 index 3d1e131712d..00000000000 --- a/jans-client-api/server/src/test/java/io/jans/ca/server/tests/GetRequestUriTest.java +++ /dev/null @@ -1,65 +0,0 @@ -package io.jans.ca.server.tests; - -import com.fasterxml.jackson.databind.JsonNode; -import io.jans.ca.client.ClientInterface; -import io.jans.ca.common.params.GetAuthorizationUrlParams; -import io.jans.ca.common.params.GetRequestObjectUriParams; -import io.jans.ca.common.params.UpdateSiteParams; -import io.jans.ca.common.response.GetAuthorizationUrlResponse; -import io.jans.ca.common.response.GetRequestObjectUriResponse; -import io.jans.ca.common.response.RegisterSiteResponse; -import io.jans.ca.server.SetUpTest; -import io.jans.ca.server.TestUtils; -import io.jans.ca.server.Tester; -import io.jans.ca.server.arquillian.BaseTest; -import org.jboss.arquillian.test.api.ArquillianResource; -import org.testng.annotations.Parameters; -import org.testng.annotations.Test; - -import java.net.URI; -import java.util.HashMap; -import java.util.Map; - -import static org.testng.AssertJUnit.assertNotNull; - -public class GetRequestUriTest extends BaseTest { - @ArquillianResource - URI url; - - @Parameters({"host", "redirectUrls", "opHost"}) - @Test - public void test(String host, String redirectUrls, String opHost) { - String hostTargetURL = getApiTagetURL(url); - ClientInterface client = Tester.newClient(hostTargetURL); - //client registration - final RegisterSiteResponse site = RegisterSiteTest.registerSite(client, opHost, redirectUrls); - //jwks generation - JsonNode jwks = client.getRpJwks(); - //update jwks in OP - UpdateSiteParams updateSiteParams = new UpdateSiteParams(); - updateSiteParams.setRpId(site.getRpId()); - updateSiteParams.setJwks(jwks.asText()); - updateSiteParams.setRequestObjectSigningAlg("RS256"); - String strAuthorization = Tester.getAuthorization(hostTargetURL, site); - client.updateSite(strAuthorization, null, updateSiteParams); - //Request uri - GetRequestObjectUriParams getRequestUriParams = new GetRequestObjectUriParams(); - getRequestUriParams.setRpId(site.getRpId()); - getRequestUriParams.setRpHostUrl(hostTargetURL); - GetRequestObjectUriResponse getRequestUriResponse = client.getRequestObjectUri(strAuthorization, getRequestUriParams.getRpId(), getRequestUriParams); - assertNotNull(getRequestUriResponse.getRequestUri()); - //Get Request object - String requestObjectId = getRequestUriResponse.getRequestUri().substring(getRequestUriResponse.getRequestUri().lastIndexOf('/') + 1); - String requestObject = client.getRequestObject(requestObjectId); - assertNotNull(requestObject); - Map paramsMap = new HashMap<>(); - paramsMap.put("request", requestObject); - - final GetAuthorizationUrlParams commandParams = new GetAuthorizationUrlParams(); - commandParams.setRpId(site.getRpId()); - commandParams.setParams(paramsMap); - final GetAuthorizationUrlResponse resp = client.getAuthorizationUrl(strAuthorization, commandParams.getRpId(), commandParams); - assertNotNull(resp); - TestUtils.notEmpty(resp.getAuthorizationUrl()); - } -} diff --git a/jans-client-api/server/src/test/java/io/jans/ca/server/tests/GetRpJwksTest.java b/jans-client-api/server/src/test/java/io/jans/ca/server/tests/GetRpJwksTest.java deleted file mode 100644 index 3c7f13f2ba2..00000000000 --- a/jans-client-api/server/src/test/java/io/jans/ca/server/tests/GetRpJwksTest.java +++ /dev/null @@ -1,32 +0,0 @@ -package io.jans.ca.server.tests; - -import com.fasterxml.jackson.databind.JsonNode; -import io.jans.ca.client.ClientInterface; -import io.jans.ca.server.Tester; -import io.jans.ca.server.arquillian.BaseTest; -import org.jboss.arquillian.test.api.ArquillianResource; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.testng.annotations.Parameters; -import org.testng.annotations.Test; - -import java.net.URI; - -import static org.testng.Assert.assertNotNull; - -public class GetRpJwksTest extends BaseTest { - - @ArquillianResource - URI url; - - @Test - @Parameters({"host"}) - public void test(String host) { - - final ClientInterface client = Tester.newClient(getApiTagetURL(url)); - - final JsonNode jwks = client.getRpJwks(); - assertNotNull(jwks); - assertNotNull(jwks.get("keys")); - } -} diff --git a/jans-client-api/server/src/test/java/io/jans/ca/server/tests/GetTokensByCodeTest.java b/jans-client-api/server/src/test/java/io/jans/ca/server/tests/GetTokensByCodeTest.java deleted file mode 100644 index 1f4aca6c9ba..00000000000 --- a/jans-client-api/server/src/test/java/io/jans/ca/server/tests/GetTokensByCodeTest.java +++ /dev/null @@ -1,252 +0,0 @@ -package io.jans.ca.server.tests; - -import com.google.common.collect.Lists; -import io.jans.as.model.common.AuthenticationMethod; -import io.jans.as.model.util.Util; -import io.jans.ca.client.ClientInterface; -import io.jans.ca.client.GetTokensByCodeResponse2; -import io.jans.ca.common.CoreUtils; -import io.jans.ca.common.SeleniumTestUtils; -import io.jans.ca.common.params.GetAccessTokenByRefreshTokenParams; -import io.jans.ca.common.params.GetAuthorizationCodeParams; -import io.jans.ca.common.params.GetTokensByCodeParams; -import io.jans.ca.common.response.GetClientTokenResponse; -import io.jans.ca.common.response.RegisterSiteResponse; -import io.jans.ca.server.Tester; -import io.jans.ca.server.arquillian.BaseTest; -import jakarta.ws.rs.BadRequestException; -import org.apache.commons.codec.binary.Base64; -import org.jboss.arquillian.test.api.ArquillianResource; -import org.testng.annotations.Parameters; -import org.testng.annotations.Test; -import org.testng.util.Strings; - -import java.net.URI; - -import static io.jans.ca.server.TestUtils.notEmpty; -import static org.testng.AssertJUnit.assertEquals; -import static org.testng.AssertJUnit.assertNotNull; - -/** - * @author Yuriy Zabrovarnyy - * @version 0.9, 06/10/2015 - */ - -public class GetTokensByCodeTest extends BaseTest { - - @ArquillianResource - private URI url; - - @Parameters({"host", "opHost", "redirectUrls", "userId", "userSecret"}) - @Test - public void whenValidCodeIsUsed_shouldGetTokenInResponse(String host, String opHost, String redirectUrls, String userId, String userSecret) { - ClientInterface client = getClientInterface(url); - final RegisterSiteResponse site = RegisterSiteTest.registerSite(client, opHost, redirectUrls); - GetTokensByCodeResponse2 tokensResponse = tokenByCode(client, site, opHost, userId, userSecret, site.getClientId(), redirectUrls, CoreUtils.secureRandomString(), CoreUtils.secureRandomString()); - refreshToken(tokensResponse, client, site); - } - - @Parameters({"host", "opHost", "redirectUrls", "userId", "userSecret"}) - @Test - public void withbase64urlencodeState_shouldGetTokenInResponse(String host, String opHost, String redirectUrls, String userId, String userSecret) throws Exception { - ClientInterface client = getClientInterface(url); - final RegisterSiteResponse site = RegisterSiteTest.registerSite(client, opHost, redirectUrls); - String state = Base64.encodeBase64String(Util.getBytes("https://www.gluu,org")); - GetTokensByCodeResponse2 tokensResponse = tokenByCode(client, site, opHost, userId, userSecret, site.getClientId(), redirectUrls, CoreUtils.secureRandomString(), state); - refreshToken(tokensResponse, client, site); - } - - @Parameters({"host", "opHost", "redirectUrls", "userId", "userSecret"}) - @Test - public void withAuthenticationMethod_shouldGetTokenInResponse(String host, String opHost, String redirectUrls, String userId, String userSecret) { - ClientInterface client = getClientInterface(url); - final RegisterSiteResponse site = RegisterSiteTest.registerSite_withAuthenticationMethod(client, opHost, redirectUrls, "PS256", AuthenticationMethod.PRIVATE_KEY_JWT.toString()); - tokenByCode(client, site, opHost, userId, userSecret, site.getClientId(), redirectUrls, CoreUtils.secureRandomString(), CoreUtils.secureRandomString(), AuthenticationMethod.PRIVATE_KEY_JWT.toString(), "PS256"); - } - - @Parameters({"host", "opHost", "redirectUrls", "userId", "userSecret"}) - @Test - public void getToken_withHS256(String host, String opHost, String redirectUrls, String userId, String userSecret) { - getToken_withResponseAlg("HS256", opHost, redirectUrls, userId, userSecret); - } - - @Parameters({"host", "opHost", "redirectUrls", "userId", "userSecret"}) - @Test - public void getToken_withHS384(String host, String opHost, String redirectUrls, String userId, String userSecret) { - getToken_withResponseAlg("HS384", opHost, redirectUrls, userId, userSecret); - } - - @Parameters({"host", "opHost", "redirectUrls", "userId", "userSecret"}) - @Test - public void getToken_withHS512(String host, String opHost, String redirectUrls, String userId, String userSecret) { - getToken_withResponseAlg("HS512", opHost, redirectUrls, userId, userSecret); - } - - @Parameters({"host", "opHost", "redirectUrls", "userId", "userSecret", "opConfigurationEndpoint"}) - @Test - public void getToken_withRS256(String host, String opHost, String redirectUrls, String userId, String userSecret, String opConfigurationEndpoint) { - getToken_withResponseAlg("RS256", opHost, redirectUrls, userId, userSecret, opConfigurationEndpoint); - } - - @Parameters({"host", "opHost", "redirectUrls", "userId", "userSecret"}) - @Test - public void getToken_withRS384(String host, String opHost, String redirectUrls, String userId, String userSecret) { - getToken_withResponseAlg("RS384", opHost, redirectUrls, userId, userSecret); - } - - @Parameters({"host", "opHost", "redirectUrls", "userId", "userSecret", "opConfigurationEndpoint"}) - @Test - public void getToken_withRS512(String host, String opHost, String redirectUrls, String userId, String userSecret, String opConfigurationEndpoint) { - getToken_withResponseAlg("RS512", opHost, redirectUrls, userId, userSecret, opConfigurationEndpoint); - } - - @Parameters({"host", "opHost", "redirectUrls", "userId", "userSecret", "opConfigurationEndpoint"}) - @Test - public void getToken_withES256(String host, String opHost, String redirectUrls, String userId, String userSecret, String opConfigurationEndpoint) { - getToken_withResponseAlg("ES256", opHost, redirectUrls, userId, userSecret, opConfigurationEndpoint); - } - - private GetTokensByCodeResponse2 getToken_withResponseAlg(String responseAlgorithm, String opHost, String redirectUrls, String userId, String userSecret, String opConfigurationEndpoint) { - ClientInterface client = getClientInterface(url); - final RegisterSiteResponse site = RegisterSiteTest.registerSite(client, opHost, redirectUrls, responseAlgorithm, opConfigurationEndpoint); - return tokenByCode(client, site, opHost, userId, userSecret, site.getClientId(), redirectUrls, CoreUtils.secureRandomString(), CoreUtils.secureRandomString()); - } - - private GetTokensByCodeResponse2 getToken_withResponseAlg(String responseAlgorithm, String opHost, String redirectUrls, String userId, String userSecret) { - ClientInterface client = getClientInterface(url); - final RegisterSiteResponse site = RegisterSiteTest.registerSite(client, opHost, redirectUrls, responseAlgorithm); - return tokenByCode(client, site, opHost, userId, userSecret, site.getClientId(), redirectUrls, CoreUtils.secureRandomString(), CoreUtils.secureRandomString()); - } - - @Parameters({"host", "opHost", "redirectUrls", "userId", "userSecret"}) - @Test - public void getToken_withES384(String host, String opHost, String redirectUrls, String userId, String userSecret) { - getToken_withResponseAlg("ES384", opHost, redirectUrls, userId, userSecret); - } - - @Parameters({"host", "opHost", "redirectUrls", "userId", "userSecret"}) - @Test - public void getToken_withES512(String host, String opHost, String redirectUrls, String userId, String userSecret) { - getToken_withResponseAlg("ES512", opHost, redirectUrls, userId, userSecret); - } - - @Parameters({"host", "opHost", "redirectUrls", "userId", "userSecret"}) - @Test - public void getToken_withPS256(String host, String opHost, String redirectUrls, String userId, String userSecret) { - getToken_withResponseAlg("PS256", opHost, redirectUrls, userId, userSecret); - } - - @Parameters({"host", "opHost", "redirectUrls", "userId", "userSecret"}) - @Test - public void getToken_withPS384(String host, String opHost, String redirectUrls, String userId, String userSecret) { - getToken_withResponseAlg("PS384", opHost, redirectUrls, userId, userSecret); - } - - @Parameters({"host", "opHost", "redirectUrls", "userId", "userSecret"}) - @Test - public void getToken_withPS512(String host, String opHost, String redirectUrls, String userId, String userSecret) { - getToken_withResponseAlg("PS512", opHost, redirectUrls, userId, userSecret); - } - - @Parameters({"host", "opHost", "redirectUrls", "userId", "userSecret"}) - @Test - public void getToken_withNoneAlgo(String host, String opHost, String redirectUrls, String userId, String userSecret) { - getToken_withResponseAlg("none", opHost, redirectUrls, userId, userSecret); - } - - @Parameters({"host", "opHost", "redirectUrls", "userId", "userSecret"}) - @Test - public void whenInvalidCodeIsUsed_shouldGet400BadRequest(String host, String opHost, String redirectUrls, String userId, String userSecret) { - ClientInterface client = getClientInterface(url); - final RegisterSiteResponse site = RegisterSiteTest.registerSite(client, opHost, redirectUrls); - tokenByInvalidCode(client, site, userId, userSecret, CoreUtils.secureRandomString()); - } - - public static GetClientTokenResponse refreshToken(GetTokensByCodeResponse2 resp, ClientInterface client, RegisterSiteResponse site) { - notEmpty(resp.getRefreshToken()); - - // refresh token - final GetAccessTokenByRefreshTokenParams refreshParams = new GetAccessTokenByRefreshTokenParams(); - refreshParams.setRpId(site.getRpId()); - refreshParams.setScope(Lists.newArrayList("openid", "jans_client_api")); - refreshParams.setRefreshToken(resp.getRefreshToken()); - - GetClientTokenResponse refreshResponse = client.getAccessTokenByRefreshToken(Tester.getAuthorization(client.getApitargetURL(), site), refreshParams.getRpId(), refreshParams); - - assertNotNull(refreshResponse); - notEmpty(refreshResponse.getAccessToken()); - notEmpty(refreshResponse.getRefreshToken()); - return refreshResponse; - } - - public static GetTokensByCodeResponse2 tokenByCode(ClientInterface client, RegisterSiteResponse site, String opHost, String userId, String userSecret, String clientId, String redirectUrls, String nonce, String state) { - return tokenByCode(client, site, opHost, userId, userSecret, clientId, redirectUrls, nonce, state, null, null); - } - - public static GetTokensByCodeResponse2 tokenByCode(ClientInterface client, RegisterSiteResponse site, String opHost, String userId, String userSecret, String clientId, String redirectUrls, String nonce, String state, String authenticationMethod, String algorithm) { - - RegisterSiteResponse authServer = RegisterSiteTest.registerSite(client, opHost, redirectUrls); - String accessToken = Tester.getAuthorization(client.getApitargetURL(), authServer); - String authorizationRpId = authServer.getRpId(); - - String code = codeRequest(client, opHost, site, userId, userSecret, clientId, redirectUrls, state, nonce, accessToken, authorizationRpId); - - notEmpty(code); - - final GetTokensByCodeParams params = new GetTokensByCodeParams(); - params.setRpId(site.getRpId()); - params.setCode(code); - params.setState(state); - params.setAuthenticationMethod(authenticationMethod); - params.setAlgorithm(algorithm); - - final GetTokensByCodeResponse2 resp = client.getTokenByCode(accessToken, authorizationRpId, params); - assertNotNull(resp); - notEmpty(resp.getAccessToken()); - notEmpty(resp.getIdToken()); - notEmpty(resp.getRefreshToken()); - return resp; - } - - public static GetTokensByCodeResponse2 tokenByInvalidCode(ClientInterface client, RegisterSiteResponse site, String userId, String userSecret, String nonce) { - - final String state = CoreUtils.secureRandomString(); - final String code = CoreUtils.secureRandomString(); - - String testRpId = site.getRpId(); - - final GetTokensByCodeParams params = new GetTokensByCodeParams(); - params.setRpId(testRpId); - params.setCode(code); - params.setState(state); - - GetTokensByCodeResponse2 resp = null; - - resp = client.getTokenByCode(Tester.getAuthorization(client.getApitargetURL(), site), params.getRpId(), params); - assertNotNull(resp); - assertEquals(resp.getError(), "bad_request"); - assertEquals(resp.getErrorDescription(), "'state' is not registered."); - - return resp; - } - - public static String codeRequest(ClientInterface client, String opHost, RegisterSiteResponse site, String userId, String userSecret, String clientId, String redirectUrls, String state, String nonce) { - return codeRequest(client, opHost, site, userId, userSecret, clientId, redirectUrls, state, nonce, null, site.getRpId()); - } - - public static String codeRequest(ClientInterface client, String opHost, RegisterSiteResponse site, String userId, String userSecret, String clientId, String redirectUrls, String state, String nonce, String accessToken, String authorizationRpId) { - SeleniumTestUtils.authorizeClient(opHost, userId, userSecret, clientId, redirectUrls, state, nonce, null, null); - GetAuthorizationCodeParams params = new GetAuthorizationCodeParams(); - params.setRpId(site.getRpId()); - params.setUsername(userId); - params.setPassword(userSecret); - params.setState(state); - params.setNonce(nonce); - - if (Strings.isNullOrEmpty(accessToken)) { - accessToken = Tester.getAuthorization(client.getApitargetURL(), site); - System.out.println("----------ACCESS TOKEN " + accessToken); - } - return client.getAuthorizationCode(accessToken, authorizationRpId, params).getCode(); - } -} diff --git a/jans-client-api/server/src/test/java/io/jans/ca/server/tests/GetUserInfoTest.java b/jans-client-api/server/src/test/java/io/jans/ca/server/tests/GetUserInfoTest.java deleted file mode 100644 index 37200948164..00000000000 --- a/jans-client-api/server/src/test/java/io/jans/ca/server/tests/GetUserInfoTest.java +++ /dev/null @@ -1,64 +0,0 @@ -package io.jans.ca.server.tests; - -import com.fasterxml.jackson.databind.JsonNode; -import io.jans.ca.client.ClientInterface; -import io.jans.ca.client.GetTokensByCodeResponse2; -import io.jans.ca.common.CoreUtils; -import io.jans.ca.common.params.GetTokensByCodeParams; -import io.jans.ca.common.params.GetUserInfoParams; -import io.jans.ca.common.response.RegisterSiteResponse; -import io.jans.ca.server.Tester; -import io.jans.ca.server.arquillian.BaseTest; -import org.jboss.arquillian.test.api.ArquillianResource; -import org.testng.annotations.Parameters; -import org.testng.annotations.Test; - -import java.net.URI; - -import static io.jans.ca.server.TestUtils.notEmpty; -import static org.testng.AssertJUnit.assertNotNull; - -/** - * @author Yuriy Zabrovarnyy - * @version 0.9, 12/10/2015 - */ - -public class GetUserInfoTest extends BaseTest { - - @ArquillianResource - private URI url; - - @Parameters({"host", "opHost", "redirectUrls", "userId", "userSecret"}) - @Test - public void test(String host, String opHost, String redirectUrls, String userId, String userSecret) { - ClientInterface client = getClientInterface(url); - - final RegisterSiteResponse site = RegisterSiteTest.registerSite(client, opHost, redirectUrls); - final GetTokensByCodeResponse2 tokens = requestTokens(client, opHost, site, userId, userSecret, site.getClientId(), redirectUrls); - - GetUserInfoParams params = new GetUserInfoParams(); - params.setRpId(site.getRpId()); - params.setAccessToken(tokens.getAccessToken()); - params.setIdToken(tokens.getIdToken()); - - final JsonNode resp = client.getUserInfo(Tester.getAuthorization(client.getApitargetURL(), site), params.getRpId(), params); - assertNotNull(resp); - assertNotNull(resp.get("sub")); - } - - private GetTokensByCodeResponse2 requestTokens(ClientInterface client, String opHost, RegisterSiteResponse site, String userId, String userSecret, String clientId, String redirectUrls) { - - final String state = CoreUtils.secureRandomString(); - final String nonce = CoreUtils.secureRandomString(); - final GetTokensByCodeParams params = new GetTokensByCodeParams(); - params.setRpId(site.getRpId()); - params.setCode(GetTokensByCodeTest.codeRequest(client, opHost, site, userId, userSecret, clientId, redirectUrls, state, nonce)); - params.setState(state); - - final GetTokensByCodeResponse2 resp = client.getTokenByCode(Tester.getAuthorization(client.getApitargetURL(), site), params.getRpId(), params); - assertNotNull(resp); - notEmpty(resp.getAccessToken()); - notEmpty(resp.getIdToken()); - return resp; - } -} diff --git a/jans-client-api/server/src/test/java/io/jans/ca/server/tests/HealthCheckTest.java b/jans-client-api/server/src/test/java/io/jans/ca/server/tests/HealthCheckTest.java deleted file mode 100644 index a9167630b70..00000000000 --- a/jans-client-api/server/src/test/java/io/jans/ca/server/tests/HealthCheckTest.java +++ /dev/null @@ -1,32 +0,0 @@ -package io.jans.ca.server.tests; - -import io.jans.ca.common.Jackson2; -import io.jans.ca.server.Tester; -import io.jans.ca.server.arquillian.BaseTest; -import org.jboss.arquillian.test.api.ArquillianResource; -import org.testng.annotations.Test; - -import java.io.IOException; -import java.net.URI; -import java.util.Map; - -import static org.testng.AssertJUnit.assertEquals; -import static org.testng.AssertJUnit.assertNotNull; - -public class HealthCheckTest extends BaseTest { - - @ArquillianResource - private URI url; - - @Test - public void testHealthCheck() throws IOException { - showTitle("testHealthCheck"); - String resp = Tester.newClient(getApiTagetURL(url)).healthCheck(); - - assertNotNull(resp); - Map map = Jackson2.createRpMapper().readValue(resp, Map.class); - - assertEquals(map.get("application"), "jans-client-api"); - assertEquals(map.get("status"), "running"); - } -} diff --git a/jans-client-api/server/src/test/java/io/jans/ca/server/tests/IntrospectAccessTokenTest.java b/jans-client-api/server/src/test/java/io/jans/ca/server/tests/IntrospectAccessTokenTest.java deleted file mode 100644 index 72f0a623e6b..00000000000 --- a/jans-client-api/server/src/test/java/io/jans/ca/server/tests/IntrospectAccessTokenTest.java +++ /dev/null @@ -1,61 +0,0 @@ -package io.jans.ca.server.tests; - -import com.google.common.collect.Lists; -import io.jans.ca.client.ClientInterface; -import io.jans.ca.common.params.GetClientTokenParams; -import io.jans.ca.common.params.IntrospectAccessTokenParams; -import io.jans.ca.common.response.GetClientTokenResponse; -import io.jans.ca.common.response.IntrospectAccessTokenResponse; -import io.jans.ca.common.response.RegisterSiteResponse; -import io.jans.ca.server.Tester; -import io.jans.ca.server.arquillian.BaseTest; -import org.jboss.arquillian.test.api.ArquillianResource; -import org.testng.annotations.Parameters; -import org.testng.annotations.Test; - -import java.net.URI; - -import static io.jans.ca.server.TestUtils.notEmpty; -import static org.testng.AssertJUnit.assertNotNull; -import static org.testng.AssertJUnit.assertTrue; - -/** - * @author yuriyz - */ -public class IntrospectAccessTokenTest extends BaseTest { - - @ArquillianResource - private URI url; - - @Parameters({"host", "opHost", "redirectUrls"}) - @Test - public void introspectAccessToken(String host, String opHost, String redirectUrls) { - - ClientInterface client = getClientInterface(url); - - RegisterSiteResponse setupResponse = SetupClientTest.setupClient(client, opHost, redirectUrls); - - final GetClientTokenParams params = new GetClientTokenParams(); - params.setOpHost(opHost); - params.setScope(Lists.newArrayList("openid", "uma_protection", "profile", "jans_client_api")); - params.setClientId(setupResponse.getClientId()); - params.setClientSecret(setupResponse.getClientSecret()); - - GetClientTokenResponse tokenResponse = client.getClientToken(params); - - assertNotNull(tokenResponse); - notEmpty(tokenResponse.getAccessToken()); - - IntrospectAccessTokenParams introspectParams = new IntrospectAccessTokenParams(); - introspectParams.setRpId(setupResponse.getRpId()); - introspectParams.setAccessToken(tokenResponse.getAccessToken()); - - IntrospectAccessTokenResponse introspectionResponse = client.introspectAccessToken("Bearer " + tokenResponse.getAccessToken(), introspectParams.getRpId(), introspectParams); - - assertNotNull(introspectionResponse); - assertTrue(introspectionResponse.isActive()); - assertNotNull(introspectionResponse.getIssuedAt()); - assertNotNull(introspectionResponse.getExpiresAt()); - assertTrue(introspectionResponse.getExpiresAt() >= introspectionResponse.getIssuedAt()); - } -} diff --git a/jans-client-api/server/src/test/java/io/jans/ca/server/tests/IntrospectRptTest.java b/jans-client-api/server/src/test/java/io/jans/ca/server/tests/IntrospectRptTest.java deleted file mode 100644 index dc71ec67771..00000000000 --- a/jans-client-api/server/src/test/java/io/jans/ca/server/tests/IntrospectRptTest.java +++ /dev/null @@ -1,47 +0,0 @@ -package io.jans.ca.server.tests; - -import io.jans.ca.client.ClientInterface; -import io.jans.ca.common.introspection.CorrectRptIntrospectionResponse; -import io.jans.ca.common.params.IntrospectRptParams; -import io.jans.ca.common.response.RegisterSiteResponse; -import io.jans.ca.common.response.RpGetRptResponse; -import io.jans.ca.server.Tester; -import io.jans.ca.server.arquillian.BaseTest; -import org.jboss.arquillian.test.api.ArquillianResource; -import org.testng.annotations.Parameters; -import org.testng.annotations.Test; - -import java.io.IOException; -import java.net.URI; - -import static org.testng.Assert.assertNotNull; -import static org.testng.AssertJUnit.assertTrue; - -/** - * @author yuriyz - */ -public class IntrospectRptTest extends BaseTest { - - @ArquillianResource - private URI url; - - @Parameters({"host", "opHost", "redirectUrls", "rsProtect"}) - @Test - public void test(String host, String opHost, String redirectUrls, String rsProtect) throws IOException { - ClientInterface client = getClientInterface(url); - - RegisterSiteResponse site = RegisterSiteTest.registerSite(client, opHost, redirectUrls); - final RpGetRptResponse rptResponse = RpGetRptTest.requestRpt(client, site, rsProtect); - - IntrospectRptParams params = new IntrospectRptParams(); - params.setRpId(site.getRpId()); - params.setRpt(rptResponse.getRpt()); - - final CorrectRptIntrospectionResponse response = client.introspectRpt(Tester.getAuthorization(client.getApitargetURL(), site), params.getRpId(), params); - - assertNotNull(response); - assertTrue(response.getActive()); - assertTrue(response.getExpiresAt() != null); - assertTrue(response.getIssuedAt() != null); - } -} diff --git a/jans-client-api/server/src/test/java/io/jans/ca/server/tests/PathTestEndPoint.java b/jans-client-api/server/src/test/java/io/jans/ca/server/tests/PathTestEndPoint.java deleted file mode 100644 index 1edcb47cc44..00000000000 --- a/jans-client-api/server/src/test/java/io/jans/ca/server/tests/PathTestEndPoint.java +++ /dev/null @@ -1,36 +0,0 @@ -package io.jans.ca.server.tests; - -public class PathTestEndPoint { - - public static String HEALT_CHECK = "health-check"; - public static String REGISTER_SITE = "register-site"; - public static String UPDATE_SITE = "update-site"; - public static String REMOVE_SITE = "remove-site"; - public static String GET_CLIENT_TOKEN = "get-client-token"; - public static String GET_ACCESS_TOKEN_BY_REFRESH = "get-access-token-by-refresh-token"; - public static String INSTROSPECT_ACCESS_TOKEN = "introspect-access-token"; - public static String GET_USER_INFO = "get-user-info"; - public static String GET_LOGOUT_URI = "get-logout-uri"; - public static String GET_JSON_WEB_KEY_SET = "get-jwks"; - public static String GET_DISCOVERY = "get-discovery"; - public static String GET_AUTHORIZATION_URL = "get-authorization-url"; - public static String GET_AUTHORIZATION_CODE = "get-authorization-code"; - public static String GET_TOKENS_BY_CODE = "get-tokens-by-code"; - - - - public static String GET_RP = "get-rp"; - public static String GET_RP_JWKS = "get-rp-jwks"; - public static String GET_REQUEST_OBJECT = "get-request-object/"; - public static String INSTROSPECT_RPT = "introspect-rpt"; - public static String UMA_RS_PROTECT = "uma-rs-protect"; - public static String UMA_RS_MODIFY = "uma-rs-modify"; - public static String UMA_RS_CHECK_ACCESS = "uma-rs-check-access"; - public static String UMA_RP_GET_RPT = "uma-rp-get-rpt"; - public static String UMA_RP_GET_CLAIMS_GATHERING_URL = "uma-rp-get-claims-gathering-url"; - public static String AUTHORIZATION_CODE_FLOW = "authorization-code-flow"; - public static String CHECK_ACCESS_TOKEN = "check-access-token"; - public static String CHECK_ID_TOKEN = "check-id-token"; - public static String GET_ISSUER = "get-issuer"; - public static String GET_REQUEST_OBJECT_URI = "get-request-object-uri"; -} diff --git a/jans-client-api/server/src/test/java/io/jans/ca/server/tests/RegisterRequestMapperTest.java b/jans-client-api/server/src/test/java/io/jans/ca/server/tests/RegisterRequestMapperTest.java deleted file mode 100644 index 57d0f6d2137..00000000000 --- a/jans-client-api/server/src/test/java/io/jans/ca/server/tests/RegisterRequestMapperTest.java +++ /dev/null @@ -1,208 +0,0 @@ -package io.jans.ca.server.tests; - -import com.google.common.collect.Lists; -import io.jans.as.client.RegisterRequest; -import io.jans.as.model.common.AuthenticationMethod; -import io.jans.as.model.common.GrantType; -import io.jans.as.model.crypto.encryption.BlockEncryptionAlgorithm; -import io.jans.as.model.crypto.encryption.KeyEncryptionAlgorithm; -import io.jans.as.model.crypto.signature.SignatureAlgorithm; -import io.jans.ca.common.Jackson2; -import io.jans.ca.server.configuration.model.Rp; -import io.jans.ca.server.mapper.RegisterRequestMapper; -import org.testng.annotations.Test; - -import java.io.IOException; -import java.util.stream.Collectors; - -import static org.testng.AssertJUnit.assertEquals; - -public class RegisterRequestMapperTest { - - @Test - public void testRegisterRequestMapper() throws IOException { - //check createRegisterRequest - Rp rp = createRp(); - RegisterRequest request = RegisterRequestMapper.createRegisterRequest(rp); - assertEquals(Jackson2.createRpMapper().readTree(Jackson2.serializeWithoutNulls(request.getClaimsRedirectUris())), - Jackson2.createRpMapper().readTree(Jackson2.serializeWithoutNulls(rp.getClaimsRedirectUri()))); - assertEquals(request.getIdTokenSignedResponseAlg(), SignatureAlgorithm.HS256); - assertEquals(request.getIdTokenEncryptedResponseAlg(), KeyEncryptionAlgorithm.RSA1_5); - assertEquals(request.getUserInfoEncryptedResponseEnc(), BlockEncryptionAlgorithm.A128CBC_PLUS_HS256); - - assertEquals(request.getClientName(), rp.getClientName()); - assertEquals(request.getApplicationType().toString(), rp.getApplicationType()); - assertEquals(request.getTokenEndpointAuthMethod(), AuthenticationMethod.CLIENT_SECRET_BASIC); - assertEquals(Jackson2.createRpMapper().readTree(Jackson2.serializeWithoutNulls(request.getGrantTypes())), - Jackson2.createRpMapper().readTree(Jackson2.serializeWithoutNulls(rp.getGrantType().stream().map(item -> GrantType.fromString(item)).collect(Collectors.toList())))); - assertEquals(request.getFrontChannelLogoutUri(), rp.getFrontChannelLogoutUri()); - assertEquals(request.getTokenEndpointAuthMethod().toString(), rp.getTokenEndpointAuthMethod()); - assertEquals(Jackson2.createRpMapper().readTree(Jackson2.serializeWithoutNulls(request.getRequestUris())), - Jackson2.createRpMapper().readTree(Jackson2.serializeWithoutNulls(rp.getRequestUris()))); - assertEquals(request.getSectorIdentifierUri().toString(), rp.getSectorIdentifierUri()); - assertEquals(Jackson2.createRpMapper().readTree(Jackson2.serializeWithoutNulls(request.getRedirectUris())), - Jackson2.createRpMapper().readTree(Jackson2.serializeWithoutNulls(rp.getRedirectUris()))); - assertEquals(request.getAccessTokenAsJwt(), rp.getAccessTokenAsJwt()); - assertEquals(request.getAccessTokenSigningAlg().toString(), rp.getAccessTokenSigningAlg()); - assertEquals(request.getRptAsJwt(), rp.getRptAsJwt()); - assertEquals(Jackson2.createRpMapper().readTree(Jackson2.serializeWithoutNulls(request.getResponseTypes())), - Jackson2.createRpMapper().readTree(Jackson2.serializeWithoutNulls(rp.getResponseTypes()))); - assertEquals(Jackson2.createRpMapper().readTree(Jackson2.serializeWithoutNulls(request.getDefaultAcrValues())), - Jackson2.createRpMapper().readTree(Jackson2.serializeWithoutNulls(rp.getAcrValues()))); - assertEquals(Jackson2.createRpMapper().readTree(Jackson2.serializeWithoutNulls(request.getContacts())), - Jackson2.createRpMapper().readTree(Jackson2.serializeWithoutNulls(rp.getContacts()))); - assertEquals(Jackson2.createRpMapper().readTree(Jackson2.serializeWithoutNulls(request.getPostLogoutRedirectUris())), - Jackson2.createRpMapper().readTree(Jackson2.serializeWithoutNulls(rp.getPostLogoutRedirectUris()))); - assertEquals(Jackson2.createRpMapper().readTree(Jackson2.serializeWithoutNulls(request.getScope())), - Jackson2.createRpMapper().readTree(Jackson2.serializeWithoutNulls(rp.getScope()))); - assertEquals(request.getLogoUri(), rp.getLogoUri()); - assertEquals(request.getClientUri(), rp.getClientUri()); - assertEquals(request.getPolicyUri(), rp.getPolicyUri()); - assertEquals(request.getFrontChannelLogoutSessionRequired(), rp.getFrontChannelLogoutSessionRequired()); - assertEquals(request.getTosUri(), rp.getTosUri()); - assertEquals(request.getJwks(), rp.getJwks()); - assertEquals(request.getIdTokenTokenBindingCnf(), rp.getIdTokenBindingCnf()); - assertEquals(request.getTlsClientAuthSubjectDn(), rp.getTlsClientAuthSubjectDn()); - assertEquals(request.getSubjectType().toString(), rp.getSubjectType()); - assertEquals(request.getRunIntrospectionScriptBeforeAccessTokenAsJwtCreationAndIncludeClaims(), rp.getRunIntrospectionScriptBeforeAccessTokenAsJwtCreationAndIncludeClaims()); - assertEquals(request.getIdTokenSignedResponseAlg().toString(), rp.getIdTokenSignedResponseAlg()); - assertEquals(request.getIdTokenEncryptedResponseAlg().toString(), rp.getIdTokenEncryptedResponseAlg()); - assertEquals(request.getIdTokenEncryptedResponseEnc().toString(), rp.getIdTokenEncryptedResponseEnc()); - assertEquals(request.getUserInfoSignedResponseAlg().toString(), rp.getUserInfoSignedResponseAlg()); - assertEquals(request.getUserInfoEncryptedResponseAlg().toString(), rp.getUserInfoEncryptedResponseAlg()); - assertEquals(request.getUserInfoEncryptedResponseEnc().toString(), rp.getUserInfoEncryptedResponseEnc()); - assertEquals(request.getRequestObjectSigningAlg().toString(), rp.getRequestObjectSigningAlg()); - assertEquals(request.getRequestObjectEncryptionAlg().toString(), rp.getRequestObjectEncryptionAlg()); - assertEquals(request.getRequestObjectEncryptionEnc().toString(), rp.getRequestObjectEncryptionEnc()); - assertEquals(request.getDefaultMaxAge(), rp.getDefaultMaxAge()); - assertEquals(request.getInitiateLoginUri(), rp.getInitiateLoginUri()); - assertEquals(Jackson2.createRpMapper().readTree(Jackson2.serializeWithoutNulls(request.getAuthorizedOrigins())), - Jackson2.createRpMapper().readTree(Jackson2.serializeWithoutNulls(rp.getAuthorizedOrigins()))); - assertEquals(request.getAccessTokenLifetime(), rp.getAccessTokenLifetime()); - assertEquals(request.getSoftwareId(), rp.getSoftwareId()); - assertEquals(request.getSoftwareVersion(), rp.getSoftwareVersion()); - assertEquals(request.getSoftwareStatement(), rp.getSoftwareStatement()); - assertEquals(request.getJwksUri(), rp.getClientJwksUri()); - assertEquals(Jackson2.createRpMapper().readTree(Jackson2.serializeWithoutNulls(request.getClaimsRedirectUris())), - Jackson2.createRpMapper().readTree(Jackson2.serializeWithoutNulls(rp.getClaimsRedirectUri()))); - - //check fillRp - Rp newRp = new Rp(); - - RegisterRequestMapper.fillRp(newRp, request); - - assertEquals(newRp.getClientName(), rp.getClientName()); - assertEquals(newRp.getApplicationType(), rp.getApplicationType()); - assertEquals(newRp.getTokenEndpointAuthMethod(), rp.getTokenEndpointAuthMethod()); - assertEquals(Jackson2.createRpMapper().readTree(Jackson2.serializeWithoutNulls(newRp.getGrantType())), - Jackson2.createRpMapper().readTree(Jackson2.serializeWithoutNulls(rp.getGrantType()))); - assertEquals(newRp.getFrontChannelLogoutUri(), rp.getFrontChannelLogoutUri()); - assertEquals(newRp.getTokenEndpointAuthMethod().toString(), rp.getTokenEndpointAuthMethod()); - assertEquals(Jackson2.createRpMapper().readTree(Jackson2.serializeWithoutNulls(newRp.getRequestUris())), - Jackson2.createRpMapper().readTree(Jackson2.serializeWithoutNulls(rp.getRequestUris()))); - assertEquals(newRp.getSectorIdentifierUri(), rp.getSectorIdentifierUri()); - assertEquals(Jackson2.createRpMapper().readTree(Jackson2.serializeWithoutNulls(newRp.getRedirectUris())), - Jackson2.createRpMapper().readTree(Jackson2.serializeWithoutNulls(rp.getRedirectUris()))); - assertEquals(newRp.getAccessTokenAsJwt(), rp.getAccessTokenAsJwt()); - assertEquals(newRp.getAccessTokenSigningAlg(), rp.getAccessTokenSigningAlg()); - assertEquals(newRp.getRptAsJwt(), rp.getRptAsJwt()); - assertEquals(Jackson2.createRpMapper().readTree(Jackson2.serializeWithoutNulls(newRp.getResponseTypes())), - Jackson2.createRpMapper().readTree(Jackson2.serializeWithoutNulls(rp.getResponseTypes()))); - assertEquals(Jackson2.createRpMapper().readTree(Jackson2.serializeWithoutNulls(newRp.getAcrValues())), - Jackson2.createRpMapper().readTree(Jackson2.serializeWithoutNulls(rp.getAcrValues()))); - assertEquals(Jackson2.createRpMapper().readTree(Jackson2.serializeWithoutNulls(newRp.getContacts())), - Jackson2.createRpMapper().readTree(Jackson2.serializeWithoutNulls(rp.getContacts()))); - assertEquals(Jackson2.createRpMapper().readTree(Jackson2.serializeWithoutNulls(newRp.getPostLogoutRedirectUris())), - Jackson2.createRpMapper().readTree(Jackson2.serializeWithoutNulls(rp.getPostLogoutRedirectUris()))); - assertEquals(Jackson2.createRpMapper().readTree(Jackson2.serializeWithoutNulls(newRp.getScope())), - Jackson2.createRpMapper().readTree(Jackson2.serializeWithoutNulls(rp.getScope()))); - assertEquals(newRp.getLogoUri(), rp.getLogoUri()); - assertEquals(newRp.getClientUri(), rp.getClientUri()); - assertEquals(newRp.getPolicyUri(), rp.getPolicyUri()); - assertEquals(newRp.getFrontChannelLogoutSessionRequired(), rp.getFrontChannelLogoutSessionRequired()); - assertEquals(newRp.getTosUri(), rp.getTosUri()); - assertEquals(newRp.getJwks(), rp.getJwks()); - assertEquals(newRp.getIdTokenBindingCnf(), rp.getIdTokenBindingCnf()); - assertEquals(newRp.getTlsClientAuthSubjectDn(), rp.getTlsClientAuthSubjectDn()); - assertEquals(newRp.getSubjectType(), rp.getSubjectType()); - assertEquals(newRp.getRunIntrospectionScriptBeforeAccessTokenAsJwtCreationAndIncludeClaims(), rp.getRunIntrospectionScriptBeforeAccessTokenAsJwtCreationAndIncludeClaims()); - assertEquals(newRp.getIdTokenSignedResponseAlg(), rp.getIdTokenSignedResponseAlg()); - assertEquals(newRp.getIdTokenEncryptedResponseAlg(), rp.getIdTokenEncryptedResponseAlg()); - assertEquals(newRp.getIdTokenEncryptedResponseEnc(), rp.getIdTokenEncryptedResponseEnc()); - assertEquals(newRp.getUserInfoSignedResponseAlg(), rp.getUserInfoSignedResponseAlg()); - assertEquals(newRp.getUserInfoEncryptedResponseAlg(), rp.getUserInfoEncryptedResponseAlg()); - assertEquals(newRp.getUserInfoEncryptedResponseEnc(), rp.getUserInfoEncryptedResponseEnc()); - assertEquals(newRp.getRequestObjectSigningAlg(), rp.getRequestObjectSigningAlg()); - assertEquals(newRp.getRequestObjectEncryptionAlg(), rp.getRequestObjectEncryptionAlg()); - assertEquals(newRp.getRequestObjectEncryptionEnc(), rp.getRequestObjectEncryptionEnc()); - assertEquals(newRp.getDefaultMaxAge(), rp.getDefaultMaxAge()); - assertEquals(newRp.getInitiateLoginUri(), rp.getInitiateLoginUri()); - assertEquals(Jackson2.createRpMapper().readTree(Jackson2.serializeWithoutNulls(newRp.getAuthorizedOrigins())), - Jackson2.createRpMapper().readTree(Jackson2.serializeWithoutNulls(rp.getAuthorizedOrigins()))); - assertEquals(newRp.getAccessTokenLifetime(), rp.getAccessTokenLifetime()); - assertEquals(newRp.getSoftwareId(), rp.getSoftwareId()); - assertEquals(newRp.getSoftwareVersion(), rp.getSoftwareVersion()); - assertEquals(newRp.getSoftwareStatement(), rp.getSoftwareStatement()); - assertEquals(newRp.getClientJwksUri(), rp.getClientJwksUri()); - assertEquals(Jackson2.createRpMapper().readTree(Jackson2.serializeWithoutNulls(newRp.getClaimsRedirectUri())), - Jackson2.createRpMapper().readTree(Jackson2.serializeWithoutNulls(rp.getClaimsRedirectUri()))); - - } - - public Rp createRp() { - Rp rp = new Rp(); - - rp.setClientName("clientName"); - rp.setApplicationType("web"); - rp.setTokenEndpointAuthSigningAlg("HS256"); - rp.setGrantType(Lists.newArrayList( - GrantType.AUTHORIZATION_CODE.getValue(), - GrantType.OXAUTH_UMA_TICKET.getValue(), - GrantType.CLIENT_CREDENTIALS.getValue())); - rp.setFrontChannelLogoutUri("https://client.example.org/logout"); - rp.setTokenEndpointAuthMethod("client_secret_basic"); - rp.setRequestUris(Lists.newArrayList("https://client.example.org/requestUri")); - rp.setSectorIdentifierUri("https://client.example.org/identifierUri"); - rp.setRedirectUris(Lists.newArrayList("https://client.example.org/redirectUri")); - rp.setRedirectUri("https://client.example.org/redirectUri"); - rp.setAccessTokenAsJwt(true); - rp.setAccessTokenSigningAlg("HS256"); - rp.setRptAsJwt(true); - rp.setResponseTypes(Lists.newArrayList("code")); - rp.setAcrValues(Lists.newArrayList("basic")); - rp.setContacts(Lists.newArrayList("contact")); - rp.setPostLogoutRedirectUris(Lists.newArrayList("https://client.example.org/postLogoutUri")); - rp.setScope(Lists.newArrayList("openid")); - rp.setLogoUri("https://client.example.org/logoutUri"); - rp.setClientUri("https://client.example.org/clientUri"); - rp.setPolicyUri("https://client.example.org/policyUri"); - rp.setFrontChannelLogoutSessionRequired(true); - rp.setTosUri("https://client.example.org/tosUri"); - rp.setJwks("{\"key1\": \"value1\", \"key2\": \"value2\"}"); - rp.setIdTokenBindingCnf("4NRB1-0XZABZI9E6-5SM3R"); - rp.setTlsClientAuthSubjectDn("www.test.com"); - rp.setSubjectType("pairwise"); - rp.setRunIntrospectionScriptBeforeAccessTokenAsJwtCreationAndIncludeClaims(true); - rp.setIdTokenSignedResponseAlg("HS256"); - rp.setIdTokenEncryptedResponseAlg("RSA1_5"); - rp.setIdTokenEncryptedResponseEnc(BlockEncryptionAlgorithm.A128CBC_PLUS_HS256.toString()); - rp.setUserInfoSignedResponseAlg("HS256"); - rp.setUserInfoEncryptedResponseAlg("RSA1_5"); - rp.setUserInfoEncryptedResponseEnc(BlockEncryptionAlgorithm.A128CBC_PLUS_HS256.toString()); - rp.setRequestObjectSigningAlg("HS256"); - rp.setRequestObjectEncryptionAlg("RSA1_5"); - rp.setRequestObjectEncryptionEnc(BlockEncryptionAlgorithm.A128CBC_PLUS_HS256.toString()); - rp.setDefaultMaxAge(1000); - rp.setRequireAuthTime(true); - rp.setInitiateLoginUri("https://client.example.org/identifierUri"); - rp.setAuthorizedOrigins(Lists.newArrayList("https://client.example.org/requestUri")); - rp.setAccessTokenLifetime(1000); - rp.setSoftwareId("4NRB1-0XZABZI9E6-5SM3R"); - rp.setSoftwareVersion("2.0"); - rp.setSoftwareStatement("software name"); - rp.setClientJwksUri("https://client.example.org/jwksUri"); - rp.setClaimsRedirectUri(Lists.newArrayList("https://client.example.org/requestUri")); - - return rp; - } -} diff --git a/jans-client-api/server/src/test/java/io/jans/ca/server/tests/RegisterSiteTest.java b/jans-client-api/server/src/test/java/io/jans/ca/server/tests/RegisterSiteTest.java deleted file mode 100644 index 0749827fc7e..00000000000 --- a/jans-client-api/server/src/test/java/io/jans/ca/server/tests/RegisterSiteTest.java +++ /dev/null @@ -1,314 +0,0 @@ -package io.jans.ca.server.tests; - -import com.google.common.base.Strings; -import com.google.common.collect.Lists; -import io.jans.as.model.common.GrantType; -import io.jans.ca.client.ClientInterface; -import io.jans.ca.common.params.RegisterSiteParams; -import io.jans.ca.common.params.UpdateSiteParams; -import io.jans.ca.common.response.RegisterSiteResponse; -import io.jans.ca.common.response.UpdateSiteResponse; -import io.jans.ca.server.TestUtils; -import io.jans.ca.server.Tester; -import io.jans.ca.server.arquillian.BaseTest; -import org.jboss.arquillian.test.api.ArquillianResource; -import org.testng.annotations.Parameters; -import org.testng.annotations.Test; - -import java.net.URI; -import java.util.*; - -import static org.testng.AssertJUnit.assertNotNull; -import static org.testng.AssertJUnit.assertTrue; - -/** - * @author Yuriy Zabrovarnyy - * @version 0.9, 05/10/2015 - */ - -public class RegisterSiteTest extends BaseTest { - - private static RegisterSiteResponse site = null; - @ArquillianResource - private URI url; - - @Parameters({"host", "opHost", "redirectUrls", "logoutUrl", "postLogoutRedirectUrls"}) - @Test - public void register(String host, String opHost, String redirectUrls, String logoutUrl, String postLogoutRedirectUrls) { - showTitle("register site"); - RegisterSiteResponse resp = registerSite(getClientInterface(url), opHost, redirectUrls, postLogoutRedirectUrls, logoutUrl, false); - assertNotNull(resp); - - TestUtils.notEmpty(resp.getRpId()); - site = resp; - } - - @Parameters({"host", "opConfigurationEndpoint", "redirectUrls", "logoutUrl", "postLogoutRedirectUrls"}) - @Test - public void register_withOpConfigurationEndpoint(String host, String opConfigurationEndpoint, String redirectUrls, String logoutUrl, String postLogoutRedirectUrls) { - - // more specific site registration - final RegisterSiteParams params = new RegisterSiteParams(); - params.setOpConfigurationEndpoint(opConfigurationEndpoint); - params.setPostLogoutRedirectUris(Lists.newArrayList(postLogoutRedirectUrls.split(" "))); - params.setClientFrontchannelLogoutUri(logoutUrl); - params.setRedirectUris(Lists.newArrayList(redirectUrls.split(" "))); - params.setAcrValues(new ArrayList()); - params.setGrantTypes(Lists.newArrayList( - GrantType.AUTHORIZATION_CODE.getValue(), - GrantType.OXAUTH_UMA_TICKET.getValue(), - GrantType.CLIENT_CREDENTIALS.getValue())); - params.setScope(Lists.newArrayList("openid", "uma_protection", "profile")); - params.setResponseTypes(Lists.newArrayList("code", "id_token", "token")); - - params.setClientName("rp-client-extension-up" + System.currentTimeMillis()); - params.setClientTokenEndpointAuthMethod("client_secret_basic"); - params.setClientTokenEndpointAuthSigningAlg("HS256"); - params.setClaimsRedirectUri(Lists.newArrayList("https://client.example.org")); - - params.setAccessTokenSigningAlg("HS256"); - params.setRptAsJwt(true); - params.setAccessTokenAsJwt(true); - params.setFrontChannelLogoutSessionRequired(true); - params.setRunIntrospectionScriptBeforeAccessTokenAsJwtCreationAndIncludeClaims(true); - params.setRequireAuthTime(true); - - params.setLogoUri("https://client.example.org/authorization/page3"); - params.setClientUri("https://client.example.org/authorization/page3"); - params.setPolicyUri("https://client.example.org/authorization/page3"); - - params.setTosUri("https://client.example.org/authorization/page3"); - params.setJwks("{\"key1\": \"value1\", \"key2\": \"value2\"}"); - params.setIdTokenBindingCnf("4NRB1-0XZABZI9E6-5SM3R"); - params.setTlsClientAuthSubjectDn("www.test-updated.com"); - params.setSubjectType("pairwise"); - - params.setIdTokenSignedResponseAlg("HS256"); - params.setIdTokenEncryptedResponseAlg("RSA1_5"); - params.setIdTokenEncryptedResponseEnc("A128CBC+HS256"); - params.setUserInfoSignedResponseAlg("HS256"); - params.setUserInfoEncryptedResponseAlg("RSA1_5"); - params.setUserInfoEncryptedResponseEnc("A128CBC+HS256"); - params.setRequestObjectSigningAlg("HS256"); - params.setRequestObjectEncryptionAlg("RSA1_5"); - params.setRequestObjectEncryptionEnc("A128CBC+HS256"); - params.setDefaultMaxAge(100000000); - - params.setInitiateLoginUri("https://client.example.org/authorization/page2"); - params.setAuthorizedOrigins(Lists.newArrayList("beem://www.test.com", "fb://app.local.url")); - params.setAccessTokenLifetime(100000000); - params.setSoftwareId("4NRB1-0XZABZI9E6-5SM3R"); - params.setSoftwareVersion("2.0"); - - Map customAttributes = new HashMap<>(); - customAttributes.put("k1", "v1"); - customAttributes.put("k2", "v2"); - params.setCustomAttributes(customAttributes); - - RegisterSiteResponse resp = getClientInterface(url).registerSite(params); - assertNotNull(resp); - assertNotNull(resp.getRpId()); - } - - @Parameters({"host"}) - @Test(dependsOnMethods = {"register"}) - public void update(String host) { - TestUtils.notEmpty(site.getRpId()); - - Calendar calendar = Calendar.getInstance(); - calendar.add(Calendar.DAY_OF_YEAR, 1); - - // more specific site registration - final UpdateSiteParams params = new UpdateSiteParams(); - params.setRpId(site.getRpId()); - params.setScope(Lists.newArrayList("profile")); - - params.setClientName("rp-client-updated-test"); - params.setClientTokenEndpointAuthMethod("client_secret_basic"); - params.setClientTokenEndpointAuthSigningAlg("HS256"); - params.setClaimsRedirectUri(Lists.newArrayList("https://client.example.org/update")); - - params.setAccessTokenSigningAlg("RS256"); - params.setAccessTokenAsJwt(false); - params.setRptAsJwt(true); - params.setFrontChannelLogoutSessionRequired(false); - params.setRequireAuthTime(false); - params.setRunIntrospectionScriptBeforeAccessTokenAsJwtCreationAndIncludeClaims(true); - - params.setLogoUri("https://client.example.org/authorization//update1"); - params.setClientUri("https://client.example.org/authorization/update2"); - params.setPolicyUri("https://client.example.org/authorization/update3"); - - params.setTosUri("https://client.example.org/authorization/update4"); - params.setJwks("{\"key1\": \"value1\", \"key2\": \"value2\"}"); - params.setIdTokenBindingCnf("4NRB1-0XZABZI9E6-5SM3R"); - params.setTlsClientAuthSubjectDn("www.test.com"); - params.setSubjectType("pairwise"); - - params.setIdTokenSignedResponseAlg("PS256"); - params.setIdTokenEncryptedResponseAlg("A128KW"); - params.setIdTokenEncryptedResponseEnc("A128CBC+HS256"); - params.setUserInfoSignedResponseAlg("HS256"); - params.setUserInfoEncryptedResponseAlg("RSA1_5"); - params.setUserInfoEncryptedResponseEnc("A128CBC+HS256"); - params.setRequestObjectSigningAlg("HS256"); - params.setRequestObjectEncryptionAlg("RSA1_5"); - params.setRequestObjectEncryptionEnc("A128CBC+HS256"); - params.setDefaultMaxAge(200000000); - - params.setInitiateLoginUri("https://client.example.org/authorization/page2"); - params.setAuthorizedOrigins(Lists.newArrayList("beem://www.test-updated.com", "fb://updated.local.url")); - params.setAccessTokenLifetime(200000000); - params.setSoftwareId("4NRB1-0XZABZI9E6-5SM3R"); - params.setSoftwareVersion("3.0"); - - Map customAttributes = new HashMap<>(); - customAttributes.put("key1", "v1"); - customAttributes.put("key2", "v2"); - params.setCustomAttributes(customAttributes); - - UpdateSiteResponse resp = getClientInterface(url).updateSite(Tester.getAuthorization(getApiTagetURL(url), site), null, params); - assertNotNull(resp); - } - - public static RegisterSiteResponse registerSite(ClientInterface client, String opHost, String redirectUrls) { - return registerSite(client, opHost, redirectUrls, redirectUrls, "", false); - } - - public static RegisterSiteResponse registerSite(ClientInterface client, String opHost, String redirectUrls, String postLogoutRedirectUrls, String logoutUri, boolean syncClientFromOp) { - - final RegisterSiteParams params = new RegisterSiteParams(); - params.setOpHost(opHost); -// params.setOpConfigurationEndpoint(); - params.setPostLogoutRedirectUris(Lists.newArrayList(postLogoutRedirectUrls.split(" "))); - params.setClientFrontchannelLogoutUri(logoutUri); - params.setRedirectUris(Lists.newArrayList(redirectUrls.split(" "))); - params.setScope(Lists.newArrayList("openid", "uma_protection", "profile", "jans_client_api")); - params.setResponseTypes(Lists.newArrayList("code", "id_token", "token")); - params.setGrantTypes(Lists.newArrayList( - GrantType.AUTHORIZATION_CODE.getValue(), - GrantType.OXAUTH_UMA_TICKET.getValue(), - GrantType.CLIENT_CREDENTIALS.getValue())); - params.setSyncClientFromOp(syncClientFromOp); - params.setSyncClientPeriodInSeconds(0); - - final RegisterSiteResponse resp = client.registerSite(params); - assertNotNull(resp); - assertTrue(!Strings.isNullOrEmpty(resp.getRpId())); - return resp; - } - - public static RegisterSiteResponse registerSite(ClientInterface client, String opHost, String redirectUrls, String postLogoutRedirectUrls, String logoutUri, String opConfigurationEndPoint) { - - final RegisterSiteParams params = new RegisterSiteParams(); - params.setOpHost(opHost); - params.setOpConfigurationEndpoint(opConfigurationEndPoint); - params.setPostLogoutRedirectUris(Lists.newArrayList(postLogoutRedirectUrls.split(" "))); - params.setClientFrontchannelLogoutUri(logoutUri); - params.setRedirectUris(Lists.newArrayList(redirectUrls.split(" "))); - params.setScope(Lists.newArrayList("openid", "uma_protection", "profile", "jans_client_api")); - params.setResponseTypes(Lists.newArrayList("code", "id_token", "token")); - params.setGrantTypes(Lists.newArrayList( - GrantType.AUTHORIZATION_CODE.getValue(), - GrantType.OXAUTH_UMA_TICKET.getValue(), - GrantType.CLIENT_CREDENTIALS.getValue())); - params.setSyncClientFromOp(false); - params.setSyncClientPeriodInSeconds(0); - - final RegisterSiteResponse resp = client.registerSite(params); - assertNotNull(resp); - assertTrue(!Strings.isNullOrEmpty(resp.getRpId())); - return resp; - } - - public static RegisterSiteResponse registerSite(ClientInterface client, String opHost, String redirectUrls, String idTokenSignedResponseAlg) { - - final RegisterSiteParams params = new RegisterSiteParams(); - params.setOpHost(opHost); - params.setRedirectUris(Lists.newArrayList(redirectUrls.split(" "))); - params.setScope(Lists.newArrayList("openid", "uma_protection", "profile", "jans_client_api")); - params.setResponseTypes(Lists.newArrayList("code", "id_token", "token")); - params.setIdTokenSignedResponseAlg(idTokenSignedResponseAlg); - params.setGrantTypes(Lists.newArrayList( - GrantType.AUTHORIZATION_CODE.getValue(), - GrantType.OXAUTH_UMA_TICKET.getValue(), - GrantType.CLIENT_CREDENTIALS.getValue())); - - final RegisterSiteResponse resp = client.registerSite(params); - assertNotNull(resp); - assertTrue(!Strings.isNullOrEmpty(resp.getRpId())); - return resp; - } - - public static RegisterSiteResponse registerSite(ClientInterface client, String opHost, String redirectUrls, String idTokenSignedResponseAlg, String opConfigurationEndpoint) { - - final RegisterSiteParams params = new RegisterSiteParams(); - params.setOpHost(opHost); - params.setOpConfigurationEndpoint(opConfigurationEndpoint); - params.setRedirectUris(Lists.newArrayList(redirectUrls.split(" "))); - params.setScope(Lists.newArrayList("openid", "uma_protection", "profile", "jans_client_api")); - params.setResponseTypes(Lists.newArrayList("code", "id_token", "token")); - params.setIdTokenSignedResponseAlg(idTokenSignedResponseAlg); - params.setGrantTypes(Lists.newArrayList( - GrantType.AUTHORIZATION_CODE.getValue(), - GrantType.OXAUTH_UMA_TICKET.getValue(), - GrantType.CLIENT_CREDENTIALS.getValue())); - - final RegisterSiteResponse resp = client.registerSite(params); - assertNotNull(resp); - assertTrue(!Strings.isNullOrEmpty(resp.getRpId())); - return resp; - } - - public static RegisterSiteResponse registerSite( - ClientInterface client, String opHost, String redirectUrls, List scopes, List responseTypes, - boolean allowSpontaneousScopes, List spontaneousScopes) { - - final RegisterSiteParams params = new RegisterSiteParams(); - params.setOpHost(opHost); - params.setRedirectUris(Lists.newArrayList(redirectUrls.split(" "))); - params.setScope(scopes); - params.setResponseTypes(responseTypes); - params.setAllowSpontaneousScopes(true); - params.setSpontaneousScopes(spontaneousScopes); - params.setGrantTypes(Lists.newArrayList( - GrantType.AUTHORIZATION_CODE.getValue(), - GrantType.OXAUTH_UMA_TICKET.getValue(), - GrantType.CLIENT_CREDENTIALS.getValue())); - - final RegisterSiteResponse resp = client.registerSite(params); - assertNotNull(resp); - assertTrue(!Strings.isNullOrEmpty(resp.getRpId())); - return resp; - } - - public static RegisterSiteResponse registerSite_withAuthenticationMethod(ClientInterface client, String opHost, String redirectUrls, String algorithm, String authenticationMethod) { - - final RegisterSiteParams params = new RegisterSiteParams(); - params.setOpHost(opHost); - params.setRedirectUris(Lists.newArrayList(redirectUrls.split(" "))); - params.setScope(Lists.newArrayList("openid", "uma_protection", "profile", "jans_client_api")); - params.setResponseTypes(Lists.newArrayList("code", "id_token", "token")); - params.setIdTokenSignedResponseAlg(algorithm); - params.setGrantTypes(Lists.newArrayList( - GrantType.AUTHORIZATION_CODE.getValue(), - GrantType.OXAUTH_UMA_TICKET.getValue(), - GrantType.CLIENT_CREDENTIALS.getValue())); - params.setClientTokenEndpointAuthSigningAlg(algorithm); - params.setClientTokenEndpointAuthMethod(authenticationMethod); - params.setJwks(client.getRpJwks().toString()); - - final RegisterSiteResponse resp = client.registerSite(params); - assertNotNull(resp); - assertTrue(!Strings.isNullOrEmpty(resp.getRpId())); - return resp; - } - - - public static RegisterSiteResponse registerSite(ClientInterface client, RegisterSiteParams params) { - final RegisterSiteResponse resp = client.registerSite(params); - assertNotNull(resp); - assertTrue(!Strings.isNullOrEmpty(resp.getRpId())); - return resp; - } -} diff --git a/jans-client-api/server/src/test/java/io/jans/ca/server/tests/RemoveSiteTest.java b/jans-client-api/server/src/test/java/io/jans/ca/server/tests/RemoveSiteTest.java deleted file mode 100644 index c2a8ac4a3ba..00000000000 --- a/jans-client-api/server/src/test/java/io/jans/ca/server/tests/RemoveSiteTest.java +++ /dev/null @@ -1,40 +0,0 @@ -package io.jans.ca.server.tests; - -import io.jans.ca.client.ClientInterface; -import io.jans.ca.common.params.RemoveSiteParams; -import io.jans.ca.common.response.RegisterSiteResponse; -import io.jans.ca.common.response.RemoveSiteResponse; -import io.jans.ca.server.Tester; -import io.jans.ca.server.arquillian.BaseTest; -import org.jboss.arquillian.test.api.ArquillianResource; -import org.testng.annotations.Parameters; -import org.testng.annotations.Test; - -import java.net.URI; - -import static io.jans.ca.server.TestUtils.notEmpty; -import static org.testng.AssertJUnit.assertNotNull; - -/** - * @author yuriyz - */ -public class RemoveSiteTest extends BaseTest { - - @ArquillianResource - private URI url; - - @Parameters({"host", "opHost", "redirectUrls"}) - @Test - public void removeSiteTest(String host, String opHost, String redirectUrls) { - ClientInterface client = getClientInterface(url); - - RegisterSiteResponse resp = RegisterSiteTest.registerSite(client, opHost, redirectUrls); - assertNotNull(resp); - - notEmpty(resp.getRpId()); - - RemoveSiteResponse removeResponse = client.removeSite(Tester.getAuthorization(getApiTagetURL(url), resp), null, new RemoveSiteParams(resp.getRpId())); - assertNotNull(removeResponse); - assertNotNull(removeResponse.getRpId()); - } -} diff --git a/jans-client-api/server/src/test/java/io/jans/ca/server/tests/RpGetRptTest.java b/jans-client-api/server/src/test/java/io/jans/ca/server/tests/RpGetRptTest.java deleted file mode 100644 index d3b97e95072..00000000000 --- a/jans-client-api/server/src/test/java/io/jans/ca/server/tests/RpGetRptTest.java +++ /dev/null @@ -1,94 +0,0 @@ -package io.jans.ca.server.tests; - -import com.google.common.base.Strings; -import com.google.common.collect.Lists; -import io.jans.as.model.common.GrantType; -import io.jans.as.model.exception.InvalidJwtException; -import io.jans.as.model.jwt.Jwt; -import io.jans.ca.client.ClientInterface; -import io.jans.ca.common.params.RegisterSiteParams; -import io.jans.ca.common.params.RpGetRptParams; -import io.jans.ca.common.response.RegisterSiteResponse; -import io.jans.ca.common.response.RpGetRptResponse; -import io.jans.ca.common.response.RsCheckAccessResponse; -import io.jans.ca.server.Tester; -import io.jans.ca.server.arquillian.BaseTest; -import org.apache.commons.lang.StringUtils; -import org.jboss.arquillian.test.api.ArquillianResource; -import org.testng.annotations.Parameters; -import org.testng.annotations.Test; - -import java.io.IOException; -import java.net.URI; - -import static org.testng.AssertJUnit.*; - -/** - * @author Yuriy Zabrovarnyy - */ - -public class RpGetRptTest extends BaseTest { - - @ArquillianResource - private URI url; - - @Parameters({"host", "opHost", "redirectUrls", "rsProtect"}) - @Test - public void simple(String host, String opHost, String redirectUrls, String rsProtect) throws IOException { - - ClientInterface client = getClientInterface(url); - - RegisterSiteResponse site = RegisterSiteTest.registerSite(client, opHost, redirectUrls); - final RpGetRptResponse response = requestRpt(client, site, rsProtect); - - assertNotNull(response); - } - - @Parameters({"host", "opHost", "redirectUrls", "rsProtect"}) - @Test - public void rptAsJwt(String host, String opHost, String redirectUrls, String rsProtect) throws IOException, InvalidJwtException { - - ClientInterface client = getClientInterface(url); - - final RegisterSiteParams params = new RegisterSiteParams(); - params.setOpHost(opHost); - params.setRedirectUris(Lists.newArrayList(redirectUrls.split(" "))); - params.setPostLogoutRedirectUris(Lists.newArrayList(redirectUrls.split(" "))); - params.setClientFrontchannelLogoutUri(redirectUrls.split(" ")[0]); - params.setScope(Lists.newArrayList("openid", "uma_protection", "profile", "jans_client_api")); - params.setRptAsJwt(true); - params.setGrantTypes(Lists.newArrayList( - GrantType.AUTHORIZATION_CODE.getValue(), - GrantType.OXAUTH_UMA_TICKET.getValue(), - GrantType.CLIENT_CREDENTIALS.getValue())); - - final RegisterSiteResponse site = client.registerSite(params); - assertNotNull(site); - assertTrue(!Strings.isNullOrEmpty(site.getRpId())); - - final RpGetRptResponse response = requestRpt(client, site, rsProtect); - assertNotNull(response); - - Jwt jwt = Jwt.parse(response.getRpt()); - assertNotNull(jwt); - assertEquals(site.getClientId(), jwt.getClaims().getClaimAsString("client_id")); - assertTrue(jwt.getClaims().getClaimAsString("permissions").contains("resource_id")); - } - - public static RpGetRptResponse requestRpt(ClientInterface client, RegisterSiteResponse site, String rsProtect) throws IOException { - RsProtectTest.protectResources(client, site, UmaFullTest.resourceList(rsProtect).getResources()); - - final RsCheckAccessResponse checkAccess = RsCheckAccessTest.checkAccess(client, site, null); - - final RpGetRptParams params = new RpGetRptParams(); - params.setRpId(site.getRpId()); - params.setTicket(checkAccess.getTicket()); - - final RpGetRptResponse response = client.umaRpGetRpt(Tester.getAuthorization(client.getApitargetURL(), site), params.getRpId(), params); - - assertNotNull(response); - assertTrue(StringUtils.isNotBlank(response.getRpt())); - assertTrue(StringUtils.isNotBlank(response.getPct())); - return response; - } -} diff --git a/jans-client-api/server/src/test/java/io/jans/ca/server/tests/RsCheckAccessTest.java b/jans-client-api/server/src/test/java/io/jans/ca/server/tests/RsCheckAccessTest.java deleted file mode 100644 index 649d28a5476..00000000000 --- a/jans-client-api/server/src/test/java/io/jans/ca/server/tests/RsCheckAccessTest.java +++ /dev/null @@ -1,98 +0,0 @@ -package io.jans.ca.server.tests; - -import io.jans.ca.client.ClientInterface; -import io.jans.ca.common.params.RsCheckAccessParams; -import io.jans.ca.common.response.RegisterSiteResponse; -import io.jans.ca.common.response.RsCheckAccessResponse; -import io.jans.ca.server.Tester; -import io.jans.ca.server.arquillian.BaseTest; -import org.apache.commons.lang.StringUtils; -import org.jboss.arquillian.test.api.ArquillianResource; -import org.testng.annotations.Parameters; -import org.testng.annotations.Test; - -import java.io.IOException; -import java.net.URI; -import java.util.List; - -import static org.testng.AssertJUnit.assertNotNull; -import static org.testng.AssertJUnit.assertTrue; - -/** - * @author Yuriy Zabrovarnyy - * @version 0.9, 03/07/2017 - */ - -public class RsCheckAccessTest extends BaseTest { - - @ArquillianResource - private URI url; - - @Parameters({"host", "opHost", "redirectUrls", "rsProtect"}) - @Test - public void withoutScopes_shouldPass(String host, String opHost, String redirectUrls, String rsProtect) throws IOException { - ClientInterface client = getClientInterface(url); - - RegisterSiteResponse site = RegisterSiteTest.registerSite(client, opHost, redirectUrls); - - RsProtectTest.protectResources(client, site, UmaFullTest.resourceList(rsProtect).getResources()); - - checkAccess(client, site, null); - } - - @Parameters({"host", "opHost", "redirectUrls", "rsProtect"}) - @Test - public void withCorrectScopes_shouldPass(String host, String opHost, String redirectUrls, String rsProtect) throws IOException { - ClientInterface client = getClientInterface(url); - - RegisterSiteResponse site = RegisterSiteTest.registerSite(client, opHost, redirectUrls); - - RsProtectTest.protectResources(client, site, UmaFullTest.resourceList(rsProtect).getResources()); - - checkAccess(client, site, org.testng.collections.Lists.newArrayList("http://photoz.example.com/dev/actions/all", "http://photoz.example.com/dev/actions/view")); - } - - @Parameters({"host", "opHost", "redirectUrls", "rsProtect"}) - @Test - public void withIncorrectScopes_shouldThrowException(String host, String opHost, String redirectUrls, String rsProtect) throws IOException { - ClientInterface client = getClientInterface(url); - - RegisterSiteResponse site = RegisterSiteTest.registerSite(client, opHost, redirectUrls); - - RsProtectTest.protectResources(client, site, UmaFullTest.resourceList(rsProtect).getResources()); - - checkAccessWithIncorrectScopes(client, site, org.testng.collections.Lists.newArrayList("/dev/actions/all", "/dev/actions/view")); - } - - public static RsCheckAccessResponse checkAccess(ClientInterface client, RegisterSiteResponse site, List scopeList) { - final RsCheckAccessParams params = new RsCheckAccessParams(); - params.setRpId(site.getRpId()); - params.setHttpMethod("GET"); - params.setPath("/ws/phone"); - params.setRpt("dummy"); - params.setScopes(scopeList); - - final RsCheckAccessResponse response = client.umaRsCheckAccess(Tester.getAuthorization(client.getApitargetURL(), site), params.getRpId(), params); - - assertNotNull(response); - assertTrue(StringUtils.isNotBlank(response.getAccess())); - return response; - } - - public static void checkAccessWithIncorrectScopes(ClientInterface client, RegisterSiteResponse site, List scopeList) { - final RsCheckAccessParams params = new RsCheckAccessParams(); - params.setRpId(site.getRpId()); - params.setHttpMethod("GET"); - params.setPath("/ws/phone"); - params.setRpt("dummy"); - params.setScopes(scopeList); - try { - RsCheckAccessResponse r = client.umaRsCheckAccess(Tester.getAuthorization(client.getApitargetURL(), site), params.getRpId(), params); - assertNotNull(r); - assertNotNull(r.getError()); - - } catch (Exception e) { - //test-case passed - } - } -} diff --git a/jans-client-api/server/src/test/java/io/jans/ca/server/tests/RsModifyTest.java b/jans-client-api/server/src/test/java/io/jans/ca/server/tests/RsModifyTest.java deleted file mode 100644 index a071594ed73..00000000000 --- a/jans-client-api/server/src/test/java/io/jans/ca/server/tests/RsModifyTest.java +++ /dev/null @@ -1,79 +0,0 @@ -package io.jans.ca.server.tests; - -import com.fasterxml.jackson.core.JsonProcessingException; -import io.jans.ca.client.ClientInterface; -import io.jans.ca.common.params.RsModifyParams; -import io.jans.ca.common.response.RegisterSiteResponse; -import io.jans.ca.common.response.RsModifyResponse; -import io.jans.ca.rs.protect.RsResource; -import io.jans.ca.server.Tester; -import io.jans.ca.server.arquillian.BaseTest; -import org.jboss.arquillian.test.api.ArquillianResource; -import org.testng.annotations.Parameters; -import org.testng.annotations.Test; -import org.testng.collections.Lists; - -import java.io.IOException; -import java.net.URI; -import java.util.List; - -import static org.testng.AssertJUnit.assertNotNull; - -public class RsModifyTest extends BaseTest { - - @ArquillianResource - URI url; - - @Parameters({"host", "redirectUrls", "opHost", "rsProtect"}) - @Test - public void protect(String host, String redirectUrls, String opHost, String rsProtect) throws IOException { - String hostTargetURL = getApiTagetURL(url); - ClientInterface client = Tester.newClient(hostTargetURL); - - final RegisterSiteResponse site = RegisterSiteTest.registerSite(client, opHost, redirectUrls); - - RsProtectTest.protectResources(client, site, UmaFullTest.resourceList(rsProtect).getResources()); - RsCheckAccessTest.checkAccess(client, site, null); - modifyResourcesWithScopes(client, site, UmaFullTest.resourceList(rsProtect).getResources()); - } - - @Parameters({"host", "redirectUrls", "opHost", "rsProtectScopeExpression", "correctScopeExpression"}) - @Test - public void protectWithScopeExpression(String host, String redirectUrls, String opHost, String rsProtectScopeExpression, String correctScopeExpression) throws IOException { - String hostTargetURL = getApiTagetURL(url); - ClientInterface client = Tester.newClient(hostTargetURL); - - final RegisterSiteResponse site = RegisterSiteTest.registerSite(client, opHost, redirectUrls); - RsProtectTest.protectResources(client, site, UmaFullTest.resourceList(rsProtectScopeExpression).getResources()); - RsCheckAccessTest.checkAccess(client, site, null); - modifyResourcesWithScopeExpression(client, site, UmaFullTest.resourceList(rsProtectScopeExpression).getResources(), correctScopeExpression); - } - - public static RsModifyResponse modifyResourcesWithScopes(ClientInterface client, RegisterSiteResponse site, List resources) { - - final RsModifyParams params2 = new RsModifyParams(); - params2.setRpId(site.getRpId()); - params2.setHttpMethod(resources.get(0).getConditions().get(0).getHttpMethods().get(0)); - params2.setPath(resources.get(0).getPath()); - params2.setScopes(Lists.newArrayList("http://photoz.example.com/dev/actions/see")); - - String strAuthorization = Tester.getAuthorization(client.getApitargetURL(), site); - RsModifyResponse response = client.umaRsModify(strAuthorization, params2.getRpId(), params2); - assertNotNull(response.getRpId()); - return response; - } - - public static RsModifyResponse modifyResourcesWithScopeExpression(ClientInterface client, RegisterSiteResponse site, List resources, String correctScopeExpression) throws JsonProcessingException { - - final RsModifyParams params2 = new RsModifyParams(); - params2.setRpId(site.getRpId()); - params2.setHttpMethod(resources.get(0).getConditions().get(0).getHttpMethods().get(0)); - params2.setPath(resources.get(0).getPath()); - params2.setScopeExpression(correctScopeExpression.replaceAll("'", "\"")); - - String strAuthorization = Tester.getAuthorization(client.getApitargetURL(), site); - RsModifyResponse response = client.umaRsModify(strAuthorization, params2.getRpId(), params2); - assertNotNull(response.getRpId()); - return response; - } -} diff --git a/jans-client-api/server/src/test/java/io/jans/ca/server/tests/RsProtectTest.java b/jans-client-api/server/src/test/java/io/jans/ca/server/tests/RsProtectTest.java deleted file mode 100644 index 23c0b79e7ed..00000000000 --- a/jans-client-api/server/src/test/java/io/jans/ca/server/tests/RsProtectTest.java +++ /dev/null @@ -1,158 +0,0 @@ -package io.jans.ca.server.tests; - -import io.jans.ca.client.ClientInterface; -import io.jans.ca.client.RsProtectParams2; -import io.jans.ca.common.Jackson2; -import io.jans.ca.common.params.RsCheckAccessParams; -import io.jans.ca.common.response.RegisterSiteResponse; -import io.jans.ca.common.response.RsCheckAccessResponse; -import io.jans.ca.common.response.RsProtectResponse; -import io.jans.ca.rs.protect.RsResource; -import io.jans.ca.server.HttpException; -import io.jans.ca.server.TestUtils; -import io.jans.ca.server.Tester; -import io.jans.ca.server.arquillian.BaseTest; -import io.jans.ca.server.configuration.model.Rp; -import io.jans.ca.server.op.RsProtectOperation; -import jakarta.ws.rs.BadRequestException; -import org.apache.commons.lang.StringUtils; -import org.jboss.arquillian.test.api.ArquillianResource; -import org.testng.annotations.Parameters; -import org.testng.annotations.Test; - -import java.io.IOException; -import java.net.URI; -import java.util.List; - -import static org.testng.AssertJUnit.*; - -public class RsProtectTest extends BaseTest { - - @ArquillianResource - private URI url; - - @Parameters({"host", "redirectUrls", "opHost", "rsProtect"}) - @Test - public void protect(String host, String redirectUrls, String opHost, String rsProtect) throws IOException { - - ClientInterface client = getClientInterface(url); - - final RegisterSiteResponse site = RegisterSiteTest.registerSite(client, opHost, redirectUrls); - - protectResources(client, site, UmaFullTest.resourceList(rsProtect).getResources()); - RsCheckAccessTest.checkAccess(client, site, null); - } - - @Parameters({"host", "redirectUrls", "opHost", "rsProtectWithCreationExpiration"}) - @Test - public void protect_withResourceCreationExpiration(String host, String redirectUrls, String opHost, String rsProtectWithCreationExpiration) throws IOException { - - ClientInterface client = getClientInterface(url); - - final RegisterSiteResponse site = RegisterSiteTest.registerSite(client, opHost, redirectUrls); - - protectResources(client, site, UmaFullTest.resourceList(rsProtectWithCreationExpiration).getResources()); - - Rp rp = UpdateSiteTest.fetchRp(client.getApitargetURL(), site); - rp.getUmaProtectedResources().forEach(ele -> { - assertEquals(1582890956L, ele.getIat().longValue()); - assertEquals(2079299799L, ele.getExp().longValue()); - }); - } - - @Parameters({"host", "redirectUrls", "opHost", "rsProtect"}) - @Test - public void overwriteFalse(String host, String redirectUrls, String opHost, String rsProtect) throws IOException { - ClientInterface client = getClientInterface(url); - - final RegisterSiteResponse site = RegisterSiteTest.registerSite(client, opHost, redirectUrls); - - List resources = UmaFullTest.resourceList(rsProtect).getResources(); - protectResources(client, site, resources); - - final RsProtectParams2 params = new RsProtectParams2(); - params.setRpId(site.getRpId()); - params.setResources(Jackson2.createJsonMapper().readTree(Jackson2.asJsonSilently(resources))); - RsProtectResponse r = client.umaRsProtect(Tester.getAuthorization(getApiTagetURL(url), site), params.getRpId(), params); - assertNotNull(r); - assertEquals(r.getError(), "uma_protection_exists"); - } - - @Parameters({"host", "redirectUrls", "opHost", "rsProtect"}) - @Test - public void overwriteTrue(String host, String redirectUrls, String opHost, String rsProtect) throws IOException { - ClientInterface client = getClientInterface(url); - - final RegisterSiteResponse site = RegisterSiteTest.registerSite(client, opHost, redirectUrls); - - List resources = UmaFullTest.resourceList(rsProtect).getResources(); - protectResources(client, site, resources); - - final RsProtectParams2 params = new RsProtectParams2(); - params.setRpId(site.getRpId()); - params.setResources(Jackson2.createJsonMapper().readTree(Jackson2.asJsonSilently(resources))); - params.setOverwrite(true); // force overwrite - - RsProtectResponse response = client.umaRsProtect(Tester.getAuthorization(getApiTagetURL(url), site), params.getRpId(), params); - assertNotNull(response); - } - - @Parameters({"host", "redirectUrls", "opHost", "rsProtectScopeExpression"}) - @Test - public void protectWithScopeExpression(String host, String redirectUrls, String opHost, String rsProtectScopeExpression) throws IOException { - ClientInterface client = getClientInterface(url); - - final RegisterSiteResponse site = RegisterSiteTest.registerSite(client, opHost, redirectUrls); - - protectResources(client, site, UmaFullTest.resourceList(rsProtectScopeExpression).getResources()); - RsCheckAccessTest.checkAccess(client, site, null); - } - - @Parameters({"host", "redirectUrls", "opHost", "rsProtectScopeExpressionSecond"}) - @Test - public void protectWithScopeExpressionSeconds(String host, String redirectUrls, String opHost, String rsProtectScopeExpressionSecond) throws IOException { - ClientInterface client = getClientInterface(url); - - final RegisterSiteResponse site = RegisterSiteTest.registerSite(client, opHost, redirectUrls); - - protectResources(client, site, UmaFullTest.resourceList(rsProtectScopeExpressionSecond).getResources()); - - final RsCheckAccessParams params = new RsCheckAccessParams(); - params.setRpId(site.getRpId()); - params.setHttpMethod("GET"); - params.setPath("/GetAll"); - params.setRpt(""); - - final RsCheckAccessResponse response = client.umaRsCheckAccess(Tester.getAuthorization(getApiTagetURL(url), site), params.getRpId(), params); - - assertNotNull(response); - assertTrue(StringUtils.isNotBlank(response.getAccess())); - } - - public static RsProtectResponse protectResources(ClientInterface client, RegisterSiteResponse site, List resources) { - final RsProtectParams2 params = new RsProtectParams2(); - params.setRpId(site.getRpId()); - try { - params.setResources(Jackson2.createJsonMapper().readTree(Jackson2.asJsonSilently(resources))); - } catch (IOException e) { - e.printStackTrace(); - } - - final RsProtectResponse resp = client.umaRsProtect(Tester.getAuthorization(client.getApitargetURL(), site), params.getRpId(), params); - assertNotNull(resp); - return resp; - } - - @Parameters({"correctScopeExpression"}) - @Test - public void testCorrectScopeExpression(String correctScopeExpression) { - RsProtectOperation.validateScopeExpression(correctScopeExpression.replaceAll("'", "\"")); - } - - @Parameters({"incorrectScopeExpression"}) - @Test(expectedExceptions = HttpException.class, enabled = false) - public void testIncorrectScopeExpression(String incorrectScopeExpression) { - RsProtectOperation.validateScopeExpression(incorrectScopeExpression.replaceAll("'", "\"")); - } - -} diff --git a/jans-client-api/server/src/test/java/io/jans/ca/server/tests/SetupClientTest.java b/jans-client-api/server/src/test/java/io/jans/ca/server/tests/SetupClientTest.java deleted file mode 100644 index c392375d36e..00000000000 --- a/jans-client-api/server/src/test/java/io/jans/ca/server/tests/SetupClientTest.java +++ /dev/null @@ -1,80 +0,0 @@ -package io.jans.ca.server.tests; - -import com.google.common.collect.Lists; -import io.jans.as.model.common.GrantType; -import io.jans.ca.client.ClientInterface; -import io.jans.ca.common.params.RegisterSiteParams; -import io.jans.ca.common.response.RegisterSiteResponse; -import io.jans.ca.server.Tester; -import io.jans.ca.server.arquillian.BaseTest; -import org.jboss.arquillian.test.api.ArquillianResource; -import org.testng.annotations.Parameters; -import org.testng.annotations.Test; - -import java.net.URI; -import java.util.ArrayList; - -import static io.jans.ca.server.TestUtils.notEmpty; -import static org.testng.AssertJUnit.assertNotNull; - -/** - * @author Yuriy Zabrovarnyy - * @version 0.9, 30/03/2017 - */ - -public class SetupClientTest extends BaseTest { - - @ArquillianResource - private static URI url; - - @Parameters({"host", "opHost", "redirectUrls", "logoutUrl", "postLogoutRedirectUrls"}) - @Test - public void setupClient(String host, String opHost, String redirectUrls, String logoutUrl, String postLogoutRedirectUrls) { - String hostTargetUrl = getApiTagetURL(url); - RegisterSiteResponse resp = setupClient(Tester.newClient(hostTargetUrl), opHost, redirectUrls, postLogoutRedirectUrls, logoutUrl); - assertResponse(resp); - - // more specific client setup - final RegisterSiteParams params = new RegisterSiteParams(); - params.setOpHost(opHost); - params.setRedirectUris(Lists.newArrayList(redirectUrls.split(" "))); - params.setPostLogoutRedirectUris(Lists.newArrayList(postLogoutRedirectUrls.split(" "))); - params.setClientFrontchannelLogoutUri(logoutUrl); - params.setAcrValues(new ArrayList()); - params.setScope(Lists.newArrayList("openid", "profile")); - params.setGrantTypes(Lists.newArrayList("authorization_code")); - params.setResponseTypes(Lists.newArrayList("code")); - - resp = Tester.newClient(hostTargetUrl).registerSite(params); - assertResponse(resp); - } - - public static void assertResponse(RegisterSiteResponse resp) { - assertNotNull(resp); - - notEmpty(resp.getClientId()); - notEmpty(resp.getClientSecret()); - notEmpty(resp.getRpId()); - } - - public static RegisterSiteResponse setupClient(ClientInterface client, String opHost, String redirectUrls) { - return setupClient(client, opHost, redirectUrls, redirectUrls, ""); - } - - public static RegisterSiteResponse setupClient(ClientInterface client, String opHost, String redirectUrls, String postLogoutRedirectUrls, String logoutUri) { - - final RegisterSiteParams params = new RegisterSiteParams(); - params.setOpHost(opHost); - params.setRedirectUris(Lists.newArrayList(redirectUrls.split(" "))); - params.setPostLogoutRedirectUris(Lists.newArrayList(postLogoutRedirectUrls.split(" "))); - params.setClientFrontchannelLogoutUri(logoutUri); - params.setScope(Lists.newArrayList("openid", "uma_protection", "profile", "jans_client_api")); - params.setGrantTypes(Lists.newArrayList( - GrantType.AUTHORIZATION_CODE.getValue(), - GrantType.CLIENT_CREDENTIALS.getValue())); - - final RegisterSiteResponse resp = client.registerSite(params); - assertResponse(resp); - return resp; - } -} diff --git a/jans-client-api/server/src/test/java/io/jans/ca/server/tests/SpontaneousScopeAuthTest.java b/jans-client-api/server/src/test/java/io/jans/ca/server/tests/SpontaneousScopeAuthTest.java deleted file mode 100644 index 95c036195cc..00000000000 --- a/jans-client-api/server/src/test/java/io/jans/ca/server/tests/SpontaneousScopeAuthTest.java +++ /dev/null @@ -1,76 +0,0 @@ -package io.jans.ca.server.tests; - -import com.google.common.collect.Lists; -import io.jans.as.client.AuthorizationResponse; -import io.jans.ca.client.ClientInterface; -import io.jans.ca.common.SeleniumTestUtils; -import io.jans.ca.common.response.RegisterSiteResponse; -import io.jans.ca.server.Tester; -import io.jans.ca.server.arquillian.BaseTest; -import org.jboss.arquillian.test.api.ArquillianResource; -import org.testng.annotations.Parameters; -import org.testng.annotations.Test; - -import java.net.URI; -import java.util.Arrays; -import java.util.List; -import java.util.UUID; - -import static org.testng.AssertJUnit.*; - -public class SpontaneousScopeAuthTest extends BaseTest { - - @ArquillianResource - URI url; - - @Parameters({"host", "opHost", "paramRedirectUrl", "userId", "userSecret"}) - @Test - public void spontaneousScope(String host, String opHost, String paramRedirectUrl, String userId, String userSecret) throws Exception { - String hostTargetURL = getApiTagetURL(url); - List spontaneousScopes = Lists.newArrayList("^transaction:.+$"); - List responseTypes = Lists.newArrayList("code", "id_token", "token"); - List scopes = Lists.newArrayList("openid", "profile", "address", "email", "phone", "user_name"); - - RegisterSiteResponse registerResponse = registerClient(hostTargetURL, opHost, paramRedirectUrl, scopes, responseTypes, spontaneousScopes); - - // Request authorization and receive the authorization code. - List scopesWithSpontanious = Lists.newArrayList("openid", "profile", "address", "email", "phone", "user_name", - "transaction:245", "transaction:8645"); - - AuthorizationResponse authorizationResponse = requestAuthorization(opHost, userId, userSecret, paramRedirectUrl, responseTypes, scopesWithSpontanious, registerResponse.getClientId()); - - final String[] responseScopes = authorizationResponse.getScope().split(" "); - - // Validate spontaneous scopes are present - assertTrue(Arrays.asList(responseScopes).contains("transaction:245")); - assertTrue(Arrays.asList(responseScopes).contains("transaction:8645")); - assertFalse(Arrays.asList(responseScopes).contains("transaction:not_requested")); - } - - private RegisterSiteResponse registerClient(String hostTargetURL, String opHost, String redirectUrls, List scopes, List responseTypes, List spontaneousScopes) { - - ClientInterface client = Tester.newClient(hostTargetURL); - // 1. allow spontaneous scopes (off by default) - // 2. set spontaneous scope regular expression. In this example `transaction:345236456` - final RegisterSiteResponse registerResponse = RegisterSiteTest.registerSite(client, opHost, redirectUrls, scopes, responseTypes, true, spontaneousScopes); - - assertNotNull(registerResponse.getClientId()); - assertNotNull(registerResponse.getClientSecret()); - assertNotNull(registerResponse.getClientIdIssuedAt()); - assertNotNull(registerResponse.getClientSecretExpiresAt()); - return registerResponse; - } - - private AuthorizationResponse requestAuthorization(final String opHost, final String userId, final String userSecret, final String redirectUri, - List responseTypes, List scopesWithSpontanious, String clientId) { - String state = UUID.randomUUID().toString(); - String nonce = UUID.randomUUID().toString(); - AuthorizationResponse authorizationResponse = SeleniumTestUtils.authorizeClient(opHost, userId, userSecret, clientId, redirectUri, state, nonce, responseTypes, scopesWithSpontanious); - - assertNotNull(authorizationResponse.getLocation(), "The location is null"); - assertNotNull(authorizationResponse.getCode(), "The authorization code is null"); - assertNotNull(authorizationResponse.getState(), "The state is null"); - assertNotNull(authorizationResponse.getScope(), "The scope is null"); - return authorizationResponse; - } -} diff --git a/jans-client-api/server/src/test/java/io/jans/ca/server/tests/UmaFullTest.java b/jans-client-api/server/src/test/java/io/jans/ca/server/tests/UmaFullTest.java deleted file mode 100644 index 536b9d03fdb..00000000000 --- a/jans-client-api/server/src/test/java/io/jans/ca/server/tests/UmaFullTest.java +++ /dev/null @@ -1,79 +0,0 @@ -package io.jans.ca.server.tests; - -import io.jans.ca.client.ClientInterface; -import io.jans.ca.common.Jackson2; -import io.jans.ca.common.params.RpGetRptParams; -import io.jans.ca.common.response.RegisterSiteResponse; -import io.jans.ca.common.response.RpGetRptResponse; -import io.jans.ca.common.response.RsCheckAccessResponse; -import io.jans.ca.rs.protect.RsResourceList; -import io.jans.ca.server.Tester; -import io.jans.ca.server.arquillian.BaseTest; -import jakarta.ws.rs.BadRequestException; -import org.apache.commons.lang.StringUtils; -import org.jboss.arquillian.test.api.ArquillianResource; -import org.testng.annotations.Parameters; -import org.testng.annotations.Test; - -import java.io.IOException; -import java.net.URI; -import java.util.UUID; - -import static org.testng.Assert.*; - -/** - * @author Yuriy Zabrovarnyy - * @version 0.9, 14/06/2016 - */ - -public class UmaFullTest extends BaseTest { - @ArquillianResource - private URI url; - - @Parameters({"host", "redirectUrls", "opHost", "rsProtect"}) - @Test - public void test(String host, String redirectUrls, String opHost, String rsProtect) throws Exception { - - ClientInterface client = getClientInterface(url); - - RegisterSiteResponse site = RegisterSiteTest.registerSite(client, opHost, redirectUrls); - - RsProtectTest.protectResources(client, site, UmaFullTest.resourceList(rsProtect).getResources()); - - final RsCheckAccessResponse checkAccess = RsCheckAccessTest.checkAccess(client, site, null); - - final RpGetRptParams params = new RpGetRptParams(); - params.setRpId(site.getRpId()); - params.setTicket(checkAccess.getTicket()); - - final RpGetRptResponse response = client.umaRpGetRpt(Tester.getAuthorization(client.getApitargetURL(), site), params.getRpId(), params); - - assertNotNull(response); - assertTrue(StringUtils.isNotBlank(response.getRpt())); - assertTrue(StringUtils.isNotBlank(response.getPct())); - } - - public static RsResourceList resourceList(String rsProtect) throws IOException { - rsProtect = StringUtils.replace(rsProtect, "'", "\""); - return Jackson2.createJsonMapper().readValue(rsProtect, RsResourceList.class); - } - - @Parameters({"host", "redirectUrls", "opHost", "rsProtect"}) - @Test - public void testWithInvalidTicket(String host, String redirectUrls, String opHost, String rsProtect) throws Exception { - - ClientInterface client = getClientInterface(url); - - RegisterSiteResponse site = RegisterSiteTest.registerSite(client, opHost, redirectUrls); - - RsProtectTest.protectResources(client, site, UmaFullTest.resourceList(rsProtect).getResources()); - - final RpGetRptParams params = new RpGetRptParams(); - params.setRpId(site.getRpId()); - params.setTicket(UUID.randomUUID().toString()); - - RpGetRptResponse r = client.umaRpGetRpt(Tester.getAuthorization(client.getApitargetURL(), site), params.getRpId(), params); - assertNotNull(r); - assertEquals(r.getError(), "invalid_ticket"); - } -} diff --git a/jans-client-api/server/src/test/java/io/jans/ca/server/tests/UmaGetClaimsGatheringUrlTest.java b/jans-client-api/server/src/test/java/io/jans/ca/server/tests/UmaGetClaimsGatheringUrlTest.java deleted file mode 100644 index 665cc71a462..00000000000 --- a/jans-client-api/server/src/test/java/io/jans/ca/server/tests/UmaGetClaimsGatheringUrlTest.java +++ /dev/null @@ -1,118 +0,0 @@ -package io.jans.ca.server.tests; - -import io.jans.ca.client.ClientInterface; -import io.jans.ca.common.CoreUtils; -import io.jans.ca.common.params.RpGetClaimsGatheringUrlParams; -import io.jans.ca.common.response.RegisterSiteResponse; -import io.jans.ca.common.response.RpGetClaimsGatheringUrlResponse; -import io.jans.ca.common.response.RsCheckAccessResponse; -import io.jans.ca.server.Tester; -import io.jans.ca.server.arquillian.BaseTest; -import org.apache.commons.lang.StringUtils; -import org.jboss.arquillian.test.api.ArquillianResource; -import org.testng.annotations.Parameters; -import org.testng.annotations.Test; -import org.testng.collections.Maps; - -import java.io.IOException; -import java.net.URI; -import java.util.Map; - -import static org.testng.Assert.assertEquals; -import static org.testng.Assert.assertTrue; - -public class UmaGetClaimsGatheringUrlTest extends BaseTest { - - @ArquillianResource - private URI url; - - @Parameters({"host", "opHost", "paramRedirectUrl", "rsProtect"}) - @Test - public void test(String host, String opHost, String paramRedirectUrl, String rsProtect) throws IOException { - - ClientInterface client = getClientInterface(url); - RegisterSiteResponse site = RegisterSiteTest.registerSite(client, opHost, paramRedirectUrl); - - RsProtectTest.protectResources(client, site, UmaFullTest.resourceList(rsProtect).getResources()); - - final RsCheckAccessResponse checkAccess = RsCheckAccessTest.checkAccess(client, site, null); - - final RpGetClaimsGatheringUrlParams params = new RpGetClaimsGatheringUrlParams(); - params.setRpId(site.getRpId()); - params.setTicket(checkAccess.getTicket()); - params.setClaimsRedirectUri(paramRedirectUrl); - - final RpGetClaimsGatheringUrlResponse response = client.umaRpGetClaimsGatheringUrl(Tester.getAuthorization(client.getApitargetURL(), site), params.getRpId(), params); - - Map parameters = CoreUtils.splitQuery(response.getUrl()); - - assertTrue(StringUtils.isNotBlank(parameters.get("client_id"))); - assertTrue(StringUtils.isNotBlank(parameters.get("ticket"))); - assertTrue(StringUtils.isNotBlank(parameters.get("state"))); - assertTrue(StringUtils.isNotBlank(response.getState())); - assertEquals(paramRedirectUrl, parameters.get("claims_redirect_uri")); - } - - @Parameters({"host", "opHost", "paramRedirectUrl", "rsProtect"}) - @Test - public void test_withCustomParameter(String host, String opHost, String paramRedirectUrl, String rsProtect) throws IOException { - - ClientInterface client = getClientInterface(url); - RegisterSiteResponse site = RegisterSiteTest.registerSite(client, opHost, paramRedirectUrl); - - RsProtectTest.protectResources(client, site, UmaFullTest.resourceList(rsProtect).getResources()); - - final RsCheckAccessResponse checkAccess = RsCheckAccessTest.checkAccess(client, site, null); - - final RpGetClaimsGatheringUrlParams params = new RpGetClaimsGatheringUrlParams(); - params.setRpId(site.getRpId()); - params.setTicket(checkAccess.getTicket()); - params.setClaimsRedirectUri(paramRedirectUrl); - - Map customParameterMap = Maps.newHashMap(); - customParameterMap.put("param1", "value1"); - customParameterMap.put("param2", "value2"); - params.setCustomParameters(customParameterMap); - - final RpGetClaimsGatheringUrlResponse response = client.umaRpGetClaimsGatheringUrl(Tester.getAuthorization(client.getApitargetURL(), site), params.getRpId(), params); - - Map parameters = CoreUtils.splitQuery(response.getUrl()); - - assertTrue(StringUtils.isNotBlank(parameters.get("client_id"))); - assertTrue(StringUtils.isNotBlank(parameters.get("ticket"))); - assertTrue(StringUtils.isNotBlank(parameters.get("state"))); - assertTrue(StringUtils.isNotBlank(response.getState())); - assertTrue(StringUtils.isNotBlank(parameters.get("param1"))); - assertTrue(StringUtils.isNotBlank(parameters.get("param2"))); - assertEquals(paramRedirectUrl, parameters.get("claims_redirect_uri")); - } - - @Parameters({"host", "opHost", "paramRedirectUrl", "rsProtect", "state"}) - @Test - public void test_withState(String host, String opHost, String paramRedirectUrl, String rsProtect, String state) throws IOException { - - ClientInterface client = getClientInterface(url); - RegisterSiteResponse site = RegisterSiteTest.registerSite(client, opHost, paramRedirectUrl); - - RsProtectTest.protectResources(client, site, UmaFullTest.resourceList(rsProtect).getResources()); - - final RsCheckAccessResponse checkAccess = RsCheckAccessTest.checkAccess(client, site, null); - - final RpGetClaimsGatheringUrlParams params = new RpGetClaimsGatheringUrlParams(); - params.setRpId(site.getRpId()); - params.setTicket(checkAccess.getTicket()); - params.setClaimsRedirectUri(paramRedirectUrl); - params.setState(state); - - final RpGetClaimsGatheringUrlResponse response = client.umaRpGetClaimsGatheringUrl(Tester.getAuthorization(client.getApitargetURL(), site), params.getRpId(), params); - - Map parameters = CoreUtils.splitQuery(response.getUrl()); - - assertTrue(StringUtils.isNotBlank(parameters.get("client_id"))); - assertTrue(StringUtils.isNotBlank(parameters.get("ticket"))); - assertTrue(StringUtils.isNotBlank(parameters.get("state"))); - assertTrue(StringUtils.isNotBlank(response.getState())); - assertEquals(paramRedirectUrl, parameters.get("claims_redirect_uri")); - assertEquals(response.getState(), state); - } -} diff --git a/jans-client-api/server/src/test/java/io/jans/ca/server/tests/UmaSpontaneousScopeTest.java b/jans-client-api/server/src/test/java/io/jans/ca/server/tests/UmaSpontaneousScopeTest.java deleted file mode 100644 index 3d864228dd8..00000000000 --- a/jans-client-api/server/src/test/java/io/jans/ca/server/tests/UmaSpontaneousScopeTest.java +++ /dev/null @@ -1,51 +0,0 @@ -package io.jans.ca.server.tests; - -import com.google.common.collect.Lists; -import io.jans.ca.client.ClientInterface; -import io.jans.ca.common.introspection.CorrectRptIntrospectionResponse; -import io.jans.ca.common.params.IntrospectRptParams; -import io.jans.ca.common.response.RegisterSiteResponse; -import io.jans.ca.common.response.RpGetRptResponse; -import io.jans.ca.server.Tester; -import io.jans.ca.server.arquillian.BaseTest; -import org.jboss.arquillian.test.api.ArquillianResource; -import org.testng.annotations.Parameters; -import org.testng.annotations.Test; - -import java.net.URI; -import java.util.List; - -import static org.testng.AssertJUnit.assertTrue; - -public class UmaSpontaneousScopeTest extends BaseTest { - - @ArquillianResource - private URI url; - - public static final String USER_2_SCOPE = "/user/2"; - - @Parameters({"host", "opHost", "paramRedirectUrl", "userId", "userSecret", "rsProtectWithSpontaneousScope"}) - @Test - public void init(String host, String opHost, String paramRedirectUrl, String userId, String userSecret, String rsProtectWithSpontaneousScope) throws Exception { - List scopes = Lists.newArrayList("openid", "uma_protection", "profile", "address", "email", "phone", "user_name", "jans_client_api"); - List responseTypes = Lists.newArrayList("code", "id_token", "token"); - //register client - ClientInterface client = getClientInterface(url); - final RegisterSiteResponse registerResponse = RegisterSiteTest.registerSite(client, opHost, paramRedirectUrl, scopes, responseTypes, true, null); - - //UMA RP - Get RPT - //Spontaneous Scope Regress: ^/user/.+$ - RpGetRptResponse response = RpGetRptTest.requestRpt(client, registerResponse, rsProtectWithSpontaneousScope); - //UMA Introspect RPT - IntrospectRptParams params = new IntrospectRptParams(); - params.setRpId(registerResponse.getRpId()); - params.setRpt(response.getRpt()); - - final CorrectRptIntrospectionResponse rptIntrospectionResponse = client.introspectRpt(Tester.getAuthorization(client.getApitargetURL(), registerResponse), params.getRpId(), params); - - rptIntrospectionResponse.getPermissions().forEach( permission -> { - assertTrue(permission.getScopes().contains(USER_2_SCOPE)); - }); - } - -} diff --git a/jans-client-api/server/src/test/java/io/jans/ca/server/tests/UpdateSiteTest.java b/jans-client-api/server/src/test/java/io/jans/ca/server/tests/UpdateSiteTest.java deleted file mode 100644 index bb7395926fd..00000000000 --- a/jans-client-api/server/src/test/java/io/jans/ca/server/tests/UpdateSiteTest.java +++ /dev/null @@ -1,94 +0,0 @@ -package io.jans.ca.server.tests; - -import com.google.common.collect.Lists; -import io.jans.as.model.common.GrantType; -import io.jans.ca.common.Jackson2; -import io.jans.ca.common.params.GetRpParams; -import io.jans.ca.common.params.RegisterSiteParams; -import io.jans.ca.common.params.UpdateSiteParams; -import io.jans.ca.common.response.GetRpResponse; -import io.jans.ca.common.response.RegisterSiteResponse; -import io.jans.ca.common.response.UpdateSiteResponse; -import io.jans.ca.server.SetUpTest; -import io.jans.ca.server.Tester; -import io.jans.ca.server.arquillian.BaseTest; -import io.jans.ca.server.configuration.model.Rp; -import org.jboss.arquillian.test.api.ArquillianResource; -import org.testng.annotations.AfterClass; -import org.testng.annotations.BeforeClass; -import org.testng.annotations.Parameters; -import org.testng.annotations.Test; - -import java.io.IOException; -import java.net.URI; - -import static org.testng.Assert.assertEquals; -import static org.testng.AssertJUnit.assertNotNull; - -/** - * @author Yuriy Zabrovarnyy - */ -public class UpdateSiteTest extends BaseTest { - - @ArquillianResource - private static URI url; - - @Parameters({"host", "opHost", "redirectUrls"}) - @Test - public void update(String host, String opHost, String redirectUrls) throws IOException { - String authorizationRedirectUri = "https://client.example.com/cb"; - String anotherRedirectUri = "https://client.example.com/another"; - String logoutUri = "https://client.example.com/logout"; - - final RegisterSiteParams registerParams = new RegisterSiteParams(); - registerParams.setOpHost(opHost); - registerParams.setClientFrontchannelLogoutUri(logoutUri); - registerParams.setRedirectUris(Lists.newArrayList(authorizationRedirectUri, anotherRedirectUri, logoutUri)); - registerParams.setAcrValues(Lists.newArrayList("basic")); - registerParams.setScope(Lists.newArrayList("openid", "profile")); - registerParams.setGrantTypes(Lists.newArrayList( - GrantType.AUTHORIZATION_CODE.getValue(), - GrantType.CLIENT_CREDENTIALS.getValue())); - registerParams.setResponseTypes(Lists.newArrayList("code", "id_token", "token")); - registerParams.setAcrValues(Lists.newArrayList("acrBefore")); - - RegisterSiteResponse registerResponse = getClientInterface(url).registerSite(registerParams); - assertNotNull(registerResponse); - assertNotNull(registerResponse.getRpId()); - String rpId = registerResponse.getRpId(); - - String strAuthorization1 = Tester.getAuthorization(getApiTagetURL(url), registerResponse, registerParams.getScope()); - Rp fetchedRp = fetchRp(getApiTagetURL(url), strAuthorization1, registerResponse.getRpId()); - - assertEquals(authorizationRedirectUri, fetchedRp.getRedirectUri()); - assertEquals(Lists.newArrayList("acrBefore"), fetchedRp.getAcrValues()); - - final UpdateSiteParams updateParams = new UpdateSiteParams(); - updateParams.setRpId(rpId); - updateParams.setRedirectUris(Lists.newArrayList(anotherRedirectUri)); - updateParams.setScope(Lists.newArrayList("profile")); - updateParams.setAcrValues(Lists.newArrayList("acrAfter")); - - UpdateSiteResponse updateResponse = getClientInterface(url).updateSite(Tester.getAuthorization(getApiTagetURL(url), registerResponse), updateParams.getRpId(), updateParams); - assertNotNull(updateResponse); - - String strAuthorization2 = Tester.getAuthorization(getApiTagetURL(url), registerResponse, updateParams.getScope()); - fetchedRp = fetchRp(getApiTagetURL(url), strAuthorization2, registerResponse.getRpId()); - - assertEquals(anotherRedirectUri, fetchedRp.getRedirectUri()); - assertEquals(Lists.newArrayList("acrAfter"), fetchedRp.getAcrValues()); - } - - public static Rp fetchRp(String apiTargetUrl, RegisterSiteResponse site) throws IOException { - String strAuthorization = Tester.getAuthorization(apiTargetUrl, site); - final String rpAsJson = Tester.newClient(apiTargetUrl).getRp(strAuthorization, site.getRpId(), new GetRpParams(site.getRpId())); - GetRpResponse resp = Jackson2.createJsonMapper().readValue(rpAsJson, GetRpResponse.class); - return Jackson2.createJsonMapper().readValue(resp.getNode().toString(), Rp.class); - } - - public static Rp fetchRp(String apiTargetUrl, String strAuthorization, String rpId) throws IOException { - final String rpAsJson = Tester.newClient(apiTargetUrl).getRp(strAuthorization, rpId, new GetRpParams(rpId)); - GetRpResponse resp = Jackson2.createJsonMapper().readValue(rpAsJson, GetRpResponse.class); - return Jackson2.createJsonMapper().readValue(resp.getNode().toString(), Rp.class); - } -} diff --git a/jans-client-api/server/src/test/java/io/jans/ca/server/tests/UtilsTest.java b/jans-client-api/server/src/test/java/io/jans/ca/server/tests/UtilsTest.java deleted file mode 100644 index e432a64cf10..00000000000 --- a/jans-client-api/server/src/test/java/io/jans/ca/server/tests/UtilsTest.java +++ /dev/null @@ -1,49 +0,0 @@ -package io.jans.ca.server.tests; - -import com.google.common.collect.Lists; -import io.jans.ca.server.Utils; -import io.jans.util.security.StringEncrypter; -import org.testng.AssertJUnit; -import org.testng.annotations.Test; - -import java.io.UnsupportedEncodingException; -import java.util.ArrayList; -import java.util.Calendar; -import java.util.Date; - -import static org.testng.AssertJUnit.assertEquals; - -/** - * @author Yuriy Zabrovarnyy - * @version 0.9, 01/10/2015 - */ - -public class UtilsTest { - - @Test - public void joinAndEncode() throws UnsupportedEncodingException { - final ArrayList list = Lists.newArrayList("id_token", "token"); - AssertJUnit.assertEquals("id_token%20token", Utils.joinAndUrlEncode(list)); - } - - @Test(enabled = false) - public void decrypt() throws StringEncrypter.EncryptionException { - StringEncrypter stringEncrypter = StringEncrypter.instance("123456789012345678901234"); - System.out.println(stringEncrypter.decrypt("")); - } - - @Test - public void hoursDiff() { - Calendar calendar = Calendar.getInstance(); - Date today = new Date(); - - calendar.add(Calendar.HOUR, 13); - - assertEquals(Utils.hoursDiff(today, calendar.getTime()), 13); - } - - public static void main(String[] args) { - String s = "{\"command\":\"register_site\",\"params\" : {\"authorization_redirect_uri\" : \"https://opencart.gl/index.php?route=module/socl_login&logout_from_gluu=aruesa\",\"post_logout_redirect_uri\" : \"https://opencart.gl/index.php?route=module/socl_login&logout_from_gluu=exist\",\"application_type\" : \"web\",\"redirect_uris\" :[\"https://opencart.gl/index.php?route=module/socl_login\"],\"acr_values\" : [],\"scope\" : [\"openid\",\"profile\",\"email\",\"address\",\"clientinfo\",\"mobile_phone\",\"phone\"],\"client_jwks_uri\" : null,\"client_token_endpoint_auth_method\" : null,\"client_request_uris\" : null,\"contacts\" : [\"vlad.karapetyan.1988@mail.ru\"],\"grant_types\" : [\"authorization_code\"],\"response_types\" : [\"code\"],\"client_logout_uris\" : [\"https://opencart.gl/index.php?route=module/socl_login&logout_from_gluu=exist\"]}}"; - System.out.println(s.length()); - } -} diff --git a/jans-client-api/server/src/test/resources/arquillian.xml b/jans-client-api/server/src/test/resources/arquillian.xml deleted file mode 100644 index c85d20b8914..00000000000 --- a/jans-client-api/server/src/test/resources/arquillian.xml +++ /dev/null @@ -1,20 +0,0 @@ - - - - - target/deployments - - - - - 0 - - - - - - - - - diff --git a/jans-client-api/server/src/test/resources/client-api-conf-test-h2.json b/jans-client-api/server/src/test/resources/client-api-conf-test-h2.json deleted file mode 100644 index 8e6f7ddb473..00000000000 --- a/jans-client-api/server/src/test/resources/client-api-conf-test-h2.json +++ /dev/null @@ -1,78 +0,0 @@ -{ - "loggingLevel":"INFO", - "loggingLayout":"text", - "externalLoggerConfiguration":"", - "disableJdkLogger":true, - "trustAllCerts": true, - "keyStorePath":"/opt/jans/jans-client-api/keys/client-api-server.keystore", - "keyStorePassword":"example", - "enableJwksGeneration": true, - "jwksExpirationInHours": 720, - "jwksRegenerationIntervalInHours": 720, - "cryptProviderKeyStorePath": "/opt/jans/jans-client-api/keys/client-api-jwks.keystore", - "cryptProviderKeyStorePassword": "example", - "cryptProviderDnName": "CN=jans-client CA Certificates", - "mtlsEnabled": false, - "mtlsClientKeyStorePath": "", - "mtlsClientKeyStorePassword": "", - "bindIpAddresses":["*"], - "storage":"h2", - "storageConfiguration":{ - "dbFileLocation":"/opt/jans/jans-client-api/data/rp_db" - }, - "addClientCredentialsGrantTypeAutomaticallyDuringClientRegistration":true, - "migrationSourceFolderPath":"", - "defaultSiteConfig":{ - "op_configuration_endpoint":"", - "response_types":["code"], - "grant_type":["authorization_code"], - "acr_values":[""], - "scope":["openid", "profile", "email"], - "ui_locales":["en"], - "claims_locales":["en"], - "contacts":[], - "redirect_uris":[], - "logout_redirect_uris":[], - "client_name":"", - "client_jwks_uri":"", - "token_endpoint_auth_method":"", - "token_endpoint_auth_signing_alg":"", - "request_uris":[], - "front_channel_logout_uri":"", - "sector_identifier_uri":"", - "claims_redirect_uri":[], - "client_id":"", - "client_secret":"", - "trusted_client":false, - "access_token_as_jwt":false, - "access_token_signing_alg":"", - "rpt_as_jwt":false, - "logo_uri":"", - "client_uri":"", - "policy_uri":"", - "front_channel_logout_session_required":false, - "tos_uri":"", - "jwks":"", - "id_token_binding_cnf":"", - "tls_client_auth_subject_dn":"", - "run_introspection_script_beforeaccess_token_as_jwt_creation_and_include_claims":false, - "id_token_signed_response_alg":"", - "id_token_encrypted_response_alg":"", - "id_token_encrypted_response_enc":"", - "user_info_signed_response_alg":"", - "user_info_encrypted_response_alg":"", - "user_info_encrypted_response_enc":"", - "request_object_signing_alg":"", - "request_object_encryption_alg":"", - "request_object_encryption_enc":"", - "default_max_age":null, - "require_auth_time":false, - "initiate_login_uri":"", - "authorized_origins":[], - "access_token_lifetime":null, - "software_id":"", - "software_version":"", - "software_statement":"", - "custom_attributes":{} - } -} \ No newline at end of file diff --git a/jans-client-api/server/src/test/resources/client-api-conf-test.json b/jans-client-api/server/src/test/resources/client-api-conf-test.json deleted file mode 100644 index ba887d20d0b..00000000000 --- a/jans-client-api/server/src/test/resources/client-api-conf-test.json +++ /dev/null @@ -1,81 +0,0 @@ -{ - "loggingLevel":"INFO", - "loggingLayout":"text", - "externalLoggerConfiguration":"", - "disableJdkLogger":true, - "trustAllCerts": true, - "keyStorePath":"/opt/jans/jans-client-api/keys/client-api-server.keystore", - "keyStorePassword":"example", - "enableJwksGeneration": true, - "jwksExpirationInHours": 720, - "jwksRegenerationIntervalInHours": 720, - "cryptProviderKeyStorePath": "/opt/jans/jans-client-api/keys/client-api-jwks.keystore", - "cryptProviderKeyStorePassword": "example", - "cryptProviderDnName": "CN=jans-client CA Certificates", - "mtlsEnabled": false, - "mtlsClientKeyStorePath": "", - "mtlsClientKeyStorePassword": "", - "bindIpAddresses":["*"], - "storage":"jans_server_configuration", - "storageConfiguration":{ - "baseDn":"ou=jans-client-api,ou=configuration,o=jans", - "type":"/etc/jans/conf/jans.properties", - "connection":"/etc/jans/conf/jans-sql.properties", - "salt":"/etc/jans/conf/salt" - }, - "addClientCredentialsGrantTypeAutomaticallyDuringClientRegistration":true, - "migrationSourceFolderPath":"", - "defaultSiteConfig":{ - "op_configuration_endpoint":"", - "response_types":["code"], - "grant_type":["authorization_code"], - "acr_values":[""], - "scope":["openid", "profile", "email"], - "ui_locales":["en"], - "claims_locales":["en"], - "contacts":[], - "redirect_uris":[], - "logout_redirect_uris":[], - "client_name":"", - "client_jwks_uri":"", - "token_endpoint_auth_method":"", - "token_endpoint_auth_signing_alg":"", - "request_uris":[], - "front_channel_logout_uri":"", - "sector_identifier_uri":"", - "claims_redirect_uri":[], - "client_id":"", - "client_secret":"", - "trusted_client":false, - "access_token_as_jwt":false, - "access_token_signing_alg":"", - "rpt_as_jwt":false, - "logo_uri":"", - "client_uri":"", - "policy_uri":"", - "front_channel_logout_session_required":false, - "tos_uri":"", - "jwks":"", - "id_token_binding_cnf":"", - "tls_client_auth_subject_dn":"", - "run_introspection_script_beforeaccess_token_as_jwt_creation_and_include_claims":false, - "id_token_signed_response_alg":"", - "id_token_encrypted_response_alg":"", - "id_token_encrypted_response_enc":"", - "user_info_signed_response_alg":"", - "user_info_encrypted_response_alg":"", - "user_info_encrypted_response_enc":"", - "request_object_signing_alg":"", - "request_object_encryption_alg":"", - "request_object_encryption_enc":"", - "default_max_age":null, - "require_auth_time":false, - "initiate_login_uri":"", - "authorized_origins":[], - "access_token_lifetime":null, - "software_id":"", - "software_version":"", - "software_statement":"", - "custom_attributes":{} - } -} \ No newline at end of file diff --git a/jans-client-api/server/src/test/resources/jetty-env.xml b/jans-client-api/server/src/test/resources/jetty-env.xml deleted file mode 100644 index 2c52782de47..00000000000 --- a/jans-client-api/server/src/test/resources/jetty-env.xml +++ /dev/null @@ -1,17 +0,0 @@ - - - - - - - - BeanManager - - - jakarta.enterprise.inject.spi.BeanManager - org.jboss.weld.resources.ManagerObjectFactory - - - - - diff --git a/jans-client-api/server/src/test/resources/test.properties b/jans-client-api/server/src/test/resources/test.properties deleted file mode 100644 index d9970bcd6db..00000000000 --- a/jans-client-api/server/src/test/resources/test.properties +++ /dev/null @@ -1,5 +0,0 @@ -test.jans.auth.server.name=${test.jans.auth.server.name} -test.auth.user.uid=${test.auth.user.uid} -test.auth.user.password=${test.auth.user.password} -test.auth.client.id=FF81-2D39 -test.auth.client.secret=FF81-2D39-jenkins-ldap \ No newline at end of file diff --git a/jans-client-api/server/src/test/resources/testng.properties b/jans-client-api/server/src/test/resources/testng.properties deleted file mode 100644 index 67ba24ce75e..00000000000 --- a/jans-client-api/server/src/test/resources/testng.properties +++ /dev/null @@ -1,28 +0,0 @@ -## Developer test ng properties (convenient way to run separate test without suite) ## -host=${test.jans.auth.server.name} -port=8081 -opHost=https://${test.jans.auth.server.name} -otherAuthServer=https://jenkins-build.jans.io -opDiscoveryPath=/ -opConfigurationEndpoint=https://${test.jans.auth.server.name}/.well-known/openid-configuration -redirectUrls=https://client.example.com/cb/home1 https://client.example.com/cb/home2 -postLogoutRedirectUrl=https://client.example.com/cb/logout -postLogoutRedirectUrls=https://client.example.com/cb/logout/page1 https://client.example.com/cb/logout/page2 -logoutUrl=https://client.example.com/logout -userId=${test.auth.user.uid} -userSecret=${test.auth.user.password} -clientId=${test.auth.client.id} -clientSecret=${test.auth.client.secret} -rsProtect={"resources":[{"path":"/ws/phone","conditions":[{"httpMethods":["GET"],"scopes":["http://photoz.example.com/dev/actions/all","http://photoz.example.com/dev/actions/view"],"ticketScopes":["http://photoz.example.com/dev/actions/view"]},{"httpMethods":["PUT", "POST"],"scopes":["http://photoz.example.com/dev/actions/all","http://photoz.example.com/dev/actions/add"],"ticketScopes":["http://photoz.example.com/dev/actions/add"]},{"httpMethods":["DELETE"],"scopes":["http://photoz.example.com/dev/actions/all","http://photoz.example.com/dev/actions/remove"],"ticketScopes":["http://photoz.example.com/dev/actions/remove"]}]}]} -rsProtectScopeExpression={'resources':[{'path':'/ws/phone','conditions':[{'httpMethods':['GET'],'scopes':['http://photoz.example.com/dev/actions/all','http://photoz.example.com/dev/actions/view'],'scope_expression':{'rule':{'and':[{'or':[{'var':0},{'var':1}]},{'var':2}]},'data':['http://photoz.example.com/dev/actions/all','http://photoz.example.com/dev/actions/add','http://photoz.example.com/dev/actions/view']}},{'httpMethods':['PUT','POST'],'scope_expression':{'rule':{'and':[{'or':[{'var':0},{'var':1}]},{'var':2}]},'data':['http://photoz.example.com/dev/actions/all','http://photoz.example.com/dev/actions/add','http://photoz.example.com/dev/actions/view']},'ticketScopes':['http://photoz.example.com/dev/actions/add']},{'httpMethods':['DELETE'],'scopes':['http://photoz.example.com/dev/actions/all','http://photoz.example.com/dev/actions/remove'],'ticketScopes':['http://photoz.example.com/dev/actions/remove']}]}]} -rsProtectScopeExpressionSecond={'resources':[{'path':'/GetAll','conditions':[{'httpMethods':['GET'],'scopes':['http://photoz.example.com/dev/actions/a1','http://photoz.example.com/dev/actions/a2','http://photoz.example.com/dev/actions/a3'],'ticketScopes':['http://photoz.example.com/dev/actions/a1','http://photoz.example.com/dev/actions/a2','http://photoz.example.com/dev/actions/a3'],'scope_expression':{'rule':{'and':[{'or':[{'var':0},{'var':1}]},{'var':2}]},'data':['http://photoz.example.com/dev/actions/a1','http://photoz.example.com/dev/actions/a2','http://photoz.example.com/dev/actions/a3']}}]}]} -rsProtectWithSpontaneousScope={'resources':[{'path':'/ws/phone','conditions':[{'httpMethods':['GET'],'scopes':['^/user/.+$','http://photoz.example.com/dev/actions/view'],'ticketScopes':['/user/2']}]}]} -rsProtectWithCreationExpiration={'resources':[{'path':'/ws/phone','conditions':[{'httpMethods':['GET'],'scopes':['http://photoz.example.com/dev/actions/all','http://photoz.example.com/dev/actions/view'],'ticketScopes':['http://photoz.example.com/dev/actions/view']},{'httpMethods':['PUT', 'POST'],'scopes':['http://photoz.example.com/dev/actions/all','http://photoz.example.com/dev/actions/add'],'ticketScopes':['http://photoz.example.com/dev/actions/add']},{'httpMethods':['DELETE'],'scopes':['http://photoz.example.com/dev/actions/all','http://photoz.example.com/dev/actions/remove'],'ticketScopes':['http://photoz.example.com/dev/actions/remove']}],'iat': 1582890956, 'exp': 2079299799}]} -emailWebfingerInput=acct:test_user@${test.jans.auth.server.name} -urlWebfingerInput=https://${test.jans.auth.server.name}/admin -hostnameWebfingerInput=${test.jans.auth.server.name} -clientJwksUri=https://exampleidp.com/oauth2/default/v1/keys -state=custom_state_for_testing -paramRedirectUrl=https://client.example.com/cb/home2 -correctScopeExpression={'rule':{'or':[{'var':0},{'var':1}]},'data':['http://photoz.example.com/dev/actions/a1','http://photoz.example.com/dev/actions/a2']} -incorrectScopeExpression='rule'{'not':[{'or':[{'var':0},{'var':1}]},{'var':2}]},'data':['http://photoz.example.com/dev/actions/a1','http://photoz.example.com/dev/actions/a2','http://photoz.example.com/dev/actions/a3']} \ No newline at end of file diff --git a/jans-client-api/server/src/test/resources/testng.xml b/jans-client-api/server/src/test/resources/testng.xml deleted file mode 100644 index f92d282c8ac..00000000000 --- a/jans-client-api/server/src/test/resources/testng.xml +++ /dev/null @@ -1,230 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/jans-client-api/server/src/test/resources/web.xml b/jans-client-api/server/src/test/resources/web.xml deleted file mode 100644 index 43d6e539395..00000000000 --- a/jans-client-api/server/src/test/resources/web.xml +++ /dev/null @@ -1,44 +0,0 @@ - - - - - Jans Test client server - - - - org.jboss.weld.environment.servlet.Listener - - - - - resteasy.injector.factory - org.jboss.resteasy.cdi.CdiInjectorFactory - - - - resteasy.servlet.mapping.prefix - / - - - - Resteasy - org.jboss.resteasy.plugins.server.servlet.HttpServlet30Dispatcher - - jakarta.ws.rs.core.Application - io.jans.ca.server.arquillian.TestApiApplication - - - - - Resteasy - /* - - - - Object factory for the CDI Bean Manager - BeanManager - jakarta.enterprise.inject.spi.BeanManager - - - diff --git a/jans-client-api/settings.xml b/jans-client-api/settings.xml deleted file mode 100644 index 317f6323b0d..00000000000 --- a/jans-client-api/settings.xml +++ /dev/null @@ -1,13 +0,0 @@ - - U:/own/mvn_repository/ - false - - - - diff --git a/jans-client-api/test/test.properties b/jans-client-api/test/test.properties deleted file mode 100644 index 5d8c8708e3e..00000000000 --- a/jans-client-api/test/test.properties +++ /dev/null @@ -1,22 +0,0 @@ -test.server.name=jenkins-ldap.gluu.org -swd.resource=acct:test_user@jenkins-ldap.gluu.org - -auth.user.uid=test_user -auth.user.password=test_user_password -auth.user.inum=B1F3-AEAE-B798 -auth.user.email=test_user@test.org - -auth.client.id=FF81-2D39 -auth.client.secret=FF81-2D39-jenkins-ldap - -uma.user.uid=test_user -uma.user.password=test_user_password -uma.pat.client.id=AB77-1A2B -uma.pat.client.secret=AB77-1A2B-jenkins-ldap - -sector.identifier.id=a55ede29-8f5a-461d-b06e-76caee8d40b5 -sector.identifier.id.bad=840ef58d-a7d0-4986-af7b-71ed0089ce61 - -clientKeyStoreFile=profiles/jenkins-ldap.gluu.org/client_keystore.jks -clientKeyStoreSecret=secret - diff --git a/jans-client-api/uma-rs-core/pom.xml b/jans-client-api/uma-rs-core/pom.xml deleted file mode 100644 index da303fb2996..00000000000 --- a/jans-client-api/uma-rs-core/pom.xml +++ /dev/null @@ -1,130 +0,0 @@ - - - - 4.0.0 - uma-rs-core - jar - 1.0.3-SNAPSHOT - UMA RS Core - - - io.jans - jans-client-api-parent - 1.0.3-SNAPSHOT - - - true - - - - - - src/main/resources - - **/*.json - **/*.xml - **/*.yml - **/*.keystore - - - - - - src/test/resources - true - - **/*.json - **/*.xml - **/*.yml - **/*.keystore - - - - - - - org.apache.maven.plugins - maven-compiler-plugin - - - org.apache.maven.plugins - maven-source-plugin - - - org.apache.maven.plugins - maven-clean-plugin - - - org.apache.maven.plugins - maven-deploy-plugin - - - org.apache.maven.plugins - maven-install-plugin - - - org.apache.maven.plugins - maven-jar-plugin - - - org.apache.maven.plugins - maven-resources-plugin - - - org.apache.maven.plugins - maven-site-plugin - - - org.apache.maven.plugins - maven-surefire-plugin - - - org.codehaus.mojo - findbugs-maven-plugin - - - org.apache.maven.plugins - maven-war-plugin - - - org.apache.maven.plugins - maven-source-plugin - - - - - - org.testng - testng - - - io.jans - jans-auth-model - - - com.google.guava - guava - - - commons-codec - commons-codec - - - - org.slf4j - slf4j-api - - - org.apache.logging.log4j - log4j-slf4j-impl - - - org.apache.logging.log4j - log4j-core - - - org.apache.logging.log4j - log4j-api - - - \ No newline at end of file diff --git a/jans-client-api/uma-rs-core/src/main/java/io/jans/ca/rs/protect/Condition.java b/jans-client-api/uma-rs-core/src/main/java/io/jans/ca/rs/protect/Condition.java deleted file mode 100644 index 82b6e3409f4..00000000000 --- a/jans-client-api/uma-rs-core/src/main/java/io/jans/ca/rs/protect/Condition.java +++ /dev/null @@ -1,69 +0,0 @@ -package io.jans.ca.rs.protect; - - -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.databind.JsonNode; - -import java.util.List; - -/** - * @author Yuriy Zabrovarnyy - * @version 0.9, 18/04/2016 - */ -@JsonIgnoreProperties(ignoreUnknown = true) -public class Condition { - - @JsonProperty(value = "httpMethods") - List httpMethods; - @JsonProperty(value = "scopes") - List scopes; - @JsonProperty(value = "scope_expression") - JsonNode scope_expression; - @JsonProperty(value = "ticketScopes") - List ticketScopes; - - public List getTicketScopes() { - return ticketScopes; - } - - public void setTicketScopes(List ticketScopes) { - this.ticketScopes = ticketScopes; - } - - public List getHttpMethods() { - return httpMethods; - } - - public void setHttpMethods(List httpMethods) { - this.httpMethods = httpMethods; - } - - public List getScopes() { - return scopes; - } - - public void setScopes(List scopes) { - this.scopes = scopes; - } - - public JsonNode getScopeExpression() { - return scope_expression; - } - - public void setScopeExpression(JsonNode scopeExpression) { - this.scope_expression = scopeExpression; - } - - @Override - public String toString() { - final StringBuilder sb = new StringBuilder(); - sb.append("Condition"); - sb.append("{httpMethods=").append(httpMethods); - sb.append(", scopes=").append(scopes); - sb.append(", scope_expression=").append(scope_expression); - sb.append(", ticketScopes=").append(ticketScopes); - sb.append('}'); - return sb.toString(); - } -} diff --git a/jans-client-api/uma-rs-core/src/main/java/io/jans/ca/rs/protect/Jackson.java b/jans-client-api/uma-rs-core/src/main/java/io/jans/ca/rs/protect/Jackson.java deleted file mode 100644 index b4f3f3bcf1b..00000000000 --- a/jans-client-api/uma-rs-core/src/main/java/io/jans/ca/rs/protect/Jackson.java +++ /dev/null @@ -1,81 +0,0 @@ -package io.jans.ca.rs.protect; - -import com.fasterxml.jackson.databind.*; -import com.fasterxml.jackson.databind.introspect.JacksonAnnotationIntrospector; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import java.io.IOException; - -/** - * @author Yuriy Zabrovarnyy - * @version 0.9, 18/04/2016 - */ - -public class Jackson { - - /** - * Lazy initialization of jackson mapper via static holder - */ - private static class JacksonMapperHolder { - private static final ObjectMapper MAPPER = jsonMapper(); - - public static ObjectMapper jsonMapper() { - final AnnotationIntrospector jackson = new JacksonAnnotationIntrospector(); - - final ObjectMapper mapper = new ObjectMapper(); - final DeserializationConfig deserializationConfig = mapper.getDeserializationConfig().with(jackson); - final SerializationConfig serializationConfig = mapper.getSerializationConfig().with(jackson); - if (deserializationConfig != null && serializationConfig != null) { - // do nothing for now - } - return mapper; - } - } - - /** - * UTF-8 encoding string - */ - public static final String UTF8 = "UTF-8"; - - /** - * Logger - */ - private static final Logger LOG = LoggerFactory.getLogger(Jackson.class); - - /** - * Converts object to json string. - * - * @param p_object object to convert to string - * @return json object representation in string format - * @throws java.io.IOException if io problems occurs - */ - public static String asJson(Object p_object) throws IOException { - final ObjectMapper mapper = createJsonMapper().configure(SerializationFeature.WRAP_ROOT_VALUE, false); - return mapper.writeValueAsString(p_object); - } - - /** - * Creates json mapper for json object serialization/deserialization. - * - * @return object mapper - */ - public static ObjectMapper createJsonMapper() { - return JacksonMapperHolder.MAPPER; - } - - public static String asPrettyJson(Object p_object) throws IOException { - final ObjectMapper mapper = createJsonMapper().configure(SerializationFeature.WRAP_ROOT_VALUE, false); - final ObjectWriter writer = mapper.writer().withDefaultPrettyPrinter(); - return writer.writeValueAsString(p_object); - } - - public static String asJsonSilently(Object p_object) { - try { - return asPrettyJson(p_object); - } catch (IOException e) { - LOG.error(e.getMessage(), e); - return ""; - } - } -} diff --git a/jans-client-api/uma-rs-core/src/main/java/io/jans/ca/rs/protect/ResourceValidator.java b/jans-client-api/uma-rs-core/src/main/java/io/jans/ca/rs/protect/ResourceValidator.java deleted file mode 100644 index 0fd91d97c03..00000000000 --- a/jans-client-api/uma-rs-core/src/main/java/io/jans/ca/rs/protect/ResourceValidator.java +++ /dev/null @@ -1,47 +0,0 @@ -package io.jans.ca.rs.protect; - -import com.google.common.collect.Lists; -import com.google.common.collect.Maps; - -import java.util.List; -import java.util.Map; - -/** - * @author Yuriy Zabrovarnyy - */ - -public class ResourceValidator { - - private ResourceValidator() { - } - - public static boolean isHttpMethodUniqueInPath(List resources) { - if (resources == null || resources.isEmpty()) { - return true; - } - - Map> pathToHttpMethod = Maps.newHashMap(); - for (RsResource resource : resources) { - if (!pathToHttpMethod.containsKey(resource.getPath())) { - pathToHttpMethod.put(resource.getPath(), Lists.newArrayList()); - } - - final List httpMethods = pathToHttpMethod.get(resource.getPath()); - if (resource.getConditions() != null) { - for (Condition condition : resource.getConditions()) { - - if (condition.getHttpMethods() != null) { - for (String httpMethod : condition.getHttpMethods()) { - if (httpMethods.contains(httpMethod)) { - return false; - } else { - httpMethods.add(httpMethod); - } - } - } - } - } - } - return true; - } -} diff --git a/jans-client-api/uma-rs-core/src/main/java/io/jans/ca/rs/protect/RsProtector.java b/jans-client-api/uma-rs-core/src/main/java/io/jans/ca/rs/protect/RsProtector.java deleted file mode 100644 index 5a08399302b..00000000000 --- a/jans-client-api/uma-rs-core/src/main/java/io/jans/ca/rs/protect/RsProtector.java +++ /dev/null @@ -1,74 +0,0 @@ -package io.jans.ca.rs.protect; - -import com.google.common.base.Preconditions; -import com.google.common.collect.Maps; -import com.google.common.io.Closeables; - -import java.io.IOException; -import java.io.InputStream; -import java.util.Arrays; -import java.util.Collections; -import java.util.List; -import java.util.Map; - -/** - * @author Yuriy Zabrovarnyy - * @version 0.9, 24/12/2015 - */ - -public class RsProtector { - - private Map resourceMap = Maps.newHashMap(); - - public RsProtector(List resourceList) { - Preconditions.checkNotNull(resourceList); - - for (RsResource resource : resourceList) { - resourceMap.put(resource.getPath(), resource); - } - } - - public static RsProtector instance(InputStream inputStream) throws IOException { - try { - final RsResourceList resourceList = read(inputStream); - return new RsProtector(resourceList.getResources()); - } finally { - Closeables.closeQuietly(inputStream); - } - } - - public static RsResourceList read(String json) throws IOException { - return Jackson.createJsonMapper().readValue(json, RsResourceList.class); - } - - public static RsResourceList read(InputStream json) throws IOException { - return Jackson.createJsonMapper().readValue(json, RsResourceList.class); - } - - public boolean hasAccess(String path, String httpMethod, String... presentScope) { - Preconditions.checkNotNull(presentScope); - - return hasAccess(path, httpMethod, Arrays.asList(presentScope)); - } - - public boolean hasAccess(String path, String httpMethod, List presentScopes) { - Preconditions.checkNotNull(path); - Preconditions.checkNotNull(presentScopes); - Preconditions.checkNotNull(httpMethod); - - Preconditions.checkState(!presentScopes.isEmpty(), "Scopes can't be empty."); - - final RsResource rsResource = resourceMap.get(path); - if (rsResource != null) { - final List requiredScopes = rsResource.scopes(httpMethod); - if (requiredScopes != null) { - return !Collections.disjoint(requiredScopes, presentScopes); // contains any - } - } - return false; - } - - public Map getResourceMap() { - return resourceMap; - } -} diff --git a/jans-client-api/uma-rs-core/src/main/java/io/jans/ca/rs/protect/RsResource.java b/jans-client-api/uma-rs-core/src/main/java/io/jans/ca/rs/protect/RsResource.java deleted file mode 100644 index 9a532ceaf6b..00000000000 --- a/jans-client-api/uma-rs-core/src/main/java/io/jans/ca/rs/protect/RsResource.java +++ /dev/null @@ -1,116 +0,0 @@ -package io.jans.ca.rs.protect; - -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.databind.JsonNode; -import com.google.common.collect.Maps; -import io.jans.as.model.uma.JsonLogicNode; -import io.jans.as.model.uma.JsonLogicNodeParser; - -import java.io.Serializable; -import java.util.List; -import java.util.Map; - -/** - * @author Yuriy Zabrovarnyy - * @version 0.9, 24/12/2015 - */ -@JsonIgnoreProperties(ignoreUnknown = true) -public class RsResource implements Serializable { - - @JsonProperty(value = "path") - String path; - @JsonProperty(value = "conditions") - List conditions; - @JsonProperty(value = "iat") - private Integer iat; - @JsonProperty(value = "exp") - private Integer exp; - - private Map httpMethodToCondition = null; - - public String getPath() { - return path; - } - - public void setPath(String path) { - this.path = path; - } - - public List getConditions() { - return conditions; - } - - public void setConditions(List conditions) { - this.conditions = conditions; - } - - public List scopes(String httpMethod) { - return getConditionMap().get(httpMethod).getScopes(); - } - - public Integer getIat() { - return iat; - } - - public void setIat(Integer iat) { - this.iat = iat; - } - - public Integer getExp() { - return exp; - } - - public void setExp(Integer exp) { - this.exp = exp; - } - - public JsonNode getScopeExpression(String httpMethod) { - return getConditionMap().get(httpMethod).getScopeExpression(); - } - - public List getScopesForTicket(String httpMethod) { - Condition condition = getConditionMap().get(httpMethod); - if (condition.getScopeExpression() != null) { - final JsonLogicNode node = JsonLogicNodeParser.parseNode(condition.getScopeExpression().toString()); - if (node != null) { - return node.getData(); // return all scopes defined in "data" of json object - } - } - return condition.getTicketScopes() != null && !condition.getTicketScopes().isEmpty() ? - condition.getTicketScopes() : condition.getScopes(); - } - - public Map getConditionMap() { - if (httpMethodToCondition == null) { - initMap(); - } - return httpMethodToCondition; - } - - private void initMap() { - httpMethodToCondition = Maps.newHashMap(); - if (conditions != null) { - for (Condition condition : conditions) { - if (condition.getHttpMethods() != null) { - for (String httpMethod : condition.getHttpMethods()) { - httpMethodToCondition.put(httpMethod, condition); - } - } - } - } - } - - @Override - public String toString() { - final StringBuilder sb = new StringBuilder(); - sb.append("RsResource"); - sb.append("{path='").append(path).append('\''); - sb.append(", conditions=").append(conditions); - sb.append(", httpMethodToCondition=").append(httpMethodToCondition); - sb.append(", iat=").append(iat); - sb.append(", exp=").append(exp); - sb.append('}'); - return sb.toString(); - } -} diff --git a/jans-client-api/uma-rs-core/src/main/java/io/jans/ca/rs/protect/RsResourceList.java b/jans-client-api/uma-rs-core/src/main/java/io/jans/ca/rs/protect/RsResourceList.java deleted file mode 100644 index c4a5613fc52..00000000000 --- a/jans-client-api/uma-rs-core/src/main/java/io/jans/ca/rs/protect/RsResourceList.java +++ /dev/null @@ -1,42 +0,0 @@ -package io.jans.ca.rs.protect; - -import com.fasterxml.jackson.annotation.JsonProperty; -import com.google.common.collect.Lists; - -import java.io.Serializable; -import java.util.List; - -/** - * @author Yuriy Zabrovarnyy - * @version 0.9, 24/12/2015 - */ - -public class RsResourceList implements Serializable { - - @JsonProperty(value = "resources") - private List resources = Lists.newArrayList(); - - public RsResourceList() { - } - - public RsResourceList(List resources) { - this.resources = resources; - } - - public List getResources() { - return resources; - } - - public void setResources(List resources) { - this.resources = resources; - } - - @Override - public String toString() { - final StringBuilder sb = new StringBuilder(); - sb.append("RsResourceList"); - sb.append("{resources=").append(resources); - sb.append('}'); - return sb.toString(); - } -} diff --git a/jans-client-api/uma-rs-core/src/main/java/io/jans/ca/rs/protect/StaticStorage.java b/jans-client-api/uma-rs-core/src/main/java/io/jans/ca/rs/protect/StaticStorage.java deleted file mode 100644 index 8f12f1c5e57..00000000000 --- a/jans-client-api/uma-rs-core/src/main/java/io/jans/ca/rs/protect/StaticStorage.java +++ /dev/null @@ -1,23 +0,0 @@ -package io.jans.ca.rs.protect; - -import com.google.common.collect.Maps; - -import java.util.Map; - -/** - * @author Yuriy Zabrovarnyy - * @version 0.9, 15/05/2016 - */ - -public class StaticStorage { - - private static Map, Object> dataMap = Maps.newConcurrentMap(); - - public static T get(Class type) { - return (T) dataMap.get(type); - } - - public static void put(Class type, T data) { - dataMap.put(type, data); - } -} diff --git a/jans-client-api/uma-rs-core/src/test/java/io/jans/ca/rs/protect/ResourceValidatorTest.java b/jans-client-api/uma-rs-core/src/test/java/io/jans/ca/rs/protect/ResourceValidatorTest.java deleted file mode 100644 index f66c7935994..00000000000 --- a/jans-client-api/uma-rs-core/src/test/java/io/jans/ca/rs/protect/ResourceValidatorTest.java +++ /dev/null @@ -1,27 +0,0 @@ -package io.jans.ca.rs.protect; - -import org.testng.annotations.Test; - -import java.io.IOException; -import java.io.InputStream; - -import static org.testng.Assert.assertFalse; -import static org.testng.Assert.assertTrue; - - -/** - * @author Yuriy Zabrovarnyy - */ - -public class ResourceValidatorTest { - - @Test - public void httpMethodMustBeUniqueWithinPath() throws IOException { - assertTrue(ResourceValidator.isHttpMethodUniqueInPath(RsProtector.read(fileInputStream("valid.json")).getResources())); - assertFalse(ResourceValidator.isHttpMethodUniqueInPath(RsProtector.read(fileInputStream("duplicated-http-method.json")).getResources())); - } - - private InputStream fileInputStream(String fileName) { - return ResourceValidatorTest.class.getResourceAsStream(fileName); - } -} diff --git a/jans-client-api/uma-rs-core/src/test/java/io/jans/ca/rs/protect/RsProtectorTest.java b/jans-client-api/uma-rs-core/src/test/java/io/jans/ca/rs/protect/RsProtectorTest.java deleted file mode 100644 index 86e06f746b7..00000000000 --- a/jans-client-api/uma-rs-core/src/test/java/io/jans/ca/rs/protect/RsProtectorTest.java +++ /dev/null @@ -1,33 +0,0 @@ -package io.jans.ca.rs.protect; - -import org.testng.annotations.Test; - -import java.io.IOException; -import java.io.InputStream; - -import static org.testng.Assert.*; - -/** - * @author Yuriy Zabrovarnyy - * @version 0.9, 24/12/2015 - */ - -public class RsProtectorTest { - - @Test - public void access() throws IOException { - final RsProtector protector = RsProtector.instance(fileInputStream("simple.json")); - - assertTrue(protector.hasAccess("/photo", "GET", "http://photoz.example.com/dev/actions/view")); - assertTrue(protector.hasAccess("/photo", "PUT", "http://photoz.example.com/dev/actions/add")); - assertTrue(protector.hasAccess("/photo", "POST", "http://photoz.example.com/dev/actions/add", - "http://photoz.example.com/dev/actions/all")); - - assertFalse(protector.hasAccess("/photo", "GET", "http://photoz.example.com/dev/actions/add")); - assertFalse(protector.hasAccess("/photo", "PUT", "http://photoz.example.com/dev/actions/view")); - } - - private InputStream fileInputStream(String fileName) { - return RsProtectorTest.class.getResourceAsStream(fileName); - } -} diff --git a/jans-client-api/uma-rs-core/src/test/resources/io/jans/ca/rs/protect/duplicated-http-method.json b/jans-client-api/uma-rs-core/src/test/resources/io/jans/ca/rs/protect/duplicated-http-method.json deleted file mode 100644 index 8947e8dec44..00000000000 --- a/jans-client-api/uma-rs-core/src/test/resources/io/jans/ca/rs/protect/duplicated-http-method.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "resources": [ - { - "path": "/ws/phone", - "conditions": [ - { - "httpMethods": [ - "GET", "PUT" - ], - "scopes": [ - "http://photoz.example.com/dev/actions/all", - "http://photoz.example.com/dev/actions/view" - ], - "ticketScopes": [ - "http://photoz.example.com/dev/actions/view" - ] - }, - { - "httpMethods": [ - "PUT", - "POST" - ], - "scopes": [ - "http://photoz.example.com/dev/actions/all", - "http://photoz.example.com/dev/actions/add" - ], - "ticketScopes": [ - "http://photoz.example.com/dev/actions/add" - ] - }, - { - "httpMethods": [ - "DELETE" - ], - "scopes": [ - "http://photoz.example.com/dev/actions/all", - "http://photoz.example.com/dev/actions/remove" - ], - "ticketScopes": [ - "http://photoz.example.com/dev/actions/remove" - ] - } - ] - } - ] -} \ No newline at end of file diff --git a/jans-client-api/uma-rs-core/src/test/resources/io/jans/ca/rs/protect/simple.json b/jans-client-api/uma-rs-core/src/test/resources/io/jans/ca/rs/protect/simple.json deleted file mode 100644 index 1029b511c1b..00000000000 --- a/jans-client-api/uma-rs-core/src/test/resources/io/jans/ca/rs/protect/simple.json +++ /dev/null @@ -1,32 +0,0 @@ -{"resources":[ - { - "path":"/photo", - "conditions":[ - { - "httpMethods":["GET"], - "scopes":[ - "http://photoz.example.com/dev/actions/view" - ] - }, - { - "httpMethods":["PUT", "POST"], - "scopes":[ - "http://photoz.example.com/dev/actions/all", - "http://photoz.example.com/dev/actions/add" - ] - } - ] - }, - { - "path":"/document", - "conditions":[ - { - "httpMethods":["GET"], - "scopes":[ - "http://photoz.example.com/dev/actions/view" - ] - } - ] - } -] -} \ No newline at end of file diff --git a/jans-client-api/uma-rs-core/src/test/resources/io/jans/ca/rs/protect/valid.json b/jans-client-api/uma-rs-core/src/test/resources/io/jans/ca/rs/protect/valid.json deleted file mode 100644 index fb06b646a3b..00000000000 --- a/jans-client-api/uma-rs-core/src/test/resources/io/jans/ca/rs/protect/valid.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "resources": [ - { - "path": "/ws/phone", - "conditions": [ - { - "httpMethods": [ - "GET" - ], - "scopes": [ - "http://photoz.example.com/dev/actions/all", - "http://photoz.example.com/dev/actions/view" - ], - "ticketScopes": [ - "http://photoz.example.com/dev/actions/view" - ] - }, - { - "httpMethods": [ - "PUT", - "POST" - ], - "scopes": [ - "http://photoz.example.com/dev/actions/all", - "http://photoz.example.com/dev/actions/add" - ], - "ticketScopes": [ - "http://photoz.example.com/dev/actions/add" - ] - }, - { - "httpMethods": [ - "DELETE" - ], - "scopes": [ - "http://photoz.example.com/dev/actions/all", - "http://photoz.example.com/dev/actions/remove" - ], - "ticketScopes": [ - "http://photoz.example.com/dev/actions/remove" - ] - } - ] - } - ] -} \ No newline at end of file diff --git a/jans-client-api/uma-rs-core/src/test/resources/testng.xml b/jans-client-api/uma-rs-core/src/test/resources/testng.xml deleted file mode 100644 index 61c89d38c7a..00000000000 --- a/jans-client-api/uma-rs-core/src/test/resources/testng.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - - - - diff --git a/jans-client-api/uma-rs-resteasy/pom.xml b/jans-client-api/uma-rs-resteasy/pom.xml deleted file mode 100644 index c8a3e43072d..00000000000 --- a/jans-client-api/uma-rs-resteasy/pom.xml +++ /dev/null @@ -1,115 +0,0 @@ - - - - 4.0.0 - uma-rs-resteasy - jar - 1.0.3-SNAPSHOT - UMA RS Resteasy - http://ox.gluu.org - - - io.jans - jans-client-api-parent - 1.0.3-SNAPSHOT - - - - true - - - - - org.apache.maven.plugins - maven-compiler-plugin - - - org.apache.maven.plugins - maven-clean-plugin - - - org.apache.maven.plugins - maven-deploy-plugin - - - org.apache.maven.plugins - maven-install-plugin - - - org.apache.maven.plugins - maven-jar-plugin - - - org.apache.maven.plugins - maven-resources-plugin - - - org.apache.maven.plugins - maven-site-plugin - - - org.apache.maven.plugins - maven-surefire-plugin - - - org.codehaus.mojo - findbugs-maven-plugin - - - org.apache.maven.plugins - maven-war-plugin - - - org.apache.maven.plugins - maven-source-plugin - - - - - - - io.jans - uma-rs-core - ${project.version} - - - io.jans - jans-auth-client - - - com.google.guava - guava - - - commons-codec - commons-codec - - - - jakarta.ws.rs - jakarta.ws.rs-api - - - - org.slf4j - slf4j-api - - - org.apache.logging.log4j - log4j-slf4j-impl - - - org.apache.logging.log4j - log4j-core - - - org.apache.logging.log4j - log4j-api - - - org.testng - testng - - - - \ No newline at end of file diff --git a/jans-client-api/uma-rs-resteasy/src/main/java/io/jans/ca/rs/protect/resteasy/Configuration.java b/jans-client-api/uma-rs-resteasy/src/main/java/io/jans/ca/rs/protect/resteasy/Configuration.java deleted file mode 100644 index 68717b7b65f..00000000000 --- a/jans-client-api/uma-rs-resteasy/src/main/java/io/jans/ca/rs/protect/resteasy/Configuration.java +++ /dev/null @@ -1,73 +0,0 @@ -package io.jans.ca.rs.protect.resteasy; - - -import com.fasterxml.jackson.annotation.JsonProperty; - -/** - * @author Yuriy Zabrovarnyy - */ - -public class Configuration { - - public static final String WELL_KNOWN_UMA_PATH = "/.well-known/uma2-configuration"; - - @JsonProperty(value = "op_host") - private String opHost; - @JsonProperty(value = "pat_client_id") - private String umaPatClientId; - @JsonProperty(value = "pat_client_secret") - private String umaPatClientSecret; - @JsonProperty(value = "trust_all") - private boolean trustAll; - - public Configuration() { - } - - public boolean isTrustAll() { - return trustAll; - } - - public void setTrustAll(boolean trustAll) { - this.trustAll = trustAll; - } - - public String wellKnownEndpoint() { - return opHost + WELL_KNOWN_UMA_PATH; - } - - public String getOpHost() { - return opHost; - } - - public void setOpHost(String opHost) { - this.opHost = opHost; - } - - public String getUmaPatClientId() { - return umaPatClientId; - } - - public void setUmaPatClientId(String umaPatClientId) { - this.umaPatClientId = umaPatClientId; - } - - public String getUmaPatClientSecret() { - return umaPatClientSecret; - } - - public void setUmaPatClientSecret(String umaPatClientSecret) { - this.umaPatClientSecret = umaPatClientSecret; - } - - @Override - public String toString() { - final StringBuilder sb = new StringBuilder(); - sb.append("Configuration"); - sb.append("{opHost='").append(opHost).append('\''); - sb.append(", umaPatClientId='").append(umaPatClientId).append('\''); - sb.append(", umaPatClientSecret='").append(umaPatClientSecret).append('\''); - sb.append(", trustAll='").append(trustAll).append('\''); - sb.append('}'); - return sb.toString(); - } -} diff --git a/jans-client-api/uma-rs-resteasy/src/main/java/io/jans/ca/rs/protect/resteasy/ConfigurationLoader.java b/jans-client-api/uma-rs-resteasy/src/main/java/io/jans/ca/rs/protect/resteasy/ConfigurationLoader.java deleted file mode 100644 index 43cf944da25..00000000000 --- a/jans-client-api/uma-rs-resteasy/src/main/java/io/jans/ca/rs/protect/resteasy/ConfigurationLoader.java +++ /dev/null @@ -1,31 +0,0 @@ -package io.jans.ca.rs.protect.resteasy; - -import org.apache.log4j.Logger; -import io.jans.ca.rs.protect.Jackson; - -import java.io.InputStream; - -/** - * @author Yuriy Zabrovarnyy - * @version 0.9, 20/04/2016 - */ - -public class ConfigurationLoader { - - private static final Logger LOG = Logger.getLogger(ConfigurationLoader.class); - - /** - * Avoid instance creation. - */ - private ConfigurationLoader() { - } - - public static Configuration loadFromJson(InputStream inputStream) { - try { - return Jackson.createJsonMapper().readValue(inputStream, Configuration.class); - } catch (Exception e) { - LOG.error(e.getMessage(), e); - return null; - } - } -} diff --git a/jans-client-api/uma-rs-resteasy/src/main/java/io/jans/ca/rs/protect/resteasy/Key.java b/jans-client-api/uma-rs-resteasy/src/main/java/io/jans/ca/rs/protect/resteasy/Key.java deleted file mode 100644 index c4b8c77287c..00000000000 --- a/jans-client-api/uma-rs-resteasy/src/main/java/io/jans/ca/rs/protect/resteasy/Key.java +++ /dev/null @@ -1,72 +0,0 @@ -package io.jans.ca.rs.protect.resteasy; - -import java.util.List; - -/** - * @author Yuriy Zabrovarnyy - * @version 0.9, 19/04/2016 - */ - -public class Key { - - private String path; - private List httpMethods; - - public Key() { - } - - public Key(String path, List httpMethod) { - this.path = path; - this.httpMethods = httpMethod; - } - - public String getResourceName() { - return httpMethods + " " + path; - } - - public String getPath() { - return path; - } - - public void setPath(String path) { - this.path = path; - } - - public List getHttpMethods() { - return httpMethods; - } - - public void setHttpMethods(List httpMethods) { - this.httpMethods = httpMethods; - } - - @Override - public boolean equals(Object o) { - if (this == o) return true; - if (o == null || getClass() != o.getClass()) return false; - - Key key = (Key) o; - - if (httpMethods != null ? !httpMethods.equals(key.httpMethods) : key.httpMethods != null) return false; - if (path != null ? !path.equals(key.path) : key.path != null) return false; - - return true; - } - - @Override - public int hashCode() { - int result = path != null ? path.hashCode() : 0; - result = 31 * result + (httpMethods != null ? httpMethods.hashCode() : 0); - return result; - } - - @Override - public String toString() { - final StringBuilder sb = new StringBuilder(); - sb.append("Key"); - sb.append("{path='").append(path).append('\''); - sb.append(", httpMethods='").append(httpMethods).append('\''); - sb.append('}'); - return sb.toString(); - } -} diff --git a/jans-client-api/uma-rs-resteasy/src/main/java/io/jans/ca/rs/protect/resteasy/ObtainPatProvider.java b/jans-client-api/uma-rs-resteasy/src/main/java/io/jans/ca/rs/protect/resteasy/ObtainPatProvider.java deleted file mode 100644 index ec8677920f8..00000000000 --- a/jans-client-api/uma-rs-resteasy/src/main/java/io/jans/ca/rs/protect/resteasy/ObtainPatProvider.java +++ /dev/null @@ -1,88 +0,0 @@ -package io.jans.ca.rs.protect.resteasy; - -import com.google.common.base.Preconditions; -import org.apache.log4j.Logger; -import io.jans.as.client.TokenClient; -import io.jans.as.client.TokenResponse; -import io.jans.as.model.uma.UmaMetadata; -import io.jans.as.model.uma.UmaScopeType; -import io.jans.as.model.uma.wrapper.Token; -import io.jans.as.model.util.Util; - -/** - * @author Yuriy Zabrovarnyy - * @version 0.9, 02/06/2016 - */ - -public class ObtainPatProvider implements PatProvider { - - private static final Logger LOG = Logger.getLogger(PatProvider.class); - - private final ServiceProvider serviceProvider; - private final Configuration configuration; - - private Token patToken; - - public ObtainPatProvider(ServiceProvider serviceProvider, Configuration configuration) { - this.serviceProvider = serviceProvider; - this.configuration = configuration; - } - - public synchronized String getPatToken() { - if (patToken == null) { - obtainPat(); - } - Preconditions.checkNotNull(patToken); - return patToken.getAccessToken(); - } - - public synchronized void clearPat() { - patToken = null; - LOG.trace("Cleared PAT."); - } - - public String renewPat() { - clearPat(); - return getPatToken(); - } - - private void obtainPat() { - try { - UmaMetadata umaMetadata = serviceProvider.getUmaMetadata(); - - patToken = requestPat(umaMetadata.getTokenEndpoint(), configuration.getUmaPatClientId(), configuration.getUmaPatClientSecret()); - LOG.trace("New PAT obtained."); - } catch (Exception e) { - LOG.error("Failed to obtain PAT. " + e.getMessage(), e); - throw new RuntimeException(e); - } - } - - public ServiceProvider getServiceProvider() { - return serviceProvider; - } - - public Token requestPat(final String tokenUrl, final String umaClientId, final String umaClientSecret, String... scopeArray) throws Exception { - - String scope = UmaScopeType.PROTECTION.getValue(); - if (scopeArray != null && scopeArray.length > 0) { - for (String s : scopeArray) { - scope = scope + " " + s; - } - } - - TokenClient tokenClient = new TokenClient(tokenUrl); - tokenClient.setExecutor(serviceProvider.getClientEngine()); - TokenResponse response = tokenClient.execClientCredentialsGrant(scope, umaClientId, umaClientSecret); - - if (response.getStatus() == 200) { - final String patToken = response.getAccessToken(); - final Integer expiresIn = response.getExpiresIn(); - if (Util.allNotBlank(patToken)) { - return new Token(null, null, patToken, UmaScopeType.PROTECTION.getValue(), expiresIn); - } - } - - return null; - } -} diff --git a/jans-client-api/uma-rs-resteasy/src/main/java/io/jans/ca/rs/protect/resteasy/PatProvider.java b/jans-client-api/uma-rs-resteasy/src/main/java/io/jans/ca/rs/protect/resteasy/PatProvider.java deleted file mode 100644 index f7fc016380d..00000000000 --- a/jans-client-api/uma-rs-resteasy/src/main/java/io/jans/ca/rs/protect/resteasy/PatProvider.java +++ /dev/null @@ -1,13 +0,0 @@ -package io.jans.ca.rs.protect.resteasy; - -/** - * @author Yuriy Zabrovarnyy - * @version 0.9, 19/04/2016 - */ - -public interface PatProvider { - - String getPatToken(); - - void clearPat(); -} diff --git a/jans-client-api/uma-rs-resteasy/src/main/java/io/jans/ca/rs/protect/resteasy/ResourceRegistrar.java b/jans-client-api/uma-rs-resteasy/src/main/java/io/jans/ca/rs/protect/resteasy/ResourceRegistrar.java deleted file mode 100644 index 1d5e9042fea..00000000000 --- a/jans-client-api/uma-rs-resteasy/src/main/java/io/jans/ca/rs/protect/resteasy/ResourceRegistrar.java +++ /dev/null @@ -1,149 +0,0 @@ -package io.jans.ca.rs.protect.resteasy; - -import com.google.common.base.Preconditions; -import com.google.common.base.Strings; -import com.google.common.collect.Lists; -import com.google.common.collect.Maps; -import io.jans.as.model.uma.JsonLogicNodeParser; -import io.jans.as.model.uma.UmaResource; -import io.jans.as.model.uma.UmaResourceResponse; -import org.apache.log4j.Logger; -import io.jans.ca.rs.protect.Condition; -import io.jans.ca.rs.protect.RsProtector; -import io.jans.ca.rs.protect.RsResource; - -import java.util.Collection; -import java.util.Map; - -/** - * @author Yuriy Zabrovarnyy - * @version 0.9, 19/04/2016 - */ - -public class ResourceRegistrar { - - private static final Logger LOG = Logger.getLogger(ResourceRegistrar.class); - - private final Map resourceMap = Maps.newHashMap(); - private final Map idMap = Maps.newHashMap(); - - private final PatProvider patProvider; - private final ServiceProvider serviceProvider; - - public ResourceRegistrar(PatProvider patProvider, ServiceProvider serviceProvider) { - this.patProvider = patProvider; - this.serviceProvider = serviceProvider; - } - - public RsProtector getProtector() { - return new RsProtector(Lists.newArrayList(resourceMap.values())); - } - - public RsResource getRsResource(Key key) { - return resourceMap.get(key); - } - - public void register(Collection resources) { - Preconditions.checkNotNull(resources); - - for (RsResource resource : resources) { - register(resource); - } - } - - public Key getKey(String path, String httpMethod) { - if (Strings.isNullOrEmpty(path) || Strings.isNullOrEmpty(httpMethod)) { - return null; - } - - String id = idMap.get(new Key(path, Lists.newArrayList(httpMethod))); - if (id != null) { - return new Key(path, Lists.newArrayList(httpMethod)); - } - - for (Key key : idMap.keySet()) { - if (path.startsWith(key.getPath()) && key.getHttpMethods().contains(httpMethod)) { - return key; - } - } - return null; - } - - public String getResourceSetId(Key key) { - return key != null ? idMap.get(key) : null; - } - - public String getResourceSetId(String path, String httpMethod) { - return getResourceSetId(getKey(path, httpMethod)); - } - - private void register(RsResource rsResource) { - try { - for (Condition condition : rsResource.getConditions()) { - Key key = new Key(rsResource.getPath(), condition.getHttpMethods()); - - UmaResource resource = new UmaResource(); - resource.setName(key.getResourceName()); - - if (condition.getScopeExpression() != null && JsonLogicNodeParser.isNodeValid(condition.getScopeExpression().toString())) { - resource.setScopeExpression(condition.getScopeExpression().toString()); - resource.setScopes(JsonLogicNodeParser.parseNode(condition.getScopeExpression().toString()).getData()); - } else { - resource.setScopes(condition.getScopes()); - } - //set creation and expiration timestamp - if (isSafeToInt(rsResource.getIat())) { - resource.setIat(rsResource.getIat()); - } - - if (isSafeToInt(rsResource.getExp())) { - resource.setExp(rsResource.getExp()); - } - - UmaResourceResponse resourceResponse = serviceProvider.getResourceService().addResource("Bearer " + patProvider.getPatToken(), resource); - - Preconditions.checkNotNull(resourceResponse.getId(), "Resource ID can not be null."); - - resourceMap.put(key, rsResource); - idMap.put(key, resourceResponse.getId()); - - LOG.debug("Registered resource, path: " + key.getPath() + ", http methods: " + condition.getHttpMethods() + ", id: " + resourceResponse.getId()); - } - - } catch (Exception ex) { - LOG.error(ex.getMessage(), ex); - throw ex; - } - } - - public void putRegisteredResource(RsResource resource, String idOfResourceOnAuthorizationServer) { - for (Condition condition : resource.getConditions()) { - Key key = new Key(resource.getPath(), condition.getHttpMethods()); - - resourceMap.put(key, resource); - idMap.put(key, idOfResourceOnAuthorizationServer); - - LOG.debug("Put registered resource, path: " + key.getPath() + ", http methods: " + condition.getHttpMethods() + ", id: " + idOfResourceOnAuthorizationServer); - } - } - - public PatProvider getPatProvider() { - return patProvider; - } - - public ServiceProvider getServiceProvider() { - return serviceProvider; - } - - public Map getResourceMapCopy() { - return Maps.newHashMap(resourceMap); - } - - public Map getIdMapCopy() { - return Maps.newHashMap(idMap); - } - - public static boolean isSafeToInt(Integer input) { - return input != null && input > 0; - } -} diff --git a/jans-client-api/uma-rs-resteasy/src/main/java/io/jans/ca/rs/protect/resteasy/RptPreProcessInterceptor.java b/jans-client-api/uma-rs-resteasy/src/main/java/io/jans/ca/rs/protect/resteasy/RptPreProcessInterceptor.java deleted file mode 100644 index 5c5126b9cb7..00000000000 --- a/jans-client-api/uma-rs-resteasy/src/main/java/io/jans/ca/rs/protect/resteasy/RptPreProcessInterceptor.java +++ /dev/null @@ -1,217 +0,0 @@ -package io.jans.ca.rs.protect.resteasy; - -import com.google.common.base.Preconditions; -import com.google.common.base.Strings; -import io.jans.as.model.uma.PermissionTicket; -import io.jans.as.model.uma.RptIntrospectionResponse; -import io.jans.as.model.uma.UmaPermission; -import io.jans.as.model.uma.UmaPermissionList; -import io.jans.ca.rs.protect.Jackson; -import io.jans.util.StringHelper; -import jakarta.ws.rs.ClientErrorException; -import jakarta.ws.rs.WebApplicationException; -import jakarta.ws.rs.core.HttpHeaders; -import jakarta.ws.rs.core.Response; -import org.apache.commons.lang.StringUtils; -import org.apache.log4j.Logger; -import org.jboss.resteasy.core.ServerResponse; -import org.jboss.resteasy.specimpl.BuiltResponse; -import org.jboss.resteasy.spi.Failure; -import org.jboss.resteasy.spi.HttpRequest; - -import java.util.List; - -/** - * @author Yuriy Zabrovarnyy - * @version 0.9, 18/04/2016 - */ - -public class RptPreProcessInterceptor { - - private static final Logger LOG = Logger.getLogger(RptPreProcessInterceptor.class); - - private final ResourceRegistrar resourceRegistrar; - private final PatProvider patProvider; - private final ServiceProvider serviceProvider; - - public RptPreProcessInterceptor(ResourceRegistrar resourceRegistrar) { - Preconditions.checkNotNull(resourceRegistrar, "Resource registrar is null."); - Preconditions.checkNotNull(resourceRegistrar.getPatProvider(), "PAT Provider is null."); - Preconditions.checkNotNull(resourceRegistrar.getServiceProvider(), "Service Provider is null."); - - this.resourceRegistrar = resourceRegistrar; - this.patProvider = resourceRegistrar.getPatProvider(); - this.serviceProvider = resourceRegistrar.getServiceProvider(); - } - - public ServerResponse preProcess(HttpRequest request) throws Failure, WebApplicationException { - - String path = getPath(request); - String httpMethod = request.getHttpMethod(); - - Key key = resourceRegistrar.getKey(path, httpMethod); - if (key == null) { - LOG.debug("Resource is not protected with UMA, path:" + path + ", httpMethod: " + httpMethod); - return null; - } - - try { - String rpt = getRpt(request.getHttpHeaders()); - - if (!Strings.isNullOrEmpty(rpt)) { - LOG.debug("RPT present in request"); - final RptIntrospectionResponse status = requestRptStatus(rpt); - if (hasPermission(status, key, httpMethod, isGat(rpt))) { - LOG.debug("RPT has enough permissions, access GRANTED. Path: " + path + ", httpMethod:" + httpMethod); - return null; - } - } - } catch (Exception e) { - LOG.error(e.getMessage(), e); - if (e instanceof ClientErrorException) { - LOG.error("Entity: " + ((((ClientErrorException) e).getResponse()).readEntity(String.class))); - } - return new ServerResponse((BuiltResponse) Response.status(Response.Status.INTERNAL_SERVER_ERROR).entity(e.getMessage()).build()); - } - - // If the client's request at the protected resource has no RPT, - // or has an invalid RPT or insufficient authorization data associated with the RPT as determined through - // RPT status checking (see Section 3.4), then assuming the resource server chooses to respond to the client, - // it MUST use the protection API's permission registration endpoint to register a requested permission with - // the corresponding authorization server. - LOG.debug("Client does not present valid RPT. Registering permission ticket ..."); - - return new ServerResponse((BuiltResponse) registerTicketResponse(path, httpMethod)); - } - - public static boolean isGat(String rpt) { - return !Strings.isNullOrEmpty(rpt) && rpt.startsWith("gat_"); - } - - public boolean hasPermission(RptIntrospectionResponse status, Key key, String httpMethod, boolean isGat) { - if (status != null && status.getActive()) { - String resourceSetId = resourceRegistrar.getResourceSetId(key); - if (Strings.isNullOrEmpty(resourceSetId)) { - LOG.error("Resource has key but is not registered on AS. Key: " + key); - return false; - } - - if (status.getPermissions() != null) { - for (UmaPermission permission : status.getPermissions()) { - if (permission.getResourceId() != null && permission.getResourceId().equals(resourceSetId) && - resourceRegistrar.getProtector().hasAccess(key.getPath(), httpMethod, permission.getScopes())) { - return true; - } - if (isGat && resourceRegistrar.getProtector().hasAccess(key.getPath(), httpMethod, permission.getScopes())) { - return true; - } - } - } - } - return false; - } - - public String getPath(HttpRequest request) { - if (request.getUri() != null && request.getUri().getAbsolutePath() != null) { - return request.getUri().getAbsolutePath().getPath(); - } - return null; - } - - public static String getRptFromAuthorization(String authorizationHeader) { - if (StringHelper.isNotEmpty(authorizationHeader) && authorizationHeader.startsWith("Bearer ")) { - return authorizationHeader.substring("Bearer ".length()); - } - return null; - } - - public static String getRpt(HttpHeaders httpHeaders) { - if (httpHeaders != null) { - final List authHeaders = httpHeaders.getRequestHeader("Authorization"); - if (authHeaders != null && !authHeaders.isEmpty()) { - final String authorization = authHeaders.get(0); - return getRptFromAuthorization(authorization); - } - } - return ""; - } - - public RptIntrospectionResponse requestRptStatus(String rpt) { - if (StringUtils.isNotBlank(rpt)) { - - LOG.debug("Request RPT " + rpt + " status..."); - - final RptIntrospectionResponse status = serviceProvider.getRptIntrospectionService().requestRptStatus("Bearer " + patProvider.getPatToken(), rpt, ""); - if (status != null) { - LOG.debug("RPT status: " + Jackson.asJsonSilently(status)); - return status; - } else { - LOG.debug("Unable to retrieve RPT " + rpt + " status from AM."); - } - } - return null; - } - - public Response registerTicketResponse(String path, String httpMethod) { - Key key = resourceRegistrar.getKey(path, httpMethod); - if (key == null) { - LOG.error("Resource is not registered. Path: " + path + ", httpMethod: " + httpMethod + ". Please register it via uma-rs configuration."); - LOG.error("Skip protection !!!"); - return null; - } - final List ticketScopes = resourceRegistrar.getRsResource(key).getScopesForTicket(httpMethod); - LOG.trace("Ticket scopes: " + ticketScopes); - return registerTicketResponse(ticketScopes, resourceRegistrar.getResourceSetId(key)); - } - - public Response registerTicketResponse(List scopes, String resourceSetId) { - return registerTicketResponse(scopes, resourceSetId, true); - } - - public Response registerTicketResponse(List scopes, String resourceSetId, boolean retry) { - Preconditions.checkState(scopes != null && !scopes.isEmpty(), "Scopes must not be empty."); - Preconditions.checkState(!Strings.isNullOrEmpty(resourceSetId), "ResourceId must be set."); - - - try { - UmaPermission permission = new UmaPermission(); - permission.setResourceId(resourceSetId); - permission.setScopes(scopes); - - PermissionTicket ticket = resourceRegistrar.getServiceProvider().getPermissionService().registerPermission( - "Bearer " + patProvider.getPatToken(), UmaPermissionList.instance(permission)); - if (ticket != null) { - String headerValue = "UMA realm=\"rs\"," + - "as_uri=\"" + serviceProvider.getOpHost() + "\"," + - "error=\"insufficient_scope\"," + - "ticket=\"" + ticket.getTicket() + "\""; - LOG.debug("Ticket registered, " + headerValue); - return Response.status(Response.Status.FORBIDDEN) - .header("WWW-Authenticate", headerValue) - .entity(ticket) - .build(); - } else { - LOG.error("Failed to register permission ticket. Response is null."); - } - } catch (ClientErrorException e) { - LOG.debug("Failed to register ticket. Entity: " + e.getResponse().readEntity(String.class) + ", status: " + e.getResponse().getStatus(), e); - if (e.getResponse().getStatus() == 400 || e.getResponse().getStatus() == 401) { - LOG.debug("Try maybe PAT is lost on AS, force refresh PAT and request ticket again ..."); - patProvider.clearPat(); - if (retry) { - LOG.debug("Re-try register the ticket."); - return registerTicketResponse(scopes, resourceSetId, false); - } - } else { - throw e; - } - } catch (Exception e) { - - LOG.error("Failed to register permission ticket.", e); - } - return Response.status(Response.Status.FORBIDDEN) - .header("Warning:", "UMA Authorization Server Unreachable") - .build(); - } -} - diff --git a/jans-client-api/uma-rs-resteasy/src/main/java/io/jans/ca/rs/protect/resteasy/ServiceProvider.java b/jans-client-api/uma-rs-resteasy/src/main/java/io/jans/ca/rs/protect/resteasy/ServiceProvider.java deleted file mode 100644 index 7aca57e80ff..00000000000 --- a/jans-client-api/uma-rs-resteasy/src/main/java/io/jans/ca/rs/protect/resteasy/ServiceProvider.java +++ /dev/null @@ -1,169 +0,0 @@ -package io.jans.ca.rs.protect.resteasy; - -import io.jans.as.client.uma.*; -import io.jans.as.model.uma.UmaMetadata; -import org.apache.commons.lang.StringUtils; -import org.apache.http.client.HttpClient; -import org.apache.http.client.config.CookieSpecs; -import org.apache.http.client.config.RequestConfig; -import org.apache.http.conn.ssl.NoopHostnameVerifier; -import org.apache.http.conn.ssl.SSLConnectionSocketFactory; -import org.apache.http.conn.ssl.TrustSelfSignedStrategy; -import org.apache.http.impl.client.HttpClientBuilder; -import org.apache.http.impl.client.HttpClients; -import org.apache.http.impl.conn.PoolingHttpClientConnectionManager; -import org.apache.http.ssl.SSLContextBuilder; -import org.apache.log4j.Logger; -import org.jboss.resteasy.client.jaxrs.engines.ApacheHttpClient43Engine; - -import javax.net.ssl.HostnameVerifier; -import javax.net.ssl.SSLContext; -import java.security.KeyManagementException; -import java.security.KeyStoreException; -import java.security.NoSuchAlgorithmException; - -/** - * @author Yuriy Zabrovarnyy - */ - -public class ServiceProvider { - - public static final String WELL_KNOWN_UMA_PATH = "/.well-known/uma2-configuration"; - - private static final Logger LOG = Logger.getLogger(ServiceProvider.class); - - private final String opHost; - - private ApacheHttpClient43Engine engine; - - private UmaMetadata umaMetadata = null; - private UmaTokenService tokenService; - private UmaMetadataService metadataService = null; - private UmaResourceService resourceService = null; - private UmaPermissionService permissionService; - private UmaRptIntrospectionService rptIntrospectionService; - - /** - * @param opHost opHost (example: https://ophost.com) - * @throws KeyStoreException - * @throws NoSuchAlgorithmException - * @throws KeyManagementException - */ - public ServiceProvider(String opHost) throws KeyManagementException, NoSuchAlgorithmException, KeyStoreException { - this(opHost, true); - } - - public ServiceProvider(String opHost, boolean trustAll) throws KeyManagementException, NoSuchAlgorithmException, KeyStoreException { - this(opHost, trustAll ? createAcceptSelfSignedCertificateClient() : createClient()); - } - - public ServiceProvider(String opHost, HttpClient httpClient) { - this.opHost = opHost; - this.engine = new ApacheHttpClient43Engine(httpClient); - } - - public synchronized UmaRptIntrospectionService getRptIntrospectionService() { - if (rptIntrospectionService == null) { - rptIntrospectionService = UmaClientFactory.instance().createRptStatusService(umaMetadata, engine); - } - return rptIntrospectionService; - } - - public synchronized UmaMetadataService getMetadataService() { - if (metadataService == null) { - metadataService = UmaClientFactory.instance().createMetadataService(opHost + WELL_KNOWN_UMA_PATH, engine); - } - return metadataService; - } - - public synchronized UmaMetadata getUmaMetadata() { - if (umaMetadata == null) { - umaMetadata = getMetadataService().getMetadata(); - LOG.trace("UMA discovery:" + umaMetadata); - } - return umaMetadata; - } - - public synchronized UmaResourceService getResourceService() { - if (resourceService == null) { - resourceService = UmaClientFactory.instance().createResourceService(getUmaMetadata(), engine); - } - - return resourceService; - } - - public synchronized UmaPermissionService getPermissionService() { - if (permissionService == null) { - permissionService = UmaClientFactory.instance().createPermissionService(getUmaMetadata(), engine); - } - - return permissionService; - } - - public synchronized UmaTokenService getTokenService() { - if (tokenService == null) { - tokenService = UmaClientFactory.instance().createTokenService(getUmaMetadata(), engine); - } - - return tokenService; - } - - public String getOpHost() { - return opHost; - } - - public String opHostWithoutProtocol() { - if (StringUtils.contains(opHost, "//")) { - return StringUtils.substringAfter(opHost, "//"); - } - return opHost; - } - - public ApacheHttpClient43Engine getClientEngine() { - return engine; - } - - private static HttpClient createClient() { - return createClient(null); - } - - private static HttpClient createAcceptSelfSignedCertificateClient() - throws KeyManagementException, NoSuchAlgorithmException, KeyStoreException { - SSLConnectionSocketFactory connectionFactory = createAcceptSelfSignedSocketFactory(); - - return createClient(connectionFactory); - } - - private static HttpClient createClient(SSLConnectionSocketFactory connectionFactory) { - PoolingHttpClientConnectionManager cm = new PoolingHttpClientConnectionManager(); - HttpClientBuilder httClientBuilder = HttpClients.custom(); - if (connectionFactory != null) { - httClientBuilder = httClientBuilder.setSSLSocketFactory(connectionFactory); - } - - HttpClient httpClient = httClientBuilder - .setDefaultRequestConfig(RequestConfig.custom().setCookieSpec(CookieSpecs.STANDARD).build()) - .setConnectionManager(cm).build(); - cm.setMaxTotal(200); // Increase max total connection to 200 - cm.setDefaultMaxPerRoute(20); // Increase default max connection per route to 20 - - return httpClient; - } - - private static SSLConnectionSocketFactory createAcceptSelfSignedSocketFactory() - throws NoSuchAlgorithmException, KeyManagementException, KeyStoreException { - // Use the TrustSelfSignedStrategy to allow Self Signed Certificates - SSLContext sslContext = SSLContextBuilder.create().loadTrustMaterial(new TrustSelfSignedStrategy()).build(); - - // We can optionally disable hostname verification. - // If you don't want to further weaken the security, you don't have to include this. - HostnameVerifier allowAllHosts = new NoopHostnameVerifier(); - - // Create an SSL Socket Factory to use the SSLContext with the trust self signed certificate strategy - // and allow all hosts verifier. - SSLConnectionSocketFactory connectionFactory = new SSLConnectionSocketFactory(sslContext, allowAllHosts); - - return connectionFactory; - } - -} diff --git a/jans-client-api/uma-rs-resteasy/src/test/java/io/jans/ca/rs/protect/resteasy/ConfigurationLoaderTest.java b/jans-client-api/uma-rs-resteasy/src/test/java/io/jans/ca/rs/protect/resteasy/ConfigurationLoaderTest.java deleted file mode 100644 index 1ad6e397db4..00000000000 --- a/jans-client-api/uma-rs-resteasy/src/test/java/io/jans/ca/rs/protect/resteasy/ConfigurationLoaderTest.java +++ /dev/null @@ -1,26 +0,0 @@ -package io.jans.ca.rs.protect.resteasy; - -import org.testng.annotations.Test; - -import java.io.InputStream; - -import static org.testng.Assert.assertEquals; - -/** - * @author Yuriy Zabrovarnyy - * @version 0.9, 20/04/2016 - */ - -public class ConfigurationLoaderTest { - - @Test - public void load() { - InputStream inputStream = ClassLoader.getSystemClassLoader().getResourceAsStream("configuration.json"); - Configuration configuration = ConfigurationLoader.loadFromJson(inputStream); - - assertEquals("https://ce-dev.gluu.org", configuration.getOpHost()); - assertEquals("1234-1234", configuration.getUmaPatClientId()); - assertEquals("client_secret", configuration.getUmaPatClientSecret()); - } - -} diff --git a/jans-client-api/uma-rs-resteasy/src/test/java/io/jans/ca/rs/protect/resteasy/KeyTest.java b/jans-client-api/uma-rs-resteasy/src/test/java/io/jans/ca/rs/protect/resteasy/KeyTest.java deleted file mode 100644 index 70b7cf1bf30..00000000000 --- a/jans-client-api/uma-rs-resteasy/src/test/java/io/jans/ca/rs/protect/resteasy/KeyTest.java +++ /dev/null @@ -1,22 +0,0 @@ -package io.jans.ca.rs.protect.resteasy; - -import com.google.common.collect.Lists; -import org.testng.annotations.Test; - -import static org.testng.Assert.assertEquals; - - -/** - * @author Yuriy Zabrovarnyy - * @version 0.9, 19/04/2016 - */ - -public class KeyTest { - - @Test - public void name() { - Key key = new Key("/photo", Lists.newArrayList("GET", "POST")); - - assertEquals("[GET, POST] /photo", key.getResourceName()); - } -} diff --git a/jans-client-api/uma-rs-resteasy/src/test/resources/configuration.json b/jans-client-api/uma-rs-resteasy/src/test/resources/configuration.json deleted file mode 100644 index af8111ea019..00000000000 --- a/jans-client-api/uma-rs-resteasy/src/test/resources/configuration.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "op_host":"https://ce-dev.gluu.org", - "pat_client_id":"1234-1234", - "pat_client_secret":"client_secret", - "trust_all":false -} \ No newline at end of file diff --git a/jans-client-api/uma-rs-resteasy/src/test/resources/simple.json b/jans-client-api/uma-rs-resteasy/src/test/resources/simple.json deleted file mode 100644 index a173c17ea34..00000000000 --- a/jans-client-api/uma-rs-resteasy/src/test/resources/simple.json +++ /dev/null @@ -1,35 +0,0 @@ -{"resources":[ - { - "path":"/photo", - "conditions":[ - { - "httpMethods":["GET"], - "scopes":[ - "http://photoz.example.com/dev/actions/view" - ] - }, - { - "httpMethods":["PUT", "POST"], - "scopes":[ - "http://photoz.example.com/dev/actions/all", - "http://photoz.example.com/dev/actions/add" - ], - "ticketScopes":[ - "http://photoz.example.com/dev/actions/add" - ] - } - ] - }, - { - "path":"/document", - "conditions":[ - { - "httpMethods":["GET"], - "scopes":[ - "http://photoz.example.com/dev/actions/view" - ] - } - ] - } -] -} \ No newline at end of file diff --git a/jans-client-api/uma-rs-resteasy/src/test/resources/testng.xml b/jans-client-api/uma-rs-resteasy/src/test/resources/testng.xml deleted file mode 100644 index b5d3e38ad32..00000000000 --- a/jans-client-api/uma-rs-resteasy/src/test/resources/testng.xml +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - - - - diff --git a/jans-config-api/pom.xml b/jans-config-api/pom.xml index e190113283e..a765252e2f3 100644 --- a/jans-config-api/pom.xml +++ b/jans-config-api/pom.xml @@ -209,17 +209,6 @@ - - io.jans - jans-client-api - ${jans.version} - - - org.jboss.resteasy - * - - - io.jans jans-orm-annotation diff --git a/jans-linux-setup/jans_setup/jans_setup.py b/jans-linux-setup/jans_setup/jans_setup.py index f3598a012cf..d214e9548bd 100755 --- a/jans-linux-setup/jans_setup/jans_setup.py +++ b/jans-linux-setup/jans_setup/jans_setup.py @@ -128,7 +128,6 @@ def ami_packaged(): from setup_app.installers.jans_cli import JansCliInstaller from setup_app.installers.rdbm import RDBMInstaller # from setup_app.installers.oxd import OxdInstaller -from setup_app.installers.client_api import ClientApiInstaller if base.snap: @@ -242,7 +241,7 @@ def ami_packaged(): fidoInstaller = FidoInstaller() scimInstaller = ScimInstaller() elevenInstaller = ElevenInstaller() - client_api_installer = ClientApiInstaller() + jansCliInstaller = JansCliInstaller() # oxdInstaller = OxdInstaller() @@ -414,10 +413,6 @@ def do_installation(): not Config.installed_instance and Config.get(elevenInstaller.install_var)): elevenInstaller.start_installation() - if (Config.installed_instance and client_api_installer.install_var in Config.addPostSetupService) or ( - not Config.installed_instance and Config.get(client_api_installer.install_var)): - client_api_installer.start_installation() - if Config.install_jans_cli: jansCliInstaller.start_installation() diff --git a/jans-linux-setup/jans_setup/schema/jans_schema.json b/jans-linux-setup/jans_setup/schema/jans_schema.json index 56729fca71b..bb3915f37af 100644 --- a/jans-linux-setup/jans_setup/schema/jans_schema.json +++ b/jans-linux-setup/jans_setup/schema/jans_schema.json @@ -3083,17 +3083,6 @@ "syntax": "1.3.6.1.4.1.1466.115.121.1.15", "x_origin": "Jans created attribute" }, - { - "desc": "Relying Party Id for jans-client-api", - "equality": "caseIgnoreMatch", - "names": [ - "rpId" - ], - "oid": "jansAttr", - "substr": "caseIgnoreSubstringsMatch", - "syntax": "1.3.6.1.4.1.1466.115.121.1.15", - "x_origin": "Jans created attribute" - }, { "desc": "Details of a running agama flow instance", "equality": "caseIgnoreMatch", @@ -4104,27 +4093,6 @@ ], "x_origin": "Jans created objectclass" }, - { - "kind": "STRUCTURAL", - "may": [ - "rpId", - "dat", - "iat", - "exp", - "jansTyp" - ], - "must": [ - "objectclass" - ], - "names": [ - "rpExpiredObject" - ], - "oid": "jansObjClass", - "sup": [ - "top" - ], - "x_origin": "Jans created objectclass" - }, { "kind": "STRUCTURAL", "may": [ diff --git a/jans-linux-setup/jans_setup/setup_app/config.py b/jans-linux-setup/jans_setup/setup_app/config.py index afd2610eec6..27ce7a2a024 100644 --- a/jans-linux-setup/jans_setup/setup_app/config.py +++ b/jans-linux-setup/jans_setup/setup_app/config.py @@ -204,7 +204,6 @@ def progress(self, service_name, msg, incr=False): self.install_jans_cli = True self.loadTestData = False self.allowPreReleasedFeatures = False - self.install_client_api = True # backward compatibility self.os_type = base.os_type @@ -228,7 +227,6 @@ def progress(self, service_name, msg, incr=False): self.cache_provider_type = 'NATIVE_PERSISTENCE' self.java_type = 'jre' - self.client_api_storage_type = 'jans_server_configuration' self.hostname = None self.ip = None diff --git a/jans-linux-setup/jans_setup/setup_app/data/jetty_app_configuration.json b/jans-linux-setup/jans_setup/setup_app/data/jetty_app_configuration.json index f0ee58cac86..74d37bd4acb 100644 --- a/jans-linux-setup/jans_setup/setup_app/data/jetty_app_configuration.json +++ b/jans-linux-setup/jans_setup/setup_app/data/jetty_app_configuration.json @@ -3,7 +3,7 @@ "memory": { "max_allowed_mb": 2048, "jvm_heap_ration": 0.7, - "ratio": 0.2 + "ratio": 0.25 }, "jetty": { "modules": "server,deploy,annotations,resources,http,http-forwarded,threadpool,console-capture,jsp,websocket" @@ -15,7 +15,7 @@ "memory": { "max_allowed_mb": 512, "jvm_heap_ration": 0.7, - "ratio": 0.15 + "ratio": 0.20 }, "jetty": { "modules": "server,deploy,resources,http,http-forwarded,threadpool,console-capture,jsp" @@ -51,24 +51,12 @@ "memory": { "max_allowed_mb": 1024, "jvm_heap_ration": 0.7, - "ratio": 0.15 + "ratio": 0.20 }, "jetty": { "modules": "server,deploy,resources,http,http-forwarded,console-capture,jsp,websocket" }, "installed": false, "name": "jans-config-api" - }, - "jans-client-api": { - "memory": { - "max_allowed_mb": 1024, - "jvm_heap_ration": 0.7, - "ratio": 0.15 - }, - "jetty": { - "modules": "server,deploy,annotations,webapp,servlet,resources,http,http-forwarded,threadpool,jsp,websocket,logging/slf4j,logging-jetty" - }, - "installed": false, - "name": "jans-client-api" } } diff --git a/jans-linux-setup/jans_setup/setup_app/installers/client_api.py b/jans-linux-setup/jans_setup/setup_app/installers/client_api.py deleted file mode 100644 index 9d3f646f517..00000000000 --- a/jans-linux-setup/jans_setup/setup_app/installers/client_api.py +++ /dev/null @@ -1,70 +0,0 @@ -import os -import json - -from setup_app.static import AppType, InstallOption -from setup_app.utils import base -from setup_app.config import Config -from setup_app.installers.jetty import JettyInstaller - - -class ClientApiInstaller(JettyInstaller): - source_files = [ - (os.path.join(Config.dist_jans_dir, 'jans-client-api.war'), os.path.join(base.current_app.app_info['JANS_MAVEN'], 'maven/io/jans/jans-client-api-server/{0}/jans-client-api-server-{0}.war').format(base.current_app.app_info['ox_version'])), - ] - - def __init__(self): - setattr(base.current_app, self.__class__.__name__, self) - self.service_name = 'jans-client-api' - self.needdb = True # we don't need backend connection in this class - self.app_type = AppType.SERVICE - self.install_type = InstallOption.OPTONAL - self.install_var = 'install_client_api' - self.register_progess() - - self.templates_folder = os.path.join(Config.templateFolder, self.service_name) - self.output_folder = os.path.join(Config.output_dir,self.service_name) - self.jetty_dir = os.path.join(self.jetty_base, self.service_name) - self.dynamic_conf_json = os.path.join(self.output_folder, 'dynamic-conf.json') - self.config_ldif_fn = os.path.join(self.output_folder, 'configuration.ldif') - self.load_ldif_files = [self.config_ldif_fn] - self.data_dir = os.path.join(self.jetty_dir, 'data/rp_db') - - def install(self): - - self.installJettyService(self.jetty_app_configuration[self.service_name], True) - self.logIt("Copying fido.war into jetty webapps folder...") - jettyServiceWebapps = os.path.join(self.jetty_dir, 'webapps') - self.copyFile(self.source_files[0][0], jettyServiceWebapps) - - self.enable() - - - def generate_configuration(self): - suffix = 'client_api' - Config.templateRenderingDict['client_api_keystore_fn'] = os.path.join(Config.certFolder, suffix+'.jks') - Config.client_api_key_pass = self.getPW() - Config.templateRenderingDict['client_api_keystore_pw'] = Config.client_api_key_pass - key_fn, csr_fn, cert_fn = self.gen_cert(suffix, Config.client_api_key_pass, 'jetty') - self.import_key_cert_into_keystore(suffix, Config.templateRenderingDict['client_api_keystore_fn'], Config.client_api_key_pass, key_fn, cert_fn) - - def create_folders(self): - for d in (self.output_folder, self.data_dir): - if not os.path.exists(d): - self.createDirs(d) - - self.chown(self.jetty_dir, Config.jetty_user, Config.jetty_group) - - def render_import_templates(self): - Config.templateRenderingDict['client_api_crypto_provider_fn'] = os.path.join(Config.certFolder, 'client-api-jwks.keystore') - self.renderTemplateInOut(self.dynamic_conf_json, self.templates_folder, self.output_folder) - - dynamic_conf_json = base.readJsonFile(self.dynamic_conf_json, ordered=True) - dynamic_conf_json['storageConfiguration'] = {'dbFileLocation': self.data_dir} if Config.client_api_storage_type == 'h2' else {} - dynamic_conf_json_str = json.dumps(dynamic_conf_json, indent=2) - self.writeFile(self.dynamic_conf_json, dynamic_conf_json_str, backup=False) - - Config.templateRenderingDict['client_api_dynamic_conf_base64'] = self.generate_base64_file(self.dynamic_conf_json, 1) - self.renderTemplateInOut(self.config_ldif_fn, self.templates_folder, self.output_folder) - self.dbUtils.import_ldif(self.load_ldif_files) - - diff --git a/jans-linux-setup/jans_setup/setup_app/installers/jans.py b/jans-linux-setup/jans_setup/setup_app/installers/jans.py index 31e7c537037..74e737b4e70 100644 --- a/jans-linux-setup/jans_setup/setup_app/installers/jans.py +++ b/jans-linux-setup/jans_setup/setup_app/installers/jans.py @@ -74,7 +74,6 @@ def __repr__(self): if Config.profile == 'jans': txt += 'Install Fido2 Server'.ljust(30) + repr(Config.installFido2).rjust(35) + (' *' if 'installFido2' in Config.addPostSetupService else '') + "\n" txt += 'Install Scim Server'.ljust(30) + repr(Config.install_scim_server).rjust(35) + (' *' if 'install_scim_server' in Config.addPostSetupService else '') + "\n" - txt += 'Install Jans Client API'.ljust(30) + repr(Config.install_client_api).rjust(35) + (' *' if 'install_client_api' in Config.addPostSetupService else '') + "\n" #txt += 'Install Oxd '.ljust(30) + repr(Config.installOxd).rjust(35) + (' *' if 'installOxd' in Config.addPostSetupService else '') + "\n" if Config.profile == 'jans' and Config.installEleven: diff --git a/jans-linux-setup/jans_setup/setup_app/installers/jetty.py b/jans-linux-setup/jans_setup/setup_app/installers/jetty.py index bd45bfe0ec8..468ca3dcff4 100644 --- a/jans-linux-setup/jans_setup/setup_app/installers/jetty.py +++ b/jans-linux-setup/jans_setup/setup_app/installers/jetty.py @@ -346,7 +346,6 @@ def calculate_selected_aplications_memory(self): ('installFido2', 'jans-fido2'), ('install_config_api', 'jans-config-api'), ('installEleven', 'jans-eleven'), - ('install_client_api', 'jans-client-api'), ]: if Config.get(config_var) and service in self.jetty_app_configuration: diff --git a/jans-linux-setup/jans_setup/setup_app/utils/properties_utils.py b/jans-linux-setup/jans_setup/setup_app/utils/properties_utils.py index 5274ee1c98c..a2c951cea18 100644 --- a/jans-linux-setup/jans_setup/setup_app/utils/properties_utils.py +++ b/jans-linux-setup/jans_setup/setup_app/utils/properties_utils.py @@ -606,23 +606,6 @@ def promptForConfigApi(self): Config.addPostSetupService.append('install_config_api') - def prompt_for_client_api(self): - - prompt = self.getPrompt("Install Jans Client API?", - self.getDefaultOption(Config.install_client_api) - )[0].lower() - - Config.install_client_api = prompt == 'y' - - if Config.installed_instance and Config.install_client_api: - Config.addPostSetupService.append('install_client_api') - - if Config.install_client_api: - prompt = self.getPrompt(" Use Jans Storage for Client API?", 'y')[0].lower() - if prompt == 'n': - Config.client_api_storage_type = 'h2' - - def prompt_for_rdbm(self): while True: Config.rdbm_type = self.getPrompt("RDBM Type", Config.rdbm_type) @@ -947,7 +930,6 @@ def promptForProperties(self): self.promptForScimServer() self.promptForFido2Server() #self.promptForEleven() - self.prompt_for_client_api() #if (not Config.installOxd) and Config.oxd_package: # self.promptForOxd() diff --git a/jans-linux-setup/jans_setup/static/system/systemd/jans-client-api.service b/jans-linux-setup/jans_setup/static/system/systemd/jans-client-api.service deleted file mode 100644 index 31b96ffe00d..00000000000 --- a/jans-linux-setup/jans_setup/static/system/systemd/jans-client-api.service +++ /dev/null @@ -1,13 +0,0 @@ -[Unit] -Description=Janssen Client API service -After=jans-auth.service - -[Service] -Type=forking -ExecStart=/opt/dist/scripts/jans-client-api start -ExecStop=/opt/dist/scripts/jans-client-api stop -User=jetty -Group=jetty - -[Install] -WantedBy=multi-user.target diff --git a/jans-linux-setup/jans_setup/templates/apache/https_jans.conf b/jans-linux-setup/jans_setup/templates/apache/https_jans.conf index bd5fc3d9131..db93208e43a 100644 --- a/jans-linux-setup/jans_setup/templates/apache/https_jans.conf +++ b/jans-linux-setup/jans_setup/templates/apache/https_jans.conf @@ -86,12 +86,6 @@ Allow from all - - ProxyPass http://localhost:8076/jans-client-api retry=5 connectiontimeout=60 timeout=60 - Order deny,allow - Allow from all - - ProxyPass http://localhost:8075/jans-eleven retry=5 connectiontimeout=60 timeout=60 Order deny,allow diff --git a/jans-linux-setup/jans_setup/templates/jans-client-api/configuration.ldif b/jans-linux-setup/jans_setup/templates/jans-client-api/configuration.ldif deleted file mode 100644 index 2733be184e5..00000000000 --- a/jans-linux-setup/jans_setup/templates/jans-client-api/configuration.ldif +++ /dev/null @@ -1,6 +0,0 @@ -dn:ou=jans-client-api,ou=configuration,o=jans -jansConfDyn:: %(client_api_dynamic_conf_base64)s -jansRevision: 1 -objectClass: top -objectClass: jansAppConf -ou: jans-client-api diff --git a/jans-linux-setup/jans_setup/templates/jans-client-api/dynamic-conf.json b/jans-linux-setup/jans_setup/templates/jans-client-api/dynamic-conf.json deleted file mode 100644 index 6a0589905dc..00000000000 --- a/jans-linux-setup/jans_setup/templates/jans-client-api/dynamic-conf.json +++ /dev/null @@ -1,92 +0,0 @@ -{ - "loggingLevel":"INFO", - "loggingLayout":"text", - "externalLoggerConfiguration":"", - "disableJdkLogger":true, - "trustAllCerts": true, - "keyStorePath":"%(client_api_keystore_fn)s", - "keyStorePassword":"%(client_api_keystore_pw)s", - "enableJwksGeneration": true, - "jwksExpirationInHours": 2400, - "jwksRegenerationIntervalInHours": 720, - "cryptProviderKeyStorePath": "%(client_api_crypto_provider_fn)s", - "cryptProviderKeyStorePassword": "example", - "cryptProviderDnName": "CN=jans-client CA Certificates", - "mtlsEnabled": false, - "mtlsClientKeyStorePath": "", - "mtlsClientKeyStorePassword": "", - "bindIpAddresses":["*"], - "storage": "%(client_api_storage_type)s", - "storageConfiguration":{ - }, - "migrationSourceFolderPath":"", - "addClientCredentialsGrantTypeAutomaticallyDuringClientRegistration":false, - "uma2AutoRegisterClaimsGatheringEndpointAsRedirectUriOfClient": false, - "supportGoogleLogout": true, - "fapiEnabled": false, - "dbCleanupIntervalInHours": 1, - "stateExpirationInMinutes": 10, - "nonceExpirationInMinutes": 10, - "encodeStateFromRequestParameter": false, - "encodeNonceFromRequestParameter": false, - "rpCacheExpirationInMinutes": 60, - "idTokenValidationCHashRequired": true, - "idTokenValidationAtHashRequired": true, - "acceptIdTokenWithoutSignature": true, - "validateUserInfoWithIdToken": true, - "encodeClientIdInAuthorizationUrl": true, - "defaultSiteConfig":{ - "op_configuration_endpoint":"", - "response_types":["code"], - "grant_type":["authorization_code"], - "acr_values":[""], - "scope":["openid", "profile", "email"], - "ui_locales":["en"], - "claims_locales":["en"], - "contacts":[], - "redirect_uris":[], - "logout_redirect_uris":[], - "client_name":"", - "client_jwks_uri":"", - "token_endpoint_auth_method":"", - "token_endpoint_auth_signing_alg":"", - "request_uris":[], - "front_channel_logout_uri":"", - "sector_identifier_uri":"", - "claims_redirect_uri":[], - "client_id":"", - "client_secret":"", - "trusted_client":false, - "access_token_as_jwt":false, - "access_token_signing_alg":"", - "rpt_as_jwt":false, - "logo_uri":"", - "client_uri":"", - "policy_uri":"", - "front_channel_logout_session_required":false, - "tos_uri":"", - "jwks":"", - "id_token_binding_cnf":"", - "tls_client_auth_subject_dn":"", - "run_introspection_script_beforeaccess_token_as_jwt_creation_and_include_claims":false, - "id_token_signed_response_alg":"", - "id_token_encrypted_response_alg":"", - "id_token_encrypted_response_enc":"", - "user_info_signed_response_alg":"", - "user_info_encrypted_response_alg":"", - "user_info_encrypted_response_enc":"", - "request_object_signing_alg":"", - "request_object_encryption_alg":"", - "request_object_encryption_enc":"", - "default_max_age":null, - "require_auth_time":false, - "initiate_login_uri":"", - "authorized_origins":[], - "access_token_lifetime":null, - "software_id":"", - "software_version":"", - "software_statement":"", - "custom_attributes":{} - } -} - diff --git a/jans-linux-setup/jans_setup/templates/jans.properties b/jans-linux-setup/jans_setup/templates/jans.properties index 08ae1053b47..ed8abbf494f 100644 --- a/jans-linux-setup/jans_setup/templates/jans.properties +++ b/jans-linux-setup/jans_setup/templates/jans.properties @@ -4,7 +4,6 @@ jansAuth_ConfigurationEntryDN=ou=jans-auth,ou=configuration,o=jans fido2_ConfigurationEntryDN=ou=jans-fido2,ou=configuration,o=jans scim_ConfigurationEntryDN=ou=jans-scim,ou=configuration,o=jans configApi_ConfigurationEntryDN=ou=jans-config-api,ou=configuration,o=jans -clientApi_ConfigurationEntryDN=ou=jans-client-api,ou=configuration,o=jans certsDir=%(certFolder)s confDir= diff --git a/jans-linux-setup/jans_setup/templates/scopes.ldif b/jans-linux-setup/jans_setup/templates/scopes.ldif index c011567b85e..931b927ff12 100644 --- a/jans-linux-setup/jans_setup/templates/scopes.ldif +++ b/jans-linux-setup/jans_setup/templates/scopes.ldif @@ -119,17 +119,6 @@ jansScopeTyp: openid objectClass: top objectClass: jansScope -dn: inum=6D90,ou=scopes,o=jans -description: jans_client_api scope which is required to call jans_client_api API -displayName: jans_client_api -inum: 6D90 -jansAttrs: {"spontaneousClientId":"","spontaneousClientScopes":[],"showInConfigurationEndpoint":true} -jansDefScope: true -jansId: jans_client_api -jansScopeTyp: openid -objectClass: top -objectClass: jansScope - dn: inum=7D90,ou=scopes,o=jans description: revoke_session scope which is required to be able call /revoke_session endpoint displayName: revoke_session diff --git a/mkdocs.yml b/mkdocs.yml index 6c3966f07c5..f6ed0b1cbb6 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -417,7 +417,6 @@ nav: - 'Auth Server': 'admin/reference/json/auth-server.md' - 'FIDO': 'admin/reference/json/fido.md' - 'SCIM': 'admin/reference/json/scim.md' - - 'Client API': 'admin/reference/json/client-api.md' - 'Config API': 'admin/reference/json/config-api.md' - 'Kubernetes': - 'admin/reference/kubernetes/README.md' @@ -430,7 +429,6 @@ nav: - 'Config API': 'admin/reference/kubernetes/image-config-api.md' - 'FIDO': 'admin/reference/kubernetes/image-fido.md' - 'SCIM': 'admin/reference/kubernetes/image-scim.md' - - 'Client API': 'admin/reference/kubernetes/image-client-api.md' - 'Persistence': 'admin/reference/kubernetes/image-persistence.md' - 'Cert Manager': 'admin/reference/kubernetes/image-cert-mgr.md' - 'Gluu OpenDJ': 'admin/reference/kubernetes/image-opendj.md' @@ -491,17 +489,6 @@ nav: - 'Docusign': 'admin/integration/saas/docusign.md' - 'Gluu Casa': 'admin/integration/casa.md' - 'FAQ': 'admin/integration/integration-faq.md' - - 'Client API Admin Guide': - - 'admin/client-api/README.md' - - 'OAuth Features': 'admin/client-api/oauth-features.md' - - 'OpenID Connect Features': 'admin/client-api/oidc-features.md' - - 'UMA Features': 'admin/client-api/uma-features.md' - - 'SIOP Features': 'admin/client-api/siop-features.md' - - 'Configuration': 'admin/client-api/config.md' - - 'Logs': 'admin/client-api/logs.md' - - 'Monitoring': 'admin/client-api/monitoring.md' - - 'Key Management': 'admin/client-api/key-mgt.md' - - 'SDKs': 'admin/client-api/sdks.md' - 'Config API Admin Guide': - 'admin/config-api/README.md' - 'Configuration': 'admin/config-api/config.md' @@ -667,7 +654,6 @@ nav: - 'Agama': 'developer/implementation-design/agama.md' - 'jans-auth-server': 'developer/implementation-design/jans-auth-server.md' - 'jans-cli': 'developer/implementation-design/jans-cli.md' - - 'jans-client-api': 'developer/implementation-design/jans-client-api.md' - 'jans-config-api': 'developer/implementation-design/jans-config-api.md' - 'jans-core': 'developer/implementation-design/jans-core.md' - 'jans-eleven': 'developer/implementation-design/jans-eleven.md'