Jump to content

omnibrain

Members
  • Content Count

    104
  • Joined

  • Last visited

Community Reputation

15 Good

Technical Information

  • Delphi-Version
    Delphi 11 Alexandria

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. I ordered it because I have lots of ideas how to use it (especially the technical drawings) to augment our software. 🙂 Let's see how this goes. If nothing else our customers will be able to create nice labels 😉
  2. omnibrain

    Looking for VoIP/SIP client SDKs/components

    That one's initially very expensive... Do you know what renewals cost?
  3. As far as I know Mosquitto is the reference implementation for MQTT.
  4. omnibrain

    Codolex 2.0 is now Free - Low-Code for Delphi

    I don't 100% understand what this is. Is this a tool that creates code that you can adjust and then compile, or is this something you integrate (like a workflow engine) into an existing application?
  5. omnibrain

    Delphi Low-code No-code?

    In the end each tool has their uses. 2 years ago I had to quickly add a customer portal to our software. A customer of one of our customers wanted to be able to access protocols and reports. Giving them direct access was no option. So I set up a DB server, built a custom periodic data export, and used a no/low code tool named Budibase to build a web frontend. Because I have total control over the data I export I could work around limitations regarding data representation by simply adjusting my export logic.
  6. omnibrain

    Experiences with D2Bridge Framework

    Interesting, never heard of it before. It looks like it is more in the direction of WEB framework & components for Delphi & Visual Studio Code | TMS Software than FMSoft uniGUI Web Application Framework There are of course also Elevate Software, Inc. Quartex Pascal – Research and development for the next generation object pascal (quartexdeveloper.com) and Smart Mobile Studio | About | Smart Mobile StudioAbout - Smart Mobile Studio but they are not 100% Delphi but rather Object Pascal and Delphi inspired. Perhaps a user of some of them can chime in.
  7. Just to add: the // quick and dirty should not handle the 404 case, otherwise nothing works anymore, because the flags comes with hg404 if you "try" static serving first.
  8. No problem. I just wanted to try it now and report my findings so you have all the information when you find time to look into it.
  9. I debugged the issue for a bit: In THttpConnection.ProcessPostPutPat Flags gets changed from hg401 to hgAcceptData, so the "case Flags of hg401" never gets triggered. Perhaps there needs to be a check for the 40x-Flags before the "if (FRequestMethod = httpMethodPost) then TriggerPostDocument(Flags) ..." block. Quick and dirty, seems to work, but I don't know if something further down the line breaks: {* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *} procedure THttpConnection.ProcessPostPutPat; { V8.08 } var Flags : THttpGetFlag; begin { POST and no content-length received, we treat this as "bad request" } { and don't pass it to the component user. } if (not FRequestHasContentLength) or (FRequestContentLength < 0) then begin { HTTP/1.0 A valid Content-Length is required on all HTTP/1.0 POST requests. An HTTP/1.0 server should respond with a 400 (bad request) message if it cannot determine the length of the request message's content. HTTP/1.1 The presence of a message-body in a request is signaled by the inclusion of a Content-Length or Transfer-Encoding header field in the request's message-headers. For compatibility with HTTP/1.0 applications, HTTP/1.1 requests containing a message-body MUST include a valid Content-Length header field unless the server is known to be HTTP/1.1 compliant. If a request contains a message-body and a Content-Length is not given, the server SHOULD respond with 400 (bad request) if it cannot determine the length of the message, or with 411 (length required) if it wishes to insist on receiving a valid Content-Length. Currently we act as a HTTP/1.0 server. } FKeepAlive := FALSE; Answer400; { We close the connection non-gracefully otherwise we might receive data we cannot handle properly. } CloseDelayed; Exit; end; {$IFNDEF NO_AUTHENTICATION_SUPPORT} if not FAuthenticated then Flags := hg401 else {$ENDIF} if FOutsideFlag and (not (hoAllowOutsideRoot in FOptions)) then Flags := hg403 else Flags := hg404; case Flags of // quick and dirty hg400: begin FKeepAlive := FALSE; Answer400; CloseDelayed; exit; end; {/V7.30 } hg401: begin if FKeepAlive = FALSE then {Bjornar} PrepareGraceFullShutDown; Answer401; exit; end; hg403: begin if FKeepAlive = FALSE then {Bjornar} PrepareGraceFullShutDown; Answer403; exit; end; hg404: begin if FKeepAlive = FALSE then {Bjornar} PrepareGraceFullShutDown; Answer404; exit; end; end; FAcceptPostedData := FALSE; if (FRequestMethod = httpMethodPost) then TriggerPostDocument(Flags) else if (FRequestMethod = httpMethodPut) then TriggerPutDocument(Flags) else if (FRequestMethod = httpMethodPatch) then TriggerPatchDocument(Flags); if (not FAcceptPostedData) and (FRequestContentLength > 0) then begin { V7.30 } { The component user doesn't handle posted data. } { Turn LineMode off if RequestContentLength > 0, we'll turn it } { back on again in our overridden method Receive. } LineMode := FALSE; FPostCounter := FRequestContentLength; end else FPostCounter := 0; case Flags of hg400: begin FKeepAlive := FALSE; Answer400; CloseDelayed; end; {/V7.30 } hg401: begin if FKeepAlive = FALSE then {Bjornar} PrepareGraceFullShutDown; Answer401; end; hg403: begin if FKeepAlive = FALSE then {Bjornar} PrepareGraceFullShutDown; Answer403; end; hg404: begin if FKeepAlive = FALSE then {Bjornar} PrepareGraceFullShutDown; Answer404; end; hgAcceptData: FAcceptPostedData := TRUE; else if FKeepAlive = FALSE then {Bjornar} CloseDelayed; end; end;
  10. I got a (somewhat working example with minimal changes to the demo. I used the postinfo-Demo, because I think you added that specifically to test POST. \demos-data\WebAppServerData\Templates\postinfo.htm is missing, but that doesn't matter for the test. My one change: procedure TWeblServerForm.SslHttpAppSrv1AuthGetType(Sender, Client: TObject); var ClientCnx : TMyHttpConnection; begin //{ It's easyer to do the cast one time. Could use with clause... } ClientCnx := TMyHttpConnection(Client); if CompareText(ClientCnx.Path, '/DemoBasicAuth.html') = 0 then begin ClientCnx.AuthTypes := [atBasic]; ClientCnx.AuthRealm := 'DemoBasicAuth'; end else if CompareText(ClientCnx.Path, '/postinfo.html') = 0 then begin // Added for Debugging Basic Auth ClientCnx.AuthTypes := [atBasic]; ClientCnx.AuthRealm := 'DemoBasicAuth'; end GET with no credentials Request requires authentication "/postinfo.html" AuthType is "atBasic" 192.168.178.105 - WEB-APP /postinfo.htm Answer Log - 2024-03-27 23:35:45 WEB-APP SYCORAX 0.0.0.0 GET /postinfo.html - 86 - 192.168.178.105 HTTP/1.1 PostmanRuntime/7.37.0 192.168.247.109:86 401 337 218 0 GET with wrong credentials Request requires authentication "/postinfo.html" AuthType is "atBasic" AuthGetPassword for "/postinfo.html" AuthType is "atBasic" [23:37:08 192.168.178.105] authentication result failed with type Basic for /postinfo.html 192.168.178.105 - WEB-APP /postinfo.html Answer Log - 2024-03-27 23:37:08 WEB-APP SYCORAX 0.0.0.0 GET /postinfo.html - 86 test1 192.168.178.105 HTTP/1.1 PostmanRuntime/7.37.0 192.168.247.109:86 401 337 257 0 GET with correct credentials Request requires authentication "/postinfo.html" AuthType is "atBasic" AuthGetPassword for "/postinfo.html" AuthType is "atBasic" [23:38:01 192.168.178.105] authentication result OK with type Basic for /postinfo.html 192.168.178.105 - WEB-APP /postinfo.html POST/PUT Content Size 0 Request Content Type Answer Log - 2024-03-27 23:38:01 WEB-APP SYCORAX 0.0.0.0 GET /postinfo.html - 86 test 192.168.178.105 HTTP/1.1 PostmanRuntime/7.37.0 192.168.247.109:86 200 563 261 0 POST with no credentials Request requires authentication "/postinfo.html" AuthType is "atBasic" POST/PUT Content Size 8 Request Content Type: text/plain Raw Params: Testdata Raw Params: Testdata= Post URL: http://192.168.247.109:86/postinfo.html From IP Address: 192.168.178.105 Answer Log - 2024-03-27 23:39:25 WEB-APP SYCORAX 0.0.0.0 POST /postinfo.html - 86 - 192.168.178.105 HTTP/1.1 PostmanRuntime/7.37.0 192.168.247.109:86 200 563 272 0 POST with wrong credentials Request requires authentication "/postinfo.html" AuthType is "atBasic" AuthGetPassword for "/postinfo.html" AuthType is "atBasic" [23:40:33 192.168.178.105] authentication result failed with type Basic for /postinfo.html POST/PUT Content Size 8 Request Content Type: text/plain Raw Params: Testdata Raw Params: Testdata= Post URL: http://192.168.247.109:86/postinfo.html From IP Address: 192.168.178.105 Answer Log - 2024-03-27 23:40:33 WEB-APP SYCORAX 0.0.0.0 POST /postinfo.html - 86 test1 192.168.178.105 HTTP/1.1 PostmanRuntime/7.37.0 192.168.247.109:86 200 563 311 0 POST with correct credentials Request requires authentication "/postinfo.html" AuthType is "atBasic" AuthGetPassword for "/postinfo.html" AuthType is "atBasic" [23:41:23 192.168.178.105] authentication result OK with type Basic for /postinfo.html [23:41:23 192.168.178.105] 1: HTTP/1.1 POST /postinfo.html POST/PUT Content Size 8 Request Content Type: text/plain Raw Params: Testdata Raw Params: Testdata= Post URL: http://192.168.247.109:86/postinfo.html From IP Address: 192.168.178.105 Answer Log - 2024-03-27 23:41:23 WEB-APP SYCORAX 0.0.0.0 POST /postinfo.html - 86 test 192.168.178.105 HTTP/1.1 PostmanRuntime/7.37.0 192.168.247.109:86 200 563 315 0 As you can see, with GET only with correct credentials .execute gets called. With POST .execute always gets called.
  11. GET is working. POST is where I have trouble. I'm going to try to reproduce it with the sample.
  12. I don't think this works properly in 9.1. On GET with failed Authentication I get a 401 from ICS with the following document (btw, where can I edit/override this?): <HTML><HEAD><TITLE>401 Access Denied</TITLE></HEAD><BODY><H1>401 Access Denied</H1>The requested URL /ping requires authorization.<P></BODY></HTML> On POST I still land in my .Execute-Function. But Client.AuthUserName doesn't get cleared. I would expect, that like with GET I don"t even come into the .Execute-Function. The second best solution would be, if the FAuthenticated was available at the Client. So I could check this. (It took me two years to get back to this, because I was building other endpoints where I do custom jwt processing and had no need for basic auth, in case you wonder)
  13. omnibrain

    Delphi-neon, any thought?

    I use it as main serializer/deserializer for various json based protocols. No complaints so far and it makes programming easier. I did not benchmark it for speed, because we are only talking about a few messages per second. For serializing/deserialiszing table data I use viniciussanchez/dataset-serialize: JSON to DataSet and DataSet to JSON converter for Delphi and Lazarus (FPC) (github.com)
  14. omnibrain

    ICS V9.1 announced

    I never changed anything in there so I had no problem "overwriting" it. I prefer to understand the settings, and change them if needed, so this was alright to me. Starting with 9.0 I started using ICS "directly" instead of via GetIt and I also decided to vendor the used release into my git repo, so I can easily track the changes between the releases, or if I have to patch something.
  15. omnibrain

    ICS V9.1 announced

    Update went (at least I think so) without a hitch. Because the way we deploy our software is a bit special I had to change the SSL-Settings, but I think it is ok, that you chose the new way as default.
×