vignettes/load-testing-authenticated-apps.Rmdload-testing-authenticated-apps.Rmdshinyloadtest supports load testing applications servedbyPositConnect with the following authentication configurations:
shinyloadtest::record_session will automatically detectwhen an application is protected using a supported authentication schemeand will prompt for a username and password.
Ifrecord_session is called from within an RStudio IDEsession, two UI dialogs will appear. If it’s called from an R session ina command-line setting, prompts will appear on standard output.
The supplied username and password are used for the duration of therecording to interact with the application, but these credentials arenot stored in the recording file.
Because credentials are not stored in recordings, a username andpassword or Posit Connect API Key must be supplied toshinycannon in order to load test authenticatedapplications.
shinycannon does not have--user,--password, or--connect-api-key arguments forsecurity reasons, so that these strings will not appear in a processlist. Instead, theSHINYCANNON_USER,SHINYCANNON_PASS, andSHINYCANNON_CONNECT_API_KEY environment variables must beset.SHINYCANNON_CONNECT_API_KEY will take preference overSHINYCANNON_USER andSHINYCANNON_PASS.
On Linux and macOS, you can disable history for any command thatstarts with a space. If using abash:
$ # Disable history for any command that starts with a space$ HISTCONTROL=ignoreboth$ export SHINYCANNON_USER=myUser$ export SHINYCANNON_PASS=myPass$$ shinycannon recording.log https://shinyapp.example.com/ --workers 5 --loaded-duration-minutes 2 --output-dir run1And if usingzsh:
$ # Disable history for any command that starts with a space$ setopt HIST_IGNORE_SPACE$ export SHINYCANNON_CONNECT_API_KEY=$CONNECT_API_KEY$$ shinycannon connect_recording.log https://connect.example.com/content/545/ --workers 5 --loaded-duration-minutes 2 --output-dir run2