You are not logged in.
Pages: 1
+1 for splitting units and versioning.
+1 for non-visual component (even if it's not a priority)
For old compilers, i think we have to consider only compilers that are most used by Mormot users, so maybe open a survey and ask users, and make a deadline (for example maintain delphi 7 for one year ) so programmers can have a delay to migrate their app.
In theory, companies uses VPN to resolve this, as many companies allow remote work from home to its salaries, they only use vpn to allow secure connection from outside to local server !
if you use predefined routes in mormot, it's normal that calling http://localhost:8085/promet/user/1000262/ will return only the data of the table user, you have to write your own code and use PrepareFillMany to retrieve the full data, see https://synopse.info/files/html/Synopse … ml#TITL_49, or better use interface based service
Current implementation supports only IN params array binding and only for types ODCINUMBERLIST/ODCIVARCHAR2LIST.
Thank you, so it's my inout parameter which wasn't supported ! , thank you for your help.
Hi,
I'm opening this topic, as i'm facing the same problem, passing an array to an oracle stored procedure, i tried bindarray but without success ! i'm getting all the time the error : number or type of argument are invalid ! i tried also with integer array and the same error ! i'm working with oracle 19c but getting the same with 12c
Here is the code i use :
- Oracle procedure
TYPE TArrChar IS VARRAY(2) OF VARCHAR2(50);
PROCEDURE TestPLSQLArray(ATable in out TArrChar) IS
BEGIN
for i in ATable.First .. ATable.Last loop
ATable(i) := '*' || ATable(i) || '*';
end loop;
END;
- Delphi code
var
Props: TSQLDBOracleConnectionProperties;
stmt : ISQLDBStatement;
query : string;
warrayUtf8 : TRawUTF8DynArray;
begin
Props := TSQLDBOracleConnectionProperties.Create('localdatabase','','user','pass');
try
query := 'begin Pkg_TFA.TestPLSQLArray(?); end;';
stmt := Props.NewThreadSafeStatementPrepared(query, false);
try
setlength(warrayUtf8,2);
warrayUtf8[0] := 'toto1';
warrayUtf8[1] := 'toto2';
stmt.BindArray(1, warrayUtf8);
stmt.ExecutePrepared;
finally
stmt := nil;
end;
finally
Props.Free;
end;
Thank you for your help
You're right, the expression is OK, i found the issue, i create the JWTForUnauthenticatedRequest like this :
aRestServer.JWTForUnauthenticatedRequest := TJWTHS256.Create('1234567890',0,[jrcSubject],[],60);
and my token contain only the "sub" claim, so in theory there is no missing claim, but as i specified an expiration time in the constructor (60 minutes), the code behavior (TjwAbstract) add automatically the claim expiration time, that's why the error occur.
Thank for your help and sorry for this.
Thanks for the quick fix, the final solution i implemeted yesteray was exactly what you described, after all it's very easy to check the jwt and authorization in the oneBeforeURI event,
all is working fine now.
There is a way to disable all default method service URI , i mean Root/tablename/ ? i want to use only interface based service, so for now, i used this code in the onBeforeUri event to disable method URI :
if Ctxt.Command<>execSOAByInterface then
Ctxt.Error('Method services are not allowed',[403])
Hi AB,
Finally i updated mormot source as the TSQLRestClientURI.SessionHttpHeader was protected, but in the last source, it's public now, so i createde a small client app to test jwt, and i got an error that claim was missing, but my token contain the claim, after looking at the code of jwt validation, the following condition seem to be inverted !
if claims-JWT.claims<>[] then
JWT.result := jwtMissingClaim else begin
SetString(headpayload,tok,payloadend-1);
JWT.result := jwtValid;
end;
Can you please advise me how to use AllowAllByID with jwt ? i mean as i didn't use session, how can i reject request if the sender is not allowed to access to an interface service ? using OnBeforeURI ?
Regards.
Thank you for your quick answer, client will be ajax, so it ll send token in the authorization header,
I used JWTForUnauthenticatedRequest to validate token, it work fine, but how can I in the server side get the user group from the token, and then call AllowAllByID (in the code of mormot, i saw that the AllowAllByID validate the groupID from the session) !
Hi,
I'm planning to use JWT for authentication in my project, i use interface based service, there is a way to use allowAllByID/DenyAllByID with JWT (without session) ?
Thank a lot for the framework and your help.
Regards.
Thank you for your quick answer ! TDocVariant is a good alternative.
Regards.
Hi,
First of all, thank you a lot for this great framework, really amazing work.
I have a problem compiiling my project under lazarus/fpc targeting linux, my TsqlRecord which include a record property can't compile under fpc, i got an error indicate that record cannot be used as published property !
I tried with the sample project 21 - http performance, i added a record property to the TSqlRecordPeople, and i got the same error.
Maybe some missing RTTI, i tried FPC, new pascal and got the same error!
Any solution ?
type
TTest = record
name : RawUTF8;
end;
TSQLRecordPeople = class(TSQLRecord)
private
fFirstName: RawUTF8;
fLastName: RawUTF8;
fYearOfBirth: integer;
fYearOfDeath: word;
fTest : TTest;
published
property FirstName: RawUTF8 read fFirstName write fFirstName;
property LastName: RawUTF8 read fLastName write fLastName;
property YearOfBirth: integer read fYearOfBirth write fYearOfBirth;
property YearOfDeath: word read fYearOfDeath write fYearOfDeath;
property Test : TTest read fTest write fTEst;
end;
regards.
Pages: 1