Skip to content

Basic token validation implementation #4368

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

Merged
merged 98 commits into from
Mar 4, 2022
Merged
Show file tree
Hide file tree
Changes from 76 commits
Commits
Show all changes
98 commits
Select commit Hold shift + click to select a range
3283d36
Initial commit. Set up ms-identity-node package
jo-arroyo Oct 9, 2021
1c3ae09
Merge branch 'dev' into ms-identity-node-prototype
jo-arroyo Oct 9, 2021
fc8865a
added prototype classes and working sample
Oct 12, 2021
0262840
add jose token validation code
Oct 12, 2021
1f5d625
Update jose package
jo-arroyo Oct 14, 2021
7c1606c
Cleaned up working branch
Oct 15, 2021
6c5299f
Merge branch 'dev' into ms-identity-node-prototype
jo-arroyo Nov 18, 2021
0b260af
Updates to POC
jo-arroyo Nov 20, 2021
83833e6
Edit sample README with instructions
jo-arroyo Nov 20, 2021
371f627
Merge branch 'dev' into ms-identity-node-prototype
jo-arroyo Dec 13, 2021
f80b562
Revert node sample change
jo-arroyo Dec 13, 2021
87e6834
Merge branch 'ms-identity-node-prototype' of https://github.com/Azure…
jo-arroyo Dec 13, 2021
e693e5a
Update POC readme
jo-arroyo Dec 13, 2021
c89c294
Add ms-identity-node POC to lib
jo-arroyo Dec 13, 2021
d5581c7
Implement basic validation claims checks, add configuration defaults,
jo-arroyo Jan 4, 2022
acf04a6
Update name to node-token-validation
jo-arroyo Jan 4, 2022
ecd702e
Update name for sample
jo-arroyo Jan 4, 2022
e6e8295
Merge branch 'dev' into token-validation-feature-build
jo-arroyo Jan 4, 2022
2bf5f45
Merge branch 'dev' into token-validation-feature-build
jo-arroyo Jan 5, 2022
6f4bc79
Undo changes to tsconfig.json
jo-arroyo Jan 5, 2022
6fcc6e8
Merge branch 'token-validation-feature-build' of https://github.com/A…
jo-arroyo Jan 5, 2022
f4a17c0
Change files
jo-arroyo Jan 5, 2022
8fb11d4
Remove ms-identity-node from experimental
jo-arroyo Jan 13, 2022
794a9be
Update tokenValidator, add http client, update errors
jo-arroyo Jan 13, 2022
2fc85bc
Add CryptoProvider
jo-arroyo Jan 14, 2022
e55fb64
Merge branch 'dev' into token-validation-feature-build
jo-arroyo Jan 20, 2022
b5b0741
Add linting
jo-arroyo Jan 26, 2022
d5cca54
Update constants and configurations
jo-arroyo Jan 27, 2022
970eb57
Update TokenValidationParameters in line with Wilson
jo-arroyo Jan 27, 2022
660041c
Remove custom validators
jo-arroyo Jan 27, 2022
dcad30a
Merge branch 'dev' into token-validation-feature-build
jo-arroyo Jan 27, 2022
6856ea5
Update types
jo-arroyo Jan 27, 2022
e7fc9ce
Address feedback
jo-arroyo Feb 1, 2022
8483652
Add JWT token type
jo-arroyo Feb 1, 2022
224eb5c
Address feedback
jo-arroyo Feb 1, 2022
3989250
Remove duplicate error
jo-arroyo Feb 2, 2022
791fe1c
Update OpenIdConfigProvider
jo-arroyo Feb 2, 2022
8125c02
Test set up
jo-arroyo Feb 2, 2022
3b9ed29
Merge branch 'dev' into token-validation-feature-build
jo-arroyo Feb 4, 2022
89e0ee0
Update token validator checks and OpenIdConfigProvider properties
jo-arroyo Feb 4, 2022
b690cb2
Merge branch 'token-validation-feature-build' into token-validation-b…
jo-arroyo Feb 4, 2022
9d2b89d
Add tests for TokenValidator and OpenIdConfigProvider, update jset.co…
jo-arroyo Feb 4, 2022
a35ce4a
Fix getJWKS
jo-arroyo Feb 4, 2022
b78bb8d
Merge branch 'token-validation-feature-build' into token-validation-b…
jo-arroyo Feb 4, 2022
e050e0a
Fix tests
jo-arroyo Feb 4, 2022
5955e59
Add node-token-validation to CI workflows
jo-arroyo Feb 5, 2022
b7bf068
Update jose
jo-arroyo Feb 7, 2022
bf98b9d
Merge branch 'dev' into token-validation-feature-build
jo-arroyo Feb 7, 2022
327e78c
Fix linting
jo-arroyo Feb 7, 2022
b4ab7a8
Update jose inputs
jo-arroyo Feb 7, 2022
b4604cd
update jest
jo-arroyo Feb 7, 2022
f25ea25
Merge branch 'token-validation-feature-build' into token-validation-b…
jo-arroyo Feb 7, 2022
4674fe4
Update package-lock
jo-arroyo Feb 7, 2022
a56f03a
Merge branch 'dev' into token-validation-feature-build
jo-arroyo Feb 8, 2022
253ebf1
Apply suggestions from code review
jo-arroyo Feb 8, 2022
c830dd4
Merge branch 'dev' into token-validation-feature-build
jo-arroyo Feb 8, 2022
99cd89e
Address feedback
jo-arroyo Feb 10, 2022
5a1ac63
Merge branch 'token-validation-feature-build' into token-validation-b…
jo-arroyo Feb 10, 2022
3d209bf
Address feedback for tests
jo-arroyo Feb 10, 2022
391cd1e
Update build-test-pr naming to be more generic
jo-arroyo Feb 10, 2022
8b2c4ab
Update TokenValidationParameters
jo-arroyo Feb 11, 2022
01e5112
Merge branch 'dev' into token-validation-feature-build
jo-arroyo Feb 11, 2022
9183510
Merge branch 'token-validation-feature-build' into token-validation-b…
jo-arroyo Feb 11, 2022
3987df4
Fix imports
jo-arroyo Feb 11, 2022
436ce0f
Update samples/node-token-validation-samples/basic-sample/package.json
jo-arroyo Feb 11, 2022
23f10e1
Update sample and readme.
jo-arroyo Feb 12, 2022
645d8fa
Merge branch 'token-validation-feature-build' of https://github.com/A…
jo-arroyo Feb 12, 2022
d5a2360
Address lint warning
jo-arroyo Feb 12, 2022
8cedd5e
Merge pull request #4478 from AzureAD/token-validation-basic-tests
jo-arroyo Feb 17, 2022
f4f315c
Merge branch 'dev' into token-validation-feature-build
jo-arroyo Feb 17, 2022
907467a
Add base readme and update codeowners
jo-arroyo Feb 18, 2022
c92496f
Update labeler
jo-arroyo Feb 18, 2022
c362c58
Update change file
jo-arroyo Feb 18, 2022
a427196
Update change/@azure-node-token-validation-7f710590-0a83-448e-9a03-d3…
jo-arroyo Feb 22, 2022
e11ff5d
Add typedocs and comments to functions
jo-arroyo Feb 22, 2022
17ba071
Merge branch 'dev' into token-validation-feature-build
jo-arroyo Feb 22, 2022
ff4f307
Updated comments from code review
jo-arroyo Feb 26, 2022
f40973e
Merge branch 'dev' into token-validation-feature-build
jo-arroyo Feb 26, 2022
5c5684c
Merge branch 'dev' into token-validation-feature-build
jo-arroyo Feb 28, 2022
52f8230
Merge branch 'dev' into token-validation-feature-build
jo-arroyo Mar 1, 2022
044a5ae
Update msal-node-extensions package-lock to fix failing CI tests
jo-arroyo Mar 1, 2022
629b0ca
Merge branch 'token-validation-feature-build' of https://github.com/A…
jo-arroyo Mar 1, 2022
2a1b16c
Revert "Update msal-node-extensions package-lock to fix failing CI te…
jo-arroyo Mar 1, 2022
794d04b
Update workflows with node version for extensions
jo-arroyo Mar 1, 2022
d9f2026
Change runs-on windows version
jo-arroyo Mar 1, 2022
550e16b
Update postinstall.js
jo-arroyo Mar 1, 2022
2730353
Update clean install
jo-arroyo Mar 1, 2022
a1ec4f0
Update postinstall.js
jo-arroyo Mar 1, 2022
bfb7df8
Revert "Update clean install"
jo-arroyo Mar 1, 2022
474ddba
Revert "Update workflows with node version for extensions"
jo-arroyo Mar 1, 2022
3d5c543
Revert "Change runs-on windows version"
jo-arroyo Mar 1, 2022
d10d3aa
Revert postinstall.js
jo-arroyo Mar 1, 2022
c0d41ae
Upgrade node-gyp
jo-arroyo Mar 2, 2022
9f87bd3
Merge branch 'token-validation-feature-build' of https://github.com/A…
jo-arroyo Mar 2, 2022
8c8a8d9
Merge branch 'dev' into token-validation-feature-build
jo-arroyo Mar 3, 2022
3381fb8
Revert "Upgrade node-gyp"
jo-arroyo Mar 3, 2022
fc35dc4
Merge branch 'dev' into token-validation-feature-build
jo-arroyo Mar 3, 2022
61e8e51
Merge branch 'dev' into token-validation-feature-build
jo-arroyo Mar 3, 2022
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: 2 additions & 0 deletions .github/labeler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ msal-browser:
- lib/msal-browser/**/*
msal-react:
- lib/msal-react/**/*
node-token-validation:
- lib/node-token-validation/**/*
adal.js:
- maintenance/adal-angular/**/*
passport-azure-ad:
Expand Down
27 changes: 15 additions & 12 deletions .github/workflows/build-test-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,24 +32,27 @@ jobs:
# browser/node filter will match any path under common as well as their own
# angular/react filter will match any path under common and browser as well as their own
filters: |
core:
msal-core:
- 'lib/msal-core/**/**.!(md)'
- '.github/workflows/build-test-pr.yml'
common: &common
msal-common: &common
- 'lib/msal-common/**/**.!(md)'
- '.github/workflows/build-test-pr.yml'
browser: &browser
msal-browser: &browser
- *common
- 'lib/msal-browser/**/**.!(md)'
node:
msal-node:
- *common
- 'lib/msal-node/**/**.!(md)'
angular:
msal-angular:
- *browser
- 'lib/msal-angular/**/**.!(md)'
react:
msal-react:
- *browser
- 'lib/msal-react/**/**.!(md)'
node-token-validation:
- *common
- 'lib/node-token-validation/**/**.!(md)'

