FairCallQueue S3G impersonation on Ozone
Christos Bisias
Known issues
IdentityProvider
public class UserIdentityProvider implements IdentityProvider {
public UserIdentityProvider() {
}
public String makeIdentity(Schedulable obj) {
UserGroupInformation ugi = obj.getUserGroupInformation();
return ugi == null ? null : ugi.getShortUserName();
}
}
Schedulable
public interface Schedulable {
UserGroupInformation getUserGroupInformation();
int getPriorityLevel();
}
OzoneIdentityProvider and new Schedulable
CallerContext
Exposing the CallerContext
public interface Schedulable {
UserGroupInformation getUserGroupInformation();
default public CallerContext getCallerContext() {
return null;
}
int getPriorityLevel();
}
Exposing the CallerContext
@Override
public CallerContext getCallerContext() {
return this.callerContext;
}
Ozone side changes
public String makeIdentity(Schedulable schedulable) {
UserGroupInformation ugi = schedulable.getUserGroupInformation();
CallerContext callerContext = schedulable.getCallerContext();
if (callerContext != null) {
if (!StringUtil.isNullOrEmpty(callerContext.getContext())) {
return callerContext.getContext();
}
}
return ugi.getShortUserName() == null ? null : ugi.getShortUserName();
}
Ozone side changes
CallerContext callerContext =
new CallerContext
.Builder(threadLocalS3Auth.get().getAccessID())
.build();
CallerContext.setCurrent(callerContext);
Would the hadoop team consider accepting such a change?
If so, what are the next steps?