Skip to content

Commit ea2931d

Browse files
committed
chore: add initial plugin folder structure
1 parent b2187a4 commit ea2931d

66 files changed

Lines changed: 3655 additions & 0 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.annotation_safe_list.yml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
# This is a Code Annotations automatically-generated Django model safelist file.
2+
# These models must be annotated as follows in order to be counted in the coverage report.
3+
# See https://code-annotations.readthedocs.io/en/latest/safelist.html for more information.
4+
#
5+
# fake_app_1.FakeModelName:
6+
# ".. no_pii:": "This model has no PII"
7+
# fake_app_2.FakeModel2:
8+
# ".. choice_annotation:": foo, bar, baz
9+
10+
admin.LogEntry:
11+
".. no_pii:": "This model has no PII"
12+
auth.Group:
13+
".. no_pii:": "This model has no PII"
14+
auth.Permission:
15+
".. no_pii:": "This model has no PII"
16+
auth.User:
17+
".. pii": "This model minimally contains a username, password, and email"
18+
".. pii_types": "username, email_address, password"
19+
".. pii_retirement": "consumer_api"
20+
contenttypes.ContentType:
21+
".. no_pii:": "This model has no PII"
22+
sessions.Session:
23+
".. no_pii:": "This model has no PII"
24+
social_django.Association:
25+
".. no_pii:": "This model has no PII"
26+
social_django.Code:
27+
".. pii:": "Email address"
28+
".. pii_types:": other
29+
".. pii_retirement:": local_api
30+
social_django.Nonce:
31+
".. no_pii:": "This model has no PII"
32+
social_django.Partial:
33+
".. no_pii:": "This model has no PII"
34+
social_django.UserSocialAuth:
35+
".. no_pii:": "This model has no PII"
36+
waffle.Flag:
37+
".. no_pii:": "This model has no PII"
38+
waffle.Sample:
39+
".. no_pii:": "This model has no PII"
40+
waffle.Switch:
41+
".. no_pii:": "This model has no PII"

