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

OLS-1379: Forward user's token #2214

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

Conversation

onmete
Copy link
Contributor

@onmete onmete commented Feb 6, 2025

Description

Forward user's token for future use in agent/tool

Type of change

  • New feature

@openshift-ci-robot openshift-ci-robot added the jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. label Feb 6, 2025
@openshift-ci-robot
Copy link

openshift-ci-robot commented Feb 6, 2025

@onmete: This pull request references OLS-1379 which is a valid jira issue.

In response to this:

Description

Forward user's token for future use in agent/tool

Type of change

  • New feature

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 review from joshuawilson and tisnik February 6, 2025 15:00
Copy link

openshift-ci bot commented Feb 6, 2025

[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 assign bparees for approval. For more information see the 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

Copy link

openshift-ci bot commented Feb 6, 2025

@onmete: 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-sigs/prow repository. I understand the commands that are listed here.

@onmete
Copy link
Contributor Author

onmete commented Feb 7, 2025

/assign @tisnik

Copy link
Contributor

@tisnik tisnik left a comment

Choose a reason for hiding this comment

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

looks ok in overall, having some nitpicks

"""
user_token = "" # no-op auth yield no token
Copy link
Contributor

Choose a reason for hiding this comment

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

NO_TOKEN or something similar stored in constants perhaps?


# Check if the correct user info has been returned
assert user_uid == user_id_in_request
assert username == DEFAULT_USER_NAME
assert skip_user_id_check is True
assert token == ""
Copy link
Contributor

Choose a reason for hiding this comment

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

dtto (as DEFAULT_USER_NAME) might be more readable

@@ -163,7 +165,7 @@ def conversation_request(
def process_request(
auth: Any, llm_request: LLMRequest
) -> tuple[
str, str, str, list[CacheEntry], list[Attachment], bool, dict[str, float], str
str, str, str, list[CacheEntry], list[Attachment], bool, dict[str, float], str, str
Copy link
Contributor

Choose a reason for hiding this comment

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

hmm sooner or later it would be valuable to create a model class for this tuple


# Check if the correct user info has been returned
assert user_uid == DEFAULT_USER_UID
assert username == DEFAULT_USER_NAME
assert skip_user_id_check is True
assert token == ""
Copy link
Contributor

Choose a reason for hiding this comment

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

see below please


# Check if the correct user info has been returned
assert user_uid == DEFAULT_USER_UID
assert username == DEFAULT_USER_NAME
assert skip_user_id_check is True
assert token == ""
Copy link
Contributor

Choose a reason for hiding this comment

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

see below please

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
jira/valid-reference Indicates that this PR references a valid Jira ticket of any type.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants