in emr-user-role-mapper-application/src/main/java/com/amazon/aws/emr/mapping/MappingInvoker.java [100:116]
public Optional<AssumeRoleRequest> map(String username) {
readLockInRwLock.lock();
try {
Optional<AssumeRoleRequest> assumeRoleRequest = roleMapperProvider.getMapping(username);
if (assumeRoleRequest.isPresent() && applicationConfiguration.isSetSourceIdentityEnabled()) {
assumeRoleRequest.get().setSourceIdentity(username);
}
log.debug("Found mapping for {} as {}", username, assumeRoleRequest);
return assumeRoleRequest;
} catch (Throwable t) {
// We are running some custom code that could throw anything.
log.error("Got exception in getting mapping for {}", username, t);
return Optional.empty();
} finally {
readLockInRwLock.unlock();
}
}