This project helps provide AWS credential information for user's of A Cloud Guru's sandbox feature. It obtains credentials for a Cloud Sandbox using environment variables (.env) from a file located in the root directory, outputs credentials and snapshots to the /test folder, and appends AWS-CLI credentials to the assumed default location in macos and most linux-based filesystems.
Sandboxes are temporary AWS environments that last for 4 hours and contain emphemeral resources that do not accrue costs in your AWS acccount (FAQ).
Interfaces are contracts that have a set of functions to be implemented to fulfill that contract
Rod is a high-level Chrome DevTools Protocol driver used for web automation and scraping.
This project uses a taskfile to run tasks:
-
cli
:
uses a visible browser for ease of debugging, and runs a script with a CLI prompt for entering credentials:- with an .env file in a custom location
- manually, entering variables through golang string prompt
-
provider
:
this project was initially build as a demo implementation of thePolicyProvider
interface - this commands runs that provider -
set-github
: sets current sandbox credentials as secrets with githubs api -
test
:
runs all integration and unit tests
- provider.go : interface-specific implementation methods
- sandbox.go : contains methods specifically pertaining to crawling the acloudguru website for credential information
- connection.go : generalized structs and methods for logging into a website
- env.go : loads a .env file with acloud-specific usage information into the go runtime
- export.go: code for writing credentials to a text file, appending them to a CLI config, and screenshotting the browser window
- interactive.go: code for obtaining CLI inputs for .env file
- carrierproxy.go: original interface for GloveBox demo, Policy struct and Policies method that returns an object of type Policy with keys and vals as CarrierIDs and PolicyNumbers
- getawscreds.go: contains the initial POC script that was used to scrape the site at first
- interactive.go: script that initiates the interactive CLI
Integration
- methods_test.go : integration tests of separate methods
- provider_test.go : integration test for provider(and base script for obtaining credentials)
Unit
- acloud_test.go : unit tests for the /acloud folder code
- core_test.go : unit tests for the /core folder code
- proxy_test.go : unit tests for the /proxy folder code
alias gotests=~/go/bin/gotests
Install (macos and linux):
brew tap josephedward/homebrew-aptnative
brew install gosandbox