Skip to content

Instantly share code, notes, and snippets.

View synopse's full-sized avatar
🏠
Working from home

ab synopse

🏠
Working from home
View GitHub Profile
unit auth.api;
{$I mormot.defines.inc}
interface
{
--------------------------------------------------------------------
AUTHENTIQ API client as TAuthClient class
unit ultravisor.api;
{$I mormot.defines.inc}
interface
{
--------------------------------------------------------------------
ULTRAVISOR API client as TUltravisorClient class
unit petstore.api;
{$I mormot.defines.inc}
interface
{
--------------------------------------------------------------------
SWAGGER PETSTORE client as TPetStoreClient class
// Client unit for Swagger Petstore
// - This is a sample server Petstore server. You can find out more about Swagger
// at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/).
// For this sample, you can use the api key `special-key` to test the authorization
// filters.
// - version 1.0.7
// - OpenAPI definition licensed under Apache 2.0 terms
unit petstore.client;
{$I mormot.defines.inc}
{
"swagger": "2.0",
"info": {
"description": "This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters.",
"version": "1.0.7",
"title": "Swagger Petstore",
"termsOfService": "http://swagger.io/terms/",
"contact": {
"email": "apiteam@swagger.io"
},
@synopse
synopse / gist:40f0440ba253e6345141ddf9b8ee6e60
Created August 8, 2024 14:47
THttpClientSocket sample from mORMot end user
function InternalGet(AURL: String; var AOutStatus: Integer; var AErrorType: TURLErrorType; AHeadOnly: boolean): String;
var
URI: TURI;
params: THttpClientSocketWGet;
procedure InitParams;
begin
with params do
begin
@synopse
synopse / gist:d0d1da86c30f55a193ddbbc84f50e544
Created June 25, 2024 10:10
some test code about LDAP
procedure TestLdap;
var usr, dn {, grp}: RawUtf8;
g: TLdapGroup;
u: TLdapUser;
//id: cardinal;
//res: TLdapResult;
grps: TRawUtf8DynArray;
//qw: Qword;
//smtp: TSmtpConnection;
//info: TCldapDomainInfo; servers: TCldapServers;
28/02/2024 14:14:59.695 Enter 1 mormot.soa.client.TServiceFactoryClient(e6e960).InternalInvoke ICalculator.RepeatTextArray("jzeozo30hh12X1fXPDZmW-Jm-Geu97jMDWJWBB7F-2dR7JV6UWslteqvU47jL-8m00qn1NKxJo-TSaAhbMa-2N4xSVF05bsX5FVz1nrhJUGSfhtLmz6h.YR4Oj40ejo.Z1PgCr-2HgDZMcRPMgzz-1FOD--nD.n-dRo11yMViBS22-GsTCU9hPsNrnhW.l3.apk..LZLO209H5.btu2nkx9SizjVMJp75.rR.EolhCKBVkL7leZJOn5WD2vmfTWPE4Ktn-oHoW1SxbjW81WZluYo6OjOK5snP71TOClq3NpsLp73aqd.2xvemPzW9EMgb-12Src4Y1sPiJETrbdGO4vuRn1aF088zMfX.dnOUzEiUTF.b924jdrY06W6yxg.AYaSPPv1YBov2iFOj7rEwJEELC41x7blX2nwvS.XeJEqDqExhczb4ozdC.5MxrEe-9oj-0RZot6e-3R8SWxwsC7Z-nb569.F1hvj9aKxUiiTCGr95YrKbTKPPJTS2wOGlylCwfP1tyALVJlYwopW7O0aGqLph1rposGjthJVX-c6.u..BEzSW4rgj0bd8bC1fF0k-UCPNh4aFnfu5-HM00TG",1000)
28/02/2024 14:14:59.695 Enter 1 mormot.rest.http.client.TRestHttpClientSocket(0102b0f0).InternalUri POST
28/02/2024 14:14:59.695 Trace 1 mormot.rest.http.client.TRestHttpClientSocket(0102b0f0) InternalRequest POST calling THttpClientSocket(eaefd0).Request
28/02/2024 14:
28/02/2024 09:48:30.903 Enter 1 mormot.soa.client.TServiceFactoryClient(e6e960).InternalInvoke ICalculator.RepeatTextArray("Y6ZhDnJjLRdxrZ9CinREXzp3d4Bg1NwCbX1mHuZa559-36S0zgGMPY.y0A.zke.HXLRXgA92htimDv7-ZVOv7.Tl-mgutswhHpag-okPr6E1.y9pD0RndhrA.wdxF1seZKUn-R7DmKlhJ0.xZuAEd5Jj1AYZRV.NnxACgYRZCRjUCY2nd0iglOP6j-4-VGA8b-ukm8lJvK-5iJN4h3GpbgCWk2dMYD9kbbA0qGqsEx9fa10aMpj-nRtpsFBMWVFDsK3P.n2mT-uPNyM.X1HBw33n4MzFj9VKkEeVJJVFFyTY6pJ6wB0cgNJOdd.8e2hfwW7Cmet.mO3JhfGKyyO3.n98AG.mw-.NDAHthACvyejurkvL0R8xre.EUN.SSRJarxGvcH-TVvf-987vqJ5-aXPN-9eWj2HWWaE6-Ha5M-OlVeFZcWC725lgTbEirBC-FMLmYL7JTGJ6S7os1rvM9FB0mEmyXC4JbVOLPPxnG1twX2FTeDEzOE6XuTcan6hXPmpYtX383J.UmFdboPhBT874NZiCy-p8LeBr9Y8AiAwWhC.TnEApyFvtB.psA2g.legZxBjHG2-b1gdcUgO3EBaA",1000)
28/02/2024 09:48:30.903 Enter 1 mormot.rest.http.client.TRestHttpClientSocket(0102b0f0).InternalUri POST
28/02/2024 09:48:30.903 Trace 1 mormot.rest.http.client.TRestHttpClientSocket(0102b0f0) InternalRequest POST calling THttpClientSocket(eaefd0).Request
28/02/2024 09:
@synopse
synopse / gist:cfc83f68db656ae144a8e1a23832cd17
Created July 13, 2023 20:53
mORMot 2.1.5652 Generated with: Delphi 10.3 Rio 64 bit Win compiler
c:\Temp\tempbuild\exe>mormot2tests
mORMot2 Regression Tests
--------------------------
1. Core units
1.1. Core base:
- RecordCopy: 746 assertions passed 459us