The `openssl`/`curl` command generator script in `rest_scripts` supports both unsigned streaming payload trailers and signed streaming requests. This update adds support for signed streaming requests with trailers (`STREAMING-AWS4-HMAC-SHA256-PAYLOAD-TRAILER`). **Usage** The script generates an OpenSSL command file, which is then used to send the request. Example: ```bash go run tests/rest_scripts/generateCommand.go \ --awsAccessKeyId access \ --awsSecretAccessKey secret \ --client openssl \ --commandType putObject \ --bucketName test \ --payload "hello" \ --payloadType STREAMING-UNSIGNED-PAYLOAD-TRAILER \ --chunkSize 8192 \ --objectKey obj \ --filePath req.txt \ --checksumType crc64nvme ``` You can then send the request with: ```bash openssl s_client -connect 127.0.0.1:7070 -ign_eof < req.txt > response.raw ```
REST scripts
Parameters
The common S3 parameters for the scripts can be found in rest.sh. They are:
- AWS_ACCESS_KEY_ID
- AWS_SECRET_ACCESS_KEY
- AWS_ENDPOINT_URL
- AWS_REGION
The OUTPUT_FILE parameter can be set to write the response data to a file.
Operation-specific parameters can be found by looking at the tops of the scripts. For example, for the CreateBucket operation, this would be BUCKET_NAME.
cURL
Most scripts will send a cURL message to an s3 server. The scripts all use the following parameters:
In the root folder, for example, the create_bucket.sh script can be run with:
AWS_ACCESS_KEY_ID=<key> AWS_SECRET_ACCESS_KEY=<key> AWS_ENDPOINT_URL=<url> AWS_REGION=<region> BUCKET_NAME=<name> OUTPUT_FILE=<file> ./tests/rest_scripts/create_bucket.sh
A successful bucket creation will return a 200 code on the command line.
openssl
Some scripts will generate a raw REST API message that can be sent via openssl.
For example, to create this file with put_object_openssl.sh:
AWS_ACCESS_KEY_ID=<key> AWS_SECRET_ACCESS_KEY=<key> AWS_ENDPOINT_URL=<url> AWS_REGION=<region> DATA_FILE=<data_file> BUCKET_NAME=<name> OBJECT_KEY=<desired key name> COMMAND_FILE=<output file> ./tests/rest_scripts/put_object_openssl.sh
This should generate a raw REST command file in the COMMAND_FILE location. This command can be sent to the S3 server with: openssl s_client -connect <server host and port> -ign_eof < <command file>