-
Notifications
You must be signed in to change notification settings - Fork 91
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix #824 - Introduce a separated OIDC module to hold security depende…
…ncies (#872) (#874) * Fix #824 - Introduce a separated OIDC module to hold security dependencies * Fix parent module --------- Signed-off-by: Ricardo Zanini <1538000+ricardozanini@users.noreply.github.com> Co-authored-by: Ricardo Zanini <1538000+ricardozanini@users.noreply.github.com>
- Loading branch information
1 parent
111db2a
commit 4ed0502
Showing
21 changed files
with
249 additions
and
230 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
208 changes: 72 additions & 136 deletions
208
...loyment/src/main/java/io/quarkiverse/openapi/generator/deployment/GeneratorProcessor.java
Large diffs are not rendered by default.
Oops, something went wrong.
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
2 changes: 0 additions & 2 deletions
2
client/integration-tests/without-oidc/src/main/resources/application.properties
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 |
---|---|---|
@@ -1,3 +1 @@ | ||
quarkus.rest-client.quarkus_simple_openapi_yaml.url=http://localhost:8080 | ||
|
||
quarkus.keycloak.devservices.enabled=false |
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,34 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<project xmlns="http://maven.apache.org/POM/4.0.0" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
<modelVersion>4.0.0</modelVersion> | ||
<parent> | ||
<groupId>io.quarkiverse.openapi.generator</groupId> | ||
<artifactId>quarkus-openapi-generator-client-parent</artifactId> | ||
<version>3.0.0-SNAPSHOT</version> | ||
</parent> | ||
|
||
<artifactId>quarkus-openapi-generator-oidc</artifactId> | ||
<name>Quarkus - Openapi Generator - Client - OIDC</name> | ||
<description>OIDC Capabilities for Runtime</description> | ||
|
||
<dependencies> | ||
<dependency> | ||
<groupId>io.quarkiverse.openapi.generator</groupId> | ||
<artifactId>quarkus-openapi-generator</artifactId> | ||
<version>${project.version}</version> | ||
</dependency> | ||
<dependency> | ||
<groupId>io.quarkus</groupId> | ||
<artifactId>quarkus-rest-client-oidc-filter</artifactId> | ||
<scope>provided</scope> | ||
</dependency> | ||
<dependency> | ||
<groupId>io.quarkus</groupId> | ||
<artifactId>quarkus-resteasy-client-oidc-filter</artifactId> | ||
<scope>provided</scope> | ||
</dependency> | ||
</dependencies> | ||
|
||
</project> |
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
33 changes: 33 additions & 0 deletions
33
.../oidc/src/main/java/io/quarkiverse/openapi/generator/oidc/OidcAuthenticationRecorder.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.quarkiverse.openapi.generator.oidc; | ||
|
||
import java.util.List; | ||
import java.util.function.Function; | ||
|
||
import io.quarkiverse.openapi.generator.AuthenticationRecorder; | ||
import io.quarkiverse.openapi.generator.OidcClient; | ||
import io.quarkiverse.openapi.generator.OpenApiGeneratorConfig; | ||
import io.quarkiverse.openapi.generator.oidc.providers.OAuth2AuthenticationProvider; | ||
import io.quarkiverse.openapi.generator.providers.AuthProvider; | ||
import io.quarkiverse.openapi.generator.providers.OperationAuthInfo; | ||
import io.quarkus.arc.SyntheticCreationalContext; | ||
import io.quarkus.runtime.annotations.Recorder; | ||
|
||
@Recorder | ||
public class OidcAuthenticationRecorder { | ||
private final OpenApiGeneratorConfig generatorConfig; | ||
|
||
public OidcAuthenticationRecorder(OpenApiGeneratorConfig generatorConfig) { | ||
this.generatorConfig = generatorConfig; | ||
} | ||
|
||
public Function<SyntheticCreationalContext<AuthProvider>, AuthProvider> recordOauthAuthProvider( | ||
String name, | ||
String openApiSpecId, | ||
List<OperationAuthInfo> operations) { | ||
return context -> new OAuth2AuthenticationProvider( | ||
AuthenticationRecorder.getAuthConfig(generatorConfig, openApiSpecId, name), name, openApiSpecId, | ||
context.getInjectedReference(OAuth2AuthenticationProvider.OidcClientRequestFilterDelegate.class, | ||
new OidcClient.Literal(name)), | ||
operations); | ||
} | ||
} |
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.