Skip to content

Commit

Permalink
Add support for Azure login type
Browse files Browse the repository at this point in the history
  • Loading branch information
syyyr committed Jun 11, 2024
1 parent 0c2c6f7 commit b2538a6
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions src/ws-client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,9 @@ type Subscription = {
type WsClientOptions = {
logDebug: (...args: string[]) => void;
mountPoint?: string;
user: string;
user?: string;
password: string;
loginType?: 'PLAIN' | 'AZURE';
timeout?: number;
wsUri: string;
onConnected: () => void;
Expand Down Expand Up @@ -80,8 +81,9 @@ class WsClient {

logDebug: WsClientOptions['logDebug'];
mountPoint: WsClientOptions['mountPoint'];
user: WsClientOptions['user'];
user?: WsClientOptions['user'];
password: WsClientOptions['password'];
loginType: WsClientOptions['loginType'];
onConnected: WsClientOptions['onConnected'];
onRequest: WsClientOptions['onRequest'];
timeout: WsClientOptions['timeout'];
Expand All @@ -94,8 +96,9 @@ class WsClient {
this.logDebug = options.logDebug ?? (() => {/* nothing */});
this.mountPoint = options.mountPoint;

this.user = options.user;
this.user = options.user ?? '';
this.password = options.password;
this.loginType = options.loginType ?? 'PLAIN';

this.websocket = new WebSocket(options.wsUri);
this.websocket.binaryType = 'arraybuffer';
Expand All @@ -111,7 +114,7 @@ class WsClient {
const params = new ShvMap({
login: new ShvMap({
password: this.password,
type: 'PLAIN',
type: this.loginType,
user: this.user,
}),
options: new ShvMap({
Expand Down

0 comments on commit b2538a6

Please sign in to comment.