Skip to content

Commit

Permalink
removes testing in favor of a small hack project
Browse files Browse the repository at this point in the history
  • Loading branch information
joshbrgs committed Aug 20, 2024
1 parent d266aa5 commit 1d2d405
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 234 deletions.
24 changes: 0 additions & 24 deletions .github/workflows/test.yml

This file was deleted.

25 changes: 17 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,21 +1,18 @@
# AWS MFA

## v1.0.1

### What this tool achieves
>
> Goal of this program in Golang is to make the life of the developer easier, by providing a quick command that sets the user's
> session token and temporary credentials to an aws cli profile [mfa] for AWS CLI Multifactor Authentication.
> This profile keeps track of the user's session determining if it is valid or not.
> The user may also opt in to having the command update their local Kube Config for a quicker MFA login and setup
### Prerequsites
The user will need to download the latest Golang version at [Go Dev](https://go.dev/doc/install).
By default, the installer will install Go to Program Files or Program Files (x86).
I suggest changing this during the install process to your User directory.
To create the executable, cd into this directory and run `go build .`
This will create an executable with the name of the directory.
You can then place it in your `C:\Users\<username>\go\bin` directory to place it in you path and use it like any command *ex) `aws-mfa --kubeConfig`*
Install the bin from the GitHub releases section and add it to your path

### Usage

Base command: aws-mfa
Supported flags:
-kubeConfig ==> _This will prompt you for region code and project name to set up your kubectl config context_
Expand All @@ -24,17 +21,29 @@ Supported flags:
-defaultProfile ==> ex) aws-mfa -defaultProfile=profile _The default is "default" but this flag will allow you to choose the name of the profile where your default aws credentials are, useful if you have multiple accounts and projects_
-help or -h ==> _This will show you available flag usage_

### Intalling locally Prerequsites

The user will need to download the latest Golang version at [Go Dev](https://go.dev/doc/install).
By default, the installer will install Go to Program Files or Program Files (x86).
I suggest changing this during the install process to your User directory.
To create the executable, cd into this directory and run `go build .`
This will create an executable with the name of the directory.
You can then place it in your `C:\Users\<username>\go\bin` directory to place it in you path and use it like any command _ex) `aws-mfa --kubeConfig`_

### Behind the Curtain

This program is executing aws cli commands and parsing the json response to retrieve your mfa device arn,
utilize the mfa code, and set the session token and keys to a second aws cli profile called [mfa].
If the user does not have the profile it will create it.
If the user's token is still valid, it will let the user know.
If the kubeConfig flag is included it will then execute the aws cli command to configure the kubernetes context with the sessions credentials.

#### Dependencies

- AWS CLI:^2.7

#### Dev Dependancies
- Golang: ^1.17

- Golang: ^1.22

_MD Author: Josh Burgess_
103 changes: 0 additions & 103 deletions aws/aws_test.go

This file was deleted.

53 changes: 0 additions & 53 deletions main_test.go

This file was deleted.

46 changes: 0 additions & 46 deletions utils/utils_test.go

This file was deleted.

0 comments on commit 1d2d405

Please sign in to comment.