Skip to content

Commit

Permalink
Chore (release): 6.5.0 (#2159)
Browse files Browse the repository at this point in the history
* Task: Fix auto-collapsing of permissions items (#2099)

* Task: Take Modify Permissions out of preview (#2110)

* Task: fix accessibility unnecessary empty data scans (#2118)

* Task: Update doc.microsoft links to learn.microsoft (#2148)

* Task: Remove errors telemetry filter to capture more details (#2124)

* Fix: Prevent sample groups from collapsing (#2101)

* Fix: Remove float CSS property on snippets (#2106)

* Fix: Update wordSeparators in Monaco (#2109)

* Fix: Failing tests (#2144)

* Fix: failing tests [Attempt 2] (#2145)

* Fix: stop recursive deep copy (#2151)

* Fix: display suggestions for placeholder segments (#2156)

* Fix: Pass empty array to signOutSuccess when signing out (#2162)

* Chore: Dependabot upgrades September 2022 (#2098)
  • Loading branch information
thewahome committed Oct 7, 2022
1 parent 3604275 commit 0053df9
Show file tree
Hide file tree
Showing 31 changed files with 2,882 additions and 1,771 deletions.
22 changes: 11 additions & 11 deletions SECURITY.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,27 +4,27 @@

Microsoft takes the security of our software products and services seriously, which includes all source code repositories managed through our GitHub organizations, which include [Microsoft](https://github.com/Microsoft), [Azure](https://github.com/Azure), [DotNet](https://github.com/dotnet), [AspNet](https://github.com/aspnet), [Xamarin](https://github.com/xamarin), and [our GitHub organizations](https://opensource.microsoft.com/).

If you believe you have found a security vulnerability in any Microsoft-owned repository that meets [Microsoft's definition of a security vulnerability](https://docs.microsoft.com/en-us/previous-versions/tn-archive/cc751383(v=technet.10)), please report it to us as described below.
If you believe you have found a security vulnerability in any Microsoft-owned repository that meets [Microsoft's definition of a security vulnerability](<https://learn.microsoft.com/en-us/previous-versions/tn-archive/cc751383(v=technet.10)>), please report it to us as described below.

## Reporting Security Issues

**Please do not report security vulnerabilities through public GitHub issues.**

Instead, please report them to the Microsoft Security Response Center (MSRC) at [https://msrc.microsoft.com/create-report](https://msrc.microsoft.com/create-report).

If you prefer to submit without logging in, send email to [secure@microsoft.com](mailto:secure@microsoft.com). If possible, encrypt your message with our PGP key; please download it from the [Microsoft Security Response Center PGP Key page](https://www.microsoft.com/en-us/msrc/pgp-key-msrc).
If you prefer to submit without logging in, send email to [secure@microsoft.com](mailto:secure@microsoft.com). If possible, encrypt your message with our PGP key; please download it from the [Microsoft Security Response Center PGP Key page](https://www.microsoft.com/en-us/msrc/pgp-key-msrc).

You should receive a response within 24 hours. If for some reason you do not, please follow up via email to ensure we received your original message. Additional information can be found at [microsoft.com/msrc](https://www.microsoft.com/msrc).
You should receive a response within 24 hours. If for some reason you do not, please follow up via email to ensure we received your original message. Additional information can be found at [microsoft.com/msrc](https://www.microsoft.com/msrc).

Please include the requested information listed below (as much as you can provide) to help us better understand the nature and scope of the possible issue:

* Type of issue (e.g. buffer overflow, SQL injection, cross-site scripting, etc.)
* Full paths of source file(s) related to the manifestation of the issue
* The location of the affected source code (tag/branch/commit or direct URL)
* Any special configuration required to reproduce the issue
* Step-by-step instructions to reproduce the issue
* Proof-of-concept or exploit code (if possible)
* Impact of the issue, including how an attacker might exploit the issue
- Type of issue (e.g. buffer overflow, SQL injection, cross-site scripting, etc.)
- Full paths of source file(s) related to the manifestation of the issue
- The location of the affected source code (tag/branch/commit or direct URL)
- Any special configuration required to reproduce the issue
- Step-by-step instructions to reproduce the issue
- Proof-of-concept or exploit code (if possible)
- Impact of the issue, including how an attacker might exploit the issue

This information will help us triage your report more quickly.

Expand All @@ -38,4 +38,4 @@ We prefer all communications to be in English.

Microsoft follows the principle of [Coordinated Vulnerability Disclosure](https://www.microsoft.com/en-us/msrc/cvd).

<!-- END MICROSOFT SECURITY.MD BLOCK -->
<!-- END MICROSOFT SECURITY.MD BLOCK -->
3,267 changes: 2,196 additions & 1,071 deletions package-lock.json

Large diffs are not rendered by default.

55 changes: 28 additions & 27 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,32 +1,32 @@
{
"name": "graph-explorer-v2",
"version": "6.4.0",
"version": "6.5.0",
"private": true,
"dependencies": {
"@augloop/types-core": "file:packages/types-core-2.16.189.tgz",
"@axe-core/webdriverjs": "4.4.3",
"@axe-core/webdriverjs": "4.4.5",
"@azure/msal-browser": "2.27.0",
"@babel/core": "7.18.10",
"@babel/runtime": "7.18.9",
"@fluentui/react": "8.72.1",
"@babel/core": "7.19.3",
"@babel/runtime": "7.19.0",
"@fluentui/react": "8.97.1",
"@fluentui/react-icons-mdl2": "1.3.8",
"@microsoft/applicationinsights-react-js": "3.3.6",
"@microsoft/applicationinsights-react-js": "3.4.0",
"@microsoft/applicationinsights-web": "2.8.6",
"@microsoft/microsoft-graph-client": "3.0.2",
"@monaco-editor/react": "4.4.5",
"@monaco-editor/react": "4.4.6",
"@ms-ofb/officebrowserfeedbacknpm": "file:packages/officebrowserfeedbacknpm-1.6.6.tgz",
"adaptivecards": "2.10.0",
"adaptivecards": "2.11.1",
"adaptivecards-templating": "1.4.0",
"babel-loader": "8.2.5",
"babel-preset-react-app": "10.0.1",
"bfj": "7.0.2",
"bootstrap": "5.2.0",
"case-sensitive-paths-webpack-plugin": "2.4.0",
"css-loader": "6.7.1",
"dotenv": "16.0.0",
"dotenv-expand": "8.0.3",
"dotenv": "16.0.3",
"dotenv-expand": "9.0.0",
"eslint-config-react-app": "7.0.1",
"eslint-plugin-react": "7.30.1",
"eslint-plugin-react": "7.31.8",
"eslint-webpack-plugin": "3.1.1",
"express": "4.18.1",
"file-loader": "6.2.0",
Expand All @@ -36,12 +36,12 @@
"isomorphic-fetch": "3.0.0",
"localforage": "1.10.0",
"mini-css-extract-plugin": "2.6.1",
"monaco-editor": "0.33.0",
"monaco-editor": "0.34.0",
"monaco-editor-webpack-plugin": "7.0.1",
"office-ui-fabric-core": "11.0.1",
"postcss-flexbugs-fixes": "5.0.2",
"postcss-loader": "7.0.1",
"postcss-preset-env": "7.7.2",
"postcss-preset-env": "7.8.2",
"re-resizable": "6.9.9",
"react": "16.14.0",
"react-app-polyfill": "3.0.0",
Expand All @@ -54,13 +54,13 @@
"sass": "1.50.0",
"sass-loader": "13.0.2",
"style-loader": "3.3.1",
"typescript": "4.7.4",
"typescript": "4.8.4",
"url": "0.11.0",
"url-loader": "4.1.1",
"webpack": "5.74.0",
"webpack-dev-server": "4.9.3",
"webpack-manifest-plugin": "5.0.0",
"workbox-webpack-plugin": "6.5.3"
"workbox-webpack-plugin": "6.5.4"
},
"scripts": {
"start": "node scripts/start.js",
Expand All @@ -86,41 +86,42 @@
],
"devDependencies": {
"@testing-library/react": "12.1.5",
"@testing-library/user-event": "14.4.1",
"@testing-library/user-event": "14.4.3",
"@types/chromedriver": "81.0.1",
"@types/enzyme": "3.10.11",
"@types/enzyme": "3.10.12",
"@types/enzyme-adapter-react-16": "1.0.6",
"@types/isomorphic-fetch": "0.0.36",
"@types/jest": "27.4.1",
"@types/lodash.debounce": "4.0.6",
"@types/lodash.debounce": "4.0.7",
"@types/react": "17.0.44",
"@types/react-dom": "17.0.11",
"@types/react-intl": "3.0.0",
"@types/react-redux": "7.1.23",
"@types/redux-logger": "3.0.9",
"@types/redux-mock-store": "1.0.3",
"@types/selenium-webdriver": "4.1.2",
"@typescript-eslint/eslint-plugin": "5.32.0",
"@typescript-eslint/parser": "5.30.5",
"acorn": "8.7.1",
"babel-jest": "28.1.2",
"chromedriver": "101.0.0",
"@types/selenium-webdriver": "4.1.5",
"@typescript-eslint/eslint-plugin": "5.38.1",
"@typescript-eslint/parser": "5.38.1",
"acorn": "8.8.0",
"babel-jest": "29.1.2",
"chromedriver": "106.0.1",
"enzyme": "3.11.0",
"enzyme-adapter-react-16": "1.15.6",
"eslint": "8.21.0",
"eslint": "8.24.0",
"html-webpack-plugin": "5.5.0",
"jest": "28.1.0",
"jest-environment-jsdom": "28.1.3",
"jest-canvas-mock": "2.4.0",
"jest-fetch-mock": "3.0.3",
"jest-sonar-reporter": "2.0.0",
"jest-watch-typeahead": "2.0.0",
"jest-watch-typeahead": "2.2.0",
"node-notifier": "10.0.1",
"react-dev-utils": "12.0.1",
"redux-logger": "3.0.6",
"redux-mock-store": "1.5.4",
"selenium-webdriver": "4.3.0",
"start-server-and-test": "1.14.0",
"ts-jest": "28.0.5"
"ts-jest": "28.0.8"
},
"jestSonar": {
"reportPath": "reports",
Expand Down
2 changes: 1 addition & 1 deletion src/app/services/actions/auth-action-creators.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ describe('Auth Action Creators', () => {

it('should dispatch LOGOUT_SUCCESS when signOutSuccess() is called', () => {
// Arrange
const response: boolean = false;
const response: boolean = true;
const expectedAction = {
type: LOGOUT_SUCCESS,
response
Expand Down
2 changes: 1 addition & 1 deletion src/app/services/reducers/auth-reducers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ export function consentedScopes(state: string[] = [], action: IAction): any {
case GET_CONSENTED_SCOPES_SUCCESS:
return action.response;
case LOGOUT_SUCCESS:
return action.response;
return [];
default:
return state;
}
Expand Down
2 changes: 1 addition & 1 deletion src/app/utils/generate-groups.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { IGroup } from '@fluentui/react';

export function generateGroupsFromList(list: any[], property: string) : IGroup[]{
export function generateGroupsFromList(list: any[], property: string) : IGroup[] {
const map = new Map();
const groups: IGroup[] = [];

Expand Down
17 changes: 14 additions & 3 deletions src/app/utils/query-parameter-sanitization.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,19 +54,23 @@ function isKeyValuePair(str: string): boolean {
return KEY_VALUE_REGEX.test(str);
}

export function isPropertyName(str: string): boolean {
function isPropertyName(str: string): boolean {
return PROPERTY_NAME_REGEX.test(str);
}

export function isAllAlpha(str: string): boolean {
function isAllAlpha(str: string): boolean {
return ALL_ALPHA_REGEX.test(str);
}

function isPlaceHolderSegment(segment: string) {
return segment.startsWith('{') && segment.endsWith('}')
}

/**
* Redact variable segments of query parameters
* @param queryParameter e.g. $top=5, $search="pizza", $filter=startswith(displayName, 'J')
*/
export function sanitizeQueryParameter(queryParameter: string): string {
function sanitizeQueryParameter(queryParameter: string): string {
// return if not key-value pair
if (!queryParameter.includes('=')) {
return queryParameter;
Expand Down Expand Up @@ -482,3 +486,10 @@ function sanitizeFilterQueryOptionValue(queryParameterValue: string): string {
}
return sanitizedQueryString.trim();
}

export {
isPropertyName,
isAllAlpha,
isPlaceHolderSegment,
sanitizeQueryParameter
}
6 changes: 5 additions & 1 deletion src/app/utils/query-url-sanitization.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import { IQuery } from '../../types/query-runner';
import {
isAllAlpha,
isPlaceHolderSegment,
sanitizeQueryParameter
} from './query-parameter-sanitization';
import { parseSampleUrl } from './sample-url-generation';
Expand Down Expand Up @@ -79,7 +80,6 @@ function sanitizedQueryUrl(url: string): string {
return `${match.substring(0, match.indexOf(':'))}:<value>`;
}
);

// Split requestUrl into segments that can be sanitized individually
const urlSegments = resourceUrl.split('/');
urlSegments.forEach((segment, index) => {
Expand Down Expand Up @@ -134,6 +134,10 @@ function sanitizePathSegment(previousSegment: string, segment: string): string {
return `${segment.substring(0, openingBracketIndex)}(${sanitizedText})`;
}

if (isPlaceHolderSegment(segment)) {
return segment;
}

if (!isAllAlpha(previousSegment) && !isDeprecation(previousSegment)) {
previousSegment = 'unknown';
}
Expand Down
3 changes: 1 addition & 2 deletions src/app/utils/resources/resources-filter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@ function getResourcesSupportedByVersion(
searchText?: string
): IResource[] {
const versionedResources: IResource[] = [];
const resourcesList = JSON.parse(JSON.stringify(resources)); // deep copy
resourcesList.forEach((resource: IResource) => {
resources.forEach((resource: IResource) => {
if (versionExists(resource, version)) {
resource.children = getResourcesSupportedByVersion(
resource.children || [],
Expand Down
19 changes: 1 addition & 18 deletions src/app/views/App.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -116,23 +116,6 @@ describe('App rendering', () => {
expect(screen.getByRole('tab', { name: /expand/i} )).toBeDefined();
});

it('should hide the sidebar when \'minimize sidebar button\' is clicked', async () => {
const user = userEvent.setup();
renderApp({ mobileScreen: false, showSidebar: true });
const minimizeButton = screen.getByRole('button', { name: /minimize sidebar/i });
await user.click(minimizeButton);
expect(screen.getByText(/sidebar minimized/i)).toBeDefined();

// resources, samples and history tabs are now buttons on the sidebar
const samplesButton = screen.getByRole('button', { name: /sample queries/i});
expect(screen.getByRole('button', { name: /resources/i})).toBeDefined();
expect(screen.getByRole('button', { name: /history/i})).toBeDefined();

await user.click(samplesButton);
expect(screen.getByText(/sidebar maximized/i)).toBeDefined();
expect(screen.getByRole('tab',{ name: /sample queries/i}));
})

it('should render http methods dropdown when the \'request method button\' is clicked', async () => {
const user = userEvent.setup();
renderApp({mobileScreen: false, showSidebar: true});
Expand Down Expand Up @@ -224,7 +207,7 @@ describe('App rendering', () => {
it('should render the permissions tab and its children when the modify permissions tab is clicked', async () => {
const user = userEvent.setup();
renderApp({mobileScreen: false, showSidebar: true});
const modifyPermissionsTab = screen.getByRole('tab', { name: /modify permissions \(preview\)/i});
const modifyPermissionsTab = screen.getByRole('tab', { name: /modify permissions/i });
await user.click(modifyPermissionsTab);
expect(screen.getByText(/Permissions for the query are missing on this tab/i)).toBeDefined();
});
Expand Down
6 changes: 3 additions & 3 deletions src/app/views/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -102,9 +102,9 @@ class App extends Component<IAppProps, IAppState> {
}

const whiteListedDomains = [
'https://docs.microsoft.com',
'https://review.docs.microsoft.com',
'https://ppe.docs.microsoft.com',
'https://learn.microsoft.com',
'https://review.learn.microsoft.com',
'https://dev.learn.microsoft.com',
'https://docs.azure.cn'
];

Expand Down
2 changes: 1 addition & 1 deletion src/app/views/app-sections/TermsOfUseMessage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ const styledTermsOfUseMessage = () => {
onClick={(e) =>
telemetry.trackLinkClickEvent((e.currentTarget as HTMLAnchorElement).href,
componentNames.MICROSOFT_APIS_TERMS_OF_USE_LINK)}
href={'https://docs.microsoft.com/' + geLocale +
href={'https://learn.microsoft.com/' + geLocale +
'/legal/microsoft-apis/terms-of-use?context=graph/context'} target='_blank' rel='noopener noreferrer'>
<FormattedMessage id='Terms of use' /></Link>.
<FormattedMessage id='View the' />
Expand Down
Loading

0 comments on commit 0053df9

Please sign in to comment.