#git submodule credentials

1 messages · Page 1 of 1 (latest)

elder sphinx
#

Hello

How can I pass https-credentials for git submodules?
I'm using relative URLs for submodules on the same server.
I'm testing this with the dagger interactive shell:

⋈ git https://my.gitea.com/proj/repo --http-auth-token TOKEN | head | tree

or:

$ git config --global credential.https://my.gitea.com.username ignored
$ git config --global credential.https://my.gitea.com.helper '!f() { test "$1" = get && echo "password=${TOKEN}"; }; f'
$ dagger -d -vvv
⋈ git https://my.gitea.com/proj/repo | head | tree

Dagger v0.18.12 seems to fetch the main repo but can't authenticate for submodules.

│   fatal: Authentication failed for 'https://.....git/'
│   fatal: clone of 'https://.....git' into submodule path '/var/lib/dagger/worker/snapshots/snapshots/91/fs/data' failed
│   Failed to clone 'data' a second time, aborting
elder sphinx
#

git https://oauth2:$TOKEN@github.com/pck/dagger_test_parent.git | head | tree | export export works as expected. Strange.

#

git https://github.com/pck/dagger_test_parent.git --http-auth-username oauth2 --http-auth-token TOKEN | head | tree | export export fails for the submodule.

elder sphinx
#

The working token-in-URL method logs the secret token, but this can be filtered:

dagger --progress plain 2> >(sed -e 's|https://[^ ]*@|https://...@|g')

restive skiff
#

cc @agile brook

restive skiff
#

will give it a try and report back @elder sphinx

agile brook
agile brook
#

PR incoming