Skip to content

Commit

Permalink
Merge branch 'fix-flaky'
Browse files Browse the repository at this point in the history
  • Loading branch information
KaziAkibJaved committed Jan 28, 2024
2 parents dc498e4 + 34c680e commit 3cc2a16
Show file tree
Hide file tree
Showing 11 changed files with 636 additions and 15 deletions.
62 changes: 62 additions & 0 deletions .github/workflows/maven-build-2.x.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
# SPDX-FileCopyrightText: 2018-2023 SAP SE or an SAP affiliate company and Cloud Security Client Java contributors
# SPDX-License-Identifier: Apache-2.0
---
<<<<<<<< HEAD:.github/workflows/maven-build.yml
name: Maven Build main

env:
NVD_API_KEY: ${{ secrets.NVD_API_KEY }}
========
name: Maven Build main-2.x
>>>>>>>> fix-flaky:.github/workflows/maven-build-2.x.yml

on:
push:
branches: [ main-2.x ]
pull_request:
branches: [ main-2.x ]

jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
java-version: [ 17 ]
name: Build with Java ${{ matrix.java-version }}

steps:
- uses: actions/checkout@v2
- name: mvn cache
uses: actions/cache@v2
with:
path: ~/.m2/repository
key: ${{ runner.os }}-owasp-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-owasp-
- name: Set up JDK ${{ matrix.java-version }}
uses: actions/setup-java@v2
with:
distribution: 'temurin'
java-version: ${{ matrix.java-version }}
- name: Build with Maven
run: mvn -B install --file pom.xml
- name: Run java-security integration tests
run: cd java-security-it; mvn -B package --file pom.xml
- name: Run spring-xsuaa integration tests
run: cd spring-xsuaa-it; mvn -B package --file pom.xml
- name: Build spring-security-basic-auth
run: cd samples/spring-security-basic-auth; mvn -B package --file pom.xml
- name: Build spring-security-xsuaa-usage
run: cd samples/spring-security-xsuaa-usage; mvn -B package --file pom.xml
- name: Build spring-webflux-security-xsuaa-usage
run: cd samples/spring-webflux-security-xsuaa-usage; mvn -B package --file pom.xml
- name: Build java-security-usage
run: cd samples/java-security-usage; mvn -B package --file pom.xml
- name: Build sap-java-buildpack-api-usage
run: cd samples/sap-java-buildpack-api-usage; mvn -B package --file pom.xml
- name: Build java-tokenclient-usage
run: cd samples/java-tokenclient-usage; mvn -B package --file pom.xml
- name: Build java-security-usage-ias
run: cd samples/java-security-usage-ias; mvn -B package --file pom.xml
- name: Build spring-security-hybrid-usage
run: cd samples/spring-security-hybrid-usage; mvn -B package --file pom.xml
8 changes: 6 additions & 2 deletions .github/workflows/maven-build.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,20 @@
# SPDX-FileCopyrightText: 2018-2023 SAP SE or an SAP affiliate company and Cloud Security Client Java contributors
# SPDX-License-Identifier: Apache-2.0
---
<<<<<<<< HEAD:.github/workflows/maven-build.yml
name: Maven Build main

env:
NVD_API_KEY: ${{ secrets.NVD_API_KEY }}
========
name: Maven Build main-2.x
>>>>>>>> fix-flaky:.github/workflows/maven-build-2.x.yml

on:
push:
branches: [ main ]
branches: [ main-2.x ]
pull_request:
branches: [ main ]
branches: [ main-2.x ]

jobs:
build:
Expand Down
10 changes: 10 additions & 0 deletions api/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
## Configuration

### Maven Dependencies
```xml
<dependency>
<groupId>com.sap.cloud.security.xsuaa</groupId>
<artifactId>api</artifactId>
<version>2.13.7</version>
</dependency>
```
43 changes: 43 additions & 0 deletions api/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- SPDX-FileCopyrightText: 2018-2022 SAP SE or an SAP affiliate company and Cloud Security Client Java contributors -->
<!-- SPDX-License-Identifier: Apache-2.0 -->
<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>

<groupId>com.sap.cloud.security.xsuaa</groupId>
<artifactId>api</artifactId>

<parent>
<groupId>com.sap.cloud.security.xsuaa</groupId>
<artifactId>parent</artifactId>
<version>2.13.7</version>
</parent>

<packaging>jar</packaging>

<name>api</name>
<url>http://maven.apache.org</url>

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>

<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>3.5.0</version>
<executions>
<execution>
<id>attach-javadocs</id>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
2 changes: 1 addition & 1 deletion java-security/Migration_SAPJavaBuildpackProjects.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,4 +61,4 @@ This comes with a change regarding scopes. For a business application A that wan
In case you face issues to apply the migration steps check this [troubleshooting](README.md#troubleshooting) for known issues and how to file the issue.

## [OPTIONAL] Leverage new API and features
You can continue [here](Migration_SAPJavaBuildpackProjects_V2.md) to understand what needs to be done to leverage the new `java-api` that is exposed by the SAP Java Buildpack as of version `1.26.1`.
You can continue [here](Migration_SAPJavaBuildpackProjects_V2.md) to understand what needs to be done to leverage the new `java-api` that is exposed by the SAP Java Buildpack starting with version `1.26.1`.
6 changes: 3 additions & 3 deletions java-security/Migration_SAPJavaBuildpackProjects_V2.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

**This document is only applicable for J2EE web applications securing their application with SAP Java Buildpack.**

This migration document is a step-by-step guide explaining how to leverage the new api that is exposed by the SAP Java Buildpack as of version `1.26.1`.
This migration document is a step-by-step guide explaining how to leverage the new api that is exposed by the SAP Java Buildpack starting with version `1.26.1`.

## Prerequisites

Expand All @@ -12,7 +12,7 @@ Please note, this Migration Guide is only intended for applications, using SAP J
**Before you proceed, make sure you have completed [this guide](Migration_SAPJavaBuildpackProjects.md).**

## Adapt Maven Dependencies <a name="maven"></a>
To use the latest API exposed by SAP Java Buildpack version as of version `1.26.1` the dependency declared in maven `pom.xml` needs to be adapted.
To use the latest API exposed by SAP Java Buildpack version starting with version `1.26.1` the dependency declared in maven `pom.xml` needs to be adapted.

First make sure you have the following dependency defined in your pom.xml:
```xml
Expand All @@ -29,7 +29,7 @@ Now you are ready to **remove** the dependency to the **`api`** by deleting the
<artifactId>api</artifactId>
</dependency>
```
The dependency `com.sap.cloud.security:java-api` is the new api exposed by the SAP Java Buildpack as of version `1.26.1`.
The dependency `com.sap.cloud.security:java-api` is the new api exposed by the SAP Java Buildpack starting with version `1.26.1`.

## Adapt Environment Variable
As the new `java-api` is incompatible with the former one, you have to tell the SAP Java Buildpack, that you want to use the latest api. This is done by setting the `ENABLE_SECURITY_JAVA_API_V2` environment variable to `true` as part of your deployment descriptor, e.g. in your `manifest.yml` file.
Expand Down
Loading

0 comments on commit 3cc2a16

Please sign in to comment.