Skip to content

Commit

Permalink
Merge pull request #245 from Sphereon-Opensource/develop
Browse files Browse the repository at this point in the history
New release
  • Loading branch information
nklomp authored Oct 1, 2024
2 parents 3000e7d + 8dd0616 commit 31ea0bf
Show file tree
Hide file tree
Showing 241 changed files with 16,154 additions and 7,529 deletions.
11 changes: 10 additions & 1 deletion .github/workflows/build-test-on-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ jobs:
runs-on: ubuntu-latest
env:
VC_HTTP_API_AUTH_TOKEN: ${{secrets.VC_HTTP_API_AUTH_TOKEN}}
NODE_OPTIONS: --max_old_space_size=4096
services:
postgres:
image: postgres:10.10
Expand Down Expand Up @@ -47,4 +48,12 @@ jobs:
SPHEREON_SSI_MSAL_USERNAME: ${{ secrets.SPHEREON_SSI_MSAL_USERNAME }}
SPHEREON_SSI_MSAL_PASSWORD: ${{ secrets.SPHEREON_SSI_MSAL_PASSWORD }}
run: pnpm test:ci
- run: npx codecov
- uses: codecov/codecov-action@v4
with:
fail_ci_if_error: false # optional (default = false)
files: ./coverage1.xml,./coverage2.xml # optional
flags: unittests # optional
name: codecov-umbrella # optional
token: ${{ secrets.CODECOV_TOKEN }} # required
verbose: true # optional (default = false)

3 changes: 1 addition & 2 deletions .github/workflows/build-test-publish-on-push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ jobs:
GH_USER: ${{secrets.GH_USER}}
GH_EMAIL: ${{secrets.GH_EMAIL}}
VC_HTTP_API_AUTH_TOKEN: ${{secrets.VC_HTTP_API_AUTH_TOKEN}}
NODE_OPTIONS: --max_old_space_size=4096
runs-on: ubuntu-latest
services:
postgres:
Expand Down Expand Up @@ -71,8 +72,6 @@ jobs:
echo "link-workspace-packages=deep" >> .npmrc
echo "prefer-workspace-packages=true" >> .npmrc
# npm whoami

- name: show diff to track issues with lock file
run: git diff -u

Expand Down
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -515,7 +515,7 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline

### Features

