Setting an idle web session timeout

Set a session timeout interval to define the amount of time a Planning Analytics Workspace login session can go unused before it is no longer valid.

Procedure

  1. Log in to the cluster command line.
  2. Create a patch.json file that will configure the idle web session timeout value.
    • If there are already configuration settings that are added directly in the wa-proxy deployment, create and run the following script:
      #!/usr/bin/env bash
      
      json_escape() {
        echo -n "$1" | jq -R .
      }
      
      TIMEOUT=$(oc get deployment wa-proxy -o jsonpath='{.spec.template.spec.containers[?(@.name=="wa-proxy")].env[?(@.name=="PROXY_TIMEOUT")].value}')
      SENDGRID_API_KEY=$(oc get deployment wa-proxy -o jsonpath='{.spec.template.spec.containers[?(@.name=="share-app")].env[?(@.name=="SENDGRID_API_KEY")].value}')
      EMAIL_FROM=$(oc get deployment wa-proxy -o jsonpath='{.spec.template.spec.containers[?(@.name=="share-app")].env[?(@.name=="EMAIL_FROM")].value}')
      EMAIL_SMTP_URL=$(oc get deployment wa-proxy -o jsonpath='{.spec.template.spec.containers[?(@.name=="share-app")].env[?(@.name=="EMAIL_SMTP_URL")].value}')
      
      PATCH='{
        "spec": {
          "common": {
            "app_name": "paw",
            "internal_domain_name": "svc.cluster.local",
            "proxy_timeout_seconds": '"$TIMEOUT"',
            "secure_session_cookie": true,
            "service_account": "zen-norbac-sa",
            "tm1_internal_type": true'
      
      if [[ -n "$EMAIL_SMTP_URL" ]]; then
        PATCH+=',"email_smtp_url": '$(json_escape "$EMAIL_SMTP_URL")
      fi
      if [[ -n "$EMAIL_FROM" ]]; then
        PATCH+=',"email_from": '$(json_escape "$EMAIL_FROM")
      fi
      if [[ -n "$SENDGRID_API_KEY" ]]; then
        PATCH+=',"send_grid_api_key": '$(json_escape "$SENDGRID_API_KEY")
      fi
      
      PATCH+='
          }
        }
      }'
      
      # Save to patch.json
      echo "$PATCH" > patch.json
      
      echo "Patch JSON saved to patch.json"
    • If you only need to configure the web session timeout, run the following command to create the patch.json file:
      cat > patch.json << 'EOF' { "spec": { "common": { "app_name": "paw", "internal_domain_name": "svc.cluster.local", \
      "proxy_timeout_seconds": 120, "secure_session_cookie": true, "service_account": "zen-norbac-sa", "tm1_internal_type": true } } } \
      EOF
    Update the proxy_timeout_seconds value to configure the web session timeout.
  3. Use the jq command to validate the patch.json file.
    jq . patch.json
  4. Use the oc patch command to update the PAServiceInstance CR.
    oc patch paserviceinstance PAServiceInstance -n ${PROJECT_CPD_INST_OPERANDS} --type=merge --patch-file=patch.json
  5. Use the oc get command to validate that the instance update is complete.
    oc get paserviceinstance PAServiceInstance -n ${PROJECT_CPD_INST_OPERANDS}

    The instance update is complete when the status is COMPLETED.