def _BuildToken(self, request, execution_time):
    'Build an ACLToken from the request.'
    token = access_control.ACLToken(username=request.user, reason=request.args.get('reason', ''), process='GRRAdminUI', expiry=(rdfvalue.RDFDatetime.Now() + execution_time))
    for field in ['Remote_Addr', 'X-Forwarded-For']:
        remote_addr = request.headers.get(field, '')
        if remote_addr:
            token.source_ips.append(remote_addr)
    return token
Build an ACLToken from the request.
def _BuildToken(self, request, execution_time):
    
    token = access_control.ACLToken(username=request.user, reason=request.args.get('reason', ), process='GRRAdminUI', expiry=(rdfvalue.RDFDatetime.Now() + execution_time))
    for field in ['Remote_Addr', 'X-Forwarded-For']:
        remote_addr = request.headers.get(field, )
        if remote_addr:
            token.source_ips.append(remote_addr)
    return token