Skip to content

updated to version 0.5.10 #31

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

Open
wants to merge 231 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
231 commits
Select commit Hold shift + click to select a range
0f346b2
Completed CRUD test of StripePackage
Zuiluj Jan 17, 2022
82d7445
Merge branch 'feature/api_tests' of personal:capless/pfunk into featu…
Zuiluj Jan 17, 2022
5a6d5de
Finished stripe unittests
Zuiluj Jan 19, 2022
593f526
added partial stripe webhook views
Zuiluj Jan 20, 2022
d28632a
Finished refactoring stripe views and unittests
Zuiluj Jan 21, 2022
52fe075
added partially working swagger generation
Zuiluj Jan 27, 2022
17dcc3a
Removed description field in StripeCustomer model. Fixed unittests
Zuiluj Jan 31, 2022
0ff6fa0
added partially working swagger generation
Zuiluj Jan 27, 2022
f772a48
Merge branch 'feature/swagger' of personal:capless/pfunk into feature…
Zuiluj Jan 31, 2022
b464eca
Reworked the acquisition of views in generate_swagger to acquire need…
Zuiluj Feb 2, 2022
f1fd103
updated to version 0.5.10
bjinwright Feb 7, 2022
e315ddf
Added response handling in generate_swagger doc method
Zuiluj Feb 7, 2022
8a0913c
Optimized code. Fixed API methods not valid in swagger yaml.
Zuiluj Feb 8, 2022
75455dc
Added acquisition of config info from json config file
Zuiluj Feb 11, 2022
de8cae6
Added generation of yaml file. Configured unittests for project
Zuiluj Feb 11, 2022
79f9514
Added additional CLI init args. Added checking of existing swagger ya…
Zuiluj Feb 15, 2022
eced2e7
removed commented out debugs
Zuiluj Feb 15, 2022
22e2e3b
Merge branch 'feature/api' into feature/swagger
Zuiluj Feb 15, 2022
7a1d609
Added a method to acquire a Rule's arguments even if it is defined as…
Zuiluj Feb 24, 2022
a0f4d13
Added iteration through every collection to create definition for swa…
Zuiluj Mar 2, 2022
8830266
Added GRAPHQL_TO_YAML_TYPES dict for easy conversion between the two
Zuiluj Mar 2, 2022
ca9cfd0
Fixed usage of Parameter class not having the _type field
Zuiluj Mar 4, 2022
3fb0680
Fixed Definition not return correct class name. Fixed _type in parame…
Zuiluj Mar 9, 2022
1a7452b
Fixed url params to have a swagger-specific syntax. Added ability to …
Zuiluj Mar 10, 2022
7044a79
Cleaned using autopep8
Zuiluj Mar 10, 2022
51db0fd
Moved entirety of swagger generator to a separate class
Zuiluj Mar 17, 2022
f2fe931
removed comment blocks in unit tests
Zuiluj Mar 28, 2022
f88dd7c
Added more docstrings for swagger generation future
Zuiluj Mar 29, 2022
74c8efd
Merge pull request #30 from capless/feature/swagger
bjinwright Apr 1, 2022
726e9c7
merged in develop
bjinwright Apr 1, 2022
3f7c64b
Added aws.py as a skeleton for upcoming AWS features
Zuiluj Apr 5, 2022
25e0158
Added skeleton tests for aws features
Zuiluj Apr 5, 2022
5624739
Added yaml validator and have it return specific errors
Zuiluj Apr 7, 2022
ec8afcb
Made yaml validation to properly separate openapi errors and python e…
Zuiluj Apr 11, 2022
18bcf5b
Refactored default dir of swagger file. Refactored unit tests for AWS…
Zuiluj Apr 11, 2022
8bb1cd3
Finished create/update api from yaml. Added writing to config file if…
Zuiluj Apr 12, 2022
7107bbf
Reworked what exceptions does aws util react to. Added doc for aws ut…
Zuiluj Apr 13, 2022
a4736c4
Did cleaning up of swaggerdoc docstrings
Zuiluj Apr 27, 2022
d9ed6ca
added generate-swagger as a cli command, creates a swagger file from …
Zuiluj May 4, 2022
4f23b85
added environment variable references for ReferenceFields and ManytoM…
bjinwright May 10, 2022
9a12433
Fixed problems associated with subclassed User and Group collections …
bjinwright May 26, 2022
a5d9a1f
updated unit tests, merging develop in
bjinwright May 27, 2022
bba4f2b
added support for splitting the docs to get params of the view
Zuiluj Jun 2, 2022
680299a
switch acquiring of swagger docs for payload from docstrings to funct…
Zuiluj Jun 2, 2022
3843493
added ability to also detect model references from _payload_docs func…
Zuiluj Jun 3, 2022
8bd2a33
Updated the docstrings of _payload_docs
Zuiluj Jun 3, 2022
74d2e64
Updated the docstrings of _payload_docs
Zuiluj Jun 3, 2022
74c0566
updated swaggyp package
Zuiluj Jun 22, 2022
9f9c818
Fixed calling of view's _payload_docs to pass the correct argument. M…
Zuiluj Jun 23, 2022
7220df4
added some pep8 love and test fixes to the swagger code
bjinwright Jul 27, 2022
4817240
Merge pull request #37 from capless/feature/fix-auth-collections
Zuiluj Jul 27, 2022
830a5ca
Added aws.py as a skeleton for upcoming AWS features
Zuiluj Apr 5, 2022
5fbec38
Added skeleton tests for aws features
Zuiluj Apr 5, 2022
6c34dc5
Added yaml validator and have it return specific errors
Zuiluj Apr 7, 2022
0a959cb
Made yaml validation to properly separate openapi errors and python e…
Zuiluj Apr 11, 2022
882b54c
Refactored default dir of swagger file. Refactored unit tests for AWS…
Zuiluj Apr 11, 2022
eecacff
Finished create/update api from yaml. Added writing to config file if…
Zuiluj Apr 12, 2022
a4b9811
Reworked what exceptions does aws util react to. Added doc for aws ut…
Zuiluj Apr 13, 2022
4a751b6
Did cleaning up of swaggerdoc docstrings
Zuiluj Apr 27, 2022
d79a82a
added generate-swagger as a cli command, creates a swagger file from …
Zuiluj May 4, 2022
25aeaac
added support for splitting the docs to get params of the view
Zuiluj Jun 2, 2022
8d81f22
switch acquiring of swagger docs for payload from docstrings to funct…
Zuiluj Jun 2, 2022
7129fc3
added ability to also detect model references from _payload_docs func…
Zuiluj Jun 3, 2022
a007336
Updated the docstrings of _payload_docs
Zuiluj Jun 3, 2022
31dba3d
Updated the docstrings of _payload_docs
Zuiluj Jun 3, 2022
a2c4603
updated swaggyp package
Zuiluj Jun 22, 2022
3248622
Fixed calling of view's _payload_docs to pass the correct argument. M…
Zuiluj Jun 23, 2022
27cc81a
Merge branch 'feature/api_gateway_swagger' of christianllanillo:caple…
Zuiluj Jul 27, 2022
9536db1
Added aws.py as a skeleton for upcoming AWS features
Zuiluj Apr 5, 2022
9d9b0ac
Added skeleton tests for aws features
Zuiluj Apr 5, 2022
1d767ad
Added yaml validator and have it return specific errors
Zuiluj Apr 7, 2022
eb0cf78
Made yaml validation to properly separate openapi errors and python e…
Zuiluj Apr 11, 2022
0794d47
Refactored default dir of swagger file. Refactored unit tests for AWS…
Zuiluj Apr 11, 2022
d976d4e
Finished create/update api from yaml. Added writing to config file if…
Zuiluj Apr 12, 2022
b510112
Reworked what exceptions does aws util react to. Added doc for aws ut…
Zuiluj Apr 13, 2022
91e7bb3
Did cleaning up of swaggerdoc docstrings
Zuiluj Apr 27, 2022
c68975d
added generate-swagger as a cli command, creates a swagger file from …
Zuiluj May 4, 2022
40983c2
added support for splitting the docs to get params of the view
Zuiluj Jun 2, 2022
506cd85
switch acquiring of swagger docs for payload from docstrings to funct…
Zuiluj Jun 2, 2022
d30cd15
added ability to also detect model references from _payload_docs func…
Zuiluj Jun 3, 2022
8358812
Updated the docstrings of _payload_docs
Zuiluj Jun 3, 2022
3c2e122
Updated the docstrings of _payload_docs
Zuiluj Jun 3, 2022
0d0b24b
updated swaggyp package
Zuiluj Jun 22, 2022
39d50b8
Fixed calling of view's _payload_docs to pass the correct argument. M…
Zuiluj Jun 23, 2022
07d8f99
Merge branch 'feature/api_gateway_swagger' of christianllanillo:caple…
Zuiluj Jul 27, 2022
198dadc
Added yaml validator and have it return specific errors
Zuiluj Apr 7, 2022
150c916
Made yaml validation to properly separate openapi errors and python e…
Zuiluj Apr 11, 2022
4464f03
Finished create/update api from yaml. Added writing to config file if…
Zuiluj Apr 12, 2022
461e73f
added support for splitting the docs to get params of the view
Zuiluj Jun 2, 2022
5a1ae8e
switch acquiring of swagger docs for payload from docstrings to funct…
Zuiluj Jun 2, 2022
d2d054f
added ability to also detect model references from _payload_docs func…
Zuiluj Jun 3, 2022
88dd53b
updated swaggyp package
Zuiluj Jun 22, 2022
81564c5
Merge branch 'feature/api_gateway_swagger' of christianllanillo:caple…
Zuiluj Jul 27, 2022
c0d149b
Added github workflow
Zuiluj Sep 6, 2022
3763c44
first stab at add forms and HTMLView, and removing circular imports
bjinwright Sep 14, 2022
a96dde2
Merge branch 'develop' of github.com:capless/pfunk into develop
bjinwright Sep 14, 2022
d5252ea
added building of volume before build in github workflow
Zuiluj Sep 14, 2022
4df60ca
Merge branch 'develop' of christianllanillo:capless/pfunk into develop
Zuiluj Sep 14, 2022
457cbaa
removed packageloader for ecommerce. Changed port of faunadb in docke…
Zuiluj Sep 15, 2022
29919c6
added unittests for circular dependency error for easier testing. fix…
Zuiluj Sep 16, 2022
e3de548
reverted docker-compose to use 8084 port for fauna
Zuiluj Sep 19, 2022
04fb584
Added env vars creation from gh secrets. Changed faunadb port
Zuiluj Sep 19, 2022
a32854c
testing remapped ports for faunadb
Zuiluj Sep 20, 2022
0d4dada
reverted fauna port back to 8085
Zuiluj Sep 20, 2022
3f48aad
reworked tests for htmlviews
Zuiluj Sep 22, 2022
05e3d78
first stab at new contrib for separate out-of-box user and group and …
Zuiluj Sep 30, 2022
973d0af
Refactored functions to use index that correctly corresponds to the c…
Zuiluj Oct 7, 2022
4131365
added dynamic indexing in auth contrib collections
Zuiluj Oct 11, 2022
496e17d
made permissions in genericUserBasedRole to dynamically use the field…
Zuiluj Oct 24, 2022
1c4b0c8
Did refactoring for better readablity in roles. Applied with pep8
Zuiluj Oct 25, 2022
831ee99
Fixed GroupBasedPermission to properly use functions and dynamic sytaxes
Zuiluj Oct 26, 2022
01833c3
fixed permission adding group based perm
Zuiluj Oct 28, 2022
cf0b9d6
Added priority publish for user-group-usergroup collections to avoid …
Zuiluj Nov 2, 2022
f298c8d
first stab at generic group based refactors
Zuiluj Nov 7, 2022
4ed00d5
updated requirements, tests, html views, and templates
bjinwright Nov 18, 2022
7a9f0fa
Fixed GenericGroupBasedPerms not properly acquiring user table in mem…
Zuiluj Nov 22, 2022
9ace3cd
refactored auth perms for cleaner usage. Refactored unittests for cle…
Zuiluj Nov 24, 2022
20163e3
Added genericM2MUser perms
Zuiluj Dec 1, 2022
ad380ed
updated github actions, gitignore, and unittests
bjinwright Dec 5, 2022
f6997bb
Fixed create permissions on m2m operations
Zuiluj Dec 12, 2022
070c784
Fixed update ops on m2m not working when adding m2m entities
Zuiluj Dec 12, 2022
982f0af
Found a better fix for permission error on m2m relation saving
Zuiluj Dec 15, 2022
50422c5
Fixed wrong imports on test m2m
Zuiluj Dec 15, 2022
c5d359f
updated unittests to work with latest contrib collections
Zuiluj Dec 23, 2022
c2fa095
first stab at using class var instead of env var initially when acces…
Zuiluj Jan 20, 2023
4b49a6e
Refactored tests to enable use of optional custom user and group in u…
Zuiluj Jan 23, 2023
43d57a4
Updated faunadb module. Removed unnecessary tests.
Zuiluj Jan 24, 2023
e2d8921
Refactored m2m custom user and group tests. Refactored names of custo…
Zuiluj Jan 26, 2023
299a5e0
Merge branch 'feature/new_contrib_user_group' into feature/api_gatewa…
Zuiluj Mar 1, 2023
9d7bee7
Merge pull request #34 from capless/feature/api_gateway_swagger
Zuiluj Mar 1, 2023
3b6dcfc
updated current branch to reflect latest changes in swagger feature. …
Zuiluj Mar 1, 2023
9f78209
added documentation for auth json views
Zuiluj Mar 6, 2023
d410aac
Fixed creation of jwt to cast to int the payload for iat. Updated pac…
Zuiluj Mar 13, 2023
89355ad
Added essential docstrings and little refactors for performance and d…
Zuiluj Mar 14, 2023
b3f2d61
updated README to show examples of custom user and group collection
Zuiluj Mar 17, 2023
0788dde
Refactored tests to work without pre-existing files
Zuiluj Mar 28, 2023
851638a
Fixed poetry errors
Zuiluj Apr 3, 2023
f7c67db
updated the poetry dependency list
bjinwright Apr 3, 2023
1763880
reverted docker-compose file
Zuiluj Apr 3, 2023
9d3f9f8
Updated tests to use local html file instead of tempfile
Zuiluj Apr 3, 2023
09daeed
Added aws.py as a skeleton for upcoming AWS features
Zuiluj Apr 5, 2022
0cf510b
Added skeleton tests for aws features
Zuiluj Apr 5, 2022
8cf501f
Added yaml validator and have it return specific errors
Zuiluj Apr 7, 2022
a972f47
Made yaml validation to properly separate openapi errors and python e…
Zuiluj Apr 11, 2022
576833b
Refactored default dir of swagger file. Refactored unit tests for AWS…
Zuiluj Apr 11, 2022
ed44f71
Finished create/update api from yaml. Added writing to config file if…
Zuiluj Apr 12, 2022
3c8fef5
Reworked what exceptions does aws util react to. Added doc for aws ut…
Zuiluj Apr 13, 2022
59030c4
Did cleaning up of swaggerdoc docstrings
Zuiluj Apr 27, 2022
712e30c
added generate-swagger as a cli command, creates a swagger file from …
Zuiluj May 4, 2022
86bac03
added support for splitting the docs to get params of the view
Zuiluj Jun 2, 2022
c0bccbe
switch acquiring of swagger docs for payload from docstrings to funct…
Zuiluj Jun 2, 2022
6e62a74
added ability to also detect model references from _payload_docs func…
Zuiluj Jun 3, 2022
ce2b467
Updated the docstrings of _payload_docs
Zuiluj Jun 3, 2022
e1312f4
Updated the docstrings of _payload_docs
Zuiluj Jun 3, 2022
228a039
updated swaggyp package
Zuiluj Jun 22, 2022
664c7b1
Fixed calling of view's _payload_docs to pass the correct argument. M…
Zuiluj Jun 23, 2022
8cc26a6
Added aws.py as a skeleton for upcoming AWS features
Zuiluj Apr 5, 2022
ee82735
Added skeleton tests for aws features
Zuiluj Apr 5, 2022
d2a371b
Added yaml validator and have it return specific errors
Zuiluj Apr 7, 2022
f4f9cae
Made yaml validation to properly separate openapi errors and python e…
Zuiluj Apr 11, 2022
49d45f1
Refactored default dir of swagger file. Refactored unit tests for AWS…
Zuiluj Apr 11, 2022
3d7fb49
Finished create/update api from yaml. Added writing to config file if…
Zuiluj Apr 12, 2022
49de249
Reworked what exceptions does aws util react to. Added doc for aws ut…
Zuiluj Apr 13, 2022
199fb26
Did cleaning up of swaggerdoc docstrings
Zuiluj Apr 27, 2022
b826a9b
added generate-swagger as a cli command, creates a swagger file from …
Zuiluj May 4, 2022
741988f
added support for splitting the docs to get params of the view
Zuiluj Jun 2, 2022
8afe87d
switch acquiring of swagger docs for payload from docstrings to funct…
Zuiluj Jun 2, 2022
3f7dbd7
added ability to also detect model references from _payload_docs func…
Zuiluj Jun 3, 2022
11b3bbb
Updated the docstrings of _payload_docs
Zuiluj Jun 3, 2022
0521226
Updated the docstrings of _payload_docs
Zuiluj Jun 3, 2022
0950d0a
updated swaggyp package
Zuiluj Jun 22, 2022
41cb077
Fixed calling of view's _payload_docs to pass the correct argument. M…
Zuiluj Jun 23, 2022
377893c
Added yaml validator and have it return specific errors
Zuiluj Apr 7, 2022
39d50f7
Made yaml validation to properly separate openapi errors and python e…
Zuiluj Apr 11, 2022
1b10e28
Finished create/update api from yaml. Added writing to config file if…
Zuiluj Apr 12, 2022
78bcffb
added support for splitting the docs to get params of the view
Zuiluj Jun 2, 2022
8399174
switch acquiring of swagger docs for payload from docstrings to funct…
Zuiluj Jun 2, 2022
b022db5
added ability to also detect model references from _payload_docs func…
Zuiluj Jun 3, 2022
bb0c2f5
updated swaggyp package
Zuiluj Jun 22, 2022
a3eea4a
Added aws.py as a skeleton for upcoming AWS features
Zuiluj Apr 5, 2022
b05e1ba
Added skeleton tests for aws features
Zuiluj Apr 5, 2022
da5675d
Added yaml validator and have it return specific errors
Zuiluj Apr 7, 2022
b289194
Made yaml validation to properly separate openapi errors and python e…
Zuiluj Apr 11, 2022
2382d1d
Refactored default dir of swagger file. Refactored unit tests for AWS…
Zuiluj Apr 11, 2022
ce9cdf9
Finished create/update api from yaml. Added writing to config file if…
Zuiluj Apr 12, 2022
6379489
Reworked what exceptions does aws util react to. Added doc for aws ut…
Zuiluj Apr 13, 2022
ef74277
Did cleaning up of swaggerdoc docstrings
Zuiluj Apr 27, 2022
4e5f530
added generate-swagger as a cli command, creates a swagger file from …
Zuiluj May 4, 2022
864242b
added support for splitting the docs to get params of the view
Zuiluj Jun 2, 2022
1c1cb92
switch acquiring of swagger docs for payload from docstrings to funct…
Zuiluj Jun 2, 2022
78284bb
added ability to also detect model references from _payload_docs func…
Zuiluj Jun 3, 2022
cb0f05b
Updated the docstrings of _payload_docs
Zuiluj Jun 3, 2022
1056368
Updated the docstrings of _payload_docs
Zuiluj Jun 3, 2022
5c4a0fd
updated swaggyp package
Zuiluj Jun 22, 2022
847ea2e
Fixed calling of view's _payload_docs to pass the correct argument. M…
Zuiluj Jun 23, 2022
aa85d73
first stab at new contrib for separate out-of-box user and group and …
Zuiluj Sep 30, 2022
b0210ee
Refactored functions to use index that correctly corresponds to the c…
Zuiluj Oct 7, 2022
4f8a87b
added dynamic indexing in auth contrib collections
Zuiluj Oct 11, 2022
b574e7a
made permissions in genericUserBasedRole to dynamically use the field…
Zuiluj Oct 24, 2022
6764e5f
Did refactoring for better readablity in roles. Applied with pep8
Zuiluj Oct 25, 2022
02843fc
Fixed GroupBasedPermission to properly use functions and dynamic sytaxes
Zuiluj Oct 26, 2022
7d7ce57
fixed permission adding group based perm
Zuiluj Oct 28, 2022
dd4a25a
Added priority publish for user-group-usergroup collections to avoid …
Zuiluj Nov 2, 2022
92a6563
first stab at generic group based refactors
Zuiluj Nov 7, 2022
a9d5dbb
Fixed GenericGroupBasedPerms not properly acquiring user table in mem…
Zuiluj Nov 22, 2022
b97ac70
refactored auth perms for cleaner usage. Refactored unittests for cle…
Zuiluj Nov 24, 2022
2f1cd4d
Added genericM2MUser perms
Zuiluj Dec 1, 2022
fcad4d7
Fixed create permissions on m2m operations
Zuiluj Dec 12, 2022
65eda3b
Fixed update ops on m2m not working when adding m2m entities
Zuiluj Dec 12, 2022
653549e
Found a better fix for permission error on m2m relation saving
Zuiluj Dec 15, 2022
5313091
Fixed wrong imports on test m2m
Zuiluj Dec 15, 2022
d2e3fcf
updated unittests to work with latest contrib collections
Zuiluj Dec 23, 2022
0e6aa26
first stab at using class var instead of env var initially when acces…
Zuiluj Jan 20, 2023
b4a1bc6
Refactored tests to enable use of optional custom user and group in u…
Zuiluj Jan 23, 2023
98fd5b5
Updated faunadb module. Removed unnecessary tests.
Zuiluj Jan 24, 2023
a52ab9c
Refactored m2m custom user and group tests. Refactored names of custo…
Zuiluj Jan 26, 2023
b126606
updated current branch to reflect latest changes in swagger feature. …
Zuiluj Mar 1, 2023
61d411e
added documentation for auth json views
Zuiluj Mar 6, 2023
30aea6c
Fixed creation of jwt to cast to int the payload for iat. Updated pac…
Zuiluj Mar 13, 2023
9f9f364
Added essential docstrings and little refactors for performance and d…
Zuiluj Mar 14, 2023
fc122de
updated README to show examples of custom user and group collection
Zuiluj Mar 17, 2023
0a0f805
Refactored tests to work without pre-existing files
Zuiluj Mar 28, 2023
f801756
Fixed poetry errors
Zuiluj Apr 3, 2023
290432a
updated the poetry dependency list
bjinwright Apr 3, 2023
d036369
reverted docker-compose file
Zuiluj Apr 3, 2023
0c05a49
Updated tests to use local html file instead of tempfile
Zuiluj Apr 3, 2023
dfc74fe
Merge branch 'feature/new_contrib_user_group' of christianllanillo:ca…
Zuiluj Apr 19, 2023
c9d4e1d
fixed poetry files
Zuiluj Apr 19, 2023
49336ec
changed order of docker commands in gh actions
Zuiluj Apr 25, 2023
a879c24
reverted gh actions. added dependency condition on compose
Zuiluj Apr 25, 2023
f7424e7
Merge pull request #42 from capless/feature/new_contrib_user_group
Zuiluj May 4, 2023
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
62 changes: 62 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
# This is a basic workflow to help you get started with Actions

