diff --git a/barbican/model/migration/alembic_migrations/script.py.mako b/barbican/model/migration/alembic_migrations/script.py.mako index 3b1c960c9..90568b6a1 100644 --- a/barbican/model/migration/alembic_migrations/script.py.mako +++ b/barbican/model/migration/alembic_migrations/script.py.mako @@ -1,3 +1,18 @@ +# Copyright ${create_date.year} OpenStack Foundation +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. +# + """${message} Revision ID: ${up_revision} diff --git a/barbican/model/migration/alembic_migrations/versions/10220ccbe7fa_remove_transport_keys_column_from_.py b/barbican/model/migration/alembic_migrations/versions/10220ccbe7fa_remove_transport_keys_column_from_.py index 5cd38d8a2..b2a1f9b15 100644 --- a/barbican/model/migration/alembic_migrations/versions/10220ccbe7fa_remove_transport_keys_column_from_.py +++ b/barbican/model/migration/alembic_migrations/versions/10220ccbe7fa_remove_transport_keys_column_from_.py @@ -1,3 +1,16 @@ +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. + """Remove transport keys column from project quotas table Revision ID: 10220ccbe7fa @@ -11,7 +24,6 @@ revision = '10220ccbe7fa' down_revision = '3c3b04040bfe' from alembic import op -import sqlalchemy as sa def upgrade(): diff --git a/barbican/model/migration/alembic_migrations/versions/156cd9933643_add_project_column_to_consumer_table.py b/barbican/model/migration/alembic_migrations/versions/156cd9933643_add_project_column_to_consumer_table.py index ad2e4bc49..67ac11cfa 100644 --- a/barbican/model/migration/alembic_migrations/versions/156cd9933643_add_project_column_to_consumer_table.py +++ b/barbican/model/migration/alembic_migrations/versions/156cd9933643_add_project_column_to_consumer_table.py @@ -1,3 +1,16 @@ +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. + """Add project column to consumer table Revision ID: 156cd9933643 @@ -18,8 +31,8 @@ def upgrade(): op.add_column( 'container_consumer_metadata', sa.Column('project_id', - sa.String(length=36), - nullable=True)) + sa.String(length=36), + nullable=True)) op.create_index( op.f('ix_container_consumer_metadata_project_id'), 'container_consumer_metadata', diff --git a/barbican/model/migration/alembic_migrations/versions/161f8aceb687_fill_project_id_to_secrets_where_missing.py b/barbican/model/migration/alembic_migrations/versions/161f8aceb687_fill_project_id_to_secrets_where_missing.py index ae7ea1300..9e2c41fcb 100644 --- a/barbican/model/migration/alembic_migrations/versions/161f8aceb687_fill_project_id_to_secrets_where_missing.py +++ b/barbican/model/migration/alembic_migrations/versions/161f8aceb687_fill_project_id_to_secrets_where_missing.py @@ -1,3 +1,16 @@ +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. + """fill project_id to secrets where missing Revision ID: 161f8aceb687 @@ -44,7 +57,7 @@ def upgrade(): op.execute(secrets.update(). values({'project_id': project_secret.c.project_id}). where(secrets.c.id == project_secret.c.secret_id). - where(secrets.c.project_id == None) + where(secrets.c.project_id == None) # noqa ) # Need to drop foreign key constraint before mysql will allow changes @@ -58,5 +71,3 @@ def upgrade(): # Create foreign key constraint again _create_constraint(ctx, 'secrets_project_fk', 'secrets', 'projects', ['project_id'], ['id']) - - diff --git a/barbican/model/migration/alembic_migrations/versions/1a0c2cdafb38_initial_version.py b/barbican/model/migration/alembic_migrations/versions/1a0c2cdafb38_initial_version.py index a2ceb8ee1..102b849c4 100644 --- a/barbican/model/migration/alembic_migrations/versions/1a0c2cdafb38_initial_version.py +++ b/barbican/model/migration/alembic_migrations/versions/1a0c2cdafb38_initial_version.py @@ -1,3 +1,16 @@ +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. + """create test table Revision ID: 1a0c2cdafb38 diff --git a/barbican/model/migration/alembic_migrations/versions/1a7cf79559e3_new_secret_and_container_acl_tables.py b/barbican/model/migration/alembic_migrations/versions/1a7cf79559e3_new_secret_and_container_acl_tables.py index 5c4414e84..22f091417 100644 --- a/barbican/model/migration/alembic_migrations/versions/1a7cf79559e3_new_secret_and_container_acl_tables.py +++ b/barbican/model/migration/alembic_migrations/versions/1a7cf79559e3_new_secret_and_container_acl_tables.py @@ -1,3 +1,16 @@ +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. + """New secret and container ACL tables Revision ID: 1a7cf79559e3 diff --git a/barbican/model/migration/alembic_migrations/versions/1bc885808c76_add_project_id_to_secrets.py b/barbican/model/migration/alembic_migrations/versions/1bc885808c76_add_project_id_to_secrets.py index 2bc942930..2f06b400e 100644 --- a/barbican/model/migration/alembic_migrations/versions/1bc885808c76_add_project_id_to_secrets.py +++ b/barbican/model/migration/alembic_migrations/versions/1bc885808c76_add_project_id_to_secrets.py @@ -1,3 +1,16 @@ +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. + """Add project id to Secrets Revision ID: 1bc885808c76 diff --git a/barbican/model/migration/alembic_migrations/versions/1bece815014f_remove_projectsecret_table.py b/barbican/model/migration/alembic_migrations/versions/1bece815014f_remove_projectsecret_table.py index 849c25d02..a69eb986a 100644 --- a/barbican/model/migration/alembic_migrations/versions/1bece815014f_remove_projectsecret_table.py +++ b/barbican/model/migration/alembic_migrations/versions/1bece815014f_remove_projectsecret_table.py @@ -1,3 +1,16 @@ +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. + """remove ProjectSecret table Revision ID: 1bece815014f @@ -11,8 +24,6 @@ revision = '1bece815014f' down_revision = '161f8aceb687' from alembic import op -import sqlalchemy as sa -from sqlalchemy.dialects import postgresql def upgrade(): diff --git a/barbican/model/migration/alembic_migrations/versions/1c0f328bfce0_fixing_composite_primary_keys_and_.py b/barbican/model/migration/alembic_migrations/versions/1c0f328bfce0_fixing_composite_primary_keys_and_.py index 0a3801d6d..46d11fbf0 100644 --- a/barbican/model/migration/alembic_migrations/versions/1c0f328bfce0_fixing_composite_primary_keys_and_.py +++ b/barbican/model/migration/alembic_migrations/versions/1c0f328bfce0_fixing_composite_primary_keys_and_.py @@ -1,3 +1,16 @@ +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. + """Fixing composite primary keys and adding indexes to foreign key Revision ID: 1c0f328bfce0 @@ -21,36 +34,64 @@ def _drop_constraint(ctx, name, table): def upgrade(): - op.create_index(op.f('ix_certificate_authority_metadata_ca_id'), 'certificate_authority_metadata', ['ca_id'], unique=False) - op.create_index(op.f('ix_certificate_authority_metadata_key'), 'certificate_authority_metadata', ['key'], unique=False) - op.create_index(op.f('ix_container_consumer_metadata_container_id'), 'container_consumer_metadata', ['container_id'], unique=False) - op.create_index(op.f('ix_container_secret_container_id'), 'container_secret', ['container_id'], unique=False) - op.create_index(op.f('ix_container_secret_secret_id'), 'container_secret', ['secret_id'], unique=False) - op.create_index(op.f('ix_containers_project_id'), 'containers', ['project_id'], unique=False) - op.create_index(op.f('ix_encrypted_data_kek_id'), 'encrypted_data', ['kek_id'], unique=False) - op.create_index(op.f('ix_encrypted_data_secret_id'), 'encrypted_data', ['secret_id'], unique=False) - op.create_index(op.f('ix_kek_data_project_id'), 'kek_data', ['project_id'], unique=False) - op.create_index(op.f('ix_order_barbican_metadata_order_id'), 'order_barbican_metadata', ['order_id'], unique=False) - op.create_index(op.f('ix_order_plugin_metadata_order_id'), 'order_plugin_metadata', ['order_id'], unique=False) - op.create_index(op.f('ix_order_retry_tasks_order_id'), 'order_retry_tasks', ['order_id'], unique=False) - op.create_index(op.f('ix_orders_container_id'), 'orders', ['container_id'], unique=False) - op.create_index(op.f('ix_orders_project_id'), 'orders', ['project_id'], unique=False) - op.create_index(op.f('ix_orders_secret_id'), 'orders', ['secret_id'], unique=False) + op.create_index(op.f('ix_certificate_authority_metadata_ca_id'), + 'certificate_authority_metadata', ['ca_id'], unique=False) + op.create_index(op.f('ix_certificate_authority_metadata_key'), + 'certificate_authority_metadata', ['key'], unique=False) + op.create_index(op.f('ix_container_consumer_metadata_container_id'), + 'container_consumer_metadata', ['container_id'], + unique=False) + op.create_index(op.f('ix_container_secret_container_id'), + 'container_secret', ['container_id'], unique=False) + op.create_index(op.f('ix_container_secret_secret_id'), + 'container_secret', ['secret_id'], unique=False) + op.create_index(op.f('ix_containers_project_id'), + 'containers', ['project_id'], unique=False) + op.create_index(op.f('ix_encrypted_data_kek_id'), + 'encrypted_data', ['kek_id'], unique=False) + op.create_index(op.f('ix_encrypted_data_secret_id'), + 'encrypted_data', ['secret_id'], unique=False) + op.create_index(op.f('ix_kek_data_project_id'), + 'kek_data', ['project_id'], unique=False) + op.create_index(op.f('ix_order_barbican_metadata_order_id'), + 'order_barbican_metadata', ['order_id'], unique=False) + op.create_index(op.f('ix_order_plugin_metadata_order_id'), + 'order_plugin_metadata', ['order_id'], unique=False) + op.create_index(op.f('ix_order_retry_tasks_order_id'), + 'order_retry_tasks', ['order_id'], unique=False) + op.create_index(op.f('ix_orders_container_id'), + 'orders', ['container_id'], unique=False) + op.create_index(op.f('ix_orders_project_id'), + 'orders', ['project_id'], unique=False) + op.create_index(op.f('ix_orders_secret_id'), + 'orders', ['secret_id'], unique=False) ctx = op.get_context() - _drop_constraint(ctx, 'preferred_certificate_authorities_ibfk_1', 'preferred_certificate_authorities') + _drop_constraint(ctx, 'preferred_certificate_authorities_ibfk_1', + 'preferred_certificate_authorities') op.alter_column('preferred_certificate_authorities', 'ca_id', - existing_type=sa.VARCHAR(length=36), - nullable=False) + existing_type=sa.VARCHAR(length=36), + nullable=False) - op.create_foreign_key('preferred_certificate_authorities_fk', 'preferred_certificate_authorities', + op.create_foreign_key('preferred_certificate_authorities_fk', + 'preferred_certificate_authorities', 'certificate_authorities', ['ca_id'], ['id']) - op.create_index(op.f('ix_preferred_certificate_authorities_ca_id'), 'preferred_certificate_authorities', ['ca_id'], unique=False) - op.create_index(op.f('ix_preferred_certificate_authorities_project_id'), 'preferred_certificate_authorities', ['project_id'], unique=True) - op.create_index(op.f('ix_project_certificate_authorities_ca_id'), 'project_certificate_authorities', ['ca_id'], unique=False) - op.create_index(op.f('ix_project_certificate_authorities_project_id'), 'project_certificate_authorities', ['project_id'], unique=False) - op.create_index(op.f('ix_project_secret_project_id'), 'project_secret', ['project_id'], unique=False) - op.create_index(op.f('ix_project_secret_secret_id'), 'project_secret', ['secret_id'], unique=False) - op.create_index(op.f('ix_secret_store_metadata_secret_id'), 'secret_store_metadata', ['secret_id'], unique=False) + op.create_index(op.f('ix_preferred_certificate_authorities_ca_id'), + 'preferred_certificate_authorities', ['ca_id'], + unique=False) + op.create_index(op.f('ix_preferred_certificate_authorities_project_id'), + 'preferred_certificate_authorities', ['project_id'], + unique=True) + op.create_index(op.f('ix_project_certificate_authorities_ca_id'), + 'project_certificate_authorities', ['ca_id'], unique=False) + op.create_index(op.f('ix_project_certificate_authorities_project_id'), + 'project_certificate_authorities', ['project_id'], + unique=False) + op.create_index(op.f('ix_project_secret_project_id'), + 'project_secret', ['project_id'], unique=False) + op.create_index(op.f('ix_project_secret_secret_id'), + 'project_secret', ['secret_id'], unique=False) + op.create_index(op.f('ix_secret_store_metadata_secret_id'), + 'secret_store_metadata', ['secret_id'], unique=False) diff --git a/barbican/model/migration/alembic_migrations/versions/1e86c18af2dd_add_new_columns_type_meta_containerid.py b/barbican/model/migration/alembic_migrations/versions/1e86c18af2dd_add_new_columns_type_meta_containerid.py index 39052f8f5..a8a973e4d 100644 --- a/barbican/model/migration/alembic_migrations/versions/1e86c18af2dd_add_new_columns_type_meta_containerid.py +++ b/barbican/model/migration/alembic_migrations/versions/1e86c18af2dd_add_new_columns_type_meta_containerid.py @@ -1,3 +1,16 @@ +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. + """add new columns type meta containerId Revision ID: 1e86c18af2dd @@ -15,8 +28,10 @@ import sqlalchemy as sa def upgrade(): - ### commands auto generated by Alembic - please adjust! ### - op.add_column('orders', sa.Column('container_id', sa.String(length=36), nullable=True)) + op.add_column('orders', + sa.Column('container_id', sa.String(length=36), + nullable=True)) op.add_column('orders', sa.Column('meta', sa.Text, nullable=True)) - op.add_column('orders', sa.Column('type', sa.String(length=255), nullable=True)) - ### end Alembic commands ### + op.add_column('orders', + sa.Column('type', sa.String(length=255), + nullable=True)) diff --git a/barbican/model/migration/alembic_migrations/versions/254495565185_removing_redundant_fields_from_order.py b/barbican/model/migration/alembic_migrations/versions/254495565185_removing_redundant_fields_from_order.py index bd0647123..16e12e48f 100644 --- a/barbican/model/migration/alembic_migrations/versions/254495565185_removing_redundant_fields_from_order.py +++ b/barbican/model/migration/alembic_migrations/versions/254495565185_removing_redundant_fields_from_order.py @@ -1,3 +1,16 @@ +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. + """removing redundant fields from order Revision ID: 254495565185 @@ -11,7 +24,6 @@ revision = '254495565185' down_revision = '2843d6469f25' from alembic import op -import sqlalchemy as sa def upgrade(): diff --git a/barbican/model/migration/alembic_migrations/versions/256da65e0c5f_change_keystone_id_for_external_id_in_.py b/barbican/model/migration/alembic_migrations/versions/256da65e0c5f_change_keystone_id_for_external_id_in_.py index 44a78bc6f..65d205c4d 100644 --- a/barbican/model/migration/alembic_migrations/versions/256da65e0c5f_change_keystone_id_for_external_id_in_.py +++ b/barbican/model/migration/alembic_migrations/versions/256da65e0c5f_change_keystone_id_for_external_id_in_.py @@ -1,3 +1,16 @@ +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. + """Change keystone_id for external_id in Project model Revision ID: 256da65e0c5f diff --git a/barbican/model/migration/alembic_migrations/versions/2843d6469f25_add_sub_status_info_for_orders.py b/barbican/model/migration/alembic_migrations/versions/2843d6469f25_add_sub_status_info_for_orders.py index 6c24085c1..5900e59ba 100644 --- a/barbican/model/migration/alembic_migrations/versions/2843d6469f25_add_sub_status_info_for_orders.py +++ b/barbican/model/migration/alembic_migrations/versions/2843d6469f25_add_sub_status_info_for_orders.py @@ -1,3 +1,16 @@ +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. + """add sub status info for orders Revision ID: 2843d6469f25 @@ -15,5 +28,9 @@ import sqlalchemy as sa def upgrade(): - op.add_column('orders', sa.Column('sub_status', sa.String(length=36), nullable=True)) - op.add_column('orders', sa.Column('sub_status_message', sa.String(length=255), nullable=True)) + op.add_column('orders', + sa.Column('sub_status', sa.String(length=36), + nullable=True)) + op.add_column('orders', + sa.Column('sub_status_message', sa.String(length=255), + nullable=True)) diff --git a/barbican/model/migration/alembic_migrations/versions/2ab3f5371bde_dsa_in_container_type_modelbase_to.py b/barbican/model/migration/alembic_migrations/versions/2ab3f5371bde_dsa_in_container_type_modelbase_to.py index 1ce08981e..36d7a6927 100644 --- a/barbican/model/migration/alembic_migrations/versions/2ab3f5371bde_dsa_in_container_type_modelbase_to.py +++ b/barbican/model/migration/alembic_migrations/versions/2ab3f5371bde_dsa_in_container_type_modelbase_to.py @@ -1,3 +1,16 @@ +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. + """dsa in container type modelbase_to Revision ID: 2ab3f5371bde @@ -15,12 +28,18 @@ import sqlalchemy as sa def upgrade(): - op.add_column('container_secret', sa.Column('created_at', sa.DateTime(), nullable=False)) - op.add_column('container_secret', sa.Column('deleted', sa.Boolean(), nullable=False)) - op.add_column('container_secret', sa.Column('deleted_at', sa.DateTime(), nullable=True)) - op.add_column('container_secret', sa.Column('id', sa.String(length=36), nullable=False)) - op.add_column('container_secret', sa.Column('status', sa.String(length=20), nullable=False)) - op.add_column('container_secret', sa.Column('updated_at', sa.DateTime(), nullable=False)) + op.add_column('container_secret', + sa.Column('created_at', sa.DateTime(), nullable=False)) + op.add_column('container_secret', + sa.Column('deleted', sa.Boolean(), nullable=False)) + op.add_column('container_secret', + sa.Column('deleted_at', sa.DateTime(), nullable=True)) + op.add_column('container_secret', + sa.Column('id', sa.String(length=36), nullable=False)) + op.add_column('container_secret', + sa.Column('status', sa.String(length=20), nullable=False)) + op.add_column('container_secret', + sa.Column('updated_at', sa.DateTime(), nullable=False)) op.create_primary_key('pk_container_secret', 'container_secret', ['id']) op.create_unique_constraint( diff --git a/barbican/model/migration/alembic_migrations/versions/2d21598e7e70_added_ca_related_tables.py b/barbican/model/migration/alembic_migrations/versions/2d21598e7e70_added_ca_related_tables.py index ba8638a16..165210590 100644 --- a/barbican/model/migration/alembic_migrations/versions/2d21598e7e70_added_ca_related_tables.py +++ b/barbican/model/migration/alembic_migrations/versions/2d21598e7e70_added_ca_related_tables.py @@ -1,3 +1,16 @@ +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. + """Added CA related tables Revision ID: 2d21598e7e70 @@ -48,7 +61,8 @@ def upgrade(): sa.Column('status', sa.String(length=20), nullable=False), sa.Column('project_id', sa.String(length=36), nullable=False), sa.Column('ca_id', sa.String(length=36), nullable=False), - sa.ForeignKeyConstraint(['ca_id'], ['certificate_authorities.id'],), + sa.ForeignKeyConstraint(['ca_id'], + ['certificate_authorities.id'],), sa.ForeignKeyConstraint(['project_id'], ['projects.id'],), sa.PrimaryKeyConstraint('id', 'project_id', 'ca_id'), sa.UniqueConstraint('project_id', @@ -71,7 +85,8 @@ def upgrade(): sa.Column('key', sa.String(length=255), nullable=False), sa.Column('value', sa.String(length=255), nullable=False), sa.Column('ca_id', sa.String(length=36), nullable=False), - sa.ForeignKeyConstraint(['ca_id'], ['certificate_authorities.id'],), + sa.ForeignKeyConstraint(['ca_id'], + ['certificate_authorities.id'],), sa.PrimaryKeyConstraint('id', 'key', 'ca_id'), sa.UniqueConstraint('ca_id', 'key', @@ -93,7 +108,8 @@ def upgrade(): sa.Column('status', sa.String(length=20), nullable=False), sa.Column('project_id', sa.String(length=36), nullable=False), sa.Column('ca_id', sa.String(length=36), nullable=True), - sa.ForeignKeyConstraint(['ca_id'], ['certificate_authorities.id'],), + sa.ForeignKeyConstraint(['ca_id'], + ['certificate_authorities.id'],), sa.ForeignKeyConstraint(['project_id'], ['projects.id'],), sa.PrimaryKeyConstraint('id', 'project_id'), sa.UniqueConstraint('project_id') diff --git a/barbican/model/migration/alembic_migrations/versions/3041b53b95d7_remove_size_limits_on_meta_table_values.py b/barbican/model/migration/alembic_migrations/versions/3041b53b95d7_remove_size_limits_on_meta_table_values.py index 868df0325..e11bfab34 100644 --- a/barbican/model/migration/alembic_migrations/versions/3041b53b95d7_remove_size_limits_on_meta_table_values.py +++ b/barbican/model/migration/alembic_migrations/versions/3041b53b95d7_remove_size_limits_on_meta_table_values.py @@ -1,3 +1,16 @@ +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. + """Remove size limits on meta table values Revision ID: 3041b53b95d7 diff --git a/barbican/model/migration/alembic_migrations/versions/30dba269cc64_update_order_retry_tasks_table.py b/barbican/model/migration/alembic_migrations/versions/30dba269cc64_update_order_retry_tasks_table.py index 20690a949..7f8a4b1d0 100644 --- a/barbican/model/migration/alembic_migrations/versions/30dba269cc64_update_order_retry_tasks_table.py +++ b/barbican/model/migration/alembic_migrations/versions/30dba269cc64_update_order_retry_tasks_table.py @@ -1,3 +1,16 @@ +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. + """Update order_retry_tasks table Revision ID: 30dba269cc64 diff --git a/barbican/model/migration/alembic_migrations/versions/39a96e67e990_add_missing_constraints.py b/barbican/model/migration/alembic_migrations/versions/39a96e67e990_add_missing_constraints.py index c23bf742a..60b7c68ff 100644 --- a/barbican/model/migration/alembic_migrations/versions/39a96e67e990_add_missing_constraints.py +++ b/barbican/model/migration/alembic_migrations/versions/39a96e67e990_add_missing_constraints.py @@ -1,3 +1,16 @@ +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. + """Add missing constraints Revision ID: 39a96e67e990 @@ -16,8 +29,8 @@ import sqlalchemy as sa def upgrade(): # Add missing projects table keystone_id uniqueness constraint. - op.create_unique_constraint( - 'uc_projects_external_ids', 'projects', ['external_id']) + op.create_unique_constraint('uc_projects_external_ids', + 'projects', ['external_id']) # Add missing default for secret_acls' project_access. op.alter_column('secret_acls', 'project_access', diff --git a/barbican/model/migration/alembic_migrations/versions/39cf2e645cba_model_for_multiple_backend_support.py b/barbican/model/migration/alembic_migrations/versions/39cf2e645cba_model_for_multiple_backend_support.py index 37ea57855..a42b276a4 100644 --- a/barbican/model/migration/alembic_migrations/versions/39cf2e645cba_model_for_multiple_backend_support.py +++ b/barbican/model/migration/alembic_migrations/versions/39cf2e645cba_model_for_multiple_backend_support.py @@ -1,3 +1,16 @@ +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. + """Model for multiple backend support Revision ID: 39cf2e645cba diff --git a/barbican/model/migration/alembic_migrations/versions/3c3b04040bfe_add_owning_project_and_creator_to_cas.py b/barbican/model/migration/alembic_migrations/versions/3c3b04040bfe_add_owning_project_and_creator_to_cas.py index 42fb8ea83..4db046ba7 100644 --- a/barbican/model/migration/alembic_migrations/versions/3c3b04040bfe_add_owning_project_and_creator_to_cas.py +++ b/barbican/model/migration/alembic_migrations/versions/3c3b04040bfe_add_owning_project_and_creator_to_cas.py @@ -1,3 +1,16 @@ +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. + """add owning project and creator to CAs Revision ID: 3c3b04040bfe @@ -15,13 +28,11 @@ import sqlalchemy as sa def upgrade(): - ### commands auto generated by Alembic - please adjust! ### op.add_column('certificate_authorities', sa.Column('creator_id', sa.String(length=255), - nullable=True)) + nullable=True)) op.add_column('certificate_authorities', sa.Column('project_id', sa.String(length=36), - nullable=True)) + nullable=True)) op.create_foreign_key('cas_project_fk', 'certificate_authorities', 'projects', ['project_id'], ['id']) - ### end Alembic commands ### diff --git a/barbican/model/migration/alembic_migrations/versions/3d36a26b88af_add_order_barbican_metadata_table.py b/barbican/model/migration/alembic_migrations/versions/3d36a26b88af_add_order_barbican_metadata_table.py index df96c0d23..5cadb6909 100644 --- a/barbican/model/migration/alembic_migrations/versions/3d36a26b88af_add_order_barbican_metadata_table.py +++ b/barbican/model/migration/alembic_migrations/versions/3d36a26b88af_add_order_barbican_metadata_table.py @@ -1,3 +1,16 @@ +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. + """Add OrderBarbicanMetadata table Revision ID: 3d36a26b88af diff --git a/barbican/model/migration/alembic_migrations/versions/4070806f6972_add_orders_plugin_metadata_table_and_.py b/barbican/model/migration/alembic_migrations/versions/4070806f6972_add_orders_plugin_metadata_table_and_.py index cf84e0f32..20a5447f2 100644 --- a/barbican/model/migration/alembic_migrations/versions/4070806f6972_add_orders_plugin_metadata_table_and_.py +++ b/barbican/model/migration/alembic_migrations/versions/4070806f6972_add_orders_plugin_metadata_table_and_.py @@ -1,3 +1,16 @@ +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. + """Add orders plugin metadata table and relationships Revision ID: 4070806f6972 diff --git a/barbican/model/migration/alembic_migrations/versions/443d6f4a69ac_added_secret_type_column_to_secrets_.py b/barbican/model/migration/alembic_migrations/versions/443d6f4a69ac_added_secret_type_column_to_secrets_.py index 190172068..127c5f82b 100644 --- a/barbican/model/migration/alembic_migrations/versions/443d6f4a69ac_added_secret_type_column_to_secrets_.py +++ b/barbican/model/migration/alembic_migrations/versions/443d6f4a69ac_added_secret_type_column_to_secrets_.py @@ -1,3 +1,16 @@ +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. + """added secret type column to secrets table Revision ID: 443d6f4a69ac diff --git a/barbican/model/migration/alembic_migrations/versions/46b98cde536_add_project_quotas_table.py b/barbican/model/migration/alembic_migrations/versions/46b98cde536_add_project_quotas_table.py index 2dec302f3..60c489844 100644 --- a/barbican/model/migration/alembic_migrations/versions/46b98cde536_add_project_quotas_table.py +++ b/barbican/model/migration/alembic_migrations/versions/46b98cde536_add_project_quotas_table.py @@ -1,3 +1,16 @@ +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. + """Add project quotas table Revision ID: 46b98cde536 diff --git a/barbican/model/migration/alembic_migrations/versions/47b69e523451_made_plugin_names_in_kek_datum_non_.py b/barbican/model/migration/alembic_migrations/versions/47b69e523451_made_plugin_names_in_kek_datum_non_.py index e953d8ae9..18ab55891 100644 --- a/barbican/model/migration/alembic_migrations/versions/47b69e523451_made_plugin_names_in_kek_datum_non_.py +++ b/barbican/model/migration/alembic_migrations/versions/47b69e523451_made_plugin_names_in_kek_datum_non_.py @@ -1,3 +1,16 @@ +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. + """Made plugin names in kek datum non nullable Revision ID: 47b69e523451 diff --git a/barbican/model/migration/alembic_migrations/versions/4ecde3a3a72a_add_cas_column_to_project_quotas_table.py b/barbican/model/migration/alembic_migrations/versions/4ecde3a3a72a_add_cas_column_to_project_quotas_table.py index d3fc69e45..f72ce3382 100644 --- a/barbican/model/migration/alembic_migrations/versions/4ecde3a3a72a_add_cas_column_to_project_quotas_table.py +++ b/barbican/model/migration/alembic_migrations/versions/4ecde3a3a72a_add_cas_column_to_project_quotas_table.py @@ -1,3 +1,16 @@ +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. + """Add cas column to project quotas table Revision ID: 4ecde3a3a72a diff --git a/barbican/model/migration/alembic_migrations/versions/6a4457517a3_rename_acl_creator_only_to_project_.py b/barbican/model/migration/alembic_migrations/versions/6a4457517a3_rename_acl_creator_only_to_project_.py index 5b8fff419..c16927bd9 100644 --- a/barbican/model/migration/alembic_migrations/versions/6a4457517a3_rename_acl_creator_only_to_project_.py +++ b/barbican/model/migration/alembic_migrations/versions/6a4457517a3_rename_acl_creator_only_to_project_.py @@ -1,3 +1,16 @@ +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. + """rename ACL creator_only to project_access Revision ID: 6a4457517a3 @@ -16,9 +29,6 @@ import sqlalchemy as sa def upgrade(): - ctx = op.get_context() - con = op.get_bind() - op.alter_column('secret_acls', 'creator_only', existing_type=sa.BOOLEAN(), new_column_name='project_access') diff --git a/barbican/model/migration/alembic_migrations/versions/795737bb3c3_change_tenants_to_projects.py b/barbican/model/migration/alembic_migrations/versions/795737bb3c3_change_tenants_to_projects.py index 8642505da..589aa773a 100644 --- a/barbican/model/migration/alembic_migrations/versions/795737bb3c3_change_tenants_to_projects.py +++ b/barbican/model/migration/alembic_migrations/versions/795737bb3c3_change_tenants_to_projects.py @@ -1,3 +1,16 @@ +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. + """Change tenants to projects Revision ID: 795737bb3c3 @@ -30,6 +43,7 @@ def _change_fk_to_project(ctx, con, table, fk_old, fk_new): op.create_foreign_key(fk_new, table, 'projects', ['project_id'], ['id']) + def upgrade(): # project_secret table ctx = op.get_context() diff --git a/barbican/model/migration/alembic_migrations/versions/aa2cf96a1d5_add_orderretrytask.py b/barbican/model/migration/alembic_migrations/versions/aa2cf96a1d5_add_orderretrytask.py index f8854882f..9e5b96664 100644 --- a/barbican/model/migration/alembic_migrations/versions/aa2cf96a1d5_add_orderretrytask.py +++ b/barbican/model/migration/alembic_migrations/versions/aa2cf96a1d5_add_orderretrytask.py @@ -1,3 +1,16 @@ +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. + """Add OrderRetryTask Revision ID: aa2cf96a1d5 diff --git a/barbican/model/migration/alembic_migrations/versions/cd4106a1a0_add_cert_to_container_type.py b/barbican/model/migration/alembic_migrations/versions/cd4106a1a0_add_cert_to_container_type.py index f6dfe6fa9..d2805100d 100644 --- a/barbican/model/migration/alembic_migrations/versions/cd4106a1a0_add_cert_to_container_type.py +++ b/barbican/model/migration/alembic_migrations/versions/cd4106a1a0_add_cert_to_container_type.py @@ -1,3 +1,16 @@ +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. + """add-cert-to-container-type Revision ID: cd4106a1a0 diff --git a/barbican/model/migration/alembic_migrations/versions/d2780d5aa510_change_url_length.py b/barbican/model/migration/alembic_migrations/versions/d2780d5aa510_change_url_length.py index e6678ff34..97632b9ed 100644 --- a/barbican/model/migration/alembic_migrations/versions/d2780d5aa510_change_url_length.py +++ b/barbican/model/migration/alembic_migrations/versions/d2780d5aa510_change_url_length.py @@ -1,3 +1,16 @@ +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. + """change_url_length Revision ID: d2780d5aa510 diff --git a/tox.ini b/tox.ini index f3354194e..896c7c37f 100644 --- a/tox.ini +++ b/tox.ini @@ -76,7 +76,7 @@ passenv = KMIP_PLUGIN_ENABLED [flake8] exclude = .git,.idea,.tox,bin,dist,debian,rpmbuild,tools,*.egg-info,*.eggs,contrib, - functionaltests,*alembic_migrations/versions,*docs/target,*.egg + functionaltests,*docs/target,*.egg [testenv:bandit] deps = -r{toxinidir}/test-requirements.txt