Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 42 additions & 0 deletions .github/workflows/check.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Run dependency and spotbugs checks

on:
workflow_run:
workflows: ["Run tests"]
types:
- completed

permissions:
contents: read

jobs:
run-checks:
runs-on: ubuntu-latest
strategy:
matrix:
java-version: ['8', '11', '17']
name: Run dependency and spotbugs checks with java SDK ${{ matrix.java-version }}

steps:
- uses: actions/checkout@v4

- name: Setup java
uses: actions/setup-java@v4
with:
java-version: ${{ matrix.java-version }}
distribution: 'temurin'
cache: maven

- name: Run dependency check
run: |
./mvnw org.owasp:dependency-check-maven:check

- name: Archive dependency report
uses: actions/upload-artifact@v4
with:
name: dependency-report
path: target/dependency-check-report.html

- name: Run spotbugs check
run: |
./mvnw spotbugs:check
51 changes: 51 additions & 0 deletions .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: Publish to maven repository

on:
release:
types:
- published

permissions:
contents: read

jobs:
package_and_publish:
name: Publish to maven repository
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- name: Setup java SDK 8
uses: actions/setup-java@v4
with:
java-version: '8'
distribution: 'temurin'
cache: maven

- name: Import GPG key
uses: crazy-max/ghaction-import-gpg@v6
with:
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }}

- name: Create bundle and upload to oss.sonatype.org (staging)
# Fail on first error
run: |
set -e
version=${{ github.event.release.name }}
artifact=mid-rest-java-client-$version
echo "[INFO] Artifact name: $artifact"
./mvnw versions:set -DnewVersion="$version"
./mvnw package -DskipTests
gpg -ab pom.xml
cd target
gpg -ab $artifact.jar
gpg -ab $artifact-sources.jar
gpg -ab $artifact-javadoc.jar
jar -cvf bundle.jar ../pom.xml ../pom.xml.asc $artifact.jar $artifact.jar.asc $artifact-javadoc.jar $artifact-javadoc.jar.asc $artifact-sources.jar $artifact-sources.jar.asc
CODE=$(curl -w "%{http_code}" -o curl_response.txt -s -ujorlina2 -u ${{ secrets.SONATYPETOKENUN }}:${{ secrets.SONATYPETOKENPW }} --request POST -F "[email protected]" "https://oss.sonatype.org/service/local/staging/bundle_upload")
echo "[INFO] ------------------------------------------------------------------------"
echo "[INFO] Upload to oss.sonatype.org ResponseCode: $CODE"
cat curl_response.txt
echo -e "\n[INFO] Login to oss.sonatype.org for releasing $artifact"
echo "[INFO] ------------------------------------------------------------------------"
[[ $CODE == 201 ]] && exit 0 || exit 1
44 changes: 44 additions & 0 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: Run tests

on:
push:
branches: [ "github_workflow" ]
pull_request:
branches: [ "github_workflow" ]

permissions:
contents: read

jobs:
run-tests:
runs-on: ubuntu-latest
strategy:
matrix:
java-version: ['8', '11', '17']
name: Run tests with java SDK ${{ matrix.java-version }}

steps:
- uses: actions/checkout@v4

- name: Setup java
uses: actions/setup-java@v4
with:
java-version: ${{ matrix.java-version }}
distribution: 'temurin'
cache: maven

- name: Install dependencies
run: |
pip install --user codecov

- name: Check JAVA version (v${{ matrix.java-version }})
run: java -version

- name: Run tests
# Fail on first error
run: |
set -e
mvn test

- name: Upload coverage reports to Codecov
run: codecov
23 changes: 0 additions & 23 deletions .travis.yml

This file was deleted.

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[![Build Status](https://api.travis-ci.com/SK-EID/mid-rest-java-client.svg?branch=master)](https://travis-ci.com/SK-EID/mid-rest-java-client)
[![Tests](https://github.com/SK-EID/mid-rest-java-client/actions/workflows/tests.yaml/badge.svg)](https://github.com/SK-EID/mid-rest-java-client/actions/workflows/tests.yaml)
[![Coverage Status](https://img.shields.io/codecov/c/github/SK-EID/mid-rest-java-client.svg)](https://codecov.io/gh/SK-EID/mid-rest-java-client)
[![License: MIT](https://img.shields.io/github/license/mashape/apistatus.svg)](https://opensource.org/licenses/MIT)
[![Maven Central](https://maven-badges.herokuapp.com/maven-central/ee.sk.mid/mid-rest-java-client/badge.svg)](https://maven-badges.herokuapp.com/maven-central/ee.sk.mid/mid-rest-java-client)
Expand Down
Binary file removed private.key.enc
Binary file not shown.
28 changes: 0 additions & 28 deletions publish.sh

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ public void validate_whenRSA_shouldReturnValidAuthenticationResult() throws Exce

@Test
public void validate_whenECC_shouldReturnValidAuthenticationResult() throws Exception{
X509Certificate caCertificate = fileToX509Certificate("/trusted_certificates/TEST_of_ESTEID-SK_2011.pem.crt");
X509Certificate caCertificate = fileToX509Certificate("/trusted_certificates/TEST_of_ESTEID-SK_2015.pem.crt");
MidAuthenticationResponseValidator validator = new MidAuthenticationResponseValidator(Collections.singletonList(caCertificate));

MidAuthentication authentication = createMobileIdAuthenticationWithECC();
Expand Down
Loading