This project is a Java Spring Boot application named "AzureDevOps OAS3 Plugin" (azuredevops-oas3-plugin). It is designed to address a specific issue with pipeline permissions in Azure DevOps environments.
In the pipelinePermission
resource, when authorized
is set to false
, the API returns none
. This results in continuous reconciliation due to the difference between the local and remote resources.
This web service acts as an intermediary to properly manage pipeline permissions and resolve the reconciliation issue. It ensures that the local and remote resources match even when a pipeline is unauthorized.
In this case, if the resource is set authorized: false
in the body request, you will receive from AzureDevOps an incomplete response. The web service then fills this response with the request data to ensure consistency between local and remote resources.
- Java 8 or higher
- Maven
- Docker (optional, for containerization)
To build the project, run:
./mvnw clean package
This will create a JAR file in the target
directory.
You can run the application using:
java -jar target/azuredevops-oas3-plugin-0.0.1-SNAPSHOT.jar
Or using Spring Boot Maven plugin:
./mvnw spring-boot:run
The project includes a Dockerfile. To build a Docker image:
docker build -t azuredevops-oas3-plugin .
To run the container:
docker run -p 8080:8080 azuredevops-oas3-plugin
The API is documented using Swagger. You can find the Swagger JSON file at swagger.json
in the root directory.
AzuredevopsPluginApplication.java
: The main Spring Boot application class.PipelinePermissionCli.java
: Controller handling pipeline permission operations. This component is crucial for addressing the reconciliation issue.- Model classes in the
model
package:IdentityRef.java
Permission.java
PipelinePermission.java
: Represents pipeline permissions and likely includes logic for handling theauthorized
flag.Resource.java
ResourcePipelinePermissions.java
: Manages the overall pipeline permissions for resources.
This project leverages the springdoc-openapi-starter-webmvc-ui
dependency to automatically generate OpenAPI Specification 3.0 documentation from the webservice code.
Once your application is running, you can access the OpenAPI specification in different formats:
- JSON format:
http://localhost:8080/v3/api-docs
- YAML format:
http://localhost:8080/v3/api-docs.yaml
The Swagger UI provides a user-friendly interface to explore and test your API endpoints. You can access it at:
http://localhost:8080/swagger-ui.html
The project includes a test class AzuredevopsPluginApplicationTests.java
. Run tests using:
./mvnw test
Application configuration can be found in src/main/resources/application.properties
.