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

feat: add support for auth.jwt in config #876

Merged
merged 4 commits into from
Feb 8, 2023

Conversation

rayanebel
Copy link
Contributor

@rayanebel rayanebel commented Jan 25, 2023

Description

This PR will allow to configure grafana with JWT authentication by adding the required auth.jwt property in the config.

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

Checklist

  • This change requires a documentation update
  • I have added tests that prove my fix is effective or that my feature works
  • I have added a test case that will be used to verify my changes
  • Verified independently on a cluster by reviewer

Verification steps

I have added a new test case TestCfgAuthJwt and I've updated the test TestWrite. I did not tried in a fresh cluster to create a Grafana instance with a valid auth.jwt config

Copy link
Collaborator

@NissesSenap NissesSenap left a comment

Choose a reason for hiding this comment

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

Thanks for even more PR:s :)

There is some config that I can't find in the docs.
I haven't read through the grafana code though so there might be stuff missing in the docs.
I don't have time to take a deeper look now though.

Can you please share where you found it.

auto_sign_up = true
cache_ttl = 60m
email_claim = sub
enable_login_token = true
Copy link
Collaborator

Choose a reason for hiding this comment

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hey @NissesSenap
Same thing as my previous PR, I've found all the config here: https://github.com/grafana/grafana/blob/main/conf/sample.ini

key_file = /path/to/key.pem
role_attribute_path = Viewer
role_attribute_strict = true
skip_org_role_sync = true
Copy link
Collaborator

Choose a reason for hiding this comment

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

Also unable to find skip_org_role_sync

@NissesSenap
Copy link
Collaborator

@rayanebel can you please run make test and I think all CI should pass, when that gets done we are more then happy to merge.
I planning to cut a release rather soon so it would be great if you can take a look at this soon.

Copy link
Collaborator

@NissesSenap NissesSenap left a comment

Choose a reason for hiding this comment

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

LGTM

@NissesSenap NissesSenap merged commit 40afe02 into grafana:master Feb 8, 2023
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.

2 participants