Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
086f8d3
PSO-24346
Feb 16, 2021
a70ba8f
PSO-24346
Feb 16, 2021
d8abf33
PSO-24346
Feb 18, 2021
84c9ded
PSO-24346
Feb 18, 2021
e0203fe
PSO-24346
Feb 18, 2021
fbbfddb
LIA-64531-render custom theme skins
gayathri-s-khoros Jul 11, 2022
2483e40
Merge pull request #151 from lithiumtech/bugfix/LIA-64531-render_cust…
gayathri-s-khoros Jul 13, 2022
9c93ef2
1.10.0
gayathri-s-khoros Jul 14, 2022
805c9c9
1.10.1
gayathri-s-khoros Jul 27, 2022
7e1ed51
LIA-84149-fix local-server gulp task to not have dependency
gayathri-s-khoros Oct 13, 2022
499b054
Merge pull request #153 from lithiumtech/bugfix/LIA-84149-fix_local_s…
gayathri-s-khoros Oct 13, 2022
026ddb0
LIA-84149-remove unused server.js import
gayathri-s-khoros Oct 18, 2022
03e8665
Merge pull request #154 from lithiumtech/bugfix/LIA-84149-fix_local_s…
gayathri-s-khoros Oct 18, 2022
e93fc8c
1.11.0
gayathri-s-khoros Oct 28, 2022
a053d42
1.11.1
gayathri-s-khoros Oct 31, 2022
7844350
Revert "1.11.1"
gayathri-s-khoros Nov 8, 2022
014dc28
LIA-86389 Edit readme.md and add the support of node.js version 10.24.1
rishabh-vats Feb 13, 2023
935c45e
Merge pull request #169 from lithiumtech/task/LIA-86389-Edit-the-docu…
rishabh-vats Feb 15, 2023
bc59646
LIA-86699 Update karma-coverage package to 2.2.0 to remove the handle…
rishabh-vats Mar 15, 2023
0a1891e
Merge pull request #170 from lithiumtech/bugfix/LIA-86699_Outdated_Li…
rishabh-vats Mar 16, 2023
d3397ed
LIA-86699 Roll back changes to upgrade the karma-coverage as it is br…
rishabh-vats Mar 23, 2023
723b6f5
Merge pull request #172 from lithiumtech/bugfix/LIA-86699_Outdated_Li…
rishabh-vats Mar 23, 2023
b2dc66b
Create checkmarx-sast-scan-push.yml
Rafi-338 Apr 10, 2023
1088eb5
Update checkmarx-sast-scan-push.yml
Rafi-338 Apr 10, 2023
f660020
Update checkmarx-sast-scan-push.yml
Rafi-338 Apr 10, 2023
d5f0798
Update checkmarx-sast-scan-push.yml
Rafi-338 Apr 10, 2023
8e8b5ec
Update checkmarx-sast-scan-push.yml
Rafi-338 Apr 11, 2023
d6e7382
Update checkmarx-sast-scan-push.yml
Rafi-338 Apr 11, 2023
31a0850
Update checkmarx-sast-scan-push.yml
Rafi-338 Apr 11, 2023
e511579
Update checkmarx-sast-scan-push.yml
Rafi-338 May 23, 2023
c6dede0
Update checkmarx-sast-scan-push.yml
HarshaBovilla3 May 23, 2023
662f7d2
Update checkmarx-sast-scan-push.yml
Rafi-338 May 25, 2023
5e50081
Update checkmarx-sast-scan-push.yml
Rafi-338 May 25, 2023
e11bc38
Update label checkmarx-sast-scan-push.yml
Rafi-338 May 25, 2023
e122886
Update label checkmarx-sast-scan-push.yml
Rafi-338 May 25, 2023
f83482d
Update checkmarx-sast-scan-push.yml
Rafi-338 Sep 22, 2023
b83d6f6
Update checkmarx-sast-scan-push.yml
Rafi-338 Sep 22, 2023
d3fc6b0
Update checkmarx-sast-scan-push.yml
Rafi-338 Sep 22, 2023
721bf7e
Update checkmarx-sast-scan-push.yml
Rafi-338 Sep 22, 2023
4570f59
Update checkmarx-sast-scan-push.yml
Rafi-338 Sep 22, 2023
c7caa86
Update checkmarx-sast-scan-push.yml
Rafi-338 Sep 25, 2023
fa12ce3
Update checkmarx-sast-scan-push.yml
Rafi-338 Oct 5, 2023
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
55 changes: 55 additions & 0 deletions .github/workflows/checkmarx-sast-scan-push.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# This workflow is to automate Checkmarx SAST scans. It runs on a push to the main branch.
#
# The following GitHub Secrets must be first defined:
# - CHECKMARX_URL
# - CHECKMARX_USER
# - CHECKMARX_PASSWORD
# - CHECKMARX_CLIENT_SECRET
#
# The following variables must be inserted below:
# - <ProjectName>