- uses: dorny/paths-filter@v2
id: extensions-filter
Expand All @@ -71,7 +74,7 @@ jobs:
# e.g. ['package1', 'package2'] if both package folders contains changes
library: ${{ fromJSON(needs.pre-check.outputs.packages) }}

name: msal-${{ matrix.library }}
name: ${{ matrix.library }}

steps:
- uses: actions/checkout@v2
Expand All @@ -95,23 +98,23 @@ jobs:
run: npm ci

- name: Build packages
working-directory: lib/msal-${{ matrix.library }}
working-directory: lib/${{ matrix.library }}
run: npm run build:all

- name: Lint
working-directory: lib/msal-${{ matrix.library }}
working-directory: lib/${{ matrix.library }}
run: npm run lint

- name: Unit Tests with coverage
working-directory: lib/msal-${{ matrix.library }}
working-directory: lib/${{ matrix.library }}
run: npm run test:coverage

- name: Upload Test Coverage to CodeCov
if: success()
uses: codecov/codecov-action@v2
with:
files: lib/msal-${{matrix.library}}/coverage/lcov.info
flags: msal-${{ matrix.library }}
files: lib/${{matrix.library}}/coverage/lcov.info
flags: ${{ matrix.library }}

extensions-build-test:
needs: pre-check
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/build-test-push-to-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ jobs:
- msal-node
- msal-angular
- msal-react
- node-token-validation

