-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
17 changed files
with
181 additions
and
79 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
31 changes: 31 additions & 0 deletions
31
server/src/main/java/io/flexwork/health/JWTSetupChecker.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
package io.flexwork.health; | ||
|
||
import io.flexwork.config.FlexworkProperties; | ||
import org.apache.commons.lang3.StringUtils; | ||
import org.slf4j.Logger; | ||
import org.slf4j.LoggerFactory; | ||
import org.springframework.boot.ApplicationArguments; | ||
import org.springframework.boot.ApplicationRunner; | ||
import org.springframework.stereotype.Component; | ||
|
||
@Component | ||
public class JWTSetupChecker implements ApplicationRunner { | ||
|
||
private static Logger LOG = LoggerFactory.getLogger(JWTSetupChecker.class); | ||
|
||
private final FlexworkProperties flexworkProperties; | ||
|
||
public JWTSetupChecker(FlexworkProperties flexworkProperties) { | ||
this.flexworkProperties = flexworkProperties; | ||
} | ||
|
||
@Override | ||
public void run(ApplicationArguments args) { | ||
if (StringUtils.isEmpty( | ||
flexworkProperties.getSecurity().getAuthentication().getJwt().getBase64Secret())) { | ||
throw new IllegalArgumentException("JWT secret is missing"); | ||
} else { | ||
LOG.info("JWT secret found and ready to use"); | ||
} | ||
} | ||
} |
33 changes: 33 additions & 0 deletions
33
server/src/main/java/io/flexwork/health/MailSetupChecker.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
package io.flexwork.health; | ||
|
||
import io.flexwork.config.FlexworkProperties; | ||
import org.apache.commons.lang3.StringUtils; | ||
import org.slf4j.Logger; | ||
import org.slf4j.LoggerFactory; | ||
import org.springframework.boot.ApplicationArguments; | ||
import org.springframework.boot.ApplicationRunner; | ||
import org.springframework.context.annotation.Profile; | ||
import org.springframework.stereotype.Component; | ||
|
||
@Component | ||
@Profile("prod") | ||
public class MailSetupChecker implements ApplicationRunner { | ||
|
||
private static Logger LOG = LoggerFactory.getLogger(MailSetupChecker.class); | ||
|
||
private final FlexworkProperties flexworkProperties; | ||
|
||
public MailSetupChecker(FlexworkProperties flexworkProperties) { | ||
this.flexworkProperties = flexworkProperties; | ||
} | ||
|
||
@Override | ||
public void run(ApplicationArguments args) { | ||
if (StringUtils.isEmpty(flexworkProperties.getMail().getBaseUrl()) | ||
|| !flexworkProperties.getMail().isEnabled()) { | ||
LOG.warn("Email provider is not configured yet"); | ||
} else { | ||
LOG.info("Mail settings are found"); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.