#
# Update the 'team' field to reflect the team name used in Checkmarx.
#
# For the full documentation, including a list of all inputs, please refer to the README https://github.com/checkmarx-ts/checkmarx-cxflow-github-action

name: Checkmarx SAST Scan
on:
push:
branches:
- develop

jobs:
build:
environment: Dev
runs-on:
- self-hosted
-label-1
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Checkmarx CxFlow Action
uses: checkmarx-ts/checkmarx-cxflow-github-action@v1.4 #Github Action version
with:
project: ${{ secrets.CHECKMARX_PROJECT }} # <-- Insert Checkmarx SAST Project Name
team: ${{ secrets.CHECKMARX_TEAMS }}
checkmarx_url: ${{ secrets.CHECKMARX_URL }} # To be stored in GitHub Secrets.
checkmarx_username: ${{ secrets.CHECKMARX_USER }} # To be stored in GitHub Secrets.
checkmarx_password: ${{ secrets.CHECKMARX_PASSWORD }} # To be stored in GitHub Secrets.
checkmarx_client_secret: ${{ secrets.CHECKMARX_CLIENT_SECRET }} # To be stored in GitHub Secrets.
#sca_api_url : ${{ secrets.SCA_API_URL }} # To be stored in GitHub Secrets.
#sca_app_url: ${{ secrets.SCA_APP_URL }} # To be stored in GitHub Secrets.
#sca_access_control_url: ${{ secrets.SCA_ACCESS_CONTROL_URL }} # To be stored in GitHub Secrets.
#sca_tenant: ${{ secrets.SCA_TENANT }} # To be stored in GitHub Secrets.
#sca_username: ${{ secrets.SCA_USERNAME }} # To be stored in GitHub Secrets.
#sca_password: ${{ secrets.SCA_PASSWORD }} # To be stored in GitHub Secrets.
break_build: false
scanners: sast
incremental: false
bug_tracker: Sarif
params: --namespace=${{ github.repository_owner }} --repo-name=${{ github.event.repository.name }} --branch=${{ github.ref }} --cx-flow.filterSeverity --cx-flow.filterCategory --checkmarx.disable-clubbing=true
- name: Upload SARIF file
uses: github/codeql-action/upload-sarif@v1
with:
sarif_file: cx.sarif
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

Run `npm` at the command line to check whether npm is installed.

2. *lithium-sdk* supports Node.js version => 4.8.4, 6.11.2 and 8.3.0.
2. *lithium-sdk* supports Node.js version => 4.8.4, 6.11.2, 8.3.0 and 10.24.1.

3. Install gulp by issuing the following statement in a command line: `npm install gulp -g`.

Expand Down
18 changes: 1 addition & 17 deletions bin/cmd/create-skin.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,23 +7,7 @@ var fs = require('fs');

