Skip to content

Commit e1cc639

Browse files
committed
update msal, add tests, add workflows
1 parent 8d3d1c9 commit e1cc639

49 files changed

Lines changed: 41664 additions & 328 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/codeql.yml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: "Code Scan"
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- main
7+
8+
jobs:
9+
CodeQL-Build:
10+
strategy:
11+
fail-fast: false
12+
13+
# CodeQL runs on ubuntu-latest, windows-latest, and macos-latest
14+
runs-on: ubuntu-latest
15+
16+
steps:
17+
- name: Checkout repository
18+
uses: actions/checkout@v2
19+
20+
# Initializes the CodeQL tools for scanning.
21+
- name: Initialize CodeQL
22+
uses: github/codeql-action/init@v1
23+
with:
24+
languages: javascript
25+
26+
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
27+
# If this step fails, then you should remove it and run the build manually (see below).
28+
#- name: Autobuild
29+
# uses: github/codeql-action/autobuild@v1
30+
31+
# ℹ️ Command-line programs to run using the OS shell.
32+
# 📚 https://git.io/JvXDl
33+
34+
# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
35+
# and modify them (or add more) to build your code if your project
36+
# uses a compiled language
37+
38+
- name: Perform CodeQL Analysis
39+
uses: github/codeql-action/analyze@v1

.github/workflows/node.js.yml

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node
2+
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions
3+
4+
name: "Build"
5+
6+
on:
7+
pull_request:
8+
branches:
9+
- main
10+
11+
jobs:
12+
build:
13+
14+
runs-on: ubuntu-latest
15+
16+
strategy:
17+
matrix:
18+
node-version: [12.x]
19+
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
20+
21+
steps:
22+
- uses: actions/checkout@v2
23+
- name: Use Node.js ${{ matrix.node-version }}
24+
uses: actions/setup-node@v2
25+
with:
26+
node-version: ${{ matrix.node-version }}
27+
28+
- run: |
29+
cd 1-Authentication/1-sign-in/App
30+
npm ci
31+
npm audit --production
32+
npm run test
33+
34+
- run: |
35+
cd 1-Authentication/2-sign-in-b2c/App
36+
npm ci
37+
npm audit --production
38+
npm run test
39+
40+
- run: |
41+
cd 2-Authorization/1-call-graph/App
42+
npm ci
43+
npm audit --production
44+
npm run test
45+
46+
- run: |
47+
cd 3-Deployment/App
48+
npm ci
49+
npm audit --production
50+
npm run test
51+
52+
- run: |
53+
cd 4-AccessControl/1-app-roles/App
54+
npm ci
55+
npm audit --production
56+
npm run test
57+
58+
- run: |
59+
cd 4-AccessControl/2-security-groups/App
60+
npm ci
61+
npm audit --production
62+
npm run test

.github/workflows/stale.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# https://github.com/actions/stale
2+
name: Mark stale issues and pull requests
3+
4+
on:
5+
schedule:
6+
- cron: "0 0 * * *"
7+
8+
jobs:
9+
stale:
10+
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- uses: actions/stale@v3
15+
with:
16+
repo-token: ${{ secrets.GITHUB_TOKEN }}
17+
operations-per-run: 60
18+
stale-issue-message: 'This issue has not seen activity in 14 days. If your issue has not been resolved please leave a comment to keep this open. It will be closed in 7 days if it remains stale.'
19+
close-issue-message: 'This issue has been closed due to inactivity. If this has not been resolved please open a new issue. Thanks!'
20+
stale-pr-message: 'This PR has not seen activity in 30 days. It may be closed if it remains stale.'
21+
stale-issue-label: 'no-issue-activity'
22+
stale-pr-label: 'no-pr-activity'
23+
days-before-issue-stale: 14
24+
days-before-pr-stale: 30
25+
days-before-close: 7

.gitignore

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -101,9 +101,6 @@ typings/
101101
# TernJS port file
102102
.tern-port
103103

104-
# NPM lock file
105-
package-lock.json
106-
107104
# VS Code cache
108105
.vscode/
109106

1-Authentication/1-sign-in/App/app.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ const path = require('path');
99

1010
const msalWrapper = require('msal-express-wrapper');
1111
const config = require('./appSettings.js');
12-
const cache = require('./utils/cachePlugin');
1312

1413
const mainController = require('./controllers/mainController');
1514

@@ -47,7 +46,7 @@ if (app.get('env') === 'production') {
4746
app.use(session(sessionConfig));
4847

4948
// instantiate the wrapper
50-
const authProvider = new msalWrapper.AuthProvider(config, cache);
49+
const authProvider = new msalWrapper.AuthProvider(config);
5150

5251
// initialize the wrapper
5352
app.use(authProvider.initialize());
@@ -84,4 +83,6 @@ app.get('/unauthorized', (req, res) => res.redirect('/401.html'));
8483
// 404
8584
app.get('*', (req, res) => res.status(404).redirect('/404.html'));
8685

87-
app.listen(SERVER_PORT, () => console.log(`Msal Node Auth Code Sample app listening on port ${SERVER_PORT}!`));
86+
app.listen(SERVER_PORT, () => console.log(`Msal Node Auth Code Sample app listening on port ${SERVER_PORT}!`));
87+
88+
module.exports = app;

1-Authentication/1-sign-in/App/data/cache.json

Whitespace-only changes.

0 commit comments

Comments
 (0)