Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
29ff266
keycloak init
JPadovano1483 Feb 11, 2026
823945a
moved realm exports
JPadovano1483 Feb 13, 2026
90031c1
integrated keycloak auth with postgres RLS
JPadovano1483 Feb 23, 2026
5dedb0d
created separate system and user connection pools
JPadovano1483 Feb 25, 2026
52112ca
set backbone access group and apply to van ownership
JPadovano1483 Feb 25, 2026
339fbe8
removing unnecessary rollbacks
JPadovano1483 Feb 25, 2026
3754293
revert system calls to original state and use system pool
JPadovano1483 Feb 26, 2026
9396e54
added owner group dropdown for object creation
JPadovano1483 Feb 26, 2026
bf16ccb
remove concept of using queryWithContext for system calls
JPadovano1483 Feb 26, 2026
164b2d5
removing old users table
JPadovano1483 Feb 27, 2026
af0544b
move response sending until after queryWithContext commits
JPadovano1483 Feb 27, 2026
28a04a1
added missing variable declaration
JPadovano1483 Feb 27, 2026
5b95474
fix typo in deployment application link
JPadovano1483 Mar 2, 2026
0198529
adding where clauses to secured table queries
JPadovano1483 Mar 2, 2026
2283d0a
modularized owner group dropdown selector
JPadovano1483 Mar 2, 2026
705a740
cleanup
JPadovano1483 Mar 2, 2026
105823f
adding keycloak protect to compose api
JPadovano1483 Mar 2, 2026
5eefeb5
drop created db roles and functions
JPadovano1483 Mar 5, 2026
e39a8f9
give vans explicit owners, not inherited
JPadovano1483 Mar 5, 2026
6466cd5
granular realm roles for api endpoint access
JPadovano1483 Mar 11, 2026
b57ec18
add RLS to backboneaccesspoints, interiorsites, and interrouterlinks …
JPadovano1483 Mar 11, 2026
437db7a
add ownergroup dropdown on multi-tenant van form
JPadovano1483 Mar 11, 2026
449b72c
fixed query syntax errors
JPadovano1483 Mar 12, 2026
26ef772
consolidated realm roles
JPadovano1483 Mar 13, 2026
d1aeae7
add public ownership option to dropdowns
JPadovano1483 Mar 13, 2026
2d13ae3
decoupled query WHERE clauses from RLS policies
JPadovano1483 Mar 13, 2026
c1f0dac
use env var for express session secret
JPadovano1483 Mar 16, 2026
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
6 changes: 5 additions & 1 deletion components/compose-web-app/modules/app_old.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
*/

import { LibDetail } from "./library.js";
import { FormLayout, SetupTable, TextArea } from "./util.js";
import { FormLayout, SetupTable, TextArea, OwnerGroupSelector } from "./util.js";

export async function BuildApplicationTable() {
const response = await fetch('compose/v1alpha1/applications');
Expand Down Expand Up @@ -152,13 +152,16 @@ async function AppForm() {
}
}

const ownerGroupSelector = await OwnerGroupSelector();

const form = await FormLayout(
//
// Form fields
//
[
['Application Name:', appName],
['Root Block:', rootSelector],
['Owner Group:', ownerGroupSelector]
],

//
Expand All @@ -173,6 +176,7 @@ async function AppForm() {
body: JSON.stringify({
name : appName.value,
rootblock : rootSelector.value,
ownerGroup: ownerGroupSelector.value
}),
});

Expand Down
17 changes: 12 additions & 5 deletions components/compose-web-app/modules/backbone.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
*/

import { toBackboneTab } from "../page.js";
import { FormLayout, LayoutRow, PollObject, PollTable, SetupTable, TimeAgo, ConfirmDialog } from "./util.js";
import { FormLayout, LayoutRow, PollObject, PollTable, SetupTable, TimeAgo, ConfirmDialog, OwnerGroupSelector } from "./util.js";

