Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build: Release #2510

Merged
merged 35 commits into from
Nov 16, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
5acac3f
fix: Vertical scrollbar in data browser is outside visible area when …
AshishBarvaliya Jun 11, 2023
29a83ac
chore(release): 5.2.0-alpha.15 [skip ci]
semantic-release-bot Jun 11, 2023
3d7148e
feat: Reopen last opened class when navigating to data browser (#2468)
AshishBarvaliya Jun 19, 2023
5f94fb0
chore(release): 5.2.0-alpha.16 [skip ci]
semantic-release-bot Jun 19, 2023
257f76b
feat: Add typing with auto-complete to select a filter field in the d…
patelmilanun Jun 19, 2023
5293640
chore(release): 5.2.0-alpha.17 [skip ci]
semantic-release-bot Jun 19, 2023
a8ce343
fix: Pasting location coordinates into field of type `GeoPoint` does …
patelmilanun Jun 20, 2023
5f4696c
chore(release): 5.2.0-alpha.18 [skip ci]
semantic-release-bot Jun 20, 2023
996ce91
feat: Add Cloud Function execution on Parse Object in data browser (#…
dblythy Jun 23, 2023
046356a
chore(release): 5.2.0-alpha.19 [skip ci]
semantic-release-bot Jun 23, 2023
35360fe
fix: Selecting a saved filter in data browser also highlights other f…
AshishBarvaliya Jun 23, 2023
d410339
chore(release): 5.2.0-alpha.20 [skip ci]
semantic-release-bot Jun 23, 2023
2f1d84e
revert: fix: Vertical scrollbar in data browser is outside visible ar…
mtrezza Jun 24, 2023
cf72fdc
chore(release): 5.2.0-alpha.21 [skip ci]
semantic-release-bot Jun 24, 2023
be212b0
feat: Add refresh button to Cloud Config page (#2480)
patelmilanun Jun 27, 2023
8e6f061
chore(release): 5.2.0-alpha.22 [skip ci]
semantic-release-bot Jun 27, 2023
e98d653
feat: Add parameter `selectedField` to script payload to determine wh…
dblythy Jun 28, 2023
359ebdc
chore(release): 5.2.0-alpha.23 [skip ci]
semantic-release-bot Jun 28, 2023
64d3913
feat: Add support for confirmation dialog before script execution in …
patelmilanun Jun 28, 2023
842d84a
chore(release): 5.2.0-alpha.24 [skip ci]
semantic-release-bot Jun 28, 2023
8c28d24
fix: Incorrect highlight maker position in class list in data browser…
dblythy Jun 29, 2023
a3af032
chore(release): 5.2.0-alpha.25 [skip ci]
semantic-release-bot Jun 29, 2023
8df4e4d
fix: File extension is hidden in file field when editing object in mo…
AshishBarvaliya Jun 30, 2023
e45d7bf
chore(release): 5.2.0-alpha.26 [skip ci]
semantic-release-bot Jun 30, 2023
5bbb94e
fix: Adding a file when adding a new row in the data browser doesn't …
AshishBarvaliya Jun 30, 2023
47b8ca2
chore(release): 5.2.0-alpha.27 [skip ci]
semantic-release-bot Jun 30, 2023
8e46203
refactor: Add lint and prettier (#2492)
mtrezza Jul 4, 2023
3e696f8
refactor: Security upgrade semver from 7.3.7 to 7.5.2 (#2493)
parseplatformorg Jul 8, 2023
103b9c6
feat: Add security checks page (#2491)
dblythy Aug 27, 2023
7ec5461
chore(release): 5.2.0-alpha.28 [skip ci]
semantic-release-bot Aug 27, 2023
bd67056
Merge branch 'beta' into build-alpha
mtrezza Sep 15, 2023
c60bbf2
release
mtrezza Sep 15, 2023
b1a87dc
build: Release (#2499)
mtrezza Sep 15, 2023
77d039a
chore(release): 5.3.0-beta.1 [skip ci]
semantic-release-bot Sep 15, 2023
daba564
release
mtrezza Nov 16, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
24 changes: 20 additions & 4 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,23 +1,39 @@
{
"root": true,
"extends": "eslint:recommended",
"env": {
"es6": true,
"node": true,
"browser": true
},
"parser": "@babel/eslint-parser",
"extends": "eslint:recommended",
"plugins": [
"react"
],
"parserOptions": {
"sourceType": "module"
"ecmaVersion": 6,
"sourceType": "module",
"requireConfigFile": false
},
"plugins": ["react"],
"rules": {
"indent": ["error", 2, { "SwitchCase": 1 }],
"linebreak-style": ["error", "unix"],
"no-trailing-spaces": 2,
"eol-last": 2,
"space-in-parens": ["error", "never"],
"no-multiple-empty-lines": 1,
"prefer-const": "error",
"space-infix-ops": "error",
"no-useless-escape": "off",
"require-atomic-updates": "off",
"react/jsx-uses-vars": 1,
"react/jsx-uses-react": 1,
"react/react-in-jsx-scope": 1,
"no-console": 0,
"no-case-declarations": 0,
"quotes": ["error", "single"],
"eol-last": ["error", "always"]
"no-var": "error",
"no-prototype-builtins": "off",
"curly": ["error", "all"]
}
}
5 changes: 5 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
semi: true
trailingComma: "es5"
singleQuote: true
arrowParens: "avoid"
printWidth: 100
42 changes: 21 additions & 21 deletions Parse-Dashboard/Authentication.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
'use strict';
var bcrypt = require('bcryptjs');
var csrf = require('csurf');
var passport = require('passport');
var LocalStrategy = require('passport-local').Strategy;
const bcrypt = require('bcryptjs');
const csrf = require('csurf');
const passport = require('passport');
const LocalStrategy = require('passport-local').Strategy;
const OTPAuth = require('otpauth')

/**
Expand All @@ -20,11 +20,11 @@ function Authentication(validUsers, useEncryptedPasswords, mountPath) {

function initialize(app, options) {
options = options || {};
var self = this;
const self = this;
passport.use('local', new LocalStrategy(
{passReqToCallback:true},
function(req, username, password, cb) {
var match = self.authenticate({
const match = self.authenticate({
name: username,
pass: password,
otpCode: req.body.otpCode
Expand All @@ -47,13 +47,13 @@ function initialize(app, options) {
});

passport.deserializeUser(function(username, cb) {
var user = self.authenticate({
const user = self.authenticate({
name: username
}, true);
cb(null, user);
});

var cookieSessionSecret = options.cookieSessionSecret || require('crypto').randomBytes(64).toString('hex');
const cookieSessionSecret = options.cookieSessionSecret || require('crypto').randomBytes(64).toString('hex');
const cookieSessionMaxAge = options.cookieSessionMaxAge;
app.use(require('connect-flash')());
app.use(require('body-parser').urlencoded({ extended: true }));
Expand All @@ -67,16 +67,16 @@ function initialize(app, options) {

app.post('/login',
csrf(),
(req,res,next) => {
let redirect = 'apps';
if (req.body.redirect) {
redirect = req.body.redirect.charAt(0) === '/' ? req.body.redirect.substring(1) : req.body.redirect
}
return passport.authenticate('local', {
successRedirect: `${self.mountPath}${redirect}`,
failureRedirect: `${self.mountPath}login${req.body.redirect ? `?redirect=${req.body.redirect}` : ''}`,
failureFlash : true
})(req, res, next)
(req,res,next) => {
let redirect = 'apps';
if (req.body.redirect) {
redirect = req.body.redirect.charAt(0) === '/' ? req.body.redirect.substring(1) : req.body.redirect
}
return passport.authenticate('local', {
successRedirect: `${self.mountPath}${redirect}`,
failureRedirect: `${self.mountPath}login${req.body.redirect ? `?redirect=${req.body.redirect}` : ''}`,
failureFlash : true
})(req, res, next)
},
);

Expand All @@ -100,13 +100,13 @@ function authenticate(userToTest, usernameOnly) {
let otpValid = true;

//they provided auth
let isAuthenticated = userToTest &&
const isAuthenticated = userToTest &&
//there are configured users
this.validUsers &&
//the provided auth matches one of the users
this.validUsers.find(user => {
let isAuthenticated = false;
let usernameMatches = userToTest.name == user.user;
const usernameMatches = userToTest.name == user.user;
if (usernameMatches && user.mfa && !usernameOnly) {
if (!userToTest.otpCode) {
otpMissingLength = user.mfaDigits || 6;
Expand All @@ -126,7 +126,7 @@ function authenticate(userToTest, usernameOnly) {
}
}
}
let passwordMatches = this.useEncryptedPasswords && !usernameOnly ? bcrypt.compareSync(userToTest.pass, user.pass) : userToTest.pass == user.pass;
const passwordMatches = this.useEncryptedPasswords && !usernameOnly ? bcrypt.compareSync(userToTest.pass, user.pass) : userToTest.pass == user.pass;
if (usernameMatches && (usernameOnly || passwordMatches)) {
isAuthenticated = true;
matchingUsername = user.user;
Expand Down
4 changes: 2 additions & 2 deletions Parse-Dashboard/CLI/mfa.js
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ const showInstructions = ({ app, username, passwordCopied, encrypt, config }) =>
`\n${getOrder()}. Make sure that "useEncryptedPasswords" is set to "true" in your dashboard configuration.` +
'\n You chose to generate an encrypted password for this user.' +
'\n Any existing users with non-encrypted passwords will require newly created, encrypted passwords.'
);
);
}
console.log(
'\n------------------------------------------------------------------------------\n'
Expand Down Expand Up @@ -198,7 +198,7 @@ module.exports = {
}
]);
const { algorithm, digits, period } = await getAlgorithm();
const secret =generateSecret({ app, username, algorithm, digits, period });
const secret = generateSecret({ app, username, algorithm, digits, period });
Object.assign(config, secret.config);
showQR(secret.config.url);
}
Expand Down
40 changes: 20 additions & 20 deletions Parse-Dashboard/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ const path = require('path');
const packageJson = require('package-json');
const csrf = require('csurf');
const Authentication = require('./Authentication.js');
var fs = require('fs');
const fs = require('fs');

const currentVersionFeatures = require('../package.json').parseDashboardFeatures;

var newFeaturesInLatestVersion = [];
let newFeaturesInLatestVersion = [];
packageJson('parse-dashboard', { version: 'latest', fullMetadata: true })
.then(latestPackage => {
if (latestPackage.parseDashboardFeatures instanceof Array) {
Expand All @@ -31,29 +31,29 @@ function getMount(mountPath) {
}

function checkIfIconsExistForApps(apps, iconsFolder) {
for (var i in apps) {
var currentApp = apps[i];
var iconName = currentApp.iconName;
var path = iconsFolder + '/' + iconName;
for (const i in apps) {
const currentApp = apps[i];
const iconName = currentApp.iconName;
const path = iconsFolder + '/' + iconName;

fs.stat(path, function(err) {
if (err) {
if ('ENOENT' == err.code) {// file does not exist
console.warn('Icon with file name: ' + iconName +' couldn\'t be found in icons folder!');
} else {
console.log(
'An error occurd while checking for icons, please check permission!');
}
if ('ENOENT' == err.code) {// file does not exist
console.warn('Icon with file name: ' + iconName + ' couldn\'t be found in icons folder!');
} else {
console.log(
'An error occurd while checking for icons, please check permission!');
}
} else {
//every thing was ok so for example you can read it and send it to client
//every thing was ok so for example you can read it and send it to client
}
} );
});
}
}

module.exports = function(config, options) {
options = options || {};
var app = express();
const app = express();
// Serve public files.
app.use(express.static(path.join(__dirname,'public')));

Expand All @@ -72,7 +72,7 @@ module.exports = function(config, options) {

// CSRF error handler
app.use(function (err, req, res, next) {
if (err.code !== 'EBADCSRFTOKEN') return next(err)
if (err.code !== 'EBADCSRFTOKEN') {return next(err)}

// handle CSRF token errors here
res.status(403)
Expand All @@ -81,8 +81,8 @@ module.exports = function(config, options) {

// Serve the configuration.
app.get('/parse-dashboard-config.json', function(req, res) {
let apps = config.apps.map((app) => Object.assign({}, app)); // make a copy
let response = {
const apps = config.apps.map((app) => Object.assign({}, app)); // make a copy
const response = {
apps: apps,
newFeaturesInLatestVersion: newFeaturesInLatestVersion,
};
Expand Down Expand Up @@ -159,7 +159,7 @@ module.exports = function(config, options) {
// running parse-dashboard from globally installed npm.
if (config.iconsFolder) {
try {
var stat = fs.statSync(config.iconsFolder);
const stat = fs.statSync(config.iconsFolder);
if (stat.isDirectory()) {
app.use('/appicons', express.static(config.iconsFolder));
//Check also if the icons really exist
Expand Down Expand Up @@ -213,7 +213,7 @@ module.exports = function(config, options) {
}
return res.redirect(`${mountPath}login`);
}
if (users && req.user && req.user.matchingUsername ) {
if (users && req.user && req.user.matchingUsername) {
res.append('username', req.user.matchingUsername);
}
res.send(`<!DOCTYPE html>
Expand Down
28 changes: 14 additions & 14 deletions Parse-Dashboard/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,18 +27,18 @@ module.exports = (options) => {
process.exit(-1);
}

let explicitConfigFileProvided = !!options.config;
const explicitConfigFileProvided = !!options.config;
let configFile = null;
let configFromCLI = null;
let configServerURL = options.serverURL || process.env.PARSE_DASHBOARD_SERVER_URL;
let configGraphQLServerURL = options.graphQLServerURL || process.env.PARSE_DASHBOARD_GRAPHQL_SERVER_URL;
let configMasterKey = options.masterKey || process.env.PARSE_DASHBOARD_MASTER_KEY;
let configAppId = options.appId || process.env.PARSE_DASHBOARD_APP_ID;
let configAppName = options.appName || process.env.PARSE_DASHBOARD_APP_NAME;
let configUserId = options.userId || process.env.PARSE_DASHBOARD_USER_ID;
let configUserPassword = options.userPassword || process.env.PARSE_DASHBOARD_USER_PASSWORD;
let configSSLKey = options.sslKey || process.env.PARSE_DASHBOARD_SSL_KEY;
let configSSLCert = options.sslCert || process.env.PARSE_DASHBOARD_SSL_CERT;
const configServerURL = options.serverURL || process.env.PARSE_DASHBOARD_SERVER_URL;
const configGraphQLServerURL = options.graphQLServerURL || process.env.PARSE_DASHBOARD_GRAPHQL_SERVER_URL;
const configMasterKey = options.masterKey || process.env.PARSE_DASHBOARD_MASTER_KEY;
const configAppId = options.appId || process.env.PARSE_DASHBOARD_APP_ID;
const configAppName = options.appName || process.env.PARSE_DASHBOARD_APP_NAME;
const configUserId = options.userId || process.env.PARSE_DASHBOARD_USER_ID;
const configUserPassword = options.userPassword || process.env.PARSE_DASHBOARD_USER_PASSWORD;
const configSSLKey = options.sslKey || process.env.PARSE_DASHBOARD_SSL_KEY;
const configSSLCert = options.sslCert || process.env.PARSE_DASHBOARD_SSL_CERT;

function handleSIGs(server) {
const signals = {
Expand Down Expand Up @@ -143,10 +143,10 @@ module.exports = (options) => {

const app = express();

if (allowInsecureHTTP || trustProxy || dev) app.enable('trust proxy');
if (allowInsecureHTTP || trustProxy || dev) {app.enable('trust proxy');}

config.data.trustProxy = trustProxy;
let dashboardOptions = { allowInsecureHTTP, cookieSessionSecret, dev, cookieSessionMaxAge };
const dashboardOptions = { allowInsecureHTTP, cookieSessionSecret, dev, cookieSessionMaxAge };
app.use(mountPath, parseDashboard(config.data, dashboardOptions));
let server;
if(!configSSLKey || !configSSLCert){
Expand All @@ -156,8 +156,8 @@ module.exports = (options) => {
});
} else {
// Start the server using SSL.
var privateKey = fs.readFileSync(configSSLKey);
var certificate = fs.readFileSync(configSSLCert);
const privateKey = fs.readFileSync(configSSLKey);
const certificate = fs.readFileSync(configSSLCert);

server = require('https').createServer({
key: privateKey,
Expand Down
Loading
Loading