Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
gatsby-source-crownpeak-dxm
Advanced tools
Crownpeak Digital Experience Management (DXM) Gatsby Source Plugin has been constructed to assist the Single Page App developer in developing applications served by Gatsby that leverage DXM for content management purposes.
As an application is built in Gatsby, it collects information about pages, components, and their underlying data in order to perform server-side rendering. To facilitate this process for content contained within DXM, a runtime NPM Package is provided. The purpose of this package is:
yarn add gatsby-source-crownpeak-dxm
# or
npm install gatsby-source-crownpeak-dxm
Create a gatsby-config.js
file in the root of your application. The behaviour of the Crownpeak Digital
Experience Management (DXM) Gatsby Source Plugin can be controlled via the options provided to it:
// In your gatsby-config.js
module.exports = {
plugins: [
{
resolve: `gatsby-source-crownpeak-dxm`,
options: {
// Optionally provide the Search G2 collection name
collection: "your-collection-name",
// Or, instead, provide a location where Search G2 can be queried
contentLocation: "//searchg2.crownpeak.net/your-collection-name/select/?wt=json",
// If neither option above is specified, the value in CMS_DYNAMIC_CONTENT_LOCATION in .env will be used
// Provide zero or more filter queries that will be applied to all queries
filterQueries: ["custom_is_cms_folder_id:12345"],
// contentTypes is optional, and will be queried from Search G2 if not provided
// if contentTypes is not specified, /src/templates will be checked for a matching template for each type
// e.g. if the CMS content type is "Blog Page", /src/template/blogPage.js will be searched
// Similarly if a template value is not provided in contentTypes, the folder will be searched
contentTypes: [{name: "Blog Page", template: "blog-template.js"}, "Content Page"]
},
},
],
}
See https://github.com/Crownpeak/DXM-SDK-Examples/tree/master/React
for information on how to populate a .env
file and scaffold DXM code and configuration from your application.
When the Crownpeak Digital Experience Management (DXM) Gatsby Source Plugin runs, it first determines which content
types it is looking for. If no configuration is found, it queries the Search G2 data source for all available
content types. The content types are determined by unique values in the custom_s_type
field.
For each configured or discovered content type, JSON data will be retrieved from the custom_t_json
field and stored in the graphql data set on a node which is named based on the content type with spaces removed. For example a content type of Blog Page
will result in graphql nodes allBlogPage
and blogPage
.
In addition to the content from custom_t_json
, all items will have an assetid
field populated with the appropriate DXM asset's branch id. If the data contains a custom_s_slug
field, a slug
field will be provided, populated with that content.
In the page creation phase, any content with a populated slug
field will examined. If a template is provided in the contentType
options, that will be used. Otherwise the application is searched for a template file to match the content type. For example, if the content type is Blog Page
, the search will be for /src/templates/blogPage.js
. If a suitable template is located, createPage
will be called for this content and slug. The template will be passed the appropriate DXM asset id in the page context object's assetId
parameter.
If you are using the Crownpeak Digital Experience Management (DXM) Software Development Kit (SDK) for React, you can pass data that you load via graphql to components and fields using the following code:
const MyPage = ({ data, pageContext }) => {
// CmsPage
CmsDataCache.cmsAssetId = pageContext.assetId;
CmsDataCache.set(CmsDataCache.cmsAssetId, data.myPage); // Use the applicable node name here
return ( <div>etc.</div> )
};
Note that the CmsPage
comment is required for the page parser to discover your template script during the scaffolding process.
If you are using the Crownpeak Digital Experience Management (DXM) Software Development Kit (SDK) for React, content from any drop zones contained on a page is automatically serialised to a string. This is done so that it is not necessary to query the exact arrangement of nodes, since this cannot be known at build time.
In your graphql query, simply add the DropZones
node, and its contents will be automatically deserialised before use.
Thanks to:
Version | Date | Changes |
---|---|---|
1.0.0 | 2021MAR15 | Initial Release. |
MIT License
Copyright (c) 2021 Crownpeak Technology, inc.
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
FAQs
Gatsby Source Plugin for Crownpeak DXM.
We found that gatsby-source-crownpeak-dxm demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.