-
Notifications
You must be signed in to change notification settings - Fork 347
Add Auth Project Library #525
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
1ce1b0d
Add Auth project and fix references.
seantleonard abba6e8
Fix somehow corrupted project files,with bad reference filepath to au…
seantleonard 17f6e20
Remove interface methods for now.
seantleonard b9d8812
Add param check for interface explicit implementation.
seantleonard ff676b1
Apply suggestions from code review
seantleonard File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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,57 @@ | ||
| namespace Azure.DataGateway.Auth | ||
| { | ||
| /// <summary> | ||
| /// Represents the permission metadata of an entity. | ||
| /// An entity's top-level permission structure is a collection | ||
| /// of roles. | ||
| /// </summary> | ||
| public class EntityMetadata | ||
| { | ||
| /// <summary> | ||
| /// Given the key (roleName) returns the associated RoleMetadata object. | ||
| /// To retrieve all roles associated with an entity -> RoleToActionMap.Keys() | ||
| /// </summary> | ||
| public Dictionary<string, RoleMetadata> RoleToActionMap { get; set; } = new(); | ||
|
|
||
| /// <summary> | ||
| /// Given the key (actionName) returns a key/value collection of fieldName to Roles | ||
| /// i.e. READ action | ||
| /// Key(field): id -> Value(collection): permitted in {Role1, Role2, ..., RoleN} | ||
| /// Key(field): title -> Value(collection): permitted in {Role1} | ||
| /// </summary> | ||
| public Dictionary<string, Dictionary<string, IEnumerable<string>>> FieldToRolesMap { get; set; } = new(); | ||
|
|
||
| /// <summary> | ||
| /// Given the key (actionName) returns a collection of roles | ||
| /// defining config permissions for the action. | ||
| /// i.e. READ action is permitted in {Role1, Role2, ..., RoleN} | ||
| /// </summary> | ||
| public Dictionary<string, List<string>> ActionToRolesMap { get; set; } = new(); | ||
| } | ||
|
|
||
| /// <summary> | ||
| /// Represents the permission metadata of a role | ||
| /// A role's top-level permission structure is a collection of | ||
| /// actions allowed for that role: Create, Read, Update, Delete, * (wildcard) | ||
| /// </summary> | ||
| public class RoleMetadata | ||
| { | ||
| /// <summary> | ||
| /// Given the key (actionName) returns the associated ActionMetadata object. | ||
| /// </summary> | ||
| public Dictionary<string, ActionMetadata> ActionToColumnMap { get; set; } = new(); | ||
| } | ||
|
|
||
| /// <summary> | ||
| /// Represents the permission metadata of an action | ||
| /// An action lists both columns that are included and/or exluded | ||
| /// for that action. | ||
| /// </summary> | ||
| public class ActionMetadata | ||
| { | ||
| public string? DatabasePolicy { get; set; } | ||
| public HashSet<string> Included { get; set; } = new(); | ||
| public HashSet<string> Excluded { get; set; } = new(); | ||
| public HashSet<string> Allowed { get; set; } = new(); | ||
| } | ||
| } |
This file contains hidden or 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,13 @@ | ||
| <Project Sdk="Microsoft.NET.Sdk"> | ||
|
|
||
| <PropertyGroup> | ||
| <TargetFramework>net6.0</TargetFramework> | ||
| <ImplicitUsings>enable</ImplicitUsings> | ||
| <Nullable>enable</Nullable> | ||
| </PropertyGroup> | ||
|
|
||
| <ItemGroup> | ||
| <PackageReference Include="Microsoft.AspNetCore.Http.Abstractions" Version="2.2.0" /> | ||
| </ItemGroup> | ||
|
|
||
| </Project> |
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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
42 changes: 0 additions & 42 deletions
42
DataGateway.Service/Models/Authorization/AuthorizationMetadataHelpers.cs
This file was deleted.
Oops, something went wrong.
This file contains hidden or 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 hidden or 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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.