Skip to content

Commit

Permalink
Replace uuid runtime dependency with crypto API
Browse files Browse the repository at this point in the history
  • Loading branch information
martinpitt committed Jan 16, 2025
1 parent b6c323c commit 42f9e69
Show file tree
Hide file tree
Showing 7 changed files with 6 additions and 12 deletions.
2 changes: 1 addition & 1 deletion node_modules
Submodule node_modules updated 193 files
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
"react-dom": "18.3.1",
"remarkable": "2.0.1",
"throttle-debounce": "5.0.2",
"uuid": "11.0.5",
"@xterm/xterm": "5.5.0",
"@xterm/addon-canvas": "0.7.0"
},
Expand Down
3 changes: 1 addition & 2 deletions pkg/networkmanager/bond.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ import { MacMenu, MemberInterfaceChoices, NetworkModal, Name, dialogSave } from
import { ModelContext } from './model-context.jsx';
import { useDialogs } from "dialogs.jsx";

import { v4 as uuidv4 } from 'uuid';
import {
member_connection_for_interface,
member_interface_choices,
Expand Down Expand Up @@ -217,7 +216,7 @@ export const getGhostSettings = ({ newIfaceName }) => {
id: newIfaceName,
autoconnect: true,
type: "bond",
uuid: uuidv4(),
uuid: window.crypto.randomUUID(),
interface_name: newIfaceName,
},
bond: {
Expand Down
3 changes: 1 addition & 2 deletions pkg/networkmanager/bridge.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ import { MemberInterfaceChoices, NetworkModal, Name, dialogSave } from './dialog
import { ModelContext } from './model-context.jsx';
import { useDialogs } from "dialogs.jsx";

import { v4 as uuidv4 } from 'uuid';
import {
member_connection_for_interface,
member_interface_choices,
Expand Down Expand Up @@ -130,7 +129,7 @@ export const getGhostSettings = ({ newIfaceName }) => {
id: newIfaceName,
autoconnect: true,
type: "bridge",
uuid: uuidv4(),
uuid: window.crypto.randomUUID(),
interface_name: newIfaceName
},
bridge: {
Expand Down
3 changes: 1 addition & 2 deletions pkg/networkmanager/interfaces.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ import { Button } from "@patternfly/react-core/dist/esm/components/Button/index.

import { fmt_to_fragments } from 'utils.jsx';
import * as utils from './utils.js';
import { v4 as uuidv4 } from 'uuid';

import "./networking.scss";

Expand Down Expand Up @@ -1420,7 +1419,7 @@ export function complete_settings(settings, device) {
}

settings.connection.id = device.Interface;
settings.connection.uuid = uuidv4();
settings.connection.uuid = window.crypto.randomUUID();

if (device.DeviceType == 'ethernet') {
settings.connection.type = '802-3-ethernet';
Expand Down
3 changes: 1 addition & 2 deletions pkg/networkmanager/team.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ import { MemberInterfaceChoices, NetworkModal, Name, dialogSave } from './dialog
import { ModelContext } from './model-context.jsx';
import { useDialogs } from "dialogs.jsx";

import { v4 as uuidv4 } from 'uuid';
import {
member_connection_for_interface,
member_interface_choices,
Expand Down Expand Up @@ -216,7 +215,7 @@ export const getGhostSettings = ({ newIfaceName }) => {
id: newIfaceName,
autoconnect: true,
type: "team",
uuid: uuidv4(),
uuid: window.crypto.randomUUID(),
interface_name: newIfaceName,
},
team: {
Expand Down
3 changes: 1 addition & 2 deletions pkg/networkmanager/vlan.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ import { Name, NetworkModal, dialogSave } from './dialogs-common.jsx';
import { ModelContext } from './model-context.jsx';
import { useDialogs } from "dialogs.jsx";

import { v4 as uuidv4 } from 'uuid';
import {
is_interface_connection,
is_interesting_interface,
Expand Down Expand Up @@ -122,7 +121,7 @@ export const getGhostSettings = () => {
id: "",
autoconnect: true,
type: "vlan",
uuid: uuidv4(),
uuid: window.crypto.randomUUID(),
interface_name: ""
},
vlan: {
Expand Down

0 comments on commit 42f9e69

Please sign in to comment.