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

PolicyAPI - Default policy collection is shown in GET /irs/policies #734

Closed
8 tasks done
mkanal opened this issue Jun 26, 2024 · 9 comments
Closed
8 tasks done

PolicyAPI - Default policy collection is shown in GET /irs/policies #734

mkanal opened this issue Jun 26, 2024 · 9 comments
Assignees
Labels
3 - Maintenance & Improvements (EDC & EDC API) Improvements bug Something isn't working policy_store Issues regarding the IRS policy store. R24.8

Comments

@mkanal
Copy link
Contributor

mkanal commented Jun 26, 2024

As Trace-X
I want default policy to be shown in GET /irs/policies
so that default policy is always visible

Hints / Details

  • ...

Acceptance Criteria

  • Default policy is always listed in GET /irs/policies
  • Filter for default policy is supported GET /irs/policies?businessPartnerNumbers=?default
  • Integration Tests
  • Documentation in Arc42

Testing

  • Show default policy after adding policy for BPN
    • Create default policy, add policy with BPN
    • Call Endpoint GET /irs/policies without parameter
    • Expected result: Default policy is listed

Out of Scope

  • ...
@mkanal mkanal added this to IRS Jun 26, 2024
@github-project-automation github-project-automation bot moved this to inbox in IRS Jun 26, 2024
@mkanal
Copy link
Contributor Author

mkanal commented Jul 3, 2024

If no BPNL is used the default policy is overridden only in this case when no BPNL is given.

@mkanal mkanal moved this from inbox to backlog in IRS Jul 3, 2024
@mkanal mkanal changed the title PolicyAPI - Default policy should not be overriden once policy is added for BPNL PolicyAPI - Default policy collection is shown in GET /irs/policies Jul 3, 2024
@mkanal mkanal added bug Something isn't working 3 - Maintenance & Improvements (EDC & EDC API) Improvements policy_store Issues regarding the IRS policy store. labels Jul 3, 2024
@mkanal mkanal moved this from backlog to next in IRS Jul 9, 2024
@ds-jhartmann
Copy link
Contributor

Planning 2

  • define a process on how to create/update the default policy which allows to filter for the default policy

@dsmf dsmf moved this from next to wip in IRS Jul 10, 2024
@dsmf dsmf self-assigned this Jul 10, 2024
@dsmf
Copy link
Contributor

dsmf commented Jul 11, 2024

If there is no custom default policy in the database the configured default needs to be returned.
If there is a custom default policy in the database the configured default must not be returned (because the configured default will most likely be more restrictive than custom policies).

dsmf added a commit to dsmf/tx-item-relationship-service that referenced this issue Jul 11, 2024
dsmf added a commit to dsmf/tx-item-relationship-service that referenced this issue Jul 11, 2024
@dsmf
Copy link
Contributor

dsmf commented Jul 11, 2024

PR:

#791

  • Default policy is always listed in GET /irs/policies and in the new endpoint GET /irs/policies/paged from [POLICY_STORE] Add filter, sorting, pagination for GET endpoints #639
    • If there is no custom default policy in the database the configured default is returned.
    • If there are normal policies but no default policy has been defined via the API then the configured default policy is returned.
    • If there is a custom default policy in the database the configured default is not returned, only the custom default policies defined via the API
  • Filter for default policy is supported
    • GET /irs/policies?businessPartnerNumbers=default
    • GET /irs/policies/paged?businessPartnerNumbers=default
    • GET /irs/policies?search=BPN,EQUALS,default
    • GET /irs/policies?search=BPN,STARTS_WITH,default
  • The insomnia request collection has been updated
    • filter for default policy has been added to each relevant endpoint
    • Some missing parameters on policies/paged have been added
    • Some descriptions have been added to improve documentation
  • Arc42 documentation (nothing to do here)
  • Policy Store API Integration tests (no change necessary)
  • The other integration tests -- to be checked after deploy to DEV

dsmf added a commit to dsmf/tx-item-relationship-service that referenced this issue Jul 11, 2024
dsmf added a commit to dsmf/tx-item-relationship-service that referenced this issue Jul 11, 2024
…lection

- add "Register a default policy"
- add more parameters to "Find policies (paged)" and add some descriptions
dsmf added a commit to dsmf/tx-item-relationship-service that referenced this issue Jul 11, 2024
…lection

- add filter for default policies to "Get policies for BPN"
- add some descriptions
dsmf added a commit to dsmf/tx-item-relationship-service that referenced this issue Jul 11, 2024
dsmf added a commit to dsmf/tx-item-relationship-service that referenced this issue Jul 11, 2024
ds-jhartmann added a commit that referenced this issue Jul 12, 2024
…T-policies-request