export async function BuildBackboneTable() {
const response = await fetch('api/v1alpha1/backbones');
Expand Down Expand Up @@ -69,12 +69,15 @@ async function BackboneForm() {
let bbName = document.createElement('input');
bbName.type = 'text';

const ownerGroupSelector = await OwnerGroupSelector();

const form = await FormLayout(
//
// Form fields
//
[
['Backbone Name:', bbName],
['Owner Group:', ownerGroupSelector],
],

//
Expand All @@ -88,6 +91,7 @@ async function BackboneForm() {
},
body: JSON.stringify({
name : bbName.value,
ownerGroup : ownerGroupSelector.value,
}),
});

Expand Down Expand Up @@ -624,8 +628,9 @@ async function SiteForm(backbone) {
'Content-Type': 'application/json',
},
body: JSON.stringify({
name : siteName.value,
platform : platformSelector.value,
name : siteName.value,
platform : platformSelector.value,
ownerGroup : backbone.ownergroup
}),
});

Expand Down Expand Up @@ -683,8 +688,9 @@ async function AccessPointForm(div, backbone, siteId) {
//
async () => {
let body = {
name : apName.value,
kind : kindSelector.value,
name : apName.value,
kind : kindSelector.value,
ownerGroup : backbone.ownergroup,
};
if (bindHost.value != '') {
body.bindhost = bindHost.value;
Expand Down Expand Up @@ -775,6 +781,7 @@ async function LinkForm(div, backbone, siteId) {
let body = {
connectingsite : siteId,
cost : cost.value,
ownerGroup : backbone.ownergroup,
};
const response = await fetch(`api/v1alpha1/accesspoints/${peerSelector.value}/links`, {
method: 'POST',
Expand Down
7 changes: 5 additions & 2 deletions components/compose-web-app/modules/deploy.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

import { toDeploymentTab } from "../page.js";
import { AppDetail } from "./app_old.js";
import { FormLayout, SetupTable, TextArea } from "./util.js";
import { FormLayout, SetupTable, TextArea, OwnerGroupSelector } from "./util.js";

export async function BuildDeploymentTable() {
const response = await fetch('compose/v1alpha1/deployments');
Expand All @@ -39,7 +39,7 @@ export async function BuildDeploymentTable() {

anchor = document.createElement('a');
anchor.setAttribute('href', '#');
anchor.addEventListener('click', () => { AppDetail(item.applicaion); });
anchor.addEventListener('click', () => { AppDetail(item.application); });
anchor.textContent = item.appname;
row.insertCell().appendChild(anchor);

Expand Down Expand Up @@ -158,6 +158,7 @@ async function DeploymentForm() {

let appSelector = document.createElement('select');
let vanSelector = document.createElement('select');
let ownerGroupSelector = await OwnerGroupSelector();

//
// Populate the application selector
Expand Down Expand Up @@ -186,6 +187,7 @@ async function DeploymentForm() {
[
['Application:', appSelector],
['VAN:', vanSelector],
['Owner Group:', ownerGroupSelector],
],

//
Expand All @@ -200,6 +202,7 @@ async function DeploymentForm() {
body: JSON.stringify({
app : appSelector.value,
van : vanSelector.value,
ownerGroup: ownerGroupSelector.value,
}),
});

Expand Down
6 changes: 5 additions & 1 deletion components/compose-web-app/modules/library.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import { LibraryHistory } from "./library-history.js";
import { LibraryEditInterfaces } from "./library-interfaces.js";
import { LibraryEditSimple } from "./library-simple.js";
import { TabSheet } from "./tabsheet.js";
import { FormLayout, LayoutRow, SetupTable, TextArea } from "./util.js";
import { FormLayout, LayoutRow, SetupTable, TextArea, OwnerGroupSelector } from "./util.js";

export async function BuildLibraryTable() {
const response = await fetch('/compose/v1alpha1/library/blocks');
Expand Down Expand Up @@ -113,6 +113,8 @@ async function BlockForm(blockTypes, interfaceRoles) {
composite.textContent = 'Composite';
bodySelector.appendChild(composite);

const ownerGroupSelector = await OwnerGroupSelector();

const form = await FormLayout(
//
// Form fields
Expand All @@ -122,6 +124,7 @@ async function BlockForm(blockTypes, interfaceRoles) {
['Block Type:', btSelector],
['Provider (optional):', provider],
['Body Type:', bodySelector],
['Owner Group:', ownerGroupSelector]
],

//
Expand All @@ -139,6 +142,7 @@ async function BlockForm(blockTypes, interfaceRoles) {
type : btSelector.value,
provider : provider.value,
bodystyle : bodySelector.value,
ownerGroup: ownerGroupSelector.value
}),
});
console.log(' fetch completed');
Expand Down
44 changes: 44 additions & 0 deletions components/compose-web-app/modules/util.js
Original file line number Diff line number Diff line change
Expand Up @@ -361,4 +361,48 @@ export function MultiSelectWithCheckbox(items) {
}

return layout;
}

export async function OwnerGroupSelector() {
let ownerGroupSelector = document.createElement('select');
ownerGroupSelector.id = 'ownerGroupSelector';

try {
const ownerGroupResult = await fetch('/api/v1alpha1/user/groups');
if (ownerGroupResult.ok) {
const ownerGroupList = await ownerGroupResult.json();

// Add a default/empty option
let defaultOption = document.createElement('option');
let publicOption = document.createElement('option');
defaultOption.textContent = '-- Select a group --';
defaultOption.value = '';
publicOption.textContent = 'public';
publicOption.value = 'public';
ownerGroupSelector.appendChild(defaultOption);
ownerGroupSelector.appendChild(publicOption);

// Add user's groups
for (const ownerGroup of ownerGroupList) {
let option = document.createElement('option');
option.textContent = ownerGroup.name;
option.value = ownerGroup.id;
ownerGroupSelector.appendChild(option);
}
} else {
// Handle error case
let errorOption = document.createElement('option');
errorOption.textContent = 'Error loading groups';
errorOption.disabled = true;
ownerGroupSelector.appendChild(errorOption);
}
} catch (error) {
console.error('Error fetching user groups:', error);
let errorOption = document.createElement('option');
errorOption.textContent = 'Error loading groups';
errorOption.disabled = true;
ownerGroupSelector.appendChild(errorOption);
}

return ownerGroupSelector;
}
10 changes: 9 additions & 1 deletion components/compose-web-app/modules/van.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
import { InvitationsTab } from "./invitations.js";
import { MembersTab } from "./members.js";
import { TabSheet } from "./tabsheet.js";
import { FormLayout, PollTable, SetupTable } from "./util.js";
import { FormLayout, PollTable, SetupTable, OwnerGroupSelector } from "./util.js";
import { ConfigTab } from "./vanconfig.js";
import { DetailTab } from "./vandetail.js";

Expand Down Expand Up @@ -152,6 +152,8 @@ async function ExternalVanForm() {
let vanName = document.createElement('input');
vanName.type = 'text';

const ownerGroupSelector = await OwnerGroupSelector();

let bbSelector = document.createElement('select');
const bbResult = await fetch('/api/v1alpha1/backbones');
const bbList = await bbResult.json();
Expand All @@ -169,6 +171,7 @@ async function ExternalVanForm() {
[
['VAN Name:', vanName],
['Backbone:', bbSelector],
['Owner Group:', ownerGroupSelector],
],

//
Expand All @@ -178,6 +181,7 @@ async function ExternalVanForm() {
let body = {
name : vanName.value,
tenant : 'false',
ownerGroup: ownerGroupSelector.value,
};
const response = await fetch(`api/v1alpha1/backbones/${bbSelector.value}/vans`, {
method: 'POST',
Expand Down Expand Up @@ -215,6 +219,8 @@ async function MultiTenantVanForm() {
let vanName = document.createElement('input');
vanName.type = 'text';

const ownerGroupSelector = await OwnerGroupSelector();

let bbSelector = document.createElement('select');
const bbResult = await fetch('/api/v1alpha1/backbones');
const bbList = await bbResult.json();
Expand Down Expand Up @@ -279,6 +285,7 @@ async function MultiTenantVanForm() {
['Backbone:', bbSelector],
['Start Time:', startTimeGroup],
['End Time:', endTimeGroup],
['Owner Group:', ownerGroupSelector],
],

//
Expand All @@ -288,6 +295,7 @@ async function MultiTenantVanForm() {
let body = {
name : vanName.value,
tenant : 'true',
ownerGroup: ownerGroupSelector.value,
};
if (!startNow.checked) {
body.starttime = startTime.value;
Expand Down
Loading