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

Add endpoints for managing API delivery channel policies #739

Merged
merged 35 commits into from
Feb 27, 2024

Conversation

griffri
Copy link
Contributor

@griffri griffri commented Feb 14, 2024

Resolves #719

This PR adds:

  • API endpoints for viewing, creating and manipulating delivery channel policies, as well as viewing them as collections organised by channel type
  • A validator class for the DeliveryChannelPolicy Hydra model
  • A validator class for DeliveryChannelPolicy policyData
  • Tests for the above
  • A new "HydraNestedCollection" class for creating nested Hydra model collections

@griffri griffri force-pushed the feature/api_deliverychannelpolicies branch 9 times, most recently from fa80cbb to 078bafe Compare February 21, 2024 16:21
@griffri griffri changed the title Add endpoints for managing delivery channel policies to API Add endpoints for managing API delivery channel policies Feb 22, 2024
…model, basic DeliveryChannelPoliciesController
…cy request, implement GetDeliveryChannelPolicy in policies controller
…o DeliveryChannelPolicy hydra model, add ToDlcsModel() method to DeliveryChannelPolicyConverter
… /deliveryChannelPolicies/{deliveryChannelName} is valid
…for clarity, turn IsValidDeliveryChannel into a separate method, check isPermittedDeliveryChannel in DELETE
…y qualified name for DeliveryChannelPolicy, add tests for HydraDeliveryChannelPolicyValidator
…e DeliveryChannelPolicyDataValidator non-static, change iiif-av policyData validation to just require a single string value
@griffri griffri force-pushed the feature/api_deliverychannelpolicies branch from 0d1fa83 to 8fc766a Compare February 22, 2024 11:42
@griffri griffri marked this pull request as ready for review February 22, 2024 11:50
@griffri griffri requested a review from a team as a code owner February 22, 2024 11:50
…its Id (e.g customer/27/iiif-img would appear instead of customer/27/deliveryChannelPolicies/iiif-img), Null coalesce Created and Modified in HydraDeliveryChannelPolicy.ToDlcsModel
Copy link
Member

@donaldgray donaldgray left a comment

Choose a reason for hiding this comment

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

Overall lgtm, left some comments - mostly around where things sit

…ger documentation, Replace IsValidDeliveryChannel() in DeliveryChannelPoliciesController to AssetDeliveryChannels.IsValidChannel(),Add DeliveryChannelPolicyDataValidator as singleton, Fix 'iif-img' typo
Remove implicit conversion of customer Ids in database fixture

Shorten ValidateTimeBasedPolicyData checks

Remove redundant setters

Change DELETE delivery channel policy to only allow delivery channel policies owned by the customer to be deleted

Return false instead of setting isInvalid to true when parsing size parameter

Allow iiif-av policyData to contain multiple transcode policies, update tests
…remove redundant exception definition from DeliveryChannelPolicyDataValidator
@griffri griffri force-pushed the feature/api_deliverychannelpolicies branch from a09c450 to b0e9ef6 Compare February 23, 2024 13:40
Rename GetDeliveryChannelPolicies to GetPoliciesFromDeliveryChannel

Remove whitespace in AssetDeliveryChannels

Add test for ensuring that attempting to POST a delivery channel with a name that's taken returns a 409

Include displayName and policyData in PatchDeliveryChannelPolicy request constructor

Only attempt to patch a delivery channel policy if a field has been changed

Allow empty strings to be specified in delivery channel policy PATCH

Move policy data validation into HydraDeliveryChannelPolicyValidator

Handle channel validation logic in HydraDeliveryChannelPolicyValidator
Add DbUpdateException extensions, use GetDatabaseError() to determine conflict when creating new delivery channel policies

Remove redundant setters

Rename GetPoliciesFromDeliveryChannel to GetPoliciesForDeliveryChannel
@griffri griffri force-pushed the feature/api_deliverychannelpolicies branch from 7b96654 to a60fe8f Compare February 27, 2024 15:00
… return type of GetDeliveryChannelPolicyCollections handler to Dictionary<string,string>
@griffri griffri merged commit d4dd6eb into develop Feb 27, 2024
9 checks passed
@griffri griffri deleted the feature/api_deliverychannelpolicies branch February 27, 2024 16:19
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.

API endpoints to manage delivery channel policies
3 participants