Skip to content

Commit

Permalink
ci: make all checks pass
Browse files Browse the repository at this point in the history
Signed-off-by: Josef Andersson <[email protected]>
  • Loading branch information
janderssonse committed Feb 14, 2025
1 parent e63d328 commit 6ff8159
Show file tree
Hide file tree
Showing 72 changed files with 2,113 additions and 931 deletions.
2 changes: 1 addition & 1 deletion .conform.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# SPDX-FileCopyrightText: 2024 Digg - Agency for Digital Government
#
# SPDX-License-Identifier: EUPL-1.2
# SPDX-License-Identifier: CC0-1.0

---
policies:
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/bump-temporary.yml
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@
echo "Tag: ${GITHUB_REF_NAME}"
TAG="${GITHUB_REF_NAME#v}"
echo "Version: ${TAG}"
# shellcheck disable=SC2086
mvn $MAVEN_CLI_OPTS versions:set -DnewVersion="${TAG}" -DgenerateBackupPoms=false -DskipTests -s development/settings.xml
- name: Generate changelog
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/release-lib.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,9 @@ jobs:
JRELEASER_GPG_PASSPHRASE: ${{ secrets.OSPO_BOT_GPG_PASS }}
GITHUB_ACTOR: ${{ github.actor }}
PACKAGE_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: mvn $MAVEN_CLI_OPTS deploy jreleaser:full-release -DskipTests -s development/settings.xml
run: |
# shellcheck disable=SC2086
mvn $MAVEN_CLI_OPTS deploy jreleaser:full-release -DskipTests -s development/settings.xml
- name: JReleaser output
if: always()
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,5 +36,7 @@ jobs:
MAVEN_CLI_OPTS: --batch-mode --no-transfer-progress --errors --fail-at-end -Dstyle.color=always -DinstallAtEnd=true -DdeployAtEnd=true
GITHUB_ACTOR: ${{ github.actor }}
PACKAGE_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: mvn $MAVEN_CLI_OPTS test -s development/settings.xml
run: |
# shellcheck disable=SC2086
mvn $MAVEN_CLI_OPTS test -s development/settings.xml
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# SPDX-FileCopyrightText: 2024 Digg - Agency for Digital Government
#
# SPDX-License-Identifier: EUPL-1.2
# SPDX-License-Identifier: CC0-1.0

.DS_Store

Expand Down
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
<!--
SPDX-FileCopyrightText: 2025 Digg - Agency for Digital Government
SPDX-License-Identifier: CC0-1.0
-->

# Changelog

All notable changes to this project will be documented in this file.
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<!--
SPDX-FileCopyrightText: 2024 Digg - Agency for Digital Government
SPDX-License-Identifier: EUPL-1.2
SPDX-License-Identifier: CC0-1.0
-->

# EUDIW Wallet Token Library
Expand Down
2 changes: 1 addition & 1 deletion development/checkstyle_prettier.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<!--
SPDX-FileCopyrightText: 2024 Digg - Agency for Digital Government
SPDX-License-Identifier: EUPL-1.2
SPDX-License-Identifier: CC0-1.0
-->

<!DOCTYPE module PUBLIC
Expand Down
4 changes: 2 additions & 2 deletions development/codequality.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

# SPDX-FileCopyrightText: 2024 Digg - Agency for Digital Government
#
# SPDX-License-Identifier: EUPL-1.2
# SPDX-License-Identifier: CC0-1.0

# Run a code quality check

Expand Down Expand Up @@ -130,7 +130,7 @@ is_command_available 'sed' ''

lint
commit
#format
format
license

check_exit_codes
2 changes: 1 addition & 1 deletion development/megalinter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
JAVA_CHECKSTYLE,
JAVA_PMD,
MARKDOWN_MARKDOWNLINT,
REPOSITORY_GITLEAKS,
# REPOSITORY_GITLEAKS,
REPOSITORY_SECRETLINT,
XML_XMLLINT
YAML_PRETTIER,
Expand Down
2 changes: 1 addition & 1 deletion development/pmd_default_java_mod.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<!--
SPDX-FileCopyrightText: 2024 Digg - Agency for Digital Government
SPDX-License-Identifier: EUPL-1.2
SPDX-License-Identifier: CC0-1.0
-->

