Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor!: Open source node #850

Merged
merged 11 commits into from
May 17, 2024
Merged

refactor!: Open source node #850

merged 11 commits into from
May 17, 2024

Conversation

milosbackonja
Copy link

Overview

Screenshots

Checklists

Pre-submit checklist:

  • Self-reviewed the diff
  • New code has proper comments/documentation/tests
  • Any changes not covered by tests have been tested manually
  • The README files are updated
  • If new libraries are included, they have licenses compatible with our project
  • If there is a db migration altering existing tables, there is a proper migration test

Pre-merge checklist:

  • Commits have useful messages
  • Review clarifications made it into the code

shotexa and others added 11 commits March 25, 2024 19:13
* Add everything

Signed-off-by: Shota Jolbordi <shota.jolbordi@iohk.io>

* Remove migration tests

Signed-off-by: Shota Jolbordi <shota.jolbordi@iohk.io>

* add ingnore invalid create option for postres mega linter

Signed-off-by: Shota Jolbordi <shota.jolbordi@iohk.io>

* Try mega linter 7

Signed-off-by: Shota Jolbordi <shota.jolbordi@iohk.io>

* edit megalinter.yaml

Signed-off-by: Shota Jolbordi <shota.jolbordi@iohk.io>

* Disable some linters

Signed-off-by: Shota Jolbordi <shota.jolbordi@iohk.io>

---------

Signed-off-by: Shota Jolbordi <shota.jolbordi@iohk.io>
* Start cleaning up docs

Signed-off-by: Shota Jolbordi <shota.jolbordi@iohk.io>

* Remove more files

Signed-off-by: Shota Jolbordi <shota.jolbordi@iohk.io>

* Fix compilation issue

Signed-off-by: Shota Jolbordi <shota.jolbordi@iohk.io>

* Trim docs

Signed-off-by: Shota Jolbordi <shota.jolbordi@iohk.io>

* Fix compilation errors

Signed-off-by: Shota Jolbordi <shota.jolbordi@iohk.io>

* Remove some bitcoin test resources and old docs

Signed-off-by: Shota Jolbordi <shota.jolbordi@iohk.io>

* Lint

Signed-off-by: Shota Jolbordi <shota.jolbordi@iohk.io>

* Fix tests

Signed-off-by: Shota Jolbordi <shota.jolbordi@iohk.io>

---------

Signed-off-by: Shota Jolbordi <shota.jolbordi@iohk.io>
* ATL-6668: Delete legacy operation related to credentials

This commit deletes the IssueCredentialBatchOperation and
RevokeCredentialsOperation. It does not delete node API, daos nor
repositories related to credentials

* ATL-6668: Delete more files related to VCs

This commit deletes even more files related to VC operations. It also
removes some dependencies on the old SDK

* ATL-6668: Delete unused tables

This commit deletes tables and indexes from VC legacy operations

* ATL-6668: Fix formatting

* ATL-6668: Address review comments

This commit deletes references to legacy VC code in protobuf and sql
definitions
* ATL-6924: Replace users of ECPublicKey

This commit replaces the used of ECPublicKey

* ATL-6924: Simplify models

This commit simplifies models by deleting classes not needed at parsing
time

* ATL-6924: Simplify types

This commit replaces some uses of Array and uses Vector instead to allow
more transparent equality checks

* ATL-6924: Add support for encoding functions

This commit adds support to decode hex strings into Sha256Hash bytes

* ATL-6924: Refactor CryptoUtils and remove SHA256Digest

This commit improves the organization of CryptoUtils methods
It also delete the used of SDK methods related to Sha256 hashing
* ATL-6926: Remove uses of EC classes

This commit removes most uses of the legacy crypto SDK

* ATL-6926: Fix missing implementations

This commit adds missing implementations for key encoding algorithms

* ATL-6926: Fix tests

* ATL-6926: Clean up code and tests

* ATL-6926: Correct typo and add tests

This commit adds the final tests to validate the cryptography
implementation that replaces the SDK
* clean up source files, replace DID usages

Signed-off-by: Shota Jolbordi <shota.jolbordi@iohk.io>

