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

Make idp only wait for certs when using ldap #3965

Merged
merged 2 commits into from
Jun 15, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Bugfix: Make IDP only wait for certs when using LDAP

When configuring cs3 as the backend the IDP no longer waits for an LDAP certificate to appear.

https://github.com/owncloud/ocis/pull/3965
17 changes: 9 additions & 8 deletions extensions/idp/pkg/service/v0/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,14 +44,6 @@ func NewService(opts ...Option) Service {
assets.Config(options.Config),
)

if err := ldap.WaitForCA(options.Logger, options.Config.IDP.Insecure, options.Config.Ldap.TLSCACert); err != nil {
logger.Fatal().Err(err).Msg("The configured LDAP CA cert does not exist")
}
if options.Config.IDP.Insecure {
// force CACert to be empty to avoid lico try to load it
options.Config.Ldap.TLSCACert = ""
}

if err := createTemporaryClientsConfig(
options.Config.IDP.IdentifierRegistrationConf,
options.Config.IDP.Iss,
Expand All @@ -67,6 +59,15 @@ func NewService(opts ...Option) Service {
logger.Fatal().Err(err).Msg("could not initialize cs3 backend env vars")
}
case "ldap":

if err := ldap.WaitForCA(options.Logger, options.Config.IDP.Insecure, options.Config.Ldap.TLSCACert); err != nil {
logger.Fatal().Err(err).Msg("The configured LDAP CA cert does not exist")
}
if options.Config.IDP.Insecure {
// force CACert to be empty to avoid lico try to load it
options.Config.Ldap.TLSCACert = ""
}

ldapBackendSupport.MustRegister()
if err := initLicoInternalLDAPEnvVars(&options.Config.Ldap); err != nil {
logger.Fatal().Err(err).Msg("could not initialize ldap env vars")
Expand Down