leflamm / afpre Goto Github PK
View Code? Open in Web Editor NEWCLI for the AWS Federation Proxy
License: Apache License 2.0
CLI for the AWS Federation Proxy
License: Apache License 2.0
when using a command passed to afpre, like
afpre --account=xyz -- bash someScriptThatHasAVersionParameter --version=shouldBePassedToScript
afpre recognizes --version as part of the cmdline and exits with its version output:
0.9.9
AFP| ...
$ACCOUNT/$ROLE AFP|...
Do not only provide detailed prompt. Prompt has been like this before - and early users complained :-)
// CC: @nisabek
$()
forks, PS1=$(function_that_renders_and_also_export)
would be easy... doesn't help here$()
(still a fork), but manipulate parent shell via gdb... weird sh*t$ cat rc
PROMPT_COMMAND="export DDD=\$(date)"
$ bash --rcfile rc
$ env | grep -i ddd
DDD=Mi 24. Mai 22:45:05 CEST 2017
$ env | grep -i ddd
DDD=Mi 24. Mai 22:45:07 CEST 2017
$ env | grep -i ddd
DDD=Mi 24. Mai 22:45:07 CEST 2017
$ env | grep -i ddd
DDD=Mi 24. Mai 22:45:08 CEST 2017
PROMPT_COMMAND
to be conditional on token expiry and perform everything necessary to update the environment, should be possible, seePROMPT_COMMAND="{
export DDD=\$(date)
export UUU=\$(uptime)
}"
AFP| xxx@xxx:~/work/workspaces/github/XXXXX$
token expired - need to renew...
authenticating as MYUSERNAME for ACCOUNT/ROLE against MYAFP
done.
AFP| xxx@xxx:~/work/workspaces/github/XXXXX$
token expired - need to renew...
authenticating as MYUSERNAME for ACCOUNT/ROLE against MYAFP
done.
AFP| xxx@xxx:~/work/workspaces/github/XXXXX$
it keeps renewing. Dunno if it is successful or not, but it seems to loop
sucks:
check_dep
(consume multiple argslongoption_value
(operate on saved ${@})options_contain
(same)to provide at least defaults for
Hi,
I try to use afpre, but authentication always fails. I use a !
in my password, but it doesn't look like this is the problem. (You can disable the special meaning of !
with $ set +H
, but authentication still fails.) Not sure what else could be the problem ๐ค
Thanks.
Ubuntu 16.04:
afpre x y
** checking dependecies
** reading credentials
username: z
password:
** authenticating as z for x/y against myafphost
** assembling environment
date: invalid date โnullโ
** starting bash
As soon as RENEW_INT
is set, authentication does not work.
:)
When using PATTERN="${ACCOUNT}|${ROLE}"
in the config file, and overwriting the account using --account=...
on the command line, the PATTERN displays the account which was defined in the config file (and not the overwritten one from the command line).
Export the account into an environment variable, e.g. AFP_ACCOUNT or STAGE.
AFP|
I have create a repo here: https://github.com/stweise/homebrew-afpre
to allow installation of afpre using homebrew with very few extra quirks, please see example code block below
stweise@mac-weises:/usr/local$ brew tap stweise/afpre
==> Tapping stweise/afpre
Cloning into '/usr/local/Homebrew/Library/Taps/stweise/homebrew-afpre'...
remote: Enumerating objects: 6, done.
remote: Counting objects: 100% (6/6), done.
remote: Compressing objects: 100% (5/5), done.
remote: Total 6 (delta 0), reused 4 (delta 0), pack-reused 0
Unpacking objects: 100% (6/6), done.
Tapped 1 formula (32 files, 39.8KB).
stweise@mac-weises:~$ brew install stweise/afpre/afpre
==> Installing afpre from stweise/afpre
==> Installing dependencies for stweise/afpre/afpre: oniguruma and jq
==> Installing stweise/afpre/afpre dependency: oniguruma
==> Downloading https://homebrew.bintray.com/bottles/oniguruma-6.9.1.mojave.bottle.tar.gz
==> Downloading from https://akamai.bintray.com/19/1983059c2eae93f1e1ec1bdb65194c64b77182c
######################################################################## 100.0%
==> Pouring oniguruma-6.9.1.mojave.bottle.tar.gz
๐บ /usr/local/Cellar/oniguruma/6.9.1: 17 files, 1.3MB
==> Installing stweise/afpre/afpre dependency: jq
==> Downloading https://homebrew.bintray.com/bottles/jq-1.6.mojave.bottle.1.tar.gz
==> Downloading from https://akamai.bintray.com/71/71f0e76c5b22e5088426c971d5e795fe67abee7
######################################################################## 100.0%
==> Pouring jq-1.6.mojave.bottle.1.tar.gz
๐บ /usr/local/Cellar/jq/1.6: 18 files, 1MB
==> Installing stweise/afpre/afpre
==> Cloning https://github.com/leflamm/afpre.git
Updating /Users/stweise/Library/Caches/Homebrew/afpre--git
==> Checking out tag 0.9.19
HEAD is now at 0009bd0 #39: supersede role
HEAD is now at 0009bd0 #39: supersede role
๐บ /usr/local/Cellar/afpre/0.9.19: 5 files, 19.7KB, built in 2 seconds
stweise@mac-weises:/usr/local$ which afpre
/usr/local/bin/afpre
stweise@mac-weises:/usr/local$ afpre --version
VERSION_PLACEHOLDER
stweise@mac-weises:/usr/local$ brew remove stweise/afpre/afpre
Uninstalling /usr/local/Cellar/afpre/0.9.19... (5 files, 19.5KB)
stweise@mac-weises:/usr/local$ brew untap stweise/afpre
Untapping stweise/afpre...
Untapped 1 formula (33 files, 40.8KB).
stweise@mac-weises:/usr/local$ which afpre
stweise@mac-weises:/usr/local$
There are several issues with this solution which would require work on your part.
stweise
it should be leflamm
as credit should go to you, can you please clone/fork the repo under you username?0.9.19
as you do not provide a latest
tag and I did not want to point to HEAD of master.afpre --version
returns a placeholder of some sort, can you make that the actual version?Either by checking environment variables, or by configuration, afpre should figure out when it should open a fish shell rather than a bash.
Note that fish has a slightly different syntax.
Hi
I use [this](bash git prompt ubuntu) to enhance my bash with git status information, but if I use afpre my bash completely resets to the default (OS X) one.
โ ~/privat/emock [master|โ]
19:16 $ ~/Downloads/afpre-0.9.8/afpre
password:
token expired - need to renew...
AFP| mymac:emock boo$
Any idea why? :)
When afpre hangs while renewing the token ("token expired - need to renew..."), it is not possible to exit afpre using ctrl + c
:
token expired - need to renew...
authenticating as ... for ... against ...
^C
token expired - need to renew...
authenticating as ... for ... against ...
^C
token expired - need to renew...
authenticating as ... for ... against ...
Instead, it just tries again to renew the token.
If you'd like to turn off curl's verification of the certificate, use
the -k (or --insecure) option.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.