Giter Site home page Giter Site logo

afpre's People

Contributors

leflamm avatar nisabek avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

afpre's Issues

greedy arg resolution

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

make forked bash update its environment itself

vague ideas

  • maybe hook into PS1 re-rendering, problem: how to call export in string assignment to variable without forking, $() forks, PS1=$(function_that_renders_and_also_export) would be easy... doesn't help here
  • use command substitution $() (still a fork), but manipulate parent shell via gdb... weird sh*t

better ideas

$ 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
  • make actual PROMPT_COMMAND to be conditional on token expiry and perform everything necessary to update the environment, should be possible, see
PROMPT_COMMAND="{
	export DDD=\$(date)
	export UUU=\$(uptime)
}"

Reconnecting does not work, or error is not emitted to stdout

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

polish functions

sucks:

  • check_dep (consume multiple args
  • longoption_value (operate on saved ${@})
  • options_contain (same)

authenticating always fails

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.

Date returned null?

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

Account name in pattern wrong when using --account switch

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).

make afpre installable using homebrew (brew.sh) tap & document it

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.

  1. the github username is stweise it should be leflamm as credit should go to you, can you please clone/fork the repo under you username?
  2. I fixed the version to 0.9.19 as you do not provide a latest tag and I did not want to point to HEAD of master.
  3. as you can see from the output afpre --version returns a placeholder of some sort, can you make that the actual version?
  4. it would be nice to have the install (and ideally also removal) instructions visible (README.md, Install.md, ...)

Enhanced prompt resets

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? :)

Not possible to exit afpre when hanging on token renewal

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.