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

Grafana auth_token MFA #225

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

djthread
Copy link

@djthread djthread commented Dec 5, 2023

This change allows the grafana or metrics_server auth_token configs to be MFAs. I need this for my company's infrastructure where Google IAP is in front of Grafana, and I need to fetch a token as needed with a 1 hour ttl.

Comment on lines +27 to +34
def build(finch_process, %{host: host, auth_token: {m, f, a}}) do
%__MODULE__{
finch_process: finch_process,
base_url: normalize_host(host),
authorization: "Bearer #{apply(m, f, a)}"
}
end

Choose a reason for hiding this comment

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

Why not accept a function too?

Choose a reason for hiding this comment

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

My reason is that the mfa is coming in from a config file, and anonymous functions are a no-go there. Probably, an anonymous function could be accepted if passed in another way, but it was out of scope with what I was going for.

@djthread
Copy link
Author

djthread commented Feb 5, 2024

@akoutmos I don't think I'll be needing the functionality in this PR for now, so feel free to close it. (I did make a few documentation changes you might be interested in, though.)

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