Skip to content

Commit 4e3d898

Browse files
authored
Merge pull request #2271 from microsoftgraph/merge/main-to-next
merging main to next/fluentui
2 parents 3677936 + 7af8094 commit 4e3d898

File tree

23 files changed

+125
-100
lines changed

23 files changed

+125
-100
lines changed
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# Copyright (c) Microsoft Corporation.
2+
# Licensed under the MIT License.
3+
4+
name: branch_protection_sdks
5+
description: Organization branch protection policy for Microsoft Graph Toolkit repository
6+
resource: repository
7+
configuration:
8+
branchProtectionRules:
9+
- branchNamePattern: next/*
10+
requiredApprovingReviewsCount:
11+
min: 1
12+
# Must have a CODEOWNER approve for the PR to be merged.
13+
requireCodeOwnersReview: true
14+
15+
# Dismiss stale pull request approvals when new commits are pushed
16+
dismissStaleReviews: true
17+
18+
# Require conversation resolution before merging. Address all concerns, and resolve in the GitHub PR UI.
19+
requiresConversationResolution: true
20+
21+
# Require status checks to pass before merging. TODO: this value should be true, we should work to support this.
22+
# Used with the requiredStatusChecks setting to specify which checks must pass for the PR to be merged.
23+
requiresStrictStatusChecks: true
24+
25+
requiredStatusChecks:
26+
- GitOps/AdvancedSecurity
27+
- license/cla
28+
- check-build-matrix
29+
30+
# TODO: all commits should be signed. We need to get everyone signing their commits.
31+
requiresCommitSignatures: false

.github/workflows/codeql-analysis.yml

Lines changed: 29 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,14 @@
99
# the `language` matrix defined below to confirm you have the correct set of
1010
# supported CodeQL languages.
1111
#
12-
name: "CodeQL"
12+
name: 'CodeQL'
1313

1414
on:
1515
push:
16-
branches: [ main, release/* ]
16+
branches: [main, release/*, next/fluentui, next/mgt-chat]
1717
pull_request:
1818
# The branches below must be a subset of the branches above
19-
branches: [ main, release/* ]
19+
branches: [main, release/*, next/fluentui, next/mgt-chat]
2020
schedule:
2121
- cron: '29 20 * * 1'
2222

@@ -28,40 +28,40 @@ jobs:
2828
strategy:
2929
fail-fast: false
3030
matrix:
31-
language: [ 'javascript' ]
31+
language: ['javascript']
3232
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python' ]
3333
# Learn more:
3434
# https://docs.github.com/en/free-pro-team@latest/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#changing-the-languages-that-are-analyzed
3535

3636
steps:
37-
- name: Checkout repository
38-
uses: actions/checkout@v2
37+
- name: Checkout repository
38+
uses: actions/checkout@v2
3939

40-
# Initializes the CodeQL tools for scanning.
41-
- name: Initialize CodeQL
42-
uses: github/codeql-action/init@v1
43-
with:
44-
languages: ${{ matrix.language }}
45-
# If you wish to specify custom queries, you can do so here or in a config file.
46-
# By default, queries listed here will override any specified in a config file.
47-
# Prefix the list here with "+" to use these queries and those in the config file.
48-
# queries: ./path/to/local/query, your-org/your-repo/queries@main
40+
# Initializes the CodeQL tools for scanning.
41+
- name: Initialize CodeQL
42+
uses: github/codeql-action/init@v2
43+
with:
44+
languages: ${{ matrix.language }}
45+
# If you wish to specify custom queries, you can do so here or in a config file.
46+
# By default, queries listed here will override any specified in a config file.
47+
# Prefix the list here with "+" to use these queries and those in the config file.
48+
# queries: ./path/to/local/query, your-org/your-repo/queries@main
4949

50-
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
51-
# If this step fails, then you should remove it and run the build manually (see below)
52-
- name: Autobuild
53-
uses: github/codeql-action/autobuild@v1
50+
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
51+
# If this step fails, then you should remove it and run the build manually (see below)
52+
- name: Autobuild
53+
uses: github/codeql-action/autobuild@v2
5454

55-
# ℹ️ Command-line programs to run using the OS shell.
56-
# 📚 https://git.io/JvXDl
55+
# ℹ️ Command-line programs to run using the OS shell.
56+
# 📚 https://git.io/JvXDl
5757

58-
# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
59-
# and modify them (or add more) to build your code if your project
60-
# uses a compiled language
58+
# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
59+
# and modify them (or add more) to build your code if your project
60+
# uses a compiled language
6161

62-
#- run: |
63-
# make bootstrap
64-
# make release
62+
#- run: |
63+
# make bootstrap
64+
# make release
6565

66-
- name: Perform CodeQL Analysis
67-
uses: github/codeql-action/analyze@v1
66+
- name: Perform CodeQL Analysis
67+
uses: github/codeql-action/analyze@v2

.github/workflows/pr.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,3 +62,17 @@ jobs:
6262

6363
- name: Write to Job Summary
6464
run: cat code-coverage-results.md >> $GITHUB_STEP_SUMMARY
65+
66+
# The check-build-matrix returns success if all matrix jobs in build are successful; otherwise, it returns a failure.
67+
# Use this as a PR status check for GitHub Policy Service instead of individual matrix entry checks.
68+
check-build-matrix:
69+
runs-on: ubuntu-latest
70+
needs: build
71+
if: always()
72+
steps:
73+
- name: All build matrix options are successful
74+
if: ${{ !(contains(needs.*.result, 'failure')) }}
75+
run: exit 0
76+
- name: One or more build matrix options failed
77+
if: ${{ contains(needs.*.result, 'failure') }}
78+
run: exit 1

artifacts/install.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,6 @@ function Get-Packages {
2020
Write-Output $output
2121
}
2222

23-
$packages = Get-Packages mgt-element mgt-msal-provider mgt-proxy-provider mgt-sharepoint-provider mgt-teams-provider mgt-components mgt mgt-react
23+
$packages = Get-Packages mgt-element mgt-msal2-provider mgt-proxy-provider mgt-sharepoint-provider mgt-teamsfx-provider mgt-components mgt mgt-react
2424

2525
npm i $packages

auth.html

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,9 @@
11
<html>
22
<head>
33
<script src="https://unpkg.com/@microsoft/teams-js@2/dist/MicrosoftTeams.min.js" crossorigin="anonymous"></script>
4-
<!-- <script src="./packages/mgt/dist/bundle/mgt-loader.js"></script>
5-
<script>
6-
mgt.TeamsProvider.handleAuth();
7-
</script> -->
84
<script type="module">
9-
// import { TeamsProvider } from './packages/providers/mgt-teams-provider/dist/es6/TeamsProvider.js';
10-
// TeamsProvider.handleAuth();
11-
12-
import { TeamsMsal2Provider } from './packages/providers/mgt-teams-msal2-provider/dist/es6/TeamsMsal2Provider.js';
13-
TeamsMsal2Provider.handleAuth();
5+
import { TeamsFxProvider } from './packages/providers/mgt-teamsfx-provider/dist/es6/TeamsFxProvider.js';
6+
// TODO: show how to use TeamsFx in auth.
147
</script>
158
</head>
169
<body>

index.html

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -30,33 +30,6 @@
3030
</head>
3131

3232
<body>
33-
<!-- <mgt-teams-provider
34-
client-id="a974dfa0-9f57-49b9-95db-90f04ce2111a"
35-
auth-popup-url="auth.html"
36-
></mgt-teams-provider> -->
37-
38-
<!-- <mgt-teams-msal2-provider
39-
client-id="72482bff-ecae-44f5-8fdc-513b7f5602e7"
40-
scopes="user.read,user.read.all,mail.readBasic,people.read,people.read.all,sites.read.all,user.readbasic.all,contacts.read,presence.read,presence.read.all,tasks.readwrite,tasks.read,calendars.read,group.read.all"
41-
auth-popup-url="auth.html"
42-
></mgt-teams-msal2-provider> -->
43-
44-
<!-- Teams Msal2 provider in SSO mode (see "teams-sso-node" sample) -->
45-
<!-- <mgt-teams-msal2-provider
46-
client-id="72482bff-ecae-44f5-8fdc-513b7f5602e7"
47-
scopes="user.read,user.read.all,mail.readBasic,people.read,people.read.all,sites.read.all,user.readbasic.all,contacts.read,presence.read,presence.read.all,tasks.readwrite,tasks.read,calendars.read,group.read.all"
48-
auth-popup-url="auth.html"
49-
sso-url="http://localhost:5000/api/token"
50-
http-method="POST"
51-
></mgt-teams-msal2-provider> -->
52-
53-
<!-- <mgt-msal-provider
54-
client-id="a974dfa0-9f57-49b9-95db-90f04ce2111a"
55-
scopes="user.read,user.read.all,mail.readBasic,people.read,people.read.all,sites.read.all,user.readbasic.all,contacts.read,presence.read,presence.read.all,tasks.readwrite,tasks.read,calendars.read,group.read.all"
56-
redirect-uri="http://localhost:3000"
57-
depends-on="mgt-teams-provider"
58-
></mgt-msal-provider> -->
59-
6033
<!-- <mgt-msal2-provider
6134
client-id="2dfea037-938a-4ed8-9b35-c05708a1b241"
6235
redirect-uri="http://localhost:3000"

packages/mgt-components/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ The components can be used on their own, but they are at their best when they ar
3333
1. Install the packages
3434

3535
```bash
36-
npm install @microsoft/mgt-element @microsoft/mgt-components @microsoft/mgt-msal-provider
36+
npm install @microsoft/mgt-element @microsoft/mgt-components @microsoft/mgt-msal2-provider
3737
```
3838

3939
1. Use components in your code
@@ -47,7 +47,7 @@ The components can be used on their own, but they are at their best when they ar
4747
import '@microsoft/mgt-components';
4848
4949
// initialize the auth provider globally
50-
Providers.globalProvider = new MsalProvider({clientId: 'clientId'});
50+
Providers.globalProvider = new Msal2Provider({clientId: 'clientId'});
5151
</script>
5252
5353
<mgt-login></mgt-login>

packages/mgt-element/README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,32 +2,32 @@
22

33
[![npm](https://img.shields.io/npm/v/@microsoft/mgt-element?style=for-the-badge)](https://www.npmjs.com/package/@microsoft/mgt-element)
44

5-
The [Microsoft Graph Toolkit (mgt)](https://aka.ms/mgt) library is a collection of authentication providers and UI components powered by Microsoft Graph.
5+
The [Microsoft Graph Toolkit (mgt)](https://aka.ms/mgt) library is a collection of authentication providers and UI components powered by Microsoft Graph.
66

77
The `@microsoft/mgt-element` package contains all base classes that enable the providers and components to work together. Use this package to set the global provider, or to create your own providers and/or components that work with Microsoft Graph.
88

99
[See docs for full documentation](https://aka.ms/mgt-docs)
1010

1111
## Set and use the global provider
1212

13-
The `@microsoft/mgt-element` package exposes the `Providers` namespace that enables global usage of the authentication providers across your entire app.
13+
The `@microsoft/mgt-element` package exposes the `Providers` namespace that enables global usage of the authentication providers across your entire app.
1414

1515
This example illustrates how to instantiate a new provider (MsalProvider in this case) and use it across your app:
1616

17-
1. Install the packages
17+
1. Install the packages
1818

1919
```bash
20-
npm install @microsoft/mgt-element @microsoft/mgt-msal-provider
20+
npm install @microsoft/mgt-element @microsoft/mgt-msal2-provider
2121
```
2222

2323
1. Create the provider
2424

2525
```ts
2626
import {Providers} from '@microsoft/mgt-element';
27-
import {MsalProvider} from '@microsoft/mgt-msal-provider';
27+
import {Msal2Provider} from '@microsoft/mgt-msal2-provider';
2828
2929
// initialize the auth provider globally
30-
Providers.globalProvider = new MsalProvider({clientId: 'clientId'});
30+
Providers.globalProvider = new Msal2Provider({clientId: 'clientId'});
3131
```
3232

3333
1. Use the provider to sign in and call the graph:

packages/mgt-react/package.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,10 @@
4040
"@microsoft/microsoft-graph-types-beta": "^0.29.0-preview",
4141
"wc-react": "^0.5.0"
4242
},
43+
"peerDependencies": {
44+
"react": "^17.0.1",
45+
"react-dom": "^17.0.1"
46+
},
4347
"publishConfig": {
4448
"access": "public"
4549
}

packages/mgt/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,12 +51,12 @@ You can use the components by referencing the loader directly (via unpkg), or in
5151

5252
> NOTE: This link will load the highest available version of @microsoft/mgt in the range `>= 2.0.0 < 3.0.0`, omitting the `@2` fragment from the url results in loading the latest version. This could result in loading a new major version and breaking the application.
5353
54-
You can then start using the components in your html page. Here is a full working example with the Msal provider:
54+
You can then start using the components in your html page. Here is a full working example with the Msal2 provider:
5555

5656
```html
5757
<script src="https://unpkg.com/@microsoft/mgt@2/dist/bundle/mgt-loader.js"></script>
5858

59-
<mgt-msal-provider client-id="[CLIENT-ID]"></mgt-msal-provider>
59+
<mgt-msal2-provider client-id="[CLIENT-ID]"></mgt-msal2-provider>
6060

6161
<mgt-login></mgt-login>
6262
<mgt-agenda></mgt-agenda>
@@ -77,7 +77,7 @@ Now you can reference all components and providers at the page you are using:
7777
```html
7878
<script type="module" src="node_modules/@microsoft/mgt/dist/es6/index.js"></script>
7979

80-
<mgt-msal-provider client-id="[CLIENT-ID]"></mgt-msal-provider>
80+
<mgt-msal2-provider client-id="[CLIENT-ID]"></mgt-msal2-provider>
8181

8282
<mgt-login></mgt-login>
8383
<mgt-agenda></mgt-agenda>

0 commit comments

Comments
 (0)