Skip to content

feat: setting to override trusted sites list#1819

Merged
mosteo merged 4 commits into
alire-project:masterfrom
Seb-MCaw:feat/trusted-sites-setting
Jan 13, 2025
Merged

feat: setting to override trusted sites list#1819
mosteo merged 4 commits into
alire-project:masterfrom
Seb-MCaw:feat/trusted-sites-setting

Conversation

@Seb-MCaw

Copy link
Copy Markdown
Contributor

Closes #814.

The alr publish and alr index --check commands currently require that Git origins use a URL with a host found in a hard-coded list of trusted sites, motivated by concerns regarding SHA1 hash collisions. Those using their own hosting arrangements (with private indexes) need to be able to configure this list.

This PR makes the list configurable, except when using alr publish without the --for-private-index switch.

PR creation checklist
  • A test is included, if required by the changes.
  • doc/user-changes.md has been updated, if applicable.

@Seb-MCaw Seb-MCaw force-pushed the feat/trusted-sites-setting branch from 57a0fa6 to 6f5a74c Compare January 10, 2025 14:18
Comment thread alire.toml
@Seb-MCaw Seb-MCaw marked this pull request as ready for review January 10, 2025 15:09
@Seb-MCaw

Copy link
Copy Markdown
Contributor Author

Ready for review @mosteo.

@mosteo mosteo left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A minor refactor and a general comment:

I find using ' ' or whitespace in general to mean any domain is a bit hackish and won't be nice when printing settings with alr settings. What do you think about using some impossible domain, like '*' or "..." instead? (Probably the latter to avoid interactions with shell expansions at the time of setting.)

Comment thread src/alire/alire-publish.adb Outdated
Comment thread src/alire/alire-index.adb Outdated
Comment thread src/alire/alire-publish.ads Outdated
@Seb-MCaw

Copy link
Copy Markdown
Contributor Author

I find using ' ' or whitespace in general to mean any domain is a bit hackish ...

Agreed. '*' was my first thought, but will definitely cause problems, and an empty list was the best alternative I could come up with. '...' is a good idea, though; thanks for the suggestion.

@Seb-MCaw Seb-MCaw requested a review from mosteo January 13, 2025 11:28
@mosteo mosteo merged commit 09b3893 into alire-project:master Jan 13, 2025
@mosteo

mosteo commented Jan 13, 2025

Copy link
Copy Markdown
Member

Merged, thanks.

@Seb-MCaw Seb-MCaw deleted the feat/trusted-sites-setting branch January 13, 2025 16:51
@Joebeazelman

Copy link
Copy Markdown

This feature needs to be documented for private indexes. I'm getting an error because dev.azure.com isn't a recognized one.

@Seb-MCaw

Copy link
Copy Markdown
Contributor Author

This feature needs to be documented for private indexes.

It is already documented at the end of the second paragraph here, but it could stand to be better signposted; I have opened #1985.

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.

Adding trusted sites

3 participants