-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Correct pom/gh-actions. Add Indy clients
- Loading branch information
Showing
5 changed files
with
129 additions
and
8 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,11 +14,11 @@ | |
|
||
<name>Konflux Build Driver</name> | ||
<description>PNC Build Driver for Konflux</description> | ||
<url>https://github.com/pnc/konflux-build-driver</url> | ||
<url>https://github.com/project-ncl/konflux-build-driver</url> | ||
<scm> | ||
<connection>scm:git:https://github.com/pnc/konflux-build-driver.git</connection> | ||
<developerConnection>scm:git:[email protected]:pnc/konflux-build-driver.git</developerConnection> | ||
<url>https://github.com/pnc/konflux-build-driver</url> | ||
<connection>scm:git:https://github.com/project-ncl/konflux-build-driver.git</connection> | ||
<developerConnection>scm:git:[email protected]:project-ncl/konflux-build-driver.git</developerConnection> | ||
<url>https://github.com/project-ncl/konflux-build-driver</url> | ||
<tag>HEAD</tag> | ||
</scm> | ||
<licenses> | ||
|
@@ -43,9 +43,21 @@ | |
|
||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> | ||
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding> | ||
|
||
<jboss.releases.repo.id>sonatype-nexus-staging</jboss.releases.repo.id> | ||
<jboss.releases.repo.url>https://oss.sonatype.org/service/local/staging/deploy/maven2</jboss.releases.repo.url> | ||
<jboss.snapshots.repo.id>sonatype-nexus-snapshots</jboss.snapshots.repo.id> | ||
<jboss.snapshots.repo.url>https://oss.sonatype.org/content/repositories/snapshots</jboss.snapshots.repo.url> | ||
|
||
<quarkus.platform.artifact-id>quarkus-bom</quarkus.platform.artifact-id> | ||
<quarkus.platform.group-id>io.quarkus.platform</quarkus.platform.group-id> | ||
<quarkus.platform.version>3.17.3</quarkus.platform.version> | ||
|
||
<lombok.version>1.18.32</lombok.version> | ||
<formatter-maven-plugin.version>2.24.1</formatter-maven-plugin.version> | ||
<impsort-maven-plugin.version>1.12.0</impsort-maven-plugin.version> | ||
|
||
<format.skip>false</format.skip> | ||
</properties> | ||
|
||
<dependencyManagement> | ||
|
@@ -61,6 +73,26 @@ | |
</dependencyManagement> | ||
|
||
<dependencies> | ||
<dependency> | ||
<groupId>io.quarkus</groupId> | ||
<artifactId>quarkus-oidc</artifactId> | ||
</dependency> | ||
<dependency> | ||
<groupId>io.quarkus</groupId> | ||
<artifactId>quarkus-oidc-client</artifactId> | ||
</dependency> | ||
<dependency> | ||
<groupId>io.quarkus</groupId> | ||
<artifactId>quarkus-rest-client-jackson</artifactId> | ||
</dependency> | ||
|
||
<dependency> | ||
<groupId>org.projectlombok</groupId> | ||
<artifactId>lombok</artifactId> | ||
<version>${lombok.version}</version> | ||
<scope>provided</scope> | ||
</dependency> | ||
|
||
<dependency> | ||
<groupId>io.quarkus</groupId> | ||
<artifactId>quarkus-junit5</artifactId> | ||
|
@@ -90,6 +122,39 @@ | |
</execution> | ||
</executions> | ||
</plugin> | ||
<plugin> | ||
<groupId>net.revelc.code.formatter</groupId> | ||
<artifactId>formatter-maven-plugin</artifactId> | ||
<version>${formatter-maven-plugin.version}</version> | ||
<dependencies> | ||
<dependency> | ||
<groupId>io.quarkus</groupId> | ||
<artifactId>quarkus-ide-config</artifactId> | ||
<version>${quarkus.platform.version}</version> | ||
</dependency> | ||
</dependencies> | ||
<configuration> | ||
<!-- store outside of target to speed up formatting when mvn clean is used --> | ||
<cachedir>.cache/formatter-maven-plugin-${formatter-maven-plugin.version}</cachedir> | ||
<configFile>eclipse-format.xml</configFile> | ||
<lineEnding>LF</lineEnding> | ||
<skip>${format.skip}</skip> | ||
</configuration> | ||
</plugin> | ||
<plugin> | ||
<groupId>net.revelc.code</groupId> | ||
<artifactId>impsort-maven-plugin</artifactId> | ||
<version>${impsort-maven-plugin.version}</version> | ||
<configuration> | ||
<!-- store outside of target to speed up formatting when mvn clean is used --> | ||
<cachedir>.cache/impsort-maven-plugin-${impsort-maven-plugin.version}</cachedir> | ||
<groups>java.,javax.,jakarta.,org.,com.</groups> | ||
<staticGroups>*</staticGroups> | ||
<lineEnding>LF</lineEnding> | ||
<skip>${format.skip}</skip> | ||
<removeUnused>true</removeUnused> | ||
</configuration> | ||
</plugin> | ||
<plugin> | ||
<artifactId>maven-surefire-plugin</artifactId> | ||
<configuration> | ||
|
33 changes: 33 additions & 0 deletions
33
src/main/java/org/jboss/pnc/konfluxbuilddriver/clients/IndyService.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 org.jboss.pnc.konfluxbuilddriver.clients; | ||
|
||
import jakarta.ws.rs.Consumes; | ||
import jakarta.ws.rs.HeaderParam; | ||
import jakarta.ws.rs.POST; | ||
import jakarta.ws.rs.Path; | ||
import jakarta.ws.rs.Produces; | ||
import jakarta.ws.rs.core.MediaType; | ||
import org.eclipse.microprofile.rest.client.inject.RegisterRestClient; | ||
|
||
/** | ||
* Indy service representing the Indy server. It uses Quarkus magical rest client to generate the client implementation | ||
*/ | ||
@RegisterRestClient(configKey = "indy-service") | ||
public interface IndyService { | ||
|
||
/** | ||
* Ask Indy to give us the token that we will use for Maven communication with Indy, in the builder pod for the | ||
* particular buildId | ||
* | ||
* @param indyTokenRequestDTO the DTO to send to Indy | ||
* @param accessToken accessToken required to send data. Note that it should include "Bearer <token>" | ||
* | ||
* @return Token DTO | ||
*/ | ||
@Path("/api/security/auth/token") | ||
@Produces(MediaType.APPLICATION_JSON) | ||
@Consumes(MediaType.APPLICATION_JSON) | ||
@POST | ||
IndyTokenResponseDTO getAuthToken( | ||
IndyTokenRequestDTO indyTokenRequestDTO, | ||
@HeaderParam("Authorization") String accessToken); | ||
} |
12 changes: 12 additions & 0 deletions
12
src/main/java/org/jboss/pnc/konfluxbuilddriver/clients/IndyTokenRequestDTO.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,12 @@ | ||
package org.jboss.pnc.konfluxbuilddriver.clients; | ||
|
||
import com.fasterxml.jackson.annotation.JsonProperty; | ||
import lombok.Builder; | ||
|
||
/** | ||
* DTO of the Indy token endpoint request | ||
*/ | ||
@Builder | ||
public record IndyTokenRequestDTO(@JsonProperty("build-id") String buildId) { | ||
|
||
} |
11 changes: 11 additions & 0 deletions
11
src/main/java/org/jboss/pnc/konfluxbuilddriver/clients/IndyTokenResponseDTO.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,11 @@ | ||
package org.jboss.pnc.konfluxbuilddriver.clients; | ||
|
||
import lombok.Builder; | ||
|
||
/** | ||
* DTO of the Indy token endpoint response | ||
*/ | ||
@Builder | ||
public record IndyTokenResponseDTO(String token) { | ||
|
||
} |