https://github.com/castle/zsh-test-suite
zsh scripts for testing out the Castle API functionality
https://github.com/castle/zsh-test-suite
Last synced: about 1 month ago
JSON representation
zsh scripts for testing out the Castle API functionality
- Host: GitHub
- URL: https://github.com/castle/zsh-test-suite
- Owner: castle
- Created: 2020-01-15T01:14:38.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2020-08-18T14:30:41.000Z (almost 6 years ago)
- Last Synced: 2025-01-10T20:44:28.652Z (over 1 year ago)
- Language: Shell
- Size: 10.7 KB
- Stars: 0
- Watchers: 11
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Castle Test Cases
This repository contains scripts to showcase Castle via various scenario tests using cURL.
They are intended to be run with zsh.
## Make the Dependencies Executable
There are several scripts in the `helpers` folder which must be made executable in order to be run as dependencies of the test case scripts:
```
chmod a+x ./helpers/*
```
## Running the Test Cases
First, set your CASTLE_API_SECRET in your local environment:
```
export CASTLE_API_SECRET={your api secret}
```
Run the test cases individually with zsh:
```
zsh ./forgetful_user.sh
```
### Usage of `/helpers` Scripts and Flags
The `authenticate.sh` and `track.sh` scripts in the `helpers` folder have flags that allow specifying event context data:
```
-e Event Name
-u User ID
-i Context IP Address
-b Context User Agent (b for Browser)
-h Context Headers
```
Example Use:
```
zsh ./helpers/track.sh -e '$login.failed' -u '1234' -i '11.11.11.11' -b 'Chrome_v1.11' -h '{"Accept": "text/html","Accept-Language":"en-us,en;q=0.5"}'
```