name: Unittests

# Controls when the action will run.
on:
# Triggers the workflow on push or pull request events but only for the master branch
push:
branches: [ master, develop ]
pull_request:
branches: [ master, develop ]

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:

# This workflow contains a single job called "build"
build:
environment: Master
# The type of runner that the job will run on
runs-on: ubuntu-latest

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2
- name: Generate env vars from gh secrets
run: |
echo TEMPLATE_ROOT_DIR=${{ secrets.TEMPLATE_ROOT_DIR }} >> .env
echo FAUNA_SECRET=${{ secrets.FAUNA_SECRET }} >> .env
echo FAUNA_SCHEME=${{ secrets.FAUNA_SCHEME }} >> .env
echo FAUNA_DOMAIN=${{ secrets.FAUNA_DOMAIN }} >> .env
echo FAUNA_PORT=${{ secrets.FAUNA_PORT}} >> .env
echo FAUNA_GRAPHQL_IMPORT_URL=${{ secrets.FAUNA_GRAPHQL_IMPORT_URL}} >> .env
echo FAUNA_GRAPHQL_URL=$${{ secrets.FAUNA_GRAPHQL_URL }} >> .env
echo DEFAULT_FROM_EMAIL=${{ secrets.DEFAULT_FROM_EMAIL }} >> .env
echo PROJECT_NAME=${{ secrets.PROJECT_NAME }} >> .env
echo KEY_MODULE=${{ secrets.KEY_MODULE }} >> .env
cat .env
- run: docker-compose pull

# In this step, this action saves a list of existing images,
# the cache is created without them in the post run.
# It also restores the cache if it exists.
- uses: satackey/[email protected]
# Ignore the failure of a step and avoid terminating the job.
continue-on-error: true

- run: docker volume create --name=pfunk-fauna-data
- run: docker-compose build

# Runs a single command using the runners shell
- name: Run Unit Tests
run: docker-compose run web poetry run python -m unittest
- name: Build and publish to pypi
if: github.ref == 'refs/heads/master'
uses: JRubics/[email protected]
with:
pypi_token: ${{ secrets.PYPI_TOKEN }}
ignore_dev_requirements: "yes"
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -132,3 +132,4 @@ dmypy.json
# Pyre type checker
.pyre/
/pfunk/carcamp/
/notebooks/
1 change: 1 addition & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
FROM capless/capless-docker:jupyter
RUN pip install --upgrade pip
COPY . /code
RUN poetry run pip install --upgrade pip
RUN poetry install
127 changes: 126 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,21 +22,29 @@ Includes GraphQL and generic ABAC auth workflow integrations.

- [Getting Started](#Getting-Started)
- [Installation](#Installation)
- [Environment Variables](#environment-variables)
- [Setup the Connection](#setup-the-connection)
- [Define your Collections](#define-your-collections-collectionspy)
- [Choose an Auth Workflow](#auth-workflows)
- [Publish](#publish)
- [Save Some Data](#save-some-data)
- [Query Your Data](#query-your-data)
- [Delete a Record](#delete-a-record)

- [Customizing your setup](#customizing-your-setup)
- [Option 1: Environment Variables](#option-1-environment-variables)
- [Option 2: Inline Field](#option-2-inline-field)


### Getting Started

### Installation
```pip install pfunk```

### Environment Variables

- **FAUNA_SECRET** - Fauna admin or server key.
- **FAUNA_SCHEME** - (optional) HTTP scheme to use (default: https)
-
### Setup the Connection

#### Using Environment Variables (Preferred Method)
Expand Down Expand Up @@ -207,3 +215,120 @@ Let's delete the record from above.
```python
product.delete()
```



### Customizing your setup
This section is for customizing your `user` and `group` collections to your liking. e.g.
- Renaming your `User` and `Group` collection to something more verbose to your usage e.g. `Agent (User)` to `Firm (Group)`
- Subclassing the `user` or `group` collection in order to have more control to what kind of auth collection you want to have


### Custom User and Groups
Initially, we have multiple ways of defining your custom user-group collections.
Things to keep in mind:
- `UserGroup` class **must** be subclassed and reference to the custom `user` and `group`
- How the permissions work will do the same thing in custom user and group. This just gives you the ability to fully customize your own auth collections.



### Option 1: Environment Variables
This is the easiest way. Just go to your `.env` file and define:
```
USER_COLLECTION=Newuser # Class name of your custom user class - case-sensitive!
GROUP_COLLECTION=Newgroup # Class name of your custom group class - case-sensitive!
GROUP_COLLECTION_DIR=dir.to.Newgroup # class dir to import your custom group
USER_COLLECTION_DIR=dir.to.Newuser # class dir to import your custom user group
```
Then you'll end up with this in your `collections.py`
```python
from pfunk.contrib.auth.collections import BaseGroup, ExtendedUser, BaseUserGroup as ug
from pfunk.contrib.auth.resources import GenericUserBasedRole


class UserGroups(ug):
userID = ReferenceField('dir.to.Newuser')
groupID = ReferenceField('dir.to.Newgroup')


class Newgroup(BaseGroup):
users = ManyToManyField('dir.to.Newuser', relation_name='custom_users_groups')


class Newuser(ExtendedUser):
user_group_class = import_util('dir.to.UserGroups')
group_class = import_util('dir.to.Newgroup')
groups = ManyToManyField('dir.to.Newgroup', relation_name='custom_users_groups')
blogs = ManyToManyField('dir.to.Blog', relation_name='users_blogs')


class Blog(Collection):
collection_roles = [GenericUserBasedRole]
title = StringField(required=True)
content = StringField(required=True)
user = ReferenceField('dir.to.Newuser', relation_name='users_blogs')

def __unicode__(self):
return self.title

```



### Option 2: Inline Field
If for some reason you don't want to use the environment variables, you can define the needed fields
directly in your `Collection`. This is what we use in PFunk's unit tests, refer to it if you
need more usage but essentially:
```python
class Blog(Collection):
user_collection = 'Newuser'
group_collection = 'Newgroup'
user_collection_dir = 'dir.to.Newuser'
group_collection_dir = 'dir.to.Newgroup'
...
```


Generally, this is how your `collections.py` will look like in the end if you want to define
your custom auth collections in fields.


```python
from pfunk.contrib.auth.collections import BaseGroup, ExtendedUser, BaseUserGroup as ug
from pfunk.contrib.auth.resources import GenericUserBasedRole


class UserGroups(ug):
userID = ReferenceField('this.file.NewUser')
groupID = ReferenceField('this.file.Newgroup')


class Newgroup(BaseGroup):
users = ManyToManyField('this.file.Newuser', relation_name='custom_users_groups')


class Newuser(ExtendedUser):
user_group_class = import_util('this.file.UserGroups')
group_class = import_util('this.file.Newgroup')
groups = ManyToManyField('this.file.Newgroup', relation_name='custom_users_groups')
blogs = ManyToManyField('this.file.Blog',
relation_name='users_blogs')

group_collection = 'Newgroup'


class Blog(Collection):
collection_roles = [GenericUserBasedRole]
title = StringField(required=True)
content = StringField(required=True)
user = ReferenceField('this.file.Newuser', relation_name='users_blogs')

user_collection = 'Newuser'
group_collection = 'Newgroup'
user_collection_dir = 'this.file.Newuser'
group_collection_dir = 'this.file.Newgroup'

def __unicode__(self):
return self.title
```

7 changes: 4 additions & 3 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ services:
- "8010"
- "3434"
depends_on:
- fauna
fauna:
condition: service_healthy
ports:
- 8010:8888
- 3434:3434
Expand All @@ -22,12 +23,12 @@ services:

fauna:
restart: always
image: fauna/faunadb
image: fauna/faunadb:4.15.0
ports:
- 8443:8443
- 8444:8444
- 8445:8445
- 8084:8084
- 8085:8085
volumes:
- ./logs:/var/log/faunadb
- ./docker-fauna.yml:/docker-fauna.yml
Expand Down
3 changes: 2 additions & 1 deletion pfunk/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@
.. include:: ../CONTRIBUTE.md
"""
__docformat__ = "google"

from .client import FaunaClient
from .collection import Collection, Enum
from .fields import (StringField, IntegerField, DateField, DateTimeField, BooleanField, FloatField, EmailField,
EnumField, ReferenceField, ManyToManyField, SlugField)
from .project import Project
from .client import FaunaClient
Loading