Skip to content

OCPBUGS-24987, OCPBUGS-30319: bump lib-go to fix SAs acting as OAuth2 clients #142

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

Merged

Conversation

liouk
Copy link
Member

@liouk liouk commented Mar 14, 2024

@liouk
Copy link
Member Author

liouk commented Mar 14, 2024

/hold proof PR

@openshift-ci openshift-ci bot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Mar 14, 2024
@liouk liouk force-pushed the prove-kubernetes-apiserver-56 branch 2 times, most recently from d03fda9 to db5c362 Compare March 15, 2024 12:21
@liouk
Copy link
Member Author

liouk commented Mar 15, 2024

/retest-required

5 similar comments
@liouk
Copy link
Member Author

liouk commented Mar 18, 2024

/retest-required

@liouk
Copy link
Member Author

liouk commented Mar 18, 2024

/retest-required

@liouk
Copy link
Member Author

liouk commented Mar 19, 2024

/retest-required

@liouk
Copy link
Member Author

liouk commented Mar 20, 2024

/retest-required

@liouk
Copy link
Member Author

liouk commented Mar 25, 2024

/retest-required

@liouk liouk force-pushed the prove-kubernetes-apiserver-56 branch 4 times, most recently from 1c53e75 to f731bf2 Compare April 10, 2024 14:06
@liouk
Copy link
Member Author

liouk commented Apr 10, 2024

Updated PR to point to openshift/[email protected].

@liouk
Copy link
Member Author

liouk commented Apr 11, 2024

/retest-required

@liouk
Copy link
Member Author

liouk commented Apr 11, 2024

/retitle OCPBUGS-30319: Bump openshift/kubernetes-apiserver to openshift-apiserver-4.16-kubernetes-1.29.2

@openshift-ci openshift-ci bot changed the title Proof for https://github.com/openshift/kubernetes-apiserver/pull/56 OCPBUGS-30319: Bump openshift/kubernetes-apiserver to openshift-apiserver-4.16-kubernetes-1.29.2 Apr 11, 2024
@openshift-bot openshift-bot added jira/severity-important Referenced Jira bug's severity is important for the branch this PR is targeting. jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. jira/valid-bug Indicates that a referenced Jira bug is valid for the branch this PR is targeting. labels Apr 11, 2024
@openshift-bot
Copy link
Contributor

@liouk: This pull request references Jira Issue OCPBUGS-30319, which is valid.

3 validation(s) were run on this bug
  • bug is open, matching expected state (open)
  • bug target version (4.16.0) matches configured target version for branch (4.16.0)
  • bug is in the state POST, which is one of the valid states (NEW, ASSIGNED, POST)

Requesting review from QA contact:
/cc @dpuniaredhat

The bug has been updated to refer to the pull request using the external bug tracker.

In response to this:

Pulls openshift/kubernetes-apiserver#56

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

@openshift-ci openshift-ci bot requested a review from dpuniaredhat April 11, 2024 10:16
@stlaz
Copy link
Contributor

stlaz commented Apr 11, 2024

/retitle OCPBUGS-30319: bump lib-go to fix SAs acting as OAuth2 clients

@openshift-ci openshift-ci bot changed the title OCPBUGS-30319: Bump openshift/kubernetes-apiserver to openshift-apiserver-4.16-kubernetes-1.29.2 OCPBUGS-30319: bump lib-go to fix SAs acting as OAuth2 clients Apr 11, 2024
@@ -1,4 +1,4 @@
FROM registry.ci.openshift.org/ocp/builder:rhel-8-golang-1.19-openshift-4.14 AS builder
Copy link
Contributor

Choose a reason for hiding this comment

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

maybe also update the runner image?

Copy link
Member

Choose a reason for hiding this comment

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

You can't change the base image to RHEL 9 without also changing the build image to RHEL 9, because RHEL 8 and 9 have different versions of OpenSSL. This change has broken all FIPS clusters.

