Skip to content

Commit 3998b96

Browse files
authored
Merge branch 'master' into dependabot/npm_and_yarn/fs-extra-11.3.2
2 parents d9c16bc + 86ae477 commit 3998b96

File tree

7 files changed

+31
-15
lines changed

7 files changed

+31
-15
lines changed

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ The js-controller repository is a monorepo which is managed via `lerna`. Every f
88
To install the dependencies, execute
99

1010
```bash
11-
npm i --ignore-scripts
11+
npm ci --ignore-scripts
1212
```
1313

1414
in the root folder of the project.

packages/db-objects-file/src/lib/objects/objectsInMemServerRedis.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ export class ObjectsInMemoryServer extends ObjectsInMemoryFileDB {
8080
.then(() => {
8181
this.log.debug(
8282
`${this.namespace} ${settings.secure ? 'Secure ' : ''} Redis inMem-objects listening on port ${
83-
settings.port || 9001
83+
this.settings.connection.port || 9001
8484
}`,
8585
);
8686

@@ -90,7 +90,7 @@ export class ObjectsInMemoryServer extends ObjectsInMemoryFileDB {
9090
})
9191
.catch(e => {
9292
this.log.error(
93-
`${this.namespace} Cannot start inMem-objects on port ${settings.port || 9001}: ${e.message}`,
93+
`${this.namespace} Cannot start inMem-objects on port ${this.settings.connection.port || 9001}: ${e.message}`,
9494
);
9595
process.exit(EXIT_CODES.NO_CONNECTION_TO_OBJ_DB);
9696
});

packages/db-objects-jsonl/src/lib/objects/objectsInMemServerRedis.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ export class ObjectsInMemoryServer extends ObjectsInMemoryJsonlDB {
8080
.then(() => {
8181
this.log.debug(
8282
`${this.namespace} ${settings.secure ? 'Secure ' : ''} Redis inMem-objects listening on port ${
83-
settings.port || 9001
83+
this.settings.connection.port || 9001
8484
}`,
8585
);
8686

@@ -90,7 +90,7 @@ export class ObjectsInMemoryServer extends ObjectsInMemoryJsonlDB {
9090
})
9191
.catch(e => {
9292
this.log.error(
93-
`${this.namespace} Cannot start inMem-objects on port ${settings.port || 9001}: ${e.message}`,
93+
`${this.namespace} Cannot start inMem-objects on port ${this.settings.connection.port || 9001}: ${e.message}`,
9494
);
9595
process.exit(EXIT_CODES.NO_CONNECTION_TO_OBJ_DB);
9696
});

packages/db-states-file/src/lib/states/statesInMemServerRedis.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ export class StatesInMemoryServer extends StatesInMemoryFileDB {
6868
.then(() => {
6969
this.log.debug(
7070
`${this.namespace} ${settings.secure ? 'Secure ' : ''} Redis inMem-states listening on port ${
71-
this.settings.port || 9000
71+
this.settings.connection.port || 9000
7272
}`,
7373
);
7474

@@ -78,7 +78,7 @@ export class StatesInMemoryServer extends StatesInMemoryFileDB {
7878
})
7979
.catch(e => {
8080
this.log.error(
81-
`${this.namespace} Cannot start inMem-states on port ${this.settings.port || 9000}: ${e.message}`,
81+
`${this.namespace} Cannot start inMem-states on port ${this.settings.connection.port || 9000}: ${e.message}`,
8282
);
8383
process.exit(EXIT_CODES.NO_CONNECTION_TO_STATES_DB);
8484
});
@@ -534,8 +534,8 @@ export class StatesInMemoryServer extends StatesInMemoryFileDB {
534534
this.server = net.createServer();
535535
this.server.on('error', err =>
536536
this.log.info(
537-
`${this.namespace} ${settings.secure ? 'Secure ' : ''} Error inMem-objects listening on port ${
538-
settings.port || 9001
537+
`${this.namespace} ${settings.secure ? 'Secure ' : ''} Error inMem-states listening on port ${
538+
settings.port || 9000
539539
}: ${err}`,
540540
),
541541
);

packages/db-states-jsonl/src/lib/states/statesInMemServerRedis.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ export class StatesInMemoryServer extends StatesInMemoryJsonlDB {
6868
.then(() => {
6969
this.log.debug(
7070
`${this.namespace} ${settings.secure ? 'Secure ' : ''} Redis inMem-states listening on port ${
71-
this.settings.port || 9000
71+
this.settings.connection.port || 9000
7272
}`,
7373
);
7474

@@ -78,7 +78,7 @@ export class StatesInMemoryServer extends StatesInMemoryJsonlDB {
7878
})
7979
.catch(e => {
8080
this.log.error(
81-
`${this.namespace} Cannot start inMem-states on port ${this.settings.port || 9000}: ${e.message}`,
81+
`${this.namespace} Cannot start inMem-states on port ${this.settings.connection.port || 9000}: ${e.message}`,
8282
);
8383
process.exit(EXIT_CODES.NO_CONNECTION_TO_STATES_DB);
8484
});
@@ -534,8 +534,8 @@ export class StatesInMemoryServer extends StatesInMemoryJsonlDB {
534534
this.server = net.createServer();
535535
this.server.on('error', err =>
536536
this.log.info(
537-
`${this.namespace} ${settings.secure ? 'Secure ' : ''} Error inMem-objects listening on port ${
538-
settings.port || 9001
537+
`${this.namespace} ${settings.secure ? 'Secure ' : ''} Error inMem-states listening on port ${
538+
settings.port || 9000
539539
}: ${err}`,
540540
),
541541
);

packages/types-dev/objects.d.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -439,6 +439,8 @@ declare global {
439439
password: string;
440440
/** Whether this user is enabled */
441441
enabled: boolean;
442+
/** External authentications besides password, e.g. OIDC */
443+
externalAuthentication?: Record<string, unknown>;
442444

443445
// Make it possible to narrow the object type using the custom property
444446
custom?: undefined;

packages/types-public/index.test-d.ts

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,10 +78,16 @@ function objectChangeHandler(id: string, object: ioBroker.Object | null | undefi
7878
case 'instance':
7979
case 'meta':
8080
case 'script':
81-
case 'user':
8281
// nothing special here, update these tests when we have specialized definitions
8382
break;
84-
83+
case 'user': {
84+
if (object.common.externalAuthentication?.oidc) {
85+
/** It is up to the dev how this looks like hence, oidc is of type unknown */
86+
const oidc = object.common.externalAuthentication.oidc as { sub: string };
87+
oidc.sub === 'foo';
88+
}
89+
break;
90+
}
8591
case 'state':
8692
if (object.acl) {
8793
object.acl.state.toFixed();
@@ -891,6 +897,14 @@ const _userObject: ioBroker.UserObject = {
891897
native: {},
892898
};
893899

900+
/** With external auth */
901+
const _userObjectExt: ioBroker.UserObject = {
902+
_id: 'system.user.me',
903+
type: 'user',
904+
common: { name: 'me', password: '*****', enabled: true, externalAuthentication: { oidc: { sub: 'bar' } } },
905+
native: {},
906+
};
907+
894908
// Ensure that getForeignObject tries to resolve a specific object type
895909
async () => {
896910
const inst: ioBroker.InstanceObject | null | undefined =

0 commit comments

Comments
 (0)