{
	"info": {
		"_postman_id": "8f734a1a-77ae-4d85-9489-5a8e3dbda41d",
		"name": "AK/SK",
		"schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json",
		"_exporter_id": "43160616"
	},
	"item": [
		{
			"name": "example",
			"event": [
				{
					"listen": "prerequest",
					"script": {
						"exec": [
							"// ====== CONSTANT CONFIGURATIONS ======",
							"const ACCESS_KEY = \"your Access key\";",
							"const SECRET_KEY = \"your secret key\";",
							"const CLIENT_ID = \"your client id\";",
							"",
							"// ====== DYNAMIC PATH CONSTRUCTION ======",
							"const apiPath = '/' + pm.request.url.path.join('/'); // Auto-construct path segments",
							"",
							"// ====== TIMESTAMP GENERATION ======",
							"const requestTime = new Date().toISOString()",
							"    .replace(/\\.\\d+Z$/, 'Z')        // Remove millisecond precision",
							"    .replace('Z', '+0000');         // Convert to RFC 3339 format",
							"",
							"// ====== SIGNATURE CONSTRUCTION ======",
							"// Build canonical request payload",
							"const signatureContent = `POST ${apiPath}\\n${CLIENT_ID}.${requestTime}.${pm.request.body.raw}`;",
							"",
							"// Base64 URL-safe decoding for secret key",
							"const secretBytes = atob(SECRET_KEY.replace(/-/g, '+').replace(/_/g, '/'));",
							"",
							"// HMAC-SHA256 cryptographic operation",
							"const signature = CryptoJS.HmacSHA256(signatureContent, CryptoJS.enc.Latin1.parse(secretBytes))",
							"    .toString(CryptoJS.enc.Base64)",
							"    .replace(/\\+/g, '-')    // URL-safe character substitution",
							"    .replace(/\\//g, '_')",
							"    .replace(/=+$/, '');    // Remove base64 padding",
							"",
							"// Debugging outputs",
							"console.log(\"apiPath:\", apiPath);",
							"console.log(\"signatureContent:\", signatureContent);",
							"",
							"// ====== REQUEST HEADERS CONFIGURATION ======",
							"pm.request.headers.add({",
							"    key: \"Request-Time\",",
							"    value: requestTime",
							"});",
							"pm.request.headers.add({",
							"    key: \"Access-Key\",",
							"    value: ACCESS_KEY",
							"});",
							"pm.request.headers.add({",
							"    key: \"Client-Id\",",
							"    value: CLIENT_ID",
							"});",
							"pm.request.headers.add({",
							"    key: \"Auth-Type\",",
							"    value: \"AKSK\"  // Authentication scheme identifier",
							"});",
							"pm.request.headers.add({",
							"    key: \"Signature\",",
							"    value: signature",
							"});",
							"",
							"// Preserve existing Content-Type header",
							"pm.request.headers.upsert({",
							"    key: \"Content-Type\",",
							"    value: \"application/json; charset=UTF-8\"",
							"});",
							""
						],
						"type": "text/javascript",
						"packages": {}
					}
				}
			],
			"request": {
				"auth": {
					"type": "noauth"
				},
				"method": "POST",
				"header": [],
				"body": {
					"mode": "raw",
					"raw": "{\n\t\"title\": \"hello\",\n\t\"description\": \"just for demonstration.\"\n}",
					"options": {
						"raw": {
							"language": "json"
						}
					}
				},
				"url": {
					"raw": "https://{host}/api/v1/zoloz/authentication/test",
					"protocol": "https",
					"host": [
						"{host}"
					],
					"path": [
						"api",
						"v1",
						"zoloz",
						"authentication",
						"test"
					]
				}
			},
			"response": []
		}
	]
}