From 4ab974925438b8447acd352b014a0fdc81fceb0a Mon Sep 17 00:00:00 2001 From: Yurii Shynbuiev Date: Wed, 20 May 2026 02:03:43 +0800 Subject: [PATCH 1/3] ci: add file hygiene workflow and lint configuration Add reusable file-hygiene workflow caller and canonical lint configs: - .github/workflows/file-hygiene.yml: caller for lint-files.yml - .editorconfig: UTF-8 (no BOM), LF line endings, indent rules with indent_size=4 override for Kotlin (*.kt, *.kts) - .gitattributes: LF normalization for text files, binary rules - .markdownlint.yml + .markdownlint-cli2.yaml: markdown lint rules with secp256k1-kmp/native/secp256k1/ excluded - .yamllint.yml: YAML lint rules with relaxations Refs: hyperledger-identus/hyperledger-identus#172 Co-Authored-By: Claude Opus 4.6 (1M context) Signed-off-by: Yurii Shynbuiev --- .editorconfig | 22 ++++++++++++++ .gitattributes | 46 ++++++++++++++++++++++++++++++ .github/workflows/file-hygiene.yml | 10 +++++++ .markdownlint-cli2.yaml | 8 ++++++ .markdownlint.yml | 20 +++++++++++++ .yamllint.yml | 26 +++++++++++++++++ 6 files changed, 132 insertions(+) create mode 100644 .gitattributes create mode 100644 .github/workflows/file-hygiene.yml create mode 100644 .markdownlint-cli2.yaml create mode 100644 .markdownlint.yml create mode 100644 .yamllint.yml diff --git a/.editorconfig b/.editorconfig index 2904482ce..4fae9d3ef 100644 --- a/.editorconfig +++ b/.editorconfig @@ -1,6 +1,28 @@ root = true +[*] +charset = utf-8 +end_of_line = lf +insert_final_newline = true +trim_trailing_whitespace = true +indent_style = space +indent_size = 2 + +[*.swift] +indent_size = 4 + +[*.{rs,go}] +indent_size = 4 + +[*.md] +trim_trailing_whitespace = false + +[Makefile] +indent_style = tab + +# Kotlin / ktlint rules (repo-specific) [*.{kt,kts}] +indent_size = 4 ktlint_code_style = intellij_idea ktlint_standard_no_semi = disabled ktlint_standard_trailing-comma-on-call-site = disabled diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 000000000..2e2bb588d --- /dev/null +++ b/.gitattributes @@ -0,0 +1,46 @@ +# Normalize all text files to LF +* text=auto eol=lf + +# Scripts -- must be LF (executed in Docker/Linux) +*.sh text eol=lf +*.bash text eol=lf + +# Data/config +*.sql text eol=lf +*.yaml text eol=lf +*.yml text eol=lf +*.json text eol=lf +*.toml text eol=lf +*.properties text eol=lf + +# Source code +*.scala text eol=lf +*.kt text eol=lf +*.kts text eol=lf +*.java text eol=lf +*.swift text eol=lf +*.ts text eol=lf +*.js text eol=lf +*.rs text eol=lf +*.go text eol=lf + +# Docs +*.md text eol=lf +*.txt text eol=lf + +# Docker +Dockerfile text eol=lf +docker-compose*.yml text eol=lf + +# Binary -- never touch +*.png binary +*.jpg binary +*.jpeg binary +*.gif binary +*.ico binary +*.jar binary +*.zip binary +*.tar.gz binary +*.woff binary +*.woff2 binary +*.ttf binary diff --git a/.github/workflows/file-hygiene.yml b/.github/workflows/file-hygiene.yml new file mode 100644 index 000000000..edb8f9e9f --- /dev/null +++ b/.github/workflows/file-hygiene.yml @@ -0,0 +1,10 @@ +name: File Hygiene + +on: + pull_request: + push: + branches: [main] + +jobs: + lint: + uses: hyperledger-identus/.github/.github/workflows/lint-files.yml@f2c9e417fa46f69b015a9cdbaafdfb9e52e4ed60 # main diff --git a/.markdownlint-cli2.yaml b/.markdownlint-cli2.yaml new file mode 100644 index 000000000..b52f44143 --- /dev/null +++ b/.markdownlint-cli2.yaml @@ -0,0 +1,8 @@ +ignores: + - ".claude/**" + - "node_modules/**" + - "**/node_modules/**" + - "build/**" + - "**/build/**" + - "target/**" + - "secp256k1-kmp/native/secp256k1/**" diff --git a/.markdownlint.yml b/.markdownlint.yml new file mode 100644 index 000000000..8cf88eac0 --- /dev/null +++ b/.markdownlint.yml @@ -0,0 +1,20 @@ +# markdownlint configuration +# https://github.com/DavidAnson/markdownlint/blob/main/doc/Rules.md + +default: true + +MD013: false +MD025: false +MD033: false +MD024: + siblings_only: true +MD041: false +MD029: + style: "ordered" +MD001: false +MD036: false +MD060: false +MD040: false +MD028: false +MD042: false +MD046: false diff --git a/.yamllint.yml b/.yamllint.yml new file mode 100644 index 000000000..4bcfe17d0 --- /dev/null +++ b/.yamllint.yml @@ -0,0 +1,26 @@ +--- +extends: default + +rules: + line-length: disable + truthy: + allowed-values: ["true", "false", "yes", "no", "on"] + comments-indentation: disable + document-start: disable + brackets: + min-spaces-inside: 0 + max-spaces-inside: 1 + comments: + min-spaces-from-content: 1 + indentation: + spaces: consistent + indent-sequences: whatever + empty-lines: + max-end: 1 + +ignore: | + build/ + node_modules/ + target/ + .claude/ + secp256k1-kmp/native/secp256k1/ From 944ec6b760030aa27f3023c4da8c637943a7c86a Mon Sep 17 00:00:00 2001 From: Yurii Shynbuiev Date: Wed, 20 May 2026 02:03:51 +0800 Subject: [PATCH 2/3] style: auto-fix markdown formatting across the repo Markdownlint auto-fix resolved formatting issues: - MD009: trailing spaces - MD012: multiple consecutive blank lines - MD022: missing blank lines around headings - MD031: missing blank lines around fenced code blocks - MD032: missing blank lines around lists - MD047: missing final newline CRLF to LF normalization: DCO.md, MAINTAINERS.md, SECURITY.md Co-Authored-By: Claude Opus 4.6 (1M context) Signed-off-by: Yurii Shynbuiev --- .github/PULL_REQUEST_TEMPLATE.md | 9 ++++-- BUILDING.md | 30 +++++++++++++------ CONTRIBUTING.md | 20 ++++++------- DCO.md | 6 ++-- MAINTAINERS.md | 6 ++-- README.md | 21 ++++++++++--- SECURITY.md | 6 ++-- apollo/docs/Apollo.md | 6 ++-- apollo/docs/Base64.md | 2 +- apollo/docs/SecureRandom.md | 2 +- .../IOHKSecureRandomGeneration.md | 1 + 11 files changed, 69 insertions(+), 40 deletions(-) diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index fb9704a17..eb3165c89 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -1,10 +1,13 @@ -### Description: +### Description + Summarize the changes you're submitting in a few sentences, including Jira ticket ATL-xxxx if applicable. Link to any discussion, related issues and bug reports to give the context to help the reviewer understand the PR. -### Alternatives Considered (optional): +### Alternatives Considered (optional) + Link to existing ADR (Architecture Decision Record), if any. If relevant, describe other approaches explored and the selected approach. Documenting why the methods were not selected will create a knowledge base for future reference, helping prevent others from revisiting less optimal ideas. -### Checklist: +### Checklist + - [ ] My PR follows the [contribution guidelines](https://github.com/hyperledger-identus/apollo/blob/main/CONTRIBUTING.md) of this project - [ ] My PR is free of third-party dependencies that don't comply with the [Allowlist](https://toc.hyperledger.org/governing-documents/allowed-third-party-license-policy.html#approved-licenses-for-allowlist) - [ ] I have commented my code, particularly in hard-to-understand areas diff --git a/BUILDING.md b/BUILDING.md index e70a81dca..4aa833f9c 100644 --- a/BUILDING.md +++ b/BUILDING.md @@ -43,28 +43,33 @@ In case of using macOS with M chip, make sure to install the arch64 version of J ### Install XCode (Mac Only) -Install XCode from App Store. +Install XCode from App Store. Then approve xcodebuild license in your terminal. Like so: + ```bash -$ sudo xcodebuild -license +sudo xcodebuild -license ``` ### Install Android SDK -Install Android SDK from SDK Manager (via Android Studio). +Install Android SDK from SDK Manager (via Android Studio). Then approve Android SDK license. Like so: + ```bash -$ cd /Users/{{YOUR USER}}/Library/Android/sdk -$ tools/bin/sdkmanager --licenses +cd /Users/{{YOUR USER}}/Library/Android/sdk +tools/bin/sdkmanager --licenses ``` + While there are many ways to install Android SDK this has proven to be the most reliable way. Standard IntelliJ with Android plugin may work. However, we've had several issues. Your mileage may vary. -For Ubuntu, +For Ubuntu, + ```bash sudo apt update && sudo apt install android-sdk ``` + Leaving the SDK at `~/Android/Sdk` ### Create local.properties file @@ -72,24 +77,28 @@ Leaving the SDK at `~/Android/Sdk` Create a file named `local.properties` in the root of Apollo. Add your android sdk path to `local.properties file`. Like so: + ```properties sdk.dir = /Users/{{YOUR USER}}/Library/Android/sdk ``` + This will indicate to your IDE which android SDK to use. Alternatively, you can add the following environment variable into your shell profile file: + ```bash -$ export ANDROID_HOME='/Users/{{YOUR USER}}/Library/Android/sdk +export ANDROID_HOME='/Users/{{YOUR USER}}/Library/Android/sdk ``` ### Building the project Install Rust packages: + ```bash -$ ./scripts/install-rust-packages.sh +./scripts/install-rust-packages.sh ``` -You should be able to import and build the project in IntelliJ IDEA now. +You should be able to import and build the project in IntelliJ IDEA now. #### Troubleshooting @@ -106,6 +115,7 @@ If you already added the environment variable to your CMD profile and still not ##### No binary for ChromeHeadless browser on your platform If you get error: + ```log No binary for ChromeHeadless browser on your platform. Please, set "CHROME_BIN" env variable. @@ -126,9 +136,11 @@ java.lang.IllegalStateException: Errors occurred during launch of browser for te ##### Could not find JNA native support if you get this error on macOS with M chip: + ```log Could not find JNA native support ``` + **Solution** * Make sure that you are using Java version that is arch64. diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 1cb77b55d..e30b24a0c 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -9,7 +9,7 @@ and feel free to propose changes to this document in a pull request. ### Identus Identus platform is a self-sovereign identity (SSI) platform and service suite for verifiable data and digital identity. -Built on a distributed ledger, it offers core infrastructure for issuing DIDs (Decentralized identifiers) and +Built on a distributed ledger, it offers core infrastructure for issuing DIDs (Decentralized identifiers) and verifiable credentials, alongside tools and frameworks to help expand your ecosystem. The complete platform is separated in multiple repositories: @@ -24,10 +24,10 @@ The complete platform is separated in multiple repositories: A cryptography lib built with Kotlin Multiplatform with support for the following targets: -- JS -- iOS -- Android -- JVM +* JS +* iOS +* Android +* JVM Future target might be supported in the future. @@ -41,15 +41,15 @@ set up your environment. The getProcess described here has several goals: -- Maintain the SDK quality -- Fix problems that are important to users -- Engage the community in working toward the best possible product -- Enable a sustainable system for the SDK maintainers to review contributions +* Maintain the SDK quality +* Fix problems that are important to users +* Engage the community in working toward the best possible product +* Enable a sustainable system for the SDK maintainers to review contributions Please follow these steps to have your contribution considered by the maintainers: 1. Follow all instructions in [the template]() -2. Follow the [Styleguide](#Styleguide) +2. Follow the [Styleguide](#styleguide) 3. After you submit your pull request, verify that all [status checks](https://help.github.com/articles/about-status-checks/) are passing
What if the status checks are failing?If a status check is failing, and you believe that the failure is unrelated to diff --git a/DCO.md b/DCO.md index 90522fd8e..44c23ddd5 100644 --- a/DCO.md +++ b/DCO.md @@ -1,3 +1,3 @@ -# Developer Certificate of Origin (DCO) - -For information about sign-offs required for contributions to this repository, please refer to this Hyperledger Identus repository's [DCO.md](https://github.com/hyperledger/identus/blob/main/DCO.md) file. \ No newline at end of file +# Developer Certificate of Origin (DCO) + +For information about sign-offs required for contributions to this repository, please refer to this Hyperledger Identus repository's [DCO.md](https://github.com/hyperledger/identus/blob/main/DCO.md) file. diff --git a/MAINTAINERS.md b/MAINTAINERS.md index 1473cb839..5101b5d99 100644 --- a/MAINTAINERS.md +++ b/MAINTAINERS.md @@ -1,3 +1,3 @@ -# Mainteiners - -For information about the Maintainers of this repository, please see the Hyperledger Identus repository’s [MAINTAINERS.md](https://github.com/hyperledger/identus/blob/main/MAINTAINERS.md) file. \ No newline at end of file +# Mainteiners + +For information about the Maintainers of this repository, please see the Hyperledger Identus repository’s [MAINTAINERS.md](https://github.com/hyperledger/identus/blob/main/MAINTAINERS.md) file. diff --git a/README.md b/README.md index 77fed335b..b69d76db0 100644 --- a/README.md +++ b/README.md @@ -25,12 +25,15 @@ A cryptography lib built with Kotlin Multiplatform with support for the followin ## JVM Usage In `build.gradle.kts` files include the dependency + ```kotlin repositories { mavenCentral() } ``` + For dependencies + ```kotlin dependencies { implementation("org.hyperledger.identus:apollo:") @@ -42,6 +45,7 @@ dependencies { ### Using SPM Inside your `Package.swift` file, add the following + ```swift dependencies: [ .package( @@ -50,9 +54,11 @@ dependencies: [ ) ] ``` + ### Using generated xcframework directly The following instruction using Xcode 15 + 1. Go the [Release Page](https://github.com/hyperledger-identus/apollo/releases) and check the latest version and download the `ApolloBinary.xcframework.zip` file. 2. Uncompress the downloaded file. 3. Add the `ApolloBinary.xcframework` to your Xcode project. @@ -80,6 +86,7 @@ Package( ## Node.js usage Inside the `package.json` + ```json { "dependencies": { @@ -93,6 +100,7 @@ Inside the `package.json` ### Using Groovy In the project `build.gradle` + ```groovy allprojects { repositories { @@ -101,7 +109,9 @@ allprojects { } } ``` + In the module `build.gradle` + ```groovy kotlin { sourceSets { @@ -118,6 +128,7 @@ kotlin { ### Using Kotlin DSL In the project `build.gradle.kts` + ```kotlin allprojects { repositories { @@ -126,6 +137,7 @@ allprojects { } } ``` + ```kotlin kotlin { sourceSets { @@ -154,14 +166,15 @@ Please have a look at unit tests, more samples will be added soon. See [BUILDING.md](./BUILDING.md) for instructions on how to build Apollo from source. ## Contributing to Apollo + See [CONTRIBUTING.md](./CONTRIBUTING.md) and [CODE_OF_CONDUCT.md](./CODE_OF_CONDUCT.md) for instructions on how to contribute ## Cryptography Notice -This distribution includes cryptographic software. The country in which you currently reside may -have restrictions on the import, possession, use, and/or re-export to another country, of encryption -software. BEFORE using any encryption software, please check your country's laws, regulations and policies -concerning the import, possession, or use, and re-export of encryption software, to see if this is permitted. +This distribution includes cryptographic software. The country in which you currently reside may +have restrictions on the import, possession, use, and/or re-export to another country, of encryption +software. BEFORE using any encryption software, please check your country's laws, regulations and policies +concerning the import, possession, or use, and re-export of encryption software, to see if this is permitted. See [http://www.wassenaar.org/](http://www.wassenaar.org/) for more information. ## License diff --git a/SECURITY.md b/SECURITY.md index ee3770df1..adb9c6d95 100644 --- a/SECURITY.md +++ b/SECURITY.md @@ -1,3 +1,3 @@ -# Security - -For information about reporting security vulnerabilities in this repository, please consult the Hyperledger Identus repository’s [SECURITY.md](https://github.com/hyperledger/identus/blob/main/SECURITY.md) file. \ No newline at end of file +# Security + +For information about reporting security vulnerabilities in this repository, please consult the Hyperledger Identus repository’s [SECURITY.md](https://github.com/hyperledger/identus/blob/main/SECURITY.md) file. diff --git a/apollo/docs/Apollo.md b/apollo/docs/Apollo.md index 5193a5032..35e3782b5 100644 --- a/apollo/docs/Apollo.md +++ b/apollo/docs/Apollo.md @@ -13,7 +13,7 @@ Apollo is the robust cryptographic engine driving the security and privacy of Id blockchain-powered solutions. This collection of cryptographic methods provides the solid foundation upon which Identus platform builds its diverse functionalities. -### Key Features of Apollo: +### Key Features of Apollo - **Hashing:** Cryptographically secure hashing functions, including the widely trusted SHA-2 family and PBKDF2SHA512, ensure data integrity and prevent tampering. @@ -29,13 +29,13 @@ platform builds its diverse functionalities. - **Hierarchical Deterministic Key Management (HDKey):** This powerful system allows generating a vast number of child keys from a single master key, facilitating robust key management for diverse applications. -## Security First: +## Security First Apollo's commitment to security is paramount. It has undergone two independent security audits, further validating its reliability and trustworthiness. This meticulous attention to security ensures that Identus platform operates at the highest standards, safeguarding user data and privacy. -## Empowering Secure Solutions: +## Empowering Secure Solutions Through its robust cryptographic capabilities, Apollo empowers Identus platform to deliver a range of secure and privacy-preserving solutions across various industries. From identity management and document verification to supply diff --git a/apollo/docs/Base64.md b/apollo/docs/Base64.md index 3581094cc..2315f4f97 100644 --- a/apollo/docs/Base64.md +++ b/apollo/docs/Base64.md @@ -10,7 +10,7 @@ Apollo Base64 is Kotlin Multiplatform library containing Standard & URL safe | iOS Arm 64 | ✔ | | iOS Arm 32 | ✔ | | iOS Simulator Arm 64 (Apple Silicon) | ✔ | -| JVM | ✔ | +| JVM | ✔ | | Android | ✔ | | JS Browser | ✔ | | NodeJS Browser | ✔ | diff --git a/apollo/docs/SecureRandom.md b/apollo/docs/SecureRandom.md index 63465cb8e..90279198c 100644 --- a/apollo/docs/SecureRandom.md +++ b/apollo/docs/SecureRandom.md @@ -10,7 +10,7 @@ Apollo Secure Random is Kotlin Multiplatform library to generate secure random b | iOS Arm 64 | ✔ | | iOS Arm 32 | ✔ | | iOS Simulator Arm 64 (Apple Silicon) | ✔ | -| JVM | ✔ | +| JVM | ✔ | | Android | ✔ | | JS Browser | ✔ | | NodeJS Browser | ✔ | diff --git a/iOSLibs/IOHKSecureRandomGeneration/IOHKSecureRandomGeneration/IOHKSecureRandomGeneration.docc/IOHKSecureRandomGeneration.md b/iOSLibs/IOHKSecureRandomGeneration/IOHKSecureRandomGeneration/IOHKSecureRandomGeneration.docc/IOHKSecureRandomGeneration.md index 0a250560d..b0501e428 100755 --- a/iOSLibs/IOHKSecureRandomGeneration/IOHKSecureRandomGeneration/IOHKSecureRandomGeneration.docc/IOHKSecureRandomGeneration.md +++ b/iOSLibs/IOHKSecureRandomGeneration/IOHKSecureRandomGeneration/IOHKSecureRandomGeneration.docc/IOHKSecureRandomGeneration.md @@ -7,6 +7,7 @@ Secure Random Generation for IV random generation Secure Random Generation for IV random generation ## Usage + ```swift let iv = KMMFunctions.randomIV(8) let salt = KMMFunctions.randomSalt(8) From cc044dfd76f2c37d9dbe516e216eedbd71938d69 Mon Sep 17 00:00:00 2001 From: Yurii Shynbuiev Date: Wed, 20 May 2026 02:03:58 +0800 Subject: [PATCH 3/3] chore: add formatting commit to .git-blame-ignore-revs Co-Authored-By: Claude Opus 4.6 (1M context) Signed-off-by: Yurii Shynbuiev --- .git-blame-ignore-revs | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 .git-blame-ignore-revs diff --git a/.git-blame-ignore-revs b/.git-blame-ignore-revs new file mode 100644 index 000000000..f084378f9 --- /dev/null +++ b/.git-blame-ignore-revs @@ -0,0 +1,3 @@ +# style: auto-fix markdown formatting across the repo +# Mass formatting. No logic changes. +944ec6b760030aa27f3023c4da8c637943a7c86a