{"id":18657954,"url":"https://github.com/lightsofapollo/azure-sign","last_synced_at":"2025-11-05T22:30:24.905Z","repository":{"id":14057240,"uuid":"16760180","full_name":"lightsofapollo/azure-sign","owner":"lightsofapollo","description":"Azure Signing (for node.js) [table service sas \u0026 sharedKey]","archived":false,"fork":false,"pushed_at":"2014-05-09T08:34:48.000Z","size":1872,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-12-27T15:12:52.661Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/lightsofapollo.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-02-12T08:01:58.000Z","updated_at":"2014-05-09T08:34:48.000Z","dependencies_parsed_at":"2022-09-23T18:41:31.841Z","dependency_job_id":null,"html_url":"https://github.com/lightsofapollo/azure-sign","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lightsofapollo%2Fazure-sign","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lightsofapollo%2Fazure-sign/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lightsofapollo%2Fazure-sign/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lightsofapollo%2Fazure-sign/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lightsofapollo","download_url":"https://codeload.github.com/lightsofapollo/azure-sign/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239475960,"owners_count":19645041,"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":[],"created_at":"2024-11-07T07:30:47.834Z","updated_at":"2025-11-05T22:30:24.871Z","avatar_url":"https://github.com/lightsofapollo.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# azure-sign\n\nAzure signing utilities for node (just table service right now)\n\nThe goal is to provide a way to grant access keys to your azure resources\n(like querying a table from the browser) with a very small footprint.\n\n## Configuration\n\nLike the node azure client(s) the credentials are taken from environment variables by default:\n\n  - `AZURE_STORAGE_ACCOUNT` : used in the \"resource\" parameter\n  - `AZURE_STORAGE_ACCESS_KEY` : used to generate `sig` query parameter and sign the other params\n\nSee the [azure docs](http://msdn.microsoft.com/en-us/library/windowsazure/ee395415.aspx) for more details\n\n## Usage\n\nThe [tests](/*_test.js) are written in an end-to-end style see them\nfor actual usage (making calls to azure)\n\n### sas\n\n```js\nvar signTable = require('azure-sign/table');\n\nvar expires = new Date();\n// good for an hour\nexpires.setHours(expires.getHours() + 1);\n\n// sign a table resource\nvar queryParams = table.sas({\n  // this must be lowercase even if your table is uppercase, etc...\n  resource: 'tablename',\n\n  // allow reads\n  signedpermissions: 'r',\n\n  signedexpiry: expires\n});\n\n// query params is suitable for use in any table query that is supported\n// via reads\n\n// a quick example using superagent\n\nvar superagent = require('superagent');\n\nsuperagent.get('https://mytable.table.core.windows.net/mytable()').\n  query('$filter', '(PartitionKey eq \"mypartition\")').\n  // turn on json mode\n  set('Accept', 'application/json');\n  end(function(err, result) {\n    var json = result.res.body;\n  });\n```\n\n### sharedKey\n\n```js\nvar superagent = requrie('superagent');\nvar signTable = require('azure-sign/table');\n\nvar now = new Date().toUTCString();\nvar url = 'https://' + tableService.host + '/' + tableName + '()';\nvar req = superagent('GET', url);\n\n// These are all required headers\nreq.set('Content-Type', 'application/json');\nreq.set('Date', now)\nreq.set('x-ms-date', now)\nreq.set('x-ms-version', '2013-08-15');\n\nvar headers = {\n  'Content-Type': req.get('Content-Type'),\n  'Date': req.get('Date')\n};\n\nvar signed = signTable.sharedKey({\n  method: req.method,\n  headers: headers,\n  resource: tableName + '()'\n});\n\nreq.set('Authorization', signed);\n\n// now your request is authenticated go for it!\n// ... yay\n\n```\n\n## TODO\n\n  - add SAS signing for blobs\n  - add SAS signing for queue\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flightsofapollo%2Fazure-sign","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flightsofapollo%2Fazure-sign","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flightsofapollo%2Fazure-sign/lists"}