name: ${{ matrix.library }}

Expand Down
4 changes: 4 additions & 0 deletions CODEOWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@
/lib/msal-react/ @tnorling @jasonnutter @jo-arroyo @peterzenz
/samples/msal-react-samples/ @tnorling @jasonnutter @jo-arroyo @peterzenz

# Node Token Validation
/lib/node-token-validation @jo-arroyo @pkanher617 @peterzenz
/samples/node-token-validation @jo-arroyo @pkanher617 @peterzenz

## ADAL.js
/maintenance/adal-angular @jasonnutter @sameerag @pkanher617 @peterzenz

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "none",
"comment": "Implement basic token validation #4368",
"packageName": "@azure/node-token-validation",
"email": "[email protected]",
"dependentChangeType": "none"
}
15 changes: 15 additions & 0 deletions lib/node-token-validation/.babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"presets": [
"@babel/preset-typescript",
[
"@babel/preset-env",
{
"modules": "commonjs"
}
]
],
"plugins": [
"@babel/proposal-class-properties",
"@babel/proposal-object-rest-spread"
]
}
265 changes: 265 additions & 0 deletions lib/node-token-validation/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,265 @@
## Ignore Visual Studio temporary files, build results, and
## files generated by popular Visual Studio add-ons.

# User-specific files
*.suo
*.user
*.userosscache
*.sln.docstates

# User-specific files (MonoDevelop/Xamarin Studio)
*.userprefs

# Build results
[Dd]ebug/
[Dd]ebugPublic/
[Rr]elease/
[Rr]eleases/
x64/
x86/
bld/
[Bb]in/
[Oo]bj/
[Ll]og/

# Visual Studio 2015 cache/options directory
.vs/
# Uncomment if you have tasks that create the project's static files in wwwroot
#wwwroot/

# MSTest test Results
[Tt]est[Rr]esult*/
[Bb]uild[Ll]og.*

# NUNIT
*.VisualState.xml
TestResult.xml

# Build Results of an ATL Project
[Dd]ebugPS/
[Rr]eleasePS/
dlldata.c

# DNX
project.lock.json
artifacts/

*_i.c
*_p.c
*_i.h
*.ilk
*.meta
*.obj
*.pch
*.pdb
*.pgc
*.pgd
*.rsp
*.sbr
*.tlb
*.tli
*.tlh
*.tmp
*.tmp_proj
*.log
*.vspscc
*.vssscc
.builds
*.pidb
*.svclog
*.scc

# Chutzpah Test files
_Chutzpah*

# Visual C++ cache files
ipch/
*.aps
*.ncb
*.opendb
*.opensdf
*.sdf
*.cachefile
*.VC.db
*.VC.VC.opendb

# Visual Studio profiler
*.psess
*.vsp
*.vspx
*.sap

# TFS 2012 Local Workspace
$tf/

# Guidance Automation Toolkit
*.gpState

# ReSharper is a .NET coding add-in
_ReSharper*/
*.[Rr]e[Ss]harper
*.DotSettings.user

# JustCode is a .NET coding add-in
.JustCode

# TeamCity is a build add-in
_TeamCity*

# DotCover is a Code Coverage Tool
*.dotCover

# NCrunch
_NCrunch_*
.*crunch*.local.xml
nCrunchTemp_*

# MightyMoose
*.mm.*
AutoTest.Net/

# Web workbench (sass)
.sass-cache/

# Installshield output folder
[Ee]xpress/

# DocProject is a documentation generator add-in
DocProject/buildhelp/
DocProject/Help/*.HxT
DocProject/Help/*.HxC
DocProject/Help/*.hhc
DocProject/Help/*.hhk
DocProject/Help/*.hhp
DocProject/Help/Html2
DocProject/Help/html

# Click-Once directory
publish/

# Publish Web Output
*.[Pp]ublish.xml
*.azurePubxml
# TODO: Comment the next line if you want to checkin your web deploy settings
# but database connection strings (with potential passwords) will be unencrypted
*.pubxml
*.publishproj

# Microsoft Azure Web App publish settings. Comment the next line if you want to
# checkin your Azure Web App publish settings, but sensitive information contained
# in these scripts will be unencrypted
PublishScripts/

# NuGet Packages
*.nupkg
# The packages folder can be ignored because of Package Restore
**/packages/*
# except build/, which is used as an MSBuild target.
!**/packages/build/
# Uncomment if necessary however generally it will be regenerated when needed
#!**/packages/repositories.config
# NuGet v3's project.json files produces more ignoreable files
*.nuget.props
*.nuget.targets

# Microsoft Azure Build Output
csx/
*.build.csdef

# Microsoft Azure Emulator
ecf/
rcf/

# Windows Store app package directories and files
AppPackages/
BundleArtifacts/
Package.StoreAssociation.xml
_pkginfo.txt

# Visual Studio cache files
# files ending in .cache can be ignored
*.[Cc]ache
# but keep track of directories ending in .cache
!*.[Cc]ache/

# Others
ClientBin/
~$*
*~
*.dbmdl
*.dbproj.schemaview
*.pfx
*.publishsettings
node_modules/
orleans.codegen.cs

# Since there are multiple workflows, uncomment next line to ignore bower_components
# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622)
#bower_components/

# RIA/Silverlight projects
Generated_Code/

# Backup & report files from converting an old project file
# to a newer Visual Studio version. Backup files are not needed,
# because we have git ;-)
_UpgradeReport_Files/
Backup*/
UpgradeLog*.XML
UpgradeLog*.htm

# SQL Server files
*.mdf
*.ldf

# Business Intelligence projects
*.rdl.data
*.bim.layout
*.bim_*.settings

# Microsoft Fakes
FakesAssemblies/

# GhostDoc plugin setting file
*.GhostDoc.xml

# Node.js Tools for Visual Studio
.ntvs_analysis.dat

# Visual Studio 6 build log
*.plg

# Visual Studio 6 workspace options file
*.opt

# Visual Studio LightSwitch build output
**/*.HTMLClient/GeneratedArtifacts
**/*.DesktopClient/GeneratedArtifacts
**/*.DesktopClient/ModelManifest.xml
**/*.Server/GeneratedArtifacts
**/*.Server/ModelManifest.xml
_Pvt_Extensions

# Paket dependency manager
.paket/paket.exe
paket-files/

# FAKE - F# Make
.fake/

# Coverage
coverage/

# JetBrains Rider
.idea/
*.sln.iml

# Istanbul Code Coverage
.nyc_output/

# MSAL specific ignore files
node_modules/
typings/
lib/
dist/
ref/
5 changes: 5 additions & 0 deletions lib/node-token-validation/.huskyrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"hooks": {
"pre-commit": "npm run lint"
}
}
Loading