Coder Social home page Coder Social logo

aws-env's People

Contributors

blacs30 avatar bltavares avatar naftulikay avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

aws-env's Issues

Publish to PyPI

Eggs and source distributions for all Python versions we support should be published to PyPI and a signed set of packages should be produced and hosted here on the releases page.

Acceptance Criteria

  • Publish source distributions and bdist_egg distributions for
    • Python 2.7
    • Python 3.4
    • Python 3.5
    • Python 3.6?
  • Publish GnuPG signed distributions here on the GitHub releases page.

Strip Quotes

Apparently, as reported by @joshuajlai, if credentials files have quotes surrounding the variable values, it breaks things.

Attempt to fix this either via shlex or some regular expression magic.

Implement Ultra-Lazy-Load

Presently with #16, we support lazy-loading of credential files when a qualified profile URI is used. If you have a profile named dev in ~/.aws/credentials.d/92-something.gpg, the profile URI will be dev/92-something; if stg exists in ~/.aws/credentials, then the profile URI will be /stg.

Currently, lazy-loading works for root URIs, but if a non-root profile URI is used, we load all profiles rather than incrementally try to load by the file stem. The most optimal solution would be to lazy load like this:

  • โœ”๏ธ If passed a root URI:
    1. Load the root credentials file and return profile if found.
    2. Load all credentials and return profile if found.
  • ๐Ÿšซ If passed a non-root URI:
    1. Load files matching the profile URI prefix as a file stem, and return profile if found.
    2. Load all credentials and return profile if found.
  • โœ”๏ธ If passed a profile name and not a URI, load all files and return profile if found.

Implementing the non-root URI lazy-loading is what is required by this issue.

Include Bash Completions

Offer tab completions utilizing aws-env --ls to offer completions for which profile to select.

MacOS: binary not working

aws-env list
[2023-02-15T14:41:22.524835-08:00 ERROR aws_env::loader (main)] Unable to read directory: No such file or directory (os error 2)
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: Os { code: 2, kind: NotFound, message: "No such file or directory" }', src/main.rs:119:10
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

Allow and Prefer PGP Encrypted Credentials Files

Since having credentials in plain-text on your filesystem is probably a bad idea, aws-env should attempt to load encrypted files in the following order:

  • ~/.aws/credentials.gpg
  • ~/.aws/credentials.pgp
  • ~/.aws/credentials.asc

It should then attempt to decrypt these files using gpg2 or gpg into memory, and then do the export thing.

Failing finding an encrypted file, it should then default back to the normal ~/.aws/credentials.

Support SSO Profiles

AWS Single-Sign-On uses temporary credentials1, then uses STS to get temporary role credentials2.

naftulikay/aws-sso-env already implements the required logic to generate and export role credentials2, provided that the temporary credentials1 are present and not expired.

Temporary credentials1 are obtained via aws sso login, which opens a browser window to obtain the credentials. Config for SSO is typically stored in ~/.aws/config either as the default profile, or with INI header names like [profile prod]. Rather than storing the access key id and secret access key, the sections look like this:

[profile prod]
sso_start_url = https://$SOMETHING.awsapps.com/start
sso_region = us-east-1
sso_account_id = $ACCOUNT_ID
sso_role_name = $ROLE_NAME
region = us-east-1

Temporary credentials1 are stored in ~/.aws/sso/cache/$(shasum $SSO_START_URL).json and look like this:

{
  "accessToken": "...",
  "expiresAt": "2021-12-27T20:30:02+0000",
  "region": "us-east-1",
  "startUrl": "SSO_START_URL"
}

Using these credentials, role credentials2 can be obtained, and then access is permitted. What is not clear at the moment is the exact logic that aws sso login uses to do the login with the browser window. If this can be determined, then aws-env can do the full lifecycle login, if not, we can only do work if valid, unexpired cached SSO credentials exist.

  • Support role credentials generation from cached SSO credentials.
  • Support aws sso login functionality to generate temporary credentials1.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.