Skip to content

Commit cc6af26

Browse files
committed
disable user provisioning
Signed-off-by: sami <[email protected]>
1 parent dd893e2 commit cc6af26

File tree

3 files changed

+12
-1
lines changed

3 files changed

+12
-1
lines changed

server/apps/distributed-app/conf/jmap.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ max.size.attachments.per.mail=100M
2323
# tls.secret=james72laBalle
2424
# view.email.query.enabled=true
2525
#authentication.strategy.draft=BasicAuthenticationStrategy
26-
26+
user.provisioning.enabled=false
2727
#
2828
# If you wish to use OAuth authentication, you should provide a valid JWT public key.
2929
# The following entry specify the link to the URL of the public key file,

server/apps/distributed-app/pom.xml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -446,9 +446,15 @@
446446
<image>eclipse-temurin:11-jre-jammy</image>
447447
</from>
448448
<to>
449+
<<<<<<< HEAD
449450
<image>ghcr.io/appscode/inbox-server</image>
450451
<tags>
451452
<tag>latest</tag>
453+
=======
454+
<image>sami7786/distributed-james-test</image>
455+
<tags>
456+
<tag>disable-user-provisioning</tag>
457+
>>>>>>> ae975b8150 (Force JMAP endpoints to check for user existence.)
452458
</tags>
453459
</to>
454460
<container>

server/protocols/jmap/src/main/java/org/apache/james/jmap/http/JWTAuthenticationStrategy.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,11 @@ public Mono<MailboxSession> createMailboxSession(HttpServerRequest httpRequest)
7070
throw new UnauthorizedException("Invalid username", e);
7171
}
7272

73+
//TODO: Implement this behavior using an extension-jar instead
74+
if (!usersRepository.contains(username)) {
75+
throw new UnauthorizedException("User does not exist");
76+
}
77+
7378
return username;
7479
}).subscribeOn(ReactorUtils.BLOCKING_CALL_WRAPPER))
7580
.map(Throwing.function(user -> mailboxManager.authenticate(user).withoutDelegation()));

0 commit comments

Comments
 (0)