-
Notifications
You must be signed in to change notification settings - Fork 0
Dev -> main #89
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
base: main
Are you sure you want to change the base?
Dev -> main #89
Changes from 250 commits
a31064d
4d4f951
ffdb806
613d542
d032588
37eedb4
3c4a14c
7711e46
3a63572
89bfed4
5697df2
ab258d3
cdcd590
ae7729f
251c52e
2ff3dd7
c31a00b
49f770b
be2820c
2611037
bbeb310
b06976c
d375258
c3afe35
140259e
461b071
6f99880
59da2ec
c3db34f
d808e68
dfb2658
1dbdf61
08899f3
814d64c
33937b6
94682d5
1939f6f
eefd51e
da8c6a0
e2c28e4
69f83f5
86e91a2
5f233b3
ea61abe
23d9f67
6efe7e4
d27087b
527b498
23828c8
3369e36
c7f5480
734d659
235489a
cd7b9c4
82c1bf4
6fdb8f6
31804c4
819abea
0d8846f
9f86a84
bb1c761
566502e
a717d8c
95edb93
e238b57
1b5247e
0c2ba9f
4ae4d10
c5dd55a
ab226ba
76b466b
e7f37e2
7e51cc7
8c8ab90
578016a
48aafdc
3b70b50
b779272
68ff4e3
51feb33
d4669ec
7e61f3d
88c7bea
fb90a57
938e7c9
cdd1f73
ea3ab99
239cd28
2257688
fbecb39
22b78db
9185295
7c9483d
88d09ff
23390e3
a8de5ca
6f1f950
3c15d77
778ed69
a2ba5da
98f1d82
34b68f8
4fe7bba
57da50f
876a712
a88c3ed
99682da
36604e9
4b86935
e695012
c6c8b27
d52160b
bb63a79
1408581
9636456
9d65cfb
303e860
c5929ad
9f9c4d8
07a9f21
2406f52
b723515
ac140ea
48a0bc2
cef52ad
42cba5b
dfc62a2
72c24be
6018172
ed1f920
5e41759
5d660fc
e63cb54
a4c2589
91da988
07f1c62
a1ea9e9
623fc48
0ee7b3d
e78bcd9
63a85f0
15ba094
a9c6922
02a3383
82c81c5
44e0e38
20f871e
1a96c3f
dfa7c76
7bd3ab3
a3978d8
7ccd5eb
94bf1e8
8b2a160
d688f0f
c7fa558
bc3ccf5
c5b9d24
09d4594
700a538
482f8c7
768e453
087d462
6a4907e
6aaae06
13a9b9f
74c0e35
24a5dfd
fe97729
bf4c280
79cc8d8
ebb7f6a
3c8bb8a
b24c327
69a6b37
378ea96
41fdf96
e651c61
2e193ab
5061ac0
504efcc
a4ded25
4a9a375
b78a6d0
707b33f
27cc912
f2684cf
18e01d2
7f60e0f
5a20bba
3f2ba37
8bcab7a
9f9f2da
98e8df1
bc6a349
23a1b02
114a7cc
0feae39
c10ed44
2fd8090
6295826
19cbea7
4ef2ded
52d67fd
ae3cf22
be9cedd
065f6e8
9bf1618
b9c452a
db66701
c2d8990
74921a0
f80a556
9cde009
d4cab01
cc52533
73dd6b8
e3c1086
3f582dd
ada58a8
cf1f05f
aeeb3e9
8de6a3d
1121bb0
9fac5e0
cd4b50e
bca26f1
88004f3
2a71801
13e4e01
de462be
1efbf67
7ce5c69
02d36ea
629360c
e78e93f
6d9bcae
dbe0f0f
1f50f72
922ccec
7930c59
3052abf
38ba006
f4261a9
f24fda1
ec436e4
a02ef39
3fb8d1a
9ea7e9d
5ea40f6
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,51 @@ | ||
| name: Prod deploy to EC2 on Push | ||
|
|
||
| on: | ||
| push: | ||
| branches: [prod] | ||
|
|
||
| env: | ||
| AWS_REGION: "us-east-1" | ||
|
|
||
| # Permission can be added at job level or workflow level | ||
| permissions: | ||
| id-token: write # This is required for requesting the JWT | ||
| contents: read # This is required for actions/checkout | ||
| jobs: | ||
| DeployToCodeDeploy: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Git clone the repository | ||
| uses: actions/checkout@v3 | ||
|
|
||
| - name: Configure AWS credentials | ||
| uses: aws-actions/configure-aws-credentials@v1.7.0 | ||
| with: | ||
| role-to-assume: arn:aws:iam::471112976510:role/GitHubAction-AssumeRoleWithAction | ||
| role-session-name: GitHub_to_AWS_via_FederatedOIDC | ||
| aws-region: ${{ env.AWS_REGION }} | ||
|
|
||
| # - name: Generate appspec.yml for prod | ||
| # run: cp appspec.yml appspec.yml | ||
|
|
||
| - name: Set environment variables | ||
| id: vars | ||
| run: | | ||
| echo "DATETIME=$(date +'%Y-%m-%d_%H-%M-%S')" >> $GITHUB_ENV | ||
| echo "FILENAME=django-indexer-prod-${DATETIME}.zip" >> $GITHUB_ENV | ||
| echo "S3_BUCKET=django-indexer-prod" >> $GITHUB_ENV | ||
|
|
||
| - name: Create zip of repository | ||
| run: zip -r "${{ env.FILENAME }}" . | ||
|
|
||
| - name: Upload repository to S3 | ||
| run: aws s3 cp "${{ env.FILENAME }}" "s3://${{ env.S3_BUCKET }}/" | ||
|
|
||
| - name: Create CodeDeploy Deployment | ||
| id: deploy | ||
| run: | | ||
| aws deploy create-deployment \ | ||
| --application-name django-indexer \ | ||
| --deployment-group-name django-indexer-prod \ | ||
| --deployment-config-name CodeDeployDefault.AllAtOnce \ | ||
| --s3-location bucket=${{ env.S3_BUCKET }},bundleType=zip,key=${{ env.FILENAME }} | ||
| Original file line number | Diff line number | Diff line change | ||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -3,19 +3,26 @@ | |||||||||||||||||
| - [Steps to run:](#steps-to-run) | ||||||||||||||||||
| - [Env vars example](#env-vars-example) | ||||||||||||||||||
| - [API Basics](#api-basics) | ||||||||||||||||||
| - [Base URL](#base-url) | ||||||||||||||||||
| - [Authorization](#authorization) | ||||||||||||||||||
| - [Error Responses](#error-responses) | ||||||||||||||||||
| - [Pagination](#pagination) | ||||||||||||||||||
| - [Base URL](#base-url) | ||||||||||||||||||
| - [Authorization](#authorization) | ||||||||||||||||||
| - [Error Responses](#error-responses) | ||||||||||||||||||
| - [Pagination](#pagination) | ||||||||||||||||||
| - [API Endpoints](#api-endpoints) | ||||||||||||||||||
| - [`Account` endpoints](#account-endpoints) | ||||||||||||||||||
| - [✅ Get all accounts: `GET /accounts` (paginated)](#-get-all-accounts-get-accounts-paginated) | ||||||||||||||||||
| - [✅ Get account by ID (address): `GET /accounts/{ACCOUNT_ID}`](#-get-account-by-id-address-get-accountsaccount_id) | ||||||||||||||||||
| - [✅ Get donations received for account: `GET /accounts/{ACCOUNT_ID}/donations_received` (paginated)](#-get-donations-received-for-account-get-accountsaccount_iddonations_received-paginated) | ||||||||||||||||||
| - [✅ Get donations sent for account: `GET /accounts/{ACCOUNT_ID}/donations_sent` (paginated)](#-get-donations-sent-for-account-get-accountsaccount_iddonations_sent-paginated) | ||||||||||||||||||
| - [✅ Get pots for account: `GET /accounts/{ACCOUNT_ID}/active_pots` (paginated)](#-get-pots-for-account-get-accountsaccount_idactive_pots-paginated) | ||||||||||||||||||
| - [✅ Get applications for account: `GET /accounts/{ACCOUNT_ID}/pot_applications` (paginated)](#-get-applications-for-account-get-accountsaccount_idpot_applications-paginated) | ||||||||||||||||||
| - [✅ Get registrations to lists by account: `GET /accounts/{ACCOUNT_ID}/list-registrations` (paginated)](#-get-registrations-to-lists-by-account-get-accountsaccount_idlist-registrations-paginated) | ||||||||||||||||||
| - [`List` endpoints](#list-endpoints) | ||||||||||||||||||
| - [✅ Get all lists: `GET /lists` (paginated)](#-get-all-lists-get-lists-paginated) | ||||||||||||||||||
| - [✅ Get list by ID: `GET /lists/{LIST_ID}` (paginated)](#-get-list-by-id-get-listslist_id-paginated) | ||||||||||||||||||
| - [✅ Get registrations for list: `GET /lists/{LIST_ID}/registrations` (paginated)](#-get-registrations-for-list-get-listslist_idregistrations-paginated) | ||||||||||||||||||
| - [✅ Get random registration for list: `GET /lists/{LIST_ID}/random_registration`](#-get-random-registration-for-list-get-listslist_idrandom_registration) | ||||||||||||||||||
| - [Donate Contract Config endpoint](#donate-contract-config-endpoint) | ||||||||||||||||||
| - [✅ Get donate contract config: `GET /donate_contract_config`](#-get-donate-contract-config-get-donate_contract_config) | ||||||||||||||||||
| - [`Donors` endpoints](#donors-endpoints) | ||||||||||||||||||
| - [✅ Get all donors: `GET /donors` (paginated)](#-get-all-donors-get-donors-paginated) | ||||||||||||||||||
| - [`Pots` endpoints](#pots-endpoints) | ||||||||||||||||||
|
|
@@ -85,7 +92,7 @@ export PL_SENTRY_DSN= | |||||||||||||||||
|
|
||||||||||||||||||
| This is a public, read-only API and as such does not currently implement authentication or authorization. | ||||||||||||||||||
|
|
||||||||||||||||||
| Rate limits of 100 requests/min are enforced to ensure service for all users. | ||||||||||||||||||
| Rate limits of 500 requests/min are enforced to ensure service for all users. | ||||||||||||||||||
|
|
||||||||||||||||||
| #### Error Responses | ||||||||||||||||||
|
|
||||||||||||||||||
|
|
@@ -102,7 +109,7 @@ Possible Error Codes: | |||||||||||||||||
|
|
||||||||||||||||||
| #### Pagination | ||||||||||||||||||
|
|
||||||||||||||||||
| Pagination available using `limit` and `offset` query params on endpoints that specify `paginated`. Default `limit` is 30. | ||||||||||||||||||
| Pagination available using `page` and `page_size` as query param on endpoints that specify `paginated`. Default `page_size` is 30. | ||||||||||||||||||
|
|
||||||||||||||||||
| Endpoints that support pagination will return a success response containing the following: | ||||||||||||||||||
|
|
||||||||||||||||||
|
|
@@ -121,10 +128,31 @@ _NB: These endpoints are what is required to integrate with BOS app & replace cu | |||||||||||||||||
|
|
||||||||||||||||||
| #### ✅ Get account by ID (address): `GET /accounts/{ACCOUNT_ID}` | ||||||||||||||||||
|
|
||||||||||||||||||
| #### ✅ Get donations received for account: `GET /accounts/{ACCOUNT_ID}/donations_received` (paginated) | ||||||||||||||||||
|
|
||||||||||||||||||
| #### ✅ Get donations sent for account: `GET /accounts/{ACCOUNT_ID}/donations_sent` (paginated) | ||||||||||||||||||
|
|
||||||||||||||||||
| #### ✅ Get pots for account: `GET /accounts/{ACCOUNT_ID}/active_pots` (paginated) | ||||||||||||||||||
|
|
||||||||||||||||||
| Can specify `status=live` query param to retrieve only pots that are currently active (live matching round) | ||||||||||||||||||
|
|
||||||||||||||||||
| #### ✅ Get applications for account: `GET /accounts/{ACCOUNT_ID}/pot_applications` (paginated) | ||||||||||||||||||
|
|
||||||||||||||||||
| Can specify `status={PotApplicationStatus}` query param to retrieve applications with a given status: | ||||||||||||||||||
|
|
||||||||||||||||||
| ```py | ||||||||||||||||||
| enum PotApplicationStatus { | ||||||||||||||||||
| Pending, | ||||||||||||||||||
| Approved, | ||||||||||||||||||
| Rejected, | ||||||||||||||||||
| InReview, | ||||||||||||||||||
| } | ||||||||||||||||||
| ``` | ||||||||||||||||||
|
Comment on lines
+143
to
+150
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Invalid syntax in enum example — use a language-agnostic or correct format.
Proposed fix-```py
-enum PotApplicationStatus {
- Pending,
- Approved,
- Rejected,
- InReview,
-}
-```
+```
+PotApplicationStatus:
+ - Pending
+ - Approved
+ - Rejected
+ - InReview
+```📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||
|
|
||||||||||||||||||
| #### ✅ Get registrations to lists by account: `GET /accounts/{ACCOUNT_ID}/list-registrations` (paginated) | ||||||||||||||||||
|
|
||||||||||||||||||
| Can specify status to filter by using `status` query param if desired, e.g. `status=Approved` | ||||||||||||||||||
|
|
||||||||||||||||||
| ### `List` endpoints | ||||||||||||||||||
|
|
||||||||||||||||||
| #### ✅ Get all lists: `GET /lists` (paginated) | ||||||||||||||||||
|
|
@@ -134,6 +162,15 @@ Can specify `status=live` query param to retrieve only pots that are currently a | |||||||||||||||||
| #### ✅ Get registrations for list: `GET /lists/{LIST_ID}/registrations` (paginated) | ||||||||||||||||||
|
|
||||||||||||||||||
| Can specify status to filter by using `status` query param if desired, e.g. `status=Approved` | ||||||||||||||||||
| Can also specify project category to filter by using `category` query param if desired, e.g. `category=Education` | ||||||||||||||||||
|
|
||||||||||||||||||
| #### ✅ Get random registration for list: `GET /lists/{LIST_ID}/random_registration` | ||||||||||||||||||
|
|
||||||||||||||||||
| Can specify status to filter by using `status` query param if desired, e.g. `status=Approved` | ||||||||||||||||||
|
|
||||||||||||||||||
| ### Donate Contract Config endpoint | ||||||||||||||||||
|
|
||||||||||||||||||
| #### ✅ Get donate contract config: `GET /donate_contract_config` | ||||||||||||||||||
|
|
||||||||||||||||||
| ### `Donors` endpoints | ||||||||||||||||||
|
|
||||||||||||||||||
|
|
||||||||||||||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -11,6 +11,7 @@ class AccountAdmin(admin.ModelAdmin): | |
| "total_donations_out_usd", | ||
| "total_matching_pool_allocations_usd", | ||
| "donors_count", | ||
| "near_social_profile_data", | ||
| ) | ||
| search_fields = ("id",) # Allow searching by account address | ||
| list_filter = ( | ||
|
|
@@ -42,11 +43,11 @@ def total_matching_pool_allocations_usd_display(self, obj): | |
| "Total Matching Pool Allocations (USD)" | ||
| ) | ||
|
|
||
| def has_add_permission(self, request): | ||
| return False | ||
| # def has_add_permission(self, request): | ||
| # return False | ||
|
|
||
| def has_change_permission(self, request, obj=None): | ||
| return False | ||
| # def has_change_permission(self, request, obj=None): | ||
| # return False | ||
|
|
||
| def has_delete_permission(self, request, obj=None): | ||
| return False | ||
| # def has_delete_permission(self, request, obj=None): | ||
| # return False | ||
|
Comment on lines
+46
to
+53
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Security concern: Permission methods have been commented out. Commenting out these permission methods changes the default behavior from denying all add/change/delete operations to allowing them based on standard Django permissions. This could potentially allow unintended modifications to Account records. If this is intentional, consider:
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Update GitHub Actions checkout version.
The
actions/checkout@v3version is outdated as flagged by static analysis. Update to a newer version to ensure compatibility with the latest GitHub Actions runner.📝 Committable suggestion
🧰 Tools
🪛 actionlint (1.7.4)
19-19: the runner of "actions/checkout@v3" action is too old to run on GitHub Actions. update the action's version to fix this issue
(action)