Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PETOSS 517 | Python vulnerabilities Check #158

Merged
merged 10 commits into from
Oct 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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