<ruleset name="Custom Rules" xmlns="http://pmd.sourceforge.net/ruleset/2.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://pmd.sourceforge.net/ruleset/2.0.0 https://pmd.sourceforge.io/ruleset_2_0_0.xsd">
Expand Down
8 changes: 7 additions & 1 deletion development/settings.xml
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>

<!--
SPDX-FileCopyrightText: 2025 Digg - Agency for Digital Government
SPDX-License-Identifier: CC0-1.0
-->

<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd">

Expand Down Expand Up @@ -29,4 +36,3 @@


</settings>

9 changes: 8 additions & 1 deletion docs/DEVELOPMENT.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
<!--
SPDX-FileCopyrightText: 2025 Digg - Agency for Digital Government
SPDX-License-Identifier: EUPL-1.2
-->

# Development Guide Lines

## Build
Expand All @@ -17,7 +24,7 @@ Example:

```shell
git tag -s v0.0.3-SNAPSHOT -m 'v0.0.3-SNAPSHOT'
git push origin tag v0.0.3
git push origin tag v0.0.3-SNAPSHOT
```

Currently only publishing to GitHub-packages
Expand Down
4 changes: 4 additions & 0 deletions jreleaser.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# SPDX-FileCopyrightText: 2025 Digg - Agency for Digital Government
#
# SPDX-License-Identifier: CC0-1.0

# Basic project metadata
project:
name: eudiw-wallet-token-lib
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<!--
SPDX-FileCopyrightText: 2024 Digg - Agency for Digital Government
SPDX-License-Identifier: EUPL-1.2
SPDX-License-Identifier: CC0-1.0
-->

<project xmlns="http://maven.apache.org/POM/4.0.0"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
// SPDX-FileCopyrightText: 2025 Digg - Agency for Digital Government
//
// SPDX-License-Identifier: EUPL-1.2

package se.digg.wallet.datatypes.common;

import lombok.Getter;
Expand Down Expand Up @@ -25,5 +29,4 @@ public class PresentationInput<T> {
* the context of a presentation.
*/
protected T disclosures;

}
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
// SPDX-FileCopyrightText: 2025 Digg - Agency for Digital Government
//
// SPDX-License-Identifier: EUPL-1.2

package se.digg.wallet.datatypes.common;

import lombok.AllArgsConstructor;
Expand All @@ -17,6 +21,3 @@ public class PresentationValidationInput {
*/
protected String requestNonce;
}



Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
// SPDX-FileCopyrightText: 2025 Digg - Agency for Digital Government
//
// SPDX-License-Identifier: EUPL-1.2

package se.digg.wallet.datatypes.common;

import java.util.List;
Expand All @@ -18,7 +22,6 @@
* Methods in this interface may throw exceptions indicating issues with the token's integrity, parsing, or validation.
*/
public interface PresentationValidator {

/**
* Validates a verifiable presentation and ensures its integrity, authenticity, and adherence to the required structure.
* The validation process involves verifying the structural correctness of the presentation, checking the expiration time,
Expand All @@ -33,7 +36,9 @@ public interface PresentationValidator {
* @throws TokenValidationException if the presentation validation fails due to structural or cryptographic errors.
* @throws TokenParsingException if an error occurs during parsing of the presentation.
*/
TokenValidationResult validatePresentation(byte[] presentation, PresentationValidationInput presentationValidationInput,
List<TrustedKey> trustedKeys) throws TokenValidationException, TokenParsingException;

TokenValidationResult validatePresentation(
byte[] presentation,
PresentationValidationInput presentationValidationInput,
List<TrustedKey> trustedKeys
) throws TokenValidationException, TokenParsingException;
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,4 @@ public class TokenAttribute {
private TokenAttributeType type;
/** The attribute value. For most attributes, this is either a String, Integer or LocalDate object */
private Object value;

}
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
// SPDX-FileCopyrightText: 2025 Digg - Agency for Digital Government
//
// SPDX-License-Identifier: EUPL-1.2

package se.digg.wallet.datatypes.common;

import lombok.AllArgsConstructor;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
// SPDX-FileCopyrightText: 2025 Digg - Agency for Digital Government
//
// SPDX-License-Identifier: EUPL-1.2

package se.digg.wallet.datatypes.common;

import lombok.AllArgsConstructor;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

package se.digg.wallet.datatypes.common;

import java.io.IOException;
import java.security.NoSuchAlgorithmException;
import java.util.Arrays;
import lombok.AllArgsConstructor;
Expand Down Expand Up @@ -32,17 +31,21 @@ public static TokenDigestAlgorithm fromMdlName(String mdlName)
tokenDigestAlgorithm.getMdlName().equalsIgnoreCase(mdlName)
)
.findFirst()
.orElseThrow(() -> new NoSuchAlgorithmException("Unsupported mDL hash algorithm"));
.orElseThrow(
() -> new NoSuchAlgorithmException("Unsupported mDL hash algorithm")
);
}

