)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":6460,"name":"Brad Topol","email":"btopol@us.ibm.com","username":"btopol"},"change_message_id":"48bd9e8a4de38f5a3287df8161d5cdf13157ea37","unresolved":false,"context_lines":[{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Initial implementation of validator"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"This is a the initial implementation of a jsonschema type"},{"line_number":10,"context_line":"validator for the Keystone API. Something very similar to this is used"},{"line_number":11,"context_line":"in Nova V3 for validation. By using jsonschema to validate API requests,"},{"line_number":12,"context_line":"we can make parameters that are passed in fit the criteria we allow and"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":19,"id":"1ae5cdf2_f9b880e7","line":9,"updated":"2014-06-07 22:30:17.000000000","message":"typo. remove the \u0027a\u0027 before the","commit_id":"9b41c624d8c33a093d8af5eef93e4fafe63fe36f"},{"author":{"_account_id":5046,"name":"Lance Bragstad","email":"lbragstad@redhat.com","username":"ldbragst"},"change_message_id":"6779c78b1d179a454992ac3b84f79499d4125248","unresolved":false,"context_lines":[{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Initial implementation of validator"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"This is a the initial implementation of a jsonschema type"},{"line_number":10,"context_line":"validator for the Keystone API. Something very similar to this is used"},{"line_number":11,"context_line":"in Nova V3 for validation. By using jsonschema to validate API requests,"},{"line_number":12,"context_line":"we can make parameters that are passed in fit the criteria we allow and"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":19,"id":"1ae5cdf2_8cb57cd2","line":9,"in_reply_to":"1ae5cdf2_f9b880e7","updated":"2014-06-08 04:39:36.000000000","message":"Done","commit_id":"9b41c624d8c33a093d8af5eef93e4fafe63fe36f"}],"keystone/common/validation/__init__.py":[{"author":{"_account_id":6482,"name":"Steve Martinelli","email":"s.martinelli@gmail.com","username":"stevemar"},"change_message_id":"47f32a863cfe136fef846a879eadf3ffa7983dc6","unresolved":false,"context_lines":[{"line_number":19,"context_line":"def schema(request_body_schema, resource_to_validate):"},{"line_number":20,"context_line":"    \"\"\"Register a schema to validate a resource reference."},{"line_number":21,"context_line":""},{"line_number":22,"context_line":"    Registered schema will be used for validating request body just before"},{"line_number":23,"context_line":"    API method executing."},{"line_number":24,"context_line":""},{"line_number":25,"context_line":"    :param request_body_schema: a schema to validate the resource reference"}],"source_content_type":"text/x-python","patch_set":14,"id":"1ae5cdf2_fdff3165","line":22,"updated":"2014-06-03 06:55:49.000000000","message":"nit: validating *a* request body","commit_id":"410cc30e871bb9c500241f91b897461848232aef"},{"author":{"_account_id":5046,"name":"Lance Bragstad","email":"lbragstad@redhat.com","username":"ldbragst"},"change_message_id":"d24a4d6e21c903857e835867fd2af1575fcbf585","unresolved":false,"context_lines":[{"line_number":19,"context_line":"def schema(request_body_schema, resource_to_validate):"},{"line_number":20,"context_line":"    \"\"\"Register a schema to validate a resource reference."},{"line_number":21,"context_line":""},{"line_number":22,"context_line":"    Registered schema will be used for validating request body just before"},{"line_number":23,"context_line":"    API method executing."},{"line_number":24,"context_line":""},{"line_number":25,"context_line":"    :param request_body_schema: a schema to validate the resource reference"}],"source_content_type":"text/x-python","patch_set":14,"id":"1ae5cdf2_c52d2e97","line":22,"in_reply_to":"1ae5cdf2_fdff3165","updated":"2014-06-03 17:40:12.000000000","message":"Done","commit_id":"410cc30e871bb9c500241f91b897461848232aef"},{"author":{"_account_id":6460,"name":"Brad Topol","email":"btopol@us.ibm.com","username":"btopol"},"change_message_id":"48bd9e8a4de38f5a3287df8161d5cdf13157ea37","unresolved":false,"context_lines":[{"line_number":20,"context_line":"    \"\"\"Register a schema to validate a resource reference."},{"line_number":21,"context_line":""},{"line_number":22,"context_line":"    Registered schema will be used for validating a request body just before"},{"line_number":23,"context_line":"    API method executing."},{"line_number":24,"context_line":""},{"line_number":25,"context_line":"    :param request_body_schema: a schema to validate the resource reference"},{"line_number":26,"context_line":"    :param resource_to_validate: the reference to validate"}],"source_content_type":"text/x-python","patch_set":19,"id":"1ae5cdf2_b98c3837","line":23,"updated":"2014-06-07 22:30:17.000000000","message":"executing should be execution","commit_id":"9b41c624d8c33a093d8af5eef93e4fafe63fe36f"},{"author":{"_account_id":5046,"name":"Lance Bragstad","email":"lbragstad@redhat.com","username":"ldbragst"},"change_message_id":"6779c78b1d179a454992ac3b84f79499d4125248","unresolved":false,"context_lines":[{"line_number":20,"context_line":"    \"\"\"Register a schema to validate a resource reference."},{"line_number":21,"context_line":""},{"line_number":22,"context_line":"    Registered schema will be used for validating a request body just before"},{"line_number":23,"context_line":"    API method executing."},{"line_number":24,"context_line":""},{"line_number":25,"context_line":"    :param request_body_schema: a schema to validate the resource reference"},{"line_number":26,"context_line":"    :param resource_to_validate: the reference to validate"}],"source_content_type":"text/x-python","patch_set":19,"id":"1ae5cdf2_8c873c12","line":23,"in_reply_to":"1ae5cdf2_b98c3837","updated":"2014-06-08 04:39:36.000000000","message":"Done","commit_id":"9b41c624d8c33a093d8af5eef93e4fafe63fe36f"},{"author":{"_account_id":2903,"name":"Morgan Fainberg","email":"morgan.fainberg@gmail.com","username":"mdrnstm"},"change_message_id":"f9a1ca2bb95f0f45466ab046cd1024ad0d5a675b","unresolved":false,"context_lines":[{"line_number":31,"context_line":"    def add_validator(func):"},{"line_number":32,"context_line":"        @functools.wraps(func)"},{"line_number":33,"context_line":"        def wrapper(*args, **kwargs):"},{"line_number":34,"context_line":"            schema_validator.validate(kwargs[resource_to_validate])"},{"line_number":35,"context_line":"            return func(*args, **kwargs)"},{"line_number":36,"context_line":"        return wrapper"},{"line_number":37,"context_line":"    return add_validator"}],"source_content_type":"text/x-python","patch_set":21,"id":"1ae5cdf2_4569878b","line":34,"updated":"2014-06-23 19:13:02.000000000","message":"Are there any cases we would be validating something that is passed in as a kwarg explicitly?\n\nIf so this will not work as it\u0027ll raise a key error.\n\nSuggest wrapping in an if statement:\n    if resource_to_validate in kwargs:\n        schema_validator.validate(kwargs[resource_to_validate])\n\nAlternatively, making the error / exception a bit more explicit (code wont actually work):\n    try:\n        schema_validator.validate(kwargs[resource_to_validate])\n    except KeyError:\n        raise Exception(\u0027expected \u003cresource to validate\u003e argument in call to func.__name__, argument not found\u0027)\n\nJust trying to avoid an exception that runs back to the decorator that is harder to follow back in an edge case.","commit_id":"9c3206e6343d58ea0cd5a9ed4ab239041ddc3115"},{"author":{"_account_id":5046,"name":"Lance Bragstad","email":"lbragstad@redhat.com","username":"ldbragst"},"change_message_id":"75cbc9fa44dc68afa6abb1bc3381cd24925c756d","unresolved":false,"context_lines":[{"line_number":31,"context_line":"    def add_validator(func):"},{"line_number":32,"context_line":"        @functools.wraps(func)"},{"line_number":33,"context_line":"        def wrapper(*args, **kwargs):"},{"line_number":34,"context_line":"            schema_validator.validate(kwargs[resource_to_validate])"},{"line_number":35,"context_line":"            return func(*args, **kwargs)"},{"line_number":36,"context_line":"        return wrapper"},{"line_number":37,"context_line":"    return add_validator"}],"source_content_type":"text/x-python","patch_set":21,"id":"1ae5cdf2_7f31abec","line":34,"in_reply_to":"1ae5cdf2_4569878b","updated":"2014-06-23 20:40:39.000000000","message":"Done","commit_id":"9c3206e6343d58ea0cd5a9ed4ab239041ddc3115"},{"author":{"_account_id":7725,"name":"David Stanek","email":"dstanek@dstanek.com","username":"dstanek"},"change_message_id":"3e580f62ca51ef7e6b2f89c73611e5f0a97beaaf","unresolved":false,"context_lines":[{"line_number":16,"context_line":"from keystone.common.validation import validators"},{"line_number":17,"context_line":""},{"line_number":18,"context_line":""},{"line_number":19,"context_line":"def schema(request_body_schema, resource_to_validate):"},{"line_number":20,"context_line":"    \"\"\"Register a schema to validate a resource reference."},{"line_number":21,"context_line":""},{"line_number":22,"context_line":"    Registered schema will be used for validating a request body just before"}],"source_content_type":"text/x-python","patch_set":23,"id":"baada198_d93184a3","line":19,"updated":"2014-07-18 14:13:38.000000000","message":"After looking at all of the validation reviews I realized that the name \u0027schema\u0027 sounds a little off. The use \u0027@v.shema(shema.something)\u0027 doesn\u0027t read nicely for me. Also the other decorators I\u0027ve seen in our code read more as a declaration of fact: @v2_deprecated, @protected, etc.\n\nIt feels like validated might be a better name.","commit_id":"5c17237a15a941094f061ddc2ea932c3f05de90f"},{"author":{"_account_id":5046,"name":"Lance Bragstad","email":"lbragstad@redhat.com","username":"ldbragst"},"change_message_id":"ec5ef38bbef7d32fb8c7f1cf685519c82f5ab6de","unresolved":false,"context_lines":[{"line_number":16,"context_line":"from keystone.common.validation import validators"},{"line_number":17,"context_line":""},{"line_number":18,"context_line":""},{"line_number":19,"context_line":"def schema(request_body_schema, resource_to_validate):"},{"line_number":20,"context_line":"    \"\"\"Register a schema to validate a resource reference."},{"line_number":21,"context_line":""},{"line_number":22,"context_line":"    Registered schema will be used for validating a request body just before"}],"source_content_type":"text/x-python","patch_set":23,"id":"baada198_cbbd1cb3","line":19,"in_reply_to":"baada198_d93184a3","updated":"2014-07-18 22:07:55.000000000","message":"Done","commit_id":"5c17237a15a941094f061ddc2ea932c3f05de90f"},{"author":{"_account_id":5046,"name":"Lance Bragstad","email":"lbragstad@redhat.com","username":"ldbragst"},"change_message_id":"f7c16db83bdb73456fe0d79cdda88cd2a268d83b","unresolved":false,"context_lines":[{"line_number":16,"context_line":"from keystone.common.validation import validators"},{"line_number":17,"context_line":""},{"line_number":18,"context_line":""},{"line_number":19,"context_line":"def schema(request_body_schema, resource_to_validate):"},{"line_number":20,"context_line":"    \"\"\"Register a schema to validate a resource reference."},{"line_number":21,"context_line":""},{"line_number":22,"context_line":"    Registered schema will be used for validating a request body just before"}],"source_content_type":"text/x-python","patch_set":23,"id":"baada198_04054979","line":19,"in_reply_to":"baada198_d93184a3","updated":"2014-07-18 22:06:06.000000000","message":"Sounds good, I can push up another patch to rename it.","commit_id":"5c17237a15a941094f061ddc2ea932c3f05de90f"}],"keystone/common/validation/parameter_types.py":[{"author":{"_account_id":6482,"name":"Steve Martinelli","email":"s.martinelli@gmail.com","username":"stevemar"},"change_message_id":"47f32a863cfe136fef846a879eadf3ffa7983dc6","unresolved":false,"context_lines":[{"line_number":28,"context_line":"}"},{"line_number":29,"context_line":""},{"line_number":30,"context_line":"hostname_or_ip_address \u003d {"},{"line_number":31,"context_line":"    # NOTE: Allow to specify hostname, ipv4 and ipv6."},{"line_number":32,"context_line":"    \u0027type\u0027: \u0027string\u0027, \u0027maxLength\u0027: 255,"},{"line_number":33,"context_line":"    \u0027pattern\u0027: \u0027^[a-zA-Z0-9-_.:]*$\u0027"},{"line_number":34,"context_line":"}"}],"source_content_type":"text/x-python","patch_set":14,"id":"1ae5cdf2_9dee2db3","line":31,"updated":"2014-06-03 06:55:49.000000000","message":"nit: i would write NOTE(lbragstad): so we know who to blame ... err.. contact\n\nbunch of spots in this file","commit_id":"410cc30e871bb9c500241f91b897461848232aef"},{"author":{"_account_id":5046,"name":"Lance Bragstad","email":"lbragstad@redhat.com","username":"ldbragst"},"change_message_id":"d24a4d6e21c903857e835867fd2af1575fcbf585","unresolved":false,"context_lines":[{"line_number":28,"context_line":"}"},{"line_number":29,"context_line":""},{"line_number":30,"context_line":"hostname_or_ip_address \u003d {"},{"line_number":31,"context_line":"    # NOTE: Allow to specify hostname, ipv4 and ipv6."},{"line_number":32,"context_line":"    \u0027type\u0027: \u0027string\u0027, \u0027maxLength\u0027: 255,"},{"line_number":33,"context_line":"    \u0027pattern\u0027: \u0027^[a-zA-Z0-9-_.:]*$\u0027"},{"line_number":34,"context_line":"}"}],"source_content_type":"text/x-python","patch_set":14,"id":"1ae5cdf2_45675ee9","line":31,"in_reply_to":"1ae5cdf2_9dee2db3","updated":"2014-06-03 17:40:12.000000000","message":"Done","commit_id":"410cc30e871bb9c500241f91b897461848232aef"},{"author":{"_account_id":6460,"name":"Brad Topol","email":"btopol@us.ibm.com","username":"btopol"},"change_message_id":"48bd9e8a4de38f5a3287df8161d5cdf13157ea37","unresolved":false,"context_lines":[{"line_number":43,"context_line":"    \u0027type\u0027: \u0027string\u0027,"},{"line_number":44,"context_line":"    \u0027minLength\u0027: 0,"},{"line_number":45,"context_line":"    \u0027maxLength\u0027: 225,"},{"line_number":46,"context_line":"    # NOTE(lbragstad): Using a regular expression here instead of the"},{"line_number":47,"context_line":"    # FormatChecker object that is built into jsonschema. The FormatChecker"},{"line_number":48,"context_line":"    # can validate URI formats but it depends on rfc3987 to do that"},{"line_number":49,"context_line":"    # validation, and rfc3987 is GPL licensed. For our purposes here we will"}],"source_content_type":"text/x-python","patch_set":19,"id":"1ae5cdf2_b993584e","line":46,"updated":"2014-06-07 22:30:17.000000000","message":"Great NOTE!!!","commit_id":"9b41c624d8c33a093d8af5eef93e4fafe63fe36f"},{"author":{"_account_id":2903,"name":"Morgan Fainberg","email":"morgan.fainberg@gmail.com","username":"mdrnstm"},"change_message_id":"f9a1ca2bb95f0f45466ab046cd1024ad0d5a675b","unresolved":false,"context_lines":[{"line_number":32,"context_line":"    \u0027type\u0027: \u0027string\u0027,"},{"line_number":33,"context_line":"    \u0027maxLength\u0027: 32,"},{"line_number":34,"context_line":"    \u0027minLength\u0027: 32,"},{"line_number":35,"context_line":"    \u0027pattern\u0027: \u0027^[a-f0-9]*$\u0027"},{"line_number":36,"context_line":"}"},{"line_number":37,"context_line":""},{"line_number":38,"context_line":"description \u003d {"}],"source_content_type":"text/x-python","patch_set":21,"id":"1ae5cdf2_c523d756","line":35,"updated":"2014-06-23 19:13:02.000000000","message":"Technically, capital letters are valid for UUIDs, and we might want to specify this as hex uuid, because \"real\" uuids have dashes in them:\n\n    \u003e\u003e\u003e u \u003d uuid.uuid4().hex\n    \u003e\u003e\u003e u.upper()\n    \u0027A19BBDFD869C4EA7AFEE64697FA3AE97\u0027\n    \u003e\u003e\u003e uuid.UUID(u.upper())\n    UUID(\u0027a19bbdfd-869c-4ea7-afee-64697fa3ae97\u0027)","commit_id":"9c3206e6343d58ea0cd5a9ed4ab239041ddc3115"},{"author":{"_account_id":5046,"name":"Lance Bragstad","email":"lbragstad@redhat.com","username":"ldbragst"},"change_message_id":"75cbc9fa44dc68afa6abb1bc3381cd24925c756d","unresolved":false,"context_lines":[{"line_number":32,"context_line":"    \u0027type\u0027: \u0027string\u0027,"},{"line_number":33,"context_line":"    \u0027maxLength\u0027: 32,"},{"line_number":34,"context_line":"    \u0027minLength\u0027: 32,"},{"line_number":35,"context_line":"    \u0027pattern\u0027: \u0027^[a-f0-9]*$\u0027"},{"line_number":36,"context_line":"}"},{"line_number":37,"context_line":""},{"line_number":38,"context_line":"description \u003d {"}],"source_content_type":"text/x-python","patch_set":21,"id":"1ae5cdf2_9b1a0c7b","line":35,"in_reply_to":"1ae5cdf2_c523d756","updated":"2014-06-23 20:40:39.000000000","message":"Done","commit_id":"9c3206e6343d58ea0cd5a9ed4ab239041ddc3115"},{"author":{"_account_id":5046,"name":"Lance Bragstad","email":"lbragstad@redhat.com","username":"ldbragst"},"change_message_id":"f55913b0d7bdaaa9d89560339a158a2c5ce3369d","unresolved":false,"context_lines":[{"line_number":14,"context_line":"boolean \u003d {"},{"line_number":15,"context_line":"    \u0027type\u0027: [\u0027boolean\u0027, \u0027string\u0027],"},{"line_number":16,"context_line":"    \u0027enum\u0027: [True, \u0027True\u0027, \u0027TRUE\u0027, \u0027true\u0027, \u00271\u0027,"},{"line_number":17,"context_line":"             False, \u0027False\u0027, \u0027FALSE\u0027, \u0027false\u0027, \u00270\u0027]"},{"line_number":18,"context_line":"}"},{"line_number":19,"context_line":""},{"line_number":20,"context_line":"# NOTE(lbragstad): Be mindful of this pattern as it might require changes"}],"source_content_type":"text/x-python","patch_set":23,"id":"baada198_3056d5ce","line":17,"updated":"2014-07-21 14:24:40.000000000","message":"Also going to remove this and make it so that we require a real boolean value instead of \"string-as-boolean\" stuff.","commit_id":"5c17237a15a941094f061ddc2ea932c3f05de90f"},{"author":{"_account_id":7725,"name":"David Stanek","email":"dstanek@dstanek.com","username":"dstanek"},"change_message_id":"9450491b3f591a3df2fe0c76ea0ce535809a03e4","unresolved":false,"context_lines":[{"line_number":25,"context_line":"    \u0027minLength\u0027: 1,"},{"line_number":26,"context_line":"    \u0027maxLength\u0027: 255,"},{"line_number":27,"context_line":"    # NOTE(lbragstad): Allow to some spaces in middle of name."},{"line_number":28,"context_line":"    \u0027pattern\u0027: \u0027^(?! )[a-zA-Z0-9. _-]+(?\u003c! )$\u0027"},{"line_number":29,"context_line":"}"},{"line_number":30,"context_line":""},{"line_number":31,"context_line":"hex_uuid \u003d {"}],"source_content_type":"text/x-python","patch_set":23,"id":"baada198_42af58e3","line":28,"updated":"2014-07-10 23:05:59.000000000","message":"Does this mean that we don\u0027t support international names?","commit_id":"5c17237a15a941094f061ddc2ea932c3f05de90f"},{"author":{"_account_id":5046,"name":"Lance Bragstad","email":"lbragstad@redhat.com","username":"ldbragst"},"change_message_id":"f55913b0d7bdaaa9d89560339a158a2c5ce3369d","unresolved":false,"context_lines":[{"line_number":25,"context_line":"    \u0027minLength\u0027: 1,"},{"line_number":26,"context_line":"    \u0027maxLength\u0027: 255,"},{"line_number":27,"context_line":"    # NOTE(lbragstad): Allow to some spaces in middle of name."},{"line_number":28,"context_line":"    \u0027pattern\u0027: \u0027^(?! )[a-zA-Z0-9. _-]+(?\u003c! )$\u0027"},{"line_number":29,"context_line":"}"},{"line_number":30,"context_line":""},{"line_number":31,"context_line":"hex_uuid \u003d {"}],"source_content_type":"text/x-python","patch_set":23,"id":"baada198_d0b67924","line":28,"in_reply_to":"baada198_42af58e3","updated":"2014-07-21 14:24:40.000000000","message":"Good point, I\u0027ll be removing this pattern for the time being. Fixed in the next patch set.","commit_id":"5c17237a15a941094f061ddc2ea932c3f05de90f"},{"author":{"_account_id":7725,"name":"David Stanek","email":"dstanek@dstanek.com","username":"dstanek"},"change_message_id":"9450491b3f591a3df2fe0c76ea0ce535809a03e4","unresolved":false,"context_lines":[{"line_number":48,"context_line":"    # can validate URI formats but it depends on rfc3987 to do that"},{"line_number":49,"context_line":"    # validation, and rfc3987 is GPL licensed. For our purposes here we will"},{"line_number":50,"context_line":"    # use a regex and not rely on rfc3987 to validate URIs."},{"line_number":51,"context_line":"    \u0027pattern\u0027: \u0027^https?://\u0027"},{"line_number":52,"context_line":"               \u0027(?:(?:[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\\.)\u0027"},{"line_number":53,"context_line":"               \u0027+[a-zA-Z]{2,6}\\.?|\u0027"},{"line_number":54,"context_line":"               \u0027localhost|\u0027"}],"source_content_type":"text/x-python","patch_set":23,"id":"baada198_824b3058","line":51,"updated":"2014-07-10 23:05:59.000000000","message":"Is it possible to extend jsonschema to use rcf3986? It was recently added to the OpenStack requirements project for Nova.\n\nNot sure if it helps at all, but it would free me from parsing this regex.","commit_id":"5c17237a15a941094f061ddc2ea932c3f05de90f"},{"author":{"_account_id":5046,"name":"Lance Bragstad","email":"lbragstad@redhat.com","username":"ldbragst"},"change_message_id":"38b66774a6bcb3383da00cd7597bdb3bca684f94","unresolved":false,"context_lines":[{"line_number":48,"context_line":"    # can validate URI formats but it depends on rfc3987 to do that"},{"line_number":49,"context_line":"    # validation, and rfc3987 is GPL licensed. For our purposes here we will"},{"line_number":50,"context_line":"    # use a regex and not rely on rfc3987 to validate URIs."},{"line_number":51,"context_line":"    \u0027pattern\u0027: \u0027^https?://\u0027"},{"line_number":52,"context_line":"               \u0027(?:(?:[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\\.)\u0027"},{"line_number":53,"context_line":"               \u0027+[a-zA-Z]{2,6}\\.?|\u0027"},{"line_number":54,"context_line":"               \u0027localhost|\u0027"}],"source_content_type":"text/x-python","patch_set":23,"id":"baada198_fa2c779b","line":51,"in_reply_to":"baada198_824b3058","updated":"2014-07-11 14:34:50.000000000","message":"yes, that might help: \n\nhttps://github.com/openstack/requirements/blob/master/global-requirements.txt#L111\n\nI know that jsonschema has a format validator that is based on rfc3987 but I don\u0027t think that we can use it because it is GPL. \n\nhttps://review.openstack.org/#/c/98012/","commit_id":"5c17237a15a941094f061ddc2ea932c3f05de90f"},{"author":{"_account_id":4,"name":"Dolph Mathews","email":"dolph.mathews@gmail.com","username":"dolph"},"change_message_id":"178c071687a7e8757e664d377330cf7b7792ed04","unresolved":false,"context_lines":[{"line_number":14,"context_line":"boolean \u003d {"},{"line_number":15,"context_line":"    \u0027type\u0027: [\u0027boolean\u0027, \u0027string\u0027],"},{"line_number":16,"context_line":"    \u0027enum\u0027: [True, \u0027True\u0027, \u0027TRUE\u0027, \u0027true\u0027, \u00271\u0027,"},{"line_number":17,"context_line":"             False, \u0027False\u0027, \u0027FALSE\u0027, \u0027false\u0027, \u00270\u0027]"},{"line_number":18,"context_line":"}"},{"line_number":19,"context_line":""},{"line_number":20,"context_line":"# NOTE(lbragstad): Be mindful of this pattern as it might require changes"}],"source_content_type":"text/x-python","patch_set":25,"id":"baada198_06befb64","line":17,"updated":"2014-07-21 15:22:26.000000000","message":"only allow actual booleans","commit_id":"17d5dfb558c16420ffc3883180ebc2973d9d322c"},{"author":{"_account_id":5046,"name":"Lance Bragstad","email":"lbragstad@redhat.com","username":"ldbragst"},"change_message_id":"fca42b127dd9a613c8653a0e79d4ff10cf95f2bc","unresolved":false,"context_lines":[{"line_number":14,"context_line":"boolean \u003d {"},{"line_number":15,"context_line":"    \u0027type\u0027: [\u0027boolean\u0027, \u0027string\u0027],"},{"line_number":16,"context_line":"    \u0027enum\u0027: [True, \u0027True\u0027, \u0027TRUE\u0027, \u0027true\u0027, \u00271\u0027,"},{"line_number":17,"context_line":"             False, \u0027False\u0027, \u0027FALSE\u0027, \u0027false\u0027, \u00270\u0027]"},{"line_number":18,"context_line":"}"},{"line_number":19,"context_line":""},{"line_number":20,"context_line":"# NOTE(lbragstad): Be mindful of this pattern as it might require changes"}],"source_content_type":"text/x-python","patch_set":25,"id":"baada198_dc977243","line":17,"in_reply_to":"baada198_06befb64","updated":"2014-07-21 15:58:21.000000000","message":"Done","commit_id":"17d5dfb558c16420ffc3883180ebc2973d9d322c"},{"author":{"_account_id":4,"name":"Dolph Mathews","email":"dolph.mathews@gmail.com","username":"dolph"},"change_message_id":"178c071687a7e8757e664d377330cf7b7792ed04","unresolved":false,"context_lines":[{"line_number":25,"context_line":"    \u0027minLength\u0027: 1,"},{"line_number":26,"context_line":"    \u0027maxLength\u0027: 255,"},{"line_number":27,"context_line":"    # NOTE(lbragstad): Allow to some spaces in middle of name."},{"line_number":28,"context_line":"    \u0027pattern\u0027: \u0027^(?! )[a-zA-Z0-9. _-]+(?\u003c! )$\u0027"},{"line_number":29,"context_line":"}"},{"line_number":30,"context_line":""},{"line_number":31,"context_line":"hex_uuid \u003d {"}],"source_content_type":"text/x-python","patch_set":25,"id":"baada198_a6ac6f36","line":28,"updated":"2014-07-21 15:22:26.000000000","message":"allow any unicode","commit_id":"17d5dfb558c16420ffc3883180ebc2973d9d322c"},{"author":{"_account_id":5046,"name":"Lance Bragstad","email":"lbragstad@redhat.com","username":"ldbragst"},"change_message_id":"fca42b127dd9a613c8653a0e79d4ff10cf95f2bc","unresolved":false,"context_lines":[{"line_number":25,"context_line":"    \u0027minLength\u0027: 1,"},{"line_number":26,"context_line":"    \u0027maxLength\u0027: 255,"},{"line_number":27,"context_line":"    # NOTE(lbragstad): Allow to some spaces in middle of name."},{"line_number":28,"context_line":"    \u0027pattern\u0027: \u0027^(?! )[a-zA-Z0-9. _-]+(?\u003c! )$\u0027"},{"line_number":29,"context_line":"}"},{"line_number":30,"context_line":""},{"line_number":31,"context_line":"hex_uuid \u003d {"}],"source_content_type":"text/x-python","patch_set":25,"id":"baada198_5cac429f","line":28,"in_reply_to":"baada198_a6ac6f36","updated":"2014-07-21 15:58:21.000000000","message":"Done","commit_id":"17d5dfb558c16420ffc3883180ebc2973d9d322c"},{"author":{"_account_id":7725,"name":"David Stanek","email":"dstanek@dstanek.com","username":"dstanek"},"change_message_id":"b6d99ce26c24befee6e101a0cc934f2f384688d6","unresolved":false,"context_lines":[{"line_number":13,"context_line":""},{"line_number":14,"context_line":"boolean \u003d {"},{"line_number":15,"context_line":"    \u0027type\u0027: \u0027boolean\u0027,"},{"line_number":16,"context_line":"    \u0027enum\u0027: [True, False]"},{"line_number":17,"context_line":"}"},{"line_number":18,"context_line":""},{"line_number":19,"context_line":"# NOTE(lbragstad): Be mindful of this pattern as it might require changes"}],"source_content_type":"text/x-python","patch_set":29,"id":"baada198_0c7e00af","line":16,"updated":"2014-07-22 01:41:23.000000000","message":"I don\u0027t think this will entirely work. Booleans like \u0027enabled\u0027 can be either boolean values or integers:http://git.openstack.org/cgit/openstack/keystone/tree/keystone/clean.py#n47","commit_id":"95850c01c1610e943bfae5583c5f19c01186ad48"},{"author":{"_account_id":4,"name":"Dolph Mathews","email":"dolph.mathews@gmail.com","username":"dolph"},"change_message_id":"b8c0044eda6c03dd55a403ed900dd3a4d6b9e572","unresolved":false,"context_lines":[{"line_number":13,"context_line":""},{"line_number":14,"context_line":"boolean \u003d {"},{"line_number":15,"context_line":"    \u0027type\u0027: \u0027boolean\u0027,"},{"line_number":16,"context_line":"    \u0027enum\u0027: [True, False]"},{"line_number":17,"context_line":"}"},{"line_number":18,"context_line":""},{"line_number":19,"context_line":"# NOTE(lbragstad): Be mindful of this pattern as it might require changes"}],"source_content_type":"text/x-python","patch_set":29,"id":"baada198_fe47ab49","line":16,"in_reply_to":"baada198_0c7e00af","updated":"2014-07-22 04:44:49.000000000","message":"while that\u0027s true, i\u0027m not sure anyone is actually sending us integers. the integer thing was added in havana, on the basis that booleans are just ints in python. it\u0027s an implementation detail that the api contract does not acknowledge","commit_id":"95850c01c1610e943bfae5583c5f19c01186ad48"},{"author":{"_account_id":7725,"name":"David Stanek","email":"dstanek@dstanek.com","username":"dstanek"},"change_message_id":"9caf9716af1dd8d8549170ae7c3e6aaf4c743d6b","unresolved":false,"context_lines":[{"line_number":13,"context_line":""},{"line_number":14,"context_line":"boolean \u003d {"},{"line_number":15,"context_line":"    \u0027type\u0027: \u0027boolean\u0027,"},{"line_number":16,"context_line":"    \u0027enum\u0027: [True, False]"},{"line_number":17,"context_line":"}"},{"line_number":18,"context_line":""},{"line_number":19,"context_line":"# NOTE(lbragstad): Be mindful of this pattern as it might require changes"}],"source_content_type":"text/x-python","patch_set":29,"id":"baada198_aabce6dc","line":16,"in_reply_to":"baada198_beb8af76","updated":"2014-07-22 15:16:34.000000000","message":"I\u0027m totally fine with pushing this toward a real boolean","commit_id":"95850c01c1610e943bfae5583c5f19c01186ad48"},{"author":{"_account_id":2903,"name":"Morgan Fainberg","email":"morgan.fainberg@gmail.com","username":"mdrnstm"},"change_message_id":"5a1a868431397d3ce29ebe2d52bcf690de30ecc0","unresolved":false,"context_lines":[{"line_number":13,"context_line":""},{"line_number":14,"context_line":"boolean \u003d {"},{"line_number":15,"context_line":"    \u0027type\u0027: \u0027boolean\u0027,"},{"line_number":16,"context_line":"    \u0027enum\u0027: [True, False]"},{"line_number":17,"context_line":"}"},{"line_number":18,"context_line":""},{"line_number":19,"context_line":"# NOTE(lbragstad): Be mindful of this pattern as it might require changes"}],"source_content_type":"text/x-python","patch_set":29,"id":"baada198_beb8af76","line":16,"in_reply_to":"baada198_fe47ab49","updated":"2014-07-22 13:53:37.000000000","message":"This might be ok, I am a fan of enforcing this being a proper boolean as long as we aren\u0027t breaking a legitimate use case (i don\u0027t see 0, and 1 as being valid booleans in this case)","commit_id":"95850c01c1610e943bfae5583c5f19c01186ad48"}],"keystone/common/validation/validators.py":[{"author":{"_account_id":6482,"name":"Steve Martinelli","email":"s.martinelli@gmail.com","username":"stevemar"},"change_message_id":"47f32a863cfe136fef846a879eadf3ffa7983dc6","unresolved":false,"context_lines":[{"line_number":24,"context_line":"    validator_org \u003d jsonschema.Draft4Validator"},{"line_number":25,"context_line":""},{"line_number":26,"context_line":"    def __init__(self, schema):"},{"line_number":27,"context_line":"        validators \u003d {"},{"line_number":28,"context_line":"            \u0027minimum\u0027: self._validate_minimum,"},{"line_number":29,"context_line":"            \u0027maximum\u0027: self._validate_maximum,"},{"line_number":30,"context_line":"        }"}],"source_content_type":"text/x-python","patch_set":14,"id":"1ae5cdf2_dd16f5a6","line":27,"updated":"2014-06-03 06:55:49.000000000","message":"can you add a docstring here, i\u0027m not super clear as to why this is needed","commit_id":"410cc30e871bb9c500241f91b897461848232aef"},{"author":{"_account_id":6460,"name":"Brad Topol","email":"btopol@us.ibm.com","username":"btopol"},"change_message_id":"48bd9e8a4de38f5a3287df8161d5cdf13157ea37","unresolved":false,"context_lines":[{"line_number":24,"context_line":"    validator_org \u003d jsonschema.Draft4Validator"},{"line_number":25,"context_line":""},{"line_number":26,"context_line":"    def __init__(self, schema):"},{"line_number":27,"context_line":"        # NOTE(lbragstad): If at some point in the future we want to extend"},{"line_number":28,"context_line":"        # our validators to include something specific we need to check for,"},{"line_number":29,"context_line":"        # we can do it here. Nova\u0027s V3 API validators extend the validator to"},{"line_number":30,"context_line":"        # include `self._validate_minimum` and `self._validate_maximum`. This"}],"source_content_type":"text/x-python","patch_set":19,"id":"1ae5cdf2_f986c012","line":27,"updated":"2014-06-07 22:30:17.000000000","message":"Great Note and a neat idea!","commit_id":"9b41c624d8c33a093d8af5eef93e4fafe63fe36f"},{"author":{"_account_id":6460,"name":"Brad Topol","email":"btopol@us.ibm.com","username":"btopol"},"change_message_id":"48bd9e8a4de38f5a3287df8161d5cdf13157ea37","unresolved":false,"context_lines":[{"line_number":40,"context_line":"    def validate(self, *args, **kwargs):"},{"line_number":41,"context_line":"        try:"},{"line_number":42,"context_line":"            self.validator.validate(*args, **kwargs)"},{"line_number":43,"context_line":"        except jsonschema.ValidationError as ex:"},{"line_number":44,"context_line":"            # NOTE: For whole OpenStack message consistency, this error"},{"line_number":45,"context_line":"            # message has been written as the similar format of WSME."},{"line_number":46,"context_line":"            if len(ex.path) \u003e 0:"}],"source_content_type":"text/x-python","patch_set":19,"id":"1ae5cdf2_5975f430","line":43,"updated":"2014-06-07 22:30:17.000000000","message":"Might rewrite note to be more clear:\n# NOTE: For whole OpenStack message consistency, this error \n# message has been written in a format consistent with WSME.","commit_id":"9b41c624d8c33a093d8af5eef93e4fafe63fe36f"},{"author":{"_account_id":5046,"name":"Lance Bragstad","email":"lbragstad@redhat.com","username":"ldbragst"},"change_message_id":"6779c78b1d179a454992ac3b84f79499d4125248","unresolved":false,"context_lines":[{"line_number":40,"context_line":"    def validate(self, *args, **kwargs):"},{"line_number":41,"context_line":"        try:"},{"line_number":42,"context_line":"            self.validator.validate(*args, **kwargs)"},{"line_number":43,"context_line":"        except jsonschema.ValidationError as ex:"},{"line_number":44,"context_line":"            # NOTE: For whole OpenStack message consistency, this error"},{"line_number":45,"context_line":"            # message has been written as the similar format of WSME."},{"line_number":46,"context_line":"            if len(ex.path) \u003e 0:"}],"source_content_type":"text/x-python","patch_set":19,"id":"1ae5cdf2_0c7b2c2a","line":43,"in_reply_to":"1ae5cdf2_5975f430","updated":"2014-06-08 04:39:36.000000000","message":"Done","commit_id":"9b41c624d8c33a093d8af5eef93e4fafe63fe36f"},{"author":{"_account_id":7191,"name":"Jamie Lennox","email":"jamielennox@gmail.com","username":"jamielennox"},"change_message_id":"ffa68e7cb5b967c6d4930e3a97667d53eab36d62","unresolved":false,"context_lines":[{"line_number":20,"context_line":"class SchemaValidator(object):"},{"line_number":21,"context_line":"    \"\"\"Resource reference validator class.\"\"\""},{"line_number":22,"context_line":""},{"line_number":23,"context_line":"    validator \u003d None"},{"line_number":24,"context_line":"    validator_org \u003d jsonschema.Draft4Validator"},{"line_number":25,"context_line":""},{"line_number":26,"context_line":"    def __init__(self, schema):"}],"source_content_type":"text/x-python","patch_set":23,"id":"baada198_80df3a0c","line":23,"updated":"2014-07-15 03:06:20.000000000","message":"what\u0027s the class variable for?","commit_id":"5c17237a15a941094f061ddc2ea932c3f05de90f"},{"author":{"_account_id":4,"name":"Dolph Mathews","email":"dolph.mathews@gmail.com","username":"dolph"},"change_message_id":"c8a1ca74a856ef8e6cf57f4b285264ff4987d1e9","unresolved":false,"context_lines":[{"line_number":14,"context_line":"import jsonschema"},{"line_number":15,"context_line":""},{"line_number":16,"context_line":"from keystone import exception"},{"line_number":17,"context_line":"from keystone.openstack.common.gettextutils import _"},{"line_number":18,"context_line":""},{"line_number":19,"context_line":""},{"line_number":20,"context_line":"class SchemaValidator(object):"}],"source_content_type":"text/x-python","patch_set":24,"id":"baada198_0dd53e42","line":17,"updated":"2014-07-21 13:59:43.000000000","message":"flake8 violation! fix with:\n\n  from keystone.i18n import _","commit_id":"e41189e313c108b81f2cf2145ebb0621cc3d1c21"},{"author":{"_account_id":5046,"name":"Lance Bragstad","email":"lbragstad@redhat.com","username":"ldbragst"},"change_message_id":"a186c48ef24268cca771fdef9fe69356c3ece56b","unresolved":false,"context_lines":[{"line_number":14,"context_line":"import jsonschema"},{"line_number":15,"context_line":""},{"line_number":16,"context_line":"from keystone import exception"},{"line_number":17,"context_line":"from keystone.openstack.common.gettextutils import _"},{"line_number":18,"context_line":""},{"line_number":19,"context_line":""},{"line_number":20,"context_line":"class SchemaValidator(object):"}],"source_content_type":"text/x-python","patch_set":24,"id":"baada198_8dc6ae47","line":17,"in_reply_to":"baada198_0dd53e42","updated":"2014-07-21 14:09:57.000000000","message":"Done","commit_id":"e41189e313c108b81f2cf2145ebb0621cc3d1c21"},{"author":{"_account_id":4,"name":"Dolph Mathews","email":"dolph.mathews@gmail.com","username":"dolph"},"change_message_id":"178c071687a7e8757e664d377330cf7b7792ed04","unresolved":false,"context_lines":[{"line_number":48,"context_line":"                # as a method of providing invalid parameters back to the"},{"line_number":49,"context_line":"                # user."},{"line_number":50,"context_line":"                # TODO(lbragstad): If the value of a field is confidential or"},{"line_number":51,"context_line":"                # to long, then we should build the masking in here so that we"},{"line_number":52,"context_line":"                # don\u0027t expose sensitive user information in the event it"},{"line_number":53,"context_line":"                # fails validation."},{"line_number":54,"context_line":"                detail \u003d _(\"Invalid input for field \u0027%(path)s\u0027. The value is \""}],"source_content_type":"text/x-python","patch_set":25,"id":"baada198_c11a2d6e","line":51,"updated":"2014-07-21 15:22:26.000000000","message":"s/to long/too long/","commit_id":"17d5dfb558c16420ffc3883180ebc2973d9d322c"},{"author":{"_account_id":5046,"name":"Lance Bragstad","email":"lbragstad@redhat.com","username":"ldbragst"},"change_message_id":"fca42b127dd9a613c8653a0e79d4ff10cf95f2bc","unresolved":false,"context_lines":[{"line_number":48,"context_line":"                # as a method of providing invalid parameters back to the"},{"line_number":49,"context_line":"                # user."},{"line_number":50,"context_line":"                # TODO(lbragstad): If the value of a field is confidential or"},{"line_number":51,"context_line":"                # to long, then we should build the masking in here so that we"},{"line_number":52,"context_line":"                # don\u0027t expose sensitive user information in the event it"},{"line_number":53,"context_line":"                # fails validation."},{"line_number":54,"context_line":"                detail \u003d _(\"Invalid input for field \u0027%(path)s\u0027. The value is \""}],"source_content_type":"text/x-python","patch_set":25,"id":"baada198_fcb7d6d5","line":51,"in_reply_to":"baada198_c11a2d6e","updated":"2014-07-21 15:58:21.000000000","message":"Done","commit_id":"17d5dfb558c16420ffc3883180ebc2973d9d322c"},{"author":{"_account_id":4,"name":"Dolph Mathews","email":"dolph.mathews@gmail.com","username":"dolph"},"change_message_id":"178c071687a7e8757e664d377330cf7b7792ed04","unresolved":false,"context_lines":[{"line_number":52,"context_line":"                # don\u0027t expose sensitive user information in the event it"},{"line_number":53,"context_line":"                # fails validation."},{"line_number":54,"context_line":"                detail \u003d _(\"Invalid input for field \u0027%(path)s\u0027. The value is \""},{"line_number":55,"context_line":"                           \"\u0027%(value)s\u0027.\") % {"},{"line_number":56,"context_line":"                               \u0027path\u0027: ex.path.pop(),"},{"line_number":57,"context_line":"                               \u0027value\u0027: ex.instance"},{"line_number":58,"context_line":"                           }"}],"source_content_type":"text/x-python","patch_set":25,"id":"baada198_61588131","line":55,"updated":"2014-07-21 15:22:26.000000000","message":"i feel like i\u0027ve looked into this before, and the answer was \u0027no\u0027, but can we get more specific failure messages from jsonschema? (value too long, value too short, doesn\u0027t match regex, etc)","commit_id":"17d5dfb558c16420ffc3883180ebc2973d9d322c"},{"author":{"_account_id":5046,"name":"Lance Bragstad","email":"lbragstad@redhat.com","username":"ldbragst"},"change_message_id":"fca42b127dd9a613c8653a0e79d4ff10cf95f2bc","unresolved":false,"context_lines":[{"line_number":52,"context_line":"                # don\u0027t expose sensitive user information in the event it"},{"line_number":53,"context_line":"                # fails validation."},{"line_number":54,"context_line":"                detail \u003d _(\"Invalid input for field \u0027%(path)s\u0027. The value is \""},{"line_number":55,"context_line":"                           \"\u0027%(value)s\u0027.\") % {"},{"line_number":56,"context_line":"                               \u0027path\u0027: ex.path.pop(),"},{"line_number":57,"context_line":"                               \u0027value\u0027: ex.instance"},{"line_number":58,"context_line":"                           }"}],"source_content_type":"text/x-python","patch_set":25,"id":"baada198_fc4b5684","line":55,"in_reply_to":"baada198_61588131","updated":"2014-07-21 15:58:21.000000000","message":"checking this out.","commit_id":"17d5dfb558c16420ffc3883180ebc2973d9d322c"},{"author":{"_account_id":5046,"name":"Lance Bragstad","email":"lbragstad@redhat.com","username":"ldbragst"},"change_message_id":"0261e815e1e3d9893ce06fc417970846af3da7dd","unresolved":false,"context_lines":[{"line_number":52,"context_line":"                # don\u0027t expose sensitive user information in the event it"},{"line_number":53,"context_line":"                # fails validation."},{"line_number":54,"context_line":"                detail \u003d _(\"Invalid input for field \u0027%(path)s\u0027. The value is \""},{"line_number":55,"context_line":"                           \"\u0027%(value)s\u0027.\") % {"},{"line_number":56,"context_line":"                               \u0027path\u0027: ex.path.pop(),"},{"line_number":57,"context_line":"                               \u0027value\u0027: ex.instance"},{"line_number":58,"context_line":"                           }"}],"source_content_type":"text/x-python","patch_set":25,"id":"baada198_226e882f","line":55,"in_reply_to":"baada198_fc4b5684","updated":"2014-07-21 16:22:47.000000000","message":"Here we might be able to get some more useful information out of the jsonschema.ValidationError object. I want to say there is some useful information in the exception object somewhere but I\u0027ll play around with it.","commit_id":"17d5dfb558c16420ffc3883180ebc2973d9d322c"},{"author":{"_account_id":7725,"name":"David Stanek","email":"dstanek@dstanek.com","username":"dstanek"},"change_message_id":"9fd67dabfb3ce6ad36762641de5bbea220264087","unresolved":false,"context_lines":[{"line_number":57,"context_line":"                               \u0027value\u0027: ex.instance"},{"line_number":58,"context_line":"                           }"},{"line_number":59,"context_line":"            else:"},{"line_number":60,"context_line":"                detail \u003d ex.message"},{"line_number":61,"context_line":"            raise exception.SchemaValidationError(detail\u003ddetail)"}],"source_content_type":"text/x-python","patch_set":29,"id":"baada198_d40fff37","line":60,"updated":"2014-07-22 15:03:28.000000000","message":"The message attribute on an exception was deprecated in Python 2.6 and removed in Python 3. I think \u0027detail \u003d ex.args[0]\u0027 is what you will want.","commit_id":"95850c01c1610e943bfae5583c5f19c01186ad48"},{"author":{"_account_id":7725,"name":"David Stanek","email":"dstanek@dstanek.com","username":"dstanek"},"change_message_id":"9caf9716af1dd8d8549170ae7c3e6aaf4c743d6b","unresolved":false,"context_lines":[{"line_number":57,"context_line":"                               \u0027value\u0027: ex.instance"},{"line_number":58,"context_line":"                           }"},{"line_number":59,"context_line":"            else:"},{"line_number":60,"context_line":"                detail \u003d ex.message"},{"line_number":61,"context_line":"            raise exception.SchemaValidationError(detail\u003ddetail)"}],"source_content_type":"text/x-python","patch_set":29,"id":"baada198_0a923258","line":60,"in_reply_to":"baada198_d40fff37","updated":"2014-07-22 15:16:34.000000000","message":"There are other things that need to be done to get Py3 tests running. We can do this later.","commit_id":"95850c01c1610e943bfae5583c5f19c01186ad48"},{"author":{"_account_id":7725,"name":"David Stanek","email":"dstanek@dstanek.com","username":"dstanek"},"change_message_id":"b6d99ce26c24befee6e101a0cc934f2f384688d6","unresolved":false,"context_lines":[{"line_number":58,"context_line":"                           }"},{"line_number":59,"context_line":"            else:"},{"line_number":60,"context_line":"                detail \u003d ex.message"},{"line_number":61,"context_line":"            raise exception.SchemaValidationError(detail\u003ddetail)"}],"source_content_type":"text/x-python","patch_set":29,"id":"baada198_897f6216","line":61,"updated":"2014-07-22 01:41:23.000000000","message":"Just a thought.  By creating our own exception I think we are losing all of the rich context available here: https://github.com/Julian/jsonschema/blob/master/jsonschema/exceptions.py#L16","commit_id":"95850c01c1610e943bfae5583c5f19c01186ad48"},{"author":{"_account_id":5046,"name":"Lance Bragstad","email":"lbragstad@redhat.com","username":"ldbragst"},"change_message_id":"6b79719c8d78a54e28fa8a2209152be47015c7ef","unresolved":false,"context_lines":[{"line_number":58,"context_line":"                           }"},{"line_number":59,"context_line":"            else:"},{"line_number":60,"context_line":"                detail \u003d ex.message"},{"line_number":61,"context_line":"            raise exception.SchemaValidationError(detail\u003ddetail)"}],"source_content_type":"text/x-python","patch_set":29,"id":"baada198_c4b2f4e4","line":61,"in_reply_to":"baada198_7ec9b724","updated":"2014-07-22 14:14:38.000000000","message":"I set a break point and ran some tests where this is raised: \n\nhttp://paste.openstack.org/show/87619/\n\nThere is some good info in the exception from jsonschema, bknudson made a comment on the output we emit to the user in the spec review too: https://review.openstack.org/#/c/95957/13/specs/juno/keystone-api-validation.rst","commit_id":"95850c01c1610e943bfae5583c5f19c01186ad48"},{"author":{"_account_id":4,"name":"Dolph Mathews","email":"dolph.mathews@gmail.com","username":"dolph"},"change_message_id":"074b9c65e74247d4031ef51dcbf41d0a631a0e88","unresolved":false,"context_lines":[{"line_number":58,"context_line":"                           }"},{"line_number":59,"context_line":"            else:"},{"line_number":60,"context_line":"                detail \u003d ex.message"},{"line_number":61,"context_line":"            raise exception.SchemaValidationError(detail\u003ddetail)"}],"source_content_type":"text/x-python","patch_set":29,"id":"baada198_b812aa5e","line":61,"in_reply_to":"baada198_897f6216","updated":"2014-07-22 04:38:03.000000000","message":"based on david\u0027s link, what happens if you just take detail\u003dunicode(ex) here?","commit_id":"95850c01c1610e943bfae5583c5f19c01186ad48"},{"author":{"_account_id":2903,"name":"Morgan Fainberg","email":"morgan.fainberg@gmail.com","username":"mdrnstm"},"change_message_id":"5a1a868431397d3ce29ebe2d52bcf690de30ecc0","unresolved":false,"context_lines":[{"line_number":58,"context_line":"                           }"},{"line_number":59,"context_line":"            else:"},{"line_number":60,"context_line":"                detail \u003d ex.message"},{"line_number":61,"context_line":"            raise exception.SchemaValidationError(detail\u003ddetail)"}],"source_content_type":"text/x-python","patch_set":29,"id":"baada198_7ec9b724","line":61,"in_reply_to":"baada198_b812aa5e","updated":"2014-07-22 13:53:37.000000000","message":"We might want to put some specific exception handling in the wsgi module to make a schema validation failure a \"validation error + HTTP status\" rather than squashing it here (as pointed out be David) so we have the context up until we emit to the user.","commit_id":"95850c01c1610e943bfae5583c5f19c01186ad48"},{"author":{"_account_id":7725,"name":"David Stanek","email":"dstanek@dstanek.com","username":"dstanek"},"change_message_id":"9caf9716af1dd8d8549170ae7c3e6aaf4c743d6b","unresolved":false,"context_lines":[{"line_number":58,"context_line":"                           }"},{"line_number":59,"context_line":"            else:"},{"line_number":60,"context_line":"                detail \u003d ex.message"},{"line_number":61,"context_line":"            raise exception.SchemaValidationError(detail\u003ddetail)"}],"source_content_type":"text/x-python","patch_set":29,"id":"baada198_8a8c8230","line":61,"in_reply_to":"baada198_c4b2f4e4","updated":"2014-07-22 15:16:34.000000000","message":"The IRC consensus is that the messaging should be enough.","commit_id":"95850c01c1610e943bfae5583c5f19c01186ad48"}],"keystone/exception.py":[{"author":{"_account_id":6460,"name":"Brad Topol","email":"btopol@us.ibm.com","username":"btopol"},"change_message_id":"48bd9e8a4de38f5a3287df8161d5cdf13157ea37","unresolved":false,"context_lines":[{"line_number":85,"context_line":""},{"line_number":86,"context_line":""},{"line_number":87,"context_line":"class SchemaValidationError(Error):"},{"line_number":88,"context_line":"    message_format \u003d _(\"%(detail)s\")"},{"line_number":89,"context_line":"    code \u003d 400"},{"line_number":90,"context_line":"    title \u003d \u0027Bad Request\u0027"},{"line_number":91,"context_line":""}],"source_content_type":"text/x-python","patch_set":19,"id":"1ae5cdf2_79c4705f","line":88,"updated":"2014-06-07 22:30:17.000000000","message":"Put the following NOTE here so reviewers don\u0027t question why this looks so bland :-) :\n# NOTE: For whole OpenStack message consistency, this error \n# message has been written in a format consistent with WSME.","commit_id":"9b41c624d8c33a093d8af5eef93e4fafe63fe36f"},{"author":{"_account_id":5046,"name":"Lance Bragstad","email":"lbragstad@redhat.com","username":"ldbragst"},"change_message_id":"6779c78b1d179a454992ac3b84f79499d4125248","unresolved":false,"context_lines":[{"line_number":85,"context_line":""},{"line_number":86,"context_line":""},{"line_number":87,"context_line":"class SchemaValidationError(Error):"},{"line_number":88,"context_line":"    message_format \u003d _(\"%(detail)s\")"},{"line_number":89,"context_line":"    code \u003d 400"},{"line_number":90,"context_line":"    title \u003d \u0027Bad Request\u0027"},{"line_number":91,"context_line":""}],"source_content_type":"text/x-python","patch_set":19,"id":"1ae5cdf2_6ca9107b","line":88,"in_reply_to":"1ae5cdf2_79c4705f","updated":"2014-06-08 04:39:36.000000000","message":"Done","commit_id":"9b41c624d8c33a093d8af5eef93e4fafe63fe36f"},{"author":{"_account_id":4,"name":"Dolph Mathews","email":"dolph.mathews@gmail.com","username":"dolph"},"change_message_id":"178c071687a7e8757e664d377330cf7b7792ed04","unresolved":false,"context_lines":[{"line_number":84,"context_line":"    title \u003d \u0027Bad Request\u0027"},{"line_number":85,"context_line":""},{"line_number":86,"context_line":""},{"line_number":87,"context_line":"class SchemaValidationError(Error):"},{"line_number":88,"context_line":"    # NOTE(lbragstad): For whole OpenStack message consistency, this error"},{"line_number":89,"context_line":"    # message has been written in a format consistent with WSME."},{"line_number":90,"context_line":"    message_format \u003d _(\"%(detail)s\")"}],"source_content_type":"text/x-python","patch_set":25,"id":"baada198_8142f53b","line":87,"updated":"2014-07-21 15:22:26.000000000","message":"extend ValidationError and just override the message_format","commit_id":"17d5dfb558c16420ffc3883180ebc2973d9d322c"},{"author":{"_account_id":5046,"name":"Lance Bragstad","email":"lbragstad@redhat.com","username":"ldbragst"},"change_message_id":"fca42b127dd9a613c8653a0e79d4ff10cf95f2bc","unresolved":false,"context_lines":[{"line_number":84,"context_line":"    title \u003d \u0027Bad Request\u0027"},{"line_number":85,"context_line":""},{"line_number":86,"context_line":""},{"line_number":87,"context_line":"class SchemaValidationError(Error):"},{"line_number":88,"context_line":"    # NOTE(lbragstad): For whole OpenStack message consistency, this error"},{"line_number":89,"context_line":"    # message has been written in a format consistent with WSME."},{"line_number":90,"context_line":"    message_format \u003d _(\"%(detail)s\")"}],"source_content_type":"text/x-python","patch_set":25,"id":"baada198_dcd3f2fe","line":87,"in_reply_to":"baada198_8142f53b","updated":"2014-07-21 15:58:21.000000000","message":"Done","commit_id":"17d5dfb558c16420ffc3883180ebc2973d9d322c"}],"keystone/tests/test_validation.py":[{"author":{"_account_id":6482,"name":"Steve Martinelli","email":"s.martinelli@gmail.com","username":"stevemar"},"change_message_id":"9cf3cdfd81add6245936a6501fbae912f7fa1677","unresolved":false,"context_lines":[{"line_number":11,"context_line":"# under the License."},{"line_number":12,"context_line":""},{"line_number":13,"context_line":"import uuid"},{"line_number":14,"context_line":""},{"line_number":15,"context_line":""},{"line_number":16,"context_line":"from keystone import exception"},{"line_number":17,"context_line":"from keystone import tests"}],"source_content_type":"text/x-python","patch_set":3,"id":"9ad9bd40_2dd61350","line":14,"updated":"2014-05-01 14:51:01.000000000","message":"unnecessary new line","commit_id":"d76be626b2fa5ca95eb586251e08e55112af5a7b"},{"author":{"_account_id":5046,"name":"Lance Bragstad","email":"lbragstad@redhat.com","username":"ldbragst"},"change_message_id":"6d3c18dd8e3cf9443ddaf3c356cd62914e5f428e","unresolved":false,"context_lines":[{"line_number":11,"context_line":"# under the License."},{"line_number":12,"context_line":""},{"line_number":13,"context_line":"import uuid"},{"line_number":14,"context_line":""},{"line_number":15,"context_line":""},{"line_number":16,"context_line":"from keystone import exception"},{"line_number":17,"context_line":"from keystone import tests"}],"source_content_type":"text/x-python","patch_set":3,"id":"9ad9bd40_21d9bc57","line":14,"in_reply_to":"9ad9bd40_2dd61350","updated":"2014-05-01 18:02:13.000000000","message":"Done","commit_id":"d76be626b2fa5ca95eb586251e08e55112af5a7b"},{"author":{"_account_id":7725,"name":"David Stanek","email":"dstanek@dstanek.com","username":"dstanek"},"change_message_id":"40d6bd5fe6dc7bf9b8a0bc29d5be50a02c3c8063","unresolved":false,"context_lines":[{"line_number":36,"context_line":"_UPDATE \u003d {}"},{"line_number":37,"context_line":""},{"line_number":38,"context_line":""},{"line_number":39,"context_line":"class ValidationTestCase(tests.TestCase):"},{"line_number":40,"context_line":""},{"line_number":41,"context_line":"    def setUp(self):"},{"line_number":42,"context_line":"        super(ValidationTestCase, self).setUp()"}],"source_content_type":"text/x-python","patch_set":3,"id":"9ad9bd40_e9a43259","line":39,"updated":"2014-04-30 19:33:46.000000000","message":"It would be nice to see the decorator being tested so that there is some sample usage.","commit_id":"d76be626b2fa5ca95eb586251e08e55112af5a7b"},{"author":{"_account_id":6482,"name":"Steve Martinelli","email":"s.martinelli@gmail.com","username":"stevemar"},"change_message_id":"9cf3cdfd81add6245936a6501fbae912f7fa1677","unresolved":false,"context_lines":[{"line_number":75,"context_line":"    def test_create_schema_with_valid_uuid_format(self):"},{"line_number":76,"context_line":"        request_to_validate \u003d {\u0027name\u0027: self.resource_name,"},{"line_number":77,"context_line":"                               \u0027some_uuid\u0027: self.valid_uuid}"},{"line_number":78,"context_line":"        # Make sure validation doensn\u0027t raise a validation exception"},{"line_number":79,"context_line":"        self.create_schema_validator.validate(request_to_validate)"},{"line_number":80,"context_line":""},{"line_number":81,"context_line":"    def test_create_schema_with_invalid_enabled_format_raises_exception(self):"}],"source_content_type":"text/x-python","patch_set":3,"id":"9ad9bd40_8d72bf7a","line":78,"updated":"2014-05-01 14:51:01.000000000","message":"s/doensn\u0027t/doesn\u0027t","commit_id":"d76be626b2fa5ca95eb586251e08e55112af5a7b"},{"author":{"_account_id":5046,"name":"Lance Bragstad","email":"lbragstad@redhat.com","username":"ldbragst"},"change_message_id":"6d3c18dd8e3cf9443ddaf3c356cd62914e5f428e","unresolved":false,"context_lines":[{"line_number":75,"context_line":"    def test_create_schema_with_valid_uuid_format(self):"},{"line_number":76,"context_line":"        request_to_validate \u003d {\u0027name\u0027: self.resource_name,"},{"line_number":77,"context_line":"                               \u0027some_uuid\u0027: self.valid_uuid}"},{"line_number":78,"context_line":"        # Make sure validation doensn\u0027t raise a validation exception"},{"line_number":79,"context_line":"        self.create_schema_validator.validate(request_to_validate)"},{"line_number":80,"context_line":""},{"line_number":81,"context_line":"    def test_create_schema_with_invalid_enabled_format_raises_exception(self):"}],"source_content_type":"text/x-python","patch_set":3,"id":"9ad9bd40_81ce0882","line":78,"in_reply_to":"9ad9bd40_8d72bf7a","updated":"2014-05-01 18:02:13.000000000","message":"Done","commit_id":"d76be626b2fa5ca95eb586251e08e55112af5a7b"},{"author":{"_account_id":7725,"name":"David Stanek","email":"dstanek@dstanek.com","username":"dstanek"},"change_message_id":"9450491b3f591a3df2fe0c76ea0ce535809a03e4","unresolved":false,"context_lines":[{"line_number":49,"context_line":"        # using the _UPDATE schema. These can be used in the test cases"},{"line_number":50,"context_line":"        # according to what is being validated."},{"line_number":51,"context_line":"        self.create_schema_validator \u003d validators.SchemaValidator(_CREATE)"},{"line_number":52,"context_line":"        self.update_schema_validator \u003d validators.SchemaValidator(_UPDATE)"},{"line_number":53,"context_line":""},{"line_number":54,"context_line":"    def test_create_schema_with_all_valid_parameters(self):"},{"line_number":55,"context_line":"        \"\"\"Validate proper values against test schema.\"\"\""}],"source_content_type":"text/x-python","patch_set":23,"id":"baada198_fd580dfc","line":52,"updated":"2014-07-10 23:05:59.000000000","message":"Any reason that this isn\u0027t used anywhere?","commit_id":"5c17237a15a941094f061ddc2ea932c3f05de90f"},{"author":{"_account_id":5046,"name":"Lance Bragstad","email":"lbragstad@redhat.com","username":"ldbragst"},"change_message_id":"f7c16db83bdb73456fe0d79cdda88cd2a268d83b","unresolved":false,"context_lines":[{"line_number":49,"context_line":"        # using the _UPDATE schema. These can be used in the test cases"},{"line_number":50,"context_line":"        # according to what is being validated."},{"line_number":51,"context_line":"        self.create_schema_validator \u003d validators.SchemaValidator(_CREATE)"},{"line_number":52,"context_line":"        self.update_schema_validator \u003d validators.SchemaValidator(_UPDATE)"},{"line_number":53,"context_line":""},{"line_number":54,"context_line":"    def test_create_schema_with_all_valid_parameters(self):"},{"line_number":55,"context_line":"        \"\"\"Validate proper values against test schema.\"\"\""}],"source_content_type":"text/x-python","patch_set":23,"id":"baada198_848959cc","line":52,"in_reply_to":"baada198_fd580dfc","updated":"2014-07-18 22:06:06.000000000","message":"will remove for now, same with the _UPDATE variable above.","commit_id":"5c17237a15a941094f061ddc2ea932c3f05de90f"},{"author":{"_account_id":4,"name":"Dolph Mathews","email":"dolph.mathews@gmail.com","username":"dolph"},"change_message_id":"178c071687a7e8757e664d377330cf7b7792ed04","unresolved":false,"context_lines":[{"line_number":33,"context_line":"}"},{"line_number":34,"context_line":""},{"line_number":35,"context_line":""},{"line_number":36,"context_line":"class ValidationTestCase(tests.TestCase):"},{"line_number":37,"context_line":""},{"line_number":38,"context_line":"    def setUp(self):"},{"line_number":39,"context_line":"        super(ValidationTestCase, self).setUp()"}],"source_content_type":"text/x-python","patch_set":25,"id":"baada198_81c5958f","line":36,"updated":"2014-07-21 15:22:26.000000000","message":"add a test with a unicode name","commit_id":"17d5dfb558c16420ffc3883180ebc2973d9d322c"},{"author":{"_account_id":5046,"name":"Lance Bragstad","email":"lbragstad@redhat.com","username":"ldbragst"},"change_message_id":"fca42b127dd9a613c8653a0e79d4ff10cf95f2bc","unresolved":false,"context_lines":[{"line_number":33,"context_line":"}"},{"line_number":34,"context_line":""},{"line_number":35,"context_line":""},{"line_number":36,"context_line":"class ValidationTestCase(tests.TestCase):"},{"line_number":37,"context_line":""},{"line_number":38,"context_line":"    def setUp(self):"},{"line_number":39,"context_line":"        super(ValidationTestCase, self).setUp()"}],"source_content_type":"text/x-python","patch_set":25,"id":"baada198_dcddb2de","line":36,"in_reply_to":"baada198_81c5958f","updated":"2014-07-21 15:58:21.000000000","message":"Done","commit_id":"17d5dfb558c16420ffc3883180ebc2973d9d322c"},{"author":{"_account_id":4,"name":"Dolph Mathews","email":"dolph.mathews@gmail.com","username":"dolph"},"change_message_id":"178c071687a7e8757e664d377330cf7b7792ed04","unresolved":false,"context_lines":[{"line_number":72,"context_line":"        \"\"\"Test that we have successful validation on boolean-like true values"},{"line_number":73,"context_line":"           for `enabled`."},{"line_number":74,"context_line":"        \"\"\""},{"line_number":75,"context_line":"        valid_enabled_formats \u003d [True, \u0027True\u0027, \u0027TRUE\u0027, \u0027true\u0027, \u00271\u0027]"},{"line_number":76,"context_line":""},{"line_number":77,"context_line":"        for valid_enabled in valid_enabled_formats:"},{"line_number":78,"context_line":"            request_to_validate \u003d {\u0027name\u0027: self.resource_name,"}],"source_content_type":"text/x-python","patch_set":25,"id":"baada198_c1486d5e","line":75,"updated":"2014-07-21 15:22:26.000000000","message":"simplify!","commit_id":"17d5dfb558c16420ffc3883180ebc2973d9d322c"},{"author":{"_account_id":5046,"name":"Lance Bragstad","email":"lbragstad@redhat.com","username":"ldbragst"},"change_message_id":"fca42b127dd9a613c8653a0e79d4ff10cf95f2bc","unresolved":false,"context_lines":[{"line_number":72,"context_line":"        \"\"\"Test that we have successful validation on boolean-like true values"},{"line_number":73,"context_line":"           for `enabled`."},{"line_number":74,"context_line":"        \"\"\""},{"line_number":75,"context_line":"        valid_enabled_formats \u003d [True, \u0027True\u0027, \u0027TRUE\u0027, \u0027true\u0027, \u00271\u0027]"},{"line_number":76,"context_line":""},{"line_number":77,"context_line":"        for valid_enabled in valid_enabled_formats:"},{"line_number":78,"context_line":"            request_to_validate \u003d {\u0027name\u0027: self.resource_name,"}],"source_content_type":"text/x-python","patch_set":25,"id":"baada198_1c09ea94","line":75,"in_reply_to":"baada198_c1486d5e","updated":"2014-07-21 15:58:21.000000000","message":"Done","commit_id":"17d5dfb558c16420ffc3883180ebc2973d9d322c"},{"author":{"_account_id":4,"name":"Dolph Mathews","email":"dolph.mathews@gmail.com","username":"dolph"},"change_message_id":"178c071687a7e8757e664d377330cf7b7792ed04","unresolved":false,"context_lines":[{"line_number":84,"context_line":"        \"\"\"Test that we have successful validation on boolean-like false"},{"line_number":85,"context_line":"           values for `enabled`."},{"line_number":86,"context_line":"        \"\"\""},{"line_number":87,"context_line":"        valid_enabled_formats \u003d [False, \u0027False\u0027, \u0027FALSE\u0027, \u0027false\u0027, \u00270\u0027]"},{"line_number":88,"context_line":""},{"line_number":89,"context_line":"        for valid_enabled in valid_enabled_formats:"},{"line_number":90,"context_line":"            request_to_validate \u003d {\u0027name\u0027: self.resource_name,"}],"source_content_type":"text/x-python","patch_set":25,"id":"baada198_0176e5a3","line":87,"updated":"2014-07-21 15:22:26.000000000","message":"simplify!","commit_id":"17d5dfb558c16420ffc3883180ebc2973d9d322c"},{"author":{"_account_id":5046,"name":"Lance Bragstad","email":"lbragstad@redhat.com","username":"ldbragst"},"change_message_id":"fca42b127dd9a613c8653a0e79d4ff10cf95f2bc","unresolved":false,"context_lines":[{"line_number":84,"context_line":"        \"\"\"Test that we have successful validation on boolean-like false"},{"line_number":85,"context_line":"           values for `enabled`."},{"line_number":86,"context_line":"        \"\"\""},{"line_number":87,"context_line":"        valid_enabled_formats \u003d [False, \u0027False\u0027, \u0027FALSE\u0027, \u0027false\u0027, \u00270\u0027]"},{"line_number":88,"context_line":""},{"line_number":89,"context_line":"        for valid_enabled in valid_enabled_formats:"},{"line_number":90,"context_line":"            request_to_validate \u003d {\u0027name\u0027: self.resource_name,"}],"source_content_type":"text/x-python","patch_set":25,"id":"baada198_7cf9067f","line":87,"in_reply_to":"baada198_0176e5a3","updated":"2014-07-21 15:58:21.000000000","message":"Done","commit_id":"17d5dfb558c16420ffc3883180ebc2973d9d322c"},{"author":{"_account_id":4,"name":"Dolph Mathews","email":"dolph.mathews@gmail.com","username":"dolph"},"change_message_id":"178c071687a7e8757e664d377330cf7b7792ed04","unresolved":false,"context_lines":[{"line_number":94,"context_line":""},{"line_number":95,"context_line":"    def test_create_schema_with_valid_urls(self):"},{"line_number":96,"context_line":"        \"\"\"Test that proper urls are successfully validated.\"\"\""},{"line_number":97,"context_line":"        valid_urls \u003d [\u0027https://9.9.9.9\u0027, \u0027https://endpoint.com\u0027,"},{"line_number":98,"context_line":"                      \u0027https://EXAMPLE.com\u0027, \u0027https://9.9.9.9:35357\u0027,"},{"line_number":99,"context_line":"                      \u0027https://localhost\u0027]"},{"line_number":100,"context_line":""}],"source_content_type":"text/x-python","patch_set":25,"id":"baada198_21d5a942","line":97,"updated":"2014-07-21 15:22:26.000000000","message":"use a private address where possible (127.0.0.1, 169.254.x.x), and example.com where you need a valid host","commit_id":"17d5dfb558c16420ffc3883180ebc2973d9d322c"},{"author":{"_account_id":5046,"name":"Lance Bragstad","email":"lbragstad@redhat.com","username":"ldbragst"},"change_message_id":"fca42b127dd9a613c8653a0e79d4ff10cf95f2bc","unresolved":false,"context_lines":[{"line_number":94,"context_line":""},{"line_number":95,"context_line":"    def test_create_schema_with_valid_urls(self):"},{"line_number":96,"context_line":"        \"\"\"Test that proper urls are successfully validated.\"\"\""},{"line_number":97,"context_line":"        valid_urls \u003d [\u0027https://9.9.9.9\u0027, \u0027https://endpoint.com\u0027,"},{"line_number":98,"context_line":"                      \u0027https://EXAMPLE.com\u0027, \u0027https://9.9.9.9:35357\u0027,"},{"line_number":99,"context_line":"                      \u0027https://localhost\u0027]"},{"line_number":100,"context_line":""}],"source_content_type":"text/x-python","patch_set":25,"id":"baada198_dc1852cf","line":97,"in_reply_to":"baada198_21d5a942","updated":"2014-07-21 15:58:21.000000000","message":"Done","commit_id":"17d5dfb558c16420ffc3883180ebc2973d9d322c"},{"author":{"_account_id":4,"name":"Dolph Mathews","email":"dolph.mathews@gmail.com","username":"dolph"},"change_message_id":"f956ef5f146905dcff2339b8ffa559c92a9fae10","unresolved":false,"context_lines":[{"line_number":80,"context_line":""},{"line_number":81,"context_line":"    def test_create_schema_with_unicode_name_is_successful(self):"},{"line_number":82,"context_line":"        \"\"\"Test that we successfully validate a unicode string.\"\"\""},{"line_number":83,"context_line":"        request_to_validate \u003d {\u0027name\u0027: unicode(\u0027Some Resource Name\u0027)}"},{"line_number":84,"context_line":"        self.create_schema_validator.validate(request_to_validate)"},{"line_number":85,"context_line":""},{"line_number":86,"context_line":"    def test_create_schema_with_invalid_enabled_format_raises_exception(self):"}],"source_content_type":"text/x-python","patch_set":27,"id":"baada198_9f7962c7","line":83,"updated":"2014-07-21 19:49:28.000000000","message":"i meant to actually use unicode characters :)\n\n  \u0027name\u0027: u\u0027????\u0027","commit_id":"df29f4acdd14df1c5592b56b034997a4a8c70ff8"},{"author":{"_account_id":5046,"name":"Lance Bragstad","email":"lbragstad@redhat.com","username":"ldbragst"},"change_message_id":"08ed7574ce0c36957d918c0f2605d6254b96fbd0","unresolved":false,"context_lines":[{"line_number":80,"context_line":""},{"line_number":81,"context_line":"    def test_create_schema_with_unicode_name_is_successful(self):"},{"line_number":82,"context_line":"        \"\"\"Test that we successfully validate a unicode string.\"\"\""},{"line_number":83,"context_line":"        request_to_validate \u003d {\u0027name\u0027: unicode(\u0027Some Resource Name\u0027)}"},{"line_number":84,"context_line":"        self.create_schema_validator.validate(request_to_validate)"},{"line_number":85,"context_line":""},{"line_number":86,"context_line":"    def test_create_schema_with_invalid_enabled_format_raises_exception(self):"}],"source_content_type":"text/x-python","patch_set":27,"id":"baada198_82bbc90d","line":83,"in_reply_to":"baada198_9f7962c7","updated":"2014-07-21 19:53:50.000000000","message":"gotcha, done in next patch.","commit_id":"df29f4acdd14df1c5592b56b034997a4a8c70ff8"},{"author":{"_account_id":5707,"name":"Henry Nash","email":"henryn@linux.vnet.ibm.com","username":"henry-nash"},"change_message_id":"27f18de10272e53866e85c96f43fad1fd0b9164b","unresolved":false,"context_lines":[{"line_number":57,"context_line":"        self.create_schema_validator.validate(request_to_validate)"},{"line_number":58,"context_line":""},{"line_number":59,"context_line":"    def test_create_schema_with_name_too_long_raises_exception(self):"},{"line_number":60,"context_line":"        \"\"\"Test that an exception is raised when passing a string of 255+"},{"line_number":61,"context_line":"           characters as a name parameter."},{"line_number":62,"context_line":"        \"\"\""},{"line_number":63,"context_line":"        invalid_name \u003d \u0027\u0027"}],"source_content_type":"text/x-python","patch_set":28,"id":"baada198_b8c8fc22","line":60,"updated":"2014-07-21 20:51:22.000000000","message":"Multiple-line doc strings should, I think have a summary line, then blank line, then the rest of the text, then \"\"\" on a line on its own...see http://legacy.python.org/dev/peps/pep-0257/","commit_id":"d55ca98a9733846ba4fa7bec2c789ca92286e410"}],"keystone/validation/__init__.py":[{"author":{"_account_id":6482,"name":"Steve Martinelli","email":"s.martinelli@gmail.com","username":"stevemar"},"change_message_id":"9cf3cdfd81add6245936a6501fbae912f7fa1677","unresolved":false,"context_lines":[{"line_number":9,"context_line":"# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the"},{"line_number":10,"context_line":"# License for the specific language governing permissions and limitations"},{"line_number":11,"context_line":"# under the License."},{"line_number":12,"context_line":"\"\"\"Request Body validating middleware for OpenStack Identity Resources."},{"line_number":13,"context_line":"\"\"\""},{"line_number":14,"context_line":""},{"line_number":15,"context_line":"import functools"}],"source_content_type":"text/x-python","patch_set":3,"id":"9ad9bd40_4d5997fd","line":12,"updated":"2014-05-01 14:51:01.000000000","message":"lower case body and resources. they seem random","commit_id":"d76be626b2fa5ca95eb586251e08e55112af5a7b"},{"author":{"_account_id":5046,"name":"Lance Bragstad","email":"lbragstad@redhat.com","username":"ldbragst"},"change_message_id":"1aeaf17ac7ab42937bc35ecf6f7702f4ab74106c","unresolved":false,"context_lines":[{"line_number":9,"context_line":"# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the"},{"line_number":10,"context_line":"# License for the specific language governing permissions and limitations"},{"line_number":11,"context_line":"# under the License."},{"line_number":12,"context_line":"\"\"\"Request Body validating middleware for OpenStack Identity Resources."},{"line_number":13,"context_line":"\"\"\""},{"line_number":14,"context_line":""},{"line_number":15,"context_line":"import functools"}],"source_content_type":"text/x-python","patch_set":3,"id":"9ad9bd40_01bd9868","line":12,"in_reply_to":"9ad9bd40_4d5997fd","updated":"2014-05-01 18:14:00.000000000","message":"Done","commit_id":"d76be626b2fa5ca95eb586251e08e55112af5a7b"},{"author":{"_account_id":7725,"name":"David Stanek","email":"dstanek@dstanek.com","username":"dstanek"},"change_message_id":"40d6bd5fe6dc7bf9b8a0bc29d5be50a02c3c8063","unresolved":false,"context_lines":[{"line_number":27,"context_line":"    :param resource_to_validate: the reference to validate"},{"line_number":28,"context_line":""},{"line_number":29,"context_line":"    \"\"\""},{"line_number":30,"context_line":"    schema_validator \u003d validators._SchemaValidator(request_body_schema)"},{"line_number":31,"context_line":""},{"line_number":32,"context_line":"    def add_validator(func):"},{"line_number":33,"context_line":"        @functools.wraps(func)"}],"source_content_type":"text/x-python","patch_set":3,"id":"9ad9bd40_89180686","line":30,"updated":"2014-04-30 19:33:46.000000000","message":"I\u0027m not a fan of naming things with an underscore if they are not private or protected.\n\nAnother thought is to create a factory to return validator objects so that we can reuse them.","commit_id":"d76be626b2fa5ca95eb586251e08e55112af5a7b"},{"author":{"_account_id":5046,"name":"Lance Bragstad","email":"lbragstad@redhat.com","username":"ldbragst"},"change_message_id":"6d3c18dd8e3cf9443ddaf3c356cd62914e5f428e","unresolved":false,"context_lines":[{"line_number":27,"context_line":"    :param resource_to_validate: the reference to validate"},{"line_number":28,"context_line":""},{"line_number":29,"context_line":"    \"\"\""},{"line_number":30,"context_line":"    schema_validator \u003d validators._SchemaValidator(request_body_schema)"},{"line_number":31,"context_line":""},{"line_number":32,"context_line":"    def add_validator(func):"},{"line_number":33,"context_line":"        @functools.wraps(func)"}],"source_content_type":"text/x-python","patch_set":3,"id":"9ad9bd40_c19f305e","line":30,"in_reply_to":"9ad9bd40_89180686","updated":"2014-05-01 18:02:13.000000000","message":"Done","commit_id":"d76be626b2fa5ca95eb586251e08e55112af5a7b"},{"author":{"_account_id":5046,"name":"Lance Bragstad","email":"lbragstad@redhat.com","username":"ldbragst"},"change_message_id":"c8dd50c2ad4e9f68e76bcb1ce25ecdc997a9a469","unresolved":false,"context_lines":[{"line_number":27,"context_line":"    :param resource_to_validate: the reference to validate"},{"line_number":28,"context_line":""},{"line_number":29,"context_line":"    \"\"\""},{"line_number":30,"context_line":"    schema_validator \u003d validators._SchemaValidator(request_body_schema)"},{"line_number":31,"context_line":""},{"line_number":32,"context_line":"    def add_validator(func):"},{"line_number":33,"context_line":"        @functools.wraps(func)"}],"source_content_type":"text/x-python","patch_set":3,"id":"9ad9bd40_6e1ad618","line":30,"in_reply_to":"9ad9bd40_89180686","updated":"2014-05-01 13:44:02.000000000","message":"Sounds good, I can tweak this to fit.","commit_id":"d76be626b2fa5ca95eb586251e08e55112af5a7b"},{"author":{"_account_id":5046,"name":"Lance Bragstad","email":"lbragstad@redhat.com","username":"ldbragst"},"change_message_id":"8e39f82bf88a51142a9fe2232018e0bb89d875d8","unresolved":false,"context_lines":[{"line_number":27,"context_line":"    :param resource_to_validate: the reference to validate"},{"line_number":28,"context_line":""},{"line_number":29,"context_line":"    \"\"\""},{"line_number":30,"context_line":"    schema_validator \u003d validators._SchemaValidator(request_body_schema)"},{"line_number":31,"context_line":""},{"line_number":32,"context_line":"    def add_validator(func):"},{"line_number":33,"context_line":"        @functools.wraps(func)"}],"source_content_type":"text/x-python","patch_set":3,"id":"7adec928_c621964e","line":30,"in_reply_to":"9ad9bd40_c19f305e","updated":"2014-05-17 15:33:57.000000000","message":"One note on the factory thing mentioned above. After discussing at the summit this could be an optimization that could be done later, mainly so that we don\u0027t have a bunch of validator objects laying around when we could try and reuse them. \n\nThis all depends on how we want to validate. Right now, with the current implementation, we are validating a resource operation, which *should* be descriptive enough to only need one validator object per resource action (e.g. we will always only have one schema to validate project creation requests, we will need a separate validator object to validate project update requests). If for some reason the implementation changes, such that we need a validator for resource attributes (having a validator specifically for valid email formats) then I could see where it would be useful to cache that validator since it would be required in multiple resource operations (user create and user update could use the same email validator instead of creating new validator objects for each).","commit_id":"d76be626b2fa5ca95eb586251e08e55112af5a7b"},{"author":{"_account_id":7191,"name":"Jamie Lennox","email":"jamielennox@gmail.com","username":"jamielennox"},"change_message_id":"594269239e1323628a14e658b2239f4c801c41f8","unresolved":false,"context_lines":[{"line_number":16,"context_line":"from keystone.validation import validators"},{"line_number":17,"context_line":""},{"line_number":18,"context_line":""},{"line_number":19,"context_line":"def schema(request_body_schema, resource_to_validate):"},{"line_number":20,"context_line":"    \"\"\"Register a schema to validate a resource reference."},{"line_number":21,"context_line":""},{"line_number":22,"context_line":"    Registered schema will be used for validating request body just before"}],"source_content_type":"text/x-python","patch_set":9,"id":"9ad9bd40_ebd13858","line":19,"updated":"2014-05-05 00:55:11.000000000","message":"nit: you can find resource_to_validate from the self.member_name of \u0027wrapper\u0027. That\u0027s how the controller works now to set this name, and that\u0027s how @protected works.","commit_id":"4a4c831c5f4a6fad97645e174357c6e00e4e77ac"}],"keystone/validation/common_parameter_types.py":[{"author":{"_account_id":6482,"name":"Steve Martinelli","email":"s.martinelli@gmail.com","username":"stevemar"},"change_message_id":"9cf3cdfd81add6245936a6501fbae912f7fa1677","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":3,"id":"9ad9bd40_2d6453b8","updated":"2014-05-01 14:51:01.000000000","message":"I think it would be best if folks using jsonschema validators, could just add to this file in the future, for any parameter type (not just common). so i\u0027d be inclined to rename it to just parameter_types.","commit_id":"d76be626b2fa5ca95eb586251e08e55112af5a7b"},{"author":{"_account_id":6482,"name":"Steve Martinelli","email":"s.martinelli@gmail.com","username":"stevemar"},"change_message_id":"9cf3cdfd81add6245936a6501fbae912f7fa1677","unresolved":false,"context_lines":[{"line_number":35,"context_line":"    \u0027type\u0027: \u0027string\u0027, \u0027maxLength\u0027: 255,"},{"line_number":36,"context_line":"    \u0027pattern\u0027: \u0027^[a-zA-Z0-9-_.:]*$\u0027"},{"line_number":37,"context_line":"}"},{"line_number":38,"context_line":""},{"line_number":39,"context_line":"name \u003d {"},{"line_number":40,"context_line":"    \u0027type\u0027: \u0027string\u0027, \u0027minLength\u0027: 1, \u0027maxLength\u0027: 255,"},{"line_number":41,"context_line":"    # NOTE: Allow to some spaces in middle of name."}],"source_content_type":"text/x-python","patch_set":3,"id":"9ad9bd40_8d963f93","line":38,"updated":"2014-05-01 14:51:01.000000000","message":"wasn\u0027t there an issue recently where the user name (or was it id) had a comma? because it was ldap based. \n\njust something to think about","commit_id":"d76be626b2fa5ca95eb586251e08e55112af5a7b"},{"author":{"_account_id":5046,"name":"Lance Bragstad","email":"lbragstad@redhat.com","username":"ldbragst"},"change_message_id":"6d3c18dd8e3cf9443ddaf3c356cd62914e5f428e","unresolved":false,"context_lines":[{"line_number":35,"context_line":"    \u0027type\u0027: \u0027string\u0027, \u0027maxLength\u0027: 255,"},{"line_number":36,"context_line":"    \u0027pattern\u0027: \u0027^[a-zA-Z0-9-_.:]*$\u0027"},{"line_number":37,"context_line":"}"},{"line_number":38,"context_line":""},{"line_number":39,"context_line":"name \u003d {"},{"line_number":40,"context_line":"    \u0027type\u0027: \u0027string\u0027, \u0027minLength\u0027: 1, \u0027maxLength\u0027: 255,"},{"line_number":41,"context_line":"    # NOTE: Allow to some spaces in middle of name."}],"source_content_type":"text/x-python","patch_set":3,"id":"9ad9bd40_817c4822","line":38,"in_reply_to":"9ad9bd40_8d963f93","updated":"2014-05-01 18:02:13.000000000","message":"I can look into this, adding a NOTE so that it doesn\u0027t get forgotten about. Thanks!","commit_id":"d76be626b2fa5ca95eb586251e08e55112af5a7b"}],"keystone/validation/validators.py":[{"author":{"_account_id":6482,"name":"Steve Martinelli","email":"s.martinelli@gmail.com","username":"stevemar"},"change_message_id":"9cf3cdfd81add6245936a6501fbae912f7fa1677","unresolved":false,"context_lines":[{"line_number":10,"context_line":"# License for the specific language governing permissions and limitations"},{"line_number":11,"context_line":"# under the License."},{"line_number":12,"context_line":"\"\"\""},{"line_number":13,"context_line":"Internal implementation of request Body validating middleware."},{"line_number":14,"context_line":""},{"line_number":15,"context_line":"\"\"\""},{"line_number":16,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"9ad9bd40_8903940e","line":13,"updated":"2014-05-01 14:51:01.000000000","message":"s/Body/body","commit_id":"d76be626b2fa5ca95eb586251e08e55112af5a7b"},{"author":{"_account_id":5046,"name":"Lance Bragstad","email":"lbragstad@redhat.com","username":"ldbragst"},"change_message_id":"6d3c18dd8e3cf9443ddaf3c356cd62914e5f428e","unresolved":false,"context_lines":[{"line_number":10,"context_line":"# License for the specific language governing permissions and limitations"},{"line_number":11,"context_line":"# under the License."},{"line_number":12,"context_line":"\"\"\""},{"line_number":13,"context_line":"Internal implementation of request Body validating middleware."},{"line_number":14,"context_line":""},{"line_number":15,"context_line":"\"\"\""},{"line_number":16,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"9ad9bd40_e1aa746f","line":13,"in_reply_to":"9ad9bd40_8903940e","updated":"2014-05-01 18:02:13.000000000","message":"Done","commit_id":"d76be626b2fa5ca95eb586251e08e55112af5a7b"}]}
