Skip to content

Commit

Permalink
feat: add brew release and rename project
Browse files Browse the repository at this point in the history
  • Loading branch information
aripalo committed Oct 10, 2021
1 parent ff77b74 commit b2839a9
Show file tree
Hide file tree
Showing 4 changed files with 119 additions and 8 deletions.
114 changes: 112 additions & 2 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# This is an example .goreleaser.yml file with some sensible defaults.
# Make sure to check the documentation at https://goreleaser.com
project_name: aws-mfa-assume-credential-process
project_name: aws-mfa-credential-process
before:
hooks:
# You may remove this if you don't use go modules.
Expand Down Expand Up @@ -28,3 +27,114 @@ changelog:
exclude:
- '^docs:'
- '^test:'
# .goreleaser.yml
brews:
-
# NOTE: make sure the url_template, the token and given repo (github or gitlab) owner and name are from the
# same kind. We will probably unify this in the next major version like it is done with scoop.

# GitHub/GitLab repository to push the formula to
tap:
owner: aripalo
name: homebrew-tap
# Optionally a branch can be provided. If the branch does not exist, it
# will be created. If no branch is listed, the default branch will be used
branch: main
# Optionally a token can be provided, if it differs from the token provided to GoReleaser
token: "{{ .Env.HOMEBREW_TAP_GITHUB_TOKEN }}"

# Template for the url which is determined by the given Token (github or gitlab)
# Default for github is "https://github.com/<repo_owner>/<repo_name>/releases/download/{{ .Tag }}/{{ .ArtifactName }}"
# Default for gitlab is "https://gitlab.com/<repo_owner>/<repo_name>/-/releases/{{ .Tag }}/downloads/{{ .ArtifactName }}"
# Default for gitea is "https://gitea.com/<repo_owner>/<repo_name>/releases/download/{{ .Tag }}/{{ .ArtifactName }}"
#url_template: "http://github.mycompany.com/foo/bar/releases/{{ .Tag }}/{{ .ArtifactName }}"

# Allows you to set a custom download strategy. Note that you'll need
# to implement the strategy and add it to your tap repository.
# Example: https://docs.brew.sh/Formula-Cookbook#specifying-the-download-strategy-explicitly
# Default is empty.
#download_strategy: CurlDownloadStrategy

# Allows you to add a custom require_relative at the top of the formula template
# Default is empty
#custom_require: custom_download_strategy

# Git author used to commit to the repository.
# Defaults are shown.
commit_author:
name: aripalo-homebrew
email: ari+github-homebrew-taps@aripalo.com

# The project name and current git tag are used in the format string.
commit_msg_template: "Brew formula update for {{ .ProjectName }} version {{ .Tag }}"

# Folder inside the repository to put the formula.
# Default is the root folder.
folder: Formula

# Caveats for the user of your binary.
# Default is empty.
#caveats: "How to use this binary"

# Your app's homepage.
# Default is empty.
#homepage: "https://example.com/"

# Template of your app's description.
# Default is empty.
description: "A helper utility that plugs into standard credential_process to assume AWS IAM Role with – Yubikey Touch and Authenticator App – TOPT MFA to provide session credentials – with automatic refreshing."

# SPDX identifier of your app's license.
# Default is empty.
license: "Apache-2.0"

# Setting this will prevent goreleaser to actually try to commit the updated
# formula - instead, the formula file will be stored on the dist folder only,
# leaving the responsibility of publishing it to the user.
# If set to auto, the release will not be uploaded to the homebrew tap
# in case there is an indicator for prerelease in the tag e.g. v1.0.0-rc1
# Default is false.
skip_upload: true

# Custom block for brew.
# Can be used to specify alternate downloads for devel or head releases.
# Default is empty.
#custom_block: |
# head "https://github.com/some/package.git"
# ...

# Packages your package depends on.
dependencies:
- name: git
#- name: zsh
# type: optional

# Packages that conflict with your package.
#conflicts:
# - svn
# - bash

# Specify for packages that run as a service.
# Default is empty.
#plist: |
# <?xml version="1.0" encoding="UTF-8"?>
# ...

