- Email service takes optional
ctxargument, queued emails receivectxfrom queue service - Jobs can be created with optional
tagfield - Queue service has
searchAPI to filter fortags - Queue service start and lifecycle functions take optional
ctxargument when creating lifecycle, enabling multi-tenant queues - Job handlers and error handlers take optional
ctxargument
- Make id generating function for id middleware configurable
- Make
passwordof Sihl_user.t[@opaque]
- Make SMTP credentials optional
- Update SQL queries to use caqti infix notation
- Expos all log sources
- Fixed a bug in the CSRF middleware where the current session cookie was overriden with an empty session
- Fixed an issue where
Sihl.Database.Migration.execute_stepsignored the provided database pool in?ctxand instead creating its own pool
- CSRF tokens are now valid per session, not per request. This allows the user to open a form, use various parts of the website in another tab and then come back to the form and submit it.
- Enforce OCaml 4.12.0, which doesn't allow named arguments after optional arguments
- Provide optional
?idparameter whenever an entity is created, to override the generated it
- Expose service context on
user_from_session
- Added the concept of a service context
ctxwhich can be used for configuration that is valid for one function call only.
- Support
multipart/form-datain CSRF middleware
- It is now possible to register multiple instances of the same service type simultaneously
- Rename page title of queue dashboard
- Document
EMAIL_BYPASS_INTERCEPTandQUEUE_FORCE_ASYNC - Accept
true,Trueand1for truthy boolean env vars - Document global middlewares
- Fix issue where the default smtp certs path is an empty string
- Fix trailing slash middleware to work with
PREFIX_PATH
- The
search_queryforSihl.Database.prepare_search_requesthas to return the total amount of rows for that query without limit. On PostgreSQL and MariaDB this can be done withCOUNT(*) OVER() as total. Nocount_queryis needed anymore.
- Add optional
given_nameandname - Deprecate
update_detailsin favor ofupdate - Consistent use of named arguments in service API
- Optional argument
format_filterfor formatting the search keyword when filtering inSihl.Database.prepare_search_request
- Add CLI generators as built-in CLI commands
gen.service(for generating CRUD services),gen.view(for generating CRUD views) andgen.html(for generating CRUD RESTful resources) Sihl.Web.Rest.{query, to_query_string, of_query_string, next_page, previous_page, last_page, first_page, query_filter, query_sort, query_limit, query_offset}- Add ParcelJS based asset pipeline to template project in
template - Database helpers to conveniently run exactly one caqti request
Sihl.Database.find,Sihl.Database.find_opt,Sihl.Database.execandSihl.Database.collect - The
searchfunction of the user service fromsihl-usertakes an optional argumentoffset. This allows you to implement offset based pagination.
- Replace the usaged of
Lwt.Syntaxwithlwt_ppxfor nicer error messages in your Sihl apps - Rework built-in commands (
startis nowserver, commands are namespaced with.) - The command function in
Sihl.Command.makereturnsunit option Lwt.tand Sihl takes care of printing the usage ifLwt.return Noneis returned - Replaced
Sihl.Database.prepare_requestswithSihl.Database.prepare_search_request - Replaced
Sihl.Database.run_requestwithSihl.Database.run_search_request - Make search query type
'a Sihl.Database.prepared_search_queryabstract to reduce API clutter. The search queries are highly specific to the implementation and are not likely to be re-used independently fromrun_search_request. - Change
queryto fully fledgedsearchinSihl.Rest.SERVICEto support paginated, filtered and sorted views
Sihl.Web.Restprovides helpers to quickly create HTML resources. This is useful to expose any service of typeSihl.Web.Rest.SERVICEthrough the Internet by making it part of a web app.
- Register timezone removal migration in
sihl-queue. This makes it easy to change the timezone on the server without breaking applications.
- Get rid of
Sihl.Web.Middleware.htmx,Sihl.Web.Htmxcan be used directly now Sihl.Web.Csrf.findreturnsstring option, useOption.getif you are sure that the CSRF middleware has been applied- Take custom
unauthenticated_handlerforSihl.Web.Middleware.bearer_tokenand enforce existence ofBearertoken inAuthorizationheader - Web helpers moved from
Sihl.Web.HttptoSihl.Web. InSihl.Web.Httpthere is only the Opium based HTTP service. - Replace middlewares with helpers where they don't have to be middlewares such as bearer token (
Sihl.Web.Request.bearer_token), htmx (Sihl.Web.Htmx) and session (Sihl.Web.Session) - Remove
formmiddleware (Sihl.Web.Middleware.form), useSihl.Web.Requestdirectly to parse form requests - Replace
Sihl.Web.Flash.find_customwithSihl.Web.Flash.findandSihl.Web.Flash.set_customwithSihl.Web.Fash.setto support key-value based semantics. If you need to store your custom string, simply store it under a key likeSihl.Web.Flash.set [("custom", value)] respand retrieve it withSihl.Web.Flash.find "custom" request - Use
conformist0.4.0
- Read
Request-ID-Xheader if present instead of generating a random id forSihl.Web.Id - Implement composable router API
Sihl.Web.{get, post, ...}andSihl.Web.choose. - Implement job queue dashboard for
sihl-queue
- Replace functor based approach with service facade pattern based approach to increase ergonomy
- Move
user_tokenmiddleware tosihl-tokenpackage
- Implement MariaDB and PostgreSql backends for all services except storage service
- JSON Web Token backend for the token service
- Default middlewares for server side rendered forms and JSON API
- Merge form data and urlencoded form parsing and provide them in one middleware
- Two subsequent
POSTrequest works now with the CSRF middleware
- Extract
sihl-core,sihl-type,sihl-contract,sihl-user,sihl-persistenceandsihl-webas separate opam packages - Increase session key size to 20 bytes
- Sign session cookies with
SIHL_SECRET - Simplify session service API
- Implement generic flash storage on top of session storage and replace the specific message service
- Update to httpaf-based Opium 0.19.0
- File log reporter to store logs in
logs/error.logandlogs/app.log - Add log source to log text
- Properly load
.envfiles based on project root, can be set usingENV_FILES_PATH - Add custom error types for user actions to allow overriding errors displayed to users
- Determine project rood using markers such as the .git folder
- Get rid of
Core.Ctx.t - Make sure migrations and repo cleaners are registered when registering service
Sihl.Core.*modules are now accessible directly underSihl.*
- Get rid of
Result.get_okbecause it swallows errors
- Simplify
Database.ServiceAPI: Only providetransaction,queryandfetch_pool - Fixe dune package names, private dune packages don't have generic names like
httpordatabasecausing conflicts in a Sihl app
Database.ServiceandRepository.Serviceare assumed to have just one implementation, so they are referenced directly in service implementations instead of passing them as functor arguments- Extract
Random.Servicefrom utils as standalone top level service - Merge utils into one
utils.mlfile
Sihl.Http.ResponseandSihl.Http.Requesthave consistent APISihl.Middlewarecontains all provided middlewares- Implement multi-part form data parsing
- Remove seed service since the same functionality
- Simplify app abstraction, instead of
with_use service APIs directly - Extract storage service as
sihl-storageopam package - Extract email service as
sihl-emailopam package - Extract queue service as
sihl-queueopam package - Move configuration and logging into core, neither of the are implemented as services
- Replace
pcrewithreas regex library to get rid of a system dependency on pcre - Split up
Sihl.DataintoSihl.Migration,Sihl.RepositoryandSihl.Database - Move module signatures from
Foo.Service.SigtoFoo.Sig, the services might live in a third party opam package, but the signatures are staying insihl - Move
Sihl.ApptoSihl.Core.Appand simplify app API - Move log service, config service and cmd service into core (they don't have to be provided to other services through functors)
- Simplify Sihl app creation and service configuration
- Remove
reasonandtyxml-jsxas dependency as they are not used anymore
- Various combinators for
Sihl.Seed.tincluding constructor and field accessors
- Seed Service with commands
seedlistandseedrun <name>
- Lifecycle API: A service now has two additional functions
startandstop, which are used in the lifecycle definition - Database service query functions
query,atomicandwith_connectioncan now be nested
- Re-export
Sihl.Queue.Job.t - Export content types under
Sihl.Web
- Don't raise exception when user login fails if it is a user error
- Remove dev tools as dev dependencies
- Storage service can remove files
- Move README.md documentation to ocamldoc based documentation
- DB connection leaks caused deadlocks
- Provide all service dependencies using functors
- Move Opium & Cohttp specific stuff into the web server service implementation to allow for swappable implementation based on something like httpaf
- Inject log service to all other services by default
- Support letters 0.2.0 for SMTP emailing
- Switch to exception based service API
- HTTP Response API to respond with file
Sihl.Web.Res.file
- Stop running integration tests during OPAM release
- Initial release of Sihl