1# lws minimal secure streams sigv4 2 3The application put a test file to AWS S3, using sigv4 auth. 4 5It does it using Secure Streams... the streamtype is "s3PutObj", along with main 6are in ss-s3-main.c 7 8The handler for state changes and payloads for "s3PutObj" is in ss-s3-ss.c 9 10 11## metadata 12 "aws_region" and "aws_service" are configured through metadata. Also, at least 13 "x-amz-content-sha256:" and ""x-amz-date:" headers need to be in metadata. 14 15 16## credentials 17credentials are read from ~/.aws/credentials, make sure you have valid keyid and 18key. One need to call lws_ss_sigv4_set_aws_key() to plug in aws credentials into 19Secure Streams and the index need to be match of the "blob_index" in entry of "auth" 20the policy. In addition, you need to change the S3 bucket name to your own, as 21bucket name is unique globally in S3. 22 23 24## build 25 26``` 27 $ cmake . && make 28``` 29 30## usage 31 32 33``` 34[2020/12/19 15:25:06:9763] U: LWS minimal secure streams sigv4 35[2020/12/19 15:25:07:0768] U: ss_s3_state: LWSSSCS_CREATING, ord 0x0 36[2020/12/19 15:25:07:0769] U: ss_s3_state: LWSSSCS_POLL, ord 0x0 37[2020/12/19 15:25:07:0770] U: ss_s3_state: LWSSSCS_CONNECTING, ord 0x0 38[2020/12/19 15:25:07:2317] U: SS / TX Payload 39[2020/12/19 15:25:07:2317] U: SS / TX Payload Total = 1024, Pos = 0 40[2020/12/19 15:25:07:3267] U: ss_s3_state: LWSSSCS_CONNECTED, ord 0x0 41[2020/12/19 15:25:07:3267] U: ss_s3_state: LWSSSCS_QOS_ACK_REMOTE, ord 0x0 42[2020/12/19 15:25:07:3267] U: ss_s3_state: LWSSSCS_DISCONNECTED, ord 0x0 43[2020/12/19 15:25:07:3268] U: ss_s3_state: LWSSSCS_DESTROYING, ord 0x0 44[2020/12/19 15:25:07:3269] U: Completed: OK 45 46``` 47