Skip to content

Commit

Permalink
feat(rbac): Implement role based access control
Browse files Browse the repository at this point in the history
-define roles and permissions for vendors and buyers
-assign roles and permissions to users during registration or profile update
-enforce role-based access control throughout the application
-write comprehensive unit tests

[Delivers #34]
  • Loading branch information
ambroisegithub authored and jkarenzi committed May 7, 2024
1 parent 5a92978 commit 92d2e16
Show file tree
Hide file tree
Showing 29 changed files with 1,119 additions and 203 deletions.
3 changes: 2 additions & 1 deletion .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
},
"rules": {
"no-console": "warn",
"quotes": ["error", "single"]
"@typescript-eslint/no-var-requires": "off",
"@typescript-eslint/no-explicit-any": "off"
}
}
55 changes: 33 additions & 22 deletions .github/workflows/workflow_for_ecomm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,37 +2,48 @@ name: CI for ecomm-project for Dynamite

on:
push:
branches: [ "develop" ]
branches: ['develop']
pull_request:
branches: [ "develop" ]

jobs:
build:
#git hub offer virtual machines to run workflows so we will be using ubuntu lastest version its standand one
#we using ubuntu because we want to use lunex terminal
runs-on: ubuntu-latest

strategy:
matrix:
#each version we specify we be tested on
#we are only limited to 3 versions
node-version: [16.x, 18.x, 20.x]

node-version: [20.x]

steps:
- uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }} #this will help use know which version we are testing on.
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: 'npm' #this we help speed up the workflow by reusing dependencies from previous runs
- run: npm ci #run dependencies installing we using ci in place of 'npm install' becouse ci(clearn install) is smooth and faster
- run: npm run test --if-present #this line will run test script
- run: npm run lint --if-present # run tle
- run: npm run build --if-present # we using if statement because initial the code have no build script in packege.json
- run: npm run test:ci --if-present # this will run test with coverage flag
- uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
- run: npm ci
- run: npm run test --if-present
- run: npm run build --if-present
- run: npm run test:ci --if-present
- run: npm run lint --if-present
- name: Upload coverage to Coveralls
uses: coverallsapp/github-action@v2
with:
allow-empty: true

- name: Upload coverage to Coveralls
uses: coverallsapp/github-action@v2
with:
allow-empty: true
env:
DB_PORT_DEV: ${{ secrets.DB_PORT_DEV }}
DB_USER_DEV: ${{ secrets.DB_USER_DEV }}
DB_PASSWORD_DEV: ${{ secrets.DB_PASSWORD_DEV }}
DB_NAME_DEV: ${{ secrets.DB_NAME_DEV }}
DB_HOST_DEV: ${{ secrets.DB_HOST_DEV }}
APP_URL: ${{ secrets.APP_URL }}
ALL: ${{ secrets.ALL }}
DOCS: ${{ secrets.DOCS }}
APP_PORT: ${{ secrets.APP_PORT }}
JWT_SECRET: ${{ secrets.JWT_SECRET }}
DB_PORT_TEST: ${{ secrets.DB_PORT_TEST }}
DB_USER_TEST: ${{ secrets.DB_USER_TEST }}
DB_PASSWORD_TEST: ${{ secrets.DB_PASSWORD_TEST }}
DB_NAME_TEST: ${{ secrets.DB_NAME_TEST }}
DB_HOST_TEST: ${{ secrets.DB_HOST_TEST }}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ node_modules/
dist/
src/output.log
coverage/

Loading

0 comments on commit 92d2e16

Please sign in to comment.