Skip to content
This repository has been archived by the owner on May 10, 2022. It is now read-only.

feat(security): add ReplicaSession interceptor #135

Merged
merged 21 commits into from
Sep 24, 2020

Conversation

levy5307
Copy link
Contributor

@levy5307 levy5307 commented Sep 21, 2020

  • add ReplicaSession hook to deal with some situations, such as session connected、sending a message.
  • add some configurations

@@ -0,0 +1,10 @@
client {
com.sun.security.auth.module.Krb5LoginModule required

Choose a reason for hiding this comment

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

Does this config format support comment? Can you write a comment of description on top of each config item?
Furthermore, does it mean that every of our users should have this file in their project?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I removed the pegasus_jaas.conf. So we can add it in later pull request. And I will refactor it in a better way at that time.

foreverneverer
foreverneverer previously approved these changes Sep 22, 2020
@levy5307 levy5307 changed the title feat(security): add ReplicaSession hook feat(security): add ReplicaSession interceptor Sep 22, 2020
public ReplicaSession(
rpc_address address, EventLoopGroup rpcGroup, int socketTimeout, boolean enableAuth) {

Choose a reason for hiding this comment

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

You can pass ClientOptions here. Each ReplicaSession creates its ReplicaSessionInterceptorManager separately.

  public ReplicaSession(rpc_address address, EventLoopGroup rpcGroup, int socketTimeout, ClientOptions opts) {
    interceptors = new ReplicaSessionInterceptorManager(opts);
    enableAuth = opts.enableAuth();
  }

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I don't think we should create a ReplicaSessionInterceptorManager for each ReplicationSession. Each ClusterManager has a ReplicaSessionInterceptorManager is enough

@levy5307 levy5307 merged commit 3615cfd into XiaoMi:master Sep 24, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants