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

feature/CWALL-153 #171

Merged
merged 40 commits into from
Jun 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
d9b8623
feat: (WIP) added ownerId, tenantId, and origin.
sksadjad Mar 14, 2024
eff3432
Merge branch 'develop' of https://github.com/Sphereon-Opensource/SSI-…
zoemaas Mar 22, 2024
95929d1
fix: removed not null constraint from the SQL statement that adds the…
zoemaas Mar 22, 2024
fb36a51
feat: Added the StudentEntity and refactored the migrations
zoemaas Mar 27, 2024
cc5caf0
Merge remote-tracking branch 'refs/remotes/origin/develop' into featu…
sanderPostma May 14, 2024
ad06ed4
CWALL-153: killed al the students & restructured metadata handling
sanderPostma May 14, 2024
ca8cb30
CWALL-153: Added migrations and support filtering on identity metadata
sanderPostma May 15, 2024
493645d
CWALL-153: Fix in contact.entities.test.ts
sanderPostma May 15, 2024
cbf05f9
CWALL-153: refactored & tested
sanderPostma May 16, 2024
d27deef
CWALL-153: renamed origin fields
sanderPostma May 16, 2024
6d25cb1
CWALL-153: reverted origin rename as it's enough to change it in the …
sanderPostma May 16, 2024
cf81643
CWALL-153: removed redundant test
sanderPostma May 16, 2024
c5cb504
CWALL-153: added metadata undefined/null check
sanderPostma May 16, 2024
4860ecc
CWALL-153: Reverted party_origin_type_enum
sanderPostma May 16, 2024
cf13171
chore: use party origin enum for default value
Brummos May 17, 2024
54b87db
chore: code styling
Brummos May 17, 2024
7f2d828
CWALL-153: PR feedback changes
sanderPostma May 21, 2024
27e7bc8
Merge branch 'feature/CWALL-153' of https://github.com/Sphereon-Opens…
sanderPostma May 21, 2024
4abf89d
CWALL-153: Updated migrations related to DEFAULT 'EXTERNAL' NOT NULL`
sanderPostma May 21, 2024
5b043bd
CWALL-153: export ContactMetadataItemEntity
sanderPostma May 21, 2024
3a7dfa4
CWALL-153: saving work
sanderPostma May 21, 2024
6bd7d77
chore: generic for buildMetadataCondition
sanderPostma May 29, 2024
1a8cb9b
chore: cleanup
sanderPostma May 29, 2024
c895ba3
chore: pnpm update
sanderPostma May 29, 2024
28a0d20
chore: IdentityRole -> CredentialRole + test fixes
sanderPostma May 29, 2024
da8d977
chore: pnpm v8
sanderPostma May 29, 2024
5adb69f
chore: lockfile
sanderPostma May 29, 2024
345d742
chore: cleanup
sanderPostma May 31, 2024
9fcedd4
chore: cleanup
sanderPostma May 31, 2024
8c9752e
chore: migrations cleanup
sanderPostma May 31, 2024
1cecf50
chore: migrations cleanup
sanderPostma May 31, 2024
f9667b5
chore: migrations cleanup
sanderPostma May 31, 2024
1331c69
chore: migrations cleanup
sanderPostma May 31, 2024
c47792c
chore: migrations cleanup
sanderPostma May 31, 2024
c8246cd
chore: test fix
Brummos Jun 3, 2024
1277d0b
chore: migrations cleanup
sanderPostma Jun 4, 2024
89c5051
chore: revert named origins
sanderPostma Jun 4, 2024
3ecb5dd
chore: comment slice to extract type from string [object String]
sanderPostma Jun 4, 2024
9b4e92f
Merge remote-tracking branch 'refs/remotes/origin/develop' into featu…
sanderPostma Jun 7, 2024
61df0f7
chore: removed default PartyOrigin
sanderPostma Jun 6, 2024
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
19 changes: 14 additions & 5 deletions packages/contact-manager-rest-api/__tests__/agent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,14 @@ import { DataStore, DataStoreORM, DIDStore } from '@veramo/data-store'
import { IRequiredPlugins } from '../src'
import { DB_CONNECTION_NAME, sqliteConfig } from './database'
import { AddContactArgs, ContactManager } from '@sphereon/ssi-sdk.contact-manager'
import { ContactStore, CorrelationIdentifierEnum, IdentityRoleEnum, NonPersistedIdentity, PartyTypeEnum } from '@sphereon/ssi-sdk.data-store'
import {
ContactStore,
CorrelationIdentifierType,
CredentialRole,
NonPersistedIdentity,
PartyOrigin,
PartyTypeType,
} from '@sphereon/ssi-sdk.data-store'
import { DataSources } from '@sphereon/ssi-sdk.agent-config'
import { v4 } from 'uuid'
import { DIDManager } from '@veramo/did-manager'
Expand Down Expand Up @@ -60,9 +67,9 @@ const toContactIdentityDTO = (contact: Record<string, any>, identifier: IIdentif
console.log(`Contact received did ${identifier.did}, contact: ${JSON.stringify(contact)}`)
return {
alias: identifier.alias,
roles: [IdentityRoleEnum.ISSUER],
roles: [CredentialRole.ISSUER],
identifier: {
type: CorrelationIdentifierEnum.DID,
type: CorrelationIdentifierType.DID,
correlationId: identifier.did,
},
} as NonPersistedIdentity
Expand All @@ -72,13 +79,15 @@ async function addContacts() {
try {
const personContactType = await agent.cmAddContactType({
name: 'people',
type: PartyTypeEnum.NATURAL_PERSON,
origin: PartyOrigin.EXTERNAL,
type: PartyTypeType.NATURAL_PERSON,
tenantId: v4(),
})

const organizationalContactType = await agent.cmAddContactType({
name: 'organizations',
type: PartyTypeEnum.ORGANIZATION,
origin: PartyOrigin.EXTERNAL,
type: PartyTypeType.ORGANIZATION,
tenantId: v4(),
})

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ import {
ElectronicAddress,
GetPartiesArgs,
Identity,
IdentityRole,
CredentialRole,
IdentityOrigin,
NaturalPerson,
NonPersistedElectronicAddress,
NonPersistedIdentity,
Expand Down Expand Up @@ -45,7 +46,8 @@ export default (testContext: { getAgent: () => ConfiguredAgent; setup: () => Pro
const correlationId = 'default_example_did'
const identity: NonPersistedIdentity = {
alias: correlationId,
roles: [IdentityRole.ISSUER, IdentityRole.VERIFIER],
origin: IdentityOrigin.EXTERNAL,
roles: [CredentialRole.ISSUER, CredentialRole.VERIFIER],
identifier: {
type: CorrelationIdentifierType.DID,
correlationId,
Expand Down Expand Up @@ -241,7 +243,8 @@ export default (testContext: { getAgent: () => ConfiguredAgent; setup: () => Pro
const correlationId = 'new_example_did'
const identity: NonPersistedIdentity = {
alias: correlationId,
roles: [IdentityRole.ISSUER, IdentityRole.VERIFIER],
origin: IdentityOrigin.EXTERNAL,
roles: [CredentialRole.ISSUER, CredentialRole.VERIFIER],
identifier: {
type: CorrelationIdentifierType.DID,
correlationId,
Expand All @@ -265,7 +268,8 @@ export default (testContext: { getAgent: () => ConfiguredAgent; setup: () => Pro
const correlationId = 'missing_connection_add_example'
const identity: NonPersistedIdentity = {
alias: correlationId,
roles: [IdentityRole.ISSUER, IdentityRole.VERIFIER],
origin: IdentityOrigin.EXTERNAL,
roles: [CredentialRole.ISSUER, CredentialRole.VERIFIER],
identifier: {
type: CorrelationIdentifierType.URL,
correlationId,
Expand All @@ -281,7 +285,8 @@ export default (testContext: { getAgent: () => ConfiguredAgent; setup: () => Pro
const correlationId = 'missing_connection_update_example'
const identity: NonPersistedIdentity = {
alias: correlationId,
roles: [IdentityRole.ISSUER, IdentityRole.VERIFIER],
origin: IdentityOrigin.EXTERNAL,
roles: [CredentialRole.ISSUER, CredentialRole.VERIFIER],
identifier: {
type: CorrelationIdentifierType.DID,
correlationId,
Expand All @@ -297,7 +302,8 @@ export default (testContext: { getAgent: () => ConfiguredAgent; setup: () => Pro
const correlationId = 'new_update_example_did'
const identity: NonPersistedIdentity = {
alias: 'update_example_did',
roles: [IdentityRole.ISSUER, IdentityRole.VERIFIER],
origin: IdentityOrigin.EXTERNAL,
roles: [CredentialRole.ISSUER, CredentialRole.VERIFIER],
identifier: {
type: CorrelationIdentifierType.DID,
correlationId: 'update_example_did',
Expand Down
Loading