Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Security] Latest SAST Scanning Results on v18.0.0 - highs #748

Merged
merged 41 commits into from
Jul 20, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
9604ca9
add updated package-lock.json to Vue sample
CobyPear Jun 28, 2021
e44db9d
Merge branch 'dev' of github.com:Sitecore/jss into dev
CobyPear Jun 29, 2021
8cba6de
Merge branch 'dev' of github.com:Sitecore/jss into dev
CobyPear Jun 30, 2021
6d7ee75
Merge branch 'dev' of github.com:Sitecore/jss into dev
CobyPear Jul 2, 2021
b4e11f0
Merge branch 'dev' of github.com:Sitecore/jss into dev
CobyPear Jul 6, 2021
5ef6a1e
Merge branch 'dev' of github.com:Sitecore/jss into dev
CobyPear Jul 9, 2021
29d4ee0
local peacock settings
CobyPear Jul 9, 2021
9bfeace
Merge branch 'dev' of github.com:Sitecore/jss into dev
CobyPear Jul 9, 2021
cb30252
upgrade high vuln packages in nextjs package
CobyPear Jul 9, 2021
027afe7
fix high vulns for sitecore-jss package
CobyPear Jul 9, 2021
a53c3ae
fix high vulns for packages in sitecore-jss-cli package
CobyPear Jul 9, 2021
e2ff3e9
fix high vuln packages in dev-tools
CobyPear Jul 9, 2021
0f570ec
fix high vulns for proxy package
CobyPear Jul 9, 2021
485c563
fix high vulns for react package
CobyPear Jul 9, 2021
493afe4
fix high fulns for react-forms package
CobyPear Jul 9, 2021
075a5ca
fix high vulns in rendering-host package
CobyPear Jul 9, 2021
4dd6014
fix high vluns for tracking package
CobyPear Jul 9, 2021
9f200c7
fix high vulns for update-package
CobyPear Jul 9, 2021
654ea3b
fix high vulns for vue package
CobyPear Jul 9, 2021
b14b0f9
fix high vulns in pipelines package
CobyPear Jul 9, 2021
71b5cbb
undo change to settings.json
CobyPear Jul 9, 2021
07b5511
fix some high vulns in base package
CobyPear Jul 9, 2021
1add424
upgrade trim-newlines and change to devDependency
CobyPear Jul 13, 2021
6cabe7e
fix high vulns for react-sample
CobyPear Jul 13, 2021
5cf2044
fix high vulns for vue sample
CobyPear Jul 13, 2021
e98ec7f
fix high vulns found by npm audit and veracode scans
CobyPear Jul 9, 2021
4e9b47a
Merge branch 'fix/479706-fix-high-vuln' of github.com:Sitecore/jss in…
CobyPear Jul 14, 2021
23b7f05
fix next package package-lock
CobyPear Jul 14, 2021
65ddc0d
Remove use of deprecated dataApi (#744)
illiakovalenko Jul 14, 2021
d58551d
version v19.0.0-canary.19 [skip ci]
Jul 14, 2021
a5f723f
[Vue] regeneratorRuntime error when opening Vue app in EE (#749)
illiakovalenko Jul 15, 2021
27d4a55
version v19.0.0-canary.20 [skip ci]
Jul 15, 2021
d391d1b
[embedded-app] Remove StepZilla, use custom component (#747)
illiakovalenko Jul 16, 2021
5a72232
version v19.0.0-canary.21 [skip ci]
Jul 16, 2021
8ef81f6
add updated package-lock.json to Vue sample
CobyPear Jun 28, 2021
eb2f885
local peacock settings
CobyPear Jul 9, 2021
2277f18
fix high vulns found by npm audit and veracode scans
CobyPear Jul 9, 2021
1cf2f5c
Fix nextjs package
CobyPear Jul 15, 2021
044c664
Fix react and next package-lock issues
CobyPear Jul 19, 2021
717879c
trim-newline package set as dev:true
CobyPear Jul 19, 2021
31f2467
Merge remote
CobyPear Jul 19, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"editor.fontSize": 13
"editor.fontSize": 13,
}
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ There are several mechanisms of using/outputting translated values with `ngx-tra

#### `JssTranslationLoaderService`

This implementation loads the Sitecore dictionary from the Dictionary Service provided by JSS, found at `/sitecore/api/jss/dictionary/`, using `HttpClient`. It is used as a "fallback" during both client and server rendering.
This implementation loads the Sitecore dictionary from the Dictionary Service provided by JSS, found at `/sitecore/api/jss/dictionary/`, using `RestDictionaryService`. It is used as a "fallback" during both client and server rendering.

#### `JssTranslationServerLoaderService`

Expand Down
53 changes: 24 additions & 29 deletions docs/data/routes/docs/fundamentals/services/layout-service/en.md
Original file line number Diff line number Diff line change
Expand Up @@ -97,38 +97,33 @@ If you don't want analytics tracking for your JSS app, or for particular Layout

## Invoking the Layout Service from JSS

The Sitecore JSS SDK provides a simple API to make utilizing the Layout Service easier. Enter your configuration into the `fetchOptions` object and pass it into `dataApi.fetchRouteData()`. The `fetcher` option enables you to implement whichever data access method you wish. JSS ships with axios, which can be imported from `src\dataFetcher.js`.
The Sitecore JSS SDK provides a simple API to make utilizing the Layout Service easier. Create instance of `RestLayoutService` and pass your configuration into the constructor and call `layoutService.fetchLayoutData()`. The optional `dataFetcherResolver` option enables you to implement whichever data access method you wish. JSS ships with Axios by default.

The `dataApi` object is found in the `@sitecore-jss\sitecore-jss` package but is also exposed via the framework-specific SDKs
The `RestLayoutService` class is found in the `@sitecore-jss\sitecore-jss` package but is also exposed via the framework-specific SDKs

```javascript
import { dataApi } from '@sitecore-jss/sitecore-jss-react';
import { dataFetcher } from './dataFetcher';

const fetchOptions = {
fetcher: dataFetcher,
layoutServiceConfig: {
host: 'http://mysitecore',
configurationName: 'jss',
},
querystringParams: {
sc_lang: 'en',
tracking: false,
sc_apikey: '{00000000-0000-0000-0000-000000000000}',
sc_camp: 'FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF'
},
requestConfig: {
// AxiosRequestConfig -- https://github.com/axios/axios#request-config
// Note: `withCredentials: true` is added automatically
timeout: 3000,
headers: {
'X-JSS': 'Experience is asynchronous'
}
},
}

dataApi.fetchRouteData('/', fetchOptions).then(route => {
console.log(JSON.stringify(route, null, 2));
// ./layout-service.js

import { RestLayoutService } from '@sitecore-jss/sitecore-jss-react';
import { dataFetcher } from './dataFetcher';

export const layoutService = new RestLayoutService({
apiHost: 'http://mysitecore',
apiKey: '{00000000-0000-0000-0000-000000000000}',
siteName: 'jssappname',
tracking: false,
dataFetcherResolver: () => dataFetcher,
});
```

```javascript
import { layoutService } from './layout-service';

const language = 'en';
const sitecoreRoutePath = '/styleguide';

layoutService.fetchLayoutData(sitecoreRoutePath, language).then((route) => {
console.log(JSON.stringify(route, null, 2));
});
```

Expand Down
2 changes: 1 addition & 1 deletion docs/data/routes/docs/fundamentals/services/tracking/en.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ The tracking API ships with TypeScript typings, so with TS-aware editors like VS

The tracking API supports tracking arbitrary page view events. This can be useful for things like tracking route changes that do not involve a Layout Service request (cached, custom routes, etc). When tracking page views, it's important to know:

* Requests to [Layout Service](/docs/fundamentals/services/layout-service) will track a page view by default. This can be disabled by adding `tracking=false` to the Layout Service request query string (configurable via the `dataApi` object in JSS apps). Disabling LS tracking may make sense if all page tracking is to be handled using the tracking API.
* Requests to [Layout Service](/docs/fundamentals/services/layout-service) will track a page view by default. This can be disabled by adding `tracking=false` to the Layout Service request query string (configurable via the `RestLayoutService` class in JSS apps). Disabling LS tracking may make sense if all page tracking is to be handled using the tracking API.
* Page view events require a Sitecore Item ID to track against, even though the URL tracked is arbitrary. If tracking non-item-based routes, you may need to create surrogate items to track against.

```js
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -180,4 +180,13 @@ After patching in your custom configuration, you can utilize it in your JSS App
</javaScriptServices>
```

You'll need to ensure that you provide this configuration name in your client code as well when invoking Layout Service via the `dataApi` (see examples above).
Provide configuration name in your client code as well when invoking Layout Service via the `RestLayoutService`.

```javascript
const layoutService = new RestLayoutService({
apiHost: 'http://mysitecore',
apiKey: '{00000000-0000-0000-0000-000000000000}',
siteName: 'jssappname',
configurationName: 'my-jss-config',
});
```
Original file line number Diff line number Diff line change
Expand Up @@ -110,9 +110,9 @@ Fastest option. This package contains the rendering items, Sublayout and modifie

### Wizard Steps

* The sample uses the [`react-stepzilla`](https://github.com/newbreedofgeek/react-stepzilla) module to provide a step-based UX.
* The sample uses a step-based UX.
* Each step is a separate JSS route to provide for easier management/editing via the Experience Editor.
* The `Wizard` component "creatively" uses a `StepReference` component to allow steps to be managed via the Experience Editor, but then when rendering for the front-end, uses the component data to construct the step data expected by `react-stepzilla`.
* The `Wizard` component "creatively" uses a `StepReference` component to allow steps to be managed via the Experience Editor, but then when rendering for the front-end, uses the component data to construct the step.
* The `Step` component loads the referenced route from the Layout Service as each step is displayed.
* This means that each step will register in analytics as it is displayed as well.
* `Step` uses the same placeholder name as `App`, so that step contents can be rendered directly in the `App` as well (i.e. in the Experience Editor).
Expand Down
15 changes: 0 additions & 15 deletions docs/data/routes/help/en.md
Original file line number Diff line number Diff line change
Expand Up @@ -135,21 +135,6 @@ Attempt to connect to Node timed out after 60000ms.

* Placeholders defined in JSS will use the global `key` field on their Placeholder Settings. This means that conflicts may arise if non-JSS and JSS apps use the same placeholder key on a multi-site Sitecore installation. This is not a JSS-specific issue, and to avoid it give JSS apps unique placeholder names such as `myapp-main`. Note that JSS apps will _not_ conflict with each other when using the same placeholder keys, if there are multiple JSS sites.

* Site detection that is not based on `hostName` but on `virtualFolder` / `physicalFolder` attributes requires additional configuration and query string based site name specification. Search your app for `dataApi`, and find where the dataApi's `fetchRouteData()` function is being called. Add `sc_site` to the options passed to `fetchRouteData` like so:

```
const fetchOptions = {
// ...
querystringParams: {
// ... (i.e. 'sc_lang')
sc_site: 'name of your site definition in Sitecore'
},
};

// pseudocode
dataApi.fetchRouteData(route, fetchOptions);
```

## Troubleshooting

### Missing Layout Service Placeholder Data
Expand Down
2 changes: 1 addition & 1 deletion lerna.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@
"packages/*",
"samples/*"
],
"version": "19.0.0-canary.18"
"version": "19.0.0-canary.21"
}
7 changes: 3 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion packages/sitecore-jss-angular-schematics/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion packages/sitecore-jss-angular-schematics/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@sitecore-jss/sitecore-jss-angular-schematics",
"version": "19.0.0-canary.18",
"version": "19.0.0-canary.21",
"description": "Scaffolding schematics for Sitecore JSS Angular apps",
"scripts": {
"build": "tsc -p tsconfig.json",
Expand Down
2 changes: 1 addition & 1 deletion packages/sitecore-jss-angular/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions packages/sitecore-jss-angular/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@sitecore-jss/sitecore-jss-angular",
"version": "19.0.0-canary.18",
"version": "19.0.0-canary.21",
"description": "",
"scripts": {
"build": "ng-packagr -p ng-package.json",
Expand Down Expand Up @@ -52,7 +52,7 @@
"rxjs": "~6.6.6"
},
"dependencies": {
"@sitecore-jss/sitecore-jss": "^19.0.0-canary.18"
"@sitecore-jss/sitecore-jss": "^19.0.0-canary.21"
},
"main": "dist/bundles/sitecore-jss-sitecore-jss-angular.umd.js",
"module": "dist/fesm2015/sitecore-jss-sitecore-jss-angular.js",
Expand Down
7 changes: 0 additions & 7 deletions packages/sitecore-jss-angular/src/layout-service-error.ts

This file was deleted.

47 changes: 0 additions & 47 deletions packages/sitecore-jss-angular/src/layout.service.ts

This file was deleted.

3 changes: 1 addition & 2 deletions packages/sitecore-jss-angular/src/lib.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ import { RichTextDirective } from './components/rich-text.directive';
import { RouterLinkDirective } from './components/router-link.directive';
import { TextDirective } from './components/text.directive';
import { JssComponentFactoryService } from './jss-component-factory.service';
import { LayoutService } from './layout.service';

@NgModule({
imports: [CommonModule],
Expand Down Expand Up @@ -72,7 +71,7 @@ export class JssModule {
static forRoot(): ModuleWithProviders<JssModule> {
return {
ngModule: JssModule,
providers: [LayoutService, DatePipe, JssComponentFactoryService],
providers: [DatePipe, JssComponentFactoryService],
};
}

Expand Down
8 changes: 4 additions & 4 deletions packages/sitecore-jss-angular/src/public_api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,23 +17,23 @@ export {
} from './components/rendering-field';
export { RichTextDirective } from './components/rich-text.directive';
export { TextDirective } from './components/text.directive';
export { LayoutService } from './layout.service';
export { LayoutServiceError } from './layout-service-error';
export { JssModule } from './lib.module';
export {
dataApi,
mediaApi,
isEditorActive,
resetEditorChromes,
constants,
isExperienceEditorActive,
resetExperienceEditorChromes,
RestDictionaryService,
RestLayoutService,
LayoutService,
LayoutServiceData,
LayoutServiceContextData,
PlaceholderData,
RouteData,
Field,
HtmlElementRendering,
LayoutServiceRequestOptions,
getChildPlaceholder,
getFieldValue,
ComponentRendering,
Expand Down
8 changes: 4 additions & 4 deletions packages/sitecore-jss-cli/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions packages/sitecore-jss-cli/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@sitecore-jss/sitecore-jss-cli",
"version": "19.0.0-canary.18",
"version": "19.0.0-canary.21",
"description": "Sitecore JSS command-line",
"scripts": {
"build": "npm run clean && tsc",
Expand Down Expand Up @@ -30,8 +30,8 @@
"url": "https://github.com/sitecore/jss/issues"
},
"dependencies": {
"@sitecore-jss/sitecore-jss-dev-tools": "^19.0.0-canary.18",
"@sitecore-jss/sitecore-jss-manifest": "^19.0.0-canary.18",
"@sitecore-jss/sitecore-jss-dev-tools": "^19.0.0-canary.21",
"@sitecore-jss/sitecore-jss-manifest": "^19.0.0-canary.21",
"axios": "^0.21.1",
"chalk": "^2.4.2",
"cross-spawn": "^7.0.0",
Expand Down
8 changes: 4 additions & 4 deletions packages/sitecore-jss-dev-tools/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions packages/sitecore-jss-dev-tools/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@sitecore-jss/sitecore-jss-dev-tools",
"version": "19.0.0-canary.18",
"version": "19.0.0-canary.21",
"description": "Utilities to assist in the development and deployment of Sitecore JSS apps.",
"scripts": {
"build": "npm run clean && tsc",
Expand Down Expand Up @@ -29,9 +29,9 @@
"url": "https://github.com/sitecore/jss/issues"
},
"dependencies": {
"@sitecore-jss/sitecore-jss": "^19.0.0-canary.18",
"@sitecore-jss/sitecore-jss-manifest": "^19.0.0-canary.18",
"@sitecore-jss/sitecore-jss-update-package": "^19.0.0-canary.18",
"@sitecore-jss/sitecore-jss": "^19.0.0-canary.21",
"@sitecore-jss/sitecore-jss-manifest": "^19.0.0-canary.21",
"@sitecore-jss/sitecore-jss-update-package": "^19.0.0-canary.21",
"axios": "^0.21.1",
"chokidar": "^3.2.1",
"del": "^5.1.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/sitecore-jss-forms/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading