1616 */
1717package org .apache .rocketmq .auth .authentication .strategy ;
1818
19- import java .util .ArrayList ;
20- import java .util .List ;
19+ import java .util .HashSet ;
20+ import java .util .Set ;
2121import java .util .function .Supplier ;
2222import org .apache .commons .lang3 .StringUtils ;
2323import org .apache .rocketmq .auth .authentication .context .AuthenticationContext ;
3030public abstract class AbstractAuthenticationStrategy implements AuthenticationStrategy {
3131
3232 protected final AuthConfig authConfig ;
33- protected final List <String > authenticationWhitelist = new ArrayList <>();
33+ protected final Set <String > authenticationWhiteSet = new HashSet <>();
3434 protected final AuthenticationProvider <AuthenticationContext > authenticationProvider ;
3535
3636 public AbstractAuthenticationStrategy (AuthConfig authConfig , Supplier <?> metadataService ) {
@@ -42,7 +42,7 @@ public AbstractAuthenticationStrategy(AuthConfig authConfig, Supplier<?> metadat
4242 if (StringUtils .isNotBlank (authConfig .getAuthenticationWhitelist ())) {
4343 String [] whitelist = StringUtils .split (authConfig .getAuthenticationWhitelist (), "," );
4444 for (String rpcCode : whitelist ) {
45- this .authenticationWhitelist .add (StringUtils .trim (rpcCode ));
45+ this .authenticationWhiteSet .add (StringUtils .trim (rpcCode ));
4646 }
4747 }
4848 }
@@ -57,7 +57,7 @@ protected void doEvaluate(AuthenticationContext context) {
5757 if (this .authenticationProvider == null ) {
5858 return ;
5959 }
60- if (this .authenticationWhitelist .contains (context .getRpcCode ())) {
60+ if (this .authenticationWhiteSet .contains (context .getRpcCode ())) {
6161 return ;
6262 }
6363 try {
0 commit comments