From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 52047C4345F for ; Mon, 22 Apr 2024 06:53:00 +0000 (UTC) Subject: Re: [yocto] Http access token fetching with gitsm fetcher To: "Janne Kiiskila" , yocto@lists.yoctoproject.org From: "Altous, Salahaldeen" X-Originating-Location: Ankara, TR (91.93.226.216) X-Originating-Platform: Linux Firefox 124 User-Agent: GROUPS.IO Web Poster MIME-Version: 1.0 Date: Sun, 21 Apr 2024 23:52:51 -0700 References: In-Reply-To: Message-ID: <28950.1713768771510530708@lists.yoctoproject.org> Content-Type: multipart/alternative; boundary="i1SG1qSiICfrK79UlpZb" List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Mon, 22 Apr 2024 06:53:00 -0000 X-Groupsio-URL: https://lists.yoctoproject.org/g/yocto/message/62973 --i1SG1qSiICfrK79UlpZb Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Hi Janne, On Fri, Apr 19, 2024 at 06:44 AM, Janne Kiiskila wrote: >=20 >=20 >=20 > * SRC_URI =3D "git://${ COMPANY_GIT_REPO }/path/to/project.git;protocol= =3Dhttps; > *user=3Dtoken_name:${TOKEN}"* > * The https+Token was working fine with Dunfell, now I have ported this > recipe to kirkstone but it is not working and I get this error > * fatal: could not read Password for 'https://git@COMPANY_GIT_REPO': No > such device or address >=20 >=20 >=20 >=20 > Finally, something I might be able to contribute with. >=20 > * Do not put ever any credentials to any recipes. That=E2=80=99s not the = right > place for them and they will leak. > * Credentials are a build machine configuration issue. You can use git > redirects for this purpose. >=20 >=20 > This type of thing is only required for private repositories typically, > here is an example for a GitHub action >=20 >=20 >=20 > https://github.com/PelionIoT/actions >=20 >=20 >=20 > that does it. But, essentially it boils down to configuring git: >=20 >=20 >=20 >=20 >=20 >=20 >=20 > git config --global user.name "Your BOT" >=20 >=20 >=20 > git config --global user.email your@email.com >=20 >=20 >=20 > git config --global url. https://${{ inputs.github_token }}@github.com/ ( > https://$%7b%7b%20inputs.github_token%20%7d%7d@github.com/ ).insteadOf gi= t@github.com: >=20 >=20 >=20 >=20 > git config --global url. https://${{ inputs.github_token }}@github ( > https://$%7b%7b%20inputs.github_token%20%7d%7d@github ).insteadOf https:/= /github >=20 >=20 >=20 >=20 > I hope this helps. >=20 >=20 >=20 >=20 >=20 >=20 >=20 thanks for your help, I will give it a try. >=20 >=20 >=20 >=20 >=20 >=20 >=20 >=20 >=20 >=20 >=20 > Best Regards, >=20 >=20 >=20 >=20 >=20 >=20 >=20 > Janne Kiiskil=C3=A4 >=20 >=20 >=20 Regards, Salahaldeen Altous --i1SG1qSiICfrK79UlpZb Content-Type: text/html; charset="utf-8" Content-Transfer-Encoding: quoted-printable

Hi Janne,

 

On Fri, Apr 19, 2024 at 06:44 AM, Janne Kiiskila wrote:

  • SRC_URI= =3D "git://${COMPANY_GIT_REPO}/path/to/= project.git;protocol=3Dhttps;user=3Dtoken_name:${TOKEN}"
  • The https+Token was working fine wi= th Dunfell, now I have ported this recipe to kirkstone but it is not workin= g and I get this error
  • fatal: could not read Password for = 'https://git@COMPANY_GIT_REPO': No such device or address

 Finally, something I might be able to contrib= ute with.

  1. Do not put ever any credentials to any recipes. That’s= not the right place for them and they will leak.
  2. Credentials are a build machine configuration issue. You can= use git redirects for this purpose.

This type of thing is only required for private repositories typic= ally, here is an example for a GitHub action

https://github.co= m/PelionIoT/actions

that does it. But, essentially it boils down to configuring git:

 

          git config = --global user.name "Your BOT"

          git config = --global user.email your@email.com

          git config = --global url.https://${{ inputs.github_token }}@github.com/.insteadOf git@github.com:

          git config = --global url.https://${{ inputs.github_token }}@github.insteadOf https://github

I hope this helps.

 

thanks for your help, I will give it a try.

 

 

Best Regards,

 

Janne Kiiskilä


Regards,

Salahaldeen Altous

--i1SG1qSiICfrK79UlpZb--