Move the Auth module from server to common for reuse by Yao-MR · Pull Request #7280 · apache/kyuubi

It looks like a break change.

I saw you want to enable the authentication for metrics port.

How about using the reflection to inject the AuthenticationFilter in kyuubi-metrics module?

val holder = new FilterHolder(new AuthenticationFilter(conf))
contextHandler.addFilter(holder, "/v1/*", EnumSet.allOf(classOf[DispatcherType]))

Please add an config item for the new feature and disable it by defaults.

@turboFei yes, it is a break change , and also we can use reflection to reslove this for reuse,

but there is a problem that all the class releated with authoration is in the server module,
and the reflection will be complexed and not easy to read

what is your idea?