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

Respect passed-in Viper instance in helper utility #64

Merged
merged 1 commit into from
Oct 24, 2022
Merged

Conversation

JAORMX
Copy link
Collaborator

@JAORMX JAORMX commented Oct 24, 2022

When calling RegisterViperOIDCFlags, the Viper instance wasn't being
respected. Instead the underlying function used the global instance...
which is fine in most cases, but is not what was requested by the
library user.

This instead fixes that by actually using a function to bind the flag to
a viper instance using the given instance. The previously used bind
function is kept to ensure backwards compatibility with applications
that might still be using it.

Closes #43

Signed-off-by: Juan Antonio Osorio juan.osoriorobles@eu.equinix.com

When calling `RegisterViperOIDCFlags`, the `Viper` instance wasn't being
respected. Instead the underlying function used the global instance...
which is fine in most cases, but is not what was requested by the
library user.

This instead fixes that by actually using a function to bind the flag to
a viper instance using the given instance. The previously used bind
function is kept to ensure backwards compatibility with applications
that might still be using it.

Signed-off-by: Juan Antonio Osorio <juan.osoriorobles@eu.equinix.com>
@JAORMX JAORMX requested review from a team, andy-v-h and jnschaeffer October 24, 2022 07:19
Copy link
Contributor

@fishnix fishnix left a comment

Choose a reason for hiding this comment

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

nice find 👍

@JAORMX JAORMX merged commit 9bca6f3 into main Oct 24, 2022
@JAORMX JAORMX deleted the fix-viper branch October 24, 2022 15:47
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.

ginjwt.RegisterViperOIDCFlags and ginjwt.GetAuthConfigFromFlags don't respect flags
3 participants