Skip to content

Merge authentication into master - #7

Open
H3nSte1n wants to merge 19 commits into
masterfrom
authentication
Open

Merge authentication into master#7
H3nSte1n wants to merge 19 commits into
masterfrom
authentication

Conversation

@H3nSte1n

@H3nSte1n H3nSte1n commented Sep 2, 2020

Copy link
Copy Markdown

Merge authentication into master

Comment thread lib/authentication/AuthenticationController.ts Outdated
Comment thread lib/authentication/AuthenticationController.ts Outdated
Comment thread lib/authentication/AuthenticationController.ts Outdated
Comment thread lib/authentication/AuthenticationController.ts Outdated
Comment thread lib/authentication/AuthenticationController.ts Outdated
Comment thread lib/authentication/AuthenticationController.ts Outdated
Comment thread lib/authentication/AuthenticationController.ts Outdated

@H3nSte1n H3nSte1n left a comment

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Interfaces würde ich den namen z.b. TokenDataInterface geben und dementsprechend auch das file so nennen. Ist schneller und besser ersichtlich um was es sich handelt.

Comment thread lib/authentication/DataStoredInToken.ts
Comment thread lib/controllers/CustomerController.ts
Comment thread lib/controllers/ProductController.ts
Comment thread lib/controllers/CustomerController.ts
Comment thread lib/exceptions/CustomerWithThatEmailAlreadyExists.ts
Comment thread lib/exceptions/NoAccessRightsException.ts
Comment thread lib/exceptions/NoAuthenticationTokenSuppliedException.ts
Comment thread lib/exceptions/WrongAuthenticationTokenException.ts
Comment thread lib/exceptions/WrongLoginCredentialsException.ts
Comment thread lib/middleware/authenticationMiddleware.ts Outdated
Comment thread lib/middleware/authenticationMiddleware.ts Outdated
Comment thread lib/middleware/permitMiddleware.ts Outdated
Comment thread lib/models/customerModel.ts
Comment thread lib/models/productModel.ts
@H3nSte1n

H3nSte1n commented Sep 2, 2020

Copy link
Copy Markdown
Author

Kennst du JSDoc ? Meiner Meinung nach würde es stark zum verständnis beitragen wenn du zum teil JSDoc verwenden würdest um deine API zu dokumentieren.

@rukemn

rukemn commented Sep 6, 2020

Copy link
Copy Markdown
Owner

JSDoc werd ich mir anschauen

@rukemn
rukemn marked this pull request as ready for review September 6, 2020 11:57
added user role enum validation,
added role-based permissions using "accesscontrol" - npmpackage,
added first exemplary query building in CustomerController to check permissions
Comment thread lib/controllers/CustomerController.ts
Comment thread lib/controllers/CustomerController.ts

private buildGetCustomerQuery = (user: IUser) : mongoose.DocumentQuery<ICustomer[], ICustomer, {}> => {
let permit = permits.can(user.role).readAny("customer");
if (permit.granted) {

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Du hast hier ziemlich viel doppelten Code drin. Kannst du das evt. zusammenfassen?


constructor(){
public static getInstance = () => {
if(! ProductController.constroller){

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oben schon beschrieben mit der Möglichkeit ohne curly brackets zu arbeiten.

Comment thread lib/exceptions/CustomerWithThatEmailAlreadyExists.ts
Comment thread lib/exceptions/CustomerWithThatEmailAlreadyExists.ts
Comment thread lib/middleware/validation.ts
Comment thread lib/models/userModel.ts
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants