Skip to content

Commit cbb4403

Browse files
authored
Merge pull request #158 from XeroAPI/PETOSS-517-python-vulnerabilities-checks
PETOSS 517 | Python vulnerabilities Check
2 parents 49e5f12 + 23377eb commit cbb4403

File tree

4 files changed

+29
-1
lines changed

4 files changed

+29
-1
lines changed

.github/workflows/build-test-lint.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,14 @@ jobs:
2727
pip install --upgrade pip
2828
pip install black
2929
sudo pip install flake8
30+
sudo pip install pip-audit
3031
pip install -r requirements.txt -r requirements/dev.txt
3132
working-directory: xero-python
3233

34+
- name: Check vulnerable packages
35+
run: pip-audit -r requirements.txt -r requirements/dev.txt
36+
working-directory: xero-python
37+
3338
- name: Run Flake8
3439
run: flake8 xero_python
3540
working-directory: xero-python

README.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ The xero-python SDK makes it easy for developers to access Xero's APIs in their
1818
- [Helper Methods](#helper-methods)
1919
- [Usage Examples](#usage-examples)
2020
- [SDK conventions](#sdk-conventions)
21+
- [Running Test(s) in Local](#running-tests-in-local)
2122
- [Participating in Xero’s developer community](#participating-in-xeros-developer-community)
2223
- [Contributing](#contributing)
2324

@@ -540,6 +541,18 @@ created_invoice_attachments_by_file_name = accounting_api.create_invoice_attachm
540541
---
541542
## SDK conventions
542543

544+
545+
---
546+
## Running Test(s) in Local
547+
For Running Test cases PRISM Mock Server needs to be started in the local machine.
548+
Steps to Run Test(s)
549+
* Install PRISM from npm using the command: **npm install -g @stoplight/prism-cli**
550+
* Verify Installation: **prism --version**
551+
* Navigate to **tests--> utils--> ** folder in the terminal
552+
* Execute the script **./start-prism.sh**
553+
* This will start the PRISM Server in Local
554+
* Run **pytest** to run the dotnet test cases.
555+
543556
### Querying & Filtering
544557

545558
Describe the support for query options and filtering

requirements.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
# make sure content of this file can be parsed by setup.load_requirements
22
python-dateutil>=2.7
3-
urllib3
3+
urllib3>=2.2.3
44
certifi
5+
setuptools>=75.1.0

tests/utils/start-prism.sh

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
prism mock https://raw.githubusercontent.com/XeroAPI/Xero-OpenAPI/refs/heads/master/xero_accounting.yaml --host 127.0.0.1 --port 4010 &
2+
prism mock https://raw.githubusercontent.com/XeroAPI/Xero-OpenAPI/refs/heads/master/xero-app-store.yaml --host 127.0.0.1 --port 4011 &
3+
prism mock https://raw.githubusercontent.com/XeroAPI/Xero-OpenAPI/refs/heads/master/xero_assets.yaml --host 127.0.0.1 --port 4012 &
4+
prism mock https://raw.githubusercontent.com/XeroAPI/Xero-OpenAPI/refs/heads/master/xero_bankfeeds.yaml --host 127.0.0.1 --port 4013 &
5+
prism mock https://raw.githubusercontent.com/XeroAPI/Xero-OpenAPI/refs/heads/master/xero-finance.yaml --host 127.0.0.1 --port 4014 &
6+
prism mock https://raw.githubusercontent.com/XeroAPI/Xero-OpenAPI/refs/heads/master/xero-payroll-uk.yaml --host 127.0.0.1 --port 4015 &
7+
prism mock https://raw.githubusercontent.com/XeroAPI/Xero-OpenAPI/refs/heads/master/xero-payroll-nz.yaml --host 127.0.0.1 --port 4016 &
8+
prism mock https://raw.githubusercontent.com/XeroAPI/Xero-OpenAPI/refs/heads/master/xero-payroll-au.yaml --host 127.0.0.1 --port 4017 &
9+
prism mock https://raw.githubusercontent.com/XeroAPI/Xero-OpenAPI/refs/heads/master/xero-projects.yaml --host 127.0.0.1 --port 4018

0 commit comments

Comments
 (0)