Bad validation of table_name length

Bug #1298588 reported by Andrii Ostapenko
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
MagnetoDB
Fix Released
Low
Nuno Santos

Bug Description

Expected minimum table_name length is 3 characters. However we can create table with table_name, that consists of 1 or 2 characters

2014-03-27 20:07:53,687 Request: POST http://localhost:8480/v1/default_tenant/data/tables
2014-03-27 20:07:53,687 Request Headers: {'Content-Type': 'application/json', 'Accept': 'application/json'}
2014-03-27 20:07:53,687 Request Body: {"local_secondary_indexes": [{"key_schema": [{"key_type": "HASH", "attribute_name": "forum"}, {"key_type": "RANGE", "attribute_name": "last_posted_by"}], "index_name": "last_posted_by_index", "projection": {"projection_type": "ALL"}}], "key_schema": [{"key_type": "HASH", "attribute_name": "forum"}], "table_name": "qq", "attribute_definitions": [{"attribute_type": "S", "attribute_name": "forum"}, {"attribute_type": "S", "attribute_name": "subject"}, {"attribute_type": "S", "attribute_name": "last_posted_by"}]}
2014-03-27 20:07:55,545 Response Status: 200
2014-03-27 20:07:55,546 Response Headers: {'date': 'Thu, 27 Mar 2014 20:07:55 GMT', 'content-length': '896', 'content-type': 'application/json'}
2014-03-27 20:07:55,546 Response Body: {"table_description": {"key_schema": [{"key_type": "HASH", "attribute_name": "forum"}, {"key_type": "RANGE", "attribute_name": null}], "creation_date_time": 0, "links": [{"href": "http://localhost:8480/v1/default_tenant/data/tables/qq", "rel": "self"}, {"href": "http://localhost:8480/v1/default_tenant/data/tables/qq", "rel": "bookmark"}], "local_secondary_indexes": [{"index_size_bytes": 0, "key_schema": [{"key_type": "HASH", "attribute_name": "forum"}, {"key_type": "RANGE", "attribute_name": "last_posted_by"}], "index_name": "last_posted_by_index", "projection": {"projection_type": "ALL"}, "item_count": 0}], "table_name": "qq", "table_size_bytes": 0, "table_status": "ACTIVE", "attribute_definitions": [{"attribute_type": "S", "attribute_name": "last_posted_by"}, {"attribute_type": "S", "attribute_name": "forum"}, {"attribute_type": "S", "attribute_name": "subject"}], "item_count": 0}}

Changed in magnetodb:
importance: Undecided → Medium
milestone: none → 2.0.4
Changed in magnetodb:
milestone: 2.0.4 → next
importance: Medium → Low
Nuno Santos (nunosantos)
Changed in magnetodb:
assignee: nobody → Nuno Santos (nunosantos)
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on magnetodb (master)

Change abandoned by Nuno Santos (<email address hidden>) on branch: master
Review: https://review.openstack.org/125445

Changed in magnetodb:
milestone: next → kilo-1
tags: added: data-api
tags: added: validation
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to magnetodb (master)

Reviewed: https://review.openstack.org/125445
Committed: https://git.openstack.org/cgit/stackforge/magnetodb/commit/?id=2e2125b409a31c30f1edd4c70c3aa3c60c617006
Submitter: Jenkins
Branch: master

commit 2e2125b409a31c30f1edd4c70c3aa3c60c617006
Author: Nuno Santos <email address hidden>
Date: Tue Oct 28 15:41:57 2014 -0400

    Additional validation; UUIDs as internal table names

    Restrict keyspace, index, table, and attribute names to valid characters,
    and minimum and maximum lengths as per
    http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Limits.html

    Use UUIDs as internal table / column family names in Cassandra
    implementation, to deal with different length limits and valid characters.

    Closes-Bug: #1308528
    Closes-Bug: #1271576
    Closes-Bug: #1298588
    Closes-Bug: #1298633

    Implements blueprint cassandra-uuid-internal-names

    Change-Id: I47ea3dd15c6bf4b4946f626734f4d6e45375a48b

Changed in magnetodb:
status: In Progress → Fix Committed
Changed in magnetodb:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.