Skip to content
This repository has been archived by the owner on May 29, 2024. It is now read-only.

Commit

Permalink
rename schema/rules
Browse files Browse the repository at this point in the history
Signed-off-by: Kevin Griffin <[email protected]>
  • Loading branch information
m00sey committed Oct 4, 2023
1 parent 4913cb4 commit 2867613
Show file tree
Hide file tree
Showing 7 changed files with 52 additions and 52 deletions.
12 changes: 6 additions & 6 deletions src/edges.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Saider } from 'signify-ts';
import { Schema } from './schema';
import { schema } from './schema';

namespace edges {
/**
Expand Down Expand Up @@ -56,7 +56,7 @@ namespace edges {

constructor({ qviCredentialSAID }: LegalEntityCredentialEdgeDataArgs) {
this.n = qviCredentialSAID;
this.s = Schema.QVI;
this.s = schema.QVI;
}
}

Expand Down Expand Up @@ -116,7 +116,7 @@ namespace edges {
engagementContextRoleAuthorizationCredentialSAID,
}: EngagementContextRoleCredentialEdgeDataArgs) {
this.n = engagementContextRoleAuthorizationCredentialSAID;
this.s = Schema.ECRAuth;
this.s = schema.ECRAuth;
}
}

Expand Down Expand Up @@ -176,7 +176,7 @@ namespace edges {
legalEntityCredentialSAID,
}: EngagementContextRoleAuthorizationCredentialEdgeDataArgs) {
this.n = legalEntityCredentialSAID;
this.s = Schema.LE;
this.s = schema.LE;
}
}

Expand Down Expand Up @@ -236,7 +236,7 @@ namespace edges {
officialOrganizationalRoleAuthorizationCredentialSAID,
}: OfficialOrganizationalRoleCredentialEdgeDataArgs) {
this.n = officialOrganizationalRoleAuthorizationCredentialSAID;
this.s = Schema.OORAuth;
this.s = schema.OORAuth;
}
}

Expand Down Expand Up @@ -296,7 +296,7 @@ namespace edges {
legalEntityCredentialSAID,
}: OfficialOrganizationalRoleAuthorizationCredentialEdgeDataArgs) {
this.n = legalEntityCredentialSAID;
this.s = Schema.LE;
this.s = schema.LE;
}
}
}
Expand Down
16 changes: 8 additions & 8 deletions src/qvi.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { SignifyClient } from 'signify-ts';
import { Schema } from './schema';
import { Rules } from './rules';
import { schema } from './schema';
import { rules } from './rules';
import { AID } from '.';
import { edges } from './edges';
import { credentials } from './credentials';
Expand Down Expand Up @@ -50,10 +50,10 @@ export class QVI {
.issue(
this.name,
this.registry,
Schema.LE,
schema.LE,
issuee,
data,
Rules.LE,
rules.LE,
edge,
false
);
Expand All @@ -77,10 +77,10 @@ export class QVI {
.issue(
this.name,
this.registry,
Schema.ECR,
schema.ECR,
issuee,
data,
Rules.ECR,
rules.ECR,
edge,
false
);
Expand All @@ -104,10 +104,10 @@ export class QVI {
.issue(
this.name,
this.registry,
Schema.OOR,
schema.OOR,
issuee,
data,
Rules.OOR,
rules.OOR,
edge,
false
);
Expand Down
16 changes: 8 additions & 8 deletions src/rules.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Schema } from './schema';
import { schema } from './schema';

namespace Rules {
namespace rules {
const usageDisclaimer =
'Usage of a valid, unexpired, and non-revoked vLEI Credential, as defined in the associated Ecosystem Governance Framework, does not assert that the Legal Entity is trustworthy, honest, reputable in its business dealings, safe to do business with, or compliant with any laws or that an implied or expressly intended purpose will be fulfilled.';
const issuanceDisclaimer =
Expand All @@ -26,7 +26,7 @@ namespace Rules {
}

export const LE = {
d: Schema.LE,
d: schema.LE,
usageDisclaimer: {
l: usageDisclaimer,
},
Expand All @@ -36,7 +36,7 @@ namespace Rules {
};

export const ECR = {
d: Schema.ECR,
d: schema.ECR,
usageDisclaimer: {
l: usageDisclaimer,
},
Expand All @@ -49,7 +49,7 @@ namespace Rules {
};

export const ECRAuth = {
d: Schema.ECRAuth,
d: schema.ECRAuth,
usageDisclaimer: {
l: usageDisclaimer,
},
Expand All @@ -62,7 +62,7 @@ namespace Rules {
};

export const OOR = {
d: Schema.OOR,
d: schema.OOR,
usageDisclaimer: {
l: usageDisclaimer,
},
Expand All @@ -72,7 +72,7 @@ namespace Rules {
};

export const OORAuth = {
d: Schema.OORAuth,
d: schema.OORAuth,
usageDisclaimer: {
l: usageDisclaimer,
},
Expand All @@ -82,4 +82,4 @@ namespace Rules {
};
}

export { Rules };
export { rules };
4 changes: 2 additions & 2 deletions src/schema.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace Schema {
namespace schema {
export const QVI = 'EBfdlu8R27Fbx-ehrqwImnK-8Cm79sqbAQ4MmvEAYqao';
export const LE = 'ENPXp1vQzRF6JwIuS-mp2U8Uf1MoADoP_GqQ62VsDZWY';
export const ECRAuth = 'EH6ekLjSr8V32WyFbGe1zXjTzFs9PkTYmupJ9H65O14g';
Expand All @@ -7,4 +7,4 @@ namespace Schema {
export const OOR = 'EBNaNu-M9P5cgrnfl2Fvymy4E_jvxxyjb70PRtiANlJy';
}

export { Schema };
export { schema };
8 changes: 4 additions & 4 deletions test/qvi.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { SignifyClient, Credentials } from 'signify-ts';
import { describe, expect, it } from '@jest/globals';
import { anyOfClass, capture, instance, mock, verify, when } from 'ts-mockito';
import { QVI } from '../src';
import { Rules } from '../src/rules';
import { rules } from '../src/rules';
import { credentials } from '../src/credentials';
import { edges } from '../src/edges';

Expand Down Expand Up @@ -36,7 +36,7 @@ describe('a qvi', () => {
'ENPXp1vQzRF6JwIuS-mp2U8Uf1MoADoP_GqQ62VsDZWY',
'issuee aid',
anyOfClass(credentials.LegalEntityCredentialData),
Rules.LE,
rules.LE,
anyOfClass(edges.LegalEntityCredentialEdge),
false
)
Expand Down Expand Up @@ -90,7 +90,7 @@ describe('a qvi', () => {
'EEy9PkikFcANV1l7EHukCeXqrzT1hNZjGlUk7wuMO5jw',
'issuee aid',
anyOfClass(credentials.EngagementContextRoleCredentialData),
Rules.ECR,
rules.ECR,
anyOfClass(edges.EngagementContextRoleCredentialEdge),
false
)
Expand Down Expand Up @@ -148,7 +148,7 @@ describe('a qvi', () => {
anyOfClass(
credentials.OfficialOrganizationalRoleCredentialData
),
Rules.OOR,
rules.OOR,
anyOfClass(edges.OfficialOrganizationalRoleEdge),
false
)
Expand Down
36 changes: 18 additions & 18 deletions test/rules.test.ts
Original file line number Diff line number Diff line change
@@ -1,67 +1,67 @@
import { describe, expect, it } from '@jest/globals';
import { Rules } from '../src/rules';
import { rules } from '../src/rules';

describe('rules', () => {
it('should have rules for legal entity', () => {
expect(Rules.LE.d).toBe('ENPXp1vQzRF6JwIuS-mp2U8Uf1MoADoP_GqQ62VsDZWY');
expect(Rules.LE.usageDisclaimer.l).toBe(
expect(rules.LE.d).toBe('ENPXp1vQzRF6JwIuS-mp2U8Uf1MoADoP_GqQ62VsDZWY');
expect(rules.LE.usageDisclaimer.l).toBe(
'Usage of a valid, unexpired, and non-revoked vLEI Credential, as defined in the associated Ecosystem Governance Framework, does not assert that the Legal Entity is trustworthy, honest, reputable in its business dealings, safe to do business with, or compliant with any laws or that an implied or expressly intended purpose will be fulfilled.'
);
expect(Rules.LE.issuanceDisclaimer.l).toBe(
expect(rules.LE.issuanceDisclaimer.l).toBe(
'All information in a valid, unexpired, and non-revoked vLEI Credential, as defined in the associated Ecosystem Governance Framework, is accurate as of the date the validation process was complete. The vLEI Credential has been issued to the legal entity or person named in the vLEI Credential as the subject; and the qualified vLEI Issuer exercised reasonable care to perform the validation process set forth in the vLEI Ecosystem Governance Framework.'
);
});

it('should have rules for ecr', () => {
expect(Rules.ECR.d).toBe(
expect(rules.ECR.d).toBe(
'EEy9PkikFcANV1l7EHukCeXqrzT1hNZjGlUk7wuMO5jw'
);
expect(Rules.ECR.usageDisclaimer.l).toBe(
expect(rules.ECR.usageDisclaimer.l).toBe(
'Usage of a valid, unexpired, and non-revoked vLEI Credential, as defined in the associated Ecosystem Governance Framework, does not assert that the Legal Entity is trustworthy, honest, reputable in its business dealings, safe to do business with, or compliant with any laws or that an implied or expressly intended purpose will be fulfilled.'
);
expect(Rules.ECR.issuanceDisclaimer.l).toBe(
expect(rules.ECR.issuanceDisclaimer.l).toBe(
'All information in a valid, unexpired, and non-revoked vLEI Credential, as defined in the associated Ecosystem Governance Framework, is accurate as of the date the validation process was complete. The vLEI Credential has been issued to the legal entity or person named in the vLEI Credential as the subject; and the qualified vLEI Issuer exercised reasonable care to perform the validation process set forth in the vLEI Ecosystem Governance Framework.'
);
expect(Rules.ECR.privacyDisclaimer.l).toBe(
expect(rules.ECR.privacyDisclaimer.l).toBe(
'Privacy Considerations are applicable to QVI ECR AUTH vLEI Credentials. It is the sole responsibility of QVIs as Issuees of QVI ECR AUTH vLEI Credentials to present these Credentials in a privacy-preserving manner using the mechanisms provided in the Issuance and Presentation Exchange (IPEX) protocol specification and the Authentic Chained Data Container (ACDC) specification. https://github.com/WebOfTrust/IETF-IPEX and https://github.com/trustoverip/tswg-acdc-specification.'
);
});

it('should have rules for ecr auth', () => {
expect(Rules.ECRAuth.d).toBe(
expect(rules.ECRAuth.d).toBe(
'EH6ekLjSr8V32WyFbGe1zXjTzFs9PkTYmupJ9H65O14g'
);
expect(Rules.ECRAuth.usageDisclaimer.l).toBe(
expect(rules.ECRAuth.usageDisclaimer.l).toBe(
'Usage of a valid, unexpired, and non-revoked vLEI Credential, as defined in the associated Ecosystem Governance Framework, does not assert that the Legal Entity is trustworthy, honest, reputable in its business dealings, safe to do business with, or compliant with any laws or that an implied or expressly intended purpose will be fulfilled.'
);
expect(Rules.ECRAuth.issuanceDisclaimer.l).toBe(
expect(rules.ECRAuth.issuanceDisclaimer.l).toBe(
'All information in a valid, unexpired, and non-revoked vLEI Credential, as defined in the associated Ecosystem Governance Framework, is accurate as of the date the validation process was complete. The vLEI Credential has been issued to the legal entity or person named in the vLEI Credential as the subject; and the qualified vLEI Issuer exercised reasonable care to perform the validation process set forth in the vLEI Ecosystem Governance Framework.'
);
expect(Rules.ECRAuth.privacyDisclaimer.l).toBe(
expect(rules.ECRAuth.privacyDisclaimer.l).toBe(
'Privacy Considerations are applicable to QVI ECR AUTH vLEI Credentials. It is the sole responsibility of QVIs as Issuees of QVI ECR AUTH vLEI Credentials to present these Credentials in a privacy-preserving manner using the mechanisms provided in the Issuance and Presentation Exchange (IPEX) protocol specification and the Authentic Chained Data Container (ACDC) specification. https://github.com/WebOfTrust/IETF-IPEX and https://github.com/trustoverip/tswg-acdc-specification.'
);
});

it('should have rules for oor', () => {
expect(Rules.OOR.d).toBe(
expect(rules.OOR.d).toBe(
'EBNaNu-M9P5cgrnfl2Fvymy4E_jvxxyjb70PRtiANlJy'
);
expect(Rules.OOR.usageDisclaimer.l).toBe(
expect(rules.OOR.usageDisclaimer.l).toBe(
'Usage of a valid, unexpired, and non-revoked vLEI Credential, as defined in the associated Ecosystem Governance Framework, does not assert that the Legal Entity is trustworthy, honest, reputable in its business dealings, safe to do business with, or compliant with any laws or that an implied or expressly intended purpose will be fulfilled.'
);
expect(Rules.OOR.issuanceDisclaimer.l).toBe(
expect(rules.OOR.issuanceDisclaimer.l).toBe(
'All information in a valid, unexpired, and non-revoked vLEI Credential, as defined in the associated Ecosystem Governance Framework, is accurate as of the date the validation process was complete. The vLEI Credential has been issued to the legal entity or person named in the vLEI Credential as the subject; and the qualified vLEI Issuer exercised reasonable care to perform the validation process set forth in the vLEI Ecosystem Governance Framework.'
);
});

it('should have rules for oor auth', () => {
expect(Rules.OORAuth.d).toBe(
expect(rules.OORAuth.d).toBe(
'EKA57bKBKxr_kN7iN5i7lMUxpMG-s19dRcmov1iDxz-E'
);
expect(Rules.OORAuth.usageDisclaimer.l).toBe(
expect(rules.OORAuth.usageDisclaimer.l).toBe(
'Usage of a valid, unexpired, and non-revoked vLEI Credential, as defined in the associated Ecosystem Governance Framework, does not assert that the Legal Entity is trustworthy, honest, reputable in its business dealings, safe to do business with, or compliant with any laws or that an implied or expressly intended purpose will be fulfilled.'
);
expect(Rules.OORAuth.issuanceDisclaimer.l).toBe(
expect(rules.OORAuth.issuanceDisclaimer.l).toBe(
'All information in a valid, unexpired, and non-revoked vLEI Credential, as defined in the associated Ecosystem Governance Framework, is accurate as of the date the validation process was complete. The vLEI Credential has been issued to the legal entity or person named in the vLEI Credential as the subject; and the qualified vLEI Issuer exercised reasonable care to perform the validation process set forth in the vLEI Ecosystem Governance Framework.'
);
});
Expand Down
12 changes: 6 additions & 6 deletions test/schema.test.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
import { describe, expect, it } from '@jest/globals';
import { Schema } from '../src/schema';
import { schema } from '../src/schema';

describe('shema', () => {
it('should have saids', () => {
expect(Schema.LE).toBe('ENPXp1vQzRF6JwIuS-mp2U8Uf1MoADoP_GqQ62VsDZWY');
expect(Schema.ECR).toBe('EEy9PkikFcANV1l7EHukCeXqrzT1hNZjGlUk7wuMO5jw');
expect(Schema.ECRAuth).toBe(
expect(schema.LE).toBe('ENPXp1vQzRF6JwIuS-mp2U8Uf1MoADoP_GqQ62VsDZWY');
expect(schema.ECR).toBe('EEy9PkikFcANV1l7EHukCeXqrzT1hNZjGlUk7wuMO5jw');
expect(schema.ECRAuth).toBe(
'EH6ekLjSr8V32WyFbGe1zXjTzFs9PkTYmupJ9H65O14g'
);
expect(Schema.OOR).toBe('EBNaNu-M9P5cgrnfl2Fvymy4E_jvxxyjb70PRtiANlJy');
expect(Schema.OORAuth).toBe(
expect(schema.OOR).toBe('EBNaNu-M9P5cgrnfl2Fvymy4E_jvxxyjb70PRtiANlJy');
expect(schema.OORAuth).toBe(
'EKA57bKBKxr_kN7iN5i7lMUxpMG-s19dRcmov1iDxz-E'
);
});
Expand Down

0 comments on commit 2867613

Please sign in to comment.