{"action":"opened","issue":{"url":"https://api.github.com/repos/SwingDev/s3-browser-direct-upload/issues/1","labels_url":"https://api.github.com/repos/SwingDev/s3-browser-direct-upload/issues/1/labels{/name}","comments_url":"https://api.github.com/repos/SwingDev/s3-browser-direct-upload/issues/1/comments","events_url":"https://api.github.com/repos/SwingDev/s3-browser-direct-upload/issues/1/events","html_url":"https://github.com/SwingDev/s3-browser-direct-upload/issues/1","id":98233031,"number":1,"title":"Support for condition matching","user":{"login":"arlando","id":942114,"avatar_url":"https://avatars.githubusercontent.com/u/942114?v=3","gravatar_id":"","url":"https://api.github.com/users/arlando","html_url":"https://github.com/arlando","followers_url":"https://api.github.com/users/arlando/followers","following_url":"https://api.github.com/users/arlando/following{/other_user}","gists_url":"https://api.github.com/users/arlando/gists{/gist_id}","starred_url":"https://api.github.com/users/arlando/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/arlando/subscriptions","organizations_url":"https://api.github.com/users/arlando/orgs","repos_url":"https://api.github.com/users/arlando/repos","events_url":"https://api.github.com/users/arlando/events{/privacy}","received_events_url":"https://api.github.com/users/arlando/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-07-30T18:35:11Z","updated_at":"2015-07-30T18:35:11Z","closed_at":null,"body":"I want to be able to use condition matching for keys and other things. Currently the API does not expose a conditions option and some of the required options has a type of a string which does not match the array required for conditions. Would code this in but I'm not sure if condition matching is supported for the other end points (get, put).\r\n\r\n[Amazon condition matching documents.](http://docs.aws.amazon.com/AmazonS3/latest/dev/HTTPPOSTForms.html#ConditionMatching)\r\n\r\nI think the API could look like this:\r\n\r\n```javascript\r\n{\r\nkey: String // optional\r\nconditions: [[] ..[]] // an array of arrays of condition matches\r\n}\r\n...\r\n[\r\n[\"condition\", \"<key0>\", \"pattern\"],\r\n...\r\n[\"condition\", \"<key1>\", \"pattern\"]\r\n]\r\n}\r\n```\r\n\r\nThe script could process by mapping the <keys> to an conditional object: ```{key0: [\"condition\", \"<key0>\", \"pattern\"]}``` checking that if a required key does not exist in the options, if it exists in the conditional its ok. A single key may have multiple conditions, we should just append the conditions array to the conditions on the policy. Not sure if this feature exists already.\r\n"}}