Skip to content

Commit

Permalink
Add option support for okta-awscli
Browse files Browse the repository at this point in the history
This patch adds support for the options to the `okta-awscli` command.

<https://github.com/jmhale/okta-awscli>

Support for this command is being introduced, because the `aws-okta`
command has been put on what the author refers to as an "indefinite
hiatus."

<segmentio/aws-okta#278>
  • Loading branch information
sirhc committed Apr 15, 2020
1 parent 99650f5 commit 5a4cf2c
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 2 deletions.
7 changes: 5 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
# AWS Okta (aws-okta) plugin
# Okta plugin

This plugin provides command line completions for the
[`aws-okta`](https://github.com/segmentio/aws-okta) command.
[`aws-okta`](https://github.com/segmentio/aws-okta) and
[`okta-awscli`](https://github.com/jmhale/okta-awscli) commands. Note that the
`aws-okta` command has been put on what the author refers to as an
[indefinite hiatus](https://github.com/segmentio/aws-okta/issues/278).

This plugin provides the following convenience functions.

Expand Down
25 changes: 25 additions & 0 deletions okta.plugin.zsh
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,8 @@ function _aws_okta_write_to_credentials() {
'2:credentials_file:_files'
}

# https://github.com/segmentio/aws-okta
# Note about deprecation: https://github.com/segmentio/aws-okta/issues/278
function _aws_okta() {
local line

Expand All @@ -142,3 +144,26 @@ function _aws_okta() {
}
compdef _aws_okta aws-okta
compdef _aws_okta_profiles aop

# https://github.com/jmhale/okta-awscli
function _okta_awscli() {
local curcontext=$curcontext state state_descr line ret=1
typeset -A opt_args

# TODO: How to hook into the aws command completion instead of using _normal?
_arguments \
'(-v --verbose)'{-v,--verbose}'[Enables verbose mode]' \
'(- *)'{-V,--version}'[Outputs version number and exits]' \
'(-d --debug)'{-d,--debug}'[Enables debug mode]' \
'(-f --force)'{-f,--force}'[Forces new STS credentials; skips STS credentials validation]' \
'--okta-profile+[Name of the profile to use in .okta-aws]:TEXT:' \
'--profile+[Name of the profile to store temporary credentials in ~/.aws/credentials]:TEXT:' \
'(-c --cache)'{-c,--cache}'[Cache the default profile credentials to ~/.okta-credentials.cache]' \
'(-t --token)'{-t,--token}+'[TOTP token from your authenticator app]:TEXT:' \
'(- *)--help[Show help message and exit]' \
'*:: :_normal' \
&& ret=0

return ret
}
compdef _okta_awscli okta-awscli

0 comments on commit 5a4cf2c

Please sign in to comment.