Skip to content

Commit a9a70f1

Browse files
committed
Update Readme documentations.
1 parent 87e6d5b commit a9a70f1

11 files changed

+429
-193
lines changed

.sonarcloud.properties

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
sonar.projectName=sbc-pay
2+
sonar.projectVersion=Autoscan
3+
4+
# Path to sources
5+
sonar.sources=pay-api/src, bcol-api/src, report-api/src
6+
#sonar.exclusions=
7+
#sonar.inclusions=
8+
9+
# Path to tests
10+
sonar.tests=pay-api/tests/unit, bcol-api/tests/unit, report-api/tests/unit,
11+
#sonar.test.exclusions=
12+
#sonar.test.inclusions=
13+
14+
# Source encoding
15+
sonar.sourceEncoding=UTF-8
16+
17+
# Exclusions for copy-paste detection
18+
#sonar.cpd.exclusions=

CODE_OF_CONDUCT.md

+78
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
2+
3+
## Contributor Covenant Code of Conduct
4+
5+
## Our Pledge
6+
7+
In the interest of fostering an open and welcoming environment, we as
8+
contributors and maintainers pledge to making participation in our project and
9+
our community a harassment-free experience for everyone, regardless of age, body
10+
size, disability, ethnicity, gender identity and expression, level of
11+
experience, nationality, personal appearance, race, religion, or sexual identity
12+
and orientation.
13+
14+
## Our Standards
15+
16+
Examples of behavior that contributes to creating a positive environment
17+
include:
18+
19+
* Using welcoming and inclusive language
20+
* Being respectful of differing viewpoints and experiences
21+
* Gracefully accepting constructive criticism
22+
* Focusing on what is best for the community
23+
* Showing empathy towards other community members
24+
25+
Examples of unacceptable behavior by participants include:
26+
27+
* The use of sexualized language or imagery and unwelcome sexual attention or
28+
advances
29+
* Trolling, insulting/derogatory comments, and personal or political attacks
30+
* Public or private harassment
31+
* Publishing others' private information, such as a physical or electronic
32+
address, without explicit permission
33+
* Other conduct which could reasonably be considered inappropriate in a
34+
professional setting
35+
36+
## Our Responsibilities
37+
38+
Project maintainers are responsible for clarifying the standards of acceptable
39+
behavior and are expected to take appropriate and fair corrective action in
40+
response to any instances of unacceptable behavior.
41+
42+
Project maintainers have the right and responsibility to remove, edit, or
43+
reject comments, commits, code, wiki edits, issues, and other contributions
44+
that are not aligned to this Code of Conduct, or to ban temporarily or
45+
permanently any contributor for other behaviors that they deem inappropriate,
46+
threatening, offensive, or harmful.
47+
48+
## Scope
49+
50+
This Code of Conduct applies both within project spaces and in public spaces
51+
when an individual is representing the project or its community. Examples of
52+
representing a project or community include using an official project e-mail
53+
address, posting via an official social media account, or acting as an appointed
54+
representative at an online or offline event. Representation of a project may be
55+
further defined and clarified by project maintainers.
56+
57+
## Enforcement
58+
59+
Instances of abusive, harassing, or otherwise unacceptable behavior may be
60+
reported by contacting the project team at SBC_ITOperationsSupport@gov.bc.ca.
61+
All complaints will be reviewed and investigated and will result in a response
62+
that is deemed necessary and appropriate to the circumstances. The project team
63+
is obligated to maintain confidentiality with regard to the reporter of an
64+
incident. Further details of specific enforcement policies may be posted
65+
separately.
66+
67+
Project maintainers who do not follow or enforce the Code of Conduct in good
68+
faith may face temporary or permanent repercussions as determined by other
69+
members of the project's leadership.
70+
71+
## Attribution
72+
73+
This Code of Conduct is adapted from the [Contributor Covenant][homepage],
74+
version 1.4, available at
75+
[http://contributor-covenant.org/version/1/4][version].
76+
77+
[homepage]: http://contributor-covenant.org
78+
[version]: http://contributor-covenant.org/version/1/4/

CONTRIBUTING.md

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
2+
## How to Contribute
3+
4+
Government employees, public and members of the private sector are encouraged to
5+
contribute to the repository by **forking and submitting a pull request**.
6+
7+
(If you are new to GitHub, you might start with a
8+
[basic tutorial](https://help.github.com/articles/set-up-git) and check out a
9+
more detailed guide to
10+
[pull requests](https://help.github.com/articles/using-pull-requests/).)
11+
12+
Pull requests will be evaluated by the repository guardians on a schedule and if
13+
deemed beneficial will be committed to the master.
14+
15+
All contributors retain the original copyright to their stuff, but by
16+
contributing to this project, you grant a world-wide, royalty-free, perpetual,
17+
irrevocable, non-exclusive, transferable license to all users **under the terms
18+
of the license under which this project is distributed.**
19+

README.md

+47-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,49 @@
11
[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](LICENSE)
22

3-
[![Bugs](https://sonarqube-l4ygcl-tools.pathfinder.gov.bc.ca/api/badges/measure?key=BCRegistriesPayment&metric=bugs&template=FLAT)](https://sonarqube-l4ygcl-tools.pathfinder.gov.bc.ca/dashboard?id=BCRegistriesPayment) [![Vulnerabilities](https://sonarqube-l4ygcl-tools.pathfinder.gov.bc.ca/api/badges/measure?key=BCRegistriesPayment&metric=vulnerabilities&template=FLAT)](https://sonarqube-l4ygcl-tools.pathfinder.gov.bc.ca/dashboard?id=BCRegistriesPayment) [![Code smells](https://sonarqube-l4ygcl-tools.pathfinder.gov.bc.ca/api/badges/measure?key=BCRegistriesPayment&metric=code_smells&template=FLAT)](https://sonarqube-l4ygcl-tools.pathfinder.gov.bc.ca/dashboard?id=BCRegistriesPayment) [![Coverage](https://sonarqube-l4ygcl-tools.pathfinder.gov.bc.ca/api/badges/measure?key=BCRegistriesPayment&metric=coverage&template=FLAT)](https://sonarqube-l4ygcl-tools.pathfinder.gov.bc.ca/dashboard?id=BCRegistriesPayment) [![Duplication](https://sonarqube-l4ygcl-tools.pathfinder.gov.bc.ca/api/badges/measure?key=BCRegistriesPayment&metric=duplicated_lines_density&template=FLAT)](https://sonarqube-l4ygcl-tools.pathfinder.gov.bc.ca/dashboard?id=BCRegistriesPayment) [![Lines of code](https://sonarqube-l4ygcl-tools.pathfinder.gov.bc.ca/api/badges/measure?key=BCRegistriesPayment&metric=lines&template=FLAT)](https://sonarqube-l4ygcl-tools.pathfinder.gov.bc.ca/dashboard?id=BCRegistriesPayment)
3+
# BC Registiries payment services
4+
5+
BC Registries and Online Services is beginning a phased, multi-year modernization initiative to replace and improve the applications used for BC Online, the Corporate, Personal Property and Manufactured Homes Registries. Our vision is to develop a better service experience and make it easier for citizens and businesses to complete transactions and filings with the province of BC and across other jurisdictions, manage accounts and pay for services.
6+
7+
The sbc-pay repo aims to create an common payment module for BC registries which can be utilised by different services.
8+
For more information on the API please refer to:
9+
10+
[pay-api\Readme](pay-api/README.md)
11+
12+
For more information on the web component refer to:
13+
14+
[bcol-api\Readme](bcol-api/README.md)
15+
16+
For more information on the Notify API component refer to:
17+
18+
[report-api\Readme](report-api/README.md)
19+
20+
## How to Contribute
21+
22+
If you would like to contribute, please see our [contributing](CONTRIBUTING.md)
23+
guidelines. Please note that this project is released with a
24+
[Contributor Code of Conduct](CODE_OF_CONDUCT.md). By participating in this
25+
project you agree to abide by its terms.
26+
27+
## License
28+
29+
Copyright 2019 Province of British Columbia
30+
31+
Licensed under the Apache License, Version 2.0 (the "License"); you may not
32+
use this file except in compliance with the License. You may obtain a copy
33+
of the License at
34+
35+
http://www.apache.org/licenses/LICENSE-2.0
36+
37+
Unless required by applicable law or agreed to in writing, software
38+
distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
39+
WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
40+
License for the specific language governing permissions and limitations
41+
under the License.
42+
43+
# Testing Thanks
44+
45+
Thanks to BrowserStack for Testing Tool support via OpenSource Licensing
46+
47+
[![BrowserStack](browserstack-logo-white-small.png)](http://browserstack.com/)
48+
49+

bcol-api/README.md

+27-61
Original file line numberDiff line numberDiff line change
@@ -1,77 +1,43 @@
1+
[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](../LICENSE)
2+
[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=bcgov_sbc-pay&metric=alert_status)](https://sonarcloud.io/code?id=bcgov_sbc-pay&selected=bcgov_sbc-pay%3Abcol-api)
3+
[![codecov](https://codecov.io/gh/bcgov/sbc-pay/branch/master/graph/badge.svg)](https://codecov.io/gh/bcgov/sbc-pay)
14

2-
[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](LICENSE)
5+
# BCOL API
36

4-
[![Bugs](https://sonarqube-l4ygcl-tools.pathfinder.gov.bc.ca/api/badges/measure?key=BCRegistriesPayment&metric=bugs&template=FLAT)](https://sonarqube-l4ygcl-tools.pathfinder.gov.bc.ca/dashboard?id=BCRegistriesPayment) [![Vulnerabilities](https://sonarqube-l4ygcl-tools.pathfinder.gov.bc.ca/api/badges/measure?key=BCRegistriesPayment&metric=vulnerabilities&template=FLAT)](https://sonarqube-l4ygcl-tools.pathfinder.gov.bc.ca/dashboard?id=BCRegistriesPayment) [![Code smells](https://sonarqube-l4ygcl-tools.pathfinder.gov.bc.ca/api/badges/measure?key=BCRegistriesPayment&metric=code_smells&template=FLAT)](https://sonarqube-l4ygcl-tools.pathfinder.gov.bc.ca/dashboard?id=BCRegistriesPayment) [![Coverage](https://sonarqube-l4ygcl-tools.pathfinder.gov.bc.ca/api/badges/measure?key=BCRegistriesPayment&metric=coverage&template=FLAT)](https://sonarqube-l4ygcl-tools.pathfinder.gov.bc.ca/dashboard?id=BCRegistriesPayment) [![Duplication](https://sonarqube-l4ygcl-tools.pathfinder.gov.bc.ca/api/badges/measure?key=BCRegistriesPayment&metric=duplicated_lines_density&template=FLAT)](https://sonarqube-l4ygcl-tools.pathfinder.gov.bc.ca/dashboard?id=BCRegistriesPayment) [![Lines of code](https://sonarqube-l4ygcl-tools.pathfinder.gov.bc.ca/api/badges/measure?key=BCRegistriesPayment&metric=lines&template=FLAT)](https://sonarqube-l4ygcl-tools.pathfinder.gov.bc.ca/dashboard?id=BCRegistriesPayment)
7+
BC Registries BCOL payment service.
58

6-
# BC Registries Payment System
79

8-
## Technology Stack Used
9-
* Python, Flask
10-
* Postgres - SQLAlchemy, psycopg2-binary & alembic
10+
## Development Environment
1111

12-
## Third-Party Products/Libraries used and the the License they are covert by
12+
Follow the instructions of the [Development Readme](https://github.com/bcgov/entity/blob/master/docs/development.md)
13+
to setup your local development environment.
1314

14-
## Project Status
15+
## Development Setup
1516

16-
## Documentation
17+
1. Follow the [instructions](https://github.com/bcgov/entity/blob/master/docs/setup-forking-workflow.md) to checkout the project from GitHub.
18+
2. Open the bcol-api directory in VS Code to treat it as a project (or WSL projec). To prevent version clashes, set up a
19+
virtual environment to install the Python packages used by this project.
20+
3. Run `make setup` to set up the virtual environment and install libraries.
21+
4. Next run `pip install .` to set up the environment for running tests.
1722

18-
GitHub Pages (https://guides.github.com/features/pages/) are a neat way to document you application/project.
23+
You also need to set up the variables used for environment-specific settings:
24+
1. Copy the [dotenv template file](./docs/dotenv_template) to somewhere above the source code and rename to `.env`. You will need to fill in missing values.
1925

20-
## Security
26+
## Running BCOL-API
2127

22-
Future - BCGov Keycloak
28+
1. Start the flask server with `(python -m flask run -p 5000)`
29+
2. View the [OpenAPI Docs](http://127.0.0.1:5000/api/v1).
2330

24-
Current - JWT hack
31+
## Running Liniting
2532

26-
## Files in this repository
33+
1. Run `make flake8` or `flake8 src/bcol_api tests`.
34+
2. Run `make pylint` or `pylint --rcfile=setup.cfg --disable=C0301,W0511 src/bcol_api test`
2735

28-
```
29-
docs/ - Project Documentation
30-
└── images
31-
└── icons
36+
## Running Unit Tests
3237

33-
openshift/ - OpenShift-specific files
34-
├── scripts - helper scripts
35-
└── templates - application templates
36-
```
38+
1. Tests are run from the Status bar at the bottom of the workbench in VS Code or `pytest` command.
39+
2. Next run `make coverage` to generate the coverage report, which appears in the *htmlcov* directory.
3740

38-
## Deployment (Local Development)
41+
## Openshift Environment
3942

40-
* Developer Workstation Requirements/Setup
41-
* Application Specific Setup
42-
43-
## Deployment (OpenShift)
44-
45-
See (openshift/Readme.md)
46-
47-
## Getting Help or Reporting an Issue
48-
49-
To report bugs/issues/feature requests, please file an [issue](../../issues).
50-
51-
52-
## Code standards
53-
54-
Refer [checklist](https://github.com/bcgov/sbc-auth/wiki/API-code-review-checklist)
55-
56-
## How to Contribute
57-
58-
If you would like to contribute, please see our [CONTRIBUTING](./CONTRIBUTING.md) guidelines.
59-
60-
Please note that this project is released with a [Contributor Code of Conduct](./CODE_OF_CONDUCT.md).
61-
By participating in this project you agree to abide by its terms.
62-
63-
## License
64-
65-
Copyright 2018 Province of British Columbia
66-
67-
Licensed under the Apache License, Version 2.0 (the "License");
68-
you may not use this file except in compliance with the License.
69-
You may obtain a copy of the License at
70-
71-
http://www.apache.org/licenses/LICENSE-2.0
72-
73-
Unless required by applicable law or agreed to in writing, software
74-
distributed under the License is distributed on an "AS IS" BASIS,
75-
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
76-
See the License for the specific language governing permissions and
77-
limitations under the License.
43+
View the [document](https://github.com/bcgov/sbc-auth/blob/development/docs/build-deploy.md).

bcol-api/docs/dotenv_template

+46
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
#
2+
# This file contains the environment-specific settings that are read by python-dotenv. Place it somewhere above your
3+
# source code and it will be used.
4+
#
5+
6+
# ===== bcol-api ======================================================================================================
7+
8+
# Flask settings
9+
PYTHONWARNINGS="once"
10+
FLASK_APP=wsgi.py
11+
FLASK_ENV="development"
12+
FLASK_DEBUG=True
13+
POD_TESTING=True
14+
SQLALCHEMY_ECHO=False
15+
16+
# The sentry.io Data Source Name for the project. For local development this should always be blank, to prevent the
17+
# logging (and emailing) of errors. However it can be temporarily set when working with sentry itself.
18+
#
19+
SENTRY_DSN=
20+
21+
# keycloak settings
22+
JWT_OIDC_ISSUER=
23+
JWT_OIDC_WELL_KNOWN_CONFIG=
24+
JWT_OIDC_ALGORITHMS=
25+
JWT_OIDC_AUDIENCE=
26+
JWT_OIDC_CLIENT_SECRET=
27+
JWT_OIDC_JWKS_CACHE_TIMEOUT=
28+
29+
KEYCLOAK_ADMIN_CLIENTID='
30+
KEYCLOAK_ADMIN_SECRET=
31+
KEYCLOAK_AUTH_AUDIENCE=
32+
KEYCLOAK_AUTH_CLIENT_SECRET=
33+
KEYCLOAK_BASE_URL=
34+
KEYCLOAK_REALMNAME=
35+
36+
#application settings
37+
BCOL_VERIFY_USER_WSDL_URL=
38+
BCOL_QUERY_PROFILE_WSDL_URL=
39+
BCOL_DEBIT_ACCOUNT_VERSION=
40+
BCOL_LINK_CODE=
41+
BCOL_LDAP_USER_DN_PATTERN=
42+
BCOL_LDAP_SERVER=
43+
BCOL_PAYMENTS_WSDL_URL=
44+
45+
46+

browserstack-logo-white-small.png

3.33 KB
Loading

docker/docker-compose.yml

+55
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
version: "3.1"
2+
3+
services:
4+
####################### AUTH Database Definition #######################
5+
paydb:
6+
image: postgres:11
7+
restart: always
8+
environment:
9+
POSTGRES_DB: postgres
10+
POSTGRES_PASSWORD: postgres
11+
ports:
12+
- "54332:5432"
13+
volumes:
14+
- db-data:/var/lib/postgresql/data2
15+
16+
####################### AUTH Unit Test Database Definition #######################
17+
paydb-test:
18+
image: postgres:11
19+
restart: always
20+
environment:
21+
POSTGRES_DB: postgres
22+
POSTGRES_PASSWORD: postgres
23+
ports:
24+
- "54333:5432"
25+
volumes:
26+
- db-data:/var/lib/postgresql/data3
27+
28+
#################### Jaeger Tracing Service Definition ####################
29+
jaeger:
30+
image: jaegertracing/all-in-one
31+
restart: always
32+
ports:
33+
- "16686:16686"
34+
- "5775:5775/udp"
35+
- "6831:6831/udp"
36+
- "6832:6832/udp"
37+
38+
#################### Nats Service Definition ####################
39+
nats:
40+
image: nats-streaming
41+
restart: always
42+
mem_limit: 512m
43+
expose:
44+
- 4222
45+
- 8222
46+
labels:
47+
- entity.services=nats
48+
ports:
49+
- 4222:4222
50+
- 8222:8222
51+
tty: true
52+
53+
volumes:
54+
db-data:
55+
driver: local

0 commit comments

Comments
 (0)