# So you can `brew test` your formula.
# Default is empty.
#test: |
# system "#{bin}/program --version"
# ...

# Custom install script for brew.
# Default is 'bin.install "program"'.
#install: |
# bin.install "program"
# ...

# Custom post_install script for brew.
# Could be used to do any additional work after the "install" script
# Default is empty.
#post_install: |
# etc.install "app-config.conf"
# ...
9 changes: 5 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# `aws-mfa-assume-credential-process`
# `aws-mfa-credential-process`

🚧 **Work-in-Progress: Do not use just yet! The API and configurations may change without any prior notice at any version. The status of this tool is that it's under development & testing. So do not use this for anything important, but feel free to test this out and give feedback!**

Expand Down Expand Up @@ -53,7 +53,7 @@ Then there's tools such as AWS CDK that [does not support caching of assumed tem

To recap, most existing solutions (I've seen so far) to these challenges either lack support for automatic temporary session credential refreshing, cache/write temporary session credentials to suboptimal locations and/or don't work that well with AWS tooling (i.e. requiring one to create “wrappers”):

This `aws-mfa-assume-credential-process` is _yet another tool_, but it plugs into the standard [`credential_process`](https://docs.aws.amazon.com/sdkref/latest/guide/setting-global-credential_process.html) AWS configuration so most of AWS tooling (CLI v2, SDKs and CDK) will work out-of-the-box with it and also support automatic temporary session credential refreshing.
This `aws-mfa-credential-process` is _yet another tool_, but it plugs into the standard [`credential_process`](https://docs.aws.amazon.com/sdkref/latest/guide/setting-global-credential_process.html) AWS configuration so most of AWS tooling (CLI v2, SDKs and CDK) will work out-of-the-box with it and also support automatic temporary session credential refreshing.

<br/>

Expand All @@ -77,7 +77,7 @@ This `aws-mfa-assume-credential-process` is _yet another tool_, but it plugs int

1. via [Homebrew](https://brew.sh/):
```shell
brew install aripalo/aws-mfa-assume-credential-process/todo
brew install aripalo/aws-mfa-credential-process/todo
```

2. or download via Github releases:
Expand All @@ -100,7 +100,7 @@ This `aws-mfa-assume-credential-process` is _yet another tool_, but it plugs int
```ini
[profile my-profile]
assume_role_arn=<target-role-arn>
credential_process = aws-mfa-assume-credential-process --profile=my-profile
credential_process = aws-mfa-credential-process --profile=my-profile
source_profile=<source-profile-name>
mfa_serial=<mfa-device-arn>
yubikey_serial=<yubikey-serial>
Expand Down Expand Up @@ -151,6 +151,7 @@ You can see all the possible configuration options in [AWS documentation](https:
- Configuration file
- Cache Password!!! (ENVIRONMENT or Yubikey slot)
- Ensure Role Chaining Works!
- Test manually CDK, CLI, NodeJS SDK v3, Boto3, Go ... for refresh/cache support!
- Add Unit tests
Expand Down
2 changes: 1 addition & 1 deletion cmd/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ const thinBorder string = "-----------------------------------------------------

func main() {
app := &cli.App{
Name: "aws-mfa-assume-credential-process",
Name: "aws-mfa-credential-process",
Usage: "Caching AWS Credential Process to manage assuming an IAM Role with MFA token from Yubikey and Authenticator App",
Flags: []cli.Flag{
&cli.StringFlag{
Expand Down
2 changes: 1 addition & 1 deletion internal/utils/banner.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ func PrintBanner() {
SafeLogLn()
SafeLogLn(FormatMessage(COLOR_TITLE, "", "credential_process", "AWS MFA Assume Credential Process"))
SafeLogLn()
SafeLogLn(FormatMessage(COLOR_DEBUG, "📝 ", "Repository & Docs", "https://github.com/aripalo/aws-mfa-assume-credential-process"))
SafeLogLn(FormatMessage(COLOR_DEBUG, "📝 ", "Repository & Docs", "https://github.com/aripalo/aws-mfa-credential-process"))
SafeLogLn()
SafeLogLn(TextGrayDark(CreateRuler("-")))
}

0 comments on commit b2839a9

Please sign in to comment.