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

Improvements to debug logging and CORS handling #759

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

alexcreasy
Copy link
Contributor

@alexcreasy alexcreasy commented Feb 4, 2025

Description

Adds some improvements to debug logging:

  • Less boilerplate and easier to use code style that follows the slog API
  • Logging of headers with redaction of sensitive headers
  • Logs static resource requests

Improves CORS handling, making the calls more efficient

How Has This Been Tested?

Run with locally on kind, fire off some curl requests and analyse what comes out, try something like this:

curl -i -H "Authorization: top-secret-token-tell-noone" -H "kubeflow-userid: user@example.com" -X POST "http://localhost:4000/api/v1/model_registry/model-registry/registered_models?namespace=kubeflow" \
     -H "Content-Type: application/json" \
     -d '{ "data": {
  "customProperties": {
    "my-label9": {
      "metadataType": "MetadataStringValue",
      "string_value": "val"
    }
  },
  "description": "bella description",
  "externalId": "9927",
  "name": "bella",
  "owner": "eder",
  "state": "LIVE"
}}'

Verify the Authorisation header is redacted.

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.

If you have UI changes

  • The developer has added tests or explained why testing cannot be added.
  • Included any necessary screenshots or gifs if it was a UI change.
  • Verify that UI/UX changes conform the UX guidelines for Kubeflow.

Copy link

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please ask for approval from alexcreasy. For more information see the Kubernetes Code Review Process.

The full list of commands accepted by this bot can be found 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 alexcreasy changed the title Improvments to debug logging and CORS handling Improvements to debug logging and CORS handling Feb 4, 2025
Signed-off-by: Alex Creasy <alex@creasy.dev>
@alexcreasy
Copy link
Contributor Author

@lucferbux @ederign any chance of a review when you get a moment?

@ederign
Copy link
Member

ederign commented Feb 10, 2025

I'll look at it today! sorry for the delay!

@ederign
Copy link
Member

ederign commented Feb 10, 2025

Thank you @alexcreasy ! I did a small sanity check locally also with web app.

@ederign
Copy link
Member

ederign commented Feb 10, 2025

/lgtm

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.

2 participants