Slackbot
06/08/2023, 8:54 AMDaniel H.
06/09/2023, 11:49 AMDaniel
06/09/2023, 12:10 PMssh
to connect to a host (it is not a limitation to http protocol).
From what I see from vendors (like Pomerium or Teleport and others), they just work around it, they use their own clients which does that part of authentification before hand and then send to the native client something that they understand.
Didn’t really test too much but maybe something but the concept is something like this:
I can think for example for your case: you can wrap in a shell script this:
https://github.com/cloudentity/oauth2c
So with oauth2c you use Oauth2 to authentificate and get a token from your Git Server (you will need to have something at the server listening for those Oauth2 requests and be able to communicate with Git Server to issue a token) and the output token obtained from oauth2c
passed to the native git
.
pseudo-code script:
#/bin/sh
$GIT_ACTION="$1"
$GIT_ACCESS_TOKEN = $(oauth2c <https://issuer_url> \
--client-id xxxxx \
... options)
$REPO_URL=// translate somehow that <https://gitserver.test.com/username/repo.git> to <https://user>:$GIT_ACCESS_TOKEN@test.com/username/repo.git
git $GIT_ACTION $REPO_URL
Later something like:
alias git my_script.sh
should do the job.
There is a glitch the native git client will cache the credentials (so when you do the other actions, like commit, pull), still the previous token will be cache.
Ps. Regarding webauthn (if you want to validate also the device which is being use, it is an authorised one), I’ve been tried that how does it work from the console. So far I know with a modern browser works out of the box, as demonstrated in the demo, but IDK how to read a fido key from the console, so you can pass it to a script for example.Daniel H.
06/09/2023, 12:19 PMDaniel
06/09/2023, 12:23 PMcontext awareness
) as you said.
The example also may be context-aware as long you have very short live tokens, which for the case of Git maybe fine but for another type of connection no