Book 4 - ServerSide Flashcards
(26 cards)
What is a controller?
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.
what does decorated mean?
decorated is when a specific annotation or attribute is applied to a class, method, property or field to provide additional information or behavior.
[Route(“api/[controller]”)]
Route attribute, tells the framework what route segment should be associated with all of the endpoints in the controller.
[ApiController]
attribute for controllers
What is ControllerBase
parent class for the controllers
What is Authentication?
proving you are you who say you are
What is Authorization?
proving you are allowed to do what you are trying to do
What is a cookie?
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.
What is in a cookie?
it is possible to configure lots of data in a cookie… each piece is called a claim
IdentityDbContext
class inherited from EF Core
IdentityUser
part of IdentityDbContext - this will hold login credentials for users
IdentityRole
part of IdentityDbContext - this will hold the various roles that a user can have
IdentityUserRole
part of IdentityDbContext - a many-to-many table between roles and users. These define which users have which roles.
what is a Guid
Global Unique Identifier. These can be created with Guid.NewGuid()..a Guid is a data type … used for uniquely identified resources
what does hashing a password mean ?
hashing the password has to do with obscuring the password for security reasons.
what is hashing?
hashing is converting data of arbitrary size to a fixed size value… through a mathematical algorithm called a hash function.
[Authorize]
attribute that tells the framework to require a cookie to access the resource
[Authorize(Roles = “Admin”)]
attribute that ensures that the resource will only be accessible to authenticated users that have the admin role associated with their user id
what does decoupling mean?
reducing or eliminating dependencies between components … or promotes independence and modularity between components, elements, modules etc. … in short reduces dependencies
what is dependency injection ?
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
what does inject mean?
typically to supply a dependency to a component or object from an external source
what does RBAC mean?
roll based access control … managing how users interact with the site based on their authorization
[Authorize(Roles = “Admin”)]
annotation applied to an endpoint that specifies its access according to the role of the user
ASP.NET
framework.. provides a rich set of tools and libraries for developing web applications,