Skip to content

Conversation

@ywangd
Copy link
Member

@ywangd ywangd commented Dec 20, 2021

The variable lives in Subject since #80926. The PR also replace string
concatenation with text block to be consistent with other refactoring
efforts (#80751).

The variable lives in Subject since elastic#80926. The PR also replace string
concatenation with text block to be consistent with other refactoring
efforts (elastic#80751).
@ywangd ywangd added >non-issue :Security/Security Security issues without another label v8.1.0 labels Dec 20, 2021
@ywangd ywangd requested a review from tvernum December 20, 2021 23:09
@elasticmachine elasticmachine added the Team:Security Meta label for security team label Dec 20, 2021
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-security (Team:Security)

"enabled": true
}
}
}""");
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we want this formatting?
We push those bytes around the cluster and store them in ThreadContext, what's the impact of a 25% increase in the size of the string?

Copy link
Member Author

Choose a reason for hiding this comment

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

Good question. I just thought it looks nicer in this format and didn't think of other implications. We don't store it in threadContext or sent it across nodes. But we do parse RoleDescriptor from it and more importantly computing message digest for it. So I think it's better not to have the format.

One alternative to reverting the change is to add a call of .replaceAll("[\\n ]", "") at the end of the text block. So it can leverage the better looking format without paying most of the runtime cost. This approach is not very future proof. But since the value is meant to be immutable for this variable. It is not really a concern.

I am happy to just simply revert given the main purpose of this PR is to getting rid of unused variable. What do you think?

Copy link
Member Author

Choose a reason for hiding this comment

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

I decided to revert the format change.

@ywangd ywangd requested a review from tvernum December 23, 2021 01:03
@ywangd ywangd merged commit 7b90d6f into elastic:master Jan 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

>non-issue :Security/Security Security issues without another label Team:Security Meta label for security team v8.1.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants