Skip to content

Commit

Permalink
WIP reconfigure with better locations for generated code
Browse files Browse the repository at this point in the history
  • Loading branch information
iJungleboy committed Dec 5, 2024
1 parent 3e3a4c7 commit 56639ce
Show file tree
Hide file tree
Showing 15 changed files with 2,362 additions and 2,373 deletions.
4 changes: 3 additions & 1 deletion 2sxc Docs Generator/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,6 @@ log.txt
/xxobj/
/xxxobj/

node_modules
node_modules

/api-generated/
5 changes: 3 additions & 2 deletions 2sxc Docs Generator/docfx.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@
]
}
],
"dest": "obj/api/dot-net/",
// Note: it needs this setup with /api/dot-net/ to sync folder depths with the manually added API files
"dest": "api-generated/api/dot-net/",
"disableGitFeatures": false, // Disable fetching Git related information for articles. By default it is enabled and may have side effect on performance when the repo is large.
"filter": "filterConfig.yml",
"force": true, // Re-build all the documentation
Expand All @@ -45,7 +46,7 @@
"content": [
{
// These are the files generated by the dotnet build, they are in `obj/api/*.yml`
"src": "obj",
"src": "api-generated",
"files": [ "api/**.yml" ],
},
{
Expand Down
2 changes: 1 addition & 1 deletion 2sxc Docs Generator/toc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
- name: .net API
# note: this strange path is where docfx put the yml files it generated from the code
topicUid: ToSic.Home
tocHref: obj/api/dot-net/toc.yml
tocHref: ./api-generated/api/dot-net/toc.yml

- name: JS & TS API
topicUid: JsCode.Index
Expand Down
2 changes: 1 addition & 1 deletion docs/abyss/parts/look-up/tokens.html
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ <h2 id="simple-example">Simple Example</h2>
You would use this in a <a class="xref" href="../../../basics/query/index.html">Query</a> to filter out news which should be published in future, so <code>PublicationDate &lt; [DateTime:Now]</code>.</p>
<div class="NOTE">
<h5>Note</h5>
<p>There is also a <a class="xref" href="../../../api/dot-net/ToSic.Sxc.Engines.TokenEngine.html">TokenEngine</a> which uses the same Token mechanism to generate HTML. What you see here also applies to that, but it's actually a separate topic.</p>
<p>There is also a <a href="xref:ToSic.Sxc.Engines.TokenEngine">TokenEngine</a> which uses the same Token mechanism to generate HTML. What you see here also applies to that, but it's actually a separate topic.</p>
</div>
<h2 id="some-token-examples">Some Token Examples</h2>
<ol>
Expand Down
4 changes: 2 additions & 2 deletions docs/api/dot-net/AppCode._Help.html
Original file line number Diff line number Diff line change
Expand Up @@ -114,13 +114,13 @@ <h1 id="AppCode__Help" data-uid="AppCode._Help" class="text-break">
</h1>

<div class="facts text-secondary">
<dl><dt>Namespace</dt><dd><a class="xref" href="AppCode/_AppCode.html">AppCode</a></dd></dl>
<dl><dt>Namespace</dt><dd><a class="xref" href="AppCode.html">AppCode</a></dd></dl>
<dl><dt>Assembly</dt><dd>ToSic.Sxc.dll</dd></dl>
</div>

<div class="markdown summary"><p>EXPERIMENTAL v17</p>
<p>This class is a placeholder to provide help in the docs.</p>
<p>The namespace <a class="xref" href="AppCode/_AppCode.html">AppCode Namespace for Dnn ☢️ &amp; Oqtane &#129656;</a> is reserved for custom code in your app.
<p>The namespace <a class="xref" href="AppCode.html">AppCode</a> is reserved for custom code in your app.
As such, it doesn't have any code in the public docs, but will contain classes and code from your app.</p>
<p>To use, see TODO: Add link to docs</p>
</div>
Expand Down
2 changes: 1 addition & 1 deletion docs/api/dot-net/AppCode.html
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ <h3 id="classes">
<dt><a class="xref" href="AppCode._Help.html">_Help</a></dt>
<dd><p>EXPERIMENTAL v17</p>
<p>This class is a placeholder to provide help in the docs.</p>
<p>The namespace <a class="xref" href="AppCode/_AppCode.html">AppCode Namespace for Dnn ☢️ &amp; Oqtane &#129656;</a> is reserved for custom code in your app.
<p>The namespace <a class="xref" href="AppCode.html">AppCode</a> is reserved for custom code in your app.
As such, it doesn't have any code in the public docs, but will contain classes and code from your app.</p>
<p>To use, see TODO: Add link to docs</p>
</dd>
Expand Down
242 changes: 242 additions & 0 deletions docs/api/dot-net/ToSic.Sxc.WebApi.SecureEndpointAttribute.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,242 @@
<!DOCTYPE html>
<html>
<!-- 2sxc docs -->
<head>
<meta charset="utf-8">
<title>Class SecureEndpointAttribute | 2sxc 18 for Dnn and Oqtane </title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="title" content="Class SecureEndpointAttribute | 2sxc 18 for Dnn and Oqtane ">

<link rel="icon" href="../../assets/favicon.ico">
<link rel="stylesheet" href="../../public/docfx.min.css">
<link rel="stylesheet" href="../../public/main.css">
<meta name="docfx:navrel" content="../../toc.html">
<meta name="docfx:tocrel" content="toc.html">

<meta name="docfx:rel" content="../../">


<meta name="docfx:docurl" content="https://github.com/2sic/2sxc/new/develop/apiSpec/new?filename=ToSic_Sxc_WebApi_SecureEndpointAttribute.md&amp;value=---%0Auid%3A%20ToSic.Sxc.WebApi.SecureEndpointAttribute%0Asummary%3A%20&#39;*You%20can%20override%20summary%20for%20the%20API%20here%20using%20*MARKDOWN*%20syntax&#39;%0A---%0A%0A*Please%20type%20below%20more%20information%20about%20this%20API%3A*%0A%0A">
<meta name="loc:inThisArticle" content="In this article">
<meta name="loc:searchResultsCount" content="{count} results for &quot;{query}&quot;">
<meta name="loc:searchNoResults" content="No results for &quot;{query}&quot;">
<meta name="loc:tocFilter" content="Filter by title">
<meta name="loc:nextArticle" content="Next">
<meta name="loc:prevArticle" content="Previous">
<meta name="loc:themeLight" content="Light">
<meta name="loc:themeDark" content="Dark">
<meta name="loc:themeAuto" content="Auto">
<meta name="loc:changeTheme" content="Change theme">
<meta name="loc:copy" content="Copy">
<meta name="loc:downloadPdf" content="Download PDF">

<script src="https://cdn.jsdelivr.net/npm/@fancyapps/[email protected]/dist/fancybox/fancybox.umd.js"></script>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fancyapps/[email protected]/dist/fancybox/fancybox.css">


</head>

<script type="module" src="./../../public/docfx.min.js"></script>

<script>
const theme = localStorage.getItem('theme') || 'auto'
document.documentElement.setAttribute('data-bs-theme', theme === 'auto' ? (window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light') : theme)
</script>

<script async src="https://www.googletagmanager.com/gtag/js?id=GTM-PH2TVNW"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag() { dataLayer.push(arguments); }
gtag('js', new Date());
gtag('config', 'GTM-PH2TVNW');
</script>

<body class="tex2jax_ignore" data-layout="" data-yaml-mime="ManagedReference">
<header class="bg-body border-bottom">
<nav id="autocollapse" class="navbar navbar-expand-md" role="navigation">
<div class="container-xxl flex-nowrap">
<a class="navbar-brand" href="../../index.html">
<img id="logo" class="svg" src="../../assets/logos/vcurrent/50.png" alt="">

</a>
<button class="btn btn-lg d-md-none border-0" type="button" data-bs-toggle="collapse" data-bs-target="#navpanel" aria-controls="navpanel" aria-expanded="false" aria-label="Toggle navigation">
<i class="bi bi-three-dots"></i>
</button>
<div class="collapse navbar-collapse" id="navpanel">
<div id="navbar">



<form class="search" role="search" id="search">
<i class="bi bi-search"></i>
<input class="form-control" id="search-query" type="search" disabled placeholder="Search" autocomplete="off" aria-label="Search">

<a class="btn btn-sm border-0 text-nowrap version-button" xstyle="padding: 10px 0 0 0; width: 25px" href="https://go.2sxc.org/docs-versions" target="_blank">
&nbsp; v18 <i class="bi bi-caret-down-fill fs-6"></i>
</a>
</form>


</div>
</div>
</div>
</nav>
</header>

<main class="container-xxl">
<div class="toc-offcanvas">
<div class="offcanvas-md offcanvas-start" tabindex="-1" id="tocOffcanvas" aria-labelledby="tocOffcanvasLabel">
<div class="offcanvas-header">
<h5 class="offcanvas-title" id="tocOffcanvasLabel">Table of Contents</h5>
<button type="button" class="btn-close" data-bs-dismiss="offcanvas" data-bs-target="#tocOffcanvas" aria-label="Close"></button>
</div>
<div class="offcanvas-body">
<nav class="toc" id="toc"></nav>
</div>
</div>
</div>

<div class="content">
<div class="actionbar">
<button class="btn btn-lg border-0 d-md-none" style="margin-top: -.65em; margin-left: -.8em" type="button" data-bs-toggle="offcanvas" data-bs-target="#tocOffcanvas" aria-controls="tocOffcanvas" aria-expanded="false" aria-label="Show table of contents">
<i class="bi bi-list"></i>
</button>

<nav id="breadcrumb"></nav>
</div>

<article data-uid="ToSic.Sxc.WebApi.SecureEndpointAttribute">



<h1 id="ToSic_Sxc_WebApi_SecureEndpointAttribute" data-uid="ToSic.Sxc.WebApi.SecureEndpointAttribute" class="text-break">
Class SecureEndpointAttribute <a class="header-action link-secondary" title="View source" href="https://github.com/2sic/2sxc/blob/develop/Src/Sxc/ToSic.Sxc.WebApi/WebApi/SecureEndpoint/SecureEndpointAttributeNetFull.cs/#L29"><i class="bi bi-code-slash"></i></a>
</h1>

<div class="facts text-secondary">
<dl><dt>Namespace</dt><dd><a class="xref" href="ToSic.html">ToSic</a>.<a class="xref" href="ToSic.Sxc.html">Sxc</a>.<a class="xref" href="ToSic.Sxc.WebApi.html">WebApi</a></dd></dl>
<dl><dt>Assembly</dt><dd>ToSic.Sxc.WebApi.dll</dd></dl>
</div>

<div class="markdown summary"><p>An ActionFilter attribute that automatically decrypts encrypted POST payloads for Web API endpoints.
Apply this attribute to a controller or action method to seamlessly handle encrypted incoming POST requests,
ensuring the decrypted data is available for processing within the action method.</p>
</div>
<div class="markdown conceptual"></div>

<div class="codewrapper">
<pre><code class="lang-csharp hljs">[PublicApi]
[AttributeUsage(AttributeTargets.Class|AttributeTargets.Method)]
public class SecureEndpointAttribute : ActionFilterAttribute, _Attribute</code></pre>
</div>




<dl class="typelist inheritance">
<dt>Inheritance</dt>
<dd>
<div><span class="xref">object</span></div>
<div><span class="xref">Attribute</span></div>
<div><span class="xref">FilterAttribute</span></div>
<div><span class="xref">ActionFilterAttribute</span></div>
<div><span class="xref">SecureEndpointAttribute</span></div>
</dd>
</dl>

<dl class="typelist implements">
<dt>Implements</dt>
<dd>
<div><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.runtime.interopservices._attribute">_Attribute</a></div>
</dd>
</dl>






<h2 id="ToSic_Sxc_WebApi_SecureEndpointAttribute_remarks">Remarks</h2>
<div class="markdown level0 remarks"><p>This attribute intercepts POST requests with JSON content, checks for encrypted data,
and if present, decrypts the payload using the <span class="xref">ToSic.Eav.Security.Encryption.AesHybridCryptographyService</span>.
It then deserializes the decrypted data into the expected parameter type and replaces the action arguments.
If the payload is not encrypted, the request content remains unchanged.</p>
<ul>
<li>Introduced in version 18.05.</li>
</ul>
</div>


<h2 class="section" id="methods">Methods
</h2>


<a id="ToSic_Sxc_WebApi_SecureEndpointAttribute_OnActionExecuting_" data-uid="ToSic.Sxc.WebApi.SecureEndpointAttribute.OnActionExecuting*"></a>

<h3 id="ToSic_Sxc_WebApi_SecureEndpointAttribute_OnActionExecuting_System_Web_Http_Controllers_HttpActionContext_" data-uid="ToSic.Sxc.WebApi.SecureEndpointAttribute.OnActionExecuting(System.Web.Http.Controllers.HttpActionContext)">
OnActionExecuting(HttpActionContext)
<a class="header-action link-secondary" title="View source" href="https://github.com/2sic/2sxc/blob/develop/Src/Sxc/ToSic.Sxc.WebApi/WebApi/SecureEndpoint/SecureEndpointAttributeNetFull.cs/#L35"><i class="bi bi-code-slash"></i></a>
</h3>

<div class="markdown level1 summary"><p>Occurs before the action method is invoked.</p>
</div>
<div class="markdown level1 conceptual"></div>

<div class="codewrapper">
<pre><code class="lang-csharp hljs">public override void OnActionExecuting(HttpActionContext filterContext)</code></pre>
</div>

<h4 class="section">Parameters</h4>
<dl class="parameters">
<dt><code>filterContext</code> <span class="xref">HttpActionContext</span></dt>
<dd></dd>
</dl>













</article>

<div class="contribution d-print-none">
<a href="https://github.com/2sic/2sxc/blob/develop/Src/Sxc/ToSic.Sxc.WebApi/WebApi/SecureEndpoint/SecureEndpointAttributeNetFull.cs/#L29" class="edit-link">Edit this page</a>
</div>


</div>

<div class="affix">
<nav id="affix"></nav>
</div>
</main>

<div class="container-xxl search-results" id="search-results"></div>

<footer class="border-top text-secondary">
<div class="container-xxl">
<div class="flex-fill">

<span>
Made by <a href="https://www.2sic.com">2sic</a>
with 💖 and
<a href="https://dotnet.github.io/docfx">docfx</a>
for <a href="https://2sxc.org">2sxc</a>,
<a href="https://dnncommunity.org/">Dnn</a>
and <a href="https://www.oqtane.org/">Oqtane</a>
see also <a href="">2sxc Github</a> and <a href="https://blazor-cms.org">Blazor CMS</a>
</span>
</div>
</div>
</footer>
</body>
</html>
7 changes: 7 additions & 0 deletions docs/api/dot-net/ToSic.Sxc.WebApi.html
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,13 @@ <h3 id="classes">
<dd><p>Mark a WebApi to use the modern Json Formatter based on System.Text.Json.
Without this, older WebApi Controllers use the Newtonsoft JSON Formatter.
Also provides additional configuration to make certain work easier.</p>
</dd>
</dl>
<dl class="jumplist">
<dt><a class="xref" href="ToSic.Sxc.WebApi.SecureEndpointAttribute.html">SecureEndpointAttribute</a></dt>
<dd><p>An ActionFilter attribute that automatically decrypts encrypted POST payloads for Web API endpoints.
Apply this attribute to a controller or action method to seamlessly handle encrypted incoming POST requests,
ensuring the decrypted data is available for processing within the action method.</p>
</dd>
</dl>
<h3 id="enums">
Expand Down
5 changes: 4 additions & 1 deletion docs/api/dot-net/toc.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<ul class="nav level1">
<li>
<span class="expand-stub"></span>
<a href="AppCode/_AppCode.html" name="" title="AppCode">AppCode</a>
<a href="AppCode.html" name="" title="AppCode">AppCode</a>

<ul class="nav level2">
<li>
Expand Down Expand Up @@ -1259,6 +1259,9 @@
<li>
<a href="ToSic.Sxc.WebApi.JsonFormatterAttribute.html" name="" title="JsonFormatterAttribute">JsonFormatterAttribute</a>
</li>
<li>
<a href="ToSic.Sxc.WebApi.SecureEndpointAttribute.html" name="" title="SecureEndpointAttribute">SecureEndpointAttribute</a>
</li>
</ul>
</li>
</ul>
Expand Down
2 changes: 1 addition & 1 deletion docs/api/dot-net/toc.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/basics/metadata/read.html
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ <h2 id="edge-cases-of-the-metadata-property">Edge cases of the <code>.Metadata</
</ol>
<p>#todoc - this should probably be moved to the C# API infos</p>
<h2 id="get-metadata-for-data-outside-of-2sxc-todoc">Get Metadata for Data outside of 2sxc #todoc</h2>
<p>To read Metadata for non-2sxc objects you must request it from the <strong>App.Data.Metadata</strong> or from the <a href="xref:ToSic.Eav.Apps.AppState">AppState</a>.MetadataSource object. Both are a a <a class="xref" href="../../api/dot-net/ToSic.Eav.Metadata.IMetadataSource.html">IMetadataSource</a>. Use commands like <code>GetMetadata&lt;T&gt;(...)</code> to access the metadata you need.</p>
<p>To read Metadata for non-2sxc objects you must request it from the <strong>App.Data.Metadata</strong> or from the <a href="xref:ToSic.Eav.Apps.AppState">AppState</a>.MetadataSource object. Both are a a <a href="xref:ToSic.Eav.Metadata.IMetadataSource"></a>. Use commands like <code>GetMetadata&lt;T&gt;(...)</code> to access the metadata you need.</p>
<h2 id="read-also-todoc">Read also #todoc</h2>
<h2 id="demo-app-and-further-links-todoc">Demo App and further links #todoc</h2>
<ul>
Expand Down
2 changes: 1 addition & 1 deletion docs/basics/server/data-flow.html
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ <h5>Tip</h5>
<p>When you use views which don't have a content-type configured, then properties like <code>Data</code>, <code>Content</code> or <code>Header</code> will be null. But <code>App.Data</code> will still work.</p>
</div>
<h3 id="2-execution">2. Execution</h3>
<p>The Block is now ready. 2sxc now consults the View to find out which <a class="xref" href="../../api/dot-net/ToSic.Sxc.Engines.IEngine.html">Engine</a> to use (Razor or Token). It will now load this engine, give it the Block and wait for the resulting Html to be created.</p>
<p>The Block is now ready. 2sxc now consults the View to find out which <a href="xref:ToSic.Sxc.Engines.IEngine">Engine</a> to use (Razor or Token). It will now load this engine, give it the Block and wait for the resulting Html to be created.</p>
<ol>
<li>The engine loads the template and lets it do what it should.</li>
<li>If the template has code accessing <a class="xref" href="../../api/dot-net/Custom.Hybrid.Razor12.html#Custom_Hybrid_Razor12_Data">Data</a> then the underlying source will retrieve the necessary data.
Expand Down
Loading

0 comments on commit 56639ce

Please sign in to comment.