Credentials for different URLs isn't possible if they are under the same domain
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 45/100
- Issue type
- Feature
- Clarity
- Mostly clear
- Activity status
- Quiet
- Tech stack
- python
- Domain
- authentication, build-system
Research direction
Start by tracing the existing netrc authentication path and user-configuration handling, then review the linked buildstream-plugins-community merge request for related behavior. Done means credentials can be selected by URL globs, user configuration takes precedence over netrc, fallback remains compatible, and plugins can use the same mechanism.
Written by the indexing model from the issue text.
Description
Problem
We have a buildstream project that uses sources from private repositories.
These repositories require different credentials, but they are all under the same domain.
This is a problem, as netrc matches domain name but not url paths.
There needs to be a different way to authenticate based on URLs that isn't using netrc.
Potential solution
URLs could be matched based on globs. Services such as Gitlab lets you create tokens for a group, where any repositories under the group can use that token to pull the source or LFS tarballs.
These entries could be stored in user configuration, and I suggest prioritising authentication with it before using netrc as a fallback.
This wouldn't create compatibility issues, and allows for per-url authentication while still keeping a netrc file.
Example:
# URL will be matched against each entry. If URL matches an entry, those credentials are used.
authentication:
# Match repository
- url: "https://example.com/group1/repo1"
username: "user1"
password: "pass1"
# Match repository group
- url: "https://example.com/group1/*"
username: "user2"
password: "pass2"
# Example of matching Gitlab LFS URL
# Note that escape sequence is used to escape the ? character
- url: 'https://example.com/api/v4/projects/group1%2Fnestedgroup%2Frepo/repository/files/lfs_object.tar.gz/raw\?ref=*&lfs=true'
username: "user3"
password: "user3"
Additional notes for plugins
This solution would allow for plugins to also authenticate using user configuration, without having to implement a custom solution for authenticating per-url.
The following merge request was created by me for buildstream-plugins-community, where I implement a solution similar to what I've described above, but credentials are obtained from ~/.gitconfig:
https://gitlab.com/BuildStream/buildstream-plugins-community/-/merge_requests/445.
- Dominant language
- Python
- Stars
- 144
- Forks
- 45
- Avg merge
- 20h 38m
- Merged PRs (30d)
- 6
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from apache/buildstream
-
logging
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
apache/buildstream#2150 · 3 comments ·
-
question
Difficulty 2/5 1-3 hours Newbie friendliness 64/100
apache/buildstream#2143 · 2 comments · 1 reaction ·
-
Difficulty 3/5 1-2 days Newbie friendliness 55/100
apache/buildstream#2194 ·
-
Modification time of an element with an open workspace propagates into consumer element's sandbox Openbug
Difficulty 3/5 1-2 days Newbie friendliness 58/100
apache/buildstream#2186 · 2 comments · 2 reactions ·
-
Difficulty 3/5 1-2 days Newbie friendliness 55/100
apache/buildstream#2184 · 1 comment ·
All issues in apache/buildstream
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100