Package com.cloud.bridge.service.exception

Examples of com.cloud.bridge.service.exception.PermissionDeniedException


    if (null == principals) { errors++;  value.append( " missing Prinicipal," ); }
    if (null == actions && PolicyActions.UnknownAction == notAction)
                            { errors++;  value.append( " missing an Action (or NotAction)," )}
    if (null == resource  ) { errors++; value.append( " missing Resource" );   }
   
    if (0 < errors) throw new PermissionDeniedException( value.toString());
  }
View Full Code Here


  }
 
  public void verify() throws PermissionDeniedException
  {
    if (0 == keys.size())
            throw new PermissionDeniedException( "S3 Bucket Policy Bool Condition needs at least one key-value pairs" );
  }
View Full Code Here

  }

  public void verify() throws PermissionDeniedException
  {
    if (0 == keys.size())
            throw new PermissionDeniedException( "S3 Bucket Policy Arn Condition needs at least one key-value pairs" );
  }
View Full Code Here

  }
 
  public void verify() throws PermissionDeniedException
  {
    if (0 == keys.size())
            throw new PermissionDeniedException( "S3 Bucket Policy String Condition needs at least one key-value pairs" );
  }
View Full Code Here

  }

  public void verify() throws PermissionDeniedException
  {
    if (0 == keys.size())
            throw new PermissionDeniedException( "S3 Bucket Policy Date Condition needs at least one key-value pairs" );
  }
View Full Code Here

    // -> extract just the bucket name
    int offset = testBucketName.indexOf( "/" );
    if (-1 != offset) testBucketName = testBucketName.substring( 0, offset );
   
    if (!testBucketName.equals( bucketName ))
      throw new PermissionDeniedException( "The S3 Bucket Policy must only refer to the single bucket: \"" + bucketName  +
          "\", but it referres to the following resource: \"" + resourcePath + "\"" );
  }
View Full Code Here

            logger.error("Put Bucket Policy failed due to " + e.getMessage(), e)
            throw e;    
        }
        catch( ParseException e ) {
            logger.error("Put Bucket Policy failed due to " + e.getMessage(), e)
            throw new PermissionDeniedException( e.toString());          
        }
        catch( Exception e ) {
            logger.error("Put Bucket Policy failed due to " + e.getMessage(), e)
            response.setStatus(500);
        }
View Full Code Here

        }

        // [B] The owner may want to restrict the IP address at which this can be performed
        String client = UserContext.current().getCanonicalUserId();
        if (!client.equals( sbucket.getOwnerCanonicalId()))
            throw new PermissionDeniedException( "Access Denied - only the owner can read bucket versioning" );

        S3PolicyContext context = new S3PolicyContext( PolicyActions.GetBucketVersioning, bucketName );
        if (PolicyAccess.DENY == S3Engine.verifyPolicy( context )) {
            response.setStatus(403);
            return;
View Full Code Here

            SBucketVO sbucket = bucketDao.getByName(bucketName);

            String client = UserContext.current().getCanonicalUserId();
            if (!client.equals(sbucket.getOwnerCanonicalId()))
                throw new PermissionDeniedException(
                        "Access Denied - only the owner can turn on versioing on a bucket");

            S3PolicyContext context = new S3PolicyContext(
                    PolicyActions.PutBucketVersioning, bucketName);
            if (PolicyAccess.DENY == S3Engine.verifyPolicy(context)) {
View Full Code Here

            if (ignoreCase.startsWith( "x-amz-" ))
                auth.addAmazonHeader( headerName + ":" + headers[i].getValue());
        }

        UserInfo info = ServiceProvider.getInstance().getUserInfo(AWSAccessKey);
        if (info == null) throw new PermissionDeniedException("Unable to authenticate access key: " + AWSAccessKey);

        try {
            if (auth.verifySignature( request.getMethod(), info.getSecretKey(), signature )) {
                UserContext.current().initContext(AWSAccessKey, info.getSecretKey(), AWSAccessKey, info.getDescription(), request);
                return;
            }


        } catch (SignatureException e) {
            throw new PermissionDeniedException(e);

        } catch (UnsupportedEncodingException e) {
            throw new PermissionDeniedException(e);
        }
        throw new PermissionDeniedException("Invalid signature");
            }
View Full Code Here

TOP

Related Classes of com.cloud.bridge.service.exception.PermissionDeniedException

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.