{"id":13757401,"url":"https://github.com/nordcloud/cognitocurl","last_synced_at":"2025-04-14T14:31:04.447Z","repository":{"id":34069754,"uuid":"167012381","full_name":"nordcloud/cognitocurl","owner":"nordcloud","description":"🦉🤖Easily sign curl calls to API Gateway with Cognito authorization token.","archived":false,"fork":false,"pushed_at":"2023-06-13T13:11:05.000Z","size":1767,"stargazers_count":89,"open_issues_count":29,"forks_count":11,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-03-28T03:24:51.998Z","etag":null,"topics":["amazon-web-services","aws","cli","cognito","curl"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/nordcloud.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":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2019-01-22T14:55:53.000Z","updated_at":"2025-02-12T15:14:12.000Z","dependencies_parsed_at":"2024-01-17T16:08:18.551Z","dependency_job_id":"1578a118-0743-44ca-bb62-9ebc1fdc9e21","html_url":"https://github.com/nordcloud/cognitocurl","commit_stats":{"total_commits":60,"total_committers":7,"mean_commits":8.571428571428571,"dds":0.3833333333333333,"last_synced_commit":"73dcdefb55cd250909365e3ac7e154d7a1bf323b"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nordcloud%2Fcognitocurl","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nordcloud%2Fcognitocurl/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nordcloud%2Fcognitocurl/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nordcloud%2Fcognitocurl/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nordcloud","download_url":"https://codeload.github.com/nordcloud/cognitocurl/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248694546,"owners_count":21146945,"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":["amazon-web-services","aws","cli","cognito","curl"],"created_at":"2024-08-03T12:00:36.547Z","updated_at":"2025-04-14T14:31:04.109Z","avatar_url":"https://github.com/nordcloud.png","language":"TypeScript","funding_links":[],"categories":["Other Awesome Lists"],"sub_categories":["General Utilities"],"readme":"# cognitocurl 🔏\n\n![](preview.gif)\n\nThis is CLI tool that allows you to easily sign curl calls to API Gateway with Cognito authorization token.\n\n[![npm version](https://badge.fury.io/js/cognitocurl.svg)](https://badge.fury.io/js/cognitocurl)\n\n## Why?\n\nAWS Cognito is really powerful, especially combined with API Gateway, but if you use Cognito Authorizer or Lambda Authorizer based on Authorization header, you may encounter a problem with signing curl calls - this is why we created `cognitocurl` - it is tiny CLI tool made with Node.js that takes care of signing in against user pool, persisting and rotating tokens, and adding additional header to your curl call.\n\nMade with ❤️ in Nordcloud\n\n## Usage\n\nInstallation:\n\n```\n$ npm i -g cognitocurl\n```\n\nThen:\n\n```\n$ cognitocurl --cognitoclient XXX --userpool YYY --run \"full curl command here\"\n```\n\nor\n\n```\n$ cognitocurl --hostedui hosteduisetupfilename.json --run \"full curl command here\"\n```\n\nGetting access token with a single command\n```\n$ cognitocurl --cognitoclient CLIENT_ID --userpool USER_POOL_ID --token --username USER_NAME --password USER_PASSWORD\n``` \n\n## Available flags\n\n### Tools:\n\n- `--version`\n- `--help`\n\n### Features:\n\n- `--cognitoclient cognitoclientid` - Cognito Client ID\n- `--userpool userpoolid` - Cognito User Pool ID\n- `--header header` - _Defaults to 'Authorization'_\n- `--reset` - Reset cached Cognito credentials\n- `--run \"runcommand\"` - pass your curl command here\n- `--hostedui hostedui.json` - if passed, Congito Hosted UI will be launched and configured using setup from provided json file\n- `--token` - if passed, run command will be ignored and access token will be printed to stdout instead\n- `--username` - if not passed, you will be prompted to enter a username (added to cli authentication)\n- `--password` - if not passed, you will be prompted to enter a password (added to cli authentication)\n\n#### Hosted UI json setup example\n\nIf you want to use hosted ui, provide `--hostedui`. You should provide a setup jsonfile file like this:\n\n```\n{\n  \"region\": \"eu-west-1\",\n  \"userPoolId\": \"your_user_pool_id\",\n  \"userPoolWebClientId\": \"your_web_client_id\",\n  \"redirectSignIn\": \"http://localhost:3000\",\n  \"redirectSignOut\": \"http://localhost:3000\",\n  \"domain\": \"your_hosted_ui_domain\"\n}\n```\n\n**Note that `lochalhost:3000` should be added to your Cognito User Pool App Client setup!**\n\n## Plans for the future\n\n- add federated/social logins (by opening browser window)\n\n## Authors\n\n- Jakub Holak, Nordcloud 🇵🇱\n\n## Credits\n\nDone using [oclif](https://github.com/oclif/oclif). Inspired by [AWS Amplify](https://github.com/aws-amplify/amplify-js).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnordcloud%2Fcognitocurl","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnordcloud%2Fcognitocurl","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnordcloud%2Fcognitocurl/lists"}