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

Support to bootstrap from a user-supplied security.json and minor refactorings to pass auth headers through a Context #356

Merged
merged 11 commits into from
Oct 29, 2021

Conversation

thelabdude
Copy link
Contributor

@thelabdude thelabdude commented Oct 26, 2021

Resolves #355

Includes the non-OIDC related security changes from #346

Copy link
Contributor

@HoustonPutman HoustonPutman left a comment

Choose a reason for hiding this comment

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

Ok this looks good!

Was stumped a bit here but I think it looks good (and I think I understand it haha).

Only things left to do are:

  • Changelog entry (in solr-operator Chart.yaml)
  • Add the option to the solr helm chart & helm chart documentation.

@@ -144,6 +173,34 @@ var _ = FDescribe("SolrCloud controller - Basic Auth", func() {
expectStatefulSetBasicAuthConfig(ctx, solrCloud, false)
})
})

FContext("User Provided Credentials and security.json ConfigMap", func() {
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
FContext("User Provided Credentials and security.json ConfigMap", func() {
FContext("User Provided Credentials and security.json Secret", func() {

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ugh, sorry @HoustonPutman ... moved a little too fast with that conversion! thanks for catching those I missed.

security.SecurityJson = string(bootstrapSecret.Data[SecurityJsonFile])
basicAuthSecret = authSecret
security.SecurityJsonSrc = &corev1.EnvVarSource{
Copy link
Contributor

Choose a reason for hiding this comment

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

Nice. love it.

}
security.CredentialsSecret = basicAuthSecret

// is there a user-provided security.json in a ConfigMap?
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
// is there a user-provided security.json in a ConfigMap?
// is there a user-provided security.json in a Secret?

}
security.SecurityJson = securityJson
security.SecurityJsonSrc = &corev1.EnvVarSource{SecretKeyRef: sec.BootstrapSecurityJson}
} // else no user-provided configMap, no sweat for us
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
} // else no user-provided configMap, no sweat for us
} // else no user-provided secret, no sweat for us

@@ -431,3 +483,22 @@ func useSecureProbe(solrCloud *solr.SolrCloud, probe *corev1.Probe, mountPath st
probe.TimeoutSeconds = 5
}
}

// Called during reconcile to load the security.json from a user-supplied ConfigMap
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
// Called during reconcile to load the security.json from a user-supplied ConfigMap
// Called during reconcile to load the security.json from a user-supplied Secret

@thelabdude thelabdude merged commit 505e244 into apache:main Oct 29, 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.

Bootstrap security.json from user-supplied Secret
2 participants