Skip to content

Commit

Permalink
Upgraded Axios version
Browse files Browse the repository at this point in the history
- Current Axios version was 0.21.4, this version has CSRF vulnerability. Referring to this issue:
  axios/axios#6022, Axios contains a cross-site request forgery (CSRF) vulnerability due to insecure HTTP endpoint permission validation. An attacker could exploit this vulnerability by sending a crafted link to a victim to execute malicious actions on their behalf.
- v1.6.0 has fixed this problem, Upgraded the version to the same.
- Reference: axios/axios#6028

Signed-off-by: Nikhil Ashoka <a.nikhil@ibm.com>
Change-Id: I43719d2dd4524ad1de647f7753a6c923762e1e80
  • Loading branch information
Nikhil-Ashoka committed Mar 26, 2024
1 parent 02f9709 commit 8a92296
Show file tree
Hide file tree
Showing 66 changed files with 21,394 additions and 19,955 deletions.
40,797 changes: 21,128 additions & 19,669 deletions package-lock.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Expand Up @@ -17,7 +17,7 @@
"dependencies": {
"@carbon/icons-vue": "10.28.0",
"@novnc/novnc": "1.2.0",
"axios": "0.21.4",
"axios": "1.6.0",
"bootstrap": "4.6.0",
"bootstrap-vue": "2.21.2",
"core-js": "3.9.1",
Expand Down
10 changes: 3 additions & 7 deletions src/components/AppHeader/AppHeader.vue
Expand Up @@ -217,7 +217,7 @@ export default {
mounted() {
this.$root.$on(
'change-is-navigation-open',
(isNavigationOpen) => (this.isNavigationOpen = isNavigationOpen),
(isNavigationOpen) => (this.isNavigationOpen = isNavigationOpen)
);
},
methods: {
Expand Down Expand Up @@ -246,9 +246,7 @@ export default {

<style lang="scss">
@mixin focus-box-shadow($padding-color: $navbar-color, $outline-color: $white) {
box-shadow:
inset 0 0 0 3px $padding-color,
inset 0 0 0 5px $outline-color;
box-shadow: inset 0 0 0 3px $padding-color, inset 0 0 0 5px $outline-color;
}
.app-header {
.link-skip-nav {
Expand Down Expand Up @@ -387,9 +385,7 @@ export default {
height: $header-height;
line-height: 1;
&:focus {
box-shadow:
inset 0 0 0 3px $navbar-color,
inset 0 0 0 5px color('white');
box-shadow: inset 0 0 0 3px $navbar-color, inset 0 0 0 5px color('white');
outline: 0;
}
}
Expand Down
4 changes: 1 addition & 3 deletions src/components/Global/FormFile.vue
Expand Up @@ -86,9 +86,7 @@ export default {
opacity: 0;
height: 0;
&:focus + span {
box-shadow:
inset 0 0 0 3px theme-color('primary'),
inset 0 0 0 5px $white;
box-shadow: inset 0 0 0 3px theme-color('primary'), inset 0 0 0 5px $white;
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/components/Global/PageTitle.vue
Expand Up @@ -28,7 +28,7 @@ export default {
let index = title.search('-');
title = title.replace(
'-' + title.charAt(index + 1),
title.charAt(index + 1).toUpperCase(),
title.charAt(index + 1).toUpperCase()
);
i++;
}
Expand Down
5 changes: 2 additions & 3 deletions src/components/Global/TableFilter.vue
Expand Up @@ -65,8 +65,7 @@ export default {
default: () => [],
validator: (prop) => {
return prop.every(
(filter) =>
'label' in filter && 'values' in filter && 'key' in filter,
(filter) => 'label' in filter && 'values' in filter && 'key' in filter
);
},
},
Expand Down Expand Up @@ -95,7 +94,7 @@ export default {
emitChange() {
const activeFilters = this.filters.map(({ key, values }) => {
const activeValues = values.filter(
(value) => this.tags.indexOf(value) !== -1,
(value) => this.tags.indexOf(value) !== -1
);
return {
key,
Expand Down
14 changes: 7 additions & 7 deletions src/components/Mixins/BVToastMixin.js
Expand Up @@ -12,14 +12,14 @@ const BVToastMixin = {
const titleWithIcon = this.$createElement(
'strong',
{ class: 'toast-icon' },
[statusIcon, title],
[statusIcon, title]
);
return titleWithIcon;
},
$_BVToastMixin_createBody(messageBody) {
if (Array.isArray(messageBody)) {
return messageBody.map((message) =>
this.$createElement('p', { class: 'mb-0' }, message),
this.$createElement('p', { class: 'mb-0' }, message)
);
} else {
return [this.$createElement('p', { class: 'mb-0' }, messageBody)];
Expand All @@ -40,7 +40,7 @@ const BVToastMixin = {
},
},
},
this.$t('global.action.refresh'),
this.$t('global.action.refresh')
);
},
$_BVToastMixin_initToast(body, title, variant) {
Expand All @@ -59,7 +59,7 @@ const BVToastMixin = {
title: t = this.$t('global.status.success'),
timestamp,
refreshAction,
} = {},
} = {}
) {
const body = this.$_BVToastMixin_createBody(message);
const title = this.$_BVToastMixin_createTitle(t, 'success');
Expand All @@ -73,7 +73,7 @@ const BVToastMixin = {
title: t = this.$t('global.status.error'),
timestamp,
refreshAction,
} = {},
} = {}
) {
const body = this.$_BVToastMixin_createBody(message);
const title = this.$_BVToastMixin_createTitle(t, 'danger');
Expand All @@ -87,7 +87,7 @@ const BVToastMixin = {
title: t = this.$t('global.status.warning'),
timestamp,
refreshAction,
} = {},
} = {}
) {
const body = this.$_BVToastMixin_createBody(message);
const title = this.$_BVToastMixin_createTitle(t, 'warning');
Expand All @@ -101,7 +101,7 @@ const BVToastMixin = {
title: t = this.$t('global.status.informational'),
timestamp,
refreshAction,
} = {},
} = {}
) {
const body = this.$_BVToastMixin_createBody(message);
const title = this.$_BVToastMixin_createTitle(t, 'info');
Expand Down
2 changes: 1 addition & 1 deletion src/components/Mixins/TableFilterMixin.js
Expand Up @@ -30,7 +30,7 @@ const TableFilterMixin = {
tableData = [],
startDate,
endDate,
propertyKey = 'date',
propertyKey = 'date'
) {
if (!startDate && !endDate) return tableData;
let startDateInMs = startDate ? startDate.getTime() : 0;
Expand Down
2 changes: 1 addition & 1 deletion src/i18n.js
Expand Up @@ -7,7 +7,7 @@ function loadLocaleMessages() {
const locales = require.context(
'./locales',
true,
/[A-Za-z0-9-_,\s]+\.json$/i,
/[A-Za-z0-9-_,\s]+\.json$/i
);
const messages = {};
locales.keys().forEach((key) => {
Expand Down
2 changes: 1 addition & 1 deletion src/store/modules/GlobalStore.js
Expand Up @@ -111,7 +111,7 @@ const GlobalStore = {
} else {
commit('setServerStatus', PowerState);
}
},
}
)
.catch((error) => console.log(error));
},
Expand Down
2 changes: 1 addition & 1 deletion src/store/modules/HardwareStatus/AssemblyStore.js
Expand Up @@ -61,7 +61,7 @@ const AssemblyStore = {
throw new Error(i18n.t('pageInventory.toast.errorEnableIdentifyLed'));
} else {
throw new Error(
i18n.t('pageInventory.toast.errorDisableIdentifyLed'),
i18n.t('pageInventory.toast.errorDisableIdentifyLed')
);
}
});
Expand Down
4 changes: 2 additions & 2 deletions src/store/modules/HardwareStatus/BmcStore.js
Expand Up @@ -64,11 +64,11 @@ const BmcStore = {
console.log('error', error);
if (led.identifyLed) {
throw new Error(
i18n.t('pageInventory.toast.errorEnableIdentifyLed'),
i18n.t('pageInventory.toast.errorEnableIdentifyLed')
);
} else {
throw new Error(
i18n.t('pageInventory.toast.errorDisableIdentifyLed'),
i18n.t('pageInventory.toast.errorDisableIdentifyLed')
);
}
});
Expand Down
6 changes: 3 additions & 3 deletions src/store/modules/HardwareStatus/ChassisStore.js
Expand Up @@ -56,7 +56,7 @@ const ChassisStore = {
return await api
.get('/redfish/v1/Chassis')
.then(({ data: { Members = [] } }) =>
Members.map((member) => api.get(member['@odata.id'])),
Members.map((member) => api.get(member['@odata.id']))
)
.then((promises) => api.all(promises))
.then((response) => {
Expand All @@ -78,11 +78,11 @@ const ChassisStore = {
console.log('error', error);
if (led.identifyLed) {
throw new Error(
i18n.t('pageInventory.toast.errorEnableIdentifyLed'),
i18n.t('pageInventory.toast.errorEnableIdentifyLed')
);
} else {
throw new Error(
i18n.t('pageInventory.toast.errorDisableIdentifyLed'),
i18n.t('pageInventory.toast.errorDisableIdentifyLed')
);
}
});
Expand Down
8 changes: 4 additions & 4 deletions src/store/modules/HardwareStatus/FanStore.js
Expand Up @@ -39,9 +39,9 @@ const FanStore = {
.then(({ data: { Members } }) =>
api.all(
Members.map((member) =>
api.get(member['@odata.id']).then((response) => response.data),
),
),
api.get(member['@odata.id']).then((response) => response.data)
)
)
)
.catch((error) => console.log(error));
},
Expand All @@ -61,7 +61,7 @@ const FanStore = {
})
.then(({ data: { Members } }) => {
const promises = Members.map((member) =>
api.get(member['@odata.id']),
api.get(member['@odata.id'])
);
return api.all(promises);
})
Expand Down
2 changes: 1 addition & 1 deletion src/store/modules/HardwareStatus/MemoryStore.js
Expand Up @@ -80,7 +80,7 @@ const MemoryStore = {
throw new Error(i18n.t('pageInventory.toast.errorEnableIdentifyLed'));
} else {
throw new Error(
i18n.t('pageInventory.toast.errorDisableIdentifyLed'),
i18n.t('pageInventory.toast.errorDisableIdentifyLed')
);
}
});
Expand Down
6 changes: 3 additions & 3 deletions src/store/modules/HardwareStatus/PowerSupplyStore.js
Expand Up @@ -50,7 +50,7 @@ const PowerSupplyStore = {
return await api
.get('/redfish/v1/Chassis')
.then(({ data: { Members } }) =>
Members.map((member) => member['@odata.id']),
Members.map((member) => member['@odata.id'])
)
.catch((error) => console.log(error));
},
Expand All @@ -62,7 +62,7 @@ const PowerSupplyStore = {
.then((supplies) => {
let suppliesList = [];
supplies.forEach(
(supply) => (suppliesList = [...suppliesList, ...supply]),
(supply) => (suppliesList = [...suppliesList, ...supply])
);
commit('setPowerSupply', suppliesList);
})
Expand All @@ -76,7 +76,7 @@ const PowerSupplyStore = {
})
.then(({ data: { Members } }) => {
const promises = Members.map((member) =>
api.get(member['@odata.id']),
api.get(member['@odata.id'])
);
return api.all(promises);
})
Expand Down
4 changes: 2 additions & 2 deletions src/store/modules/HardwareStatus/ProcessorStore.js
Expand Up @@ -65,7 +65,7 @@ const ProcessorStore = {
return await api
.get('/redfish/v1/Systems/system/Processors')
.then(({ data: { Members = [] } }) =>
Members.map((member) => api.get(member['@odata.id'])),
Members.map((member) => api.get(member['@odata.id']))
)
.then((promises) => api.all(promises))
.then((response) => {
Expand All @@ -88,7 +88,7 @@ const ProcessorStore = {
throw new Error(i18n.t('pageInventory.toast.errorEnableIdentifyLed'));
} else {
throw new Error(
i18n.t('pageInventory.toast.errorDisableIdentifyLed'),
i18n.t('pageInventory.toast.errorDisableIdentifyLed')
);
}
});
Expand Down
2 changes: 1 addition & 1 deletion src/store/modules/HardwareStatus/SensorsStore.js
Expand Up @@ -34,7 +34,7 @@ const SensorsStore = {
return await api
.get('/redfish/v1/Chassis')
.then(({ data: { Members } }) =>
Members.map((member) => member['@odata.id']),
Members.map((member) => member['@odata.id'])
)
.catch((error) => console.log(error));
},
Expand Down
6 changes: 3 additions & 3 deletions src/store/modules/HardwareStatus/ServerLedStore.js
Expand Up @@ -21,7 +21,7 @@ const ServerLedStore = {
.then((response) => {
commit(
'setIndicatorLedActiveState',
response.data.LocationIndicatorActive,
response.data.LocationIndicatorActive
);
})
.catch((error) => console.log(error));
Expand All @@ -37,11 +37,11 @@ const ServerLedStore = {
commit('setIndicatorLedActiveState', !payload);
if (payload) {
throw new Error(
i18n.t('pageInventory.toast.errorEnableIdentifyLed'),
i18n.t('pageInventory.toast.errorEnableIdentifyLed')
);
} else {
throw new Error(
i18n.t('pageInventory.toast.errorDisableIdentifyLed'),
i18n.t('pageInventory.toast.errorDisableIdentifyLed')
);
}
});
Expand Down
6 changes: 3 additions & 3 deletions src/store/modules/HardwareStatus/SystemStore.js
Expand Up @@ -39,7 +39,7 @@ const SystemStore = {
return await api
.get('/redfish/v1')
.then((response) =>
api.get(`${response.data.Systems['@odata.id']}/system`),
api.get(`${response.data.Systems['@odata.id']}/system`)
)
.then(({ data }) => commit('setSystemInfo', data))
.catch((error) => console.log(error));
Expand All @@ -54,11 +54,11 @@ const SystemStore = {
console.log('error', error);
if (ledState) {
throw new Error(
i18n.t('pageInventory.toast.errorEnableIdentifyLed'),
i18n.t('pageInventory.toast.errorEnableIdentifyLed')
);
} else {
throw new Error(
i18n.t('pageInventory.toast.errorDisableIdentifyLed'),
i18n.t('pageInventory.toast.errorDisableIdentifyLed')
);
}
});
Expand Down

0 comments on commit 8a92296

Please sign in to comment.