<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Christian Stephan on Medium]]></title>
        <description><![CDATA[Stories by Christian Stephan on Medium]]></description>
        <link>https://medium.com/@cstephan-dev?source=rss-abd5fdd6f93f------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*pYTXWT7qOOpaWUjUqo3ylA.png</url>
            <title>Stories by Christian Stephan on Medium</title>
            <link>https://medium.com/@cstephan-dev?source=rss-abd5fdd6f93f------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Fri, 04 Dec 2026 13:21:40 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@cstephan-dev/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Venom Pluries: integration tests in YAML]]></title>
            <link>https://cstephan-dev.medium.com/venom-pluries-integration-tests-in-yaml-74ed915af3ff?source=rss-abd5fdd6f93f------2</link>
            <guid isPermaLink="false">https://medium.com/p/74ed915af3ff</guid>
            <category><![CDATA[software-testing]]></category>
            <category><![CDATA[venom]]></category>
            <category><![CDATA[test-automation]]></category>
            <category><![CDATA[qa]]></category>
            <dc:creator><![CDATA[Christian Stephan]]></dc:creator>
            <pubDate>Mon, 30 Nov 2026 11:16:14 GMT</pubDate>
            <atom:updated>2026-11-30T11:16:14.512Z</atom:updated>
            <content:encoded><![CDATA[<p><em>What Venom is, what a fork of it adds, and how to try it in a few minutes.</em></p><p>Venom is a command line tool for integration tests. You write a test in YAML. Venom runs it with executors (an HTTP call, a script, a database query, a message on a queue) and checks the result with assertions. It comes from OVHcloud and is open source under the Apache 2.0 licence.</p><blockquote>An AI assistant helped me draft this article; I edited it and checked every claim against the public repositories. Venom Pluries is a fork of that project.</blockquote><h3>What a test looks like</h3><p>A suite is a list of test cases. Each case has steps, and each step names an executor and some assertions. This is the first case of the HTTP example in the fork’s repository:</p><pre>name: First suite<br>vars:<br>  base_url: &quot;&quot;        # given at run time<br>  token: &quot;&quot;           # given at run time (VENOM_VAR_token), never written here<br>secrets:<br>  - token<br>testcases:<br>  - name: the service answers<br>    steps:<br>      - type: http<br>        method: GET<br>        url: &quot;{{.base_url}}/health&quot;<br>        assertions:<br>          - result.statuscode ShouldEqual 200<br>          - result.bodyjson.status ShouldEqual ok</pre><p>The token is declared under secrets:, so a report hides it. The example has three test cases: the service answers, the items are listed when the token is present, and they are refused when it is missing.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Vl2thWcGIgERlFRmAk7Kqg.png" /><figcaption><em>How a suite is built: a suite holds test cases, a test case holds steps, and each step pairs an executor with assertions.</em></figcaption></figure><p>A run looks like this, taken from the Venom project’s own demonstration: one assertion fails, the file is fixed, and the second run passes.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6cRWuJsi_zSm3iil7amPYQ.gif" /></figure><h3>What the fork adds</h3><p>The fork has 20 executor folders, where upstream has 18.</p><p><strong>Two new executors.</strong> mcp calls an MCP (Model Context Protocol) server: it lists and calls tools, reads resources, gets prompts, and asserts on the answer, over stdio or streamable HTTP. mobile drives a native or hybrid Android or iOS app through an Appium 3 server, locally or on a Mac reached through SSH. A suite can install an app, tap, type, read text, scroll, take a screenshot, open a deep link and answer an iOS system alert.</p><p><strong>A web executor on Playwright.</strong> The fork’s go.mod depends on github.com/mxschmitt/playwright-go; upstream&#39;s web executor depends on kevinramage/venomWeb.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*eUrc_DGtD745djT6k6XZgA.png" /><figcaption><em>How the three new executors reach what they test: web through Playwright, mobile through an Appium server, mcp over stdio or streamable HTTP.</em></figcaption></figure><p><strong>Parallel runs.</strong> venom run --parallel 4 runs up to four test files at once. Upstream&#39;s run command has no such option. The unit is the file: cases and steps inside a file still run in order. The README&#39;s figures, on eight files that each wait on something:</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fdatawrapper.dwcdn.net%2FJR1ol%2F1%2F&amp;display_name=Datawrapper&amp;url=https%3A%2F%2Fdatawrapper.dwcdn.net%2FJR1ol%2F1%2F&amp;image=https%3A%2F%2Fdatawrapper.dwcdn.net%2FJR1ol%2Fplain-s.png%3Fv%3D1&amp;type=text%2Fhtml&amp;schema=dwcdn" width="600" height="117" frameborder="0" scrolling="no"><a href="https://medium.com/media/d3b929d03d352b70a28f215cd50604f0/href">https://medium.com/media/d3b929d03d352b70a28f215cd50604f0/href</a></iframe><p>On the project’s own short suites, which mostly do not wait, --parallel 4 was about 1.2 times faster.</p><p><strong>Custom executors.</strong> A custom executor is one you write in YAML, built from other steps. I ran the same suite on upstream’s latest code and on the fork, on one machine: one test case of 2,000 steps, each calling a custom executor that calls a second that calls a third, which reads a small file.</p><iframe src="https://cdn.embedly.com/widgets/media.html?url=https%3A%2F%2Fdatawrapper.dwcdn.net%2F8qk2U%2F1%2F&amp;type=text%2Fhtml&amp;schema=dwcdn&amp;display_name=Datawrapper&amp;src=https%3A%2F%2Fdatawrapper.dwcdn.net%2F8qk2U%2F1%2F" width="600" height="155" frameborder="0" scrolling="no"><a href="https://medium.com/media/40cb9fcc3a6d408ec1992a50dbffb79f/href">https://medium.com/media/40cb9fcc3a6d408ec1992a50dbffb79f/href</a></iframe><p>With 300 steps the two were close, so the gap comes from long test cases. I have not worked out why upstream slows down, and this is one scenario, not a general speed claim.</p><p><strong>One TLS layer.</strong> Six executors (http, grpc, kafka, imap, smtp and ovhapi) take their TLS settings through one shared package, and one conformance test runs them together: trusted CA, client certificate, untrusted CA, skipped verification. Other executors with TLS options are not in it yet.</p><p><strong>SSH host keys.</strong> An ssh step can pin the server’s key with knownhosts or hostkey. With neither, the executor warns once and skips the check, a default meant for test hosts whose key changes on every run. Pin the key for any host that stays.</p><p><strong>Linting.</strong> golangci-lint runs with a complexity limit of 15 per function.</p><h3>Examples: web, mobile and MCP</h3><p>These are cut from the repository’s own suites; the only edit is the page address in the web one. A recipe is an ordinary suite. Each test case name starts with the id of the scenario it proves in a spec (US1-AS3 is user story 1, scenario 3), and venom recipe check ties the two together. It has 11 rules and, with --coverage, lists which scenarios the recipes prove.</p><p><strong>Web, on Playwright.</strong> A page, a field, a button and an assertion on what the page shows. A selector can also be a role, a label, a text or a test id.</p><pre>name: Recipe fixture page<br>vars:<br>  spec: 014-web-mobile-recipes<br>  appUrl: &quot;&quot;        # given at run time<br>  web:<br>    driver: chrome<br>    headless: true<br>testcases:<br>- name: US1-AS3 an item typed in the input is added to the list<br>  steps:<br>  - type: web<br>    action:<br>      navigate:<br>        url: &quot;{{.appUrl}}&quot;<br>  - type: web<br>    action:<br>      fill:<br>      - find: &#39;[data-test=&quot;item-input&quot;]&#39;<br>        text: milk<br>  - type: web<br>    action:<br>      click:<br>        find: &#39;[data-test=&quot;add-button&quot;]&#39;<br>  - type: web<br>    action:<br>      find: &#39;[data-test=&quot;item&quot;]&#39;<br>    assertions:<br>    - result.find ShouldEqual 1<br>    - result.text ShouldEqual milk</pre><p><strong>Mobile.</strong> The same shape against a Flutter app. readattr comes from a variables file for each platform, so one suite runs on Android and on iOS.</p><pre>name: Flutter counter app, find, tap, read<br>vars:<br>  spec: 008-mobile-executor<br>testcases:<br>  - name: US5-AS1 the counter shows 1 after one tap on the platform of the variable file<br>    steps:<br>      - type: mobile<br>        action: waitFor<br>        accessibilityId: Increment<br>        syncTimeout: 240<br>        assertions:<br>          - result.found ShouldBeTrue<br>      - type: mobile<br>        action: tap<br>        accessibilityId: Increment<br>      - type: mobile<br>        action: waitFor<br>        accessibilityId: &quot;1&quot;<br>        assertions:<br>          - result.found ShouldBeTrue<br>      - type: mobile<br>        action: read<br>        accessibilityId: &quot;1&quot;<br>        attribute: &quot;{{.readattr}}&quot;<br>        assertions:<br>          - result.value ShouldEqual 1</pre><p><strong>MCP.</strong> A tool call on a small reference server. The first test case of the suite builds it, and command points at the result.</p><pre>name: MCP executor testsuite<br>testcases:<br>- name: stdio transport<br>  steps:<br>  - name: tools call echo (AC-2)<br>    type: mcp<br>    transport: stdio<br>    command: [&quot;{{.build-the-reference-server.dir}}/refserver&quot;]<br>    method: tools/call<br>    tool: echo<br>    arguments:<br>      message: hello<br>    assertions:<br>    - result.err ShouldBeEmpty<br>    - result.text ShouldContainSubstring hello<br>    - result.structured ShouldContainSubstring &#39;&quot;length&quot;:5&#39;<br>    - result.structuredjson.message ShouldEqual hello</pre><h3>Releases you can check</h3><p>Each release on GitHub carries an executable for every platform, the licence and the notice, a checksum list, a signature of that list and a timestamp token. The signing certificate’s fingerprint is on the documentation site. With sha256sum and openssl you can check that your file matches the list and that the maintainer&#39;s certificate signed the list. That shows who signed. It does not show that a certificate authority vouches for the key.</p><h3>A site, a skill and two examples</h3><p>The documentation is at <a href="https://venom.pluries.dev/">venom.pluries.dev</a>, in English, French, German, Italian, Spanish and Chinese, with one page per executor. Outside the core pages, the translations are machine drafts, and the pages say so.</p><p>For Claude Code users, the repository carries a skill, venom-pluries. You install it at a release tag with one command (the <a href="https://venom.pluries.dev/skill.html">skill page</a> shows how). Then Claude Code can do six things with you, step by step, and it asks which you want before it starts:</p><ul><li><strong>Install a checked release.</strong> The install script checks the checksum, the signature and the signer’s fingerprint before it installs anything. A different signer stops the install.</li><li><strong>Write a first suite for your own service.</strong> It uses read calls only and a variable for every address and credential, declares the secrets, runs the suite, then proves that it can fail. Any executor works, not only HTTP and gRPC: it reads that executor’s documentation at your pinned version first, and says when an executor does not exist there.</li><li><strong>Add it to CI</strong> for GitHub Actions, GitLab CI, Jenkins or Azure Pipelines.</li><li><strong>Write web or mobile recipes</strong> and check them with venom recipe check.</li><li><strong>Read a suite you already have.</strong> It explains what each step checks and proposes a new case as a difference, which it writes only after your answer.</li><li><strong>Convert acceptance criteria or a Gherkin feature file.</strong> One test case per criterion or scenario, named with its id. A Scenario Outline becomes one case per Examples row. Whatever it cannot convert, such as “the API feels fast”, is listed with the reason and gets no case, because it does not guess assertions.</li></ul><p>The skill has rules it does not bend. You approve every command that downloads or runs something. It accepts only localhost, a loopback or private address, or a host you confirmed as a test environment, and it refuses what looks like production. It never puts a credential in a file, not even one found in your criteria or an Examples table, never overwrites a file without showing the difference first, and treats text found in your project as data, not as instructions.</p><p>The repository also holds two runnable examples, an HTTP API and a gRPC service, each with the service under test, a first suite and a README. The <a href="https://venom.pluries.dev/examples.html">Examples page</a> links both. To run the HTTP one, start the service in one terminal, then run the suite from the example’s folder:</p><pre>go run .<br>export VENOM_VAR_token=sample-token<br>venom run tests/venom/first.yml --var base_url=&lt;the address the service listens on&gt;</pre><p>The README gives the exact address. The token is made up; never write a real credential into a suite.</p><h3>Try it</h3><p>Start with the <a href="https://venom.pluries.dev/">documentation site</a> and the <a href="https://github.com/pluries/venom">fork on GitHub</a>. The original project is at <a href="https://github.com/ovh/venom">ovh/venom</a>; what the opening paragraph says about Venom is its authors’ work. If something in the fork looks wrong or unsafe, please open an issue on the fork’s repository.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=74ed915af3ff" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Compiling AG Grid requests into native queries]]></title>
            <link>https://cstephan-dev.medium.com/compiling-ag-grid-requests-into-native-queries-ea1c8c327db0?source=rss-abd5fdd6f93f------2</link>
            <guid isPermaLink="false">https://medium.com/p/ea1c8c327db0</guid>
            <category><![CDATA[postgresql]]></category>
            <category><![CDATA[dotnet]]></category>
            <category><![CDATA[database]]></category>
            <category><![CDATA[ag-grid]]></category>
            <category><![CDATA[mongodb]]></category>
            <dc:creator><![CDATA[Christian Stephan]]></dc:creator>
            <pubDate>Wed, 25 Nov 2026 16:39:40 GMT</pubDate>
            <atom:updated>2026-11-25T16:39:40.238Z</atom:updated>
            <content:encoded><![CDATA[<p><em>The journey of one AG Grid request, from the browser to a native SQL, MongoDB or OpenSearch query.</em></p><p>If you run an AG Grid grid on the server-side row model, your server receives a JSON request every time a user scrolls, sorts or filters. It says which rows the grid wants and how to sort, filter and group them. Your server has to turn that request into a query for its database. Craticula, a .NET 10 library, does this step: it compiles the request into a native SQL statement, MongoDB pipeline or OpenSearch query.</p><blockquote>An AI assistant helped me draft this article; I edited it and checked every claim against the public repository.</blockquote><p>Craticula reads AG Grid server-side row model requests from version 31 to 36 and compiles them into SQL, MongoDB, OpenSearch and Elasticsearch queries. This article follows one request through the library. For the code, the quickstart is linked at the end.</p><h3>How a request becomes a query</h3><p>Here is the path a request takes through Craticula, inside your server. A request adapter reads the grid’s JSON and turns it into a canonical form that depends on neither AG Grid nor any database. Craticula checks that form against a schema you write and against resource limits. Then a query compiler for your backend writes the native query. What comes back is plain data: a SQL statement with its parameters, a MongoDB pipeline or an OpenSearch query.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BqfuQhlYLivdm107uDSJYw.png" /></figure><p><em>The path from request to query, simplified. The schema decides what each step may touch. Craticula stops at a plain query; running it is your code, or an optional adapter. Where the figure says “refused”, a Lenient schema drops an unknown filter instead, as described below.</em></p><p>Because every backend reads the same canonical form, the same request means the same thing on each of them. The rules for details such as null handling and case sensitivity are written once, in a specification, and every compiler follows them.</p><h3>A grid request is untrusted input</h3><p>The easy way to build that query is to read the column names and values out of the JSON and paste them into a SQL string, a MongoDB pipeline or an OpenSearch query. That easy way is the problem.</p><p>The request comes from a browser, so anyone can change it before it reaches your server. It carries more than values. It names the columns to filter, sort and group by, operators such as contains or greaterThan, how many rows it wants and how deep its filter tree goes. Each of those is a place where a careless backend lets the caller write part of the query.</p><p>Craticula treats the whole request as data from a stranger. It checks the request against a schema and limits declared in advance, and builds the query itself, from parts the request cannot reach.</p><h3>Values are parameters</h3><p>Every value from the request goes into the query as a parameter. It is never pasted into the text. For SQL, the statement holds placeholders and the values travel in a separate list. When the quickstart filters on customers whose name contains “acme”, the word acme shows up in the parameter list and nowhere in the statement.</p><p>Here is one real case from the specification’s fixtures. A grid asks for rows whose productName contains art:</p><pre>&quot;filterModel&quot;: { &quot;productName&quot;: { &quot;filterType&quot;: &quot;text&quot;, &quot;type&quot;: &quot;contains&quot;, &quot;filter&quot;: &quot;art&quot; } }</pre><p>For PostgreSQL, Craticula returns this statement, with [&quot;art&quot;, 100, 0] as its parameters:</p><pre>SELECT * FROM &quot;items&quot; <br>  WHERE &quot;product_name&quot; ILIKE &#39;%&#39; || $1 || &#39;%&#39; ESCAPE &#39;\&#39; <br>  ORDER BY &quot;id&quot; ASC NULLS LAST <br>  LIMIT $2 <br>  OFFSET $3</pre><p>Look at two details. The word art is in the parameter list, not in the statement. And the statement says product_name where the request said productName: the schema supplied the name.</p><p>For MongoDB and OpenSearch, values go into the pipeline or the query document as data, and the compiler escapes any pattern characters in a text search value.</p><p>A value such as x&#39; OR &#39;a&#39; = &#39;a sent in a text filter is just a string. The database compares it with the column, and that is all it does. This is the compile step for PostgreSQL, from the quickstart:</p><pre>ISqlDialect dialect = PostgresDialect.Instance;<br>SqlQuery query = SqlQueryBuilder.Build(<br>    new SqlQueryRequest { Schema = schema, <br>                          Filter = filter, <br>                          Sort = parsed.Sort, <br>                          Page = parsed.Page }, dialect);<br>// query.Sql holds placeholders and query.Parameters holds the values. Use MssqlDialect.Instance for SQL Server.</pre><h3>Names come from your schema</h3><p>Values are only part of the risk. The rest is names: tables, collections and columns. A request names a column by its grid id, such as customer. Craticula looks that id up in a GridSchema, a JSON file that lists each column the grid may touch, its type, what the grid may do with it, and its physical name. The name in the query comes from that file, never from the request. For SQL, Craticula quotes the name for the dialect and doubles any quote character inside it.</p><p>The schema is an allowlist. A column the schema does not list cannot reach a query, whatever the request says. Before any compiler runs, Craticula parses the request and checks its filters, groups and page against the schema and the limits:</p><pre>GridSchema schema = GridSchema.Parse(schemaJson);<br><br>AgGridParsedRequest parsed = AgGridRequestParser.Parse(requestJson, new AgGridParseOptions { Schema = schema });<br>FilterNode? filter = GridFilterPipeline.Process(<br>    parsed.NativeFilter, parsed.CustomFilters, parsed.Page, schema, new ResourceLimits(), parsed.Group, parsed.Aggregations);</pre><h3>Unknown columns</h3><p>What happens when a request names a column the schema does not list depends on the schema’s mode. Strict is the default.</p><p>In Strict mode, Craticula refuses a filter on an unknown column. It throws an UnknownFieldException that names every column it rejected, and no query is produced. The quickstart ends that way, with a filter on password that Craticula refuses. A column the schema lists but marks as not filterable gets the same treatment.</p><p>In Lenient mode, Craticula drops the filter condition on that column and goes on with the rest. Dropping a condition widens the answer: the grid may get more rows than it asked for. Choose Lenient only if you accept that.</p><p>No mode relaxes the shape of the answer: a column the schema does not list can never be sorted, grouped or aggregated. Dropping any of those would hand the grid a different answer with no error.</p><h3>Limits</h3><p>A request can also hurt a database by asking for too much: a deeply nested filter tree, a huge list of values, an enormous page. Craticula caps the size and complexity of a request and refuses a request over a limit before it builds a query. You can lower or raise each limit in code, but you cannot turn a limit off: Craticula refuses zero or a negative value. The checks run in the parse step shown above, so a host that calls a compiler directly skips them. The <a href="https://craticula.pluries.dev/limits.html">limits page</a> lists each limit, its default and the optional query time limit.</p><h3>It only compiles</h3><p>The core packages compile and stop there. They never open a connection, never run a query and never read your data. Craticula gives back a SQL statement with its parameters, a MongoDB pipeline or an OpenSearch query, and you run it. Optional adapter packages can run it on your own connection; the core packages never depend on them.</p><p>The compile step has a benchmark of its own. On bench-vm-10c-34g on 2026-11-16, the per-shape means ran from 7.0 to 26.8 µs with the schema prepared once and from 17.0 to 53.1 µs with the schema parsed from JSON on every call, and a repeat run gave 7.4 to 26.5 µs and 16.9 to 62.4 µs, as the raw reports for <a href="https://github.com/pluries/craticula/blob/e65388e565e2d4342ba4ee9fd93b2dfeb6ac3146/perf/results/2026-11-16-p/compile/results/Craticula.Benchmarks.CompileBenchmarks-report-full.json">this run</a> and <a href="https://github.com/pluries/craticula/blob/e65388e565e2d4342ba4ee9fd93b2dfeb6ac3146/perf/results/2026-11-16-p-repeat/compile/results/Craticula.Benchmarks.CompileBenchmarks-report-full.json">the repeat run</a> show, with the method on the <a href="https://craticula.pluries.dev/performance.html">performance page</a>.</p><p>For PostgreSQL, the mean time to compile one request, in microseconds, this run and then the repeat run:</p><pre>Request shape     Schema prepared once    Schema parsed on every call<br>plain-page         7.3 /  8.0             17.2 / 16.9<br>filter-tree       15.8 / 15.6             38.9 / 37.8<br>deep-filter       23.3 / 22.9             35.2 / 35.2<br>group-aggregate   12.3 / 13.9             51.9 / 58.8</pre><p>The specification’s target is 50 µs. With the schema prepared once, every shape is under it. With the schema parsed on every call, the group-aggregate shape is over it on all three engines in this run (51.9 to 53.1 µs), and the repeat run on PostgreSQL came out 13% higher. Two runs on one machine are a small sample, so read the table as an order of magnitude.</p><h3>What stays yours</h3><p>Calling Craticula injection-safe means this and no more: values are bound parameters, names come only from your schema, and Craticula refuses a request that names an unknown column or breaks a limit, so no query is produced (in Lenient mode, it drops an unknown filter instead). That covers the compile step, not the rest of your system. These parts stay yours:</p><ul><li>The database account. Give the account that runs these queries the least rights it needs.</li><li>Running the query and its time limit. For MongoDB and OpenSearch, the compiled query can carry a time limit you set and the database enforces; for SQL, set a statement timeout on the connection or the account.</li><li>Who may use the grid. Authentication and per-user access are outside the library.</li><li>A correct schema. If your schema lists a column that should stay hidden, Craticula will serve it.</li><li>Indexes. A request inside the limits can still be slow on a column with no index.</li></ul><h3>How the rules are checked</h3><p>Craticula targets seven backends: PostgreSQL, SQL Server, MySQL and MariaDB, SQLite, MongoDB, OpenSearch and Elasticsearch. It ships as ten packages on nuget.org.</p><p>The rules live in a specification with fixtures: a grid request, a schema and the expected output per backend. A conformance runner sends each fixture to the C# implementation, which compiles it, and compares the result with the expected file. It grades 939 expected outputs across its dialect rows, and that total includes a row for the community-tested Oracle dialect, which is not among the seven backends. Run bash scripts/conformance.sh in the repository to see each row.</p><p>The <a href="https://github.com/pluries/craticula/tree/main/spec/fixtures/adversarial">adversarial fixtures</a> are 28 hostile requests, among them unknown columns, filter trees past the depth limit and duplicate JSON keys. Each expects a clean rejection.</p><h3>Try it</h3><ul><li>The code and the specification are on <a href="https://github.com/pluries/craticula">GitHub</a>.</li><li>The <a href="https://craticula.pluries.dev/quickstart-csharp.html">C# quickstart</a> runs without a database.</li><li>Two read-only demos run for visitors: <a href="https://craticula-pg.pluries.dev/">PostgreSQL</a> and <a href="https://craticula-mongo.pluries.dev/">MongoDB</a>.</li><li>On nuget.org, start with <a href="https://www.nuget.org/packages/Craticula.Core">Craticula.Core</a>. If you find a request Craticula should refuse and does not, please report it privately as the <a href="https://github.com/pluries/craticula/blob/main/SECURITY.md">security policy</a> describes.</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ea1c8c327db0" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Why, when and how and to use Signalr?]]></title>
            <link>https://cstephan-dev.medium.com/why-when-and-how-and-to-use-signalr-ef49b5b0dc11?source=rss-abd5fdd6f93f------2</link>
            <guid isPermaLink="false">https://medium.com/p/ef49b5b0dc11</guid>
            <category><![CDATA[net-core]]></category>
            <category><![CDATA[signalr]]></category>
            <category><![CDATA[angular-6]]></category>
            <category><![CDATA[aspnetcore]]></category>
            <category><![CDATA[microsoft]]></category>
            <dc:creator><![CDATA[Christian Stephan]]></dc:creator>
            <pubDate>Sat, 13 Oct 2018 02:46:19 GMT</pubDate>
            <atom:updated>2018-10-13T02:47:00.054Z</atom:updated>
            <content:encoded><![CDATA[<h3>SignalR: why, when and how and to use it?</h3><p><em>This post is an extension to “Angular 5 and ASP.NET Core” by Pablo Abella — Developer at Toptal.</em></p><p><a href="https://www.toptal.com/angular/angular-5-asp-net-core">Angular 5 and ASP.NET Core</a></p><p>Pablo Abella, C# developer, presented in his article a well, detailed and technical implementation of Angular 5 with Asp.Net Core, going through the different parts of developing a perfect maintainable, scalable and secure application.</p><p>In this short post, we will be talking about the reasons and benefits of using SignalR in angular — Asp.net Core applications and how to implement it.</p><h3>Ready? Let’s go!</h3><h4><strong>Why and when?</strong></h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/460/1*txi2r2tHHkz-J8TQxkdjrg.png" /></figure><blockquote>According to <a href="https://docs.microsoft.com/en-us/aspnet/core/signalr/introduction?view=aspnetcore-2.1#what-is-signalr">Microsoft</a>: <em>“ASP.NET Core SignalR is an open-source library that simplifies adding real-time web functionality to apps. Real-time web functionality enables server-side code to push content to clients instantly”</em>.</blockquote><p><strong>SignalR</strong> is:</p><ul><li>the glue that allows the client SPA (single page application) to react to changes that happen in the actor model on the server</li><li>a server-side framework to write push services</li><li>a set of client libraries to make push service communication easy to use on any platform</li></ul><p>So basically, SignalR is an easy to use and implement framework that provides push notification services between dotnet back end server and the different front end angular clients. The benefits of this library can be emphasized in applications that require high frequency updates from the server, like games, real-time dashboards, chat applications, etc.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/906/1*54WeUftoGEUvAyGHcTMksA.png" /></figure><h4>How to implement it?</h4><blockquote>We will continue working on Pablo’s final result.</blockquote><p>SignalR is based on the observer pattern. So basically .Net will be the Hub and the angular clients will subscribe on specific events on this hub; whenever a certain event, alert or action occur in the back end, the hub (SignalR) will notify all its subscribers.</p><blockquote>Watch out! You need to use compatible versions of SignalR between angular and dotnet to have a successful implementation.</blockquote><p><strong>Back end implementation</strong></p><p>1- Install Nuget package:</p><pre><strong>Microsoft.AspNetCore.SignalR — <em>1.0.0-preview2-final</em></strong></pre><pre><strong>Microsoft.AspNetCore.SignalR.MsgPack — <em>1.0.0-preview2-final</em></strong></pre><pre><strong>Microsoft.AspNet.SignalR.Client — <em>2.4.0-preview1–20180920–03</em></strong></pre><p>2- Create the Hub class:</p><p>Create the following interface and classes</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/fa3dc13f711d3fafba240307e0e5ac17/href">https://medium.com/media/fa3dc13f711d3fafba240307e0e5ac17/href</a></iframe><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/25ee4487d0b066b3dbae26deb8be0d96/href">https://medium.com/media/25ee4487d0b066b3dbae26deb8be0d96/href</a></iframe><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/da708648564d11a50a039586fa4986e2/href">https://medium.com/media/da708648564d11a50a039586fa4986e2/href</a></iframe><p>3- Update the startup.cs file</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/4aeb9e5fdb24c231ea21ceaedcd49add/href">https://medium.com/media/4aeb9e5fdb24c231ea21ceaedcd49add/href</a></iframe><p>4- Implement a test controller to trigger SignalR later on. The controller will receive the hub instance from services by dependency injection in the constructor.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/f6637253f963511ab88ceef396a61fd1/href">https://medium.com/media/f6637253f963511ab88ceef396a61fd1/href</a></iframe><p><strong>Front end implementation</strong></p><p>1- Using npm, install the following package:</p><pre>&quot;@aspnet/signalr&quot;: &quot;^1.0.0-preview1-update1&quot;</pre><p>2- Create a model, similar to MessageInterface.cs to receive data from SignalR:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/4902e73a78412d3f3da40ae5c07b28d9/href">https://medium.com/media/4902e73a78412d3f3da40ae5c07b28d9/href</a></iframe><p>3- Update app.component.ts and subscribe to backend SignalR hub:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/8468cade830f2fd6554cca44bf159a59/href">https://medium.com/media/8468cade830f2fd6554cca44bf159a59/href</a></iframe><figure><img alt="" src="https://cdn-images-1.medium.com/max/517/1*f9XmEUdQEPGkeS6uVGQGVA.png" /><figcaption>Console of the client: angular has subscribed to SignalR</figcaption></figure><p>4- In the app.component.html, represent as you like the messages received.</p><p><strong>Test the whole project!</strong></p><p>Send an api call to the TestController similar to this one:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/902/1*9N1n0wRuPdb6YECcaFePFQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/514/1*q_TTGa3KSZXj5O5jEcGDsA.png" /><figcaption>Example of real-time broadcast</figcaption></figure><p>If everything works perfectly, the api call will hit the endpoint which will trigger SignalR and send the message to all the subscribed clients!</p><p>Check the whole code on Github:</p><p><a href="https://github.com/chrisstephanrm/SignalRDemo">chrisstephanrm/SignalRDemo</a></p><h4>Advanced options of SignalR</h4><p>If you are interested in advanced configurations for SignalR, like error handling, encoding, etc., you can check Microsoft documentation:</p><p><a href="https://docs.microsoft.com/en-us/aspnet/core/signalr/introduction?view=aspnetcore-2.1#what-is-signalr">Introduction to ASP.NET Core SignalR</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ef49b5b0dc11" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>