Skip to content
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

[ADMINAPI-1117] - Adds /v2/resourceClaimActions and /v2/resourceClaimActionAuthStrategies endpoints. #221

Merged
merged 24 commits into from
Feb 5, 2025

Conversation

DavidJGapCR
Copy link

No description provided.

Copy link

github-actions bot commented Jan 27, 2025

Test Results

6 tests   6 ✅  0s ⏱️
1 suites  0 💤
1 files    0 ❌

Results for commit 7f40067.

♻️ This comment has been updated with latest results.

@DavidJGapCR
Copy link
Author

Hi @jasonh-edfi . We have a question on these changes.
One of the new endpoints is resourceClaimActions. It is returning the information as shown on this screenshot.
The ticket says "Add /v2/resourceClaimActions as a select * from resourceClaimActions table"
So, as it is, it's just showing Ids.
So, the question is: Do we need to return ResourceClaims.ResourceName and Actions.ActionName as well?
image

CreateMap<EdFi.Security.DataAccess.Models.ResourceClaimAction, ResourceClaimActionModel>()
.ForMember(dst => dst.ResourceClaimName, opt => opt.MapFrom(src => src.ResourceClaim.ResourceName))
.ForMember(dst => dst.ActionName, opt => opt.MapFrom(src => src.Action.ActionName));

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am curious: am I the only one who hates Automapper? I am not suggesting a change right now, because Automapper is how the application already does things. I just think it would be easier to debug and think about things if we wrote the following function inside the ResourceClaimAction class:

public ResourceClaimActionModel ToModel()
{
  return new
  {
    ResourceClaimName = this.ResourceClaim.ResourceClaimName,
    ActionName = this.Action.ActionName
  };
}

When things go wrong, it is very hard to debug if the object at runtime is flowing through AutoMapper. Plus, AutoMapper adds a little overhead to the mapping process. In other words, it will take longer to process that conversion than just using the plain code.

};
}

public List<ResourceClaimActionAuthorizationStrategies> Execute(CommonQueryParams commonQueryParams)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The class that needs to access this: does it need to modify the list contents? If not, then may I suggest returning as IReadOnlyList instead of returning as List?

Copy link

@jagudelo-gap jagudelo-gap left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jasonh-edfi @stephenfuqua
Would it be right for you if this branch contains some initial adminconsole implementation (including swagger definition)?

If not, we have to create a new branch from the tag v2.2.1 (not from the main branch) and issue a new PR.

@stephenfuqua
Copy link

@jasonh-edfi @stephenfuqua Would it be right for you if this branch contains some initial adminconsole implementation (including swagger definition)?

If not, we have to create a new branch from the tag v2.2.1 (not from the main branch) and issue a new PR.

Just saw this question from yesterday. As far as I'm concerned, everything for Admin Console should be going into main now, since Admin Console support is the primary reason for the next AdminApi-2 release.

@@ -16,8 +16,8 @@
"AllowRegistration": true
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you undo the changes on this file?

@DavidJGapCR DavidJGapCR changed the title [ADMINAPI-1117] - Admin API should provide default auth strategy for resource claims [ADMINAPI-1117] - Adds /v2/resourceClaimActions and /v2/resourceClaimActionAuthStrategies endpoints. Feb 5, 2025
@DavidJGapCR DavidJGapCR merged commit 3d6d5ad into main Feb 5, 2025
15 checks passed
@DavidJGapCR DavidJGapCR deleted the ADMINAPI-1117-David branch February 5, 2025 15:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants