# [[BE][FE] Integrate DRM context Data Flow](https://ownzones.atlassian.net/browse/CD-6586)
## TO DO
### Checks - Newstaging:
5. To check the replacement of the error messages with the ones provided by Andrei Balan.
- [x] QA - checked on Arrakis
### Issues:
3. Workflow is completed in hybrik and swf but not in connect
https://connect.arrakis.ownzones.dev/arrakis-org/workflows/59455b80-4088-4fa6-9a38-a62293b88810
- [x] BE
- [x] QA - checked on Arrakis
4. (Newstaging) In the case of an incorrect **Response Signature** the error returned indicates that there are zero "0" signatures that are missing: `CPIXDocumentSignatureVerificationError: There are 0 signatures that are missing the associated public key required for verification.`
WF example: https://connect.newstaging.ownzones.dev/metadate-cu-v2/workflows/18400759-0982-4a49-9d34-278d67272307
- [x] BE
- [x] QA - checked on Arrakis
5. (Newstaging) Having an empty/incorrect (wrong format) Key ID metadata field in the title will generate an ambiguous error: **EncryptionInformationValidationError: Property validation has failed.**
WF example: https://connect.newstaging.ownzones.dev/metadate-cu-v2/workflows/f6b75369-27fb-426e-ac0c-752230a4e6da
- [x] BE
- [x] QA - checked on Arrakis
6. (Newstaging) Having two sets of keys in the same provider, for the **Request signature** and **Response signature** will generate the following error: **CPIXDocumentSigningError: error:0909006C:PEM routines:get_name:no start line**
WF example: https://connect.newstaging.ownzones.dev/metadate-cu-v2/workflows/75add1ec-8174-4629-a9ac-dcc35fa9ec20
- [x] BE
- [x] QA - checked on Arrakis
7. (Nice to have) Attempting to delete a DRM provider generates a generic message: GraphQL error: The DRM Provider is in use.
Perhaps it is possible to add the number of profiles or their ID's to the message to aid in their identification, like for the entity types?

- [x] BE
- [x] QA - checked on Arrakis
## Done
### Issues
1. The entire form is visible even if DRM provider is not selected yet - from specs: *When selecting a DRM provider the rest of the form will be made visible and all of the fields are mandatory*
- [x] FE
- [x] QA
2. Should DRM Provider selector be mandatory in any cases, or it makes sense to have some sort of validation based on job template?
Or should we leave it as not required (even if drm is referenced in job template)
Stefan: It shouldn't be required
- [x] FE
- [x] QA
3. **Tooltips** are missing (for DRM provider, content keys fields)
Stefan: Having these doesn't really make sense, because we have the validations for this fields
- [x] FE
- [x] QA
5. *Track type input field also is pre-filled with the Default value* - not present, is this still a requirement? Stefan: I discussed with Balan, and he decided that we can leave this empty, and let the user type it, as long as it's required it should be all right
- [x] FE
- [x] QA
6. These fields have different names than in specs (Template name -> ***Name template***, Content identifier name -> ***Content identifier template***)
- [x] FE
- [x] QA
7. **Content identifier template** field should be required (*all of the fields are mandatory*)
- [x] FE
- [x] QA
8. No FE validation for empty Content Keys fields - if a new content key is added (validation exists for the default one)

- [x] FE
- [x] QA
8. Profile can be saved with no drm provider id, but keeping drm template - maybe hide or empty the rest of the form when delesecting a drm provider - TBD


- [x] FE
- [x] QA
9. Change DRM provider - fill required fields - save - **not reproducible anymore**
 -
- [ ] BE
- [ ] QA
10. Error when triggering a transcode if metadata attributes are used for KID template field


- [x] BE
- [x] QA
11. Maybe add a validation when deleting an used DRM provider; at this moment it can be deleted, the job template and drm template are kept, but no selected value for drm provider field (since it was deleted)
Stefan: You should be able to delete a drm provider, I fixed the issue above, and it will remove the data after the provider is changed or removed

- [x] FE
- [x] QA - checked on Arrakis
### Validations - Newstaging:
1. DRM tab - all values are mandatory.
- [x] QA
### Checks - Newstaging:
1. Using incorrect authentication keys generates an error: **CPIXAPIExchangeError: 'logId' : '15487c1b-6257-4f2a-a8ed-9416721378f5', 'message' : 'Request does not contain Esp Partner's signature'**
- [x] QA
2. Using incorrect request keys generates various errors depending on the incorrect key (public/private):
a) Gibberish in both: **CPIXDocumentSigningError: error:09091064:PEM routines:PEM_read_bio_ex:bad base64**
b) Private: **CPIXDocumentSigningError: error:0D07209B:asn1 encoding routines:ASN1_get_object:too long**
c) Public: **CPIXAPIExchangeError: 'logId' : '', 'message' : 'Cannot find the requested object'**
- [x] QA
3. Using an incorrect response key generates an error: **CPIXDocumentSignatureVerificationError: There are 0 signatures that are missing the associated public key required for verification**.
- [x] QA
4. Using an incorrect variable name generates an error: **HybrikError: Transcode activity failed (activity id: 2d58b6eb-8da3-421e-ad5f-bb07e63d50a0): DASH encryption requires key_id in the JSON**.
- [x] QA