($INBOX_DIR/description missing)
 help / color / mirror / Atom feed
From: alexzoyv@gmail.com
To: yocto@lists.yoctoproject.org
Subject: Http access token fetching with gitsm fetcher
Date: Fri, 20 Oct 2023 04:55:18 -0700	[thread overview]
Message-ID: <SI8G.1697802918201554942.vNSZ@lists.yoctoproject.org> (raw)


[-- Attachment #1.1: Type: text/plain, Size: 543 bytes --]

Greetings!
I try to use gitsm fetcher to fetch bitbucket repository with read-only https access token. SRC_URI looks like this
> 
> 
> SRC_URI =
> "gitsm://******.git;protocol=https;branch=${BRANCH};user=azoykin:${TOKEN}"
> 
> 

This recipe fetches parent repository, but is unable to fetch submodule, writing fatal: could not read Username for 'https://tps-git.topcon.com': No such device or address in log.do_fetch
It happens because url is passed to fetcher function already with user string. I suggest a patch to fix this issue

[-- Attachment #1.2: Type: text/html, Size: 605 bytes --]

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: gits.patch --]
[-- Type: text/x-patch; name="gits.patch", Size: 704 bytes --]

diff --git a/lib/bb/fetch2/gitsm.py b/lib/bb/fetch2/gitsm.py
index c5f7c03c..3a025624 100644
--- a/lib/bb/fetch2/gitsm.py
+++ b/lib/bb/fetch2/gitsm.py
@@ -100,6 +100,10 @@ class GitSM(Git):
                 # Properly formated URL already
                 proto = uris[module].split(':', 1)[0]
                 url = uris[module].replace('%s:' % proto, 'gitsm:', 1)
+                # remove user+password from string to add them as parameter
+                if ud.user in url:
+                    url = url.replace(ud.user + '@', '')
+                    url += ";user=%s" % ud.user
             else:
                 if ":" in uris[module]:
                     # Most likely an SSH style reference

             reply	other threads:[~2023-10-20 11:55 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-20 11:55 alexzoyv [this message]
2023-10-20 13:32 ` [yocto] Http access token fetching with gitsm fetcher Adrian Freihofer
2023-10-20 13:43   ` Yoann CONGAL
2023-10-20 14:32     ` alexzoyv
2024-04-19 13:25       ` [yocto] " Altous, Salahaldeen
2024-04-19 13:44         ` Janne Kiiskila
2024-04-22  6:52           ` Altous, Salahaldeen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=SI8G.1697802918201554942.vNSZ@lists.yoctoproject.org \
    --to=alexzoyv@gmail.com \
    --cc=yocto@lists.yoctoproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).