Skip to content
This repository has been archived by the owner on Apr 12, 2024. It is now read-only.

Commit

Permalink
Allow specifying SSL/TLS in fabric.connect() method (#51)
Browse files Browse the repository at this point in the history
* Allow specifying SSL/TLS in fabric.connect() method

Signed-off-by: Josh Kim <kjosh@vmware.com>

* Set version to 1.3.0 because of breaking API change

Signed-off-by: Josh Kim <kjosh@vmware.com>
  • Loading branch information
jooskim authored Aug 21, 2021
1 parent e65e9ee commit 97f59f6
Show file tree
Hide file tree
Showing 6 changed files with 130 additions and 102 deletions.
64 changes: 44 additions & 20 deletions build/npm/transport.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
"version": "/* @echo VERSION */",
"description": "Channel / stream based event bus & model store that extends to brokers via WebSockets & STOMP.",
"homepage": "https://vmware.github.io/transport/",
"repository" : {
"type" : "git",
"url" : "git@github.com:vmware/transport-typescript.git"
"repository": {
"type": "git",
"url": "git@github.com:vmware/transport-typescript.git"
},
"peerDependencies": {
"rxjs": "^6.4.0"
Expand All @@ -17,9 +17,27 @@
},
//@endexclude
"author": "Dave Shanley <dshanley@vmware.com>",
"contributors": ["Akmal Khan <akmalk@vmware.com>","Etienne Le Sueur <elesueur@vmware.com>","Ashwini Manjunath <ashwinim@vmware.com>", "Matt Critchlow <mcritch@vmware.com>", "Andrii Alieksashyn <aalieksashyn@vmware.com>", "Stoyan Hristov <shristov@vmware.com>", "Josh Kim <kjosh@vmware.com>"],
"contributors": [
"Akmal Khan <akmalk@vmware.com>",
"Etienne Le Sueur <elesueur@vmware.com>",
"Ashwini Manjunath <ashwinim@vmware.com>",
"Matt Critchlow <mcritch@vmware.com>",
"Andrii Alieksashyn <aalieksashyn@vmware.com>",
"Stoyan Hristov <shristov@vmware.com>",
"Josh Kim <kjosh@vmware.com>"
],
"license": "BSD-2-Clause",
"changelogHistory": [
{
"date": "8/20/21",
"version": "1.3.0",
"notes": [
{
"description": "Expose useSSL argument in fabric.connect()",
"review_uri": "https://github.com/vmware/transport-typescript/pull/51"
}
]
},
{
"date": "5/14/21",
"version": "1.2.9",
Expand All @@ -29,7 +47,8 @@
"review_uri": "https://github.com/vmware/transport-typescript/pull/44"
}
]
},{
},
{
"date": "5/10/21",
"version": "1.2.8",
"notes": [
Expand All @@ -38,7 +57,8 @@
"review_uri": "https://github.com/vmware/transport-typescript/pull/43"
}
]
},{
},
{
"date": "2/11/21",
"version": "1.2.7",
"notes": [
Expand All @@ -47,7 +67,8 @@
"review_uri": "https://github.com/vmware/transport-typescript/pull/31"
}
]
},{
},
{
"date": "2/11/21",
"version": "1.2.6",
"notes": [
Expand All @@ -56,7 +77,8 @@
"review_uri": "https://github.com/vmware/transport-typescript/pull/29"
}
]
},{
},
{
"date": "2/10/21",
"version": "1.2.5",
"notes": [
Expand All @@ -65,7 +87,8 @@
"review_uri": "https://github.com/vmware/transport-typescript/pull/27"
}
]
},{
},
{
"date": "11/19/20",
"version": "1.2.4",
"notes": [
Expand All @@ -74,7 +97,8 @@
"review_uri": "https://gitlab.eng.vmware.com/bifrost/typescript/merge_requests/114"
}
]
},{
},
{
"date": "11/18/20",
"version": "1.2.3",
"notes": [
Expand Down Expand Up @@ -116,7 +140,7 @@
"description": "When autoReconnect is true, all previously subscribed galactic channels re-subscribe after re-connect."
}
]
},
},
{
"date": "9/1/20",
"version": "1.1.0",
Expand Down Expand Up @@ -668,7 +692,7 @@
"description": "Making compatible with bifrost-java version 0.5 (change to APIRequest model)."
}
]
},
},
{
"date": "12/03/18",
"version": "0.9.18",
Expand Down Expand Up @@ -1014,7 +1038,7 @@
"version": "0.3.0",
"notes": [
{
"description": "Project structure change, bugfixes and new getObservable() feature added to MessageHandler"
"description": "Project structure change, bugfixes and new getObservable() feature added to MessageHandler"
}
]
},
Expand All @@ -1023,7 +1047,7 @@
"version": "0.1.19",
"notes": [
{
"description": "Lots of cleanup, error fixes, more tests and documentation"
"description": "Lots of cleanup, error fixes, more tests and documentation"
}
]
},
Expand All @@ -1032,7 +1056,7 @@
"version": "0.1.11",
"notes": [
{
"description": "Added schema support and schema handling"
"description": "Added schema support and schema handling"
}
]
},
Expand All @@ -1041,7 +1065,7 @@
"version": "0.1.8",
"notes": [
{
"description": "More wrappers around simplified API"
"description": "More wrappers around simplified API"
}
]
},
Expand All @@ -1050,7 +1074,7 @@
"version": "0.1.7",
"notes": [
{
"description": "Added simplified API"
"description": "Added simplified API"
}
]
},
Expand All @@ -1059,7 +1083,7 @@
"version": "0.1.6",
"notes": [
{
"description": "Cleaned up build issues, fixed linting and refactors"
"description": "Cleaned up build issues, fixed linting and refactors"
}
]
},
Expand All @@ -1068,9 +1092,9 @@
"version": "0.1.0",
"notes": [
{
"description": "Published 0.1.0 after extracting from VMC codebase"
"description": "Published 0.1.0 after extracting from VMC codebase"
}
]
}
]
}
}
136 changes: 68 additions & 68 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,69 +1,69 @@
{
"name": "@vmw/transport",
"version": "1.2.9",
"private": false,
"license": "BSD-2-Clause",
"repository": "git@github.com:vmware/transport-typescript.git",
"dependencies": {
"karma-jasmine-html-reporter": "^1.5.4",
"rxjs": "^6.6.3"
},
"devDependencies": {
"@types/fetch-mock": "^7.3.3",
"@types/jasmine": "^2.8.17",
"@types/node": "^10.17.44",
"@types/selenium-webdriver": "^2.53.45",
"clean-webpack-plugin": "^3.0.0",
"core-js": "^2.6.11",
"del": "^3.0.0",
"event-stream": "^3.3.4",
"fetch-mock": "^7.7.3",
"gulp": "^4.0.2",
"gulp-autoprefixer": "^5.0.0",
"gulp-concat": "^2.6.0",
"gulp-env": "^0.4.0",
"gulp-gzip": "^1.4.2",
"gulp-help": "github:chmontgomery/gulp-help#gulp4",
"gulp-preprocess": "^3.0.3",
"gulp-rename": "^1.4.0",
"gulp-replace": "^0.5.4",
"gulp-sourcemaps": "^2.6.5",
"gulp-tslint": "^8.1.3",
"gulp-typescript": "^5.0.1",
"intl": "1.2.5",
"jasmine-core": "^3.6.0",
"karma": "^6.3.2",
"karma-chrome-launcher": "^2.2.0",
"karma-coverage": "^2.0.3",
"karma-jasmine": "^2.0.1",
"karma-spec-reporter": "0.0.32",
"karma-typescript": "^5.2.0",
"karma-webpack": "^4.0.2",
"merge-stream": "^1.0.1",
"require-dir": "^1.0.0",
"systemjs": "0.21.4",
"systemjs-builder": "^0.16.13",
"ts-loader": "^6.2.2",
"tslint": "5.11.0",
"typedoc": "^0.20.24",
"typescript": "^3.9.7",
"webpack": "^4.44.2",
"webpack-cli": "^3.3.12",
"webpack-rxjs-externals": "^2.0.0",
"webpack-stream": "^5.2.1"
},
"scripts": {
"build-umd": "webpack",
"build-commonjs": "tsc -d --declarationDir ./dist",
"build": "gulp clean && npm run build-umd && npm run build-commonjs",
"test": "tslint -p . && karma start karma.conf",
"build-docs": "node_modules/typedoc/bin/typedoc --out dist/npm/transport/docs --exclude \"**/*+(e2e|spec|index).ts\" --excludePrivate --name \"VMware Transport (TypeScript)\" src",
"build-package": "gulp npm:publish",
"pre-publish": "npm run build && npm run build-package && npm run build-docs",
"publish": "npm publish dist/npm/transport --access public",
"preinstall": "npx npm-force-resolutions"
},
"resolutions": {
"glob-parent": "^5.1.2"
}
}
"name": "@vmw/transport",
"version": "1.3.0",
"private": false,
"license": "BSD-2-Clause",
"repository": "git@github.com:vmware/transport-typescript.git",
"dependencies": {
"karma-jasmine-html-reporter": "^1.5.4",
"rxjs": "^6.6.3"
},
"devDependencies": {
"@types/fetch-mock": "^7.3.3",
"@types/jasmine": "^2.8.17",
"@types/node": "^10.17.44",
"@types/selenium-webdriver": "^2.53.45",
"clean-webpack-plugin": "^3.0.0",
"core-js": "^2.6.11",
"del": "^3.0.0",
"event-stream": "^3.3.4",
"fetch-mock": "^7.7.3",
"gulp": "^4.0.2",
"gulp-autoprefixer": "^5.0.0",
"gulp-concat": "^2.6.0",
"gulp-env": "^0.4.0",
"gulp-gzip": "^1.4.2",
"gulp-help": "github:chmontgomery/gulp-help#gulp4",
"gulp-preprocess": "^3.0.3",
"gulp-rename": "^1.4.0",
"gulp-replace": "^0.5.4",
"gulp-sourcemaps": "^2.6.5",
"gulp-tslint": "^8.1.3",
"gulp-typescript": "^5.0.1",
"intl": "1.2.5",
"jasmine-core": "^3.6.0",
"karma": "^6.3.2",
"karma-chrome-launcher": "^2.2.0",
"karma-coverage": "^2.0.3",
"karma-jasmine": "^2.0.1",
"karma-spec-reporter": "0.0.32",
"karma-typescript": "^5.2.0",
"karma-webpack": "^4.0.2",
"merge-stream": "^1.0.1",
"require-dir": "^1.0.0",
"systemjs": "0.21.4",
"systemjs-builder": "^0.16.13",
"ts-loader": "^6.2.2",
"tslint": "5.11.0",
"typedoc": "^0.20.24",
"typescript": "^3.9.7",
"webpack": "^4.44.2",
"webpack-cli": "^3.3.12",
"webpack-rxjs-externals": "^2.0.0",
"webpack-stream": "^5.2.1"
},
"scripts": {
"build-umd": "webpack",
"build-commonjs": "tsc -d --declarationDir ./dist",
"build": "gulp clean && npm run build-umd && npm run build-commonjs",
"test": "tslint -p . && karma start karma.conf",
"build-docs": "node_modules/typedoc/bin/typedoc --out dist/npm/transport/docs --exclude \"**/*+(e2e|spec|index).ts\" --excludePrivate --name \"VMware Transport (TypeScript)\" src",
"build-package": "gulp npm:publish",
"pre-publish": "npm run build && npm run build-package && npm run build-docs",
"publish": "npm publish dist/npm/transport --access public",
"preinstall": "npx npm-force-resolutions"
},
"resolutions": {
"glob-parent": "^5.1.2"
}
}
4 changes: 2 additions & 2 deletions src/bus.api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import { FabricApi } from './fabric.api';
import { BrokerConnector } from './bridge';