fix(policy-api):[#734] return configured default policies if no custo…
@ds-jhartmann ds-jhartmann moved this from wip to test in IRS Jul 12, 2024
@ds-kgassner
Copy link
Contributor

ds-kgassner commented Jul 15, 2024

Successfully tested endpoints GET /irs/policies and endpoint GET /irs/policies/paged regarding:

  • If there is no custom default policy in the database the configured default is returned.
  • If there are normal policies but no default policy has been defined via the API then the configured default policy is returned.
  • If there is a custom default policy in the database the configured default is not returned, only the custom default policies defined via the API

Also successfully tested filtering:

  • GET /irs/policies?businessPartnerNumbers=default
    
  • GET /irs/policies/paged?businessPartnerNumbers=default
    
  • GET /irs/policies?search=BPN,EQUALS,default
    
  • GET /irs/policies?search=BPN,STARTS_WITH,default
    

@mkanal mkanal added the R24.8 label Jul 15, 2024
@ds-jhartmann ds-jhartmann moved this from test to review in IRS Jul 15, 2024
dsmf added a commit to dsmf/tx-item-relationship-service that referenced this issue Jul 17, 2024
dsmf added a commit to dsmf/tx-item-relationship-service that referenced this issue Jul 17, 2024
dsmf added a commit to dsmf/tx-item-relationship-service that referenced this issue Jul 17, 2024
@dsmf dsmf mentioned this issue Jul 17, 2024
2 tasks
@mkanal
Copy link
Contributor Author

mkanal commented Jul 19, 2024

@dsmf

image

@mkanal mkanal moved this from review to wip in IRS Jul 19, 2024
@dsmf
Copy link
Contributor

dsmf commented Jul 19, 2024

@mkanal

Documentation
Default Policy Handling is no component. It has to do with configuration. Therefore I don't see what we should change in the arc42 configuration. How to configure default policies is described in
https://eclipse-tractusx.github.io/item-relationship-service/docs/administration/administration-guide.html#_helm_configuration_irs_values_yaml

grafik

and

grafik

The concept of default policies is not new and has already been included in this documentation. Only the format of the configuration value has changed, and the documentation has been updated accordingly.
If anything more is needed specify exactly where this should be documented and in what form, please.

errorRef
errorRef is a reference by which you can find error details in the logs (this way the API does not need to expose security relevant things like stack traces and still you can investigate the error by reporting the errorRef. Someone with access to the logs can then check what happened). errorRef is generated for unknown errors by the central exception handler. It is nothing new from this story.

UPDATE / DELETE HTTP 500
This story is about changing the GET endpoint. The UPDATE / DELETE endpoints are not part of this story / acceptance criteria.

However I created a pull request to handle this situation (404 if normal policy does not exist, 400 if tried to delete / update a configured default policy which are readonly):

#835

grafik

dsmf added a commit to dsmf/tx-item-relationship-service that referenced this issue Jul 19, 2024
@mkanal
Copy link
Contributor Author

mkanal commented Jul 22, 2024

@dsmf Documentation in Arc42 is a AC criteria. Please document the api in the Building block view. Thx.

@mkanal mkanal moved this from wip to done in IRS Jul 22, 2024
@mkanal mkanal closed this as completed Jul 22, 2024
@mkanal
Copy link
Contributor Author

mkanal commented Jul 22, 2024

LGFM PO acceptance in behalf of @jzbmw . #835 provides solution. Arc42 documentation for policy store api will be part of another story.

@mkanal mkanal added this to the 24.03 Feature Freeze milestone Jul 22, 2024
dsmf added a commit to dsmf/tx-item-relationship-service that referenced this issue Jul 23, 2024
… on read-only default policies: tests, readability

- Add missing tests for trial to register, update or delete fallback policy
- Enhance code readability by relocating checks from the catch block to the beginning of relevant methods.
dsmf added a commit to dsmf/tx-item-relationship-service that referenced this issue Jul 23, 2024
… on read-only default policies: add handleTrialToModifyFallbackPolicy to registerPolicy method
ds-jhartmann added a commit that referenced this issue Jul 23, 2024
…donly-default-policies

feat(impl): [#734] Handling for modification attempts on read-only de…
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3 - Maintenance & Improvements (EDC & EDC API) Improvements bug Something isn't working policy_store Issues regarding the IRS policy store. R24.8
Projects
Status: done
Development

No branches or pull requests

4 participants