Blog posts by Aniel Sud2020-02-03T19:04:47.0000000Z/blogs/aniel-sud/Optimizely WorldKey Rotation on Episerver Find/blogs/aniel-sud/dates/2020/2/key-rotation-on-episerver-find/2020-02-03T19:04:47.0000000Z<p>We at Episerver consider continuous security and data protection a core responsibility. In a dedicated effort to protect the data of our customers and our customers’ customers, we work diligently to monitor and test our products, services and offerings for any potential security threats. Our aim is to ensure your confidence in the security of our solutions, so you can continue to deliver seamless and secure experiences for your customers without worry. As such, we are releasing a new process and protocol specific to Episerver Find customers which will require a regular cadence of rotating authentication keys on an annual basis.</p>
<p>In order to adhere to this new process, customers on the Digital Experience Platform need do nothing – your environments will be automatically updated periodically with new keys. If you are connecting to your indices from elsewhere using a direct connection string, or if you are a managed services customer or an on-premise customer, please reach out to Technical Support Services at <a href="mailto:support@episerver.com">support@episerver.com</a> in order to initiate your key rotation.</p>
<p>We will require that all existing Find keys are rotated within the next 90 days, or by May 3, 2020. On or before that date, all existing Find keys will be disabled, which will negatively impact your site if you have not rotated your keys before then.</p>
<p>After that period, we will require that all Find keys are rotated annually.</p>
<p>Should you have any questions or concerns, please do not hesitate to contact us at <a href="mailto:security@episerver.com">security@episerver.com</a> or your local support representative.</p>Support for IQueryable data sources/blogs/aniel-sud/dates/2017/8/support-for-iqueryable-data-sources/2017-08-02T20:30:49.0000000Z<p>One of the cooler features released with Ektron 9.20 was support for IQueryable data sources. This feature allows a developer to write native Linq queries against almost any native data type in the system, while still supporting all the baked-in permissioning and business logic for those items. And it’s super easy to use!</p>
<p>In version 8.5, Ektron introduced the Framework API, which features simple, criteria-based retrieval. For example, to retrieve all the content viewable to the currently loggedin user that exists in either folder ID 32 or 34, write a query like the following:</p>
<pre class="language-csharp"><code>using Ektron.Cms.Framework.Content;
using Ektron.Cms.Content;
using Ektron.Cms.Common;
...
var contentManager = new ContentManager();
var contentCriteria = new ContentCriteria();
contentCriteria.AddFilter(ContentProperty.FolderId, CriteriaFilterOperator.EqualTo, 32);
contentCriteria.AddFilter(ContentProperty.FolderId, CriteriaFilterOperator.EqualTo, 34);
contentCriteria.Condition = LogicalOperation.Or;
var contentItems = contentManager.GetList(contentCriteria);</code></pre>
<p>This works, and is easy enough to understand, but is verbose. And if you have more complex queries, with nested logic, it gets even worse. For example, here is a query searching for items in folder ID 32 with a last editor name beginning with “Ben”, in addition to all items in folder ID 34. The resulting list ordered by the content title.</p>
<pre class="language-csharp"><code>using Ektron.Cms.Framework.Content;
using Ektron.Cms.Content;
using Ektron.Cms.Common;
...
var contentManager = new ContentManager();
var contentCriteria = new ContentCriteria();
var AuthorFolderFilter = new CriteriaFilterGroup<ContentProperty>();
AuthorFolderFilter.Condition = LogicalOperation.And;
AuthorFolderFilter.AddFilter(ContentProperty.FolderId, CriteriaFilterOperator.EqualTo, 32);
AuthorFolderFilter.AddFilter(ContentProperty.LastEditorFirstName, CriteriaFilterOperator.StartsWith, "Ben");
contentCriteria.Condition = LogicalOperation.Or;
contentCriteria.FilterGroups.Add(AuthorFolderFilter);
contentCriteria.AddFilter(ContentProperty.FolderId, CriteriaFilterOperator.EqualTo, 34);
contentCriteria.OrderByField = ContentProperty.Title;
contentCriteria.OrderByDirection = EkEnumeration.OrderByDirection.Ascending;
var contentItems = contentManager.GetList(contentCriteria);</code></pre>
<p>That’s a lot of code for what is, in the end, a simple query. To make the Ektron platform more supportable and maintainable, in 9.20, we introduced the EktronContext manager. Let’s translate our two queries from above into fluent Linq syntax as supported by the EktronContext object. Here’s the first query:</p>
<pre class="language-csharp"><code>using Ektron.Cms;
using Ektron.Cms.Linq;
...
var contentItems = EktronContext<ContentData>.Source.Where(t => t.FolderId == 32 || t.FolderId == 34);</code></pre>
<p>And here’s the second query:</p>
<pre class="language-csharp"><code>using Ektron.Cms;
using Ektron.Cms.Linq;
...
var contentItems = EktronContext<ContentData>.Source
.Where(t => t.FolderId == 34
|| (t.FolderId == 32 && a.EditorFirstName.StartsWith("Ben")))
.OrderBy(t=>t.Title);</code></pre>
<p>Query expression syntax is also supported. The same queries written that way would be:</p>
<pre class="language-csharp"><code>using Ektron.Cms;
using Ektron.Cms.Linq;
...
var contentItems = from c in EktronContext<ContentData>.Source
where c.FolderId == 32 || c.FolderId == 34
select c;</code></pre>
<p>and the second query would be:</p>
<pre class="language-csharp"><code>using Ektron.Cms;
using Ektron.Cms.Linq;
...
var contentItems = from a in EktronContext<ContentData>.Source
where a.FolderId == 34
|| (a.FolderId == 32 && a.EditorFirstName.StartsWith("Ben"))
select a;</code></pre>
<p>This is far more readable, and we worked hard to make sure it was applicable to a wide array of data types. In fact, nearly 80 core data types are supported. The most common data types are constructs like ContentData, FolderData, TaxonomyData, TaxonomyItemData or UserData, but even uncommon data types, like WarehouseData, FormData and CmsDeviceConfigurationData, are supported. To retrieve data of a desired type, use the data class in the generic EktronContext source; for example:</p>
<pre class="language-csharp"><code>EktronContext<ContentData>.Source.Where(...)
EktronContext<UserData>.Source.Where(...)
EktronContext<AliasRuleData>.Source.Where(...)</code></pre>
<p>These context sources support querying by almost any property on the data class. Specifically, they support the properties on the associated Criteria classes for the Data class in question. They also support a range of operators that are useful for each data type. For example, both strings and lists can be used with the Contains method operator, and almost every data type supports the core comparison operators (equals, greater than, greater than or equal, etc.).</p>
<p><br />Additionally, the context sources support paging implementations through the orderby, skip, and take operators. Since the context manager is still using the framework manager, you also get the advantage of a smart cache layer, and your queries still respect the system business logic applicable to that data type.</p>
<p>We hope you find this new API pattern useful! The full documentation and list of supported classes and properties supported are available in the <a title="Ektron documentation" href="http://documentation.ektron.com/cms400/edr/web/EDR.htm#IQueryable%20Data%20Sources/IQ%20data%20sources.htm" target="_blank">Ektron documentation</a>.</p>