Skip to content

Commit

Permalink
Merge pull request #252 from browserstack/update_dependencies
Browse files Browse the repository at this point in the history
chore(deps): updating package versions
  • Loading branch information
kneeraj2000 authored Aug 19, 2024
2 parents f5d1770 + 883e734 commit a0b0026
Show file tree
Hide file tree
Showing 9 changed files with 1,041 additions and 1,286 deletions.
62 changes: 31 additions & 31 deletions .github/workflows/docker-push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,39 +2,39 @@ name: Build and Push enigma image to Docker
on:
push:
tags:
- 'v*'
- v*

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Check out the repo
uses: actions/checkout@v3
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Docker metadata
id: meta
uses: docker/metadata-action@v4
with:
images: |
browserstack/enigma
tags: |
type=semver,pattern=v{{version}}
type=semver,pattern=v{{major}}.{{minor}}
type=semver,pattern=v{{major}}
- name: Login to DockerHub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v4
with:
context: .
push: true
platforms: linux/amd64, linux/arm64/v8
target: web
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
- name: Check out the repo
uses: actions/checkout@v3
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Docker metadata
id: meta
uses: docker/metadata-action@v4
with:
images: |
browserstack/enigma
tags: |
type=semver,pattern=v{{version}}
type=semver,pattern=v{{major}}.{{minor}}
type=semver,pattern=v{{major}}
- name: Login to DockerHub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v4
with:
context: .
push: true
platforms: linux/amd64, linux/arm64/v8
target: web
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
6 changes: 3 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# See https://pre-commit.com/hooks.html for more hooks
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
rev: v4.6.0
hooks:
- id: check-merge-conflict
- id: trailing-whitespace
Expand All @@ -19,11 +19,11 @@ repos:
files: \.(json|json.sample)$
args: [--autofix, --no-sort-keys]
- repo: https://github.com/macisamuele/language-formatters-pre-commit-hooks
rev: v2.6.0
rev: v2.14.0
hooks:
- id: pretty-format-yaml
args: [--autofix]
- repo: https://github.com/alessandrojcm/commitlint-pre-commit-hook
rev: v9.4.0
rev: v9.16.0
hooks:
- id: commitlint
3 changes: 1 addition & 2 deletions Access/tests/features/get_pending_request.feature
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Feature : Get Pending Request

Scenario: Retrieving All Pending Requests
Given request to view all pending requests
When the `get_pending_requests` method is called
Expand All @@ -13,4 +13,3 @@ Feature : Get Pending Request
When the `get_pending_requests` method is called
Then the method should handle the error
And return an error response

19 changes: 9 additions & 10 deletions Access/tests/features/get_request_access.feature
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Feature: Get Request Access

Scenario: verify generic form key
Given empty configured access_modules are There
And get_request has zero modules
Expand All @@ -8,14 +8,14 @@ Feature: Get Request Access

Scenario: get_access_request returns correct response
Given four configured access_modules are There
And get_request has four modules
When get_request_access function is called
And get_request has four modules
When get_request_access function is called
Then Return value should return all four access list with all seven present keynames

Scenario: get_access_request returns correct response with extra fields
Given four configured access_modules are There
And two with extra fields and two without extra fields
When get_request_access function is called
When get_request_access function is called
Then Return value should return all four access with extra fields

Scenario: get_access_request returns correct response with notice/alert
Expand All @@ -26,30 +26,29 @@ Feature: Get Request Access

Scenario: verify response with array of access list with two elements
Given four configured access_modules are There
And get_request has two modules
And get_request has two modules
When get_request_access function is called
Then Return value should be access list with two modules

Scenario: verify response with array of access list with empty elements
Given four configured access_modules are There
And get_request has zero modules
And get_request has zero modules
When get_request_access function is called
Then Return value should be empty access list

Scenario: verify response with array of access list with all elements
Given four configured access_modules are There
And get_request has four modules
And get_request has four modules
When get_request_access function is called
Then Return value should return all four access list with all seven present keynames

Scenario: get_request_access is called with invalid parameters
Given four configured access_modules are There
And get_request does not have accesses key
And get_request does not have accesses key
When get_request_access function is called
Then Return value should be error json