* Fix some tests

Signed-off-by: Shota Jolbordi <shota.jolbordi@iohk.io>

* Linting

Signed-off-by: Shota Jolbordi <shota.jolbordi@iohk.io>

* Fix test

Signed-off-by: Shota Jolbordi <shota.jolbordi@iohk.io>

* Fix fromString on DID

Signed-off-by: Shota Jolbordi <shota.jolbordi@iohk.io>

* formatting

Signed-off-by: Shota Jolbordi <shota.jolbordi@iohk.io>

* Address some PR comments

Signed-off-by: Shota Jolbordi <shota.jolbordi@iohk.io>

---------

Signed-off-by: Shota Jolbordi <shota.jolbordi@iohk.io>
* Remove uses of the old SDK

This commit removes the uses of the old SDK and update tests

* Refactor CryptoUtils class

This commit re-organizes and renames methods for better use

* Remove last dependency on old SDK

This commit removes the last dependencies on the old SDK
* ATL-6669: Update README

This commits updates the README to focus oly on the PRISM node.

* ATL-6669: Add IDE notes in README

This commit adds instructions to load the project in different IDEs.
The commit also removes incorrect sentences

* ATL-6669: Delete old README and complete new one

* ATL-6669: Add pre-commit configuration

This commit adds a pre-commit hook that runs scalafmt and instructions
to configure it

* ATL-6669: Refer to identus configuration

This commit updates the README and refers users to read identus
documentation in order to configure the node.
This commit deletes the legacy DID based authentication
* Change some build files

Signed-off-by: Shota Jolbordi <shota.jolbordi@iohk.io>

* Rmove unused files

Signed-off-by: Shota Jolbordi <shota.jolbordi@iohk.io>

* Remove unused files

Signed-off-by: Shota Jolbordi <shota.jolbordi@iohk.io>

* Remove outer node folder

Signed-off-by: Shota Jolbordi <shota.jolbordi@iohk.io>

* Revert version name

Signed-off-by: Shota Jolbordi <shota.jolbordi@iohk.io>

* Remove unneeded resolver from the build

Signed-off-by: Shota Jolbordi <shota.jolbordi@iohk.io>

* Update fs2

Signed-off-by: Shota Jolbordi <shota.jolbordi@iohk.io>

* Start adding tests

Signed-off-by: Shota Jolbordi <shota.jolbordi@iohk.io>

* Add more tests

Signed-off-by: Shota Jolbordi <shota.jolbordi@iohk.io>

* Fix 1 failing test

Signed-off-by: Shota Jolbordi <shota.jolbordi@iohk.io>

* Minor adjustment in docs

Signed-off-by: Shota Jolbordi <shota.jolbordi@iohk.io>

* Remove test report aggregation step

Signed-off-by: Shota Jolbordi <shota.jolbordi@iohk.io>

---------

