Skip to content

Update mocha to the latest version 🚀 #31

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

Open
wants to merge 10 commits into
base: master
Choose a base branch
from
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -31,7 +31,7 @@
"@types/sequelize": "^4.0.79",
"chai": "^4.1.2",
"mkdirp": "^0.5.1",
"mocha": "^5.0.0",
"mocha": "^6.0.0",
"nyc": "^12.0.1",
"request": "^2.83.0",
"rimraf": "^2.6.2",
@@ -52,8 +52,8 @@
},
"apidoc": {
"title": "judge-blocks API",
"url": "http://judge.cb.lk/api",
"sampleUrl": "http://judge.cb.lk/api"
"url": "https://judge2.codingblocks.com/api",
"sampleUrl": "https://judge2.codingblocks.com/api"
},
"nyc": {
"extension": [
2 changes: 1 addition & 1 deletion src/routes/api/run.ts
Original file line number Diff line number Diff line change
@@ -109,7 +109,7 @@ const getRunPoolElement = function (body: RunRequestBody, res: Response): RunPoo
*
* @apiParam {String(Base64)} source source code to run (encoded in base64)
* @apiParam {Enum} lang Language of code to execute
* @apiParam {String(Base64)} input [Optional] stdin input for the program (encoded in base64)
* @apiParam {String(Base64)} stdin [Optional] stdin input for the program (encoded in base64)
* @apiParam {Enum} mode [Optional] mode for request. Default = `sync`, see: https://github.com/coding-blocks/judge-api/issues/16
* @apiParam {String)} callback [Optional] callback url for request. Required for `mode = callback`
* @apiParam {String)} enc [Optional] Encoding type for stdin and source. Can be `url`|`base64`. Default = 'base64'
4 changes: 2 additions & 2 deletions src/utils/s3.ts
Original file line number Diff line number Diff line change
@@ -5,8 +5,8 @@ import config = require('../../config')

const client = new Minio.Client({
endPoint: config.S3.endpoint,
port: config.S3.port,
useSSL: config.S3.ssl,
port: +config.S3.port,
useSSL: !!config.S3.ssl,
accessKey: config.S3.accessKey,
secretKey: config.S3.secretKey,
})
5 changes: 3 additions & 2 deletions src/validators/ApiKeyValidators.ts
Original file line number Diff line number Diff line change
@@ -4,7 +4,8 @@ import {ApiKeyAttrs, ApiKeys} from '../db/models'

export function checkValidApiKey (req: Request): Promise<boolean> {
return new Promise((resolve, reject) => {
let apiKey = req.header('Authorization').split('Bearer ')[1]
let apiKey = req.header('Authorization')
apiKey = apiKey && apiKey.split('Bearer ')[1]
if (!apiKey) {
reject(new Error('No API Key in request'))
}
@@ -42,4 +43,4 @@ export function checkValidApiKey (req: Request): Promise<boolean> {



}
}
527 changes: 491 additions & 36 deletions yarn.lock

Large diffs are not rendered by default.