Skip to content

Commit

Permalink
Add client type field in GenerateClientTokenOptions interface (#30137)
Browse files Browse the repository at this point in the history
1. Support to generate MQTT JWT Token for Azure WebPubSub. Essentially
we need to identify if clients want to establish a default WebPubSub
connection or an MQTT connection, then we will generate the Client
Connection URL for them accordingly.

- Example Client URL for:
  - Default Connection: `wss://exampleHost.com/client/hubs/exampleHub`
- MQTT Connection: `wss://exampleHost.com/clients/mqtt/hubs/exampleHub`
 
2. Upgrade API version to '2024-01-01'
3. Add tests to get MQTT Token

---------

Co-authored-by: Chuong Nguyen <[email protected]>
  • Loading branch information
cqnguy23 and cqnguy23 authored Aug 1, 2024
1 parent d166c69 commit 65faad7
Show file tree
Hide file tree
Showing 15 changed files with 746 additions and 651 deletions.
6 changes: 6 additions & 0 deletions sdk/web-pubsub/web-pubsub/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Release History

## 1.1.4 (Unreleased)

### Features Added
- Added a `clientProtocol` option to `GenerateClientTokenOptions` to specify the type of client protocol when generating token. This option can be used to generate token and client connection URL for a specific client protocol type, such as `Default` or `MQTT`.
- Update API version to `2024-01-01`

## 1.1.3 (Unreleased)

### Features Added
Expand Down
2 changes: 1 addition & 1 deletion sdk/web-pubsub/web-pubsub/assets.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
"AssetsRepo": "Azure/azure-sdk-assets",
"AssetsRepoPrefixPath": "js",
"TagPrefix": "js/web-pubsub/web-pubsub",
"Tag": "js/web-pubsub/web-pubsub_3dc1340341"
"Tag": "js/web-pubsub/web-pubsub_54a6c7602b"
}
4 changes: 4 additions & 0 deletions sdk/web-pubsub/web-pubsub/review/web-pubsub.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ export interface ClientTokenResponse {

// @public
export interface GenerateClientTokenOptions extends OperationOptions {
clientProtocol?: WebPubSubClientProtocol;
expirationTimeInMinutes?: number;
groups?: string[];
roles?: string[];
Expand Down Expand Up @@ -157,6 +158,9 @@ export function odata(strings: TemplateStringsArray, ...values: unknown[]): stri
// @public (undocumented)
export type Permission = "joinLeaveGroup" | "sendToGroup";

// @public
export type WebPubSubClientProtocol = "default" | "mqtt";

// @public (undocumented)
export interface WebPubSubGroup {
addConnection(connectionId: string, options?: GroupAddConnectionOptions): Promise<void>;
Expand Down
14 changes: 7 additions & 7 deletions sdk/web-pubsub/web-pubsub/src/generated/generatedClient.ts

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

22 changes: 21 additions & 1 deletion sdk/web-pubsub/web-pubsub/src/generated/models/index.ts

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

Loading

0 comments on commit 65faad7

Please sign in to comment.