Skip to content

Conversation

@Corristo
Copy link
Contributor

Sometimes source archives are only accessible to logged-in users, for example as described in issue #456. However, authentication currently is not supported by flatpak-builder aside from hard-coding credentials in the manifest file.

Since flatpak-builder uses libcurl to download sources we can make use of cURL's support for netrc files to provide credentials out-of-band. While that does not directly solve #456 it offers an in my opinion superior alternative: Instead of hard-coding username and password in the manifest file the reporter of #456 can now create the file ~/.netrc with the following content:

machine gitlab.com
  login <user>
  password <password>

This allows storing the manifest file in version control without exposing the credentials to all other developers.

Sometimes source archives are only accessible to logged-in users,
for example as described in issue flatpak#456. However, authentication
currently is not supported by flatpak-builder aside from hard-coding
credentials in the manifest file.

Since flatpak-builder uses libcurl to download sources we can make
use of cURL's support for netrc files to provide credentials
out-of-band. That way the manifest file can be shared with others
without leaking credentials.

See the cURL documentation [0] for details about where cURL is
looking for the .netrc file and the expected format of that file.

[0] https://curl.se/libcurl/c/CURLOPT_NETRC.html
@swick
Copy link
Contributor

swick commented Sep 2, 2025

Seems fine to me.

@bbhtt
Copy link
Contributor

bbhtt commented Sep 2, 2025

Seems to work. imo this should solve #456, using username@pass in the manifest should not be allowed.

@bbhtt bbhtt merged commit 87c197a into flatpak:main Sep 2, 2025
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants