Merge Boundary UI OSS branch 'main' at commit 863c08019

This commit is contained in:
github-team-secure-boundary committed 2023-06-08 01:29:12 +00:00
commit e438ce227a
8 files changed
+335 -389

No files matched your search

+10 -4
View File
@@ -26,12 +26,18 @@ export default factory.extend({
withAssociations: trait({
afterCreate(record, server) {
const scopeId = record.scopeId;
if (record.scope.type === 'project') {
const orgScopeId = record.scope?.scope.id;
const user = server.schema.users.where({ scopeId: orgScopeId })
.models[0];
// Assign a user to this session if not already assigned.
if (record.scope && !record.user) {
const scopeId =
record.scope.type === 'project'
? record.scope?.scope.id
: record.scope.id;
const user = server.schema.users.where({ scopeId }).models[0];
if (user) record.update({ user });
}
// Assign target and host set to this session, if not already assigned.
const target = server.schema.targets.where({ scopeId }).models[0];
if (target) {
record.update({ target });
+3
View File
@@ -106,6 +106,9 @@ export default function (server) {
server.create('target', { scope, address: '0.0.0.0' });
// Sessions have target data. Create it after targets.
server.createList('session', 4, { scope }, 'withAssociations');
// Also create sessions for "authenticateduser" for Desktop,
// which filters user_id by the currently authenticated user.
server.createList('session', 1, { scope, user }, 'withAssociations');
// Create IAM resources for project
server.createList('group', 3, { scope });
server.createList('role', 3, { scope });