Skip to content

Commit 0fcaf1e

Browse files
committed
Fix: fix schema validation script. Fixes for renaming repo.
1 parent 5b73d7d commit 0fcaf1e

File tree

12 files changed

+31
-22
lines changed

12 files changed

+31
-22
lines changed

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ Scan through our existing issues to find one that interests you. You can narrow
1717

1818
## Did you write a patch that fixes a bug or adds functionality?
1919
- Commit the changes once you are happy with them. Always write a clear log message for your commits.
20-
- For commit message we follow [Conventional Commit Message Guideline](https://www.conventionalcommits.org). To enforce this we use [pre-commit](https://pre-commit.com), to setup the same go through [pre-commit setup section of the README](https://github.com/browserstack/enigma-public-central#for-contributing-code)
20+
- For commit message we follow [Conventional Commit Message Guideline](https://www.conventionalcommits.org). To enforce this we use [pre-commit](https://pre-commit.com), to setup the same go through [pre-commit setup section of the README](https://github.com/browserstack/enigma#for-contributing-code)
2121
- Make sure there are no lint issues, check lint issues by running `make lint`. If there are some in the portion which you have touched, fix those lint issues.
2222
- If you are making changes to config then please update [schema.json file](schema.json) also.
2323
- We use [semgrep](https://semgrep.dev) for static code analysis and finding vulnerabilities. To check issues locally run `make run_semgrep`.

Makefile

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,17 @@ lint: lint_issues
7676
@python3 -m pylama --version
7777
@pylama -r lint_issues || echo "Linter run returned errors. Check lint_issues file for details." && false
7878

79-
schema_validate:
80-
@echo $(shell python3 scripts/clone_access_modules.py && python3 scripts/validator.py)
79+
.PHONY: schema_validate
80+
schema_validate: export APPUID = $(APP_UID)
81+
schema_validate: setup_mounts ensure_web_container_for_test
82+
@echo "Validating Schema"
83+
@docker exec dev python scripts/validator.py
84+
@if [ "$$?" -ne 0 ]; then \
85+
echo "Schema validation failed"; \
86+
exit 1; \
87+
else \
88+
echo "Schema validation passed"; \
89+
fi
8190

8291
run_semgrep:
8392
$(shell semgrep --error --config "p/cwe-top-25" --config "p/r2c-security-audit")

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
This tool consists of 2 different components: a central webserver and pluggable access modules.
66

77
This repo is the code-base for the central webserver.
8-
Refer to [this](https://github.com/browserstack/enigma-public-access-modules) for published access modules with this tool.
8+
Refer to [this](https://github.com/browserstack/enigma-access-modules) for published access modules with this tool.
99

1010
Refer to [this doc](/docs/%E2%80%9CHow-to%E2%80%9D%20guides/Adding%20Modules.md) on how to create custom access modules
1111

@@ -24,7 +24,7 @@ If you don't have docker setup, follow the guidelines [here](https://docs.docker
2424

2525
1. Ensure you have a valid `config.json` present locally.
2626

27-
The default [config.json.sample](https://github.com/browserstack/enigma-public-central/blob/main/config.json.sample) should be sufficient to start.
27+
The default [config.json.sample](https://github.com/browserstack/enigma/blob/main/config.json.sample) should be sufficient to start.
2828

2929
You can then add module-specific configuration for the modules you want integrated with Enigma.
3030
For detailed instructions on configuration, follow [this doc](/docs/Configuration%20Guide.md)

config.json.sample

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
},
2626
"access_modules": {
2727
"git_urls": [
28-
"https://github.com/browserstack/enigma-public-access-modules.git"
28+
"https://github.com/browserstack/enigma-access-modules.git"
2929
],
3030
"RETRY_LIMIT": 5
3131
},

docs/Configuration Guide.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ database.username | "" (Empty string) | `String` The username to use when connec
1717
database.password | "" (Empty string) | `String` The password to use when connecting to the database. *Not used with SQLite.*
1818
database.host | "" (Empty string) | `String` The host to use when connecting to the database. *Not used with SQLite.*
1919
database.port | | `Integer` The port to use when connecting to the database. *Not used with SQLite.*
20-
access_modules.git_urls | ["https://github.com/browserstack/enigma-public-access-modules.git"] (Enigma's Access Module Repository)| `Array` List of Git URLs of access modules, these URLs are fed to the cloning script to pull the modules into the running container.
20+
access_modules.git_urls | ["https://github.com/browserstack/enigma-access-modules.git"] (Enigma's Access Module Repository)| `Array` List of Git URLs of access modules, these URLs are fed to the cloning script to pull the modules into the running container.
2121
access_modules.RETRY_LIMIT | 5 | `Integer` Maximum number of tries to clone the access modules repository
2222
enigmaGroup.MAIL_APPROVER_GROUPS | [] (Empty list) | `Array` List of approvers Email for managing groups.
2323
email.access-approve | "" (Empty string) | `String` Admin access approver's email address

docs/https-nginx-setup.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ Following are the steps to Setup Nginx in enigma
55
1. **Pre-requisistes**
66
- Should have a host(domain) with ssl certificats that can be attached to nginx.
77
- Make sure the host points the public IP of the machine in which enigma is running on. (i.e., create an dns A record with host pointing to public IP of machine)
8-
2. Create a folder in the root folder of enigma-public-central named `certs` which contains ssl certificate and key.
8+
2. Create a folder in the root folder of enigma named `certs` which contains ssl certificate and key.
99
3. Copy `nginx.conf.sample` file to `nginx.conf`
1010
3. Configure `nginx.conf` file.
1111
- update the hostname in the `nginx.conf` file
@@ -39,7 +39,7 @@ Following are the steps to Setup Nginx in enigma
3939
```
4040
The above mentioned changes are just examples to show what needs to be changed, Please add your own certificate and key file names.
4141

42-
4. Run the following command with your terminal in enigma-public-central root folder.
42+
4. Run the following command with your terminal in enigma root folder.
4343
```
4444
docker run --name enigma-nginx -v <absolute_path to nginx.conf file>:/etc/nginx/nginx.conf:ro \
4545
-v <absolute_path to certs folder>:/certs -p 80:80 -p 443:443 -d --add-host host.docker.internal:host-gateway nginx:latest

docs/one-click-dev.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,13 @@ colima start
2323
### Clone Repository
2424
Clone the repo in local system
2525
```bash
26-
git clone https://github.com/browserstack/enigma-public-central.git
26+
git clone https://github.com/browserstack/enigma.git
2727
```
2828
- copy config.json.sample to config.json
2929

3030
#### For private repo in git_urls in `config.json`
3131
```bash
32-
"https://<git-username>:<github-token>@github.com/browserstack/enigma-public-access-modules.git"
32+
"https://<git-username>:<github-token>@github.com/browserstack/enigma-access-modules.git"
3333
```
3434
where `github-token` is a pat token from https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/creating-a-personal-access-token
3535

docs/“How-to” guides/Adding Modules.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ Enigma provides the following modules as part of its default settings, these can
1414

1515
## Creating custom access modules
1616

17-
When a new resource is required, it's corresponding module has to be added in [Engima's modules repository](https://github.com/browserstack/enigma-public-access-modules.git) or a new dedicated repo (as per the usecase):
17+
When a new resource is required, it's corresponding module has to be added in [Engima's modules repository](https://github.com/browserstack/enigma-access-modules.git) or a new dedicated repo (as per the usecase):
1818

1919
- Add `__init__.py`:
2020

@@ -39,7 +39,7 @@ When a new resource is required, it's corresponding module has to be added in [E
3939
```
4040
- Implement `approve` and `revoke` functions to implement respective functionalities.
4141

42-
Refer to [Engima Access Modules](https://github.com/browserstack/enigma-public-access-modules.git) for further understanding of the default implementations and file structure.
42+
Refer to [Engima Access Modules](https://github.com/browserstack/enigma-access-modules.git) for further understanding of the default implementations and file structure.
4343

4444
Once the implementation is in place, the module needs to be integrated with the central code.
4545
Refer to [Integrations doc](/docs/%E2%80%9CHow-to%E2%80%9D%20guides/Integrating%20Modules.md) for further steps.

docs/“How-to” guides/Integrating Modules.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,15 @@ For every new access modules repository, the following settings have to be added
55
```bash
66
"access_modules": {
77
"git_urls": [
8-
"https://github.com/browserstack/enigma-public-access-modules.git",
8+
"https://github.com/browserstack/enigma-access-modules.git",
99
"https://github-new-access-module.git"
1010
],
1111
....
1212
}
1313
```
1414
### For private repos:
1515
```bash
16-
"https://<git-username>:<github-token>@github.com/browserstack/enigma-public-access-modules.git"
16+
"https://<git-username>:<github-token>@github.com/browserstack/enigma-access-modules.git"
1717
```
1818
where github-token is a [PAT Token](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/creating-a-personal-access-token)
1919

@@ -52,5 +52,5 @@ The added URLs will be integrated by the cloning script `scripts/clone_access_mo
5252
- Once the function is overridden admin can now create a permission with the label and then assign user that permission (learn more about adding permission is Adding Permissions Section). And the user will be asked for the secondary approver for a request.
5353

5454
#### Disabling Access module
55-
- For one click setup it clone all the access modules from the `enigma-public-access-modules` repo. So in the UI you can see all the access modules.
55+
- For one click setup it clone all the access modules from the `enigma-access-modules` repo. So in the UI you can see all the access modules.
5656
- Which can be disabled by removing the non required access moduled folder from `Access/access_modules` path.

docs/“How-to” guides/Running Tests.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Running Unit Tests
22

3-
To run all tests in the code-base, run the following on the root directory for `enigma-public-central`
3+
To run all tests in the code-base, run the following on the root directory for `enigma`
44

55
```bash
66
make test

0 commit comments

Comments
 (0)