Skip to content

Commit

Permalink
Merge pull request #158 from XeroAPI/PETOSS-517-python-vulnerabilitie…
Browse files Browse the repository at this point in the history
…s-checks

PETOSS 517 | Python vulnerabilities Check
  • Loading branch information
vigneshk-tw authored Oct 11, 2024
2 parents 49e5f12 + 23377eb commit cbb4403
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .github/workflows/build-test-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,14 @@ jobs:
pip install --upgrade pip
pip install black
sudo pip install flake8
sudo pip install pip-audit
pip install -r requirements.txt -r requirements/dev.txt
working-directory: xero-python

- name: Check vulnerable packages
run: pip-audit -r requirements.txt -r requirements/dev.txt
working-directory: xero-python

- name: Run Flake8
run: flake8 xero_python
working-directory: xero-python
Expand Down
13 changes: 13 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ The xero-python SDK makes it easy for developers to access Xero's APIs in their
- [Helper Methods](#helper-methods)
- [Usage Examples](#usage-examples)
- [SDK conventions](#sdk-conventions)
- [Running Test(s) in Local](#running-tests-in-local)
- [Participating in Xero’s developer community](#participating-in-xeros-developer-community)
- [Contributing](#contributing)

Expand Down Expand Up @@ -540,6 +541,18 @@ created_invoice_attachments_by_file_name = accounting_api.create_invoice_attachm
---
## SDK conventions


---
## Running Test(s) in Local
For Running Test cases PRISM Mock Server needs to be started in the local machine.
Steps to Run Test(s)
* Install PRISM from npm using the command: **npm install -g @stoplight/prism-cli**
* Verify Installation: **prism --version**
* Navigate to **tests--> utils--> ** folder in the terminal
* Execute the script **./start-prism.sh**
* This will start the PRISM Server in Local
* Run **pytest** to run the dotnet test cases.

### Querying & Filtering

Describe the support for query options and filtering
Expand Down
3 changes: 2 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# make sure content of this file can be parsed by setup.load_requirements
python-dateutil>=2.7
urllib3
urllib3>=2.2.3
certifi
setuptools>=75.1.0
9 changes: 9 additions & 0 deletions tests/utils/start-prism.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
prism mock https://raw.githubusercontent.com/XeroAPI/Xero-OpenAPI/refs/heads/master/xero_accounting.yaml --host 127.0.0.1 --port 4010 &
prism mock https://raw.githubusercontent.com/XeroAPI/Xero-OpenAPI/refs/heads/master/xero-app-store.yaml --host 127.0.0.1 --port 4011 &
prism mock https://raw.githubusercontent.com/XeroAPI/Xero-OpenAPI/refs/heads/master/xero_assets.yaml --host 127.0.0.1 --port 4012 &
prism mock https://raw.githubusercontent.com/XeroAPI/Xero-OpenAPI/refs/heads/master/xero_bankfeeds.yaml --host 127.0.0.1 --port 4013 &
prism mock https://raw.githubusercontent.com/XeroAPI/Xero-OpenAPI/refs/heads/master/xero-finance.yaml --host 127.0.0.1 --port 4014 &
prism mock https://raw.githubusercontent.com/XeroAPI/Xero-OpenAPI/refs/heads/master/xero-payroll-uk.yaml --host 127.0.0.1 --port 4015 &
prism mock https://raw.githubusercontent.com/XeroAPI/Xero-OpenAPI/refs/heads/master/xero-payroll-nz.yaml --host 127.0.0.1 --port 4016 &
prism mock https://raw.githubusercontent.com/XeroAPI/Xero-OpenAPI/refs/heads/master/xero-payroll-au.yaml --host 127.0.0.1 --port 4017 &
prism mock https://raw.githubusercontent.com/XeroAPI/Xero-OpenAPI/refs/heads/master/xero-projects.yaml --host 127.0.0.1 --port 4018

0 comments on commit cbb4403

Please sign in to comment.