Package org.apache.accumulo.core.security.thrift

Examples of org.apache.accumulo.core.security.thrift.ThriftSecurityException$ThriftSecurityExceptionTupleScheme


        boolean fatal = false;
        try {
          log.debug("Got " + request + " message from user: " + credentials.user);
          if (!authenticator.hasSystemPermission(credentials, credentials.user, SystemPermission.SYSTEM)) {
            log.warn("Got " + request + " message from user: " + credentials.user);
            throw new ThriftSecurityException(credentials.user, SecurityErrorCode.PERMISSION_DENIED);
          }
        } catch (AccumuloSecurityException e) {
          log.warn("Got " + request + " message from unauthenticatable user: " + e.getUser());
          if (e.getUser().equals(SecurityConstants.SYSTEM_USERNAME)) {
            log.fatal("Got message from a service with a mismatched configuration. Please ensure a compatible configuration.", e);
View Full Code Here


    @Override
    public List<ActiveScan> getActiveScans(TInfo tinfo, AuthInfo credentials) throws ThriftSecurityException, TException {
     
      try {
        if (!authenticator.hasSystemPermission(credentials, credentials.user, SystemPermission.SYSTEM))
          throw new ThriftSecurityException(credentials.user, SecurityErrorCode.PERMISSION_DENIED);
      } catch (AccumuloSecurityException e) {
        throw e.asThriftException();
      }
     
      return sessionManager.getActiveScans();
View Full Code Here

   
    @Override
    public void chop(TInfo tinfo, AuthInfo credentials, String lock, TKeyExtent textent) throws TException {
      try {
        if (!authenticator.hasSystemPermission(credentials, credentials.user, SystemPermission.SYSTEM))
          throw new ThriftSecurityException(credentials.user, SecurityErrorCode.PERMISSION_DENIED);
      } catch (Exception e) {
        throw new RuntimeException(e);
      }
      KeyExtent ke = new KeyExtent(textent);
     
View Full Code Here

   
    @Override
    public void compact(TInfo tinfo, AuthInfo credentials, String lock, String tableId, ByteBuffer startRow, ByteBuffer endRow) throws TException {
      try {
        if (!authenticator.hasSystemPermission(credentials, credentials.user, SystemPermission.SYSTEM))
          throw new ThriftSecurityException(credentials.user, SecurityErrorCode.PERMISSION_DENIED);
      } catch (Exception e) {
        throw new RuntimeException(e);
      }
     
      KeyExtent ke = new KeyExtent(new Text(tableId), ByteBufferUtil.toText(endRow), ByteBufferUtil.toText(startRow));
View Full Code Here

          log.debug("Failed to scan !METADATA table to wait for flush " + tableId, e);
        } catch (TabletDeletedException tde) {
          log.debug("Failed to scan !METADATA table to wait for flush " + tableId, tde);
        } catch (AccumuloSecurityException e) {
          log.warn(e.getMessage(), e);
          throw new ThriftSecurityException();
        } catch (TableNotFoundException e) {
          log.error(e.getMessage(), e);
          throw new ThriftTableOperationException();
        }
      }
View Full Code Here

    }
   
    private void authenticate(AuthInfo credentials) throws ThriftSecurityException {
      try {
        if (!authenticator.authenticateUser(credentials, credentials.user, credentials.password))
          throw new ThriftSecurityException(credentials.user, SecurityErrorCode.BAD_CREDENTIALS);
      } catch (AccumuloSecurityException e) {
        throw e.asThriftException();
      }
    }
View Full Code Here

 
  private void checkForSystemPrivs(String request, AuthInfo credentials) throws ThriftSecurityException {
    try {
      if (!authenticator.hasSystemPermission(credentials, credentials.user, SystemPermission.SYSTEM)) {
        LOG.warn("Got " + request + " from user: " + credentials.user);
        throw new ThriftSecurityException(credentials.user, SecurityErrorCode.PERMISSION_DENIED);
      }
    } catch (AccumuloSecurityException e) {
      LOG.warn("Got " + request + " from unauthenticatable user: " + e.getUser());
      throw e.asThriftException();
    }
View Full Code Here

 
  /**
   * @return this exception as a thrift exception
   */
  public ThriftSecurityException asThriftException() {
    return new ThriftSecurityException(user, errorCode);
  }
View Full Code Here

      ArrayList<TKeyExtent> failures = new ArrayList<TKeyExtent>();
     
      for (Entry<TKeyExtent,Map<String,MapFileInfo>> entry : files.entrySet()) {
        try {
          if (!authenticator.hasTablePermission(credentials, credentials.user, new String(entry.getKey().getTable()), TablePermission.BULK_IMPORT))
            throw new ThriftSecurityException(credentials.user, SecurityErrorCode.PERMISSION_DENIED);
        } catch (AccumuloSecurityException e) {
          throw e.asThriftException();
        }
      }
     
View Full Code Here

     
      Authorizations userauths = null;
     
      try {
        if (!authenticator.hasTablePermission(credentials, credentials.user, new String(textent.getTable()), TablePermission.READ))
          throw new ThriftSecurityException(credentials.user, SecurityErrorCode.PERMISSION_DENIED);
       
        userauths = authenticator.getUserAuthorizations(credentials, credentials.user);
        for (byte[] auth : authorizations)
          if (!userauths.contains(auth))
            throw new ThriftSecurityException(credentials.user, SecurityErrorCode.BAD_AUTHORIZATIONS);
      } catch (AccumuloSecurityException e) {
        throw e.asThriftException();
      }
     
      scanCount.addAndGet(1);
View Full Code Here

TOP

Related Classes of org.apache.accumulo.core.security.thrift.ThriftSecurityException$ThriftSecurityExceptionTupleScheme

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.