func WithPreserveAuthorizationHeader(handler http.Handler) http.Handler {
var oauthHeaders = []string{
"Authorization",
"X-Remote-User",
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we keep all the authentication headers the default handler chain removes?
The requestheader provider won't work properly in case any of the headers configured in https://github.com/openshift/api/blob/master/config/v1/types_oauth.go#L415-L424 match any headers that are being removed in the kube default handler chain.

@liouk liouk force-pushed the prove-kubernetes-apiserver-56 branch from f731bf2 to 4a5a3dc Compare April 11, 2024 12:17
@liouk
Copy link
Member Author

liouk commented Apr 11, 2024

Proof PR updated and can now be used to perform the actual bump.

/hold cancel

@openshift-ci openshift-ci bot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Apr 11, 2024
Comment on lines 351 to 360
preservedHeaders := make([]string, 0)
for _, identityProvider := range c.ExtraOAuthConfig.Options.IdentityProviders {
switch provider := identityProvider.Provider.Object.(type) {
case *osinv1.RequestHeaderIdentityProvider:
preservedHeaders = append(preservedHeaders, provider.Headers...)
preservedHeaders = append(preservedHeaders, provider.PreferredUsernameHeaders...)
preservedHeaders = append(preservedHeaders, provider.NameHeaders...)
preservedHeaders = append(preservedHeaders, provider.EmailHeaders...)
}
}
Copy link
Contributor

Choose a reason for hiding this comment

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

extract into a function, shove into the With*() call

)

func WithPreserveAuthorizationHeader(handler http.Handler) http.Handler {
func WithPreserveOAuthHeaders(handler http.Handler, preservedHeaders []string) http.Handler {
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
Copy link
Contributor

Choose a reason for hiding this comment

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

build the complete headers slice ahead of time, not during HTTP handling

@liouk liouk force-pushed the prove-kubernetes-apiserver-56 branch from 4a5a3dc to c0803c4 Compare April 12, 2024 09:54
WORKDIR /go/src/github.com/openshift/oauth-server
COPY . .
ENV GO_PACKAGE github.com/openshift/oauth-server
RUN make build --warn-undefined-variables

FROM registry.ci.openshift.org/ocp/4.14:base
FROM registry.ci.openshift.org/ocp/4.16:base
Copy link
Contributor

Choose a reason for hiding this comment

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

FROM registry.ci.openshift.org/ocp/4.16:base-rhel9

@liouk liouk force-pushed the prove-kubernetes-apiserver-56 branch from c0803c4 to bacdbd8 Compare April 12, 2024 12:57
@stlaz
Copy link
Contributor

stlaz commented Apr 12, 2024

/lgtm

@stlaz
Copy link
Contributor

stlaz commented Apr 12, 2024

/retitle OCPBUGS-24987, OCPBUGS-30319: bump lib-go to fix SAs acting as OAuth2 clients

@openshift-ci openshift-ci bot changed the title OCPBUGS-30319: bump lib-go to fix SAs acting as OAuth2 clients OCPBUGS-24987, OCPBUGS-30319: bump lib-go to fix SAs acting as OAuth2 clients Apr 12, 2024
@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Apr 12, 2024
Copy link
Contributor

openshift-ci bot commented Apr 12, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: liouk, stlaz

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

@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Apr 12, 2024
@openshift-ci-robot
Copy link
Contributor

/retest-required

Remaining retests: 0 against base HEAD 8296c05 and 2 for PR HEAD bacdbd8 in total

Copy link
Contributor

openshift-ci bot commented Apr 12, 2024

@liouk: all tests passed!

Full PR test history. Your PR dashboard.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here.

@openshift-merge-bot openshift-merge-bot bot merged commit 396c1ff into openshift:master Apr 12, 2024
8 checks passed
@openshift-ci-robot
Copy link
Contributor

@liouk: Jira Issue OCPBUGS-30319: Some pull requests linked via external trackers have merged:

The following pull requests linked via external trackers have not merged:

These pull request must merge or be unlinked from the Jira bug in order for it to move to the next state. Once unlinked, request a bug refresh with /jira refresh.

Jira Issue OCPBUGS-30319 has not been moved to the MODIFIED state.

In response to this:

Pulls openshift/kubernetes-apiserver#56

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

@openshift-bot
Copy link
Contributor

[ART PR BUILD NOTIFIER]

This PR has been included in build oauth-server-container-v4.16.0-202404121812.p0.g396c1ff.assembly.stream.el9 for distgit oauth-server.
All builds following this will include this PR.

@openshift-merge-robot
Copy link
Contributor

Fix included in accepted release 4.16.0-0.nightly-2024-04-15-184947

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. jira/severity-important Referenced Jira bug's severity is important for the branch this PR is targeting. jira/valid-bug Indicates that a referenced Jira bug is valid for the branch this PR is targeting. jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. lgtm Indicates that a PR is ready to be merged.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants