Commit Graph

2623 Commits

Author SHA1 Message Date
Cursor Agent 57fb5cc1fa Fix OIDC redirect to preserve query parameters and prevent open redirects
Co-authored-by: contact <contact@ophir.dev>
2025-07-28 22:57:15 +00:00
lovasoa 7b7e4ccdc0 Escape search input in SQLite FTS queries
The search term is now properly escaped when used in SQLite full-text
search queries to prevent syntax errors with quotes. This ensures
searches containing quotes work correctly.
2025-07-28 18:08:29 +02:00
Ophir LOJKINE 33125565d3 Check for 404 before redirecting on no-extension paths (#972)
* Check for 404 before redirecting on no-extension paths

The commit improves routing logic by checking if a path would result in
a 404

fixes https://github.com/sqlpage/SQLPage/issues/971 before adding a
trailing slash. This prevents unnecessary redirects when a custom 404
handler exists.

* Fix test function signature formatting in routing module (#973)

Co-authored-by: Cursor Agent <cursoragent@cursor.com>

* Simplify path resolution and redirect logic

The shorter code more clearly handles finding files with .sql extensions
and decides whether to add trailing slashes based on index file
presence.

* clippy

---------

Co-authored-by: Cursor Agent <cursoragent@cursor.com>
2025-07-28 17:54:23 +02:00
lovasoa 1860aa8433 v0.36 2025-07-27 23:08:12 +02:00
lovasoa ae30d82917 biome fixes 2025-07-27 00:09:39 +02:00
lovasoa 6704dce04a sqlparser changelog 2025-07-27 00:03:51 +02:00
lovasoa 6e4227381f update sql parser 2025-07-26 23:43:25 +02:00
lovasoa 233cbb8837 update rust dependencies 2025-07-26 23:38:16 +02:00
lovasoa 0d7d58c103 update biome 2025-07-26 23:37:32 +02:00
lovasoa 16ed836782 Chart component: accept numerical values passed as strings in pie
charts.
2025-07-26 23:29:15 +02:00
lovasoa 8a3d51f385 Update CHANGELOG.md 2025-07-25 21:54:40 +02:00
lovasoa be9170d0bb update tabler icons 2025-07-25 21:54:33 +02:00
lovasoa 4af50e847f update tabler to v1.4 2025-07-25 21:49:08 +02:00
lovasoa 1820707591 Update apexcharts.js 2025-07-25 21:45:47 +02:00
lovasoa 630882ef5c remove large file 2025-07-25 21:30:15 +02:00
Lenardt Gerhardts 84db9b2276 Added configuration option to skip OIDC authorization checks for certain endpoints (#969)
* Added posibility to bypass oidc authentication for certain endpoints

* fixxed missing .clone()

* Fixxed oidc_skip_endpoints not being optional

* feat(oidc): Introduce protected path prefixes

This commit replaces the OIDC endpoint blacklist with a path prefix whitelist. This is a more intuitive and secure approach for managing protected routes.

The new `oidc_protected_paths` configuration option allows users to specify a list of URL prefixes that require OIDC authentication. By default, all paths are protected.

The documentation has been updated to reflect this change, with clear examples and more user-friendly language.

* docs(oidc): Improve OIDC documentation and examples

This commit improves the OIDC documentation and the "single sign on"
example to better demonstrate how to create a selective login system.

The main documentation now includes a section on creating a public
login page and the "single sign on" example has been updated to
reflect this pattern.

* Simplify OIDC middleware request handling for unprotected paths

* docs(oidc): Improve single sign on example

This commit improves the "single sign on" example to better
demonstrate a public information page that adapts to the users
login status and a separate protected page.

* docs(oidc): Document oidc_protected_paths in configuration.md

This commit updates the main configuration documentation to reflect the
new `oidc_protected_paths` option. It removes the outdated
`oidc_skip_endpoints` and provides a more detailed explanation of how
to create a mix of public and private pages.

* Improve SSO demo UX

- Update docker compose command to use `--watch` flag - Add watch
configuration for SQLPage development - Enhance login page with hero
component and better styling - Simplify protected page welcome message -
Fix OIDC middleware path check logic - Update protected paths in config
to use `/protected` instead of `/protected.sql`

* Skip OIDC auth for non-protected paths later in middleware

We still want to be able to access authenticated user's info in
non-authenticated parts of the app.

We crucially need to check request.path() == SQLPAGE_REDIRECT_URI before
the protected_paths check

* Added whitelist option

* Update configuration.md

* Improve OIDC public paths documentation

The documentation now provides clearer examples and explains the
interaction between public and protected paths more precisely. Also
removes the now-unused default_oidc_public_paths function since the
field's default is handled by serde's default for Vec.

* Add OidcConfig method to check public paths

The new `is_public_path` method consolidates the logic for checking if a
path should bypass OIDC authentication. This replaces the previous
inline checks for public and protected paths.

* fix default empty public paths

* Update SSO example with new image path and public access rules

- Change hero image path in login page - Remove protected.sql as it's no
longer needed - Update sqlpage.yaml to allow public access to
/protected/public

---------

Co-authored-by: Lenardt Gerhardts <lenardt.gerhardts@obi.de>
Co-authored-by: lovasoa <contact@ophir.dev>
2025-07-25 21:15:53 +02:00
lovasoa 57ba206c78 cargo fmt 2025-07-24 23:47:45 +02:00
lovasoa e3334380af Move CLI parsing to separate module
fix potential cli parsing crash
2025-07-24 23:20:10 +02:00
lovasoa 7f7549ec38 fix clippy errors
introduced by https://github.com/sqlpage/SQLPage/pull/943
2025-07-24 22:45:45 +02:00
Ophir LOJKINE a351d6b8fc sso docs: do not mention github, since it is not an oidc provider
github does not implement oidc

see https://github.com/sqlpage/SQLPage/issues/963
2025-07-18 18:09:51 +02:00
lovasoa 32a875d34d Optimize category collection in chart data processing
Replace the iterative series filtering with a flatMap initialization and
remove series from processing when they have no more data points
2025-07-02 00:11:08 +02:00
lovasoa ee156d943d Sort chart categories by name instead of first appearance
fixes https://github.com/sqlpage/SQLPage/issues/951
2025-07-01 23:58:22 +02:00
lovasoa 7004ebc8f7 Fix potential null reference in chart value formatting 2025-07-01 16:58:36 +02:00
lovasoa 21b4287753 test new modal component + changelog 2025-06-27 15:49:34 +02:00
olivierauverlot 3834f18e88 New modal component (#934)
* New modal component and upgrade of the button component to allow the opening of a modal box

* Modal component

* Update examples/official-site/sqlpage/migrations/63_modal.sql

* Support for embed content in modal box
2025-06-27 14:32:37 +02:00
lovasoa e8516b4329 document migration creation subcommand 2025-06-27 12:02:51 +02:00
lovasoa fef3778a1e Merge remote-tracking branch 'refs/remotes/origin/main' 2025-06-27 11:58:16 +02:00
lovasoa 8b24838c37 Update dependencies 2025-06-27 11:57:51 +02:00
Andrews Innovations 453701c17c Added create-migration command line instruction (#943)
* Added create-migration command line instruction

This update adds a command line interface to create migrations directly with sqlpage, and have it manage the timestamps and uniqueness of migration names.

* Update sqlpage/migrations/README.md

Co-authored-by: Ophir LOJKINE <contact@ophir.dev>

* Update sqlpage/migrations/README.md

Co-authored-by: Ophir LOJKINE <contact@ophir.dev>

* Updated with changes for config directory, migration output

Now respects the configuration_directory environment variable.

It also outputs the path of the new migration created when it is created, and takes care to display that path relative to the current working directory.

Lastly, the execution of create-migration command was moved above the rest of the initialization, so that creating a new migration does not run existing migrations. This allows you to create multiple migrations before you run sqlpage normally again to execute them.

---------

Co-authored-by: Ophir LOJKINE <contact@ophir.dev>
2025-06-25 10:45:39 +02:00
Andrew Straw 7ccf735298 fix docs (#942)
The `:` character is a colon (not a semi-colon).
2025-06-22 17:43:23 +02:00
lovasoa 92310643ae Update CHANGELOG.md 2025-06-20 21:23:12 +02:00
lovasoa 9c49a524c1 update dependencies 2025-06-20 21:23:08 +02:00
francesco-cattoglio cc6a391810 Added a compile time flag to compile SQLite with builtin math functions (#938)
* Added a compile time flag to compile SQLite with builtin math funcions

* Added a test, improved the comments in cargo config file
2025-06-20 21:19:47 +02:00
lovasoa 33f82053da temporary disable postgres money test
postgres' money type is not yet supported
2025-06-08 22:51:41 +02:00
lovasoa 5dcbe125b9 support mssql money types 2025-06-08 03:48:59 +02:00
lovasoa 8b13464be5 test money decoding 2025-06-08 01:45:07 +02:00
lovasoa e3343fb426 remove outdated entries from cargo package 2025-06-02 21:36:46 +02:00
lovasoa 33ce3a2e25 move default sql files 2025-06-02 21:35:16 +02:00
lovasoa 66b35193ed rename default 404 file to default_404.sql 2025-06-02 21:27:31 +02:00
lovasoa fdee60146f format 2025-06-02 21:19:01 +02:00
lovasoa 3e181ce453 Update CHANGELOG.md
CI / compile_and_lint (push) Has been cancelled
CI / test (mssql) (push) Has been cancelled
CI / test (mysql) (push) Has been cancelled
CI / test (postgres) (push) Has been cancelled
CI / windows_test (push) Has been cancelled
CI / docker_build (linux/amd64) (push) Has been cancelled
CI / docker_build (linux/arm/v7) (push) Has been cancelled
CI / docker_build (linux/arm64) (push) Has been cancelled
CI / docker_push (push) Has been cancelled
Create Release / Build sqlpage binaries (macOS & Windows) (.exe, windows-latest, x86_64-pc-windows-msvc) (push) Has been cancelled
Create Release / Build sqlpage binaries (macOS & Windows) (macos-latest, x86_64-apple-darwin) (push) Has been cancelled
Create Release / Build sqlpage binaries (Linux) (push) Has been cancelled
Create Release / Build AWS Lambda Serverless zip image (push) Has been cancelled
Create Release / Create Github Release (push) Has been cancelled
Create Release / Publish to crates.io (push) Has been cancelled
v0.35.2
2025-06-02 21:03:20 +02:00
lovasoa ca00eaa07a chart item ordering
fixes https://github.com/sqlpage/SQLPage/discussions/930Preserve original category order for bar charts

Single-series bar charts now retain their original data point order.
For multi-series bar charts, categories are aligned and ordered by
their first appearance in the data, instead of alphabetically.
2025-06-02 20:59:10 +02:00
lovasoa d0e493fb13 Rich text editor: readonly mode
https://github.com/sqlpage/SQLPage/discussions/913#discussioncomment-13343491
2025-06-02 20:57:19 +02:00
lovasoa e90002a932 Update Cargo.toml 2025-06-02 13:12:03 +02:00
lovasoa cb9d89d6b9 fix mssql unsigned int decoding 2025-06-02 00:29:15 +02:00
lovasoa e1876ff1d6 explicit sqlx feature activation 2025-06-01 23:09:25 +02:00
lovasoa c92c1bb1e6 Update Cargo.lock 2025-05-31 15:07:26 +02:00
lovasoa 5ade60fa95 Return plain text 404 for non-HTML requests
Checks the `Accept` header for 404 responses. If HTML is not
preferred, a plain text 404 is returned, avoiding the
`_default_404.sql` processing. HTML-preferring clients
continue to receive the custom SQL-based 404 page.
2025-05-30 22:49:26 +02:00
lovasoa 674da32fd8 Update cc crate to 1.2.25 2025-05-30 21:10:38 +02:00
lovasoa 7c6e027d11 Warn on large OIDC ID tokens
see https://github.com/sqlpage/SQLPage/issues/928
2025-05-30 21:09:49 +02:00