-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix OTP not working and add content to README
- Loading branch information
Showing
7 changed files
with
165 additions
and
52 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
venv | ||
.git | ||
*.egg-info/ | ||
*.egg-info | ||
.DS_Store | ||
dist |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -127,3 +127,5 @@ dmypy.json | |
|
||
# Pyre type checker | ||
.pyre/ | ||
|
||
.DS_Store |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,121 @@ | ||
# auther | ||
Command line tool for AWS CLI authentication | ||
# `auther` | ||
|
||
Auther is a CLI tool which authenticates your AWS CLI using various identity providers - all in one tool! | ||
|
||
Currently supported Identity Providers | ||
|
||
- Azure Active Directory - `azuread` | ||
|
||
--- | ||
|
||
## Installation | ||
|
||
### Pip | ||
|
||
```console | ||
$ pip install auther | ||
``` | ||
|
||
Further info on [PyPi](https://pypi.org/project/auther/). | ||
|
||
### Docker | ||
|
||
```console | ||
$ docker run -it --rm -v ~/.aws:/root/.aws trewq34/auther | ||
``` | ||
|
||
When looking at usage information, the above command is a direct replacement for `auther`. Although you may wish to create a command alias with your chosen shell for ease. | ||
|
||
Further info on [Docker Hub](https://hub.docker.com/r/trewq34/auther). | ||
|
||
## Usage | ||
|
||
### Configure | ||
|
||
Before using `auther` to authenticate your AWS CLI, you need to configure it. This can be done quite using `auther configure` | ||
|
||
```console | ||
# Uses the default options, most importantly: AWS config file path, AWS region, AWS profile and Auther provider | ||
$ auther configure | ||
Your Azure AD Tenant ID: 30e04ef1-fb0d-4844-87a5-8720745de01b | ||
Your Azure AD Application ID: 94ab3a5d-1b99-416a-bcaf-669f7b6bcaba | ||
The username you use to sign in: [email protected] | ||
``` | ||
|
||
If you need to use a different AWS CLI profile or AWS region, you can override these by passing in options to the `configure` command | ||
|
||
```console | ||
$ auther configure --profile saml --region us-east-1 | ||
``` | ||
|
||
This will create/update a CLI profile called `saml` for use in the `us-east-1` region. | ||
|
||
For all available configuration options and their defaults, you can use the following command | ||
|
||
```console | ||
$ auther configure --help | ||
``` | ||
|
||
### Login | ||
|
||
Once you have configured your AWS CLI profile for use with `auther` for authentication, you can login simply using the following command | ||
|
||
```console | ||
# Uses the default options, most importantly: AWS config file path, AWS credential file path, AWS profile and Auther provider | ||
$ auther login | ||
``` | ||
|
||
If you wish to override override any of the defaults, you can do so by passing in options to the `login` command. A list of available options and their defailts is available using the following command | ||
|
||
```console | ||
$ auther login --help | ||
``` | ||
|
||
## Troubleshooting | ||
|
||
### Chromium failed to download | ||
|
||
A common cause for this is a corporate proxy/firewall blocking such downloads. To work around this, you can set the `CHROME_BIN` environment variable pointing to your preinstalled Google Chrome, Chromium or Microsoft Edge installation (this will probably work with other Chromium based browsers too, although hasn't been tested). | ||
|
||
Some examples per OS can be seen below | ||
|
||
#### macOS | ||
|
||
```console | ||
# Google Chrome | ||
$ export CHROME_BIN="/Applications/Google Chrome.app/Contents/MacOS/Google Chrome" | ||
|
||
# Microsoft Edge | ||
$ export CHROME_BIN="/Applications/Microsoft Edge.app/Contents/MacOS/Microsoft Edge" | ||
|
||
# Chromium | ||
$ export CHROME_BIN="/Applications/Chromium.app/Contents/MacOS/Chromium" | ||
``` | ||
|
||
#### Windows | ||
|
||
```powershell | ||
# Google Chrome | ||
PS C:\Users\username> $env:CHROME_BIN="C:\Program Files\Google\Chrome\Application\chrome.exe" | ||
# Microsoft Edge | ||
PS C:\Users\username> $env:CHROME_BIN="C:\Program Files (x86)\Microsoft\Edge\Application\msedge.exe" | ||
# Chromium - this depends on how you installed it. Assuming you installed it the same way I did, the path will be | ||
PS C:\Users\username> $env:CHROME_BIN="C:\Users\username\AppData\Local\Chromium\Application\chrome.exe" | ||
``` | ||
|
||
#### Linux | ||
|
||
This will vary vastly depending on which distro you use. I've tested on RHEL 7.9, so this may not be the same as your distro. In any case, you can verify the path using the `which` command. | ||
|
||
```console | ||
# Google Chrome | ||
$ export CHROME_BIN="/usr/bin/google-chrome" | ||
|
||
# Microsoft Edge | ||
$ export CHROME_BIN="/usr/bin/microsoft-edge" | ||
|
||
# Chromium | ||
$ export CHROME_BIN="/usr/bin/chromium-browser" | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
click==7.1.2 | ||
requests==2.24.0 | ||
boto3==1.14.57 | ||
bs4==0.0.1 | ||
pyppeteer==0.2.6 | ||
asyncio==3.4.3 | ||
typer==0.4.1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,7 +5,7 @@ | |
|
||
setup( | ||
name="auther", | ||
version="0.0.4", | ||
version="0.0.5", | ||
author="Kamran Ali", | ||
author_email="[email protected]", | ||
description="Command line tool for AWS CLI authentication", | ||
|
@@ -22,7 +22,7 @@ | |
], | ||
packages=[package for package in find_namespace_packages('.') if 'auther' in package], | ||
install_requires=[ | ||
"Click", | ||
"typer", | ||
'requests', | ||
'boto3', | ||
'bs4', | ||
|
@@ -31,6 +31,6 @@ | |
], | ||
entry_points=""" | ||
[console_scripts] | ||
auther=auther.cli:main | ||
auther=auther.cli:app | ||
""", | ||
) |