-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #22042 from sberyozkin/oidc_dev_console_exception
Skip OIDC DevConsole setup if `quarkus.oidc.auth-server-url` can not be accessed at build time
- Loading branch information
Showing
4 changed files
with
62 additions
and
20 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
36 changes: 36 additions & 0 deletions
36
.../devmode/src/test/java/io/quarkus/test/devconsole/DevConsoleOidcNoDiscoverySmokeTest.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,36 @@ | ||
package io.quarkus.test.devconsole; | ||
|
||
import org.hamcrest.Matchers; | ||
import org.jboss.shrinkwrap.api.asset.StringAsset; | ||
import org.junit.jupiter.api.Test; | ||
import org.junit.jupiter.api.extension.RegisterExtension; | ||
|
||
import io.quarkus.test.QuarkusDevModeTest; | ||
import io.restassured.RestAssured; | ||
|
||
/** | ||
* Note that this test cannot be placed under the relevant {@code -deployment} module because then the DEV UI processor would | ||
* not be able to locate the template resources correctly. | ||
*/ | ||
public class DevConsoleOidcNoDiscoverySmokeTest { | ||
|
||
@RegisterExtension | ||
static final QuarkusDevModeTest config = new QuarkusDevModeTest() | ||
.withApplicationRoot((jar) -> jar.addAsResource(createApplicationProperties(), | ||
"application.properties")); | ||
|
||
@Test | ||
public void testOidcProviderTemplate() { | ||
RestAssured.get("q/dev/io.quarkus.quarkus-oidc/provider") | ||
.then() | ||
.statusCode(200).body(Matchers.containsString("OpenId Connect Dev Console")); | ||
} | ||
|
||
private static StringAsset createApplicationProperties() { | ||
return new StringAsset("quarkus.oidc.auth-server-url=http://localhost/oidc\n" | ||
+ "quarkus.oidc.client-id=client\n" | ||
+ "quarkus.oidc.discovery-enabled=false\n" | ||
+ "quarkus.oidc.introspection-path=introspect\n"); | ||
|
||
} | ||
} |