Book 4 - ServerSide Flashcards

1
Q

What is a controller?

A

a controller is a class. A controller class contains methods that are the handlers for the endpoints of the API. Controllers inherit many of their properties and methods from the ControllerBase class. A controller contains all of the endpoints for a specific resource.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

what does decorated mean?

A

decorated is when a specific annotation or attribute is applied to a class, method, property or field to provide additional information or behavior.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

[Route(“api/[controller]”)]

A

Route attribute, tells the framework what route segment should be associated with all of the endpoints in the controller.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

[ApiController]

A

attribute for controllers

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What is ControllerBase

A

parent class for the controllers

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What is Authentication?

A

proving you are you who say you are

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What is Authorization?

A

proving you are allowed to do what you are trying to do

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What is a cookie?

A

A small piece of data that a web server sends to a web browser, which the browser then stores locally. They are used to track user activity, maintain user sessions, store user preferences, and perform other tasks related to user interaction with a website or web application.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What is in a cookie?

A

it is possible to configure lots of data in a cookie… each piece is called a claim

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

IdentityDbContext

A

class inherited from EF Core

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

IdentityUser

A

part of IdentityDbContext - this will hold login credentials for users

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

IdentityRole

A

part of IdentityDbContext - this will hold the various roles that a user can have

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

IdentityUserRole

A

part of IdentityDbContext - a many-to-many table between roles and users. These define which users have which roles.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

what is a Guid

A

Global Unique Identifier. These can be created with Guid.NewGuid()..a Guid is a data type … used for uniquely identified resources

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

what does hashing a password mean ?

A

hashing the password has to do with obscuring the password for security reasons.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

what is hashing?

A

hashing is converting data of arbitrary size to a fixed size value… through a mathematical algorithm called a hash function.

17
Q

[Authorize]

A

attribute that tells the framework to require a cookie to access the resource

18
Q

[Authorize(Roles = “Admin”)]

A

attribute that ensures that the resource will only be accessible to authenticated users that have the admin role associated with their user id

19
Q

what does decoupling mean?

A

reducing or eliminating dependencies between components … or promotes independence and modularity between components, elements, modules etc. … in short reduces dependencies

20
Q

what is dependency injection ?

A

a design pattern in software development where the dependencies of a class are provided from the outside as opposed to being defined within the class itself. This minimizes the dependencies between components…. aka loose coupling

21
Q

what does inject mean?

A

typically to supply a dependency to a component or object from an external source

22
Q

what does RBAC mean?

A

roll based access control … managing how users interact with the site based on their authorization

23
Q

[Authorize(Roles = “Admin”)]

A

annotation applied to an endpoint that specifies its access according to the role of the user

24
Q

ASP.NET

A

framework.. provides a rich set of tools and libraries for developing web applications,

25
Q

what is an interface?

A

an interface is a construct that you define for classes to implement. A mechanism to introduce polymorphism into your system. They provide additional types to your classes.They define what your class should do, but not how it should do it. They allow you to define common properties and behaviors among different classes in your system so you can group them together into collections.

26
Q

what is polymorphism?

A

concept in OOP that allows objects of different classes to be treated as objects of a common superclass. It enables a single interface to represent different underlying data types.