Skip to content

Commit

Permalink
Merge pull request #62 from rootkie/0.3.1-beta
Browse files Browse the repository at this point in the history
0.3.1 beta
  • Loading branch information
wonyk authored Nov 14, 2018
2 parents aca12fb + 7ad4466 commit 3ed6e1f
Show file tree
Hide file tree
Showing 29 changed files with 3,345 additions and 337 deletions.
21 changes: 21 additions & 0 deletions .env.template.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
// This is a template file for .env
// To make it work, simply remove the extensions .template.js (leaving just .env) and substitute the various values
// They corrosponds to process.env.* where * is the key. Refer to https://github.com/motdotla/dotenv
// Make sure to delete the comments since .env files do not support comments.

SECRET=
SECRET_REFRESH=
SECRET_EMAIL=
DATABASE=
DATABASE_DEBUG=
NODE_ENV=
TEST_EMAIL=
TEST_EMAIL_PW=
ALLOW_ORIGIN=
USER=
CLIENT_ID=
CLIENT_SECRET=
REFRESH_TOKEN=
DOMAIN_NAME=
CAPTCHA_SECRET=
RESET_PASSWORD_RANDOM=
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,11 @@
npm-debug.log*
yarn-debug.log*
yarn-error.log*
*.http

#database
/server/databases/
/personal

#IDE stuff
react-express-upstars.sublime-project
Expand Down
43 changes: 43 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,47 @@
# Change Log
## [v0.3.1-beta](https://github.com/rootkie/react-express-js-upstars/tree/v0.3.1-beta) (November 11, 2018, 4.03pm)
- [Security] Standardised wrong email / password response
- [Feature] Utilised .env for security considerations, allowing different configurations on different machines
- [Added] Files for integration and unit testing
- [Trial] Cut down on CORS headers to reduce bandwidth
- [Added] AuthController.test.js
- [Added] More .env variables for security purposes
- [Changed] MongoDB dumps for new test data
- [Fixed] Debug mode now toggles properly
- [Security] Changed expiry of refresh tokens from 1000d to 90d
- [Added] Emails sent to user after initating a successful passwd change
- [Security] Prompt user to login despite having correct access token but wrong refresh tokens
- [Temp] Added Captcha bypass in debug mode under certain circumstances
- [Fixed] Clean up some unncessary code in AuthController
- [Added] Tests for check, register, login, verifyEmail and refresh
- [Added] More process.env variables
- [Changed] Debug to NODE_ENV
- [Fixed] Better coding practices
- [Tests] More testing features
- [Added] Routed emails to ethereal.mail for development
- [Removed] Multiple tests files for backend and combined
- [Reason] Integration testing requires serial tests only possible in a single file
- [Removed] BASE_URL in .env because front-end don't support env
- [Bump] Version no. to v0.3.1-beta
- [Clean] Jest config file to check wildcard tests
- [Removed] Only allow headers to hold x-access-token
- [Removed] External-personnel is officially deprecated
- [Changed] README.md for tests
- [Added] Class API e2e testing
- [Improved] Better comments for reference
- [Added] User based API e2e tests
- [Fixed] UserController getUser returns more params for front-end
- [Fixed] Security allowing only admin to edit admin fields
- [Added] e2e test for student related api
- [Fixed] Errors response if adding students to non existent class
- [Trial] Captcha bypass in development mode for student
- [Added] E2E tests on attendance APIs
- [Changed] Status code returns for creation
- [Fixed] Dates timing due to regional difference affects comparison
- [Changed] Better attendance code documentation
- [Remove] Unimportant functions like dateFormat
- [Added] Native command line function to reset DB back after the whole backend test

## [v0.3.0-beta](https://github.com/rootkie/react-express-js-upstars/tree/v0.3.0-beta) (September 15, 2018, 3.15pm)
- [Fixed] Image stretching that only occur in chrome (logo)
- [Added] New dependencies for production
Expand Down
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,17 @@ Type these commands into the shell:
|/server |Express.js stuff |
|/server/controllers|All the application backend logic |
|/server/models |Schemas and database operations |
|/dump |A mongoDB template pre-created for testing purposes |


## Resources

All API documentation is in the [wiki](https://github.com/rootkie/react-express-js-upstars/wiki).

## Testing

All tests could be ran manually by following the steps in the [testing guide](https://github.com/rootkie/react-express-js-upstars/wiki/Testing-Guide)

## Troubleshoot
```
bash: nodemon: command not found
Expand Down
6 changes: 6 additions & 0 deletions __tests__/jest.config.integration.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
module.exports = {
verbose: true,
rootDir: '../',
testEnvironment: 'node',
testMatch: [ '<rootDir>/server/__tests__/*.test.js' ]
}
5 changes: 5 additions & 0 deletions __tests__/jest.config.unit.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
module.exports = {
verbose: true,
rootDir: '../',
testMatch: [ '<rootDir>/src/__tests__/*.js' ]
}
Binary file modified dump/tests/classes.bson
Binary file not shown.
Empty file removed dump/tests/externals.bson
Empty file.
1 change: 0 additions & 1 deletion dump/tests/externals.metadata.json

This file was deleted.

Binary file modified dump/tests/users.bson
Binary file not shown.
Loading

0 comments on commit 3ed6e1f

Please sign in to comment.