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

Add credentials to HTTP resolver #7315

Conversation

chmouel
Copy link
Member

@chmouel chmouel commented Oct 31, 2023

Changes

This adds the ability to pass credentials to the HTTP resolver when fetching the URL.

This let the user for example fetch a task from another SCM private repositories on another SCM providers than the one configured with the git resolver.

Fixes #7296

Submitter Checklist

As the author of this PR, please check off the items in this checklist:

  • Has Docs if any changes are user facing, including updates to minimum requirements e.g. Kubernetes version bumps
  • Has Tests included if any functionality added or changed
  • Follows the commit message standard
  • Meets the Tekton contributor standards (including functionality, content, code)
  • Has a kind label. You can add one by adding a comment on this PR that contains /kind <type>. Valid types are bug, cleanup, design, documentation, feature, flake, misc, question, tep
  • Release notes block below has been updated with any user facing changes (API changes, bug fixes, changes requiring upgrade notices or deprecation warnings). See some examples of good release notes.
  • Release notes contains the string "action required" if the change requires additional action from users switching to the new release

Release Notes

The http resolver supports passing username and password for fetching URLs with basic credentials

/kind feature

@tekton-robot tekton-robot added kind/feature Categorizes issue or PR as related to a new feature. release-note Denotes a PR that will be considered when it comes time to generate release notes. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Oct 31, 2023
@tekton-robot
Copy link
Collaborator

The following is the coverage report on the affected files.
Say /test pull-tekton-pipeline-go-coverage to re-run this coverage report

File Old Coverage New Coverage Delta
pkg/resolution/resolver/http/resolver.go 92.5% 92.4% -0.2

@tekton-robot
Copy link
Collaborator

The following is the coverage report on the affected files.
Say /test pull-tekton-pipeline-go-coverage-df to re-run this coverage report

File Old Coverage New Coverage Delta
pkg/resolution/resolver/http/resolver.go 92.5% 92.4% -0.2

@chmouel chmouel force-pushed the issue-7296-usernamepassword-support-in-http-resolver branch from e9fe4a9 to c9f92ad Compare October 31, 2023 11:21
@tekton-robot
Copy link
Collaborator

The following is the coverage report on the affected files.
Say /test pull-tekton-pipeline-go-coverage to re-run this coverage report

File Old Coverage New Coverage Delta
pkg/resolution/resolver/http/resolver.go 92.5% 92.4% -0.2

@tekton-robot
Copy link
Collaborator

The following is the coverage report on the affected files.
Say /test pull-tekton-pipeline-go-coverage-df to re-run this coverage report

File Old Coverage New Coverage Delta
pkg/resolution/resolver/http/resolver.go 92.5% 92.4% -0.2

@tekton-robot
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: vdemeester

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@tekton-robot tekton-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Oct 31, 2023
@chmouel chmouel force-pushed the issue-7296-usernamepassword-support-in-http-resolver branch from c9f92ad to 724f260 Compare November 6, 2023 08:09
@tekton-robot
Copy link
Collaborator

The following is the coverage report on the affected files.
Say /test pull-tekton-pipeline-go-coverage to re-run this coverage report

File Old Coverage New Coverage Delta
pkg/resolution/resolver/http/resolver.go 92.5% 92.4% -0.2

@tekton-robot
Copy link
Collaborator

The following is the coverage report on the affected files.
Say /test pull-tekton-pipeline-go-coverage-df to re-run this coverage report

File Old Coverage New Coverage Delta
pkg/resolution/resolver/http/resolver.go 92.5% 92.4% -0.2

@chmouel chmouel force-pushed the issue-7296-usernamepassword-support-in-http-resolver branch from 724f260 to 64d3ee4 Compare November 7, 2023 07:51
@tekton-robot
Copy link
Collaborator

The following is the coverage report on the affected files.
Say /test pull-tekton-pipeline-go-coverage-df to re-run this coverage report

File Old Coverage New Coverage Delta
pkg/resolution/resolver/http/resolver.go 92.5% 92.4% -0.2

@tekton-robot
Copy link
Collaborator

The following is the coverage report on the affected files.
Say /test pull-tekton-pipeline-go-coverage to re-run this coverage report

File Old Coverage New Coverage Delta
pkg/resolution/resolver/http/resolver.go 92.5% 92.4% -0.2

pkg/resolution/resolver/http/params.go Outdated Show resolved Hide resolved
pkg/resolution/resolver/http/params.go Outdated Show resolved Hide resolved
pkg/resolution/resolver/http/params.go Outdated Show resolved Hide resolved
pkg/resolution/resolver/http/resolver.go Show resolved Hide resolved
tokenSecretKey = v
}
}
secretNS := common.RequestNamespace(ctx)
Copy link
Member

Choose a reason for hiding this comment

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

The namespace is the same as the one with TaskRun/PiplineRun or from the default? I think we need to clarify which namespace we're using in the docs&docstrings

@jerop jerop modified the milestones: Pipelines v0.54, Pipelines v0.55 Nov 9, 2023
This adds the ability to pass credentials to the HTTP resolver when
fetching the URL.

This let's for example to fetch tasks from SCM private repositories on
other SCM providers than configured with the git resolver.

Fixes tektoncd#7296

Signed-off-by: Chmouel Boudjnah <chmouel@redhat.com>
@chmouel chmouel force-pushed the issue-7296-usernamepassword-support-in-http-resolver branch from 64d3ee4 to c17dc30 Compare November 15, 2023 12:13
@tekton-robot
Copy link
Collaborator

The following is the coverage report on the affected files.
Say /test pull-tekton-pipeline-go-coverage to re-run this coverage report

File Old Coverage New Coverage Delta
pkg/resolution/resolver/http/resolver.go 92.5% 92.4% -0.2

@tekton-robot
Copy link
Collaborator

The following is the coverage report on the affected files.
Say /test pull-tekton-pipeline-go-coverage-df to re-run this coverage report

File Old Coverage New Coverage Delta
pkg/resolution/resolver/http/resolver.go 92.5% 92.4% -0.2

@Yongxuanzhang
Copy link
Member

Thanks!
/lgtm

@tekton-robot tekton-robot added the lgtm Indicates that a PR is ready to be merged. label Nov 15, 2023
@tekton-robot tekton-robot merged commit 14d5a10 into tektoncd:main Nov 15, 2023
13 checks passed
@chmouel chmouel deleted the issue-7296-usernamepassword-support-in-http-resolver branch November 16, 2023 07:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. kind/feature Categorizes issue or PR as related to a new feature. lgtm Indicates that a PR is ready to be merged. release-note Denotes a PR that will be considered when it comes time to generate release notes. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Username/Password support in HTTP Resolver
5 participants