コード例 #1
0
        /// <summary>
        /// Constructs a new access policy condition that compares an Amazon S3
        /// canned ACL with the canned ACL specified by an incoming request.
        /// <para>
        /// You can use this condition to ensure that any objects uploaded to an
        /// Amazon S3 bucket have a specific canned ACL set.
        /// </para>
        /// </summary>
        /// <param name="cannedAcl">The Amazon S3 canned ACL to compare against.</param>
        /// <returns>A new access control policy condition that compares the Amazon S3
        ///         canned ACL specified in incoming requests against the value
        ///         specified.</returns>
        public static Condition NewCannedACLCondition(S3CannedACL cannedAcl)
        {
            string cannedHeader = S3Constants.CannedAcls[(int)cannedAcl];

            return(ConditionFactory.NewCondition(StringComparisonType.StringEquals,
                                                 S3_CANNED_ACL_CONDITION_KEY, cannedHeader));
        }
コード例 #2
0
 /// <summary>
 /// Constructs a new AWS access control policy condition that allows an
 /// access control statement to restrict subscriptions to an Amazon SNS topic
 /// based on the protocol being used for the subscription. For example, this
 /// condition can restrict subscriptions to a topic to endpoints using HTTPS
 /// to ensure that messages are securely delivered.
 /// </summary>
 /// <param name="protocol">The protocol against which to compare the requested protocol
 ///            for an Amazon SNS topic subscription.</param>
 /// <returns>A new access control policy condition that compares the
 ///         notification protocol requested in a request to subscribe to an
 ///         Amazon SNS topic with the protocol value specified.</returns>
 public static Condition NewProtocolCondition(string protocol)
 {
     return(ConditionFactory.NewCondition(StringComparisonType.StringEquals,
                                          SNS_PROTOCOL_CONDITION_KEY, protocol));
 }
コード例 #3
0
 /// <summary>
 /// Constructs a new access policy condition that compares the requested
 /// endpoint used to subscribe to an Amazon SNS topic with the specified
 /// endpoint pattern. The endpoint pattern may optionally contain the
 /// multi-character wildcard (*) or the single-character wildcard (?).
 /// <para>
 /// For example, this condition can restrict subscriptions to a topic to
 /// email addresses in a certain domain ("*@my-company.com").
 /// </para>
 /// <code>
 /// Policy policy = new Policy("MyTopicPolicy");
 /// policy.WithStatements(new Statement(Statement.StatementEffect.Allow)
 ///        .WithPrincipals(new Principal("*")).WithActionIdentifiers(SNSActionIdentifiers.Subscribe)
 ///        .WithResources(new Resource(myTopicArn))
 ///        .WithConditions(ConditionFactory.NewEndpointCondition("*@my-company.com")));
 /// </code>
 /// </summary>
 /// <param name="endpointPattern">The endpoint pattern against which to compare the requested
 ///            endpoint for an Amazon SNS topic subscription.</param>
 /// <returns>A new access control policy condition that compares the endpoint
 ///         used in a request to subscribe to an Amazon SNS topic with the
 ///         endpoint pattern specified.</returns>
 public static Condition NewEndpointCondition(string endpointPattern)
 {
     return(ConditionFactory.NewCondition(StringComparisonType.StringLike,
                                          SNS_ENDPOINT_CONDITION_KEY, endpointPattern));
 }
コード例 #4
0
 /// <summary>
 /// Constructs a new access policy condition that compares an Amazon S3
 /// canned ACL with the canned ACL specified by an incoming request.
 /// <para>
 /// You can use this condition to ensure that any objects uploaded to an
 /// Amazon S3 bucket have a specific canned ACL set.
 /// </para>
 /// </summary>
 /// <param name="cannedAcl">The Amazon S3 canned ACL to compare against.</param>
 /// <returns>A new access control policy condition that compares the Amazon S3
 ///         canned ACL specified in incoming requests against the value
 ///         specified.</returns>
 public static Condition NewCannedACLCondition(string cannedAcl)
 {
     return(ConditionFactory.NewCondition(StringComparisonType.StringEquals, S3_CANNED_ACL_CONDITION_KEY, cannedAcl));
 }