-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #81 from velocitycareerlabs/VL-7921-remove-handleR…
…esult-method chore: remove `VCLResult` and use `Promise` only + fixes
- Loading branch information
Showing
130 changed files
with
1,366 additions
and
1,265 deletions.
There are no files selected for viewing
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,18 @@ | ||
// eslint-disable-next-line unused-imports/no-unused-vars,no-unused-vars | ||
interface String { | ||
getQueryParameters(): Map<string, string>; | ||
appendQueryParams(queryParams: string): string; | ||
getUrlSubPath(subPathPrefix: string): string | null | undefined; | ||
randomString(length: number): string; | ||
} | ||
|
||
// eslint-disable-next-line unused-imports/no-unused-vars,no-unused-vars | ||
interface Array<T> { | ||
toJsonArray(): any[]; | ||
} | ||
|
||
// eslint-disable-next-line unused-imports/no-unused-vars | ||
interface Date { | ||
addDaysToNow(days: number): Date; | ||
equalsTo(date: Date): boolean; | ||
} |
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,20 @@ | ||
import { VCLDidJwk } from "@velocitycareerlabs/vnf-nodejs-wallet-sdk"; | ||
|
||
class DidJwkMocks { | ||
static readonly DidJwkStr = `{ "did": "did:jwk:eyJjcnYiOiJQLTI1NiIsImt0eSI6IkVDIiwieCI6InI5ZnlhNTJJbG1UbzN5YlMwd19HZWZlUV9SWDJFSF9ISm1TV3FZWU8ySlkiLCJ5IjoicFFUUmE3R2txYzVrajZvZGVNcXBnVjVUNExqYlphNEY1S1R1MkpEclduYyJ9", "kid": "did:jwk:eyJjcnYiOiJQLTI1NiIsImt0eSI6IkVDIiwieCI6InI5ZnlhNTJJbG1UbzN5YlMwd19HZWZlUV9SWDJFSF9ISm1TV3FZWU8ySlkiLCJ5IjoicFFUUmE3R2txYzVrajZvZGVNcXBnVjVUNExqYlphNEY1S1R1MkpEclduYyJ9#0", "keyId": "6630f0a67b097c289711f583", "publicJwk": { "kty": "EC", "crv": "P-256", "y": "pQTRa7Gkqc5kj6odeMqpgV5T4LjbZa4F5KTu2JDrWnc", "x": "r9fya52IlmTo3ybS0w_GefeQ_RX2EH_HJmSWqYYO2JY" } }` | ||
static readonly DidJwkJson = | ||
{ | ||
"did": "did:jwk:eyJjcnYiOiJQLTI1NiIsImt0eSI6IkVDIiwieCI6InI5ZnlhNTJJbG1UbzN5YlMwd19HZWZlUV9SWDJFSF9ISm1TV3FZWU8ySlkiLCJ5IjoicFFUUmE3R2txYzVrajZvZGVNcXBnVjVUNExqYlphNEY1S1R1MkpEclduYyJ9", | ||
"kid": "did:jwk:eyJjcnYiOiJQLTI1NiIsImt0eSI6IkVDIiwieCI6InI5ZnlhNTJJbG1UbzN5YlMwd19HZWZlUV9SWDJFSF9ISm1TV3FZWU8ySlkiLCJ5IjoicFFUUmE3R2txYzVrajZvZGVNcXBnVjVUNExqYlphNEY1S1R1MkpEclduYyJ9#0", | ||
"keyId": "6630f0a67b097c289711f583", | ||
"publicJwk": { | ||
"kty": "EC", | ||
"crv": "P-256", | ||
"y": "pQTRa7Gkqc5kj6odeMqpgV5T4LjbZa4F5KTu2JDrWnc", | ||
"x": "r9fya52IlmTo3ybS0w_GefeQ_RX2EH_HJmSWqYYO2JY" | ||
} | ||
} | ||
static readonly DidJwk = VCLDidJwk.fromJSON(DidJwkMocks.DidJwkJson) | ||
} | ||
|
||
export { DidJwkMocks } |
22 changes: 22 additions & 0 deletions
22
packages/sample-server/test/mocks/jwt/JwtSignServiceMock.ts
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,22 @@ | ||
/* eslint-disable unused-imports/no-unused-vars,no-unused-vars */ | ||
|
||
import { | ||
Nullish, | ||
VCLDidJwk, VCLJwt, | ||
VCLJwtDescriptor, | ||
VCLJwtSignService, | ||
VCLToken | ||
} from "@velocitycareerlabs/vnf-nodejs-wallet-sdk"; | ||
|
||
export class JwtSignServiceMock implements VCLJwtSignService { | ||
constructor(readonly successValue: Nullish<string> = null) {} | ||
|
||
async sign( | ||
jwtDescriptor: VCLJwtDescriptor, | ||
didJwk: VCLDidJwk, | ||
nonce: Nullish<string>, | ||
remoteCryptoServicesToken: Nullish<VCLToken> | ||
): Promise<VCLJwt> { | ||
return VCLJwt.fromEncodedJwt(this.successValue || ''); | ||
} | ||
} |
9 changes: 9 additions & 0 deletions
9
packages/sample-server/test/mocks/jwt/JwtVerifyServiceMock.ts
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,9 @@ | ||
/* eslint-disable unused-imports/no-unused-vars,no-unused-vars */ | ||
|
||
import { Nullish, VCLJwt, VCLJwtVerifyService, VCLPublicJwk } from "@velocitycareerlabs/vnf-nodejs-wallet-sdk"; | ||
|
||
export class JwtVerifyServiceMock implements VCLJwtVerifyService { | ||
async verify(jwt: VCLJwt, publicJwk: Nullish<VCLPublicJwk>): Promise<boolean> { | ||
return true; | ||
} | ||
} |
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,10 @@ | ||
/* eslint-disable unused-imports/no-unused-vars,no-unused-vars */ | ||
|
||
import { VCLDidJwk, VCLDidJwkDescriptor, VCLKeyService } from "@velocitycareerlabs/vnf-nodejs-wallet-sdk"; | ||
import { DidJwkMocks } from "../DidJwkMocks"; | ||
|
||
export class KeyServiceMock implements VCLKeyService { | ||
async generateDidJwk(didJwkDescriptor: VCLDidJwkDescriptor): Promise<VCLDidJwk> { | ||
return DidJwkMocks.DidJwk | ||
} | ||
} |
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
Oops, something went wrong.