public static TokenDigestAlgorithm fromSdJwtName(String sdJwtName) throws NoSuchAlgorithmException {
public static TokenDigestAlgorithm fromSdJwtName(String sdJwtName)
throws NoSuchAlgorithmException {
return Arrays.stream(values())
.filter(
tokenDigestAlgorithm ->
tokenDigestAlgorithm.getSdJwtName().equalsIgnoreCase(sdJwtName)
)
.findFirst()
.orElseThrow(() -> new NoSuchAlgorithmException("Unsupported SD-JWT hash algorithm"));
.orElseThrow(
() -> new NoSuchAlgorithmException("Unsupported SD-JWT hash algorithm")
);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

package se.digg.wallet.datatypes.common;

import com.nimbusds.jose.JWSAlgorithm;
import java.security.PublicKey;
import java.time.Duration;
import java.util.List;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
* to issue a token
*/
public interface TokenIssuer<T extends TokenInput> {

/**
* Generates a token based on the provided TokenInput.
*
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,17 @@
// SPDX-FileCopyrightText: 2025 Digg - Agency for Digital Government
//
// SPDX-License-Identifier: EUPL-1.2

package se.digg.wallet.datatypes.common;

import java.io.Serial;

public class TokenParsingException extends Exception {

@Serial
private static final long serialVersionUID = -150091799709439631L;


public TokenParsingException() {
}
public TokenParsingException() {}

public TokenParsingException(String message) {
super(message);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,17 @@
// SPDX-FileCopyrightText: 2025 Digg - Agency for Digital Government
//
// SPDX-License-Identifier: EUPL-1.2

package se.digg.wallet.datatypes.common;

import java.io.Serial;

public class TokenPresentationException extends Exception {

@Serial
private static final long serialVersionUID = 942635978985209161L;

public TokenPresentationException() {
}
public TokenPresentationException() {}

public TokenPresentationException(String message) {
super(message);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
// SPDX-FileCopyrightText: 2025 Digg - Agency for Digital Government
//
// SPDX-License-Identifier: EUPL-1.2

package se.digg.wallet.datatypes.common;

import java.security.PrivateKey;
Expand All @@ -11,13 +15,14 @@
* cryptographic settings, and disclosures.
*/
public interface TokenPresenter<T extends PresentationInput<?>> {

/**
* Creates a presentation token with selective disclosures
*
* @param presentationInput the verifiable presentation token input
* @return token with disclosures and device provided key proof
*/
byte[] presentToken(PresentationInput<?> presentationInput, PrivateKey privateKey) throws TokenPresentationException;

byte[] presentToken(
PresentationInput<?> presentationInput,
PrivateKey privateKey
) throws TokenPresentationException;
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,6 @@
import java.time.Instant;
import java.util.List;
import java.util.Map;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

Expand All @@ -20,7 +17,7 @@
*/
@Data
@NoArgsConstructor
public class TokenValidationResult{
public class TokenValidationResult {

protected PublicKey validationKey;
protected X509Certificate validationCertificate;
Expand Down
Loading

0 comments on commit 6ff8159

Please sign in to comment.