- add Microsoft Request Service API support ([251ed60](https://github.com/Sphereon-Opensource/SSI-SDK/commit/251ed60ebd6984d5fe494a764d8cd662dd0eba6d))
- add Microsoft Request CoseCryptoService API support ([251ed60](https://github.com/Sphereon-Opensource/SSI-SDK/commit/251ed60ebd6984d5fe494a764d8cd662dd0eba6d))
- Add migration support to mnemonic seed manager plugin. Fix some entity props in the process ([f7641f4](https://github.com/Sphereon-Opensource/SSI-SDK/commit/f7641f4f56ebe99894ddad6c6827681406d21d2e))

### Reverts
Expand Down
8 changes: 6 additions & 2 deletions lerna.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
{
"version": "0.29.0",
"version": "0.30",
"npmClient": "pnpm",
"command": {
"version": {
"forcePublish": true
},
"publish": {
"allowBranch": ["main", "master"],
"allowBranch": [
"main",
"master",
"feature/from-funke"
],
"conventionalCommits": true,
"gitRemote": "origin",
"message": "chore(release): %s"
Expand Down
8 changes: 3 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@sphereon/sphereon-sdk.workspace",
"private": true,
"version": "0.28.0",
"version": "0.30.0",
"description": "Sphereon SSI SDK (Workspace)",
"repository": "[email protected]:Sphereon-Opensource/SSI-SDK.git",
"author": "Sphereon <[email protected]>",
Expand Down Expand Up @@ -113,10 +113,8 @@
"@veramo/url-handler": "4.2.0",
"@sphereon/ssi-types": "workspace:*",
"@sphereon/ssi-sdk.core": "workspace:*",
"@sphereon/oid4vci-common": "0.15.1-next.9",
"@sphereon/oid4vci-client": "0.15.1-next.9",
"@sphereon/oid4vci-issuer": "0.15.1-next.9",
"@sphereon/pex": "^4.0.1",
"@sphereon/pex": "5.0.0-unstable.8",
"@sphereon/pex-models": "^2.3.1",
"@noble/hashes": "1.2.0",
"debug": "^4.3.5",
"did-jwt": "6.11.6",
Expand Down
2 changes: 1 addition & 1 deletion packages/agent-config/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@sphereon/ssi-sdk.agent-config",
"version": "0.29.0",
"version": "0.30.0",
"source": "src/index.ts",
"main": "dist/index.js",
"types": "dist/index.d.ts",
Expand Down
64 changes: 64 additions & 0 deletions packages/agent-config/src/agentContextUtils.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
import {
IAgentContext,
ICredentialVerifier,
IDataStore,
IDataStoreORM,
IDIDManager,
IKeyManager,
IPluginMethodMap,
IResolver,
ICredentialIssuer,
ICredentialStatusVerifier,
} from '@veramo/core'

/**
* Allows to get a type agent context plugin methods based on provided or inferred types and at least one method for these plugin(s)
* @param context Tje agent context to check against
* @param requiredMethod One or more method the plugin provides, so we can check availability and thus plugin presence
*/
export function contextHasPlugin<Plugins extends IPluginMethodMap>(
context: IAgentContext<any>,
requiredMethod: string | string[],
): context is IAgentContext<Plugins> {
const methods = Array.isArray(requiredMethod) ? requiredMethod : [requiredMethod]
const allMethods = context.agent.availableMethods()
return methods.every((method) => allMethods.includes(method))
}

/**
* The below methods are convenience methods to directly get the appropriate context after calling the respective method
*
* @param context
*/

export function contextHasKeyManager(context: IAgentContext<IPluginMethodMap>): context is IAgentContext<IKeyManager> {
return contextHasPlugin(context, 'keyManagerGet')
}

export function contextHasDidManager(context: IAgentContext<IPluginMethodMap>): context is IAgentContext<IResolver & IDIDManager> {
return contextHasPlugin(context, 'didManagerGet') // IResolver is always required for IDIDManager
}

export function contextHasDidResolver(context: IAgentContext<IPluginMethodMap>): context is IAgentContext<IResolver> {
return contextHasPlugin(context, 'resolveDid') // IResolver is always required for IDIDManager
}

export function contextHasCredentialIssuer(context: IAgentContext<IPluginMethodMap>): context is IAgentContext<ICredentialIssuer> {
return contextHasPlugin(context, ['createVerifiableCredential', 'createVerifiablePresentation']) // W3C Credential issuer
}

export function contextHasCredentialVerifier(context: IAgentContext<IPluginMethodMap>): context is IAgentContext<ICredentialVerifier> {
return contextHasPlugin(context, ['verifyCredential', 'verifyPresentation']) // W3c Credential Verifier
}

export function contextHasCredentialStatusVerifier(context: IAgentContext<IPluginMethodMap>): context is IAgentContext<ICredentialStatusVerifier> {
return contextHasPlugin(context, ['checkCredentialStatus']) // W3c Credential status Verifier
}

export function contextHasDataStore(context: IAgentContext<IPluginMethodMap>): context is IAgentContext<IDataStore> {
return contextHasPlugin(context, ['dataStoreGetVerifiableCredential', 'dataStoreGetVerifiablePresentation'])
}

export function contextHasDataStoreORM(context: IAgentContext<IPluginMethodMap>): context is IAgentContext<IDataStoreORM> {
return contextHasPlugin(context, ['dataStoreORMGetVerifiableCredentials', 'dataStoreORMGetVerifiablePresentations'])
}
2 changes: 1 addition & 1 deletion packages/agent-config/src/agentCreator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ export const getConfig = async (filePath: string | Buffer | URL): Promise<{ vers

// read file async
try {
const fs = await import('fs')
const fs = await import(/* webpackIgnore: true */ 'fs')
fileContent = await fs.promises.readFile(filePath, 'utf8')
} catch (e) {
console.log('Config file not found: ' + filePath)
Expand Down
Loading

0 comments on commit 31ea0bf

Please sign in to comment.