Signed-off-by: Shota Jolbordi <shota.jolbordi@iohk.io>
…eys table (#848)

* Add http scheme support and removed the contraint from publickeys table

Signed-off-by: mineme0110 <shailesh.patil@iohk.io>

* ran scalafmt

Signed-off-by: mineme0110 <shailesh.patil@iohk.io>

---------

Signed-off-by: mineme0110 <shailesh.patil@iohk.io>
@milosbackonja milosbackonja requested a review from yshyn-iohk May 17, 2024 12:08
Copy link

github-actions bot commented May 17, 2024

Unit Test Results

289 tests   - 39   288 ✔️  - 39   24s ⏱️ -11s
  36 suites  - 12       1 💤 ±  0 
  36 files    - 12       0 ±  0 

Results for commit 76d49e2. ± Comparison against base commit 15e6865.

This pull request removes 80 and adds 41 tests. Note that renamed tests count towards both.
io.iohk.atala.prism.auth.grpc.AuthorizationInterceptorSpec ‑ AuthorizationInterceptor should intercept allow when supplied prism auth token matches and authEnable is true
io.iohk.atala.prism.auth.grpc.AuthorizationInterceptorSpec ‑ AuthorizationInterceptor should intercept fail Unauthenticated when supplied prism auth token doesn't matched and authEnable is true
io.iohk.atala.prism.auth.grpc.AuthorizationInterceptorSpec ‑ AuthorizationInterceptor should intercept nothing when authEnabled is false
io.iohk.atala.prism.auth.utils.DIDUtilsSpec ‑ findPublicKey should return AuthError given key not found
io.iohk.atala.prism.auth.utils.DIDUtilsSpec ‑ findPublicKey should return key given publicKey contains compressedKeyData
io.iohk.atala.prism.auth.utils.DIDUtilsSpec ‑ findPublicKey should return key given publicKey contains not compressed dKeyData
io.iohk.atala.prism.auth.utils.DIDUtilsSpec ‑ findPublicKey should work fine when you pass compressed key as uncompressed
io.iohk.atala.prism.auth.utils.DidWhitelistLoaderSpec ‑ DidWhitelistLoader should be able to load whitelist from file
io.iohk.atala.prism.daos.DbConfigDaoSpec ‑ DbConfigDao should return None if a key doesn't exist
io.iohk.atala.prism.daos.DbConfigDaoSpec ‑ DbConfigDao should return previous value when key exists
…
io.iohk.atala.prism.node.crypto.CryptoTestsSpec ‑ cryptoUtils library should Must generate the same key from different encodings
io.iohk.atala.prism.node.crypto.CryptoTestsSpec ‑ cryptoUtils library should Perform Sha256 hashing as expected
io.iohk.atala.prism.node.crypto.CryptoTestsSpec ‑ cryptoUtils library should can verify a valid signature from another library
io.iohk.atala.prism.node.crypto.CryptoTestsSpec ‑ cryptoUtils library should can verify what it signs
io.iohk.atala.prism.node.crypto.CryptoTestsSpec ‑ cryptoUtils library should decode hashes bytes as expected
io.iohk.atala.prism.node.crypto.CryptoTestsSpec ‑ cryptoUtils library should decode hex encoded hashes as expected
io.iohk.atala.prism.node.crypto.CryptoTestsSpec ‑ cryptoUtils library should encode hashes as expected
io.iohk.atala.prism.node.crypto.CryptoTestsSpec ‑ cryptoUtils library should private key encoding / decoding works as expected
io.iohk.atala.prism.node.crypto.CryptoTestsSpec ‑ cryptoUtils library should public key compressed encoding / decoding works as expected
io.iohk.atala.prism.node.crypto.CryptoTestsSpec ‑ cryptoUtils library should public key coordinates encoding / decoding works as expected
…

♻️ This comment has been updated with latest results.

@atala-dev
Copy link
Contributor

🦙 MegaLinter status: ⚠️ WARNING

Descriptor Linter Files Fixed Errors
✅ ACTION actionlint 2 0
✅ JSON jsonlint 9 0
✅ JSON npm-package-json-lint yes no
⚠️ JSON prettier 9 1
✅ JSON v8r 9 0
⚠️ MARKDOWN markdownlint 7 109
⚠️ MARKDOWN markdown-link-check 7 12
⚠️ MARKDOWN markdown-table-formatter 7 1
⚠️ PROTOBUF protolint 4 4
✅ REPOSITORY dustilock yes no
✅ REPOSITORY git_diff yes no
✅ REPOSITORY grype yes no
⚠️ REPOSITORY kics yes 49
✅ REPOSITORY syft yes no
✅ REPOSITORY trivy-sbom yes no
⚠️ REPOSITORY trufflehog yes 1
✅ SQL sql-lint 2 0
✅ XML xmllint 2 0
⚠️ YAML prettier 3 1
✅ YAML v8r 3 0
✅ YAML yamllint 3 0

See detailed report in MegaLinter reports
Set VALIDATE_ALL_CODEBASE: true in mega-linter.yml to validate all sources, not only the diff

MegaLinter is graciously provided by OX Security

@milosbackonja milosbackonja merged commit 5ba1bd1 into main May 17, 2024
7 of 10 checks passed
@milosbackonja milosbackonja deleted the open-source-node branch May 17, 2024 12:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants