You are not logged in.
Pages: 1
Hello AB!
1. Is it possible to use Interface functions on Client CrossPlatform side (CodeTyphon)? For example, on the server side I defined the interface with functions:
IRemoteServerStandard = interface(IInvokable)
['{FFFF753E-F6BB-4F60-B54D-9D3CA3961B87}']
function GetLoginData(username: RawUTF8; password: RawUTF8): RawJSON;
function SetAgencyInfo( id: int64; ipAddress: RawUTF8): boolean;
....
How can I call this function on the client side?
2. Is it possible to encrypt the connection as in Win version?
FClientStandard := TSQLHttpClient.Create(AnsiString(FIniData.WebAddress), AnsiString(IntToStr(FIniData.Port)), FModelStandard);
FClientStandard.Compression := [hcSynShaAes];
SynCrypto.CompressShaAesSetKey(RawByteString(c_CrKey));
Offline
1. Yes, you can, using a generated wrapper unit on FPC - in fact, we used CodeTyphon for our FPC tests.
See http://blog.synopse.info/post/2014/08/1 … FreePascal
2. Our proprietary hcSynShaAes encryption is not part of the SynCrossPlatform units yet.
You would have to use https instead.
Offline
Thanks for information. Generated wrapper works very well.
When you said: "Our proprietary hcSynShaAes encryption is not part of the SynCrossPlatform units yet" are you talking about days, weeks, months or ...?
Offline
It is not planned...
Worth a feature request ticket.
Could make sense definitively with a FPC or Delphi client.
Perhaps less with SMS clients - implementing SynLZ and AES in SMS would be more work, due to missing support of pointers.
Which kind of clients are you using?
Offline
Now I need to make one app in version on Fedora 11 and I have chosen FPC (CodeTypeon or Lazarus). Server and Windows clients use your encryption and I am very pleased with how it all works. It would be best if I could use the existing server.
Offline
You can use the existing server as is.
In fact, hcSynShaAes encryption is optional: both ends have to support it.
If the client does not support it, the server won't ask for hcSynShaAes encryption, and use plain (or deflated) transmission instead.
The same server is able to server unencrypted FPC clients under Linux, and encrypted Delphi clients under Windows, at the same time.
Offline
That's great, but I think that encryption will be also great for FPC and Delphi clients.
Offline
Thanks, I will!
Also, with mORMotClient.pas for FPC made from wrapper I get an error in function GetClient: mormotclient.pas(137,27) Error: Identifier not found "TSQLRestServerAuthenticationSSPI",
and for every service function which return RawJSON data type from server side in mORMotClient.pas I have error: mormotclient.pas(41,76) Error: Identifier not found "dynamic".
Offline
Ticket UUID: 464bed6e1ccdb006e1415737740806e77bbd0aa4
Ticket Title: Encryption in the SynCrossPlatform units
Thank you, again.
Offline
Well, then it's a bug in the FPC Wrapper?
Look, how looks a function:
function GetClient(const aServerAddress, aUserName,aPassword: string;
aServerPort: integer): TSQLRestClientHTTP;
begin
result := TSQLRestClientHTTP.Create(aServerAddress,aServerPort,GetModel,true); // aOwnModel=true
try
if (not result.Connect) or (result.ServerTimeStamp=0) then
raise ERestException.CreateFmt('Impossible to connect to %s:%d server',
[aServerAddress,aServerPort]);
if not result.SetUser(TSQLRestServerAuthenticationSSPI,aUserName,aPassword) then
raise ERestException.CreateFmt('%s:%d server rejected "%s" credentials',
[aServerAddress,aServerPort,aUserName]);
except
result.Free;
raise;
end;
end;
It is minor bug because user can delete that function and connect manual.
What is with the error regarding "dynamic"?
Offline
By default, it will use the first registered scheme available in TSQLRestServer.AuthenticationSchemes[].
So I guess that in your particular case, TSQLRestServerAuthenticationSSPI is the first registered authentication class.
I've modified mORMotWrapper so that it would include the first of the only supported types (i.e. TSQLRestServerAuthenticationDefault / TSQLRestServerAuthenticationNone) for the cross-platform clients.
See http://synopse.info/fossil/info/e6c4ac70d7
Offline
Thanks, I'll check after solve another compilation problem.
For example, on server function definition is:
function GetLoginData(username: RawUTF8; password: RawUTF8): RawJSON;
For FPC the Wrapper makes:
function GetLoginData(const username: string; const password: string): dynamic;
and CodeTypon compiler says:
mormotclient.pas(41,76) Error: Identifier not found "dynamic"
Offline
I've fixed unexpected "dynamic" parameter type for cross-plaform code generation of "RawJSON" original type: replaced by "variant".
See http://synopse.info/fossil/info/d229bce602
In fact, this was a typo: "dynamic" was for C# wrappers, not pascal wrappers.
But RawJSON has not been fully tested for cross-plaform.
Please report here any issue.
Under FPC/CrossPlatformDelphi, the "variant" type will be a TJSONVariant instance - use function JSONVariantDataSafe() if you want to access directly the internal fields, e.g. arrays items.
Offline
Thank you, again!
I'd be glad to help. I have to make FPC client that works with around thirty service functions, and I hope it will be a good test.
Offline
Hello AB!
Do you have idea/plan when the encryption for FPC to be available?
Offline
At which level?
Our proprietary SQLite3 database file encryption works on FPC + Windows/Linux, if you use our statically compiled .o files.
Or are you speaking about transmission encryption for clients?
Offline
Yes, in transmission encryption between client and server.
Something like in Windows version: "FClientStandard.Compression := [hcSynShaAes];"
Ticket UUID: 464bed6e1ccdb006e1415737740806e77bbd0aa4
Offline
Pages: 1