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 omitempty to authorization.auth_users #218

Merged
merged 1 commit into from
Feb 16, 2024
Merged

Conversation

caleblloyd
Copy link
Contributor

In account claims, authorization is a struct so it always gets serialized even though it has omitempty

And since authorization.auth_users doesn't currently have omitempty, by default that always gets serialized to null

So every account JWT by default is ending up with:

  "nats": {
    "authorization": {
      "auth_users": null
    },
    ...
}

After this change, it will be:

  "nats": {
    "authorization": {},
    ...
}

To get rid of the empty authorization field, we would have to change Account.Authorization to a Pointer

Signed-off-by: Caleb Lloyd <caleb@synadia.com>
@coveralls
Copy link

Pull Request Test Coverage Report for Build 7935547480

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 81.042%

Totals Coverage Status
Change from base Build 7919651659: 0.0%
Covered Lines: 2723
Relevant Lines: 3360

💛 - Coveralls

Copy link
Member

@derekcollison derekcollison left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Member

@aricart aricart left a comment

Choose a reason for hiding this comment

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

LGTM

@aricart aricart merged commit 38e07c5 into main Feb 16, 2024
6 checks passed
@aricart aricart deleted the authorization_omitempty branch February 16, 2024 21:07
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.

4 participants