Skip to content
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

Refactor Phew as a class to support multiple apps on one device running singly or concurrently; Support SSL and Session Authentication. #53

Open
wants to merge 21 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
de85289
Refactor Phew as a class to support multiple apps
ccrighton Jun 8, 2023
005adc0
Ensure that all form data is read to content-length
Aug 12, 2023
610ea79
Document approach to processing lists in templates.
ccrighton Jun 8, 2023
9e61398
Additional common mime types mapped to extensions
Aug 28, 2023
7bac7a6
Distribution updates for this fork of phew
ccrighton Sep 27, 2023
411d215
Rename package to micropython-ccrighton-phew
ccrighton Oct 3, 2023
83c902c
Add support for TLS
ccrighton Jun 1, 2024
2d4aca9
Added session based auth using a session cookie
ccrighton Jun 2, 2024
ce3bef2
Usability improvements to the auth example
ccrighton Jun 3, 2024
4da6bea
@login_required decorator support for the catchall hander
ccrighton Jun 3, 2024
c6bae7e
Update auth example to use der encoded cert and key files
ccrighton Jun 4, 2024
d785f01
Added gc.collect in _handle_request
ccrighton Jun 4, 2024
7f03c9b
Add TLS and Session documentation to README
ccrighton Jun 4, 2024
17f2909
sessionid cookie now 128 bits and cookie removed on logout
ccrighton Jun 4, 2024
3c66747
Tidied up presentation in auth example
ccrighton Jun 5, 2024
8429aa3
Add cert and key files to auth example
ccrighton Jun 26, 2024
8ae9123
Display assigned IP address on connection to WiFi in examples.
ccrighton Jun 26, 2024
d2c250c
Add reuse license headers to new examples
ccrighton Jun 26, 2024
893d2df
Merge branch 'ssl_and_session_auth'
ccrighton Jun 26, 2024
fac3fff
Setup.py and changelog.md to version 0.0.5
ccrighton Jun 26, 2024
2ba3337
Added install-local target to Makefile
ccrighton Jun 26, 2024
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
Prev Previous commit
Next Next commit
Add reuse license headers to new examples
ccrighton committed Jun 26, 2024
commit d2c250cac8b929f85f9dffa91d1b967772a81c85
8 changes: 7 additions & 1 deletion examples/auth/404.html
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
<!--
SPDX-FileCopyrightText: 2024 Charles Crighton <code@crighton.net.nz>
SPDX-License-Identifier: MIT
-->

<!DOCTYPE html>
<head>
<style>{{render_template("/style.css")}}</style>
@@ -9,4 +15,4 @@
<p><button class="button" onclick="window.location.href='/';">Home</button></p>
</table>
</body>
</html>
</html>
3 changes: 3 additions & 0 deletions examples/auth/cert.der.license
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
SPDX-FileCopyrightText: 2024 Charles Crighton <code@crighton.net.nz>

SPDX-License-Identifier: MIT
3 changes: 3 additions & 0 deletions examples/auth/developer_board.svg.license
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
SPDX-FileCopyrightText: 2024 Material Design icons by Google

SPDX-License-Identifier: Apache-2.0
8 changes: 7 additions & 1 deletion examples/auth/index.html
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
<!--
SPDX-FileCopyrightText: 2024 Charles Crighton <code@crighton.net.nz>
SPDX-License-Identifier: MIT
-->

<!DOCTYPE html>
<head>
<style>{{render_template("/style.css")}}</style>
@@ -12,4 +18,4 @@
<p><button class="button" onclick="window.location.href='/logout';">Logout</button></p>
</table>
</body>
</html>
</html>
3 changes: 3 additions & 0 deletions examples/auth/key.der.license
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
SPDX-FileCopyrightText: 2024 Charles Crighton <code@crighton.net.nz>

SPDX-License-Identifier: MIT
8 changes: 7 additions & 1 deletion examples/auth/login.html
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
<!--
SPDX-FileCopyrightText: 2024 Charles Crighton <code@crighton.net.nz>
SPDX-License-Identifier: MIT
-->

<!DOCTYPE html>
<head>
<style>{{render_template("/style.css")}}</style>
@@ -16,4 +22,4 @@
</div>

</form>
</body>
</body>
8 changes: 7 additions & 1 deletion examples/auth/logout.html
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
<!--
SPDX-FileCopyrightText: 2024 Charles Crighton <code@crighton.net.nz>
SPDX-License-Identifier: MIT
-->

<!DOCTYPE html>
<head>
<style>{{render_template("/style.css")}}</style>
@@ -9,4 +15,4 @@
<p><button class="button" onclick="window.location.href='/';">Home</button></p>
</table>
</body>
</html>
</html>
5 changes: 5 additions & 0 deletions examples/auth/main.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
# SPDX-FileCopyrightText: 2024 Charles Crighton <code@crighton.net.nz>
# SPDX-FileCopyrightText: 2022 Pimoroni
#
# SPDX-License-Identifier: MIT

# example script to show how uri routing and parameters work
#
# create a file called secrets.py alongside this one and add the
7 changes: 7 additions & 0 deletions examples/auth/style.css
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
/*
* SPDX-FileCopyrightText: 2024 2024 Charles Crighton <code@crighton.net.nz>
* SPDX-FileCopyrightText: 2024 Charles Crighton <code@crighton.net.nz>
*
* SPDX-License-Identifier: MIT
*/

@media (prefers-color-scheme: dark) {
body {
color: #eee;
6 changes: 6 additions & 0 deletions examples/ssl/example.html
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
<!--
SPDX-FileCopyrightText: 2024 Charles Crighton <code@crighton.net.nz>
SPDX-License-Identifier: MIT
-->

<!DOCTYPE html>
<head>
</head>
6 changes: 6 additions & 0 deletions examples/ssl/include.html
Original file line number Diff line number Diff line change
@@ -1 +1,7 @@
<!--
SPDX-FileCopyrightText: 2024 Charles Crighton <code@crighton.net.nz>
SPDX-License-Identifier: MIT
-->

Hello again {{name}}!
5 changes: 5 additions & 0 deletions examples/ssl/main.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
# SPDX-FileCopyrightText: 2024 Charles Crighton <code@crighton.net.nz>
# SPDX-FileCopyrightText: 2022 Pimoroni
#
# SPDX-License-Identifier: MIT

# example script to show how uri routing and parameters work
#
# create a file called secrets.py alongside this one and add the