From 056a5bb9718b7d914e74f95f3b74d59baa86e5ca Mon Sep 17 00:00:00 2001 From: michael faith Date: Sat, 16 Dec 2023 16:36:14 -0600 Subject: [PATCH] feat: update project to Angular 17 The primary focus for this change is to update the project to Angular 17, verify functionality, and update documentation to reflect compatibility. In addition to this primary goal, I also did the following quality of life updates: - updated to latest prettier and converted config to esm - updated a handful of other libraries to newer minor versions - updated @types/node to the latest v18 version - moved to new control flow syntax - moved to new esbuild application builder - Increased minimum supported Angular version to 15, since v14 is end of life --- .prettierrc | 3 - angular.json | 36 +- contributors.md | 41 +- docs-src/implicit-flow.md | 15 +- package-lock.json | 11295 ++++++++-------- package.json | 73 +- prettier.config.mjs | 3 + .../angular-oauth2-oidc-jwks/package.json | 4 +- .../src/lib/jwks-validation-handler.ts | 4 +- projects/angular-oauth2-oidc-jwks/src/test.ts | 2 +- projects/lib/package.json | 6 +- projects/lib/src/angular-oauth-oidc.module.ts | 2 +- projects/lib/src/base64-helper.ts | 2 +- projects/lib/src/events.ts | 12 +- .../interceptors/default-oauth.interceptor.ts | 12 +- projects/lib/src/oauth-service.ts | 250 +- projects/lib/src/provider.ts | 2 +- .../lib/src/token-validation/fast-sha256js.ts | 8 +- .../lib/src/token-validation/hash-handler.ts | 3 - .../token-validation/validation-handler.ts | 6 +- .../src/app/app.component.html | 32 +- .../src/app/app.component.spec.ts | 2 +- .../quickstart-demo/src/app/app.component.ts | 1 - .../quickstart-demo/src/app/app.module.ts | 5 +- projects/quickstart-demo/src/test.ts | 2 +- projects/quickstart-demo/tsconfig.spec.json | 2 +- .../src/app/app.component.html | 32 +- .../src/app/app.component.spec.ts | 2 +- .../src/app/app.component.ts | 3 +- projects/sample/src/app/app.component.spec.ts | 2 +- projects/sample/src/app/app.component.ts | 5 +- projects/sample/src/app/app.routes.ts | 2 +- .../alt-flight-card/flight-list.ts | 18 +- .../flight-booking/flight-booking.routes.ts | 2 +- .../flight-edit/flight-edit.component.ts | 34 +- .../flight-search-reactive.component.html | 89 +- .../flight-search-reactive.component.ts | 2 +- .../flight-search.component.html | 146 +- .../flight-search/flight-search.component.ts | 2 +- .../flight-booking/services/flight.service.ts | 4 +- .../sample/src/app/home/home.component.html | 184 +- .../sample/src/app/home/home.component.ts | 2 +- .../password-flow-login.component.html | 26 +- .../password-flow-login.component.ts | 2 +- .../sample/src/app/shared/auth/auth.guard.ts | 5 +- projects/sample/src/polyfills.ts | 42 - projects/sample/src/test.ts | 2 +- projects/sample/tsconfig.app.json | 2 +- projects/sample/tsconfig.spec.json | 2 +- tslint.json | 95 - 50 files changed, 6518 insertions(+), 6010 deletions(-) delete mode 100644 .prettierrc create mode 100644 prettier.config.mjs delete mode 100644 projects/sample/src/polyfills.ts delete mode 100644 tslint.json diff --git a/.prettierrc b/.prettierrc deleted file mode 100644 index 544138be..00000000 --- a/.prettierrc +++ /dev/null @@ -1,3 +0,0 @@ -{ - "singleQuote": true -} diff --git a/angular.json b/angular.json index fbb4d1c3..f08bf93b 100644 --- a/angular.json +++ b/angular.json @@ -41,12 +41,12 @@ "schematics": {}, "architect": { "build": { - "builder": "@angular-devkit/build-angular:browser", + "builder": "@angular-devkit/build-angular:application", "options": { "outputPath": "dist/sample", "index": "projects/sample/src/index.html", - "main": "projects/sample/src/main.ts", - "polyfills": "projects/sample/src/polyfills.ts", + "browser": "projects/sample/src/main.ts", + "polyfills": ["zone.js"], "tsConfig": "projects/sample/tsconfig.app.json", "assets": [ "projects/sample/src/favicon.ico", @@ -58,9 +58,7 @@ "node_modules/bootstrap/dist/css/bootstrap.css" ], "scripts": [], - "vendorChunk": true, "extractLicenses": false, - "buildOptimizer": false, "sourceMap": true, "optimization": false, "namedChunks": true @@ -83,9 +81,7 @@ "outputHashing": "all", "sourceMap": false, "namedChunks": false, - "extractLicenses": true, - "vendorChunk": false, - "buildOptimizer": true + "extractLicenses": true } }, "defaultConfiguration": "" @@ -93,25 +89,25 @@ "serve": { "builder": "@angular-devkit/build-angular:dev-server", "options": { - "browserTarget": "sample:build" + "buildTarget": "sample:build" }, "configurations": { "production": { - "browserTarget": "sample:build:production" + "buildTarget": "sample:build:production" } } }, "extract-i18n": { "builder": "@angular-devkit/build-angular:extract-i18n", "options": { - "browserTarget": "sample:build" + "buildTarget": "sample:build" } }, "test": { "builder": "@angular-devkit/build-angular:karma", "options": { "main": "projects/sample/src/test.ts", - "polyfills": "projects/sample/src/polyfills.ts", + "polyfills": ["zone.js"], "tsConfig": "projects/sample/tsconfig.spec.json", "karmaConfig": "projects/sample/karma.conf.js", "styles": [ @@ -140,7 +136,7 @@ "outputPath": "dist/quickstart-demo", "index": "projects/quickstart-demo/src/index.html", "main": "projects/quickstart-demo/src/main.ts", - "polyfills": "projects/quickstart-demo/src/polyfills.ts", + "polyfills": ["zone.js"], "tsConfig": "projects/quickstart-demo/tsconfig.app.json", "aot": false, "assets": [ @@ -186,25 +182,25 @@ "serve": { "builder": "@angular-devkit/build-angular:dev-server", "options": { - "browserTarget": "quickstart-demo:build" + "buildTarget": "quickstart-demo:build" }, "configurations": { "production": { - "browserTarget": "quickstart-demo:build:production" + "buildTarget": "quickstart-demo:build:production" } } }, "extract-i18n": { "builder": "@angular-devkit/build-angular:extract-i18n", "options": { - "browserTarget": "quickstart-demo:build" + "buildTarget": "quickstart-demo:build" } }, "test": { "builder": "@angular-devkit/build-angular:karma", "options": { "main": "projects/quickstart-demo/src/test.ts", - "polyfills": "projects/quickstart-demo/src/polyfills.ts", + "polyfills": ["zone.js"], "tsConfig": "projects/quickstart-demo/tsconfig.spec.json", "karmaConfig": "projects/quickstart-demo/karma.conf.js", "assets": [ @@ -297,10 +293,10 @@ "builder": "@angular-devkit/build-angular:dev-server", "configurations": { "production": { - "browserTarget": "quickstart-standalone:build:production" + "buildTarget": "quickstart-standalone:build:production" }, "development": { - "browserTarget": "quickstart-standalone:build:development" + "buildTarget": "quickstart-standalone:build:development" } }, "defaultConfiguration": "development" @@ -308,7 +304,7 @@ "extract-i18n": { "builder": "@angular-devkit/build-angular:extract-i18n", "options": { - "browserTarget": "quickstart-standalone:build" + "buildTarget": "quickstart-standalone:build" } }, "test": { diff --git a/contributors.md b/contributors.md index e4b53a80..9649245c 100644 --- a/contributors.md +++ b/contributors.md @@ -1,42 +1,41 @@ +[alexandis](https://github.com/alexandis)[anbiniyar](https://github.com/anbiniyar)[anoordende](https://github.com/anoordende)[nihanth007](https://github.com/nihanth007)[bobvandevijver](https://github.com/bobvandevijver) -[alexandis](https://github.com/alexandis)[anbiniyar](https://github.com/anbiniyar)[anoordende](https://github.com/anoordende)[ArsProgramma](https://github.com/ArsProgramma)[nihanth007](https://github.com/nihanth007) +[BobCui20](https://github.com/BobCui20)[Bottswana](https://github.com/Bottswana)[ErazerBrecht](https://github.com/ErazerBrecht)[Chris3773](https://github.com/Chris3773)[ChristianMurphy](https://github.com/ChristianMurphy) -[bobvandevijver](https://github.com/bobvandevijver)[BobCui20](https://github.com/BobCui20)[Bottswana](https://github.com/Bottswana)[ErazerBrecht](https://github.com/ErazerBrecht)[Chris3773](https://github.com/Chris3773) - -[ChristianMurphy](https://github.com/ChristianMurphy)[d-moos](https://github.com/d-moos)[enterprisebug](https://github.com/enterprisebug)[craniodev](https://github.com/craniodev)[FabianGosebrink](https://github.com/FabianGosebrink) +[d-moos](https://github.com/d-moos)[enterprisebug](https://github.com/enterprisebug)[dennisholmer](https://github.com/dennisholmer)[craniodev](https://github.com/craniodev)[FabianGosebrink](https://github.com/FabianGosebrink) [FabienDehopre](https://github.com/FabienDehopre)[FRosner](https://github.com/FRosner)[MisterJames](https://github.com/MisterJames)[JessePreiner](https://github.com/JessePreiner)[jesusbotella](https://github.com/jesusbotella) -[Jojofoulk](https://github.com/Jojofoulk)[kristofdegrave](https://github.com/kristofdegrave)[saxicek](https://github.com/saxicek)[lukasmatta](https://github.com/lukasmatta)[Maximaximum](https://github.com/Maximaximum) - -[mpbalmeida](https://github.com/mpbalmeida)[mhyfritz](https://github.com/mhyfritz)[mdaehnert](https://github.com/mdaehnert)[mcserra](https://github.com/mcserra)[nhumblot](https://github.com/nhumblot) +[Joss-FD](https://github.com/Joss-FD)[kristofdegrave](https://github.com/kristofdegrave)[saxicek](https://github.com/saxicek)[lukasmatta](https://github.com/lukasmatta)[mahmut-gundogdu](https://github.com/mahmut-gundogdu) -[l1b3r](https://github.com/l1b3r)[oleersoy](https://github.com/oleersoy)[OskarsPakers](https://github.com/OskarsPakers)[hellerbarde](https://github.com/hellerbarde)[paweldyminski](https://github.com/paweldyminski) +[Maximaximum](https://github.com/Maximaximum)[mpbalmeida](https://github.com/mpbalmeida)[mhyfritz](https://github.com/mhyfritz)[mdaehnert](https://github.com/mdaehnert)[mcserra](https://github.com/mcserra) -[bechhansen](https://github.com/bechhansen)[peterneave](https://github.com/peterneave)[pmccloghrylaing](https://github.com/pmccloghrylaing)[akehir](https://github.com/akehir)[RubenVermeulen](https://github.com/RubenVermeulen) +[huy2nhan](https://github.com/huy2nhan)[nhumblot](https://github.com/nhumblot)[l1b3r](https://github.com/l1b3r)[oleersoy](https://github.com/oleersoy)[OskarsPakers](https://github.com/OskarsPakers) -[ryanmwright](https://github.com/ryanmwright)[scttcper](https://github.com/scttcper)[abshoff](https://github.com/abshoff)[SpazzMarticus](https://github.com/SpazzMarticus)[srenatus](https://github.com/srenatus) +[hellerbarde](https://github.com/hellerbarde)[paweldyminski](https://github.com/paweldyminski)[bechhansen](https://github.com/bechhansen)[peterneave](https://github.com/peterneave)[pmccloghrylaing](https://github.com/pmccloghrylaing) -[sven-codeculture](https://github.com/sven-codeculture)[Rocket18](https://github.com/Rocket18)[Ceteareth](https://github.com/Ceteareth)[vadjs](https://github.com/vadjs)[Varada-Schneider](https://github.com/Varada-Schneider) +[pirminrehm](https://github.com/pirminrehm)[akehir](https://github.com/akehir)[RubenVermeulen](https://github.com/RubenVermeulen)[ryanmwright](https://github.com/ryanmwright)[scttcper](https://github.com/scttcper) -[Gimly](https://github.com/Gimly)[akkaradej](https://github.com/akkaradej)[coyoteecd](https://github.com/coyoteecd)[darbio](https://github.com/darbio)[filipvh](https://github.com/filipvh) +[abshoff](https://github.com/abshoff)[ssaip](https://github.com/ssaip)[SpazzMarticus](https://github.com/SpazzMarticus)[srenatus](https://github.com/srenatus)[sven-codeculture](https://github.com/sven-codeculture) -[kyubisation](https://github.com/kyubisation)[luciimon](https://github.com/luciimon)[mike-rivera](https://github.com/mike-rivera)[drobert-bfm](https://github.com/drobert-bfm)[roblabat](https://github.com/roblabat) +[sven-tidde](https://github.com/sven-tidde)[Rocket18](https://github.com/Rocket18)[Ceteareth](https://github.com/Ceteareth)[vadjs](https://github.com/vadjs)[Gimly](https://github.com/Gimly) -[wdunn001](https://github.com/wdunn001)[adrianbenjuya](https://github.com/adrianbenjuya)[Andreas-Hjortland](https://github.com/Andreas-Hjortland)[adematte](https://github.com/adematte)[cgatian](https://github.com/cgatian) +[akkaradej](https://github.com/akkaradej)[coyoteecd](https://github.com/coyoteecd)[darbio](https://github.com/darbio)[filipvh](https://github.com/filipvh)[kyubisation](https://github.com/kyubisation) -[dirkbolte](https://github.com/dirkbolte)[enricodeleo](https://github.com/enricodeleo)[Gregordy](https://github.com/Gregordy)[jeroenhinfi](https://github.com/jeroenhinfi)[linjie997](https://github.com/linjie997) +[luciimon](https://github.com/luciimon)[mikelgo](https://github.com/mikelgo)[mike-rivera](https://github.com/mike-rivera)[drobert-bfm](https://github.com/drobert-bfm)[roblabat](https://github.com/roblabat) -[jfyne](https://github.com/jfyne)[kevincathcart-cas](https://github.com/kevincathcart-cas)[martin1cerny](https://github.com/martin1cerny)[marvinosswald](https://github.com/marvinosswald)[nick1699](https://github.com/nick1699) +[wdunn001](https://github.com/wdunn001)[adrianbenjuya](https://github.com/adrianbenjuya)[Andreas-Hjortland](https://github.com/Andreas-Hjortland)[adematte](https://github.com/adematte)[dirkbolte](https://github.com/dirkbolte) -[paulyoder](https://github.com/paulyoder)[reda-alaoui](https://github.com/reda-alaoui)[remiburtin](https://github.com/remiburtin)[gingters](https://github.com/gingters)[kranich](https://github.com/kranich) +[enricodeleo](https://github.com/enricodeleo)[Gregordy](https://github.com/Gregordy)[jeroenhinfi](https://github.com/jeroenhinfi)[linjie997](https://github.com/linjie997)[jfyne](https://github.com/jfyne) -[StefanoChiodino](https://github.com/StefanoChiodino)[tpeter1985](https://github.com/tpeter1985)[dennisameling](https://github.com/dennisameling)[dependabot[bot]](https://github.com/apps/dependabot)[jdgeier](https://github.com/jdgeier) +[kevincathcart-cas](https://github.com/kevincathcart-cas)[martin1cerny](https://github.com/martin1cerny)[marvinosswald](https://github.com/marvinosswald)[nick1699](https://github.com/nick1699)[paulyoder](https://github.com/paulyoder) -[mraible](https://github.com/mraible)[ajpierson](https://github.com/ajpierson)[artnim](https://github.com/artnim)[fmalcher](https://github.com/fmalcher)[Flofie](https://github.com/Flofie) +[reda-alaoui](https://github.com/reda-alaoui)[remiburtin](https://github.com/remiburtin)[gingters](https://github.com/gingters)[kranich](https://github.com/kranich)[StefanoChiodino](https://github.com/StefanoChiodino) -[mabdelaal86](https://github.com/mabdelaal86)[nhance](https://github.com/nhance)[Razzeee](https://github.com/Razzeee)[maxisam](https://github.com/maxisam)[ismcagdas](https://github.com/ismcagdas) +[tpeter1985](https://github.com/tpeter1985)[busycat](https://github.com/busycat)[dennisameling](https://github.com/dennisameling)[jdgeier](https://github.com/jdgeier)[mraible](https://github.com/mraible) -[Toxicable](https://github.com/Toxicable)[ManuelRauber](https://github.com/ManuelRauber)[vdveer](https://github.com/vdveer)[jeroenheijmans](https://github.com/jeroenheijmans)[manfredsteyer](https://github.com/manfredsteyer) +[michaelfaith](https://github.com/michaelfaith)[ajpierson](https://github.com/ajpierson)[fmalcher](https://github.com/fmalcher)[Flofie](https://github.com/Flofie)[mabdelaal86](https://github.com/mabdelaal86) +[nhance](https://github.com/nhance)[razzeee](https://github.com/razzeee)[maxisam](https://github.com/maxisam)[ismcagdas](https://github.com/ismcagdas)[dependabot[bot]](https://github.com/apps/dependabot) +[ManuelRauber](https://github.com/ManuelRauber)[vdveer](https://github.com/vdveer)[jeroenheijmans](https://github.com/jeroenheijmans)[manfredsteyer](https://github.com/manfredsteyer) diff --git a/docs-src/implicit-flow.md b/docs-src/implicit-flow.md index 38a490dd..97f30d26 100644 --- a/docs-src/implicit-flow.md +++ b/docs-src/implicit-flow.md @@ -1,6 +1,6 @@ ## Configuring for Implicit Flow -This section shows how to implement login leveraging implicit flow. This is the OAuth2/OIDC flow which was originally intended for Single Page Application. +This section shows how to implement login leveraging implicit flow. This is the OAuth2/OIDC flow which was originally intended for Single Page Application. Meanwhile using **Code Flow** instead is a **best practice** and with OAuth 2.1 implicit flow will be **deprecated***. @@ -85,12 +85,15 @@ export class HomeComponent { The following snippet contains the template for the login page: ```HTML -

- Hallo -

-

+@if (name) { +

Hallo, {{name}} -

+ +} @else { +

+ Hallo +

+}