Compare commits
30
Commits
develop
...
v0.1.0-RC.12
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d91c4e8d5b | ||
|
|
d9e969f3e1
|
||
|
|
477bfff3a2
|
||
|
|
dd8cebd666 | ||
|
|
7e579cc1cd
|
||
|
|
a058403857
|
||
|
|
ce9cf33fd4
|
||
|
|
c089ea5749 | ||
|
|
178bf01857
|
||
|
|
5e114114c5 | ||
|
|
ed139520df | ||
|
|
afedbd1f29 | ||
|
|
3ee07e26ba
|
||
|
|
19cec0f147
|
||
|
|
21d246faf8 | ||
|
|
d7ce084112
|
||
|
|
f98dd97786 | ||
|
|
e0e6ce601c
|
||
|
|
0f9169b9ee | ||
|
|
7559321967
|
||
|
|
b22844590f | ||
|
|
09451baeb6
|
||
|
|
9787d2d184
|
||
|
|
04bc8c1055 | ||
|
|
839c76f19e
|
||
|
|
ffc12a8041 | ||
|
|
6e307e24c5
|
||
|
|
b30a30c53f | ||
|
|
ea9342368a
|
||
|
|
ede7cd9bdb |
No files matched your search
@@ -21,7 +21,7 @@
|
||||
<qqq.version>4.1.0-RC.26</qqq.version> <!-- feeds qbit-build-parent's qqq-bom-pom import -->
|
||||
<qbit.guardrails.enforce>true</qbit.guardrails.enforce>
|
||||
<qbit.guardrails.strictUiApiRoutes>true</qbit.guardrails.strictUiApiRoutes>
|
||||
<revision>0.1.0-SNAPSHOT</revision>
|
||||
<revision>0.1.0-RC.12</revision>
|
||||
<maven.compiler.source>21</maven.compiler.source>
|
||||
<maven.compiler.target>21</maven.compiler.target>
|
||||
<jacoco.version>0.8.15</jacoco.version>
|
||||
|
||||
@@ -65,7 +65,13 @@ public final class AuthentikHealthChecks
|
||||
public static void register(QInstance instance, AuthentikQBitConfig config)
|
||||
{
|
||||
HealthChecksMetaData registry = HealthChecksMetaData.ofOrWithNew(instance);
|
||||
for(String name : List.of("api", "api_token", "mapper", "token_broker"))
|
||||
/////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// the token broker is only used when tokens are on; with tokens off a registered check //
|
||||
// could only ever report UNKNOWN "not configured", and core cannot remove a registered check. //
|
||||
/////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
List<String> names = Boolean.TRUE.equals(config.getTokensEnabled())
|
||||
? List.of("api", "api_token", "mapper", "token_broker") : List.of("api", "api_token", "mapper");
|
||||
for(String name : names)
|
||||
{
|
||||
registry.withCheck(new HealthCheckMetaData().withName("authentik." + name).withLabel("Authentik " + name)
|
||||
.withComponent("authentik").withCategory(HealthCategory.IDENTITY).withKind(HealthCheckKind.DEPENDENCY)
|
||||
|
||||
@@ -117,6 +117,33 @@ class AuthentikHealthChecksTest
|
||||
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
** With tokens off the token broker is not used, so no token_broker check is
|
||||
** registered (it could only ever show UNKNOWN "not configured"); the rest stay.
|
||||
*******************************************************************************/
|
||||
@Test
|
||||
void registrationWithTokensOffOmitsTokenBroker() throws QException
|
||||
{
|
||||
QInstance tokensOff = AuthentikTestSupport.produce(AuthentikTestSupport.unitConfig().withApiToken(SECRET).withTokensEnabled(false));
|
||||
var checks = HealthChecksMetaData.ofOrWithNew(tokensOff).resolveAll(tokensOff);
|
||||
assertThat(checks).extracting(c -> c.getName()).containsExactly("authentik.api", "authentik.api_token", "authentik.mapper");
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
** With tokens explicitly on the token broker check is registered as before.
|
||||
*******************************************************************************/
|
||||
@Test
|
||||
void registrationWithTokensOnKeepsTokenBroker() throws QException
|
||||
{
|
||||
QInstance tokensOn = AuthentikTestSupport.produce(AuthentikTestSupport.unitConfig().withApiToken(SECRET).withTokensEnabled(true));
|
||||
var checks = HealthChecksMetaData.ofOrWithNew(tokensOn).resolveAll(tokensOn);
|
||||
assertThat(checks).extracting(c -> c.getName()).containsExactly("authentik.api", "authentik.api_token", "authentik.mapper", "authentik.token_broker");
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
** Version responses are allowlisted before entering details.
|
||||
*******************************************************************************/
|
||||
|
||||
Reference in new issue
Block a user