Using Digital Ocean Spaces and/or AWS S3 in Livecode

Bringing the internet highway into your project? Building FTP, HTTP, email, chat or other client solutions?

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
AlexM_Cogapp
Posts: 4
Joined: Thu Jul 30, 2015 3:39 pm

Using Digital Ocean Spaces and/or AWS S3 in Livecode

Post by AlexM_Cogapp » Wed Sep 03, 2025 2:14 pm

Does anyone have any experience using Digital Ocean Spaces in Livecode (or AWS S3)?

I would like to use this online storage service (or something similar) for a project but the authentication protocol of the API relies on SHA256 and HMAC encodings. What is needed is described in pseudo-code below.

I can't work out how to do this in Livecode.

Any help would be much appreciated.

******

canonicalRequest = `
${HTTPMethod}\n
${canonicalURI}\n
${canonicalQueryString}\n
${canonicalHeaders}\n
${signedHeaders}\n
${hashedPayload}
`

stringToSign = "AWS4-HMAC-SHA256" + "\n" +
date(format=ISO08601) + "\n" +
date(format=YYYYMMDD) + "/" + ${REGION} + "/" + "s3/aws4_request" + "\n" +
Hex(SHA256Hash(canonicalRequest))

dateKey = HMAC-SHA256("AWS4" + ${SECRET_KEY}, date(format=YYYYMMDD))
dateRegionKey = HMAC-SHA256(dateKey, ${REGION})
dateRegionServiceKey = HMAC-SHA256(dateRegionKey, "s3")
signingKey = HMAC-SHA256(dateRegionServiceKey, "aws4_request")

signature = Hex(HMAC-SHA256(signingKey, stringToSign))

Post Reply