module.exports = {
run: function () {
//Success call back function
var cb = require('../../gulp/createskin')(gulp, gutil).createNewSkin;

//Check if we are creating skin on a sdk project
if (!fs.existsSync('./server.conf.json')) {
console.log(gutil.colors.red('Please run create-skin under your Lithium SDK project directory.' +
'\n or create a new project with ' + gutil.colors.bold('li create-project') + ' before creating a new skin.'));
process.exit(1);
return true;
}
var server = require('../../lib/server.js')(gulp, gutil);
var versionCheck = require('../../lib/version-check.js')(gulp, gutil);
var serverVersion = versionCheck.createVersion("16.4");
versionCheck.process(server, {
debugMode: gutil.env.debug,
version: serverVersion
}, cb);
require('../../lib/spawn-gulp')(['create-new-skin'].concat(process.argv.splice(3)));
},
help: 'Creates a new skin.' + gutil.colors.bold('\nOptions:') +
'\n--clearCore: Gets the most recent versions of parent skins from the server. Running without --clearCore is faster, '+
Expand Down
6 changes: 6 additions & 0 deletions bin/li.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@ var gutil = require('gulp-util');
var path = require('path');
var fs = require('fs');

process.on('uncaughtException', err => {
console.error('li.js: uncaught error:\n', err);
process.exit(1);
});

function addSpaces (word, length) {
word = ' ' + word;
while (word.length < length + 2) {
Expand Down Expand Up @@ -31,6 +36,7 @@ if (cmds.indexOf(cmd) > -1) {
require('./cmd/' + cmd).run();
} else {
if (cmd != 'help') {
process.exitCode = 9;
console.log(gutil.colors.red(gutil.colors.bold('Command not found: ' + cmd)));
}
console.log(gutil.colors.bold('\nUsage:') + "li command [--options]");
Expand Down
28 changes: 28 additions & 0 deletions gulp/checkThemes.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
'use strict';

module.exports = function (gulp, gutil) {
/**
* Checks if a theme skin is enabled
*/

gulp.task('check-themes', ['version-check'], function(cb, errorCallback) {
var server = require('../lib/server.js')(gulp, gutil);
if (server.useLocalCompile()) {
var version = require('../lib/version-check')(gulp, gutil).getVersion();
var serverVersionThemeCheck = require('../lib/server-version-theme-check.json');
var versionPattern = /(\d+)\.(\d{0,2})*/i;
var matches = version.toString().match(versionPattern);
var versionOnServer = parseInt(matches[1]);
var minorVersionOnServer = parseInt(matches[2]);
if (versionOnServer >= serverVersionThemeCheck.supportedVersionMajor ||
(versionOnServer == serverVersionThemeCheck.supportedVersionMajor &&
minorVersionOnServer >= serverVersionThemeCheck.supportedVersionMinor)) {
require('../lib/check-themes.js')(gulp, gutil).process(server, {
debugMode: gutil.env.debug
}, cb, errorCallback);
} else {
return cb();
}
}
});
};
1 change: 1 addition & 0 deletions gulp/clean.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ module.exports = function (gulp, gutil) {
});
});
}).catch(err => {
process.exitCode = 1;
gutil.log(gutil.colors.red(err));
});
});
Expand Down
24 changes: 20 additions & 4 deletions gulp/createskin.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ var through = lazyReq('through2');
var putils = require('../lib/plugin-utils');

