Project:
View Issue Details[ Jump to Notes ] | [ Issue History ] [ Print ] | |||||||
ID | ||||||||
0046301 | ||||||||
Type | Category | Severity | Reproducibility | Date Submitted | Last Update | |||
defect | [Retail Modules] Web POS Hardware Manager | major | always | 2021-04-19 22:55 | 2021-04-27 17:52 | |||
Reporter | rtoledano | View Status | public | |||||
Assigned To | rqueralta | |||||||
Priority | high | Resolution | fixed | Fixed in Version | RR21Q3 | |||
Status | closed | Fix in branch | Fixed in SCM revision | |||||
Projection | none | ETA | none | Target Version | RR20Q3.4 | |||
OS | Linux 64 bit | Database | PostgreSQL | Java version | Openjdk 11.0.10 2021-01-19 | |||
OS Version | Ubuntu 18.04.5 LTS | Database version | PostgreSQL 11.7 | Ant version | Apache Ant(TM) version 1.10.6 | |||
Product Version | RR20Q3.4 | SCM revision | ||||||
Merge Request Status | approved | |||||||
Review Assigned To | ||||||||
OBNetwork customer | Gold | |||||||
Support ticket | ||||||||
Regression level | ||||||||
Regression date | ||||||||
Regression introduced in release | ||||||||
Regression introduced by commit | ||||||||
Triggers an Emergency Pack | No | |||||||
Summary | 0046301: Printing of images referring to URLs with authentication is not supported in HWM | |||||||
Description | We have a client (Weldom), who has a custom module, which during the synchronization of a ticket consults an external service that can return a list of URLs referring to bonds (in image format) as royalties for the purchase made. The requirement is to be able to print on the printer in addition to the ticket, the generated bonds to be able to give them to the buyer. Each URL refers to an image so it is possible, for example, to send the following template to print on the printer: <? xml version = "1.0" encoding = "UTF-8"?> <output> <ticket> <line> <image type = "url">https://wspreprod.be-one.fr/BEOneDataWeldom/tickets/tickets-a645-1617941657970.bmp</image> [^] </line> </ticket> </output> Which works fine if this URL is not protected by some HTTP authentication method. But this URL is protected with a basic HTTP authentication method. If we try to send the following template to print: <? xml version = "1.0" encoding = "UTF-8"?> <output> <ticket> <line> <image type = "url"> https://<user>:<password>@wspreprod.be-one.fr/BEOneDataWeldom/tickets/tickets-a645-1617941657970.bmp</image> [^] </line> </ticket> </output> replacing <user> and <password> with the authentication credentials, the image is still not possible to print, due to the way the HWM tries to download this image for printing. The other drawback of trying to solve the problem in this way is that we would be exposing unencrypted authentication data. Currently in the source file of the HWM, com.openbravo.pos.printer.TicketParser is where the way to read this image is implemented: image = ImageIO.read (new URL (text.toString ())); where text is the URL. The use of the java URL class is what prevents the authentication data from being taken into account. | |||||||
Steps To Reproduce | 1- Start HWM 2- Using Postman or similar tool Create a HTTP POST request to the printer(http://localhost:8090/printer [^]) 3- In Body send a xml print template like the example show. But with an URL protected by a basic HTTP authentication 4- Check that the image is not printed | |||||||
Proposed Solution | 1- A proposal could be to add other attributes to the image tag of the xml template, for example: <? xml version = "1.0" encoding = "UTF-8"?> <output> <ticket> <line> <image type = "url" user = "usr" password = "encrypted_password" authType = "Basic"> https://wspreprod.be-one.fr/BEOneDataWeldom/tickets/tickets-a645-1617941657970.bmp [^] </image> </line> </ticket> </output> In this way, in the com.openbravo.pos.printer.TicketParser class, the new authentication attributes would be managed, as well as the suitable java APIs to read the image. The method that the class will use to decrypt the password must be defined. 2- Another proposal, would be to support the base-64 encoded image in the printing template. In this way, the developer would be in charge of downloading the image and generating the xml printing template with the base-64 encoded image. This could be a proposed code to add in TicketParser.endElement method: if ("data".equals(imgtype)) { image = ImageIO.read(new ByteArrayInputStream(Base64.getDecoder().decode(text.toString()))); } | |||||||
Tags | No tags attached. | |||||||
Attached Files | ![]() ![]() | |||||||
![]() |
|
![]() |
|||
Date Modified | Username | Field | Change |
2021-04-19 22:55 | rtoledano | New Issue | |
2021-04-19 22:55 | rtoledano | Assigned To | => Retail |
2021-04-19 22:55 | rtoledano | OBNetwork customer | => No |
2021-04-19 22:55 | rtoledano | Triggers an Emergency Pack | => No |
2021-04-19 23:04 | rtoledano | Description Updated | View Revisions |
2021-04-20 17:03 | rtoledano | Proposed Solution updated | |
2021-04-20 17:03 | rtoledano | Proposed Solution updated | |
2021-04-20 18:37 | rtoledano | Proposed Solution updated | |
2021-04-20 20:16 | rtoledano | Proposed Solution updated | |
2021-04-22 17:13 | rtoledano | OBNetwork customer | No => Gold |
2021-04-22 17:13 | rtoledano | Resolution time | => 1620079200 |
2021-04-22 17:20 | rtoledano | Type | feature request => design defect |
2021-04-22 17:21 | rtoledano | Type | design defect => defect |
2021-04-22 19:03 | rtoledano | File Added: 0001-Fixes-ISSUE-46301-Support-is-added-to-print-embedded.patch | |
2021-04-22 19:03 | rtoledano | File Added: testdata.xml | |
2021-04-22 21:34 | rqueralta | Assigned To | Retail => rqueralta |
2021-04-22 21:35 | rqueralta | Status | new => scheduled |
2021-04-22 21:48 | hgbot | Merge Request Status | => open |
2021-04-22 21:48 | hgbot | Note Added: 0127474 | |
2021-04-27 13:10 | hgbot | Merge Request Status | open => approved |
2021-04-27 17:12 | hgbot | Note Added: 0127590 | |
2021-04-27 17:22 | hgbot | Note Added: 0127591 | |
2021-04-27 17:24 | hgbot | Note Added: 0127592 | |
2021-04-27 17:52 | hgbot | Resolution | open => fixed |
2021-04-27 17:52 | hgbot | Status | scheduled => closed |
2021-04-27 17:52 | hgbot | Fixed in Version | => RR21Q3 |
2021-04-27 17:52 | hgbot | Note Added: 0127594 | |
2021-04-27 17:52 | hgbot | Note Added: 0127595 | |
2021-04-27 17:52 | hgbot | Note Added: 0127596 | |
2021-04-27 17:52 | hgbot | Note Added: 0127597 |
Copyright © 2000 - 2009 MantisBT Group |