File tree Expand file tree Collapse file tree 2 files changed +53
-0
lines changed Expand file tree Collapse file tree 2 files changed +53
-0
lines changed Original file line number Diff line number Diff line change @@ -152,6 +152,27 @@ Deno.test(async function signSpaceId() {
152
152
) ;
153
153
} ) ;
154
154
155
+ Deno . test ( async function signDrmLicense ( ) {
156
+ assertObjectMatch ( await verify ( mux . jwt . signDrmLicense ( 'abcdefgh' ) ) , {
157
+ kid : jwtSigningKey ,
158
+ aud : 'l' ,
159
+ sub : 'abcdefgh' ,
160
+ } ) ;
161
+ assertObjectMatch (
162
+ await verify (
163
+ muxWithoutKeys . jwt . signDrmLicense ( 'abcdefgh' , {
164
+ keyId : jwtSigningKey ,
165
+ keySecret : privatePkcs1 ,
166
+ } ) ,
167
+ ) ,
168
+ {
169
+ kid : jwtSigningKey ,
170
+ aud : 'l' ,
171
+ sub : 'abcdefgh' ,
172
+ } ,
173
+ ) ;
174
+ } ) ;
175
+
155
176
Deno . test ( async function signViewerCounts ( ) {
156
177
assertObjectMatch ( await verify ( mux . jwt . signViewerCounts ( 'abcdefgh' ) ) , {
157
178
kid : jwtSigningKey ,
Original file line number Diff line number Diff line change @@ -208,6 +208,38 @@ describe('resource jwt', () => {
208
208
} ) ;
209
209
} ) ;
210
210
211
+ test ( 'signDrmLicense' , async ( ) => {
212
+ expect ( decodeJwt ( await mux . jwt . signDrmLicense ( 'abcdefgh' ) ) ) . toMatchObject ( {
213
+ kid : jwtSigningKey ,
214
+ aud : 'l' ,
215
+ sub : 'abcdefgh' ,
216
+ } ) ;
217
+ expect (
218
+ decodeJwt (
219
+ await muxWithoutKeys . jwt . signDrmLicense ( 'abcdefgh' , {
220
+ keyId : jwtSigningKey ,
221
+ keySecret : privatePkcs1 ,
222
+ } ) ,
223
+ ) ,
224
+ ) . toMatchObject ( {
225
+ kid : jwtSigningKey ,
226
+ aud : 'l' ,
227
+ sub : 'abcdefgh' ,
228
+ } ) ;
229
+ expect (
230
+ decodeJwt (
231
+ await muxWithoutKeys . jwt . signDrmLicense ( 'abcdefgh' , {
232
+ keyId : jwtSigningKey ,
233
+ keySecret : Buffer . from ( privatePkcs1 ) . toString ( 'base64' ) ,
234
+ } ) ,
235
+ ) ,
236
+ ) . toMatchObject ( {
237
+ kid : jwtSigningKey ,
238
+ aud : 'l' ,
239
+ sub : 'abcdefgh' ,
240
+ } ) ;
241
+ } ) ;
242
+
211
243
test ( 'signViewerCounts' , async ( ) => {
212
244
expect ( decodeJwt ( await mux . jwt . signViewerCounts ( 'abcdefgh' ) ) ) . toMatchObject ( {
213
245
kid : jwtSigningKey ,
You can’t perform that action at this time.
0 commit comments