-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Add .swiftpm/config/registries.json to default .gitignore #3468
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
As discussed in SE-0292, a user may inadvertently reveal the existence of a private registry or expose hardcoded credentials by checking in their project's .swiftpm/config file or directory. By adding this entry to the .gitignore file in the new project template, we significantly minimize the possibility of the user leaking credentials in the future.
|
@swift-ci please smoke test |
|
I'm not sure I agree with this. If we think the per-package config cannot be checked in, it basically has zero value and shouldn't exist in the first place. |
|
@neonichu Adding
Also, there are plenty of examples across various ecosystems of files that provide local configuration that aren't checked into source control, such as Swift Package Manager has used local configuration files in |
|
I agree with @neonichu here. adding this categorically can be unexpected behavior, and this is not enough as security mitigation for credential handling discussed on SE-0292 |
For what it's worth, Swift Package Manager itself ignores the If you look at GitHub's own repository of recommended
There are reasons to ignore configuration beyond leaking credentials, which I articulate here:
|
|
hi @mattt coming back to this, I think a balanced solution could be to to add |
|
@swift-ci Please smoke test |
This PR adds
.swiftpm/configto the.gitignorefile in the new project template.Motivation:
As discussed in SE-0292, a user may inadvertently reveal the existence of a private registry or expose hardcoded credentials by checking in their project's
.swiftpm/configfile or directory. Adding this entry to the.gitignorefile in the new project template significantly minimize the possibility of the user leaking credentials in the future.Modifications:
+ .swiftpm/configResult:
After this change, all future projects created by running swift package init will default to ignoring
.swiftpm/configfiles (which covers both the file.swiftpm/configif it's a file, and the contents of the directory if.swiftpm/config/is a directory).Existing packages will be unaffected.