From 6cbf702504ef65da1b9c5dd6456c915f1cd6836c Mon Sep 17 00:00:00 2001 From: jannyHou Date: Tue, 25 Feb 2020 14:57:32 -0500 Subject: [PATCH] fix: app info --- examples/access-control-migration/LICENSE | 2 +- examples/access-control-migration/README.md | 10 +++++----- examples/access-control-migration/package.json | 7 +++---- examples/access-control-migration/public/index.html | 5 ++--- examples/access-control-migration/src/application.ts | 5 ++++- 5 files changed, 15 insertions(+), 14 deletions(-) diff --git a/examples/access-control-migration/LICENSE b/examples/access-control-migration/LICENSE index fa35ee5f44db..05b33530dda0 100644 --- a/examples/access-control-migration/LICENSE +++ b/examples/access-control-migration/LICENSE @@ -1,4 +1,4 @@ -Copyright (c) IBM Corp. 2018,2019. All Rights Reserved. +Copyright (c) IBM Corp. 2020. All Rights Reserved. Node module: @loopback/example-access-control-migration This project is licensed under the MIT License, full text below. diff --git a/examples/access-control-migration/README.md b/examples/access-control-migration/README.md index a10e06960dd1..9f58a1808678 100644 --- a/examples/access-control-migration/README.md +++ b/examples/access-control-migration/README.md @@ -7,16 +7,16 @@ the access control. ## Overview -This tutorial demonstrates how to implement a RBAC(role based access control) +This tutorial demonstrates how to implement a RBAC(Role Based Access Control) system and provides 5 endpoints to test different role's permissions. The -tutorial of building it from a dummy application is documented in +tutorial of building it from a dummy application documented in ![auth-example-migration-tutorial](https://github.com/strongloop/loopback-next/blob/auth-migration/docs/site/migration/auth/example.md) ## Setup First, you'll need to install a supported version of Node: -- [Node.js](https://nodejs.org/en/) at v8.9 or greater +- [Node.js](https://nodejs.org/en/) at v10 or greater Additionally, this tutorial assumes that you are comfortable with certain technologies, languages and concepts. @@ -41,8 +41,8 @@ application, follow these steps: Server is running at http://127.0.0.1:3000 ``` -Then try each role's permission by following the -[try out section](https://github.com/strongloop/loopback-next/blob/auth-migration/docs/site/migration/auth/example.md#try-out) +Then try different roles' permissions by following the +[try it out section](https://github.com/strongloop/loopback-next/blob/auth-migration/docs/site/migration/auth/example.md#try-it-out) ### Need help? diff --git a/examples/access-control-migration/package.json b/examples/access-control-migration/package.json index 3beb8e1d761c..e44ed88d3a7a 100644 --- a/examples/access-control-migration/package.json +++ b/examples/access-control-migration/package.json @@ -1,10 +1,10 @@ { "name": "@loopback/example-access-control-migration", - "version": "1.9.5", + "version": "1.0.0", "description": "Tutorial example on how to migrate the access control example with LoopBack 4.", "main": "index.js", "engines": { - "node": ">=8.9" + "node": ">=10" }, "author": "IBM Corp.", "scripts": { @@ -51,8 +51,7 @@ "@types/bcryptjs": "2.4.2", "casbin": "^3.1.0", "jsonwebtoken": "^8.5.1", - "loopback-connector-rest": "^3.6.0", - "path": "^0.12.7" + "loopback-connector-rest": "^3.6.0" }, "devDependencies": { "@loopback/build": "^3.1.1", diff --git a/examples/access-control-migration/public/index.html b/examples/access-control-migration/public/index.html index 861687005696..5a92bba48752 100644 --- a/examples/access-control-migration/public/index.html +++ b/examples/access-control-migration/public/index.html @@ -2,7 +2,7 @@ - @loopback/example-todo + @loopback/example-access-control-migration @@ -56,7 +56,7 @@
-

@loopback/example-todo

+

@loopback/example-access-control-migration

OpenAPI spec: /openapi.json

API Explorer: /explorer

@@ -70,4 +70,3 @@

API Explorer: /explorer

- diff --git a/examples/access-control-migration/src/application.ts b/examples/access-control-migration/src/application.ts index 2764d3c6516c..1f8d71fa2a81 100644 --- a/examples/access-control-migration/src/application.ts +++ b/examples/access-control-migration/src/application.ts @@ -97,7 +97,10 @@ export class AccessControlApplication extends BootMixin( addSecuritySpec(): void { this.api({ openapi: '3.0.0', - info: {title: 'access-control-example', version: '1.0.0'}, + info: { + title: 'access-control-example', + version: require('.././package.json').version, + }, paths: {}, components: {securitySchemes: SECURITY_SCHEME_SPEC}, security: [