mbaechler commented on code in PR #2897:
URL: https://github.com/apache/james-project/pull/2897#discussion_r2662591485
##########
mailbox/api/src/main/java/org/apache/james/mailbox/Authorizator.java:
##########
@@ -38,7 +38,17 @@ interface FluentAuthorizator {
enum AuthorizationState {
ALLOWED,
FORBIDDEN,
- UNKNOWN_USER
+ UNKNOWN_USER;
+
+ static AuthorizationState combine(AuthorizationState a,
AuthorizationState b) {
+ if (a.equals(AuthorizationState.FORBIDDEN)) {
Review Comment:
enum instances can be compared with `==` and it's actually safer as it
enforces the type of both operands
##########
server/protocols/protocols-imap4/src/main/java/org/apache/james/imapserver/netty/IMAPServer.java:
##########
@@ -249,19 +250,21 @@ private static Integer
parseLiteralSizeLimit(HierarchicalConfiguration<Immutable
@VisibleForTesting static ImapConfiguration
getImapConfiguration(HierarchicalConfiguration<ImmutableNode> configuration) {
ImmutableSet<String> disabledCaps =
ImmutableSet.copyOf(Splitter.on(CAPABILITY_SEPARATOR).split(configuration.getString("disabledCaps",
"")));
+ ImmutableList<String> adminUsers =
ImmutableList.copyOf(Splitter.on(CAPABILITY_SEPARATOR).split(configuration.getString("auth.adminUsers",
"")));
Review Comment:
well, it's a capability, we should not reuse capability separator, right?
##########
server/protocols/protocols-imap4/src/test/resources/imapServerAdminUsers.xml:
##########
@@ -0,0 +1,18 @@
+<imapserver enabled="true">
+ <jmxName>imapserver</jmxName>
+ <bind>0.0.0.0:0</bind>
+ <connectionBacklog>200</connectionBacklog>
+ <connectionLimit>0</connectionLimit>
+ <connectionLimitPerIP>0</connectionLimitPerIP>
+ <idleTimeInterval>120</idleTimeInterval>
+ <idleTimeIntervalUnit>SECONDS</idleTimeIntervalUnit>
+ <enableIdle>true</enableIdle>
+ <inMemorySizeLimit>64K</inMemorySizeLimit>
+ <literalSizeLimit>128K</literalSizeLimit>
+ <plainAuthDisallowed>false</plainAuthDisallowed>
+ <gracefulShutdown>false</gracefulShutdown>
+ <concurrentRequests>20</concurrentRequests>
+ <auth>
+ <adminUsers>[email protected]|[email protected]</adminUsers>
Review Comment:
what about using xml as it's meant to with several `<adminUser>` tags?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]