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

Fix crash in v0.27.0 when s3_signing is configured #3256

Merged
merged 1 commit into from
Mar 12, 2021

Conversation

anderseknert
Copy link
Member

This was caused by new logger not getting properly initialized in NewClient
call.

Fixes #3255

Signed-off-by: Anders Eknert anders@eknert.com

This was caused by new logger not getting properly initialized in NewClient
call.

Fixes open-policy-agent#3255

Signed-off-by: Anders Eknert <anders@eknert.com>
authPlugin := &awsSigningAuthPlugin{
AWSEnvironmentCredentials: &awsEnvironmentCredentialService{},
}
client, err := New([]byte(config), map[string]*keys.Config{}, AuthPluginLookup(func(name string) HTTPAuthPlugin {
Copy link
Contributor

Choose a reason for hiding this comment

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

[nit]

Suggested change
client, err := New([]byte(config), map[string]*keys.Config{}, AuthPluginLookup(func(name string) HTTPAuthPlugin {
client, err := New([]byte(config), map[string]*keys.Config{}, AuthPluginLookup(func(string) HTTPAuthPlugin {

@@ -1277,6 +1277,38 @@ func TestOauth2ClientCredentialsJwtAuthentication(t *testing.T) {
}
}

// https://github.com/open-policy-agent/opa/issues/3255
func TestS3SigningInstantiationInitializesLogger(t *testing.T) {
config := fmt.Sprintf(`{
Copy link
Contributor

Choose a reason for hiding this comment

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

[nit] There doesn't seem to be a need for Sprintf here.

Suggested change
config := fmt.Sprintf(`{
config := `{

@srenatus
Copy link
Contributor

Merely low-priority nitpicks. Merging.

@srenatus srenatus merged commit 83a7079 into open-policy-agent:master Mar 12, 2021
This was referenced Mar 12, 2021
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.

OPA v0.27.0 crashes with s3_signing configured
2 participants