-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #55 from Adel-Atzouza/mark
Mark
- Loading branch information
Showing
25 changed files
with
592 additions
and
509 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,3 +2,4 @@ | |
|
||
POST {{baseUrl}}?FolderName=data | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
|
||
// using CargoHub.Enums; | ||
// using Microsoft.AspNetCore.Mvc.Filters; | ||
|
||
// namespace CargoHub.Services | ||
// { | ||
// public class AuthorizationFilter : Attribute, IAsyncActionFilter | ||
// { | ||
// private readonly Dictionary<RolesEnum.Roles, List<string>> _roles = new Dictionary<RolesEnum.Roles, List<string>>(){ | ||
// {RolesEnum.Roles.WarehouseManager, new List<string>(){"api/v2/ItemGroups","api/v2/ItemLines", "api/v2/Warehouses", "api/v2/Locations", "api/v2/ItemTypes", "api/v2/Transfer", "api/v2/Classifications"}}, | ||
// {RolesEnum.Roles.FloorManager, new List<string>(){ "api/v2/[Controller]", "", "",}} | ||
// }; | ||
// public async Task OnActionExecutionAsync(ActionExecutingContext _context, ActionExecutionDelegate next) | ||
// { | ||
// RolesEnum.Roles[] ApiRoles = [] | ||
// var context = _context.HttpContext; | ||
// string? ApiKey = context.Request.Headers["ApiKey"].FirstOrDefault(); | ||
// if (ApiKey == null) | ||
// { | ||
// context.Response.StatusCode = 401; | ||
// context.Response.ContentType = "text/plain"; | ||
// await context.Response.WriteAsync("Unauthorized: API key is missing."); | ||
// return; | ||
// } | ||
// var apiKeyService = context.RequestServices.GetService<APIKeyService>(); | ||
// bool KeyExists = apiKeyService.VerifyApiKey(ApiKey); | ||
// if (!KeyExists) | ||
// { | ||
// context.Response.StatusCode = 401; | ||
// context.Response.ContentType = "text/plain"; | ||
// await context.Response.WriteAsync("Unknown or inactive Api key"); | ||
// } | ||
// RolesEnum.Roles? UserRole = await apiKeyService.GetRoleForApiKey(ApiKey); | ||
// UserRole. | ||
|
||
|
||
// } | ||
// } | ||
// } |
Oops, something went wrong.