Commit Graph

2623 Commits

Author SHA1 Message Date
olivierauverlot 29f64479b5 form improvements with new types of field: header and switch (#906)
* form improvements with new types of field: header and switch

* added checked toggle switch example

* add names to the switch checkboxes

* update form header margins

* trailing whitespace

* docs

---------

Co-authored-by: lovasoa <contact@ophir.dev>
2025-05-20 00:54:05 +02:00
lovasoa bbaf2097fa improve official site form field visual appearance 2025-05-20 00:34:13 +02:00
lovasoa cc1657193c update tabler to v1.3
fixes https://github.com/sqlpage/SQLPage/issues/901
mostly fixes https://github.com/sqlpage/SQLPage/issues/892
see https://github.com/tabler/tabler/issues/2283#issuecomment-2892385617
2025-05-20 00:27:23 +02:00
lovasoa 04e1046018 fix alert component styles 2025-05-14 00:44:51 +02:00
lovasoa 9939c7512c fmt 2025-05-09 02:04:04 +02:00
lovasoa a07ddc167c rich text editor: improve handling of attributes for paragraphs, headings, list items, blockquotes, and code blocks 2025-05-09 01:42:05 +02:00
lovasoa 3075e482b6 improve rich text edition
https://github.com/sqlpage/SQLPage/discussions/913#discussioncomment-13079456
2025-05-09 01:35:55 +02:00
lovasoa 84d959425b article width style 2025-05-09 00:27:50 +02:00
lovasoa 15c7b07a73 lint 2025-05-08 23:51:37 +02:00
lovasoa 49ab2be35d add null handling for search input and clean up whitespace
fixes https://github.com/sqlpage/SQLPage/issues/884#issuecomment-2863873123
2025-05-08 23:14:11 +02:00
lovasoa c323bde4da fmt 2025-05-08 23:01:55 +02:00
lovasoa a9d24672f0 fix error message layour issue 2025-05-08 22:47:03 +02:00
lovasoa fb26609325 Refactor example cards: move example cards data to a new migration file and remove deprecated SQL from index.sql. Add rich text editor SVG asset. 2025-05-08 01:03:26 +02:00
lovasoa 3d9ab826df Enhance rich text editor: add required field validation for content and implement Markdown to Quill Delta conversion
fixes https://github.com/sqlpage/SQLPage/discussions/913
2025-05-08 01:02:56 +02:00
lovasoa 845e0371ec sql-page.com search: dynamic component retrieval and improve link data handling 2025-05-08 01:01:46 +02:00
lovasoa d526ccbc01 add full text search 2025-05-07 01:50:04 +02:00
lovasoa f5730354fb update sql parser
see https://github.com/apache/datafusion-sqlparser-rs/blob/main/changelog/0.56.0.md
fixes https://github.com/sqlpage/SQLPage/issues/887
2025-05-06 23:32:56 +02:00
lovasoa 616ac2a561 fix list component text truncation for empty descriptions 2025-05-06 23:07:53 +02:00
lovasoa c00446ca21 clippy 2025-05-06 22:47:12 +02:00
lovasoa 94a56bf5b9 more memory efficient CSP templates 2025-05-06 22:47:00 +02:00
lovasoa 06292a97d6 OIDC token: implementing max age for auth cookies based on ID token expiration
Refactor claims retrieval in get_authenticated_user_info to return claims directly.
2025-05-06 22:46:07 +02:00
lovasoa edf36b311f changelog 2025-05-06 09:41:03 +02:00
Andrews Innovations 275b44ae51 Add active indicator to the shell nav items (#908)
* Added active indicator to the nav-item to highlight active navigation item

* Update documentation to reflect active property on a menu_item

* Updated shell component examples to separate active flag as its own example

* Update examples/official-site/sqlpage/migrations/01_documentation.sql

---------

Co-authored-by: Ophir LOJKINE <contact@ophir.dev>
2025-05-06 09:36:43 +02:00
Gus Power 1582956ae5 Extend CSP Configuration to handle user-supplied values that can contain {NONCE} (#911)
* Extend CSP Configuration to handle user-supplied values that can contain {NONCE}

* fix RequestContext to use CSP value from AppConfig

* update documentation to describe usage

* generate nonce per request; config is a string (again); added playwright test to verify subsequent requests return a different nonce.

* fix js lint `let` -> `const`

* format

* remove some useless string copies

we are still re-parsing the csp template on every request

* implement a proper csp template struct

* parse the content-security-policy just once

* fix merge issue.

* fix docs

* fix docs

* clippy

---------

Co-authored-by: lovasoa <contact@ophir.dev>
2025-05-06 09:34:46 +02:00
Ophir LOJKINE adcbaa680b Single Sign-On via OpenID Connect (#888)
* add oidc config variables

* setup a basic middleware

* implement an async http client that uses oidc

* initialize provider_metadata in OidcService

* better error handling in oidc config

* HTTP client initialization in oidc now follows global config

* oidc: implement redirects

- Add `host` configuration option for specifying the application's web address in configuration.md and app_config.rs.
- Update docker-compose.yaml to include SQLPAGE_HOST and SQLPAGE_OIDC_ISSUER_URL environment variables.
- Enhance OIDC middleware to utilize the new `host` setting for redirect URLs and improve cookie handling in oidc.rs.

* improve local oidc configurability

* log

* Update warning message in OIDC configuration to clarify how to disable it by providing a host setting

* Update OIDC redirect logging to use info level with client ID

* Refactor unauthenticated request handling in OIDC service

- Extracted logic for handling unauthenticated requests into a separate method `handle_unauthenticated_request`.
- Updated the main request handling flow to utilize the new method for improved readability and maintainability.

* Enhance OIDC service with callback handling and token processing

- Introduced `handle_oidc_callback` method to manage OIDC callback requests.
- Added `process_oidc_callback` and `exchange_code_for_token` methods for token exchange logic.
- Updated `handle_unauthenticated_request` to check for callback URL and redirect accordingly.
- Refactored `build_redirect_response` to improve clarity in response handling.

* in handle_oidc_callback use service_request.into_response

* fmt

* Implement oidc code exchange and token storage

* validate oidc cookies

- Updated `get_sqlpage_auth_cookie` to return a result for better error handling and validation of the SQLPage auth cookie.
- Improved logging throughout the OIDC service for better traceability of requests and responses.
- Adjusted the handling of OIDC callback parameters to include context in error messages.

* OIDC callback: redirect to the auth URL on failure.

* oidc use localhost for redirect config instead of 0.0.0.0 by default

* Enhance OIDC provider metadata discovery with improved logging and error context

* maintain the initial URL during OIDC authentication

- Added state cookie handling to maintain the initial URL during OIDC authentication.
- Refactored `build_auth_url` to accept the initial URL as a parameter.
- Enhanced `process_oidc_callback` to retrieve the state from the cookie and redirect accordingly.

* implement csrf token

* update deps

* update sso examples

* nonce verification

- Improved error logging for invalid auth cookies and ID token verification.
- Introduced nonce verification logic to ensure security during OIDC authentication.
- Adjusted parameters for nonce hashing to optimize for short-lived tokens.

* Refactor OIDC logging and improve documentation

- Updated logging statements for better clarity and context.
- Refactored code for nonce verification and error handling.
- Enhanced documentation in `app_config.rs` for clarity on `https_domain` usage.

* Remove unused app_state field from OidcService struct

* Enhance OIDC client error handling and refactor HTTP request types

- Added context to OIDC client creation error handling.
- Updated HTTP request and response types for better integration with the openidconnect library.
- Introduced AwcWrapperError for improved error management in HTTP calls.

* clippy fixes

- Changed http_client from Arc to Rc in OidcService for improved memory efficiency.
- Updated related code to reflect the new ownership model for the HTTP client.

* initialize the oidc and http clients only once

- Added OidcState struct to encapsulate OIDC configuration and client.
- Refactored OidcMiddleware to utilize OidcState for improved state management.
- Updated HTTP client handling in OIDC service methods for better integration with app data.
- Enhanced logging for OIDC middleware initialization and request processing.

* functions for accessing user claims from OIDC tokens + documentation

- Updated SQLPage authentication component documentation for clarity on usage and options.
- Removed deprecated login and redirect handler scripts to streamline the SSO implementation.
- Enhanced logout functionality to properly clear session cookies and redirect users.
- Improved request handling to include OIDC claims in the request context for better user information retrieval.

* better sso troubleshooting info

* fmt

* add sso to the changelog
2025-05-05 17:59:07 +02:00
ppom f205b65e93 Fix SQLite examples having PostgreSQL :: syntax (#903)
According to discussion here
https://github.com/sqlpage/SQLPage/pull/897#issuecomment-2835516830

Co-authored-by: ppom <>
2025-04-29 22:22:37 +02:00
Ophir LOJKINE b05316d6d0 Update 01_documentation.sql 2025-04-28 09:57:42 +02:00
ppom 10d4c69c80 Documentation: add "Extensions to SQL" page (#897)
Fix #877

Co-authored-by: ppom <>
Co-authored-by: Ophir LOJKINE <contact@ophir.dev>
2025-04-28 09:19:23 +02:00
lovasoa 8017ecd125 fix form dropdowns
workaround for #894

the source issue is https://github.com/tabler/tabler/issues/2284

closes https://github.com/sqlpage/SQLPage/issues/894
2025-04-24 17:57:38 +02:00
lovasoa 1d87e88742 update tabler.io js to 1.2.0 2025-04-24 17:10:34 +02:00
Amruta.org 74d5b24f9a Replace hardcoded strings with customizable attributes in multiple components (#893)
* Update shell.handlebars

adding two options:
search_button
search_placeholder

* Update table.handlebars

adding search_placeholder option

* Update 01_documentation.sql

documentation update for the shell component options:
search_placeholder
search_button
and for the table component option: search_placeholder

* avoid failing tests on long loading map tiles

* add an example for search_placeholder

---------

Co-authored-by: lovasoa <contact@ophir.dev>
2025-04-24 16:01:25 +02:00
olivierauverlot 32778bf0ad New component : Empty state (#890)
* empty_state component added

* empty_state component added

* Correction and new example

* rename status_code to header

* Enhance empty_state component documentation and template to support rich text formatting. Update docs with detailed descriptions and examples, and modify Handlebars template to conditionally render Markdown content.

* add and document class and id attributes

---------

Co-authored-by: lovasoa <contact@ophir.dev>
2025-04-24 14:51:40 +02:00
lovasoa 5979e31536 bump to v0.35
update deps
2025-04-23 16:39:24 +02:00
lovasoa fb2091921c update to tabler css v1.2 2025-04-23 16:30:59 +02:00
lovasoa 524c5f939a grammar 2025-04-22 11:06:47 +02:00
lovasoa 407bc81664 improve the documentation for the redirect component 2025-04-22 11:05:37 +02:00
lovasoa b9c383fe8d add monospace font option in tables
It was present in the documentation, but never actually implemented

Fixes https://github.com/sqlpage/SQLPage/issues/889
2025-04-22 09:53:29 +02:00
lovasoa 90d4b010fd update to rust 1.86 2025-04-21 09:29:47 +02:00
lovasoa 7d1e85f2fc fix unstable lib usage 2025-04-21 09:28:37 +02:00
lovasoa 05fd4d2ed3 sort imports 2025-04-21 09:12:12 +02:00
lovasoa 9a401b6106 format 2025-04-21 09:10:02 +02:00
lovasoa 8725fb7393 rich text in changelog 2025-04-21 09:09:35 +02:00
lovasoa d6913e2b3c handle newlines, prevent duplication in lists and blockquotes, and improve line break processing in rich text editor 2025-04-21 03:22:18 +02:00
lovasoa c203af6716 refactor deltaToMarkdown and createTextNode functions for improved text handling in rich text editor 2025-04-21 03:08:24 +02:00
lovasoa 379e5a31c0 update SQL link generation and refactor deltaToMdast function for improved text processing in rich text editor 2025-04-21 02:46:45 +02:00
lovasoa 482c8e614d add code formatting option to rich text editor toolbar 2025-04-21 02:18:12 +02:00
lovasoa 8a25a90d25 add type annotations 2025-04-21 02:13:16 +02:00
lovasoa 4664c22cba clean up rich text editor code 2025-04-21 02:04:50 +02:00
lovasoa d0b60e1b0e enhance deltaToMdast function to support code blocks, blockquotes, and lists in rich text editor 2025-04-21 02:00:46 +02:00
lovasoa 772970db13 add code block option to rich text editor toolbar 2025-04-21 01:38:53 +02:00