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 the toString override to build the role header string #21

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

SaravananPrasadh-SP
Copy link

Issue: 19

A simple fix to handle the building the ROLE trino header to set the user role assumption. Please feel free to comment/suggest better way to handle.

Copy link

cla-bot bot commented Mar 24, 2025

Thank you for your pull request and welcome to the Trino community. We require contributors to sign our Contributor License Agreement, and we don't seem to have you on file. Continue to work with us on the review and improvements in this PR, and submit the signed CLA to [email protected]. Photos, scans, or digitally-signed PDF files are all suitable. Processing may take a few days. The CLA needs to be on file before we merge your changes. For more information, see https://github.com/trinodb/cla


public override string ToString()
{
return Type.ROLE.ToString()+"{"+Role+"}";
Copy link
Member

Choose a reason for hiding this comment

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

This needs to work regardless of the role type. This impl only works for role type = ROLE. What about NONE and ALL?

Choose a reason for hiding this comment

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

Silly me, Thank you!! I fixed it and tested with ROLE and NONE and ALL

Choose a reason for hiding this comment

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

@stephen-zhao : Can you please check if the changes look okay?

Copy link

cla-bot bot commented Mar 24, 2025

Thank you for your pull request and welcome to the Trino community. We require contributors to sign our Contributor License Agreement, and we don't seem to have you on file. Continue to work with us on the review and improvements in this PR, and submit the signed CLA to [email protected]. Photos, scans, or digitally-signed PDF files are all suitable. Processing may take a few days. The CLA needs to be on file before we merge your changes. For more information, see https://github.com/trinodb/cla

Copy link

cla-bot bot commented Mar 24, 2025

Thank you for your pull request and welcome to the Trino community. We require contributors to sign our Contributor License Agreement, and we don't seem to have you on file. Continue to work with us on the review and improvements in this PR, and submit the signed CLA to [email protected]. Photos, scans, or digitally-signed PDF files are all suitable. Processing may take a few days. The CLA needs to be on file before we merge your changes. For more information, see https://github.com/trinodb/cla

Copy link

cla-bot bot commented Mar 24, 2025

Thank you for your pull request and welcome to the Trino community. We require contributors to sign our Contributor License Agreement, and we don't seem to have you on file. Continue to work with us on the review and improvements in this PR, and submit the signed CLA to [email protected]. Photos, scans, or digitally-signed PDF files are all suitable. Processing may take a few days. The CLA needs to be on file before we merge your changes. For more information, see https://github.com/trinodb/cla

Copy link
Member

@stephen-zhao stephen-zhao left a comment

Choose a reason for hiding this comment

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

I noticed in the java reference impl for this class, Role is an optional string, which is inconsistent with what's here. But that can be deemed a separate issue. At least for these changes, since Role is already validated to be not null at construct-time, and is immutable, I think it's safe.

Though please sign the CLA before this can be considered for merge. Also, we will need approvals from the maintainers, as I am but a contributor.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants