Skip to content

Conversation

@jinmeiliao
Copy link
Member

GEODE-9453: clean up the old subject when new subject is authenticated.

  • authorize the message before dispatching the message to the client
  • add a new message type to be sent to the client for re-authentiate
  • message dispatcher will wait for a certain time for client to reauthenticate before terminating the client
  • when re-authenticate, the new subject will re-use the original uniqueId. Credentials will be sent to the user along with the old uniqueId if exists.
  • old subject will be cleaned out when new subject re-authenticate back.
  • re-auth multi-user mode in event dispatching is not supported (yet).

I will continue to write unit tests for those refactored classes

Copy link

@agingade agingade left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is changing the messaging between client/server; it will be nice to have client backward compatibility related unit tests.

// can't differentiate which user this message is intended to. so throw exception for now
// one possible solution is re-authenticate all users in this client
if (qManager.getPool().getMultiuserAuthentication()) {
throw new UnsupportedOperationException(
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Throwing this only closes/stops the CacheClientUpdater thread. Is this the expectation here? If the server-to-client connection needs to be closed, it should disconnect all the connections from that server...

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The test shows the connection gets closed, may need to investigate what eventually triggered the close event.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is getting processed by CacheClientUpdater thread...As you can see from the thread name, this thread is used only for local cache operation; its not used to do client-to-server operation. I am worried about the exception it could see by doing server side operation....And its impact on overall closing CCU thread and re-creating it. In the past we had several issues with older and new CCU threads running simultaneously. Without sufficient tests its hard to see its impact. It will be nice to process this in separate thread than the CCU thread.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't put this "re-authenticate" in my initial implementation because

  1. if we get this message from the server, no other message will be delivered to this client until we re-authenticate back successfully.
  2. even if we put it in a separate thread, we will need to see if any exception happens on that thread and if so, we need to close the thread anyway.

I haven't seen much benefit of putting this in a different thread yet, but I don't see much harm in putting in a different thread either. Since it can go either way, I much rather wait for this PR to settle before I put in more "improvement".

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jinmeiliao my concerns are:
Point 1:
Yes that is true.
Point 2:
If there is exception, then thread can handle according to the exception. And if it needs to close the connection, it can. But what I am trying to convey here is the CacheClientUpdater thread is not meant to be used for server cache operation. And currently its handling the exception based on the expectation of server to client communication. I am not seeing any tests/code changes in CacheClientUpdater exception handling to handle the exception from client to server communication which this PR is introducing.

wait_for_re_auth_start_time = -1;
} catch (NotAuthorizedException notAuthorized) {
// behave as if the message is dispatched, remove from the queue
logger.info("skip delivering message: " + clientMessage, notAuthorized);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Info level may cause log to be filled with this message incase of user auth changes...

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this exception should not happen in the first place, if it does, an info level message would make it clear what happened since this exception is not bubbled up to the caller.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But if it does happen (i.e. the info log message) do we want the server to keep logging it for every message it attempts to send to that unauthenticated client? Will the server close this dispatcher in this case or retry reauth? If not it seems like we could log once (maybe it should be a warning) for that client.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Jinmei, Darrel has additional comment on this...I am changing the state to unresolved.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Notice this is NotAuthorizedException (not AuthenticationExpiredException), when this exception happens, we only log it, drop it from the queue and continue on to the next message (that's what the old authorization model does to the un-authorized messages), we don't do retrys for any "un-authorized" messages.

Copy link
Contributor

@kirklund kirklund left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for writing AuthenticateUserOpTest!

We should really unit test the PR changes in the following classes. No need to test the entire class, just the spots that are changed in the PR. I would be happy to pair or help in any way with unit testing these. I think I even created some initial unit tests for a couple of these:

  • CacheClientProxy
  • ClientUserAuths
  • MessageDispatcher
  • PutUserCredentials
  • ServerConnection

@jinmeiliao jinmeiliao force-pushed the eventDispatch branch 2 times, most recently from 8ed17da to 85e4408 Compare September 8, 2021 23:37
@jinmeiliao jinmeiliao marked this pull request as ready for review September 9, 2021 21:52
wait_for_re_auth_start_time = -1;
} catch (NotAuthorizedException notAuthorized) {
// behave as if the message is dispatched, remove from the queue
logger.info("skip delivering message: " + clientMessage, notAuthorized);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But if it does happen (i.e. the info log message) do we want the server to keep logging it for every message it attempts to send to that unauthenticated client? Will the server close this dispatcher in this case or retry reauth? If not it seems like we could log once (maybe it should be a warning) for that client.

@boglesby
Copy link
Contributor

I see the same basic exception in the CQ case, just a slightly different stack from the server:

[warn 2021/09/15 12:55:30.583 PDT client-cq <queueTimer-pool1> tid=0x1f] QueueManagerImpl failed to recover interest to server boglesbymac.local:59654
org.apache.geode.cache.client.ServerOperationException: remote server on boglesbymac(client-cq:11999:loner):59663:660c07eb:client-cq: org.apache.geode.security.AuthenticationRequiredException: Failed to find the authenticated user.
	at org.apache.geode.cache.client.internal.OpExecutorImpl.handleException(OpExecutorImpl.java:559)
	at org.apache.geode.cache.client.internal.OpExecutorImpl.handleException(OpExecutorImpl.java:623)
	at org.apache.geode.cache.client.internal.OpExecutorImpl.handleException(OpExecutorImpl.java:512)
	at org.apache.geode.cache.client.internal.OpExecutorImpl.executeOn(OpExecutorImpl.java:475)
	at org.apache.geode.cache.client.internal.OpExecutorImpl.executeOn(OpExecutorImpl.java:486)
	at org.apache.geode.cache.client.internal.PoolImpl.executeOn(PoolImpl.java:857)
	at org.apache.geode.cache.query.cq.internal.ops.CreateCQOp.executeOn(CreateCQOp.java:68)
	at org.apache.geode.cache.query.cq.internal.ops.ServerCQProxyImpl.createOn(ServerCQProxyImpl.java:76)
	at org.apache.geode.cache.query.cq.internal.ClientCQImpl.createOn(ClientCQImpl.java:574)
	at org.apache.geode.cache.client.internal.QueueManagerImpl.recoverCqs(QueueManagerImpl.java:1121)
	at org.apache.geode.cache.client.internal.QueueManagerImpl.recoverAllInterestTypes(QueueManagerImpl.java:1239)
	at org.apache.geode.cache.client.internal.QueueManagerImpl.recoverInterest(QueueManagerImpl.java:1069)
	at org.apache.geode.cache.client.internal.QueueManagerImpl.recoverPrimary(QueueManagerImpl.java:928)
	at org.apache.geode.cache.client.internal.QueueManagerImpl.access$600(QueueManagerImpl.java:77)
	at org.apache.geode.cache.client.internal.QueueManagerImpl$RedundancySatisfierTask.run2(QueueManagerImpl.java:1448)
	at org.apache.geode.cache.client.internal.PoolImpl$PoolTask.run(PoolImpl.java:1336)
Caused by: org.apache.geode.security.AuthenticationRequiredException: Failed to find the authenticated user.
	at org.apache.geode.internal.security.IntegratedSecurityService.getSubject(IntegratedSecurityService.java:123)
	at org.apache.geode.internal.security.IntegratedSecurityService.authorize(IntegratedSecurityService.java:249)
	at org.apache.geode.internal.security.IntegratedSecurityService.authorize(IntegratedSecurityService.java:244)
	at org.apache.geode.internal.security.IntegratedSecurityService.authorize(IntegratedSecurityService.java:230)
	at org.apache.geode.cache.query.cq.internal.command.ExecuteCQ61.lambda$cmdExecute$0(ExecuteCQ61.java:138)
	at java.lang.Iterable.forEach(Iterable.java:75)
	at java.util.Collections$UnmodifiableCollection.forEach(Collections.java:1080)
	at org.apache.geode.cache.query.cq.internal.command.ExecuteCQ61.cmdExecute(ExecuteCQ61.java:137)
	at org.apache.geode.internal.cache.tier.sockets.BaseCommand.execute(BaseCommand.java:184)

The server is processing the ExecuteCQ61. It looks like it binds the Subject in bindSubject, but later on it fails to find it.

Here is the exception on the server:

[warn 2021/09/15 12:55:30.563 PDT server1 <ServerConnection on port 59654 Thread 5> tid=0x4a] XXX ServerConnection.doNormalMessage about to bindSubject command=ExecuteCQ61

[warn 2021/09/15 12:55:30.564 PDT server1 <ServerConnection on port 59654 Thread 5> tid=0x4a] XXX ServerConnection.bindSubject command=org.apache.geode.cache.query.cq.internal.command.ExecuteCQ61; uniqueId=8287195257237307674; subject=org.apache.shiro.subject.support.DelegatingSubject@492e352e

[warn 2021/09/15 12:55:30.564 PDT server1 <ServerConnection on port 59654 Thread 5> tid=0x4a] XXX ServerConnection.doNormalMessage done bindSubject command=ExecuteCQ61

[warn 2021/09/15 12:55:30.565 PDT server1 <ServerConnection on port 59654 Thread 5> tid=0x4a] XXX ExecuteCQ61.cmdExecute caught:
org.apache.geode.security.AuthenticationRequiredException: Failed to find the authenticated user.
	at org.apache.geode.internal.security.IntegratedSecurityService.getSubject(IntegratedSecurityService.java:123)
	at org.apache.geode.internal.security.IntegratedSecurityService.authorize(IntegratedSecurityService.java:249)
	at org.apache.geode.internal.security.IntegratedSecurityService.authorize(IntegratedSecurityService.java:244)
	at org.apache.geode.internal.security.IntegratedSecurityService.authorize(IntegratedSecurityService.java:230)
	at org.apache.geode.cache.query.cq.internal.command.ExecuteCQ61.lambda$cmdExecute$0(ExecuteCQ61.java:138)
	at java.lang.Iterable.forEach(Iterable.java:75)
	at java.util.Collections$UnmodifiableCollection.forEach(Collections.java:1080)
	at org.apache.geode.cache.query.cq.internal.command.ExecuteCQ61.cmdExecute(ExecuteCQ61.java:137)
	at org.apache.geode.internal.cache.tier.sockets.BaseCommand.execute(BaseCommand.java:184)
	at org.apache.geode.internal.cache.tier.sockets.ServerConnection.doNormalMessage(ServerConnection.java:883)
	at org.apache.geode.internal.cache.tier.sockets.ServerConnection.doOneMessage(ServerConnection.java:1072)
	at org.apache.geode.internal.cache.tier.sockets.ServerConnection.run(ServerConnection.java:1341)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
	at org.apache.geode.internal.cache.tier.sockets.AcceptorImpl.lambda$initializeServerConnectionThreadPool$3(AcceptorImpl.java:690)
	at org.apache.geode.logging.internal.executors.LoggingThreadFactory.lambda$newThread$0(LoggingThreadFactory.java:120)
	at java.lang.Thread.run(Thread.java:745)

I do see that it depends on where I put the sleep.

If I put it in CacheClientUpdater handleAuthenticate on the client before sending the AuthenticateUserOp, the test works fine.

If I put it in PutUserCredentials cmdExecute on the server before the command is processed, the test fails.

…up the old subject when new subject is authenticated.

* authorize the message before dispatching the message to the client
* add a new message type to be sent to the client for re-authentiate
* message dispatcher will wait for a certain time for client to reauthenticate before terminating the client
* when re-authenticate, the new subject will re-use the original uniqueId. Credentials will be sent to the user along with the old uniqueId if exists.
* old subject will be cleaned out when new subject re-authenticate back.
* re-auth multi-user mode in event dispatching is not supported (yet).
@jinmeiliao
Copy link
Member Author

the acceptance test failure happens on the develop pipeline as well.

@jinmeiliao
Copy link
Member Author

@Bill can you re-review and dismiss your "request to change"? or any more comments on this PR? Thanks!

Copy link
Contributor

@Bill Bill left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved.

@jinmeiliao jinmeiliao merged commit b07f320 into apache:develop Sep 20, 2021
@jinmeiliao jinmeiliao deleted the eventDispatch branch September 20, 2021 19:18
nonbinaryprogrammer added a commit to nonbinaryprogrammer/geode that referenced this pull request Oct 4, 2021
jinmeiliao added a commit to jinmeiliao/geode that referenced this pull request Mar 23, 2022
… (squashed)

GEODE-10042: do not make ClientUserAuths null when we are not unregister client yet. (apache#7357)

* make cleanUserAuths synchronized to avoid NPE
* This also pass down client termination reason when we clean up client threads.
* since we introduced a lock object for clientUserAuths, revert some  old code to not to catch NPE but use the lock
* synchronize all clientUserAuths updates.

GEODE-9985: add region redundancy to avoid data loss. (apache#7308)

GEODE-9900: ensure AuthenticationExpiredException handling (apache#7207)

* GEODE-9900: ensure AuthenticationExpiredException handling

- in CloseCQ command
- Add unit tests to confirm proper message is sent

GEODE-9875: client operation should not send in invalid userId. (apache#7173)

GEODE-9867: do not process the message if the connection is terminated (apache#7158)

GEODE-9803: Fix the flaky "Failed To find authenticated user" problem (apache#7149)

* GEODE-9803: Fix the flaky "Failed To find authenticated user" problem

* Only to update subject on the ClientCacheProxy if it's waiting for re-auth
* logout the subject in one place when we close the dispatcher
* reset the timer when we stopped waiting

GEODE-9820: stopCQ should handle general exception same way as ExecuteCQ61 (apache#7122)

GEODE-9803: turning on security debug log in the test and add more debug logging (apache#7117)

GEODE-9746: do not logout old subjects immediately when we get a new subject for the same uniqueId (apache#7063)

* add more logging for future debugging
* minor bug fix in CacheClientProxy

GEODE-9792: synchronize multi-user authentication on different threads (apache#7088)

GEODE-9792: avoid sending in multiple authentication request on the same connection by different threads. (apache#7067)

GEODE-9723: test transactions with auth expiration (apache#7012)

Add tests to confirm that client transactions are not disrupted when authentication expires and automatic re-authentication takes place.

    complete transaction with commit
    transaction rollback
    suspended and resumed transaction with commit
    failed re-authentication with commit and rollback on partial transaction
    add test to include PARTITION region behavior

GEODE-9674: For durable client, when client reconnects, server should retrieve the message from the queue, not continue to try to deliver the last un-delivered message.

GEODE-9749: ignore the test case that shows GEODE-9704. (apache#7015)

GEODE-9534, GEODE-9540: add more tests for peer communication and bulk operations (apache#6985)

* add more tests for durable clients

GEODE-9674: fix durable client message loss issue in tests. (apache#6947)

* for caching_proxy region, count the events received instread of the region size
* do not try to dispatch residual messages when exception occurred.
* add durable client flag when register interest

GEODE-9534: get rid of some test warnings (apache#6945)

GEODE-9663: refactor authenticateIfRequired (apache#6948)

GEODE-9663: throw and handle AuthenticationExpiredException at login time (apache#6927)

* GEODE-9663: throw and handle AuthenticationExpiredException at login time

GEODE-9658: refactor test AuthInit to not use static field for credentials. (apache#6922)

GEODE-9570: make sure re-authentication works with registered interests (apache#6885)

GEODE-9459: testing clients with WAN connected cluster (apache#6901)

GEODE-9457: re-authentication in event dispatcher (apache#6835)

* authorize the message before dispatching the message to the client
* add a new message type to be sent to the client for re-authentiate
* message dispatcher will wait for a certain time for client to reauthenticate before terminating the client
* when re-authenticate, the new subject will re-use the original uniqueId. Credentials will be sent to the user along with the old uniqueId if exists.
* old subject will be cleaned out when new subject re-authenticate back.
* re-auth multi-user mode in event dispatching is not supported (yet).

GEODE-9458: Enhance function execution testing auth expiry (apache#6865)

* GEODE-9458: Enhance function execution testing auth expiry

GEODE-9521: add more multi-server test scenario (apache#6860)

* remove the static methods in ExpirableSecurityManager

GEODE-9586: modify 1.15.0's client server protocol version (apache#6846)

GEODE-9458: function execution with expiring authentication (apache#6789)

* GEODE-9456, GEODE-9452: Authentication Expiration (apache#6721)

* Add tests and throw AuthenticationExpiredException
Co-authored-by: Joris Melchior <joris.melchior@gmail.com>

* GEODE-9460: Add testing for mutli-user scenarios (apache#6755)

Co-Authored-By Jinmei Liao <jiliao@vmware.com>

* review update

* revert accidental change

* GEODE-9458: function execution with expiring authentication

* Changes based on review

* Changes based on review, parameterization

Co-authored-by: Jinmei Liao <jiliao@pivotal.io>

GEODE-9451: On demand authentication expiration and re-authentication (apache#6787)

* GEODE-9456, GEODE-9452: Authentication Expiration (apache#6721)
* Add tests and throw AuthenticationExpiredException
* GEODE-9460: Add testing for mutli-user scenarios (apache#6755)

Co-authored-by: Joris Melchior <joris.melchior@gmail.com>
jinmeiliao added a commit to jinmeiliao/geode that referenced this pull request Mar 23, 2022
… (squashed)

GEODE-10042: do not make ClientUserAuths null when we are not unregister client yet. (apache#7357)

* make cleanUserAuths synchronized to avoid NPE
* This also pass down client termination reason when we clean up client threads.
* since we introduced a lock object for clientUserAuths, revert some  old code to not to catch NPE but use the lock
* synchronize all clientUserAuths updates.

GEODE-9985: add region redundancy to avoid data loss. (apache#7308)

GEODE-9900: ensure AuthenticationExpiredException handling (apache#7207)

* GEODE-9900: ensure AuthenticationExpiredException handling

- in CloseCQ command
- Add unit tests to confirm proper message is sent

GEODE-9875: client operation should not send in invalid userId. (apache#7173)

GEODE-9867: do not process the message if the connection is terminated (apache#7158)

GEODE-9803: Fix the flaky "Failed To find authenticated user" problem (apache#7149)

* GEODE-9803: Fix the flaky "Failed To find authenticated user" problem

* Only to update subject on the ClientCacheProxy if it's waiting for re-auth
* logout the subject in one place when we close the dispatcher
* reset the timer when we stopped waiting

GEODE-9820: stopCQ should handle general exception same way as ExecuteCQ61 (apache#7122)

GEODE-9803: turning on security debug log in the test and add more debug logging (apache#7117)

GEODE-9746: do not logout old subjects immediately when we get a new subject for the same uniqueId (apache#7063)

* add more logging for future debugging
* minor bug fix in CacheClientProxy

GEODE-9792: synchronize multi-user authentication on different threads (apache#7088)

GEODE-9792: avoid sending in multiple authentication request on the same connection by different threads. (apache#7067)

GEODE-9723: test transactions with auth expiration (apache#7012)

Add tests to confirm that client transactions are not disrupted when authentication expires and automatic re-authentication takes place.

    complete transaction with commit
    transaction rollback
    suspended and resumed transaction with commit
    failed re-authentication with commit and rollback on partial transaction
    add test to include PARTITION region behavior

GEODE-9674: For durable client, when client reconnects, server should retrieve the message from the queue, not continue to try to deliver the last un-delivered message.

GEODE-9749: ignore the test case that shows GEODE-9704. (apache#7015)

GEODE-9534, GEODE-9540: add more tests for peer communication and bulk operations (apache#6985)

* add more tests for durable clients

GEODE-9674: fix durable client message loss issue in tests. (apache#6947)

* for caching_proxy region, count the events received instread of the region size
* do not try to dispatch residual messages when exception occurred.
* add durable client flag when register interest

GEODE-9534: get rid of some test warnings (apache#6945)

GEODE-9663: refactor authenticateIfRequired (apache#6948)

GEODE-9663: throw and handle AuthenticationExpiredException at login time (apache#6927)

* GEODE-9663: throw and handle AuthenticationExpiredException at login time

GEODE-9658: refactor test AuthInit to not use static field for credentials. (apache#6922)

GEODE-9570: make sure re-authentication works with registered interests (apache#6885)

GEODE-9459: testing clients with WAN connected cluster (apache#6901)

GEODE-9457: re-authentication in event dispatcher (apache#6835)

* authorize the message before dispatching the message to the client
* add a new message type to be sent to the client for re-authentiate
* message dispatcher will wait for a certain time for client to reauthenticate before terminating the client
* when re-authenticate, the new subject will re-use the original uniqueId. Credentials will be sent to the user along with the old uniqueId if exists.
* old subject will be cleaned out when new subject re-authenticate back.
* re-auth multi-user mode in event dispatching is not supported (yet).

GEODE-9458: Enhance function execution testing auth expiry (apache#6865)

* GEODE-9458: Enhance function execution testing auth expiry

GEODE-9521: add more multi-server test scenario (apache#6860)

* remove the static methods in ExpirableSecurityManager

GEODE-9586: modify 1.15.0's client server protocol version (apache#6846)

GEODE-9458: function execution with expiring authentication (apache#6789)

* GEODE-9456, GEODE-9452: Authentication Expiration (apache#6721)

* Add tests and throw AuthenticationExpiredException
Co-authored-by: Joris Melchior <joris.melchior@gmail.com>

* GEODE-9460: Add testing for mutli-user scenarios (apache#6755)

Co-Authored-By Jinmei Liao <jiliao@vmware.com>

* review update

* revert accidental change

* GEODE-9458: function execution with expiring authentication

* Changes based on review

* Changes based on review, parameterization

Co-authored-by: Jinmei Liao <jiliao@pivotal.io>

GEODE-9451: On demand authentication expiration and re-authentication (apache#6787)

* GEODE-9456, GEODE-9452: Authentication Expiration (apache#6721)
* Add tests and throw AuthenticationExpiredException
* GEODE-9460: Add testing for mutli-user scenarios (apache#6755)

Co-authored-by: Joris Melchior <joris.melchior@gmail.com>
jmelchio pushed a commit to jmelchio/geode that referenced this pull request Mar 23, 2022
…apache#6787)

* GEODE-9456, GEODE-9452: Authentication Expiration (apache#6721)
* Add tests and throw AuthenticationExpiredException
* GEODE-9460: Add testing for mutli-user scenarios (apache#6755)

Co-authored-by: Joris Melchior <joris.melchior@gmail.com>

GEODE-9458: function execution with expiring authentication (apache#6789)

* GEODE-9456, GEODE-9452: Authentication Expiration (apache#6721)

* Add tests and throw AuthenticationExpiredException
Co-authored-by: Joris Melchior <joris.melchior@gmail.com>

* GEODE-9460: Add testing for mutli-user scenarios (apache#6755)

Co-Authored-By Jinmei Liao <jiliao@vmware.com>

* review update

* revert accidental change

* GEODE-9458: function execution with expiring authentication

* Changes based on review

* Changes based on review, parameterization

Co-authored-by: Jinmei Liao <jiliao@pivotal.io>

GEODE-9586: modify 1.15.0's client server protocol version (apache#6846)

GEODE-9521: add more multi-server test scenario (apache#6860)

* remove the static methods in ExpirableSecurityManager

GEODE-9458: Enhance function execution testing auth expiry (apache#6865)

* GEODE-9458: Enhance function execution testing auth expiry

GEODE-9457: re-authentication in event dispatcher (apache#6835)

* authorize the message before dispatching the message to the client
* add a new message type to be sent to the client for re-authentiate
* message dispatcher will wait for a certain time for client to reauthenticate before terminating the client
* when re-authenticate, the new subject will re-use the original uniqueId. Credentials will be sent to the user along with the old uniqueId if exists.
* old subject will be cleaned out when new subject re-authenticate back.
* re-auth multi-user mode in event dispatching is not supported (yet).

GEODE-9459: testing clients with WAN connected cluster (apache#6901)

GEODE-9570: make sure re-authentication works with registered interests (apache#6885)

GEODE-9658: refactor test AuthInit to not use static field for credentials. (apache#6922)

GEODE-9663: throw and handle AuthenticationExpiredException at login time (apache#6927)

* GEODE-9663: throw and handle AuthenticationExpiredException at login time

GEODE-9663: refactor authenticateIfRequired (apache#6948)

GEODE-9534: get rid of some test warnings (apache#6945)

GEODE-9674: fix durable client message loss issue in tests. (apache#6947)

* for caching_proxy region, count the events received instread of the region size
* do not try to dispatch residual messages when exception occurred.
* add durable client flag when register interest

GEODE-9534, GEODE-9540: add more tests for peer communication and bulk operations (apache#6985)

* add more tests for durable clients

GEODE-9749: ignore the test case that shows GEODE-9704. (apache#7015)

GEODE-9674: For durable client, when client reconnects, server should retrieve the message from the queue, not continue to try to deliver the last un-delivered message.

GEODE-9723: test transactions with auth expiration (apache#7012)

Add tests to confirm that client transactions are not disrupted when authentication expires and automatic re-authentication takes place.

    complete transaction with commit
    transaction rollback
    suspended and resumed transaction with commit
    failed re-authentication with commit and rollback on partial transaction
    add test to include PARTITION region behavior

GEODE-9792: avoid sending in multiple authentication request on the same connection by different threads. (apache#7067)

GEODE-9792: synchronize multi-user authentication on different threads (apache#7088)

GEODE-9746: do not logout old subjects immediately when we get a new subject for the same uniqueId (apache#7063)

* add more logging for future debugging
* minor bug fix in CacheClientProxy

GEODE-9803: turning on security debug log in the test and add more debug logging (apache#7117)

GEODE-9820: stopCQ should handle general exception same way as ExecuteCQ61 (apache#7122)

GEODE-9803: Fix the flaky "Failed To find authenticated user" problem (apache#7149)

* GEODE-9803: Fix the flaky "Failed To find authenticated user" problem

* Only to update subject on the ClientCacheProxy if it's waiting for re-auth
* logout the subject in one place when we close the dispatcher
* reset the timer when we stopped waiting

GEODE-9867: do not process the message if the connection is terminated (apache#7158)

GEODE-9875: client operation should not send in invalid userId. (apache#7173)

GEODE-9900: ensure AuthenticationExpiredException handling (apache#7207)

* GEODE-9900: ensure AuthenticationExpiredException handling

- in CloseCQ command
- Add unit tests to confirm proper message is sent

GEODE-9985: add region redundancy to avoid data loss. (apache#7308)

GEODE-10042: do not make ClientUserAuths null when we are not unregister client yet. (apache#7357)

* make cleanUserAuths synchronized to avoid NPE
* This also pass down client termination reason when we clean up client threads.
* since we introduced a lock object for clientUserAuths, revert some  old code to not to catch NPE but use the lock
* synchronize all clientUserAuths updates.

Fix some compile errors

Fix more compile errors
jinmeiliao added a commit to jinmeiliao/geode that referenced this pull request Mar 24, 2022
… (squashed)

GEODE-10042: do not make ClientUserAuths null when we are not unregister client yet. (apache#7357)

* make cleanUserAuths synchronized to avoid NPE
* This also pass down client termination reason when we clean up client threads.
* since we introduced a lock object for clientUserAuths, revert some  old code to not to catch NPE but use the lock
* synchronize all clientUserAuths updates.

GEODE-9985: add region redundancy to avoid data loss. (apache#7308)

GEODE-9900: ensure AuthenticationExpiredException handling (apache#7207)

* GEODE-9900: ensure AuthenticationExpiredException handling

- in CloseCQ command
- Add unit tests to confirm proper message is sent

GEODE-9875: client operation should not send in invalid userId. (apache#7173)

GEODE-9867: do not process the message if the connection is terminated (apache#7158)

GEODE-9803: Fix the flaky "Failed To find authenticated user" problem (apache#7149)

* GEODE-9803: Fix the flaky "Failed To find authenticated user" problem

* Only to update subject on the ClientCacheProxy if it's waiting for re-auth
* logout the subject in one place when we close the dispatcher
* reset the timer when we stopped waiting

GEODE-9820: stopCQ should handle general exception same way as ExecuteCQ61 (apache#7122)

GEODE-9803: turning on security debug log in the test and add more debug logging (apache#7117)

GEODE-9746: do not logout old subjects immediately when we get a new subject for the same uniqueId (apache#7063)

* add more logging for future debugging
* minor bug fix in CacheClientProxy

GEODE-9792: synchronize multi-user authentication on different threads (apache#7088)

GEODE-9792: avoid sending in multiple authentication request on the same connection by different threads. (apache#7067)

GEODE-9723: test transactions with auth expiration (apache#7012)

Add tests to confirm that client transactions are not disrupted when authentication expires and automatic re-authentication takes place.

    complete transaction with commit
    transaction rollback
    suspended and resumed transaction with commit
    failed re-authentication with commit and rollback on partial transaction
    add test to include PARTITION region behavior

GEODE-9674: For durable client, when client reconnects, server should retrieve the message from the queue, not continue to try to deliver the last un-delivered message.

GEODE-9749: ignore the test case that shows GEODE-9704. (apache#7015)

GEODE-9534, GEODE-9540: add more tests for peer communication and bulk operations (apache#6985)

* add more tests for durable clients

GEODE-9674: fix durable client message loss issue in tests. (apache#6947)

* for caching_proxy region, count the events received instread of the region size
* do not try to dispatch residual messages when exception occurred.
* add durable client flag when register interest

GEODE-9534: get rid of some test warnings (apache#6945)

GEODE-9663: refactor authenticateIfRequired (apache#6948)

GEODE-9663: throw and handle AuthenticationExpiredException at login time (apache#6927)

* GEODE-9663: throw and handle AuthenticationExpiredException at login time

GEODE-9658: refactor test AuthInit to not use static field for credentials. (apache#6922)

GEODE-9570: make sure re-authentication works with registered interests (apache#6885)

GEODE-9459: testing clients with WAN connected cluster (apache#6901)

GEODE-9457: re-authentication in event dispatcher (apache#6835)

* authorize the message before dispatching the message to the client
* add a new message type to be sent to the client for re-authentiate
* message dispatcher will wait for a certain time for client to reauthenticate before terminating the client
* when re-authenticate, the new subject will re-use the original uniqueId. Credentials will be sent to the user along with the old uniqueId if exists.
* old subject will be cleaned out when new subject re-authenticate back.
* re-auth multi-user mode in event dispatching is not supported (yet).

GEODE-9458: Enhance function execution testing auth expiry (apache#6865)

* GEODE-9458: Enhance function execution testing auth expiry

GEODE-9521: add more multi-server test scenario (apache#6860)

* remove the static methods in ExpirableSecurityManager

GEODE-9586: modify 1.15.0's client server protocol version (apache#6846)

GEODE-9458: function execution with expiring authentication (apache#6789)

* GEODE-9456, GEODE-9452: Authentication Expiration (apache#6721)

* Add tests and throw AuthenticationExpiredException
Co-authored-by: Joris Melchior <joris.melchior@gmail.com>

* GEODE-9460: Add testing for mutli-user scenarios (apache#6755)

Co-Authored-By Jinmei Liao <jiliao@vmware.com>

* review update

* revert accidental change

* GEODE-9458: function execution with expiring authentication

* Changes based on review

* Changes based on review, parameterization

Co-authored-by: Jinmei Liao <jiliao@pivotal.io>

GEODE-9451: On demand authentication expiration and re-authentication (apache#6787)

* GEODE-9456, GEODE-9452: Authentication Expiration (apache#6721)
* Add tests and throw AuthenticationExpiredException
* GEODE-9460: Add testing for mutli-user scenarios (apache#6755)

Co-authored-by: Joris Melchior <joris.melchior@gmail.com>
jinmeiliao added a commit to jinmeiliao/geode that referenced this pull request Mar 24, 2022
… (squashed)

GEODE-10042: do not make ClientUserAuths null when we are not unregister client yet. (apache#7357)

* make cleanUserAuths synchronized to avoid NPE
* This also pass down client termination reason when we clean up client threads.
* since we introduced a lock object for clientUserAuths, revert some  old code to not to catch NPE but use the lock
* synchronize all clientUserAuths updates.

GEODE-9985: add region redundancy to avoid data loss. (apache#7308)

GEODE-9900: ensure AuthenticationExpiredException handling (apache#7207)

* GEODE-9900: ensure AuthenticationExpiredException handling

- in CloseCQ command
- Add unit tests to confirm proper message is sent

GEODE-9875: client operation should not send in invalid userId. (apache#7173)

GEODE-9867: do not process the message if the connection is terminated (apache#7158)

GEODE-9803: Fix the flaky "Failed To find authenticated user" problem (apache#7149)

* GEODE-9803: Fix the flaky "Failed To find authenticated user" problem

* Only to update subject on the ClientCacheProxy if it's waiting for re-auth
* logout the subject in one place when we close the dispatcher
* reset the timer when we stopped waiting

GEODE-9820: stopCQ should handle general exception same way as ExecuteCQ61 (apache#7122)

GEODE-9803: turning on security debug log in the test and add more debug logging (apache#7117)

GEODE-9746: do not logout old subjects immediately when we get a new subject for the same uniqueId (apache#7063)

* add more logging for future debugging
* minor bug fix in CacheClientProxy

GEODE-9792: synchronize multi-user authentication on different threads (apache#7088)

GEODE-9792: avoid sending in multiple authentication request on the same connection by different threads. (apache#7067)

GEODE-9723: test transactions with auth expiration (apache#7012)

Add tests to confirm that client transactions are not disrupted when authentication expires and automatic re-authentication takes place.

    complete transaction with commit
    transaction rollback
    suspended and resumed transaction with commit
    failed re-authentication with commit and rollback on partial transaction
    add test to include PARTITION region behavior

GEODE-9674: For durable client, when client reconnects, server should retrieve the message from the queue, not continue to try to deliver the last un-delivered message.

GEODE-9749: ignore the test case that shows GEODE-9704. (apache#7015)

GEODE-9534, GEODE-9540: add more tests for peer communication and bulk operations (apache#6985)

* add more tests for durable clients

GEODE-9674: fix durable client message loss issue in tests. (apache#6947)

* for caching_proxy region, count the events received instread of the region size
* do not try to dispatch residual messages when exception occurred.
* add durable client flag when register interest

GEODE-9534: get rid of some test warnings (apache#6945)

GEODE-9663: refactor authenticateIfRequired (apache#6948)

GEODE-9663: throw and handle AuthenticationExpiredException at login time (apache#6927)

* GEODE-9663: throw and handle AuthenticationExpiredException at login time

GEODE-9658: refactor test AuthInit to not use static field for credentials. (apache#6922)

GEODE-9570: make sure re-authentication works with registered interests (apache#6885)

GEODE-9459: testing clients with WAN connected cluster (apache#6901)

GEODE-9457: re-authentication in event dispatcher (apache#6835)

* authorize the message before dispatching the message to the client
* add a new message type to be sent to the client for re-authentiate
* message dispatcher will wait for a certain time for client to reauthenticate before terminating the client
* when re-authenticate, the new subject will re-use the original uniqueId. Credentials will be sent to the user along with the old uniqueId if exists.
* old subject will be cleaned out when new subject re-authenticate back.
* re-auth multi-user mode in event dispatching is not supported (yet).

GEODE-9458: Enhance function execution testing auth expiry (apache#6865)

* GEODE-9458: Enhance function execution testing auth expiry

GEODE-9521: add more multi-server test scenario (apache#6860)

* remove the static methods in ExpirableSecurityManager

GEODE-9586: modify 1.15.0's client server protocol version (apache#6846)

GEODE-9458: function execution with expiring authentication (apache#6789)

* GEODE-9456, GEODE-9452: Authentication Expiration (apache#6721)

* Add tests and throw AuthenticationExpiredException
Co-authored-by: Joris Melchior <joris.melchior@gmail.com>

* GEODE-9460: Add testing for mutli-user scenarios (apache#6755)

Co-Authored-By Jinmei Liao <jiliao@vmware.com>

* review update

* revert accidental change

* GEODE-9458: function execution with expiring authentication

* Changes based on review

* Changes based on review, parameterization

Co-authored-by: Jinmei Liao <jiliao@pivotal.io>

GEODE-9451: On demand authentication expiration and re-authentication (apache#6787)

* GEODE-9456, GEODE-9452: Authentication Expiration (apache#6721)
* Add tests and throw AuthenticationExpiredException
* GEODE-9460: Add testing for mutli-user scenarios (apache#6755)

Co-authored-by: Joris Melchior <joris.melchior@gmail.com>
jmelchio pushed a commit to jmelchio/geode that referenced this pull request Mar 25, 2022
…apache#6787)

* GEODE-9456, GEODE-9452: Authentication Expiration (apache#6721)
* Add tests and throw AuthenticationExpiredException
* GEODE-9460: Add testing for mutli-user scenarios (apache#6755)

Co-authored-by: Joris Melchior <joris.melchior@gmail.com>

GEODE-9458: function execution with expiring authentication (apache#6789)

* GEODE-9456, GEODE-9452: Authentication Expiration (apache#6721)

* Add tests and throw AuthenticationExpiredException
Co-authored-by: Joris Melchior <joris.melchior@gmail.com>

* GEODE-9460: Add testing for mutli-user scenarios (apache#6755)

Co-Authored-By Jinmei Liao <jiliao@vmware.com>

* review update

* revert accidental change

* GEODE-9458: function execution with expiring authentication

* Changes based on review

* Changes based on review, parameterization

Co-authored-by: Jinmei Liao <jiliao@pivotal.io>

GEODE-9586: modify 1.15.0's client server protocol version (apache#6846)

GEODE-9521: add more multi-server test scenario (apache#6860)

* remove the static methods in ExpirableSecurityManager

GEODE-9458: Enhance function execution testing auth expiry (apache#6865)

* GEODE-9458: Enhance function execution testing auth expiry

GEODE-9457: re-authentication in event dispatcher (apache#6835)

* authorize the message before dispatching the message to the client
* add a new message type to be sent to the client for re-authentiate
* message dispatcher will wait for a certain time for client to reauthenticate before terminating the client
* when re-authenticate, the new subject will re-use the original uniqueId. Credentials will be sent to the user along with the old uniqueId if exists.
* old subject will be cleaned out when new subject re-authenticate back.
* re-auth multi-user mode in event dispatching is not supported (yet).

GEODE-9459: testing clients with WAN connected cluster (apache#6901)

GEODE-9570: make sure re-authentication works with registered interests (apache#6885)

GEODE-9658: refactor test AuthInit to not use static field for credentials. (apache#6922)

GEODE-9663: throw and handle AuthenticationExpiredException at login time (apache#6927)

* GEODE-9663: throw and handle AuthenticationExpiredException at login time

GEODE-9663: refactor authenticateIfRequired (apache#6948)

GEODE-9534: get rid of some test warnings (apache#6945)

GEODE-9674: fix durable client message loss issue in tests. (apache#6947)

* for caching_proxy region, count the events received instread of the region size
* do not try to dispatch residual messages when exception occurred.
* add durable client flag when register interest

GEODE-9534, GEODE-9540: add more tests for peer communication and bulk operations (apache#6985)

* add more tests for durable clients

GEODE-9749: ignore the test case that shows GEODE-9704. (apache#7015)

GEODE-9674: For durable client, when client reconnects, server should retrieve the message from the queue, not continue to try to deliver the last un-delivered message.

GEODE-9723: test transactions with auth expiration (apache#7012)

Add tests to confirm that client transactions are not disrupted when authentication expires and automatic re-authentication takes place.

    complete transaction with commit
    transaction rollback
    suspended and resumed transaction with commit
    failed re-authentication with commit and rollback on partial transaction
    add test to include PARTITION region behavior

GEODE-9792: avoid sending in multiple authentication request on the same connection by different threads. (apache#7067)

GEODE-9792: synchronize multi-user authentication on different threads (apache#7088)

GEODE-9746: do not logout old subjects immediately when we get a new subject for the same uniqueId (apache#7063)

* add more logging for future debugging
* minor bug fix in CacheClientProxy

GEODE-9803: turning on security debug log in the test and add more debug logging (apache#7117)

GEODE-9820: stopCQ should handle general exception same way as ExecuteCQ61 (apache#7122)

GEODE-9803: Fix the flaky "Failed To find authenticated user" problem (apache#7149)

* GEODE-9803: Fix the flaky "Failed To find authenticated user" problem

* Only to update subject on the ClientCacheProxy if it's waiting for re-auth
* logout the subject in one place when we close the dispatcher
* reset the timer when we stopped waiting

GEODE-9867: do not process the message if the connection is terminated (apache#7158)

GEODE-9875: client operation should not send in invalid userId. (apache#7173)

GEODE-9900: ensure AuthenticationExpiredException handling (apache#7207)

* GEODE-9900: ensure AuthenticationExpiredException handling

- in CloseCQ command
- Add unit tests to confirm proper message is sent

GEODE-9985: add region redundancy to avoid data loss. (apache#7308)

GEODE-10042: do not make ClientUserAuths null when we are not unregister client yet. (apache#7357)

* make cleanUserAuths synchronized to avoid NPE
* This also pass down client termination reason when we clean up client threads.
* since we introduced a lock object for clientUserAuths, revert some  old code to not to catch NPE but use the lock
* synchronize all clientUserAuths updates.

Fix some compile errors

Fix more compile errors
jmelchio pushed a commit to jmelchio/geode that referenced this pull request Mar 25, 2022
…apache#6787)

* GEODE-9456, GEODE-9452: Authentication Expiration (apache#6721)
* Add tests and throw AuthenticationExpiredException
* GEODE-9460: Add testing for mutli-user scenarios (apache#6755)

Co-authored-by: Joris Melchior <joris.melchior@gmail.com>

GEODE-9458: function execution with expiring authentication (apache#6789)

* GEODE-9456, GEODE-9452: Authentication Expiration (apache#6721)

* Add tests and throw AuthenticationExpiredException
Co-authored-by: Joris Melchior <joris.melchior@gmail.com>

* GEODE-9460: Add testing for mutli-user scenarios (apache#6755)

Co-Authored-By Jinmei Liao <jiliao@vmware.com>

* review update

* revert accidental change

* GEODE-9458: function execution with expiring authentication

* Changes based on review

* Changes based on review, parameterization

Co-authored-by: Jinmei Liao <jiliao@pivotal.io>

GEODE-9586: modify 1.15.0's client server protocol version (apache#6846)

GEODE-9521: add more multi-server test scenario (apache#6860)

* remove the static methods in ExpirableSecurityManager

GEODE-9458: Enhance function execution testing auth expiry (apache#6865)

* GEODE-9458: Enhance function execution testing auth expiry

GEODE-9457: re-authentication in event dispatcher (apache#6835)

* authorize the message before dispatching the message to the client
* add a new message type to be sent to the client for re-authentiate
* message dispatcher will wait for a certain time for client to reauthenticate before terminating the client
* when re-authenticate, the new subject will re-use the original uniqueId. Credentials will be sent to the user along with the old uniqueId if exists.
* old subject will be cleaned out when new subject re-authenticate back.
* re-auth multi-user mode in event dispatching is not supported (yet).

GEODE-9459: testing clients with WAN connected cluster (apache#6901)

GEODE-9570: make sure re-authentication works with registered interests (apache#6885)

GEODE-9658: refactor test AuthInit to not use static field for credentials. (apache#6922)

GEODE-9663: throw and handle AuthenticationExpiredException at login time (apache#6927)

* GEODE-9663: throw and handle AuthenticationExpiredException at login time

GEODE-9663: refactor authenticateIfRequired (apache#6948)

GEODE-9534: get rid of some test warnings (apache#6945)

GEODE-9674: fix durable client message loss issue in tests. (apache#6947)

* for caching_proxy region, count the events received instread of the region size
* do not try to dispatch residual messages when exception occurred.
* add durable client flag when register interest

GEODE-9534, GEODE-9540: add more tests for peer communication and bulk operations (apache#6985)

* add more tests for durable clients

GEODE-9749: ignore the test case that shows GEODE-9704. (apache#7015)

GEODE-9674: For durable client, when client reconnects, server should retrieve the message from the queue, not continue to try to deliver the last un-delivered message.

GEODE-9723: test transactions with auth expiration (apache#7012)

Add tests to confirm that client transactions are not disrupted when authentication expires and automatic re-authentication takes place.

    complete transaction with commit
    transaction rollback
    suspended and resumed transaction with commit
    failed re-authentication with commit and rollback on partial transaction
    add test to include PARTITION region behavior

GEODE-9792: avoid sending in multiple authentication request on the same connection by different threads. (apache#7067)

GEODE-9792: synchronize multi-user authentication on different threads (apache#7088)

GEODE-9746: do not logout old subjects immediately when we get a new subject for the same uniqueId (apache#7063)

* add more logging for future debugging
* minor bug fix in CacheClientProxy

GEODE-9803: turning on security debug log in the test and add more debug logging (apache#7117)

GEODE-9820: stopCQ should handle general exception same way as ExecuteCQ61 (apache#7122)

GEODE-9803: Fix the flaky "Failed To find authenticated user" problem (apache#7149)

* GEODE-9803: Fix the flaky "Failed To find authenticated user" problem

* Only to update subject on the ClientCacheProxy if it's waiting for re-auth
* logout the subject in one place when we close the dispatcher
* reset the timer when we stopped waiting

GEODE-9867: do not process the message if the connection is terminated (apache#7158)

GEODE-9875: client operation should not send in invalid userId. (apache#7173)

GEODE-9900: ensure AuthenticationExpiredException handling (apache#7207)

* GEODE-9900: ensure AuthenticationExpiredException handling

- in CloseCQ command
- Add unit tests to confirm proper message is sent

GEODE-9985: add region redundancy to avoid data loss. (apache#7308)

GEODE-10042: do not make ClientUserAuths null when we are not unregister client yet. (apache#7357)

* make cleanUserAuths synchronized to avoid NPE
* This also pass down client termination reason when we clean up client threads.
* since we introduced a lock object for clientUserAuths, revert some  old code to not to catch NPE but use the lock
* synchronize all clientUserAuths updates.

Fix some compile errors

Fix more compile errors
jmelchio pushed a commit to jmelchio/geode that referenced this pull request Mar 28, 2022
…apache#6787)

* GEODE-9456, GEODE-9452: Authentication Expiration (apache#6721)
* Add tests and throw AuthenticationExpiredException
* GEODE-9460: Add testing for mutli-user scenarios (apache#6755)

Co-authored-by: Joris Melchior <joris.melchior@gmail.com>

GEODE-9458: function execution with expiring authentication (apache#6789)

* GEODE-9456, GEODE-9452: Authentication Expiration (apache#6721)

* Add tests and throw AuthenticationExpiredException
Co-authored-by: Joris Melchior <joris.melchior@gmail.com>

* GEODE-9460: Add testing for mutli-user scenarios (apache#6755)

Co-Authored-By Jinmei Liao <jiliao@vmware.com>

* review update

* revert accidental change

* GEODE-9458: function execution with expiring authentication

* Changes based on review

* Changes based on review, parameterization

Co-authored-by: Jinmei Liao <jiliao@pivotal.io>

GEODE-9586: modify 1.15.0's client server protocol version (apache#6846)

GEODE-9521: add more multi-server test scenario (apache#6860)

* remove the static methods in ExpirableSecurityManager

GEODE-9458: Enhance function execution testing auth expiry (apache#6865)

* GEODE-9458: Enhance function execution testing auth expiry

GEODE-9457: re-authentication in event dispatcher (apache#6835)

* authorize the message before dispatching the message to the client
* add a new message type to be sent to the client for re-authentiate
* message dispatcher will wait for a certain time for client to reauthenticate before terminating the client
* when re-authenticate, the new subject will re-use the original uniqueId. Credentials will be sent to the user along with the old uniqueId if exists.
* old subject will be cleaned out when new subject re-authenticate back.
* re-auth multi-user mode in event dispatching is not supported (yet).

GEODE-9459: testing clients with WAN connected cluster (apache#6901)

GEODE-9570: make sure re-authentication works with registered interests (apache#6885)

GEODE-9658: refactor test AuthInit to not use static field for credentials. (apache#6922)

GEODE-9663: throw and handle AuthenticationExpiredException at login time (apache#6927)

* GEODE-9663: throw and handle AuthenticationExpiredException at login time

GEODE-9663: refactor authenticateIfRequired (apache#6948)

GEODE-9534: get rid of some test warnings (apache#6945)

GEODE-9674: fix durable client message loss issue in tests. (apache#6947)

* for caching_proxy region, count the events received instread of the region size
* do not try to dispatch residual messages when exception occurred.
* add durable client flag when register interest

GEODE-9534, GEODE-9540: add more tests for peer communication and bulk operations (apache#6985)

* add more tests for durable clients

GEODE-9749: ignore the test case that shows GEODE-9704. (apache#7015)

GEODE-9674: For durable client, when client reconnects, server should retrieve the message from the queue, not continue to try to deliver the last un-delivered message.

GEODE-9723: test transactions with auth expiration (apache#7012)

Add tests to confirm that client transactions are not disrupted when authentication expires and automatic re-authentication takes place.

    complete transaction with commit
    transaction rollback
    suspended and resumed transaction with commit
    failed re-authentication with commit and rollback on partial transaction
    add test to include PARTITION region behavior

GEODE-9792: avoid sending in multiple authentication request on the same connection by different threads. (apache#7067)

GEODE-9792: synchronize multi-user authentication on different threads (apache#7088)

GEODE-9746: do not logout old subjects immediately when we get a new subject for the same uniqueId (apache#7063)

* add more logging for future debugging
* minor bug fix in CacheClientProxy

GEODE-9803: turning on security debug log in the test and add more debug logging (apache#7117)

GEODE-9820: stopCQ should handle general exception same way as ExecuteCQ61 (apache#7122)

GEODE-9803: Fix the flaky "Failed To find authenticated user" problem (apache#7149)

* GEODE-9803: Fix the flaky "Failed To find authenticated user" problem

* Only to update subject on the ClientCacheProxy if it's waiting for re-auth
* logout the subject in one place when we close the dispatcher
* reset the timer when we stopped waiting

GEODE-9867: do not process the message if the connection is terminated (apache#7158)

GEODE-9875: client operation should not send in invalid userId. (apache#7173)

GEODE-9900: ensure AuthenticationExpiredException handling (apache#7207)

* GEODE-9900: ensure AuthenticationExpiredException handling

- in CloseCQ command
- Add unit tests to confirm proper message is sent

GEODE-9985: add region redundancy to avoid data loss. (apache#7308)

GEODE-10042: do not make ClientUserAuths null when we are not unregister client yet. (apache#7357)

* make cleanUserAuths synchronized to avoid NPE
* This also pass down client termination reason when we clean up client threads.
* since we introduced a lock object for clientUserAuths, revert some  old code to not to catch NPE but use the lock
* synchronize all clientUserAuths updates.

Fix some compile errors

Fix more compile errors

Still more compile errors

Fix assembly content file

Fix sanctioned-geode-core-serializables

GEODE-10163: upgradeTest serialization issues (apache#7488)

- AuthExpirationTransactionUpgradeTest had issues with serialization of
  TXId class between different versions of test VMs during the
  upgradeTest.
- Change made to the test so that we serialize a String instead of the
  TXId to avoid this issue and gain the ability to run the test across a
  wider range of client versions.

Back-port test fixes and adjust versions

Reduce number of upgrade version to run against

Manually fix merge errors

- as a result of rebase on support/1.14
jmelchio added a commit to jmelchio/geode that referenced this pull request Mar 28, 2022
…apache#6787)

* GEODE-9456, GEODE-9452: Authentication Expiration (apache#6721)
* Add tests and throw AuthenticationExpiredException
* GEODE-9460: Add testing for mutli-user scenarios (apache#6755)

Co-authored-by: Joris Melchior <joris.melchior@gmail.com>

GEODE-9458: function execution with expiring authentication (apache#6789)

* GEODE-9456, GEODE-9452: Authentication Expiration (apache#6721)

* Add tests and throw AuthenticationExpiredException
Co-authored-by: Joris Melchior <joris.melchior@gmail.com>

* GEODE-9460: Add testing for mutli-user scenarios (apache#6755)

Co-Authored-By Jinmei Liao <jiliao@vmware.com>

* review update

* revert accidental change

* GEODE-9458: function execution with expiring authentication

* Changes based on review

* Changes based on review, parameterization

Co-authored-by: Jinmei Liao <jiliao@pivotal.io>

GEODE-9586: modify 1.15.0's client server protocol version (apache#6846)

GEODE-9521: add more multi-server test scenario (apache#6860)

* remove the static methods in ExpirableSecurityManager

GEODE-9458: Enhance function execution testing auth expiry (apache#6865)

* GEODE-9458: Enhance function execution testing auth expiry

GEODE-9457: re-authentication in event dispatcher (apache#6835)

* authorize the message before dispatching the message to the client
* add a new message type to be sent to the client for re-authentiate
* message dispatcher will wait for a certain time for client to reauthenticate before terminating the client
* when re-authenticate, the new subject will re-use the original uniqueId. Credentials will be sent to the user along with the old uniqueId if exists.
* old subject will be cleaned out when new subject re-authenticate back.
* re-auth multi-user mode in event dispatching is not supported (yet).

GEODE-9459: testing clients with WAN connected cluster (apache#6901)

GEODE-9570: make sure re-authentication works with registered interests (apache#6885)

GEODE-9658: refactor test AuthInit to not use static field for credentials. (apache#6922)

GEODE-9663: throw and handle AuthenticationExpiredException at login time (apache#6927)

* GEODE-9663: throw and handle AuthenticationExpiredException at login time

GEODE-9663: refactor authenticateIfRequired (apache#6948)

GEODE-9534: get rid of some test warnings (apache#6945)

GEODE-9674: fix durable client message loss issue in tests. (apache#6947)

* for caching_proxy region, count the events received instread of the region size
* do not try to dispatch residual messages when exception occurred.
* add durable client flag when register interest

GEODE-9534, GEODE-9540: add more tests for peer communication and bulk operations (apache#6985)

* add more tests for durable clients

GEODE-9749: ignore the test case that shows GEODE-9704. (apache#7015)

GEODE-9674: For durable client, when client reconnects, server should retrieve the message from the queue, not continue to try to deliver the last un-delivered message.

GEODE-9723: test transactions with auth expiration (apache#7012)

Add tests to confirm that client transactions are not disrupted when authentication expires and automatic re-authentication takes place.

    complete transaction with commit
    transaction rollback
    suspended and resumed transaction with commit
    failed re-authentication with commit and rollback on partial transaction
    add test to include PARTITION region behavior

GEODE-9792: avoid sending in multiple authentication request on the same connection by different threads. (apache#7067)

GEODE-9792: synchronize multi-user authentication on different threads (apache#7088)

GEODE-9746: do not logout old subjects immediately when we get a new subject for the same uniqueId (apache#7063)

* add more logging for future debugging
* minor bug fix in CacheClientProxy

GEODE-9803: turning on security debug log in the test and add more debug logging (apache#7117)

GEODE-9820: stopCQ should handle general exception same way as ExecuteCQ61 (apache#7122)

GEODE-9803: Fix the flaky "Failed To find authenticated user" problem (apache#7149)

* GEODE-9803: Fix the flaky "Failed To find authenticated user" problem

* Only to update subject on the ClientCacheProxy if it's waiting for re-auth
* logout the subject in one place when we close the dispatcher
* reset the timer when we stopped waiting

GEODE-9867: do not process the message if the connection is terminated (apache#7158)

GEODE-9875: client operation should not send in invalid userId. (apache#7173)

GEODE-9900: ensure AuthenticationExpiredException handling (apache#7207)

* GEODE-9900: ensure AuthenticationExpiredException handling

- in CloseCQ command
- Add unit tests to confirm proper message is sent

GEODE-9985: add region redundancy to avoid data loss. (apache#7308)

GEODE-10042: do not make ClientUserAuths null when we are not unregister client yet. (apache#7357)

* make cleanUserAuths synchronized to avoid NPE
* This also pass down client termination reason when we clean up client threads.
* since we introduced a lock object for clientUserAuths, revert some  old code to not to catch NPE but use the lock
* synchronize all clientUserAuths updates.

Fix some compile errors

Fix more compile errors

Still more compile errors

Fix assembly content file

Fix sanctioned-geode-core-serializables

GEODE-10163: upgradeTest serialization issues (apache#7488)

- AuthExpirationTransactionUpgradeTest had issues with serialization of
  TXId class between different versions of test VMs during the
  upgradeTest.
- Change made to the test so that we serialize a String instead of the
  TXId to avoid this issue and gain the ability to run the test across a
  wider range of client versions.

Back-port test fixes and adjust versions

Reduce number of upgrade version to run against

Manually fix merge errors

- as a result of rebase on support/1.14
jinmeiliao added a commit to jinmeiliao/geode that referenced this pull request Mar 29, 2022
… (squashed)

GEODE-10042: do not make ClientUserAuths null when we are not unregister client yet. (apache#7357)

* make cleanUserAuths synchronized to avoid NPE
* This also pass down client termination reason when we clean up client threads.
* since we introduced a lock object for clientUserAuths, revert some  old code to not to catch NPE but use the lock
* synchronize all clientUserAuths updates.

GEODE-9985: add region redundancy to avoid data loss. (apache#7308)

GEODE-9900: ensure AuthenticationExpiredException handling (apache#7207)

* GEODE-9900: ensure AuthenticationExpiredException handling

- in CloseCQ command
- Add unit tests to confirm proper message is sent

GEODE-9875: client operation should not send in invalid userId. (apache#7173)

GEODE-9867: do not process the message if the connection is terminated (apache#7158)

GEODE-9803: Fix the flaky "Failed To find authenticated user" problem (apache#7149)

* GEODE-9803: Fix the flaky "Failed To find authenticated user" problem

* Only to update subject on the ClientCacheProxy if it's waiting for re-auth
* logout the subject in one place when we close the dispatcher
* reset the timer when we stopped waiting

GEODE-9820: stopCQ should handle general exception same way as ExecuteCQ61 (apache#7122)

GEODE-9803: turning on security debug log in the test and add more debug logging (apache#7117)

GEODE-9746: do not logout old subjects immediately when we get a new subject for the same uniqueId (apache#7063)

* add more logging for future debugging
* minor bug fix in CacheClientProxy

GEODE-9792: synchronize multi-user authentication on different threads (apache#7088)

GEODE-9792: avoid sending in multiple authentication request on the same connection by different threads. (apache#7067)

GEODE-9723: test transactions with auth expiration (apache#7012)

Add tests to confirm that client transactions are not disrupted when authentication expires and automatic re-authentication takes place.

    complete transaction with commit
    transaction rollback
    suspended and resumed transaction with commit
    failed re-authentication with commit and rollback on partial transaction
    add test to include PARTITION region behavior

GEODE-9674: For durable client, when client reconnects, server should retrieve the message from the queue, not continue to try to deliver the last un-delivered message.

GEODE-9749: ignore the test case that shows GEODE-9704. (apache#7015)

GEODE-9534, GEODE-9540: add more tests for peer communication and bulk operations (apache#6985)

* add more tests for durable clients

GEODE-9674: fix durable client message loss issue in tests. (apache#6947)

* for caching_proxy region, count the events received instread of the region size
* do not try to dispatch residual messages when exception occurred.
* add durable client flag when register interest

GEODE-9534: get rid of some test warnings (apache#6945)

GEODE-9663: refactor authenticateIfRequired (apache#6948)

GEODE-9663: throw and handle AuthenticationExpiredException at login time (apache#6927)

* GEODE-9663: throw and handle AuthenticationExpiredException at login time

GEODE-9658: refactor test AuthInit to not use static field for credentials. (apache#6922)

GEODE-9570: make sure re-authentication works with registered interests (apache#6885)

GEODE-9459: testing clients with WAN connected cluster (apache#6901)

GEODE-9457: re-authentication in event dispatcher (apache#6835)

* authorize the message before dispatching the message to the client
* add a new message type to be sent to the client for re-authentiate
* message dispatcher will wait for a certain time for client to reauthenticate before terminating the client
* when re-authenticate, the new subject will re-use the original uniqueId. Credentials will be sent to the user along with the old uniqueId if exists.
* old subject will be cleaned out when new subject re-authenticate back.
* re-auth multi-user mode in event dispatching is not supported (yet).

GEODE-9458: Enhance function execution testing auth expiry (apache#6865)

* GEODE-9458: Enhance function execution testing auth expiry

GEODE-9521: add more multi-server test scenario (apache#6860)

* remove the static methods in ExpirableSecurityManager

GEODE-9586: modify 1.15.0's client server protocol version (apache#6846)

GEODE-9458: function execution with expiring authentication (apache#6789)

* GEODE-9456, GEODE-9452: Authentication Expiration (apache#6721)

* Add tests and throw AuthenticationExpiredException
Co-authored-by: Joris Melchior <joris.melchior@gmail.com>

* GEODE-9460: Add testing for mutli-user scenarios (apache#6755)

Co-Authored-By Jinmei Liao <jiliao@vmware.com>

* review update

* revert accidental change

* GEODE-9458: function execution with expiring authentication

* Changes based on review

* Changes based on review, parameterization

Co-authored-by: Jinmei Liao <jiliao@pivotal.io>

GEODE-9451: On demand authentication expiration and re-authentication (apache#6787)

* GEODE-9456, GEODE-9452: Authentication Expiration (apache#6721)
* Add tests and throw AuthenticationExpiredException
* GEODE-9460: Add testing for mutli-user scenarios (apache#6755)

Co-authored-by: Joris Melchior <joris.melchior@gmail.com>
jmelchio pushed a commit to jmelchio/geode that referenced this pull request Mar 30, 2022
…apache#6787)

* GEODE-9456, GEODE-9452: Authentication Expiration (apache#6721)
* Add tests and throw AuthenticationExpiredException
* GEODE-9460: Add testing for mutli-user scenarios (apache#6755)

Co-authored-by: Joris Melchior <joris.melchior@gmail.com>

GEODE-9458: function execution with expiring authentication (apache#6789)

* GEODE-9456, GEODE-9452: Authentication Expiration (apache#6721)

* Add tests and throw AuthenticationExpiredException
Co-authored-by: Joris Melchior <joris.melchior@gmail.com>

* GEODE-9460: Add testing for mutli-user scenarios (apache#6755)

Co-Authored-By Jinmei Liao <jiliao@vmware.com>

* review update

* revert accidental change

* GEODE-9458: function execution with expiring authentication

* Changes based on review

* Changes based on review, parameterization

Co-authored-by: Jinmei Liao <jiliao@pivotal.io>

GEODE-9586: modify 1.15.0's client server protocol version (apache#6846)

GEODE-9521: add more multi-server test scenario (apache#6860)

* remove the static methods in ExpirableSecurityManager

GEODE-9458: Enhance function execution testing auth expiry (apache#6865)

* GEODE-9458: Enhance function execution testing auth expiry

GEODE-9457: re-authentication in event dispatcher (apache#6835)

* authorize the message before dispatching the message to the client
* add a new message type to be sent to the client for re-authentiate
* message dispatcher will wait for a certain time for client to reauthenticate before terminating the client
* when re-authenticate, the new subject will re-use the original uniqueId. Credentials will be sent to the user along with the old uniqueId if exists.
* old subject will be cleaned out when new subject re-authenticate back.
* re-auth multi-user mode in event dispatching is not supported (yet).

GEODE-9459: testing clients with WAN connected cluster (apache#6901)

GEODE-9570: make sure re-authentication works with registered interests (apache#6885)

GEODE-9658: refactor test AuthInit to not use static field for credentials. (apache#6922)

GEODE-9663: throw and handle AuthenticationExpiredException at login time (apache#6927)

* GEODE-9663: throw and handle AuthenticationExpiredException at login time

GEODE-9663: refactor authenticateIfRequired (apache#6948)

GEODE-9534: get rid of some test warnings (apache#6945)

GEODE-9674: fix durable client message loss issue in tests. (apache#6947)

* for caching_proxy region, count the events received instread of the region size
* do not try to dispatch residual messages when exception occurred.
* add durable client flag when register interest

GEODE-9534, GEODE-9540: add more tests for peer communication and bulk operations (apache#6985)

* add more tests for durable clients

GEODE-9749: ignore the test case that shows GEODE-9704. (apache#7015)

GEODE-9674: For durable client, when client reconnects, server should retrieve the message from the queue, not continue to try to deliver the last un-delivered message.

GEODE-9723: test transactions with auth expiration (apache#7012)

Add tests to confirm that client transactions are not disrupted when authentication expires and automatic re-authentication takes place.

    complete transaction with commit
    transaction rollback
    suspended and resumed transaction with commit
    failed re-authentication with commit and rollback on partial transaction
    add test to include PARTITION region behavior

GEODE-9792: avoid sending in multiple authentication request on the same connection by different threads. (apache#7067)

GEODE-9792: synchronize multi-user authentication on different threads (apache#7088)

GEODE-9746: do not logout old subjects immediately when we get a new subject for the same uniqueId (apache#7063)

* add more logging for future debugging
* minor bug fix in CacheClientProxy

GEODE-9803: turning on security debug log in the test and add more debug logging (apache#7117)

GEODE-9820: stopCQ should handle general exception same way as ExecuteCQ61 (apache#7122)

GEODE-9803: Fix the flaky "Failed To find authenticated user" problem (apache#7149)

* GEODE-9803: Fix the flaky "Failed To find authenticated user" problem

* Only to update subject on the ClientCacheProxy if it's waiting for re-auth
* logout the subject in one place when we close the dispatcher
* reset the timer when we stopped waiting

GEODE-9867: do not process the message if the connection is terminated (apache#7158)

GEODE-9875: client operation should not send in invalid userId. (apache#7173)

GEODE-9900: ensure AuthenticationExpiredException handling (apache#7207)

* GEODE-9900: ensure AuthenticationExpiredException handling

- in CloseCQ command
- Add unit tests to confirm proper message is sent

GEODE-9985: add region redundancy to avoid data loss. (apache#7308)

GEODE-10042: do not make ClientUserAuths null when we are not unregister client yet. (apache#7357)

* make cleanUserAuths synchronized to avoid NPE
* This also pass down client termination reason when we clean up client threads.
* since we introduced a lock object for clientUserAuths, revert some  old code to not to catch NPE but use the lock
* synchronize all clientUserAuths updates.

Fix some compile errors

Fix more compile errors

Still more compile errors

Fix assembly content file

Fix sanctioned-geode-core-serializables

GEODE-10163: upgradeTest serialization issues (apache#7488)

- AuthExpirationTransactionUpgradeTest had issues with serialization of
  TXId class between different versions of test VMs during the
  upgradeTest.
- Change made to the test so that we serialize a String instead of the
  TXId to avoid this issue and gain the ability to run the test across a
  wider range of client versions.

Back-port test fixes and adjust versions

Reduce number of upgrade version to run against

Manually fix merge errors

- as a result of rebase on support/1.14

Change SystemPropertyHelper back for expiry
jmelchio added a commit to jmelchio/geode that referenced this pull request Mar 30, 2022
…apache#6787)

* GEODE-9456, GEODE-9452: Authentication Expiration (apache#6721)
* Add tests and throw AuthenticationExpiredException
* GEODE-9460: Add testing for mutli-user scenarios (apache#6755)

Co-authored-by: Joris Melchior <joris.melchior@gmail.com>

GEODE-9458: function execution with expiring authentication (apache#6789)

* GEODE-9456, GEODE-9452: Authentication Expiration (apache#6721)

* Add tests and throw AuthenticationExpiredException
Co-authored-by: Joris Melchior <joris.melchior@gmail.com>

* GEODE-9460: Add testing for mutli-user scenarios (apache#6755)

Co-Authored-By Jinmei Liao <jiliao@vmware.com>

* review update

* revert accidental change

* GEODE-9458: function execution with expiring authentication

* Changes based on review

* Changes based on review, parameterization

Co-authored-by: Jinmei Liao <jiliao@pivotal.io>

GEODE-9586: modify 1.15.0's client server protocol version (apache#6846)

GEODE-9521: add more multi-server test scenario (apache#6860)

* remove the static methods in ExpirableSecurityManager

GEODE-9458: Enhance function execution testing auth expiry (apache#6865)

* GEODE-9458: Enhance function execution testing auth expiry

GEODE-9457: re-authentication in event dispatcher (apache#6835)

* authorize the message before dispatching the message to the client
* add a new message type to be sent to the client for re-authentiate
* message dispatcher will wait for a certain time for client to reauthenticate before terminating the client
* when re-authenticate, the new subject will re-use the original uniqueId. Credentials will be sent to the user along with the old uniqueId if exists.
* old subject will be cleaned out when new subject re-authenticate back.
* re-auth multi-user mode in event dispatching is not supported (yet).

GEODE-9459: testing clients with WAN connected cluster (apache#6901)

GEODE-9570: make sure re-authentication works with registered interests (apache#6885)

GEODE-9658: refactor test AuthInit to not use static field for credentials. (apache#6922)

GEODE-9663: throw and handle AuthenticationExpiredException at login time (apache#6927)

* GEODE-9663: throw and handle AuthenticationExpiredException at login time

GEODE-9663: refactor authenticateIfRequired (apache#6948)

GEODE-9534: get rid of some test warnings (apache#6945)

GEODE-9674: fix durable client message loss issue in tests. (apache#6947)

* for caching_proxy region, count the events received instread of the region size
* do not try to dispatch residual messages when exception occurred.
* add durable client flag when register interest

GEODE-9534, GEODE-9540: add more tests for peer communication and bulk operations (apache#6985)

* add more tests for durable clients

GEODE-9749: ignore the test case that shows GEODE-9704. (apache#7015)

GEODE-9674: For durable client, when client reconnects, server should retrieve the message from the queue, not continue to try to deliver the last un-delivered message.

GEODE-9723: test transactions with auth expiration (apache#7012)

Add tests to confirm that client transactions are not disrupted when authentication expires and automatic re-authentication takes place.

    complete transaction with commit
    transaction rollback
    suspended and resumed transaction with commit
    failed re-authentication with commit and rollback on partial transaction
    add test to include PARTITION region behavior

GEODE-9792: avoid sending in multiple authentication request on the same connection by different threads. (apache#7067)

GEODE-9792: synchronize multi-user authentication on different threads (apache#7088)

GEODE-9746: do not logout old subjects immediately when we get a new subject for the same uniqueId (apache#7063)

* add more logging for future debugging
* minor bug fix in CacheClientProxy

GEODE-9803: turning on security debug log in the test and add more debug logging (apache#7117)

GEODE-9820: stopCQ should handle general exception same way as ExecuteCQ61 (apache#7122)

GEODE-9803: Fix the flaky "Failed To find authenticated user" problem (apache#7149)

* GEODE-9803: Fix the flaky "Failed To find authenticated user" problem

* Only to update subject on the ClientCacheProxy if it's waiting for re-auth
* logout the subject in one place when we close the dispatcher
* reset the timer when we stopped waiting

GEODE-9867: do not process the message if the connection is terminated (apache#7158)

GEODE-9875: client operation should not send in invalid userId. (apache#7173)

GEODE-9900: ensure AuthenticationExpiredException handling (apache#7207)

* GEODE-9900: ensure AuthenticationExpiredException handling

- in CloseCQ command
- Add unit tests to confirm proper message is sent

GEODE-9985: add region redundancy to avoid data loss. (apache#7308)

GEODE-10042: do not make ClientUserAuths null when we are not unregister client yet. (apache#7357)

* make cleanUserAuths synchronized to avoid NPE
* This also pass down client termination reason when we clean up client threads.
* since we introduced a lock object for clientUserAuths, revert some  old code to not to catch NPE but use the lock
* synchronize all clientUserAuths updates.

Fix some compile errors

Fix more compile errors

Still more compile errors

Fix assembly content file

Fix sanctioned-geode-core-serializables

GEODE-10163: upgradeTest serialization issues (apache#7488)

- AuthExpirationTransactionUpgradeTest had issues with serialization of
  TXId class between different versions of test VMs during the
  upgradeTest.
- Change made to the test so that we serialize a String instead of the
  TXId to avoid this issue and gain the ability to run the test across a
  wider range of client versions.

Back-port test fixes and adjust versions

Reduce number of upgrade version to run against

Manually fix merge errors

- as a result of rebase on support/1.14

Temp checkin not to lose changes

Fix things and so on

Everything appears to compile version
jmelchio added a commit to jmelchio/geode that referenced this pull request Mar 30, 2022
…apache#6787)

* GEODE-9456, GEODE-9452: Authentication Expiration (apache#6721)
* Add tests and throw AuthenticationExpiredException
* GEODE-9460: Add testing for mutli-user scenarios (apache#6755)

Co-authored-by: Joris Melchior <joris.melchior@gmail.com>

GEODE-9458: function execution with expiring authentication (apache#6789)

* GEODE-9456, GEODE-9452: Authentication Expiration (apache#6721)

* Add tests and throw AuthenticationExpiredException
Co-authored-by: Joris Melchior <joris.melchior@gmail.com>

* GEODE-9460: Add testing for mutli-user scenarios (apache#6755)

Co-Authored-By Jinmei Liao <jiliao@vmware.com>

* review update

* revert accidental change

* GEODE-9458: function execution with expiring authentication

* Changes based on review

* Changes based on review, parameterization

Co-authored-by: Jinmei Liao <jiliao@pivotal.io>

GEODE-9586: modify 1.15.0's client server protocol version (apache#6846)

GEODE-9521: add more multi-server test scenario (apache#6860)

* remove the static methods in ExpirableSecurityManager

GEODE-9458: Enhance function execution testing auth expiry (apache#6865)

* GEODE-9458: Enhance function execution testing auth expiry

GEODE-9457: re-authentication in event dispatcher (apache#6835)

* authorize the message before dispatching the message to the client
* add a new message type to be sent to the client for re-authentiate
* message dispatcher will wait for a certain time for client to reauthenticate before terminating the client
* when re-authenticate, the new subject will re-use the original uniqueId. Credentials will be sent to the user along with the old uniqueId if exists.
* old subject will be cleaned out when new subject re-authenticate back.
* re-auth multi-user mode in event dispatching is not supported (yet).

GEODE-9459: testing clients with WAN connected cluster (apache#6901)

GEODE-9570: make sure re-authentication works with registered interests (apache#6885)

GEODE-9658: refactor test AuthInit to not use static field for credentials. (apache#6922)

GEODE-9663: throw and handle AuthenticationExpiredException at login time (apache#6927)

* GEODE-9663: throw and handle AuthenticationExpiredException at login time

GEODE-9663: refactor authenticateIfRequired (apache#6948)

GEODE-9534: get rid of some test warnings (apache#6945)

GEODE-9674: fix durable client message loss issue in tests. (apache#6947)

* for caching_proxy region, count the events received instread of the region size
* do not try to dispatch residual messages when exception occurred.
* add durable client flag when register interest

GEODE-9534, GEODE-9540: add more tests for peer communication and bulk operations (apache#6985)

* add more tests for durable clients

GEODE-9749: ignore the test case that shows GEODE-9704. (apache#7015)

GEODE-9674: For durable client, when client reconnects, server should retrieve the message from the queue, not continue to try to deliver the last un-delivered message.

GEODE-9723: test transactions with auth expiration (apache#7012)

Add tests to confirm that client transactions are not disrupted when authentication expires and automatic re-authentication takes place.

    complete transaction with commit
    transaction rollback
    suspended and resumed transaction with commit
    failed re-authentication with commit and rollback on partial transaction
    add test to include PARTITION region behavior

GEODE-9792: avoid sending in multiple authentication request on the same connection by different threads. (apache#7067)

GEODE-9792: synchronize multi-user authentication on different threads (apache#7088)

GEODE-9746: do not logout old subjects immediately when we get a new subject for the same uniqueId (apache#7063)

* add more logging for future debugging
* minor bug fix in CacheClientProxy

GEODE-9803: turning on security debug log in the test and add more debug logging (apache#7117)

GEODE-9820: stopCQ should handle general exception same way as ExecuteCQ61 (apache#7122)

GEODE-9803: Fix the flaky "Failed To find authenticated user" problem (apache#7149)

* GEODE-9803: Fix the flaky "Failed To find authenticated user" problem

* Only to update subject on the ClientCacheProxy if it's waiting for re-auth
* logout the subject in one place when we close the dispatcher
* reset the timer when we stopped waiting

GEODE-9867: do not process the message if the connection is terminated (apache#7158)

GEODE-9875: client operation should not send in invalid userId. (apache#7173)

GEODE-9900: ensure AuthenticationExpiredException handling (apache#7207)

* GEODE-9900: ensure AuthenticationExpiredException handling

- in CloseCQ command
- Add unit tests to confirm proper message is sent

GEODE-9985: add region redundancy to avoid data loss. (apache#7308)

GEODE-10042: do not make ClientUserAuths null when we are not unregister client yet. (apache#7357)

* make cleanUserAuths synchronized to avoid NPE
* This also pass down client termination reason when we clean up client threads.
* since we introduced a lock object for clientUserAuths, revert some  old code to not to catch NPE but use the lock
* synchronize all clientUserAuths updates.

Fix some compile errors

Fix more compile errors

Still more compile errors

Fix assembly content file

Fix sanctioned-geode-core-serializables

GEODE-10163: upgradeTest serialization issues (apache#7488)

- AuthExpirationTransactionUpgradeTest had issues with serialization of
  TXId class between different versions of test VMs during the
  upgradeTest.
- Change made to the test so that we serialize a String instead of the
  TXId to avoid this issue and gain the ability to run the test across a
  wider range of client versions.

Back-port test fixes and adjust versions

Reduce number of upgrade version to run against

Manually fix merge errors

- as a result of rebase on support/1.14

Temp checkin not to lose changes

Fix things and so on

Everything appears to compile version
jinmeiliao added a commit to jinmeiliao/geode that referenced this pull request Apr 1, 2022
… (squashed)

GEODE-10042: do not make ClientUserAuths null when we are not unregister client yet. (apache#7357)

* make cleanUserAuths synchronized to avoid NPE
* This also pass down client termination reason when we clean up client threads.
* since we introduced a lock object for clientUserAuths, revert some  old code to not to catch NPE but use the lock
* synchronize all clientUserAuths updates.

GEODE-9985: add region redundancy to avoid data loss. (apache#7308)

GEODE-9900: ensure AuthenticationExpiredException handling (apache#7207)

* GEODE-9900: ensure AuthenticationExpiredException handling

- in CloseCQ command
- Add unit tests to confirm proper message is sent

GEODE-9875: client operation should not send in invalid userId. (apache#7173)

GEODE-9867: do not process the message if the connection is terminated (apache#7158)

GEODE-9803: Fix the flaky "Failed To find authenticated user" problem (apache#7149)

* GEODE-9803: Fix the flaky "Failed To find authenticated user" problem

* Only to update subject on the ClientCacheProxy if it's waiting for re-auth
* logout the subject in one place when we close the dispatcher
* reset the timer when we stopped waiting

GEODE-9820: stopCQ should handle general exception same way as ExecuteCQ61 (apache#7122)

GEODE-9803: turning on security debug log in the test and add more debug logging (apache#7117)

GEODE-9746: do not logout old subjects immediately when we get a new subject for the same uniqueId (apache#7063)

* add more logging for future debugging
* minor bug fix in CacheClientProxy

GEODE-9792: synchronize multi-user authentication on different threads (apache#7088)

GEODE-9792: avoid sending in multiple authentication request on the same connection by different threads. (apache#7067)

GEODE-9723: test transactions with auth expiration (apache#7012)

Add tests to confirm that client transactions are not disrupted when authentication expires and automatic re-authentication takes place.

    complete transaction with commit
    transaction rollback
    suspended and resumed transaction with commit
    failed re-authentication with commit and rollback on partial transaction
    add test to include PARTITION region behavior

GEODE-9674: For durable client, when client reconnects, server should retrieve the message from the queue, not continue to try to deliver the last un-delivered message.

GEODE-9749: ignore the test case that shows GEODE-9704. (apache#7015)

GEODE-9534, GEODE-9540: add more tests for peer communication and bulk operations (apache#6985)

* add more tests for durable clients

GEODE-9674: fix durable client message loss issue in tests. (apache#6947)

* for caching_proxy region, count the events received instread of the region size
* do not try to dispatch residual messages when exception occurred.
* add durable client flag when register interest

GEODE-9534: get rid of some test warnings (apache#6945)

GEODE-9663: refactor authenticateIfRequired (apache#6948)

GEODE-9663: throw and handle AuthenticationExpiredException at login time (apache#6927)

* GEODE-9663: throw and handle AuthenticationExpiredException at login time

GEODE-9658: refactor test AuthInit to not use static field for credentials. (apache#6922)

GEODE-9570: make sure re-authentication works with registered interests (apache#6885)

GEODE-9459: testing clients with WAN connected cluster (apache#6901)

GEODE-9457: re-authentication in event dispatcher (apache#6835)

* authorize the message before dispatching the message to the client
* add a new message type to be sent to the client for re-authentiate
* message dispatcher will wait for a certain time for client to reauthenticate before terminating the client
* when re-authenticate, the new subject will re-use the original uniqueId. Credentials will be sent to the user along with the old uniqueId if exists.
* old subject will be cleaned out when new subject re-authenticate back.
* re-auth multi-user mode in event dispatching is not supported (yet).

GEODE-9458: Enhance function execution testing auth expiry (apache#6865)

* GEODE-9458: Enhance function execution testing auth expiry

GEODE-9521: add more multi-server test scenario (apache#6860)

* remove the static methods in ExpirableSecurityManager

GEODE-9586: modify 1.15.0's client server protocol version (apache#6846)

GEODE-9458: function execution with expiring authentication (apache#6789)

* GEODE-9456, GEODE-9452: Authentication Expiration (apache#6721)

* Add tests and throw AuthenticationExpiredException
Co-authored-by: Joris Melchior <joris.melchior@gmail.com>

* GEODE-9460: Add testing for mutli-user scenarios (apache#6755)

Co-Authored-By Jinmei Liao <jiliao@vmware.com>

* review update

* revert accidental change

* GEODE-9458: function execution with expiring authentication

* Changes based on review

* Changes based on review, parameterization

Co-authored-by: Jinmei Liao <jiliao@pivotal.io>

GEODE-9451: On demand authentication expiration and re-authentication (apache#6787)

* GEODE-9456, GEODE-9452: Authentication Expiration (apache#6721)
* Add tests and throw AuthenticationExpiredException
* GEODE-9460: Add testing for mutli-user scenarios (apache#6755)

Co-authored-by: Joris Melchior <joris.melchior@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants