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

feat(bff): load x-forwarded-access-token in cluster setup #558

Merged
merged 1 commit into from
Nov 13, 2024

Conversation

ederign
Copy link
Member

@ederign ederign commented Nov 11, 2024

load x-forwarded-access-token in cluster setup

Description

In this PR:

  • middleware.go: load the bearerToken from x-forwarded-access-token and did a small refactoring to avoid leaking k8s client api;
  • k8s.go: move the rest.inclusterConfig logic here for better encapsulation
  • apiUtils.go: add the token parameter to the header also in calls where content type is set,

How Has This Been Tested?

  1. Built UI and BFF images locally and pushed to kind.
  2. Used new 'make kind-deployment' to create and deploy everything to kind.
Screenshot 2024-11-11 at 11 32 44 AM

Merge criteria:

  • All the commits have been signed-off (To pass the DCO check)
  • The commits have meaningful messages; the author will squash them after approval or in case of manual merges will ask to merge with squash.
  • Testing instructions have been added in the PR body (for PRs involving changes that are not immediately obvious).
  • The developer has manually tested the changes and verified that the changes work.
  • Code changes follow the kubeflow contribution guidelines.

Signed-off-by: Eder Ignatowicz <ignatowicz@gmail.com>
@lucferbux
Copy link
Contributor

Ok, tested and it works flawlesly! Great addition, we now have a working version of the deployment.

Copy link
Contributor

@lucferbux lucferbux left a comment

Choose a reason for hiding this comment

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

/lgtm

Copy link

@lucferbux: changing LGTM is restricted to collaborators

In response to this:

/lgtm

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.

Copy link
Contributor

@alexcreasy alexcreasy left a comment

Choose a reason for hiding this comment

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

Great PR, thanks Eder!

@@ -76,7 +76,10 @@ const callRestJSON = <T>(

return fetch(`${host}${path}${searchParams ? `?${searchParams}` : ''}`, {
Copy link
Contributor

Choose a reason for hiding this comment

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

I think it's generally better to use the URL api to construct this rather than a string template. You get URL encoding / escaping for free that way.

That said this is a nit so I won't hold the PR up for it :)

Copy link

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: alexcreasy, lucferbux

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

@alexcreasy
Copy link
Contributor

/lgtm

@google-oss-prow google-oss-prow bot added the lgtm label Nov 13, 2024
@google-oss-prow google-oss-prow bot merged commit 30f7c26 into kubeflow:main Nov 13, 2024
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants