Project

General

Profile

Feature #9955

Implement ClientPrincipal:TENANT-ID and ClientPrincipal:TENANT-NAME

Added by Ioana-Cristina Prioteasa about 1 year ago. Updated 9 months ago.

Status:
Test
Priority:
Normal
Target version:
-
Start date:
Due date:
% Done:

100%

billable:
No
vendor_id:
GCD
case_num:
version_reported:
version_resolved:
reviewer:
production:
No
env_name:
topics:

Related issues

Related to Base Language - Feature #9488: implement all built-in OO classes using the open source ADE code from 12.8.4 WIP
Related to Base Language - Feature #9436: add built-in OO classes WIP

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

#4 Updated by Ovidiu Maxiniuc about 1 year ago

I created task branch 9955a and committed the initial implementation.
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);
What is still missing:
  • I think the relation with TenantManager is 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

Review for 9955a
  • In ClientPrincipal.setLoginExpirationTimestamp, at line ts = 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 attributes like: 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.
  • Just a small typo in the javadocs of ClientPrincipal.getTenantId() (all three methods) and ClientPrincipal.getTenantName() (all three methods) + the same functions from ClientPrincipalResource: it should be enabled database instead of enable 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
Thank you, Radu. Related to reported issues:
  • 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 @Override for the ClientPrincipal added methods. Also, do TENANT-ID() and TENANT-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.

Also available in: Atom PDF