{"id":16348449,"url":"https://github.com/tivac/aws-sig","last_synced_at":"2025-03-16T15:31:22.997Z","repository":{"id":29394118,"uuid":"119941507","full_name":"tivac/aws-sig","owner":"tivac","description":"🔏 AWS sigv4, optimized for size","archived":false,"fork":false,"pushed_at":"2024-10-01T18:51:47.000Z","size":1420,"stargazers_count":7,"open_issues_count":4,"forks_count":3,"subscribers_count":4,"default_branch":"main","last_synced_at":"2024-10-12T00:52:12.949Z","etag":null,"topics":["aws","sigv4"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tivac.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-02-02T06:22:43.000Z","updated_at":"2024-10-01T18:51:43.000Z","dependencies_parsed_at":"2023-02-18T02:31:08.720Z","dependency_job_id":"6d258872-407b-4f94-8860-6f865a9e1089","html_url":"https://github.com/tivac/aws-sig","commit_stats":{"total_commits":326,"total_committers":5,"mean_commits":65.2,"dds":0.6411042944785277,"last_synced_commit":"87d2245729f3ff73ee53d282c20ece05a75bcca5"},"previous_names":[],"tags_count":14,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tivac%2Faws-sig","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tivac%2Faws-sig/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tivac%2Faws-sig/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tivac%2Faws-sig/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tivac","download_url":"https://codeload.github.com/tivac/aws-sig/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":221665313,"owners_count":16860216,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["aws","sigv4"],"created_at":"2024-10-11T00:52:08.503Z","updated_at":"2024-10-27T10:49:54.858Z","avatar_url":"https://github.com/tivac.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 🔏 aws-sig [![NPM Version](https://img.shields.io/npm/v/aws-sig.svg)](https://www.npmjs.com/package/aws-sig) [![NPM License](https://img.shields.io/npm/l/aws-sig.svg)](https://www.npmjs.com/package/aws-sig) [![NPM Downloads](https://img.shields.io/npm/dm/aws-sig.svg)](https://www.npmjs.com/package/aws-sig) [![Build Status](https://img.shields.io/endpoint.svg?url=https%3A%2F%2Factions-badge.atrox.dev%2Ftivac%2Faws-sig%2Fbadge%3Fref%3Dmain\u0026style=flat)](https://actions-badge.atrox.dev/tivac/aws-sig/goto?ref=main)\n\nTeeny-tiny library for signing requests to Amazon Web Services using the [signature v4 signing algorithm](https://docs.aws.amazon.com/general/latest/gr/signature-version-4.html). Supports signing requests via `Authorization` header or query params.\n\nNo serious, it's really small!\n\n![Bundle Size](http://img.badgesize.io/tivac/aws-sig/main/dist/aws-sig.umd.js?color=blue) ![Gzipped Bundle Size](http://img.badgesize.io/tivac/aws-sig/main/dist/aws-sig.umd.js?compression=gzip\u0026color=blue\u0026max=5000\u0026softmax=4000)\n\n## 🙋 Why?\n\nI wanted something small. Really, really small. Couldn't find a small AWS v4 signing library that worked in a browser using rollup for bundling so... here we are. ¯\\\\_(ツ)\\_/¯\n\n## ⚙️ How?\n\n```js\nimport { signedHeaders, signedQuery } from \"aws-sig\";\n\nconst config = {\n    accessKeyId     : \"AKIDEXAMPLE\",\n    secretAccessKey : \"wJalrXUtnFEMI/K7MDENG+bPxRfiCYEXAMPLEKEY\",\n\n    // sessionTokens are optional, but correctly supported\n    sessionToken    : \"...\"\n};\n\nconst request = {\n    // These can be part of the config object or the request object\n    region  : \"us-east-1\",\n    service : \"service\",\n    \n    method : \"GET\",\n    url    : \"https://my.aws.url.that.i.need.to.hit/look/it-has/a-path-in-it-as-well\",\n    \n    // Headers are optional\n    headers : {\n        // Single header value\n        \"X-Amz-Date\" : \"20150830T123600Z\",\n        \n        // Multiple headers\n        \"X-Multiple\" : [ \"one\", \"two\", \"three\" ]\n    }\n    // Body is optional, should be a string\n    body : \"...\"\n};\n\nconst signed = signedHeaders(request, config);\n\n/**\n * signed : {\n *     url : \"https://my.aws.url.that.i.need.to.hit/look/it-has/a-path-in-it-as-well\"\n *     method : \"GET\",\n *     headers : {\n *         X-Amz-Date : \"20150830T123600Z\",\n *         \"X-Multiple\" : [ \"one\", \"two\", \"three\" ],\n *         Authorization : \"...\",\n *     },\n *     body : \"...\",\n * }\n */\n\n// Signing queries is identical, just uses signedQuery() instead\nconst config = {\n    accessKeyId     : \"AKIDEXAMPLE\",\n    secretAccessKey : \"wJalrXUtnFEMI/K7MDENG+bPxRfiCYEXAMPLEKEY\",\n\n    // sessionTokens are optional, but correctly supported\n    sessionToken    : \"...\",\n\n    // These can be part of the config object or the request object\n    region  : \"us-east-1\",\n    service : \"service\",\n};\n\nconst request = {\n    url    : \"https://my.aws.url.that.i.need.to.hit/look/it-has/a-path-in-it-as-well\",\n};\n\nconst signed = signedQuery(request, config);\n\n/**\n * signed : {\n *     url : \"https://my.aws.url.that.i.need.to.hit/look/it-has/a-path-in-it-as-well?X-Amz-Algorithm=...\u0026X-Amz-Credential=...\"\n *     method : \"GET\",\n *     headers : {},\n *     body : undefined,\n * }\n */\n```\n\n## 🛁 What?\n\nSupports query params, date overrides via `X-Amz-Date` or `Date` headers, multiple header values, and probably some other features.\n\nTested against API Gateway so far. Your results may vary for other services, S3 seems especially fraught with peril. 💀\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftivac%2Faws-sig","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftivac%2Faws-sig","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftivac%2Faws-sig/lists"}