Add flag to enable trust per repo (#2541)
* Add flag to enable trust per repo * Add api for enabling/disabling trust * Add new LogEntryKind for changing repo trust settings Also add tests for repo trust api * Add `set_trust` method to repository * Expose new logkind to UI * Fix registry tests * Rebase migrations and regen test.db * Raise downstreamissue if trust metadata can't be removed * Refactor change_repo_trust * Add show_if to change_repo_trust endpoint
This commit is contained in:
parent
aa1c8d47dd
commit
2661db7485
13 changed files with 176 additions and 12 deletions
|
@ -0,0 +1,34 @@
|
|||
"""Add trust_enabled to repository
|
||||
|
||||
Revision ID: ed01e313d3cb
|
||||
Revises: c3d4b7ebcdf7
|
||||
Create Date: 2017-04-14 17:38:03.319695
|
||||
|
||||
"""
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision = 'ed01e313d3cb'
|
||||
down_revision = 'c3d4b7ebcdf7'
|
||||
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
|
||||
def upgrade(tables):
|
||||
### commands auto generated by Alembic - please adjust! ###
|
||||
op.add_column('repository', sa.Column('trust_enabled', sa.Boolean(), nullable=False))
|
||||
### end Alembic commands ###
|
||||
op.bulk_insert(tables.logentrykind, [
|
||||
{'name': 'change_repo_trust'},
|
||||
])
|
||||
|
||||
|
||||
def downgrade(tables):
|
||||
### commands auto generated by Alembic - please adjust! ###
|
||||
op.drop_column('repository', 'trust_enabled')
|
||||
### end Alembic commands ###
|
||||
|
||||
op.execute(tables
|
||||
.logentrykind
|
||||
.delete()
|
||||
.where(tables.
|
||||
logentrykind.name == op.inline_literal('change_repo_trust')))
|
Reference in a new issue