-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Add @loopback/security #3551
Add @loopback/security #3551
Conversation
@jannyHou, for the decreased in code coverage, is there something we can do about it? Thanks. |
subject.addUser(user); | ||
expect(subject.user).to.eql(user); | ||
}); | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's add tests for addApplication
and addCredential
etc.
@dhmlau @raymondfeng Tests added :) |
packages/security/docs.json
Outdated
"src/**/*.ts" | ||
], | ||
"codeSectionDepth": 4 | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This file should be removed as we no longer use strong-docs
.
packages/security/package.json
Outdated
"build": "lb-tsc", | ||
"clean": "lb-clean loopback-authorization*.tgz dist package *.tsbuildinfo", | ||
"integration": "lb-mocha \"dist/__tests__/integration/**/*.js\"", | ||
"prepublishOnly": "npm run build && npm run build:apidocs", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This line should be removed.
packages/security/package.json
Outdated
"scripts": { | ||
"acceptance": "lb-mocha \"dist/__tests__/acceptance/**/*.js\"", | ||
"build": "lb-tsc", | ||
"clean": "lb-clean loopback-authorization*.tgz dist package *.tsbuildinfo", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It should be:
"clean": "lb-clean loopback-security*.tgz dist package *.tsbuildinfo",
packages/security/package.json
Outdated
"@loopback/build": "^1.5.2", | ||
"@loopback/testlab": "^1.2.7", | ||
"@types/debug": "^4.1.4", | ||
"@types/node": "10.14.15", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should it be a range?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good catch 👍
packages/security/package.json
Outdated
], | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/strongloop/loopback-next.git" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add "directory": "packages/security"
"type": "git", | ||
"url": "https://github.com/strongloop/loopback-next.git" | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's compare with an existing module such as @loopback/context
to make sure the package.json is consistent.
444d889
to
e03fc39
Compare
e03fc39
to
3aebb9a
Compare
Implements #2900
cherry-picked from #2902
Create a shared layer for
@loopback/authentication
and@loopback/authorization
, which defines the security information(context) and binding keys forSubject
and its members.For reviewers:
This PR is migrated from draft #2902.
It contains a comprehensive design of the security system (now
@loopback/authentication
and@loopback/authorization
only share interfaceUserProfile
)So we have different plans for implementing the security module:
Principle
andUserProfile
(which extends Principle) in this PR.Principle
, let's at least extract the existingUserProfile
interface here as the first release.Checklist
👉 Read and sign the CLA (Contributor License Agreement) 👈
npm test
passes on your machinepackages/cli
were updatedexamples/*
were updated👉 Check out how to submit a PR 👈