Skip to content

Conversation

@maciej-lech
Copy link
Contributor

This PR implements the feature discussed in #2473.

It introduces a new --trust CLI flag and a corresponding remote.trust configuration option in taskrc. These options are available when the Remote Taskfiles experiment is enabled.

The --trust flag can be specified multiple times to define trusted hosts (optionally including ports). Any remote Taskfiles fetched from these trusted hosts will not prompt for confirmation on their initial download or when their checksums change.

Closes #2473

@curtbushko
Copy link

Looking forward to this feature!

// Extract host from server URL for trust testing
parsedURL, err := url.Parse(srv.URL)
require.NoError(t, err)
trustedHost := parsedURL.Host
Copy link
Contributor

Choose a reason for hiding this comment

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

Can't I trust URLs? I trust github.com/myself but I don't trust github.com/shady.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I was thinking about that, but using URLs requires more assumptions how to compare provided URL with the trust config.

  1. Exact match, so full URL comparison. In my case it would require configuring every single remote taskfiles (more than dozen now) which is not a big deal, but may not be a best DX.
  2. Prefix match. A problem: I want to trust https://github.com/myself but not https://github.com/myselfHackedByShady - which could be easily solved by setting https://github.com/myself/ and not https://github.com/myself. So maybe this is the best way.
  3. Glob-like style: https://github.com/myself/* or extended version https://github.com/myself/**/*
  4. Regex: https:\/\/github\.com\/myself\/.*

@vmaerten vmaerten self-requested a review November 29, 2025 10:05
Copy link
Member

@vmaerten vmaerten left a comment

Choose a reason for hiding this comment

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

Thanks for your PR!
I would prefer using trusted-hosts instead of trust (both in the CLI and in the config file).

@maciej-lech
Copy link
Contributor Author

maciej-lech commented Dec 2, 2025

Thanks for your PR! I would prefer using trusted-hosts instead of trust (both in the CLI and in the config file).

Thank you for your feedback. Yes, I stumbled across PIP when I was searching for similar implementations. Although, --trusted-hosts in PIP is more like per-domain --insecure, I fully agree it is more explicit. Comma-separated imho is also fine. Let me update this PR

@maciej-lech maciej-lech requested a review from vmaerten December 2, 2025 09:37
@maciej-lech maciej-lech requested a review from vmaerten December 6, 2025 19:18
Copy link
Member

@vmaerten vmaerten left a comment

Choose a reason for hiding this comment

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

I fixed an anchor was not good anymore
LGTM! Thanks for your PR!

@vmaerten vmaerten merged commit 72a349b into go-task:main Dec 7, 2025
13 checks passed
vmaerten added a commit that referenced this pull request Dec 7, 2025
@maciej-lech maciej-lech deleted the remote-trust branch December 8, 2025 08:23
@vmaerten vmaerten mentioned this pull request Dec 11, 2025
18 tasks
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.

Remote Taskfiles: add a new trust mechanism

4 participants