Skip to content

Commit

Permalink
feat: video client acl (#814)
Browse files Browse the repository at this point in the history
  • Loading branch information
dragonmantank authored Apr 4, 2023
1 parent 555ea86 commit 342d903
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 2 deletions.
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions packages/video/__tests__/video.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,7 @@ describe('video', () => {
expect(decoded.payload.application_id).toEqual('abcd-1234');
expect(decoded.payload.scope).toEqual('session.connect');
expect(decoded.payload.session_id).toEqual('abcd');
expect(decoded.payload.acl.paths).toEqual({'/video/**': {}});
});

test("can generate a client JWT token with renamed values", async () => {
Expand Down
5 changes: 5 additions & 0 deletions packages/video/lib/interfaces/ClientTokenClaims.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,9 @@ export interface ClientTokenClaims {
data?: string
exp?: number
connection_data?: string
acl: {
paths: {
[key: string]: object
}
}
}
5 changes: 5 additions & 0 deletions packages/video/lib/video.ts
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,11 @@ export class Video extends Client {
session_id: sessionId,
role: 'publisher',
initial_layout_class_list: '',
acl: {
paths: {
"/video/**": {}
}
}
};

if (tokenOptions?.role) {
Expand Down
2 changes: 1 addition & 1 deletion packages/video/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@vonage/video",
"version": "1.3.0",
"version": "1.4.0",
"description": "Package to interact with the Vonage Video API (Not OpenTok Compatible)",
"keywords": [
"vonage",
Expand Down

0 comments on commit 342d903

Please sign in to comment.