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

[CHANGE] retracts case-sensitive support for tags #229

Closed
wants to merge 1 commit into from

Conversation

aricart
Copy link
Member

@aricart aricart commented Sep 26, 2024

This PR changes the version of the JWT library, which has added a new "Exact" API that is case-sensitive. The use of the old API will store lowercase entries and match them in a case-insensitive manner. This enables current usage in nats-server to work as it has without changes.

2.11 will switch the APIs to use the case-sensitive ("Exact") variants of the API.

nats-io/nats-server#5954

@coveralls
Copy link

coveralls commented Sep 26, 2024

Pull Request Test Coverage Report for Build 11151788916

Details

  • 78 of 89 (87.64%) changed or added relevant lines in 1 file are covered.
  • 1 unchanged line in 1 file lost coverage.
  • Overall coverage increased (+0.4%) to 81.375%

Changes Missing Coverage Covered Lines Changed/Added Lines %
v2/types.go 78 89 87.64%
Files with Coverage Reduction New Missed Lines %
v2/types.go 1 88.95%
Totals Coverage Status
Change from base Build 10906299209: 0.4%
Covered Lines: 2818
Relevant Lines: 3463

💛 - Coveralls

@aricart
Copy link
Member Author

aricart commented Sep 26, 2024

The PR adds code, just in case if some jwt were edited and contain mix values reads will honor the lower-case contract.

Copy link

@ripienaar ripienaar left a comment

Choose a reason for hiding this comment

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

I thought we said we would:

  • store tags with case and largely make the api case sensitive
  • make the current functions the server use operate without case sensitivity
  • add new ones, of the ones that the server use, to work on the mix case tags and make 2.11 use those
  • nsc will fail if anything but lowercase tag is added without passing the flag to enable that

This has the smallest surface area and introduce the least amount of new things - its just what the server needs nothing more.

So largely I think this tracks well but Add(), Remove() etc should all be case sensitive

// FindTag finds entries that start with the specified name
// followed by a colon (:). Names are case-insensitive for
// matches. This function returns the name+:+value (the entire "entry").
func (u *TagList) FindTag(v string) *TagList {

Choose a reason for hiding this comment

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

bit sad to be adding new case insensitive APIs here but I guess this is to replace the feature where the server today does its own walking and iterating.

@aricart aricart closed this Oct 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants