Skip to content

Commit f2ca26e

Browse files
committed
feat(security): add diagram
1 parent 77d2a0b commit f2ca26e

File tree

9 files changed

+27
-49
lines changed

9 files changed

+27
-49
lines changed

greenkeeper.json

Lines changed: 0 additions & 42 deletions
This file was deleted.

packages/security/README.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,21 @@ authorization.
1111
npm install --save @loopback/security
1212
```
1313

14+
## Overview
15+
16+
- Subject
17+
- It's the "who" for security
18+
- contains a set of Principles, a set of Credentials, and a set of Permissions
19+
- Principle
20+
- Represent a user, an application, or a device
21+
- Credential
22+
- Security attributes used to authenticate the subject. Such credentials
23+
include passwords, Kerberos tickets, and public key certificates.
24+
- Permission
25+
- It's the `what` for security.
26+
27+
![Overview](security-overview-diagram.png)
28+
1429
## Basic use
1530

1631
## Contributions

packages/security/index.d.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,3 @@
44
// License text available at https://opensource.org/licenses/MIT
55

66
export * from './dist';
7-

packages/security/index.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,3 @@
66
// DO NOT EDIT THIS FILE
77
// Add any additional (re)exports to src/index.ts instead.
88
export * from './src';
9-

packages/security/package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/security/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
{
22
"name": "@loopback/security",
3-
"version": "1.0.0-1",
3+
"version": "0.1.0",
44
"description": "A LoopBack component for security support.",
55
"engines": {
66
"node": ">=8.9"
77
},
88
"scripts": {
99
"acceptance": "lb-mocha \"dist/__tests__/acceptance/**/*.js\"",
10-
"build": "lb-tsc es2017 --outDir dist",
10+
"build": "lb-tsc",
1111
"build:apidocs": "lb-apidocs",
1212
"clean": "lb-clean loopback-security*.tgz dist package api-docs",
1313
"integration": "lb-mocha \"dist/__tests__/integration/**/*.js\"",
129 KB
Loading

packages/security/src/types.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ export interface Principal {
1717
*/
1818
[securityId]: string;
1919

20-
// tslint:disable-next-line:no-any
20+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
2121
[attribute: string]: any;
2222
}
2323

@@ -31,8 +31,14 @@ export class TypedPrincipal implements Principal {
3131
}
3232
}
3333

34+
/**
35+
* The minimum set of attributes that describe a user.
36+
*/
3437
export interface UserProfile extends Principal {
35-
// basic user information
38+
// `email` and `name` are added to be identical with the
39+
// current `UserProfile` being exported from `@loopback/authentication`
40+
email?: string;
41+
name?: string;
3642
}
3743

3844
export interface Organization extends Principal {}

packages/security/tsconfig.build.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
"$schema": "http://json.schemastore.org/tsconfig",
33
"extends": "@loopback/build/config/tsconfig.common.json",
44
"compilerOptions": {
5+
"outDir": "dist",
56
"rootDir": "src"
67
},
78
"include": ["src"]

0 commit comments

Comments
 (0)