-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
commit 9f88783 Author: Peter Langenkamp <[email protected]> Date: Tue Nov 30 11:12:59 2021 -0800 fix redirect after issuing + put back ida code in issue.controller commit 68651f7 Author: Galit Rahim <[email protected]> Date: Tue Nov 30 19:23:40 2021 +0100 Added Trinsic issue response commit d62c354 Author: Galit Rahim <[email protected]> Date: Tue Nov 30 17:24:10 2021 +0100 Working Trinsic verify response commit 57af51f Author: Peter Langenkamp <[email protected]> Date: Tue Nov 30 02:41:17 2021 -0800 fix for sending trinsic requests commit 6b21590 Author: Peter Langenkamp <[email protected]> Date: Fri Nov 19 06:43:16 2021 -0800 add migration for trinsic credential commit bf2d1a0 Merge: 5a8cb99 f46259b Author: Peter Langenkamp <[email protected]> Date: Fri Nov 19 06:23:51 2021 -0800 Merge branch 'master' into trinsic commit 5a8cb99 Author: Galit Rahim <[email protected]> Date: Thu Oct 14 11:25:02 2021 +0200 Fixed bug and removed api key commit a746c2d Author: Galit Rahim <[email protected]> Date: Wed Oct 13 17:42:56 2021 +0200 Working issue commit eb46841 Author: Galit Rahim <[email protected]> Date: Tue Oct 5 14:23:02 2021 +0200 Working verify commit f32b910 Author: Galit Rahim <[email protected]> Date: Mon Oct 4 16:31:51 2021 +0200 System now asks to setup connection commit 722c258 Author: Galit Rahim <[email protected]> Date: Thu Sep 30 17:20:53 2021 +0200 Working Trinsic implementation! commit 5a3505b Author: Galit Rahim <[email protected]> Date: Mon Sep 27 17:02:28 2021 +0200 Working qr code generator commit 9dff2e0 Author: Galit Rahim <[email protected]> Date: Wed Sep 22 15:05:05 2021 +0200 Working trinsic verify commit 31dcc5a Author: Galit Rahim <[email protected]> Date: Fri Aug 20 15:00:30 2021 +0200 Working Trinsic Credential Types commit dc1e418 Author: Galit Rahim <[email protected]> Date: Thu Aug 5 16:56:33 2021 +0200 Added get Trinsic credentials commit 0b526d3 Author: Galit Rahim <[email protected]> Date: Wed Jul 14 16:59:20 2021 +0200 Added extra trinsic code commit 8aadaa7 Author: Galit Rahim <[email protected]> Date: Fri Jul 9 15:18:53 2021 +0200 Working creating schemas and creddef commit bc89ad4 Author: Galit Rahim <[email protected]> Date: Thu Jul 8 15:19:30 2021 +0200 Changing trinsic schema commit 77a8ab0 Author: Galit <[email protected]> Date: Fri Jun 18 15:56:48 2021 +0200 Fixed build bug commit eee1801 Author: Galit Rahim <[email protected]> Date: Mon May 31 16:12:09 2021 +0200 More connection code for Trinsic commit fe4b981 Author: Galit Rahim <[email protected]> Date: Tue May 18 12:19:24 2021 +0200 Changed code for connection commit f72292c Author: Galit Rahim <[email protected]> Date: Fri Apr 30 14:55:08 2021 +0200 More code for Trinsic connection commit 9b2f212 Author: Galit Rahim <[email protected]> Date: Wed Apr 28 16:46:35 2021 +0200 Further work on Trinsic connection commit b6a2a5a Author: Galit Rahim <[email protected]> Date: Thu Apr 22 15:03:46 2021 +0200 Add template for Trinsic
- Loading branch information
1 parent
f46259b
commit 0b1de82
Showing
19 changed files
with
753 additions
and
4 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import { IsNotEmpty, IsOptional, IsString, Matches } from 'class-validator'; | ||
|
||
export class CreateTrinsicSchemaDto { | ||
@IsString() | ||
@IsNotEmpty() | ||
name: string; | ||
|
||
@IsString() | ||
@Matches(/^\d+(\.\d+)*$/) | ||
version: string; | ||
|
||
@IsString({ each: true }) | ||
@IsNotEmpty({ each: true }) | ||
attributeNames: string[]; | ||
|
||
@IsOptional() | ||
@IsString() | ||
@IsNotEmpty() | ||
trinsicSchemaId?: string; | ||
|
||
@IsOptional() | ||
@IsString() | ||
@IsNotEmpty() | ||
trinsicCredentialDefinitionId?: string; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
import { Entity, PrimaryGeneratedColumn, Column } from 'typeorm'; | ||
import { randomBytes } from 'crypto'; | ||
|
||
export interface TrinsicConnectionResponse { | ||
connectionId: string; | ||
name: string; | ||
imageUrl: string; | ||
myDid: string; | ||
theirDid: string; | ||
myKey: string; | ||
theirKey: string; | ||
state: string; | ||
invitation: string; | ||
invitationUrl: string; | ||
endpoint: { | ||
did: string; | ||
reciverkeypientKeys: string[]; | ||
uri: string; | ||
}; | ||
createdAtUtc: string; | ||
multiParty: boolean; | ||
} | ||
|
||
const TRINSIC_INVITATION_IDENTIFIER_BYTES = 6; | ||
|
||
@Entity() | ||
export class TrinsicInvitation { | ||
@PrimaryGeneratedColumn() | ||
id: number; | ||
|
||
@Column() | ||
name: string; | ||
|
||
@Column({ unique: true }) | ||
connectionId: string; | ||
|
||
@Column() | ||
multiParty: boolean; | ||
|
||
@Column('simple-json') | ||
connectionResponse: TrinsicConnectionResponse; | ||
|
||
static randomIdentifier() { | ||
return randomBytes(TRINSIC_INVITATION_IDENTIFIER_BYTES).toString('base64'); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
import { CredentialType } from 'src/types/credential-type.entity'; | ||
import { PrimaryGeneratedColumn, Column, OneToMany, Entity } from 'typeorm'; | ||
|
||
export interface TrinsicSchemaResponse { | ||
schemaId: string; | ||
name: string; | ||
version: string; | ||
attributeNames: string[]; | ||
} | ||
|
||
export interface TrinsicCredDefResponse { | ||
schemaId: string; | ||
definitionId: string; | ||
supportRevocation: boolean; | ||
tag: string; | ||
} | ||
|
||
@Entity() | ||
export class TrinsicSchema { | ||
@PrimaryGeneratedColumn() | ||
id: number; | ||
|
||
@Column() | ||
name: string; | ||
|
||
@Column() | ||
version: string; | ||
|
||
@Column('simple-json') | ||
attributeNames: string[]; | ||
|
||
@Column({ nullable: true, default: null }) | ||
supportRevocation: boolean; | ||
|
||
@Column({ nullable: true}) | ||
trinsicSchemaId: string; | ||
|
||
@Column({ nullable: true }) | ||
trinsicCredentialDefinitionId: string; | ||
|
||
@OneToMany( | ||
() => CredentialType, | ||
type => type.trinsicSchema, | ||
) | ||
credentialTypes: CredentialType[]; | ||
|
||
//TODO: change to real unique tag | ||
//Trinsic docs: "Unique tag to differentiate definitions of the same schema" | ||
//@Column({ unique: true }) | ||
@Column({ nullable: true }) | ||
tag: string; | ||
|
||
get schemaIssuerDid() { | ||
return this.trinsicSchemaId.split(':')[0]; | ||
} | ||
|
||
get credDefIssuerDid() { | ||
return this.trinsicCredentialDefinitionId.split(':')[0]; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import { Test, TestingModule } from '@nestjs/testing'; | ||
import { TrinsicController } from './trinsic.controller'; | ||
|
||
describe('Trinsic Controller', () => { | ||
let controller: TrinsicController; | ||
|
||
beforeEach(async () => { | ||
const module: TestingModule = await Test.createTestingModule({ | ||
controllers: [TrinsicController], | ||
}).compile(); | ||
|
||
controller = module.get<TrinsicController>(TrinsicController); | ||
}); | ||
|
||
it('should be defined', () => { | ||
expect(controller).toBeDefined(); | ||
}); | ||
}); |
Oops, something went wrong.