Feature #9955
Implement ClientPrincipal:TENANT-ID and ClientPrincipal:TENANT-NAME
100%
Related issues
History
#1 Updated by Ioana-Cristina Prioteasa about 1 year ago
This task is mean for completing the runtime support for ClientPrincipal:TENANT-ID and ClientPrincipal:TENANT-NAME.
Conversion support and STUB runtime support is implemented in 9436b rev. 15885.
This minimal test was used:
define variable client as handle no-undo. define variable tokenValue as character no-undo. define variable domainAccessCode as character no-undo initial "MyAccessCode". create client-principal client. client:user-id = "MyUser". client:domain-name = "MyDomain". client:session-id = "MySessionID". client:seal(domainAccessCode). assign tokenValue = string(client:tenant-id). message "Tenant ID:" tokenValue view-as alert-box. assign tokenValue = client:tenant-name. message "Tenant Name:" tokenValue view-as alert-box. delete object client no-error.
#2 Updated by Ioana-Cristina Prioteasa about 1 year ago
- Related to Feature #9488: implement all built-in OO classes using the open source ADE code from 12.8.4 added
#3 Updated by Ioana-Cristina Prioteasa about 1 year ago
- Related to Feature #9436: add built-in OO classes added
#4 Updated by Ovidiu Maxiniuc about 1 year ago
The initial commit contains:
- full support for conversion of the methods (all signatures);
- core runtime implementation for normal usage (when CP is populated with data or not yet);
- I think the relation with
TenantManageris not optimal and might be a bit adjusted; - still missing the gap information;
- multiple databases not supported.
I expect to commit the week a new revision to address the above issues. Since the implementation it is not very intrusive, minimal testing is necessary.
#5 Updated by Ovidiu Maxiniuc about 1 year ago
- Status changed from New to WIP
Committed revision 15907 into 9955a with improved support. All above issues were addressed.
The only remaining issue is the hard coupling of ClientPrincipal to ConnectionManager and TenantManager. I have not found an elegant solution to avoid that.
#6 Updated by Ovidiu Maxiniuc about 1 year ago
- % Done changed from 0 to 100
- Status changed from WIP to Review
- reviewer Radu Apetrii added
Please review.
#7 Updated by Radu Apetrii about 1 year ago
- In
ClientPrincipal.setLoginExpirationTimestamp, at linets = new datetimetz(); // TODO: what happens with this variable?I think there are three options:- The date is set to default and then it should be placed in the
attributeslike:attributes.put(AttrInfo.LOGIN_EXPIRATION_TIMESTAMP, Optional.of(ts)); - Or, after the date is set to default, maybe a log or exception should take place.
- Or, the date should not be defaulted to a certain value. In other words, remove the assignment.
- This depends on what 4GL does: does it change the value of the variable? Does it throw an error? Does it work, but the value is changed?. I'm not sure about how trivial is to create such an example, but it might be worth investigating.
- The date is set to default and then it should be placed in the
- Just a small typo in the javadocs of
ClientPrincipal.getTenantId()(all three methods) andClientPrincipal.getTenantName()(all three methods) + the same functions fromClientPrincipalResource: it should beenabled databaseinstead ofenable database. - This one is just me being really picky: the tenant name keyword is defined as
kw_tenname. Can we have it as the other keywords, with underscore between words (i.e.kw_ten_name)?
Functionally, I see nothing wrong in the code.
#8 Updated by Ovidiu Maxiniuc about 1 year ago
- Status changed from Review to Internal Test
- I did a quick test and in that case the timestamp is silently ignored (no errors issued);
- I fixed all typos multiplied by CTRL+V;
- the 3rd is not an issue. The IDs were not created now. They honour the GCD convention that the keywords should be max 11 characters long. Indeed, we could have pick
kw_ten_name. Changing it now will cause issues if FWD is not cleanly built, so I vote for keeping it like this.
Committed revision 15932.
#9 Updated by Ovidiu Maxiniuc about 1 year ago
Branch 9955a has only additive changes (added conversion support for those two methods, runtime support for them and updated gap information). No changes are required in the configuration or FWD environment.
The branch was tested for runtime, but not for conversion, except hotel_gui and for my isolated testcase. I asked Eugenie for help with conversion of a large customer application. I previously executed the unit-tests of same app and the harness smoke-test another one. They finished all with success.
#10 Updated by Ovidiu Maxiniuc about 1 year ago
Eugenie just confirmed that the conversion test was successful, as expected: the generated code is not changed from the trunk version.
#11 Updated by Constantin Asofiei about 1 year ago
Ovidiu, you are missing @Override for the ClientPrincipal added methods. Also, do TENANT-ID() and TENANT-NAME() builtin functions still convert properly?
#12 Updated by Ovidiu Maxiniuc about 1 year ago
Constantin Asofiei wrote:
Ovidiu, you are missing
@Overridefor the ClientPrincipal added methods. Also, doTENANT-ID()andTENANT-NAME()builtin functions still convert properly?
Thank you for noticing that. The functions were already implemented in DatabaseManager as static methods.
I will do a rebase and redo the tests. Also I will ask Eugenie to do a conversion test, again, since there were some conflicts when I did the last rebase and some execution paths might have been affected.
#13 Updated by Constantin Asofiei 10 months ago
Ovidiu - please rebase now.
#14 Updated by Ovidiu Maxiniuc 10 months ago
Done.
Pushed up to revision 16215.
#15 Updated by Constantin Asofiei 9 months ago
- Status changed from Internal Test to Merge Pending
This can be merged after 10542a.
#16 Updated by Ovidiu Maxiniuc 9 months ago
- Status changed from Merge Pending to Test
Branch 9955a was merged to trunk rev. 16239 and archived.