module.exports = function (gulp, gutil) {
var skinLib = require('../lib/skin')(gulp, gutil);

/**
* This function should match all validations for studio skin creation. As of 16.4, studio skin creation does not
Expand All @@ -32,6 +33,7 @@ module.exports = function (gulp, gutil) {
*/
function normalizeSkinId(value) {
if (value === '') {
process.exitCode = 9;
throw Error('Bad input value');
}
return value.trim().replace(/ /g, '_').toLowerCase();
Expand Down Expand Up @@ -77,7 +79,6 @@ module.exports = function (gulp, gutil) {
* skin directory structure under skin base dir of sdk project.
*/
function createNewSkin() {
var skinLib = require('../lib/skin')(gulp, gutil);
var putils = require('../lib/plugin-utils');

var options = {
Expand Down Expand Up @@ -125,6 +126,11 @@ module.exports = function (gulp, gutil) {
choices: function(repo) {
var otherCommunitySkins = skinLib.getOtherCommunitySkins();

var version = require('../lib/version-check')(gulp, gutil).getVersion();
skinLib.setLiaVersion(version);
var isThemeEnabled = require('../lib/check-themes')(gulp, gutil).getThemeEnabled();
skinLib.setThemesMap(isThemeEnabled);

if (repo.isResponsive) {
var communityResponsiveSkinIds = otherCommunitySkins.filter(function(skin) {
return skin.isResponsive();
Expand All @@ -138,7 +144,7 @@ module.exports = function (gulp, gutil) {
} else {
//All core and community skins plus all sdk local skins are valid parents
var communitySkinIds = otherCommunitySkins.filter(function(skin) {
return !skin.isResponsive();
return !skin.isResponsive() && !skin.getIsTheme();
}).map(function(skin) {
return skin.getId();
});
Expand Down Expand Up @@ -192,13 +198,23 @@ module.exports = function (gulp, gutil) {
try {
skinUtil.createNewSkin(options.skinInfo);
} catch(err) {
process.exitCode = 1;
options.skinInfo.errorCb(err);
}
});
}

gulp.task('create-new-skin', ['version-check'], function () {
return createNewSkin();
gulp.task('create-new-skin', ['check-themes'], function () {
//Check if we are creating skin on a sdk project
if (!fs.existsSync('./server.conf.json')) {
console.log(gutil.colors.red('Please run create-skin under your Lithium SDK project directory.' +
'\n or create a new project with ' + gutil.colors.bold('li create-project') + ' before creating a new skin.'));
process.exit(1);
return null;
}
var stream = through().obj();
downloadCorePlugins();
return stream;
});

return {
Expand Down
2 changes: 2 additions & 0 deletions gulp/includes.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,14 @@ module.exports = function (req) {
require('./local-server')(gulp, gutil);
require('./skins')(gulp, gutil);
require('./text')(gulp, gutil);
require('./checkThemes')(gulp, gutil);

Object.getOwnPropertyNames(extensions).forEach(function (ext) {
try {
req(ext + '/gulp/includes')(gulp, gutil);
} catch (err) {
if (err.code !== 'MODULE_NOT_FOUND') {
process.exitCode = 1;
throw err;
} else {
extensions[ext].forEach(function (task) {
Expand Down
7 changes: 6 additions & 1 deletion gulp/plugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ module.exports = function (gulp, gutil) {
runSequence = runSequence.use(gulp);

function handleRsyncError(e) {
process.exitCode = 1;
gutil.log(gutil.colors.red('Failed to sync files: ' + e));
}

Expand Down Expand Up @@ -169,5 +170,9 @@ module.exports = function (gulp, gutil) {
'skins'
]);

gulp.task('serve-sass', ['skins-compile', 'watch-res-sass', 'local-server']);
gulp.task('serve-sass', function(done) {
runSequence('skins-compile', 'watch-res-sass', 'local-server', function() {
done();
});
});
};
23 changes: 19 additions & 4 deletions gulp/responsiveoptions.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ module.exports = function (gulp, gutil) {
return putils.validate(val, /^[0-9]+$/);
}

gulp.task('responsive-options', ['version-check'], function () {
gulp.task('responsive-options', ['check-themes'], function () {
var stream = through().obj();
var server = getPluginServer().getServer();
if ((gutil.env.force || server.force()) && !gutil.env.prompt) {
Expand All @@ -49,16 +49,19 @@ module.exports = function (gulp, gutil) {
var anon = gutil.env.anon;

if (typeof skinId === 'undefined' || typeof port === 'undefined') {
process.exitCode = 9;
throw new Error('must pass both --skin and --port parameters when using the --force flag');
}

if (!validateSkinId(skinId)) {
process.exitCode = 9;
throw new Error('the value passed for skin is not valid.');
}

var portValidate = validatePort(port);

if (portValidate !== true) {
process.exitCode = 9;
throw new Error('port: ' + portValidate);
}

Expand All @@ -73,11 +76,20 @@ module.exports = function (gulp, gutil) {
debugMode: gutil.env.debug,
configDir: gutil.env.configdir || server.configDir()
}, function(err) {
if (err) throw err;
if (err) {
process.exitCode = 1;
throw err;
}
}).pipe(stream);
} else {
var skins = getSkinLib().getResponsiveSkinIds();
var version = require('../lib/version-check')(gulp, gutil).getVersion();
var skinLibVar = getSkinLib();
skinLibVar.setLiaVersion(version);
var isThemeEnabled = require('../lib/check-themes')(gulp, gutil).getThemeEnabled();
skinLibVar.setThemesMap(isThemeEnabled);
var skins = skinLibVar.getResponsiveSkinIds();
if (skins.length < 1) {
process.exitCode = 1;
throw new Error('There are no responsive skins. You should create a skin in the res/skins folder and make ' +
'its parent a responsive skin (such as the responsive_peak skin) by setting the parent property in the ' +
'skin.properties file');
Expand Down Expand Up @@ -112,7 +124,10 @@ module.exports = function (gulp, gutil) {
debugMode: gutil.env.debug,
configDir: gutil.env.configdir || server.configDir()
}, function(err) {
if (err) throw err;
if (err) {
process.exitCode = 1;
throw err;
}
}).pipe(stream);
});
}
Expand Down
4 changes: 2 additions & 2 deletions gulp/skins.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ module.exports = function (gulp, gutil) {

gulp.task('skins', ['skins-vars-template', 'skins-compile']);

gulp.task('skins-compile', function (cb) {
skins.compile().then(cb);
gulp.task('skins-compile', ['check-themes'], function (cb) {
skins.compile().then(cb);
});

gulp.task('skins-vars-template', function () {
Expand Down
Loading
Loading