Skip to content

Commit 9fafa79

Browse files
committed
removed bolded headers
1 parent 04bfa20 commit 9fafa79

File tree

3 files changed

+7
-7
lines changed
  • module4-authentication-and-security

3 files changed

+7
-7
lines changed

module4-authentication-and-security/r1.1-defining-authentication-layer/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,7 @@ Let's take the example above and add salting to it. When Alice is registering, s
233233

234234
The hashes for these two salted passwords will be entirely different, and when stored in the database, **we will need to store the salt too**. So that when they login we can retrieve it and prepend it to their supplied password. This way, the attacker will never know that they are using the same password when studying the hashes even if they know the salt. And their attack will take greater time adjusting for the introduction of salts. The same can be said for Jane, even though she is using a dictionary word, the hash will be for a different sequence of letters, and the hash table won't match it.
235235

236-
### **BCrypt**
236+
### BCrypt
237237

238238
[BCrypt](https://en.wikipedia.org/wiki/Bcrypt) is a password hashing algorithm that is very hard to crack due to being super slow. It is adaptive and can be set up to be harder over time to provide more security by increasing the iteration count. It has an in-built feature to generate a salt when hashing so it won't need a salt column in the database.
239239

module4-authentication-and-security/r1.2-adding-authorization-layer/README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,14 @@ With authorization, we introduce another level of app security. In this lesson,
66
- Introduce role-based authorization
77
- How to restrict access to routes using authorization
88

9-
## **Authorization**
9+
## Authorization
1010

1111
- Authorization is a process by which a server determines if the client has permission to use a resource or access a file.
1212
- Authorization is usually coupled with authentication so that the server has some concept of who the client is that is requesting access.
1313
- The type of authentication required for authorization may vary; passwords may be required in some cases but not in others.
1414
- In some cases, there is no authorization; any user may use a resource or access a file simply by asking for it. Most of the web pages on the Internet require no authentication or authorization.
1515

16-
## **Authentication**
16+
## Authentication
1717

1818
- Authentication is used by a server when the server needs to know exactly who is accessing their information or site.
1919
- Authentication is used by a client when the client needs to know that the server is the system it claims to be.
@@ -42,7 +42,7 @@ From these requirements, we can distinguish our app structure as follows:
4242
- Endpoints like `/delete` would need an authorization guard. Which is a guard that contains the authentication guard, plus it also checks if the user is a `moderator`, before letting them complete the action. Otherwise, it shouldn't let them through.
4343
- To elevate a user, an endpoint like `/elevate` would have the same authorization guard, but instead it will check if the user is an `admin`.
4444

45-
### **Implementation**
45+
### Implementation
4646

4747
To implement this as simply as possible, we need to first define our roles as numbers. That is mainly to:
4848

@@ -213,7 +213,7 @@ There is still a problem with our code though. It is very messy with lots of if-
213213

214214
In the next lesson, we will introduce an easier way to enforce our guards using a feature called **middleware**. We can define an `onlyAdmins`, `onlyModerators`, and `onlyAuthenticated` middleware that would stop unauthorized requests, and only let authorized access through.
215215

216-
## **Conclusion**
216+
## Conclusion
217217

218218
In this lesson, we introduced authorization as a new security feature to our app. It would prevent users without the required access level from entering protected endpoints.
219219

module4-authentication-and-security/r1.2.1-authorization-through-middleware/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ This lesson objectives are:
99
- Implement authorization guard
1010
- Guard certain endpoints with these middlewares
1111

12-
## **Middleware**
12+
## Middleware
1313

1414
Middleware are functions that have access to the [request object](https://expressjs.com/en/4x/api.html#req) (`req`), the [response object](https://expressjs.com/en/4x/api.html#res) (`res`), and the next middleware function in the application’s request-response cycle. The next middleware function is commonly denoted by a variable named `next`.
1515

@@ -195,6 +195,6 @@ Because we are using the `onlyAdmins` middleware, there is no need to check if t
195195
196196
> ⚠️ **Warning**: When you apply a middleware, you simply pass it as a **function**. Above we passed `onlyAdmins` without `()` parentheses. Middleware can be implemented using a configuration function as well, which is a function that takes configuration arguments and returns a middleware function. Read more about it in Express [documentation](https://expressjs.com/en/guide/writing-middleware.html#:~:text=Using%20Express%20middleware.-,Configurable%20middleware,-If%20you%20need).
197197
198-
## **Conclusion**
198+
## Conclusion
199199
200200
In this lesson, we learned that everything in Express.js is basically a middleware that gets invoked somewhere. And by using middleware, we can structure our business logic in a clean approach. Middleware can be used for basically everything, and one of their use cases is to enforce authorization.

0 commit comments

Comments
 (0)