Skip to content

Commit 52f830a

Browse files
authored
Merge branch '0.9' into fix-multiple-h1-issue
2 parents 0432ca6 + 8ecaae8 commit 52f830a

Some content is hidden

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

41 files changed

+4294
-25
lines changed

.circleci/config_continue.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ jobs:
1717
resource_class: large
1818
steps:
1919
- checkout
20+
- run: update-alternatives --install "/usr/bin/java" "java" "/usr/java/jdk-15.0.1/bin/java" 2
21+
- run: update-alternatives --install "/usr/bin/javac" "javac" "/usr/java/jdk-15.0.1/bin/javac" 2
2022
- run: echo "127.0.0.1 localhost.org" >> /etc/hosts
2123
- run: make dev-install
2224
- run: (cd .circleci/ && ./doUnitTests.sh)
@@ -27,6 +29,8 @@ jobs:
2729
resource_class: large
2830
steps:
2931
- checkout
32+
- run: update-alternatives --install "/usr/bin/java" "java" "/usr/java/jdk-15.0.1/bin/java" 2
33+
- run: update-alternatives --install "/usr/bin/javac" "javac" "/usr/java/jdk-15.0.1/bin/javac" 2
3034
- run: echo "127.0.0.1 localhost.org" >> /etc/hosts
3135
- run: make with-fastapi
3236
- run: (cd .circleci/ && ./websiteFastApi.sh)
@@ -37,6 +41,8 @@ jobs:
3741
resource_class: large
3842
steps:
3943
- checkout
44+
- run: update-alternatives --install "/usr/bin/java" "java" "/usr/java/jdk-15.0.1/bin/java" 2
45+
- run: update-alternatives --install "/usr/bin/javac" "javac" "/usr/java/jdk-15.0.1/bin/javac" 2
4046
- run: echo "127.0.0.1 localhost.org" >> /etc/hosts
4147
- run: make with-flask
4248
- run: (cd .circleci/ && ./websiteFlask.sh)
@@ -47,6 +53,8 @@ jobs:
4753
resource_class: large
4854
steps:
4955
- checkout
56+
- run: update-alternatives --install "/usr/bin/java" "java" "/usr/java/jdk-15.0.1/bin/java" 2
57+
- run: update-alternatives --install "/usr/bin/javac" "javac" "/usr/java/jdk-15.0.1/bin/javac" 2
5058
- run: echo "127.0.0.1 localhost.org" >> /etc/hosts
5159
- run: make with-django
5260
- run: (cd .circleci/ && ./websiteDjango.sh)
@@ -64,6 +72,8 @@ jobs:
6472
- checkout
6573
- attach_workspace:
6674
at: /
75+
- run: update-alternatives --install "/usr/bin/java" "java" "/usr/java/jdk-15.0.1/bin/java" 2
76+
- run: update-alternatives --install "/usr/bin/javac" "javac" "/usr/java/jdk-15.0.1/bin/javac" 2
6777
- run: n 16
6878
- run: node --version
6979
- run: echo "127.0.0.1 localhost.org" >> /etc/hosts
@@ -92,6 +102,8 @@ jobs:
92102
- checkout
93103
- attach_workspace:
94104
at: /
105+
- run: update-alternatives --install "/usr/bin/java" "java" "/usr/java/jdk-15.0.1/bin/java" 2
106+
- run: update-alternatives --install "/usr/bin/javac" "javac" "/usr/java/jdk-15.0.1/bin/javac" 2
95107
- run: n 16
96108
- run: node --version
97109
- run: echo "127.0.0.1 localhost.org" >> /etc/hosts
@@ -120,6 +132,8 @@ jobs:
120132
- checkout
121133
- attach_workspace:
122134
at: /
135+
- run: update-alternatives --install "/usr/bin/java" "java" "/usr/java/jdk-15.0.1/bin/java" 2
136+
- run: update-alternatives --install "/usr/bin/javac" "javac" "/usr/java/jdk-15.0.1/bin/javac" 2
123137
- run: n 16
124138
- run: node --version
125139
- run: echo "127.0.0.1 localhost.org" >> /etc/hosts

CHANGELOG.md

Lines changed: 37 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,44 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
66

77
## [unreleased]
88

9-
## [0.9.0] - 2022-06-23
9+
### Documentation
10+
11+
- Add more details in the `CONTRIBUTING.md` to make it beginner friendly.
12+
1013

14+
## [0.9.1] - 2022-06-27
15+
### Features:
16+
17+
- Introduce `userroles` recipe.
18+
```python
19+
from supertokens_python import InputAppInfo, SupertokensConfig, init
20+
from supertokens_python.recipe import userroles
21+
from supertokens_python.recipe.userroles.asyncio import create_new_role_or_add_permissions, add_role_to_user
22+
23+
init(
24+
supertokens_config=SupertokensConfig('http://localhost:3567'),
25+
app_info=InputAppInfo(
26+
app_name='SuperTokens Demo',
27+
api_domain='https://api.supertokens.io',
28+
website_domain='supertokens.io'
29+
),
30+
framework='flask',
31+
recipe_list=[userroles.init()]
32+
)
33+
34+
user_id = "userId"
35+
role = "role"
36+
permissions = ["perm1", "perm2"]
37+
38+
# Functions to use inside your views:
39+
# Create a new role with a few permissions:
40+
result = await create_new_role_or_add_permissions(role, permissions)
41+
# Add role to the user:
42+
result = await add_role_to_user(user_id, role)
43+
# Check documentation for more examples..
44+
```
45+
46+
## [0.9.0] - 2022-06-23
1147
### Fixes
1248
- Fixes Cookie same_site config validation.
1349
- Remove `<Recipe>(Email|SMS)TemplateVars` in favour of `(Email|SMS)TemplateVars` for better DX.

CONTRIBUTING.md

Lines changed: 30 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -14,19 +14,19 @@ We're so excited you're interested in helping with SuperTokens! We are happy to
1414

1515
## Development Setup
1616

17-
You will need to setup the `supertokens-core` in order to run the `supertokens-python` tests, you can setup `supertokens-core` by following this [guide](https://github.com/supertokens/supertokens-core/blob/master/CONTRIBUTING.md#development-setup)
17+
You will need to setup the [supertokens-core](https://github.com/supertokens/supertokens-core) in order to run the `supertokens-python` tests, you can setup `supertokens-core` by following this [guide](https://github.com/supertokens/supertokens-core/blob/master/CONTRIBUTING.md#development-setup)
1818
**Note: If you are not contributing to the `supertokens-core` you can skip steps 1 & 4 under Project Setup of the `supertokens-core` contributing guide.**
1919

2020
### Prerequisites
2121

2222
- Python (version 3.7 or above)
23-
- IDE: [PyCharm](https://www.jetbrains.com/pycharm/download)(recommended) or equivalent IDE
23+
- IDE: [PyCharm](https://www.jetbrains.com/pycharm/download)(recommended) OR [VS Code](https://code.visualstudio.com/) OR equivalent IDE
2424

2525
### Project Setup
2626

27-
1. Fork the [supertokens-python](https://github.com/supertokens/supertokens-python) repository
27+
1. Fork the [supertokens-python](https://github.com/supertokens/supertokens-python) repository.
2828
2. Clone the forked repository in the parent directory of the previously setup `supertokens-root`.
29-
`supertokens-python` and `supertokens-root` should exist side by side within the same parent directory
29+
`supertokens-python` and `supertokens-root` should exist side by side within the same parent directory.
3030
3. Create a virtual environment for the `supertokens-python` project and activate it.
3131
4. Install the project dependencies
3232
`make dev-install`
@@ -35,23 +35,25 @@ You will need to setup the `supertokens-core` in order to run the `supertokens-p
3535

3636
## Modifying Code
3737

38-
1. Open the `supertokens-python` project in your IDE and you can start modifying the code
38+
- Open the `supertokens-python` project in your IDE and you can start modifying the code.
39+
- Use `make check-lint` and `make format` to find lint/formatting errors before committing. (They will run anyways)
3940

4041
## Testing
4142

42-
1. Navigate to the `supertokens-root` repository
43+
1. Navigate to the [supertokens-root](https://github.com/supertokens/supertokens-root) repository.
4344
2. Start the testing environment
4445
`./startTestEnv --wait`
45-
and ensure the test environment is up and running
46-
3. Open a new terminal and navigate to the `supertokens-python` respositry
47-
4. Run all tests, while ensuring the test environment is running on a different terminal
48-
`make test`
46+
and ensure the test environment is up and running.
47+
3. Open a new terminal and navigate to the `supertokens-python` respositry.
48+
4. Use `export SUPERTOKENS_PATH=path/to/supertokens-root` (**MANDATORY**)
49+
4. To run all tests, while ensuring the test environment is running on a different terminal, use `make test`.
50+
5. To run individual tests, use `pytest ./tests/path/to/test/file.py -k test_function_name` OR use your IDE's in-built UI for running python tests. You may read [VSCode Python Testing](https://code.visualstudio.com/docs/python/testing) and [PyCharm Testing](https://www.jetbrains.com/help/pycharm/testing-your-first-python-application.html#debug-test) for more info.
4951

5052
## Pull Request
5153

52-
1. Before submitting a pull request make sure all tests have passed
53-
2. Reference the relevant issue or pull request and give a clear description of changes/features added when submitting a pull request
54-
3. Make sure the PR title follows [conventional commits](https://www.conventionalcommits.org/en/v1.0.0/) specification
54+
1. Before submitting a pull request make sure all tests have passed.
55+
2. Reference the relevant issue or pull request and give a clear description of changes/features added when submitting a pull request.
56+
3. Make sure the PR title follows [conventional commits](https://www.conventionalcommits.org/en/v1.0.0/) specification.
5557

5658
## SuperTokens Community
5759

@@ -65,4 +67,18 @@ SuperTokens is made possible by a passionate team and a strong community of deve
6567
Additional resources you might find useful:
6668

6769
- [SuperTokens Docs](https://supertokens.io/docs/community/getting-started/installation)
68-
- [Blog Posts](https://supertokens.io/blog/)
70+
- [Blog Posts](https://supertokens.io/blog/)
71+
72+
## Implementing RecipeInterfaces
73+
74+
- Make sure all CRUD operations are available via the `(a)?syncio` modules of that recipe.
75+
- Make sure the corresponding `RecipeImplementation` takes type imports from the `interfaces.py` file of that recipe. This is so that if a user wants to copy / paste that code into their project, they can do so via the normal import statement.
76+
77+
## Implementing APIInterfaces
78+
- Make sure the corresonding `APIImplementation` takes type imports from the `interfaces.py` file of that recipe. This is so that if a user wants to copy / paste that code into their project, they can do so via the normal import statement.
79+
80+
## Generating docs
81+
This will generate the API docs in a folder called docs
82+
```
83+
make build-docs
84+
```

coreDriverInterfaceSupported.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
"2.10",
66
"2.11",
77
"2.12",
8-
"2.13"
8+
"2.13",
9+
"2.14"
910
]
1011
}

html/supertokens_python/constants.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,8 @@ <h1 class="title">Module <code>supertokens_python.constants</code></h1>
3939
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
4040
# License for the specific language governing permissions and limitations
4141
# under the License.
42-
SUPPORTED_CDI_VERSIONS = [&#39;2.9&#39;, &#39;2.10&#39;, &#39;2.11&#39;, &#39;2.12&#39;, &#39;2.13&#39;]
43-
VERSION = &#39;0.9.0&#39;
42+
SUPPORTED_CDI_VERSIONS = [&#39;2.9&#39;, &#39;2.10&#39;, &#39;2.11&#39;, &#39;2.12&#39;, &#39;2.13&#39;, &#39;2.14&#39;]
43+
VERSION = &#39;0.9.1&#39;
4444
TELEMETRY = &#39;/telemetry&#39;
4545
USER_COUNT = &#39;/users/count&#39;
4646
USER_DELETE = &#39;/user/remove&#39;

html/supertokens_python/exceptions.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,7 @@ <h3>Subclasses</h3>
184184
<li><a title="supertokens_python.recipe.thirdpartyemailpassword.exceptions.SupertokensThirdPartyEmailPasswordError" href="recipe/thirdpartyemailpassword/exceptions.html#supertokens_python.recipe.thirdpartyemailpassword.exceptions.SupertokensThirdPartyEmailPasswordError">SupertokensThirdPartyEmailPasswordError</a></li>
185185
<li><a title="supertokens_python.recipe.thirdpartypasswordless.exceptions.SupertokensThirdPartyPasswordlessError" href="recipe/thirdpartypasswordless/exceptions.html#supertokens_python.recipe.thirdpartypasswordless.exceptions.SupertokensThirdPartyPasswordlessError">SupertokensThirdPartyPasswordlessError</a></li>
186186
<li><a title="supertokens_python.recipe.usermetadata.exceptions.SuperTokensUserMetadataError" href="recipe/usermetadata/exceptions.html#supertokens_python.recipe.usermetadata.exceptions.SuperTokensUserMetadataError">SuperTokensUserMetadataError</a></li>
187+
<li><a title="supertokens_python.recipe.userroles.exceptions.SuperTokensUserRolesError" href="recipe/userroles/exceptions.html#supertokens_python.recipe.userroles.exceptions.SuperTokensUserRolesError">SuperTokensUserRolesError</a></li>
187188
</ul>
188189
</dd>
189190
</dl>

html/supertokens_python/recipe/index.html

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,10 @@ <h2 class="section-title" id="header-submodules">Sub-modules</h2>
6666
<dd>
6767
<div class="desc"></div>
6868
</dd>
69+
<dt><code class="name"><a title="supertokens_python.recipe.userroles" href="userroles/index.html">supertokens_python.recipe.userroles</a></code></dt>
70+
<dd>
71+
<div class="desc"></div>
72+
</dd>
6973
</dl>
7074
</section>
7175
<section>
@@ -98,6 +102,7 @@ <h1>Index</h1>
98102
<li><code><a title="supertokens_python.recipe.thirdpartyemailpassword" href="thirdpartyemailpassword/index.html">supertokens_python.recipe.thirdpartyemailpassword</a></code></li>
99103
<li><code><a title="supertokens_python.recipe.thirdpartypasswordless" href="thirdpartypasswordless/index.html">supertokens_python.recipe.thirdpartypasswordless</a></code></li>
100104
<li><code><a title="supertokens_python.recipe.usermetadata" href="usermetadata/index.html">supertokens_python.recipe.usermetadata</a></code></li>
105+
<li><code><a title="supertokens_python.recipe.userroles" href="userroles/index.html">supertokens_python.recipe.userroles</a></code></li>
101106
</ul>
102107
</li>
103108
</ul>

0 commit comments

Comments
 (0)