{"id":18566566,"url":"https://github.com/youyo/credentor","last_synced_at":"2026-04-12T16:09:11.425Z","repository":{"id":85802452,"uuid":"146875820","full_name":"youyo/credentor","owner":"youyo","description":null,"archived":false,"fork":false,"pushed_at":"2018-08-31T12:48:48.000Z","size":17,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-17T13:27:53.019Z","etag":null,"topics":["aws","go","golang"],"latest_commit_sha":null,"homepage":"","language":"Go","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/youyo.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-08-31T10:12:09.000Z","updated_at":"2018-12-24T13:56:15.000Z","dependencies_parsed_at":"2023-03-13T06:48:55.466Z","dependency_job_id":null,"html_url":"https://github.com/youyo/credentor","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/youyo%2Fcredentor","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/youyo%2Fcredentor/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/youyo%2Fcredentor/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/youyo%2Fcredentor/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/youyo","download_url":"https://codeload.github.com/youyo/credentor/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254407760,"owners_count":22066311,"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","go","golang"],"created_at":"2024-11-06T22:23:33.036Z","updated_at":"2026-04-12T16:09:11.382Z","avatar_url":"https://github.com/youyo.png","language":"Go","readme":"# credentor\n\n[![Go project version](https://badge.fury.io/go/github.com%2Fyouyo%2Fcredentor.svg)](https://badge.fury.io/go/github.com%2Fyouyo%2Fcredentor)\n[![Go Report Card](https://goreportcard.com/badge/github.com/youyo/credentor)](https://goreportcard.com/report/github.com/youyo/credentor)\n[![License](https://img.shields.io/badge/license-MIT-brightgreen.svg)](./LICENSE)\n[![CircleCI](https://circleci.com/gh/youyo/credentor/tree/master.svg?style=svg)](https://circleci.com/gh/youyo/credentor/tree/master)\n\nAWS assume role credential wrapper.\n\n## Description\n\ncredentor is useful for some commands which couldn't resolve an assume role credentials in ~/.aws/credentials.\n\nFor example,\n\n- [Terraform](https://www.terraform.io/)\n- [Packer](https://www.packer.io/)\n- etc.\n\n## Install\n\nPlace a `credentor` command to your PATH and set an executable flag.  \nDownload the latest release from github. https://github.com/youyo/credentor/releases/latest\n\n```console\n# darwin/amd64\n$ curl -s https://api.github.com/repos/youyo/credentor/releases/latest \\\n\t| grep \"browser_download_url.*darwin\" \\\n\t| cut -d : -f 2,3 \\\n\t| tr -d \\\" \\\n\t| wget -qi -\n\n# linux/amd64\n$ curl -s https://api.github.com/repos/youyo/credentor/releases/latest \\\n\t| grep \"browser_download_url.*linux\" \\\n\t| cut -d : -f 2,3 \\\n\t| tr -d \\\" \\\n\t| wget -qi -\n```\n\n## Usage\n\n```ini\n# ~/.aws/credentials\n\n[my-profile]\naws_access_key_id=XXX\naws_secret_access_key=YYY\n```\n\n```ini\n# ~/.aws/config\n\n[profile foo]\nrole_arn=arn:aws:iam::999999999999:role/MyRole\nsource_profile=my-profile\n```\n\n### As command wrapper\n\n```console\n$ AWS_PROFILE=foo credentor -- some_command [arg1 arg2...]\n```\n\n`credentor` works as below.\n\n1. Find `AWS_PROFILE` section in ~/.aws/credentials and ~/.aws/config .\n2. Call `aws sts assume-role` to a get temporary credentials.\n3. Set the credentilas to environment variables.\n   - `AWS_ACCESS_KEY_ID`\n   - `AWS_SECRET_ACCESS_KEY`\n   - `AWS_SESSION_TOKEN`\n4. Execute `some_command` with args.\n\n### As env exporter\n\nWhen credentor is executed with no arguments, credentor outputs shell script to export AWS credentials environment variables.\n\n```console\n$ export AWS_PROFILE=foo\n$ credentor\nexport AWS_ACCESS_KEY_ID=XXXXXXXXXXXXXXXX\nexport AWS_SECRET_ACCESS_KEY=zWarBXUtMKJYnC8y4dNAf9e5HQqFTp....\nexport AWS_SESSION_TOKEN=Wj3YGuSMwn8aJx4AN6TFsbtB5URKHEpVgdDkPvy7....\n```\n\nYou can set the credentials in current shell by `eval`.\n\n```console\n$ eval \"$(credentor)\"\n```\n\nTemporary credentials has expiration time (about 1 hour).\n\n## References\n\ncredentor is inspired by aswrap.  \nOriginal software is [aswrap](https://github.com/fujiwara/aswrap). https://github.com/fujiwara/aswrap\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyouyo%2Fcredentor","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyouyo%2Fcredentor","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyouyo%2Fcredentor/lists"}