Scenario: get_request_access is called with invalid request type
Given request is post request
When get_request_access function is called for invalid request type
Then Return value should be error json

21 changes: 10 additions & 11 deletions Access/tests/features/validate_approver_permissions.feature
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
Feature: Validate Approver Permission

Scenario: User who made the request has primary approver access & access_mapping is not in pending state & module does not need secondary approval
Given User who made request has primary approver access
And access_mapping is not in pending state
And Modules does not need secondary approval
When validate_approver_permissions function is called
When validate_approver_permissions function is called
Then Return value should be empty json

Scenario: _get_approver_permissions raises an Exception, the function should return error message as json
Scenario: _get_approver_permissions raises an Exception, the function should return error message as json
Given _get_approver_permissions raises an exception when called
When validate_approver_permissions function is called
Then Return value should be error json
Expand All @@ -18,40 +18,39 @@ Feature: Validate Approver Permission
And Modules does not need secondary approval
When validate_approver_permissions function is called
Then Return value should be permission denied json

Scenario: User who made the request has secondary approver access & access_mapping is not in pending state & module supports secondary approval
Given User who made request has secondary approver access
And access_mapping is not in pending state
And Modules supports secondary approval
When validate_approver_permissions function is called
Then Return value should be empty json

Scenario: User who made the request has primary approver access & access_mapping is not in pending state & module supports secondary approval
Scenario: User who made the request has primary approver access & access_mapping is not in pending state & module supports secondary approval
Given User who made request has primary approver access with false response
And access_mapping is not in pending state
And Modules supports secondary approval
When validate_approver_permissions function is called
Then Return value should be permission denied json


Scenario: When the user who made the request has primary approver access & access_mapping is in pending state & module does not need secondary approval
Scenario: When the user who made the request has primary approver access & access_mapping is in pending state & module does not need secondary approval
Given User who made request has primary approver access
And access_mapping is in pending state
And Modules does not need secondary approval
When validate_approver_permissions function is called
Then Return value should be empty json

Scenario: When the user who made the request has primary approver access & access_mapping is in pending state & module does needs secondary approval
Scenario: When the user who made the request has primary approver access & access_mapping is in pending state & module does needs secondary approval
Given User who made request has primary approver access
And access_mapping is in pending state
And Modules supports secondary approval
When validate_approver_permissions function is called
When validate_approver_permissions function is called
Then Return value should be empty json

Scenario: When the user who made the request has secondary approver access & access_mapping is in primary pending state & module does needs secondary approval
Scenario: When the user who made the request has secondary approver access & access_mapping is in primary pending state & module does needs secondary approval
Given User who made request has only secondary approver access with false response
And access_mapping is in pending state
And Modules does not need secondary approval
When validate_approver_permissions function is called
When validate_approver_permissions function is called
Then Return value should be permission denied json

4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ Enigma access management tool was developed internally at BrowserStack to solve
The following steps are for hosting Enigma locally from published docker container images.

For development setup, follow these docs:
[Setup using docker](/docs/“How-to”%20guides/User%20Guides/Local%20Developer%20Setup/Local%20Setup%20with%20Docker.md),
[Setup using docker](/docs/“How-to”%20guides/User%20Guides/Local%20Developer%20Setup/Local%20Setup%20with%20Docker.md),
[Setup without docker](/docs/“How-to”%20guides/User%20Guides/Local%20Developer%20Setup/Local%20Setup%20without%20Docker.md)

#### Pre-requisites
Expand Down Expand Up @@ -84,7 +84,7 @@ For first time user sign-in, follow [this doc](/docs/%E2%80%9CHow-to%E2%80%9D%20
- The codebase is tested for Python 3.11.0
- Setup pre-commit hooks for development (see rules [below](#rules-enforced-by-the-pre-commit-hooks))
- run: `npm install @commitlint/cli @commitlint/config-conventional`
- run: `pip install pre-commit==2.21.0`
- run: `pip install pre-commit==3.8.0`
- run: `pre-commit install --install-hooks --overwrite` in the base directory of this project
- run: `pre-commit autoupdate`
- run: `pre-commit run --all-files --show-diff-on-failure --color always`
Expand Down
Loading

0 comments on commit a0b0026

Please sign in to comment.