// current version
const version = '1.2.9';
const version = '1.3.0';

export type ChannelName = string;
export type SentFrom = string;
Expand Down Expand Up @@ -137,7 +137,7 @@ export abstract class EventBus {
* This should only be called when re-booting the bus.
*/
public static rebuildId(): string {
return `eventbus-${GeneralUtil.genUUID()}-${EventBus.version}`;
return `eventbus-${GeneralUtil.genUUID()}-${EventBus.version}`;
}

/**
Expand Down
16 changes: 9 additions & 7 deletions src/fabric.api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,15 @@ export interface FabricApi {
/**
* Connect to fabric endpoint. Defaults to current host and port on '/fabric'
*
* @param connectHandler lambda to fire when the fabric is connected.
* @param disconnectHandler lambda to fire when the fabric is disconnected.
* @param host hostname of your fabric endpoint, defaults to current host
* @param port port of your fabric endpoint, defaults to current port
* @param endpoint What endpoint are you connecting to? Defaults to /fabric
* @param useSSL whether to use secure WebSocket protocol (wss://) instead of ws://
* @param topicLocation What topic location are you subscribing to. /topic by default
* @param queueLocation What queue location are you subscribing to. /queue by default
* @param host hostname of your fabric endpoint, defaults to current host
* @param port port of your fabric endpoint, defaults to current port
* @param numRelays how many relays are being used? Defaults to 1.
* @param connectHandler lambda to fire when the fabric is connected.
* @param disconnectHandler lambda to fire when the fabric is disconnected.
* @param autoReconnect if disconnected, want to auto-reconnect? defaults to true.
*/
connect(
Expand All @@ -50,6 +51,7 @@ export interface FabricApi {
host?: string,
port?: number,
endpoint?: string,
useSSL?: boolean,
topicLocation?: string,
queueLocation?: string,
numRelays?: number,
Expand Down Expand Up @@ -152,15 +154,15 @@ export interface FabricApi {
protocols: Array<string>;

/**
* When true "<accessTokenHeaderKey>.<token>" will be sent as a
* sec-websocket-protocol header to the server during the websocket handshake. Useful for
* When true "<accessTokenHeaderKey>.<token>" will be sent as a
* sec-websocket-protocol header to the server during the websocket handshake. Useful for
* non-cookie based authentication implementations.
* @default false.
*/
sendAccessTokenDuringHandshake: boolean;

/**
* Get access token using getAccessTokenFunction if set else session storage
* Get access token using getAccessTokenFunction if set else session storage
* under the key returned by getAccessTokenSessionStorageKey()
*/
getAccessToken(): string;
Expand Down
Loading

0 comments on commit 97f59f6

Please sign in to comment.