.coveragerc

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
[run]
2+
branch = True
3+
data_file = .coverage
4+
source=openedx_authz
5+
omit =
6+
test_settings.py
7+
*/migrations/*
8+
*admin.py
9+
*/static/*
10+
*/templates/*

.editorconfig

Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
# ***************************
2+
# ** DO NOT EDIT THIS FILE **
3+
# ***************************
4+
#
5+
# This file was generated by edx-lint: https://github.com/openedx/edx-lint
6+
#
7+
# If you want to change this file, you have two choices, depending on whether
8+
# you want to make a local change that applies only to this repo, or whether
9+
# you want to make a central change that applies to all repos using edx-lint.
10+
#
11+
# Note: If your .editorconfig file is simply out-of-date relative to the latest
12+
# .editorconfig in edx-lint, ensure you have the latest edx-lint installed
13+
# and then follow the steps for a "LOCAL CHANGE".
14+
#
15+
# LOCAL CHANGE:
16+
#
17+
# 1. Edit the local .editorconfig_tweaks file to add changes just to this
18+
# repo's file.
19+
#
20+
# 2. Run:
21+
#
22+
# $ edx_lint write .editorconfig
23+
#
24+
# 3. This will modify the local file. Submit a pull request to get it
25+
# checked in so that others will benefit.
26+
#
27+
#
28+
# CENTRAL CHANGE:
29+
#
30+
# 1. Edit the .editorconfig file in the edx-lint repo at
31+
# https://github.com/openedx/edx-lint/blob/master/edx_lint/files/.editorconfig
32+
#
33+
# 2. install the updated version of edx-lint (in edx-lint):
34+
#
35+
# $ pip install .
36+
#
37+
# 3. Run (in edx-lint):
38+
#
39+
# $ edx_lint write .editorconfig
40+
#
41+
# 4. Make a new version of edx_lint, submit and review a pull request with the
42+
# .editorconfig update, and after merging, update the edx-lint version and
43+
# publish the new version.
44+
#
45+
# 5. In your local repo, install the newer version of edx-lint.
46+
#
47+
# 6. Run:
48+
#
49+
# $ edx_lint write .editorconfig
50+
#
51+
# 7. This will modify the local file. Submit a pull request to get it
52+
# checked in so that others will benefit.
53+
#
54+
#
55+
#
56+
#
57+
#
58+
# STAY AWAY FROM THIS FILE!
59+
#
60+
#
61+
#
62+
#
63+
#
64+
# SERIOUSLY.
65+
#
66+
# ------------------------------
67+
# Generated by edx-lint version: 5.2.5
68+
# ------------------------------
69+
[*]
70+
end_of_line = lf
71+
insert_final_newline = true
72+
charset = utf-8
73+
indent_style = space
74+
indent_size = 4
75+
max_line_length = 120
76+
trim_trailing_whitespace = true
77+
78+
[{Makefile, *.mk}]
79+
indent_style = tab
80+
indent_size = 8
81+
82+
[*.{yml,yaml,json}]
83+
indent_size = 2
84+
85+
[*.js]
86+
indent_size = 2
87+
88+
[*.diff]
89+
trim_trailing_whitespace = false
90+
91+
[.git/*]
92+
trim_trailing_whitespace = false
93+
94+
[COMMIT_EDITMSG]
95+
max_line_length = 72
96+
97+
[*.rst]
98+
max_line_length = 79
99+
100+
# f2f02689fced7a2e0c62c2f9803184114dc2ae4b

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
2+
**Merge checklist:**
3+
Check off if complete *or* not applicable:
4+
- [ ] Version bumped
5+
- [ ] Changelog record added
6+
- [ ] Documentation updated (not only docstrings)
7+
- [ ] Fixup commits are squashed away
8+
- [ ] Unit tests added/updated
9+
- [ ] Manual testing instructions provided
10+
- [ ] Noted any: Concerns, dependencies, migration issues, deadlines, tickets

.github/dependabot.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
version: 2
2+
updates:
3+
# Adding new check for github-actions
4+
- package-ecosystem: "github-actions"
5+
directory: "/"
6+
schedule:
7+
interval: "weekly"
8+
# reviewers:
9+
# - "openedx/arbi-bom"

.github/workflows/ci.yml

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
name: Python CI
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches:
8+
- "**"
9+
10+
jobs:
11+
run_tests:
12+
name: tests
13+
runs-on: ${{ matrix.os }}
14+
strategy:
15+
matrix:
16+
os: [ubuntu-latest]
17+
python-version: ["3.12"]
18+
toxenv: [quality, docs, pii_check, django42, django52]
19+
steps:
20+
- uses: actions/checkout@v4
21+
- name: setup python
22+
uses: actions/setup-python@v5
23+
with:
24+
python-version: ${{ matrix.python-version }}
25+
26+
- name: Install pip
27+
run: pip install -r requirements/pip.txt
28+
29+
- name: Install Dependencies
30+
run: pip install -r requirements/ci.txt
31+
32+
- name: Run Tests
33+
env:
34+
TOXENV: ${{ matrix.toxenv }}
35+
run: tox
36+
37+
- name: Run coverage
38+
if: matrix.python-version == '3.12' && matrix.toxenv == 'django42'
39+
uses: codecov/codecov-action@v4
40+
with:
41+
token: ${{ secrets.CODECOV_TOKEN }}
42+
flags: unittests
43+
fail_ci_if_error: true

.github/workflows/pypi-publish.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: Publish package to PyPi
2+
3+
on:
4+
release:
5+
types: [published]
6+
7+
jobs:
8+
push:
9+
runs-on: ubuntu-latest
10+
11+
steps:
12+
- name: Checkout
13+
uses: actions/checkout@v4
14+
- name: setup python
15+
uses: actions/setup-python@v5
16+
with:
17+
python-version: 3.12
18+
19+
- name: Install pip
20+
run: pip install -r requirements/pip.txt
21+
22+
- name: Build package
23+
run: python setup.py sdist bdist_wheel
24+
25+
- name: Publish to PyPi
26+
uses: pypa/gh-action-pypi-publish@release/v1
27+
with:
28+
user: __token__
29+
password: ${{ secrets.PYPI_UPLOAD_TOKEN }}
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: Upgrade Python Requirements
2+
3+
on:
4+
schedule:
5+
- cron: "0 0 * * 1"
6+
workflow_dispatch:
7+
inputs:
8+
branch:
9+
description: "Target branch against which to create requirements PR"
10+
required: true
11+
default: 'main'
12+
13+
jobs:
14+
call-upgrade-python-requirements-workflow:
15+
uses: openedx/.github/.github/workflows/upgrade-python-requirements.yml@master
16+
with:
17+
branch: ${{ github.event.inputs.branch || 'main' }}
18+
# optional parameters below; fill in if you'd like github or email notifications
19+
# user_reviewers: ""
20+
# team_reviewers: ""
21+
# email_address: ""
22+
# send_success_notification: false
23+
secrets:
24+
requirements_bot_github_token: ${{ secrets.REQUIREMENTS_BOT_GITHUB_TOKEN }}
25+
requirements_bot_github_email: ${{ secrets.REQUIREMENTS_BOT_GITHUB_EMAIL }}
26+
edx_smtp_username: ${{ secrets.EDX_SMTP_USERNAME }}
27+
edx_smtp_password: ${{ secrets.EDX_SMTP_PASSWORD }}

.gitignore

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
*.py[cod]
2+
__pycache__
3+
.pytest_cache
4+
5+
# C extensions
6+
*.so
7+
8+
# Packages
9+
*.egg
10+
*.egg-info
11+
/dist
12+
/build
13+
/eggs
14+
/parts
15+
/bin
16+
/var
17+
/sdist
18+
/develop-eggs
19+
/.installed.cfg
20+
/lib
21+
/lib64
22+
23+
# Installer logs
24+
pip-log.txt
25+
26+
# Unit test / coverage reports
27+
.cache/
28+
.pytest_cache/
29+
.coverage
30+
.coverage.*
31+
.tox
32+
coverage.xml
33+
htmlcov/
34+
35+
# Virtual environments
36+
/venv/
37+
/venv-*/
38+
/.venv/
39+
/.venv-*/
40+
41+
# The Silver Searcher
42+
.agignore
43+
44+
# OS X artifacts
45+
*.DS_Store
46+
47+
# Logging
48+
log/
49+
logs/
50+
chromedriver.log
51+
ghostdriver.log
52+
53+
# Complexity
54+
output/*.html
55+
output/*/index.html
56+
57+
# Sphinx
58+
docs/_build
59+
docs/modules.rst
60+
docs/openedx_authz.rst
61+
docs/openedx_authz.*.rst
62+
63+
# Private requirements
64+
requirements/private.in
65+
requirements/private.txt

.pii_annotations.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
source_path: ./
2+
report_path: pii_report
3+
safelist_path: .annotation_safe_list.yml
4+
coverage_target: 100.0
5+
annotations:
6+
".. no_pii:":
7+
"pii_group":
8+
- ".. pii:":
9+
- ".. pii_types:":
10+
choices:
11+
- id # Unique identifier for the user which is shared across systems
12+
- name # Used for any part of the user's name
13+
- username
14+
- password
15+
- location # Used for any part of any type address or country stored
16+
- phone_number # Used for phone or fax numbers
17+
- email_address
18+
- birth_date # Used for any part of a stored birth date
19+
- ip # IP address
20+
- external_service # Used for external service ids or links such as social media links or usernames, website links, etc.
21+
- biography # Any type of free-form biography field
22+
- gender
23+
- sex
24+
- image
25+
- video
26+
- other
27+
- ".. pii_retirement:":
28+
choices:
29+
- retained # Intentionally kept for legal reasons
30+
- local_api # An API exists in this repository for retiring this information
31+
- consumer_api # The data's consumer must implement an API for retiring this information
32+
- third_party # A third party API exists to retire this data
33+
extensions:
34+
python:
35+
- py

0 commit comments

Comments
 (0)