Skip to content

Conversation

JonathanLeeWH
Copy link
Contributor

@JonathanLeeWH JonathanLeeWH commented Nov 10, 2020

To address #68

Reimplemented existing source code for firebase Authentication migration

  • Removed previous implementation of custom JWT Authentication
  • All existing controllers such as softwareController and usersController are reimplemented with firebase Authentication implementation
  • Added disabledAPIEndPoint middleware to allow for disabling of API endpoints
  • Disabled /api/auth API endpoint (Possible removing of auth api endpoint in future commits) with the new disabledAPIEndPoint middleware
  • Disabled auth.test.js test suite and moved to disabledAPINotTested directory (with jest.config.js configuration)
  • Refactored API endpoint from /api/softwares/ to /api/software/ for consistency
  • Amended software model to change platforms field to platform field and the corresponding type from array to string (Plan for project page in future to support software with multiple platforms)
  • Amended user model's passwordHash field to password field for consistency (It should still store password hash)
  • Refactored all existing requests rest API test cases with the new software API endpoints route amendments, changes to request body and Authorization header
  • Reimplemented all test cases for software.test.js and users.test.js (including their test utilities) with firebase Authentication integration.

Note: Some test cases are removed from previous test suites as it is handled by firebase Authentication such as email validation.

  • Added firebaseConfig.js and firebaseTestUtils.js
  • Removed unused environmental variables from config.js
  • Improved .gitignore to avoid committing Google service account file (Security purposes)

The Improved docker support with firebase Authentication

  • Refactored docker-compose-test-ci.yml to .github/ci/docker-compose-test-ci.yml
  • Added decrypt_firebase_secret.sh shell script used for continuous integration
  • Added new environmental variables in dockerfile and removed unused environmental variables
  • Added dockerfile-ci a custom docker file specifically for continuous integration

Others

  • Resolved a bug where the put software API endpoint is doing a partial update of resource in logic which in the concept of Rest API is a behaviour of patch hence, the HTTP method is changed from put to patch to match the logic used

Removed previous implementation of custom JWT Authentication
All existing controllers such as softwareController and usersController are reimplemented with firebase Authentication implementation
Added disabledAPIEndPoint middleware to allow for disabling of API endpoints
Disabled /api/auth API endpoint (Possible removing of auth api endpoint in future commits) with the new disabledAPIEndPoint middleware
Disabled auth.test.js test suite and moved to disabledAPINotTested directory (with jest.config.js configuration)
Refactored API endpoint from /api/softwareds/ to /api/software/ for consistency
Amended software model to change platforms field from array to string (Plan for project page in future to support software with multiple platforms)
Amended user model's passwordHash field to password field for consistency (It should still store password hash)
Refactored all existing requests rest API test cases with the new software API endpoints route amendments, changes to request body and Authorization header
Reimplemented all test cases for software.test.js and users.test.js (including their test utilities) with firebase Authentication integration
Note: Some test cases are removed from previous test suites as it is handled by firebase Authentication such as email validation.
Added firebaseConfig.js firebaseTestUtils.js
Removed unused environmental variables from config.js
Improved app-test-container.yml GitHub Actions to support firebase Authentication
Added new environmental variables introduced in migration to firebase Authentication in Dockerfile and remove unused environmental variables
Improved .gitignore to avoid committing Google service account file for security purposes
Added test-ci script in package.json for continuous integration usage
Improved comments in software.test.js
Added firebase.gpg
Added Shell script descrypt_firebase_secret.sh for firebase.gpg decrpytion (This is for continuous integration only)
Added Dockerfile-ci which is a separate dockerfile used only by continuous integration
Improved docker-compose-test-ci with firebase Authentication support
Refactor docker ci files to .github directory
@JonathanLeeWH JonathanLeeWH added documentation Improvements or additions to documentation enhancement New feature or request github_actions Pull requests that update Github_actions code priority.high High priority db.model Related to database models/schemas API Related to API endpoints Testing Related to testing code quality Related to code quality Security Related to Security labels Nov 10, 2020
@JonathanLeeWH JonathanLeeWH self-assigned this Nov 10, 2020
@JonathanLeeWH JonathanLeeWH linked an issue Nov 10, 2020 that may be closed by this pull request
@JonathanLeeWH JonathanLeeWH added this to the Version 1.0.0 milestone Nov 10, 2020
@JonathanLeeWH JonathanLeeWH added the status.done Done and ready for review and merge label Nov 10, 2020
@JonathanLeeWH JonathanLeeWH merged commit 3335a67 into master Nov 10, 2020
@JonathanLeeWH JonathanLeeWH deleted the migration-to-firebase-auth branch November 10, 2020 10:22
@JonathanLeeWH JonathanLeeWH added bug.resolved Related to resolution of bugs docker Related to docker labels Nov 10, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
API Related to API endpoints bug.resolved Related to resolution of bugs code quality Related to code quality db.model Related to database models/schemas docker Related to docker documentation Improvements or additions to documentation enhancement New feature or request firebase Related to firebase github_actions Pull requests that update Github_actions code priority.high High priority Security Related to Security status.done Done and ready for review and merge Testing Related to testing
Projects
None yet
Development

Successfully merging this pull request may close these issues.

To migrate to firebase Authentication
1 participant