File tree Expand file tree Collapse file tree 2 files changed +6
-15
lines changed Expand file tree Collapse file tree 2 files changed +6
-15
lines changed Original file line number Diff line number Diff line change @@ -33,10 +33,6 @@ import { Options, DocumentLoader } from '@iden3/js-jsonld-merklization';
33
33
import path from 'path' ;
34
34
import { DID , getUnixTimestamp } from '@iden3/js-iden3-core' ;
35
35
import { ZeroKnowledgeProofRequest } from '@0xpolygonid/js-sdk' ;
36
- import {
37
- MediaType ,
38
- ProtocolVersion
39
- } from '@0xpolygonid/js-sdk/dist/types/iden3comm/constants' ;
40
36
41
37
/**
42
38
* Options to pass to createAuthorizationRequest function
@@ -440,14 +436,14 @@ export class Verifier {
440
436
if ( ! profile ?. length ) {
441
437
return ;
442
438
}
443
- const supportedMediaTypes : MediaType [ ] = [ ] ;
439
+ const supportedMediaTypes : PROTOCOL_CONSTANTS . MediaType [ ] = [ ] ;
444
440
for ( const acceptProfile of profile ) {
445
441
// 1. check protocol version
446
442
const { protocolVersion, env } = parseAcceptProfile ( acceptProfile ) ;
447
443
const messageTypeVersion = Number ( messageType . split ( '/' ) . at ( - 2 ) ) ;
448
444
if (
449
- protocolVersion !== ProtocolVersion . V1 ||
450
- ( protocolVersion === ProtocolVersion . V1 &&
445
+ protocolVersion !== PROTOCOL_CONSTANTS . ProtocolVersion . V1 ||
446
+ ( protocolVersion === PROTOCOL_CONSTANTS . ProtocolVersion . V1 &&
451
447
( messageTypeVersion < 1 || messageTypeVersion >= 2 ) )
452
448
) {
453
449
continue ;
Original file line number Diff line number Diff line change @@ -22,19 +22,14 @@ import { Circuits } from '@lib/circuits/registry';
22
22
import path from 'path' ;
23
23
import { resolveDIDDocument , resolvers , schemaLoader , testOpts } from './mocks' ;
24
24
import { getDateFromUnixTimestamp , getUnixTimestamp } from '@iden3/js-iden3-core' ;
25
- import {
26
- AcceptAuthCircuits ,
27
- MediaType ,
28
- ProtocolVersion
29
- } from '@0xpolygonid/js-sdk/dist/types/iden3comm/constants' ;
30
25
31
26
describe ( 'auth tests' , ( ) => {
32
27
const connectionString = process . env . IPFS_URL ?? 'https://ipfs.io' ;
33
28
const acceptProfile = buildAccept ( [
34
29
{
35
- protocolVersion : ProtocolVersion . V1 ,
36
- env : MediaType . ZKPMessage ,
37
- circuits : [ AcceptAuthCircuits . AuthV2 ]
30
+ protocolVersion : PROTOCOL_CONSTANTS . ProtocolVersion . V1 ,
31
+ env : PROTOCOL_CONSTANTS . MediaType . ZKPMessage ,
32
+ circuits : [ PROTOCOL_CONSTANTS . AcceptAuthCircuits . AuthV2 ]
38
33
}
39
34
] ) ;
40
35
const expiresTime = getDateFromUnixTimestamp ( getUnixTimestamp ( new Date ( ) ) + 5 * 60 ) ;
You can’t perform that action at this time.
0 commit comments