Skip to content
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

Remote Taskfiles: redact credentials of remote URLs in prompts and logs #2045

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

iwittkau
Copy link
Contributor

@iwittkau iwittkau commented Feb 6, 2025

This is to improve #1317.

I've implemented redaction support for the taskfile.Node interface, specifically for the taskfile.GitNode implementation which was logged with the clear-text user access tokens before.

@iwittkau iwittkau mentioned this pull request Feb 6, 2025
16 tasks
@iwittkau iwittkau changed the title Remote Taskfiles: redact credentials of git URLs in prompts and logs Remote Taskfiles: redact credentials of remote URLs in prompts and logs Feb 9, 2025
@iwittkau iwittkau marked this pull request as draft February 9, 2025 10:38
@iwittkau
Copy link
Contributor Author

iwittkau commented Feb 9, 2025

I've turned this into a draft for now.

@@ -122,5 +121,5 @@ func (node *GitNode) ResolveDir(dir string) (string, error) {
}

func (node *GitNode) FilenameAndLastDir() (string, string) {
return filepath.Base(node.path), filepath.Base(filepath.Dir(node.path))
return filepath.Base(filepath.Dir(node.filepath)), filepath.Base(node.filepath)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

taskfile/cache.go uses it like this:

lastDir, filename := node.FilenameAndLastDir()

@iwittkau iwittkau force-pushed the redact-git-urls branch 2 times, most recently from 03a5551 to 3fc6d75 Compare February 9, 2025 20:58
@iwittkau iwittkau marked this pull request as ready for review February 9, 2025 21:02
@iwittkau
Copy link
Contributor Author

Compiling it and running this as a development version actually breaks my own git-based Remote Taskfiles setup 😅

Back to draft, I guess.

@iwittkau iwittkau marked this pull request as draft February 10, 2025 11:27
@iwittkau iwittkau force-pushed the redact-git-urls branch 2 times, most recently from 8b53b31 to 8d0a6cd Compare March 11, 2025 09:37
@pd93 pd93 linked an issue Mar 12, 2025 that may be closed by this pull request
@iwittkau iwittkau marked this pull request as ready for review March 12, 2025 21:35
@iwittkau iwittkau requested review from vmaerten and pd93 March 12, 2025 21:35
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 taskfile could potentially expose secrets
3 participants