Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/build-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ env:
SECRET_GOOGLE_CREDENTIALS: ${{ secrets.GOOGLE_CREDENTIALS }}
SECRET_RESULTS_SHEET_ID: ${{ secrets.RESULTS_SHEET_ID }}
jobs:
connection_bridge_lua:
nmos_bridge_lua:
runs-on: ubuntu-22.04
defaults:
run:
working-directory: ConnectionBridge/envoy
working-directory: nmos-bridge/envoy
steps:
- uses: actions/checkout@v7

Expand Down
4 changes: 2 additions & 2 deletions Development/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@
"build": "react-scripts build",
"test": "react-scripts test --env=jsdom",
"eject": "react-scripts eject",
"lint": "eslint --fix ./ && prettier --config .prettierrc.js --write src/**/*.js ../ConnectionBridge/**/*.js",
"lint-check": "eslint --fix-dry-run ./ && prettier --config .prettierrc.js --check src/**/*.js ../ConnectionBridge/**/*.js"
"lint": "eslint --fix ./ && prettier --config .prettierrc.js --write src/**/*.js ../nmos-bridge/**/*.js",
"lint-check": "eslint ./ && prettier --config .prettierrc.js --check src/**/*.js ../nmos-bridge/**/*.js"
},
"devDependencies": {
"@babel/core": "^7.29.6",
Expand Down
4 changes: 2 additions & 2 deletions Development/src/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,9 @@
"Auth Enabled": {
"value": false
},
"Connection Bridge Mode": {
"NMOS Bridge Mode": {
"value": "disabled"
},
"Connection Bridge API": {
"NMOS Bridge API": {
}
}
37 changes: 14 additions & 23 deletions Development/src/dataProvider.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,29 +13,26 @@ import { JsonPointer } from 'json-ptr';
import diff from 'deep-diff';
import { makeBearerAuthHeader } from './authProvider';
import {
BRIDGE_API,
BRIDGE_AUTO,
BRIDGE_FORCED,
CONNECTION_BRIDGE_API,
DNSSD_API,
LOGGING_API,
QUERY_API,
apiPagingLimit,
apiUrl,
apiUsingRql,
apiVersion,
bridgeMode,
concatUrl,
connectionBridgeMode,
usingAuth,
} from './settings';

// the Connection API Bridge (see ../../ConnectionBridge) makes Device
// Connection and Channel Mapping APIs available at a configured base URL for
// deployments where the browser cannot reach the Device directly
// the NMOS Bridge (see ../../nmos-bridge) makes Device Control APIs
// available at a configured base URL for deployments where the browser
// cannot reach the Device directly
const bridgeAddress = (deviceId, api, version) =>
concatUrl(
apiUrl(CONNECTION_BRIDGE_API),
`/devices/${deviceId}/${api}/${version}`
);
concatUrl(apiUrl(BRIDGE_API), `/devices/${deviceId}/${api}/${version}`);

// which access path, direct or bridge, most recently worked for each Device
const deviceAccessPaths = new Map();
Expand Down Expand Up @@ -895,7 +892,7 @@ const convertHTTPResponseToDataProvider = async (
.reverse();

const deviceId = resourceJSONData.device_id;
const bridgeMode = connectionBridgeMode();
const mode = bridgeMode();

let endpointData;
let accessPath;
Expand All @@ -910,13 +907,10 @@ const convertHTTPResponseToDataProvider = async (
// inaccessible; start with whichever worked last time,
// unless the bridge is forced
const attempts = [];
if (bridgeMode !== BRIDGE_FORCED) {
if (mode !== BRIDGE_FORCED) {
attempts.push(['direct', connectionAddresses[version]]);
}
if (
bridgeMode === BRIDGE_AUTO ||
bridgeMode === BRIDGE_FORCED
) {
if (mode === BRIDGE_AUTO || mode === BRIDGE_FORCED) {
attempts.push([
'bridge',
[
Expand All @@ -929,7 +923,7 @@ const convertHTTPResponseToDataProvider = async (
]);
}
if (
bridgeMode === BRIDGE_AUTO &&
mode === BRIDGE_AUTO &&
deviceAccessPaths.get(deviceId) === 'bridge'
) {
attempts.reverse();
Expand Down Expand Up @@ -1001,7 +995,7 @@ const convertHTTPResponseToDataProvider = async (
.reverse();

const deviceId = deviceJSONData.id;
const bridgeMode = connectionBridgeMode();
const mode = bridgeMode();

let endpointData;
let accessPath;
Expand All @@ -1015,16 +1009,13 @@ const convertHTTPResponseToDataProvider = async (
// bridge; start with whichever path last worked for this
// Device unless Forced
const attempts = [];
if (bridgeMode !== BRIDGE_FORCED) {
if (mode !== BRIDGE_FORCED) {
attempts.push([
'direct',
channelmappingAddresses[version],
]);
}
if (
bridgeMode === BRIDGE_AUTO ||
bridgeMode === BRIDGE_FORCED
) {
if (mode === BRIDGE_AUTO || mode === BRIDGE_FORCED) {
attempts.push([
'bridge',
[
Expand All @@ -1037,7 +1028,7 @@ const convertHTTPResponseToDataProvider = async (
]);
}
if (
bridgeMode === BRIDGE_AUTO &&
mode === BRIDGE_AUTO &&
deviceAccessPaths.get(deviceId) === 'bridge'
) {
attempts.reverse();
Expand Down
36 changes: 14 additions & 22 deletions Development/src/pages/settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,12 @@ import { useTheme } from '@material-ui/styles';
import { Title } from 'react-admin';
import {
AUTH_API,
BRIDGE_API,
BRIDGE_AUTO,
BRIDGE_DISABLED,
BRIDGE_FORCED,
BRIDGE_MODE,
CLIENT_ID,
CONNECTION_BRIDGE_API,
CONNECTION_BRIDGE_MODE,
DNSSD_API,
FRIENDLY_PARAMETERS,
IS12_BROWSER,
Expand Down Expand Up @@ -348,20 +348,16 @@ const Settings = () => {
</StyledListItem>
)}
<StyledDivider />
{!hiddenSetting(CONNECTION_BRIDGE_MODE) && (
{!hiddenSetting(BRIDGE_MODE) && (
<StyledListItem>
<StyledTextField
select
label="Connection Bridge Mode"
label="NMOS Bridge Mode"
variant="filled"
value={values[CONNECTION_BRIDGE_MODE]}
onChange={handleTextChange(
CONNECTION_BRIDGE_MODE
)}
disabled={disabledSetting(
CONNECTION_BRIDGE_MODE
)}
helperText="Proxy Connection API requests when Device endpoints are unreachable (Auto) or always (Forced)"
value={values[BRIDGE_MODE]}
onChange={handleTextChange(BRIDGE_MODE)}
disabled={disabledSetting(BRIDGE_MODE)}
helperText="Proxy Device Control API requests when Device endpoints are unreachable (Auto) or always (Forced)"
>
{bridgeModes.map(option => (
<MenuItem
Expand All @@ -374,20 +370,16 @@ const Settings = () => {
</StyledTextField>
</StyledListItem>
)}
{!hiddenSetting(CONNECTION_BRIDGE_API) && (
{!hiddenSetting(BRIDGE_API) && (
<StyledListItem>
<StyledTextField
label="Connection Bridge API"
label="NMOS Bridge API"
variant="filled"
value={values[CONNECTION_BRIDGE_API]}
onChange={handleTextChange(
CONNECTION_BRIDGE_API
)}
value={values[BRIDGE_API]}
onChange={handleTextChange(BRIDGE_API)}
onFocus={selectOnFocus}
disabled={disabledSetting(
CONNECTION_BRIDGE_API
)}
helperText="Base URL for proxied Connection API requests"
disabled={disabledSetting(BRIDGE_API)}
helperText="Base URL for proxied Device Control API requests"
/>
</StyledListItem>
)}
Expand Down
26 changes: 11 additions & 15 deletions Development/src/settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ export const CLIENT_ID = 'Client ID';

export const IS12_BROWSER = 'IS-12 Browser';

export const CONNECTION_BRIDGE_API = 'Connection Bridge API';
export const CONNECTION_BRIDGE_MODE = 'Connection Bridge Mode';
// Connection Bridge modes
export const BRIDGE_API = 'NMOS Bridge API';
export const BRIDGE_MODE = 'NMOS Bridge Mode';
// NMOS Bridge modes
export const BRIDGE_DISABLED = 'disabled';
export const BRIDGE_AUTO = 'auto';
export const BRIDGE_FORCED = 'forced';
Expand All @@ -44,7 +44,7 @@ const defaultUrl = api => {
return baseUrl + '/log/v1.0';
case QUERY_API:
return baseUrl + '/x-nmos/query/v1.3';
case CONNECTION_BRIDGE_API:
case BRIDGE_API:
return baseUrl + '/x-nmos-bridge/v1.0';
case DNSSD_API:
return baseUrl + '/x-dns-sd/v1.1';
Expand Down Expand Up @@ -128,8 +128,8 @@ export const setUsingAuth = auth => {
};

// an unrecognized stored value falls back to the default mode
export const connectionBridgeMode = () => {
const mode = getJSONSetting(CONNECTION_BRIDGE_MODE, BRIDGE_DISABLED);
export const bridgeMode = () => {
const mode = getJSONSetting(BRIDGE_MODE, BRIDGE_DISABLED);
return [BRIDGE_DISABLED, BRIDGE_AUTO, BRIDGE_FORCED].includes(mode)
? mode
: BRIDGE_DISABLED;
Expand Down Expand Up @@ -194,8 +194,8 @@ const useSettings = () => {
[PAGING_LIMIT]: apiPagingLimit(QUERY_API),
[USE_RQL]: apiUsingRql(QUERY_API),
[FRIENDLY_PARAMETERS]: getJSONSetting(FRIENDLY_PARAMETERS, false),
[CONNECTION_BRIDGE_MODE]: connectionBridgeMode(),
[CONNECTION_BRIDGE_API]: apiUrl(CONNECTION_BRIDGE_API),
[BRIDGE_MODE]: bridgeMode(),
[BRIDGE_API]: apiUrl(BRIDGE_API),
[CLIENT_ID]: authClientId(),
[AUTH_API]: apiUrl(AUTH_API),
[IS12_BROWSER]: apiUrl(IS12_BROWSER),
Expand All @@ -212,13 +212,9 @@ const useSettings = () => {
if (isEffective(USE_RQL)) setApiUsingRql(QUERY_API, values[USE_RQL]);
if (isEffective(FRIENDLY_PARAMETERS))
setJSONSetting(FRIENDLY_PARAMETERS, values[FRIENDLY_PARAMETERS]);
if (isEffective(CONNECTION_BRIDGE_MODE))
setJSONSetting(
CONNECTION_BRIDGE_MODE,
values[CONNECTION_BRIDGE_MODE]
);
if (isEffective(CONNECTION_BRIDGE_API))
setApiUrl(CONNECTION_BRIDGE_API, values[CONNECTION_BRIDGE_API]);
if (isEffective(BRIDGE_MODE))
setJSONSetting(BRIDGE_MODE, values[BRIDGE_MODE]);
if (isEffective(BRIDGE_API)) setApiUrl(BRIDGE_API, values[BRIDGE_API]);
if (isEffective(CLIENT_ID)) setAuthClientId(values[CLIENT_ID]);
if (isEffective(AUTH_API)) setApiUrl(AUTH_API, values[AUTH_API]);
if (isEffective(IS12_BROWSER))
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ After setting up the dependencies, follow these [instructions](Documents/Getting
The web application can also be packaged and deployed with the [nmos-cpp-registry application](https://github.com/sony/nmos-cpp).
Copy the contents of the nmos-js build directory into the admin directory next to the nmos-cpp-registry executable.

For deployments where the browser cannot reach Device Connection APIs directly,
the optional [NMOS Connection API Bridge](ConnectionBridge/README.md) provides
For deployments where the browser cannot reach Device Control APIs directly,
the optional [NMOS Bridge](nmos-bridge/README.md) provides
controlled access through Envoy.

## Agile Development
Expand Down Expand Up @@ -73,7 +73,7 @@ The implementation is designed to be extended. Development is ongoing, following

Recent activity on the project (newest first):

- Added the optional NMOS Connection API Bridge.
- Added the optional NMOS Bridge (formerly Connection API Bridge).
- Launch IS-12 Device Model browser client from within nmos-js Device summary tab.
- Added BCP-007-03 NMOS Support for MXL
- Added prototype [IS-12 Device Model browser client](is12-client/README.md).
Expand Down
Loading