File tree Expand file tree Collapse file tree 2 files changed +5
-4
lines changed
Expand file tree Collapse file tree 2 files changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -10,7 +10,7 @@ const runInteropTests =
1010
1111describe ( 'CAT library' , ( ) => {
1212 testIf (
13- false && runInteropTests , // Skip this test
13+ runInteropTests ,
1414 'can generate a token that someone else can validate' ,
1515 async ( ) => {
1616 const ctx = new Context ( ) ;
@@ -23,12 +23,12 @@ describe('CAT library', () => {
2323 } ,
2424 expectCwtTag : true
2525 } ) ;
26- const token = await generator . generate (
26+ const token = await generator . generateFromJson (
2727 {
2828 iss : 'eyevinn' ,
2929 sub : 'jonas' ,
3030 aud : 'coap://light.example.com' ,
31- exp : 1444064944 ,
31+ exp : Math . floor ( Date . now ( ) / 1000 ) + 3600 ,
3232 nbf : 1443944944 ,
3333 iat : 1443944944 ,
3434 cti : '0b71'
Original file line number Diff line number Diff line change @@ -332,7 +332,8 @@ export class CommonAccessToken {
332332 key : key . k
333333 } ;
334334 if ( ! opts ?. noCwtTag ) {
335- const plaintext = cbor . encode ( this . payload ) ;
335+ const encoder = new cbor . Encoder ( { mapsAsObjects : false } ) ;
336+ const plaintext = encoder . encode ( this . payload ) ;
336337 const coseMessage = await cose . mac . create (
337338 headers ,
338339 plaintext as unknown as string ,
You can’t perform that action at this time.
0 commit comments