printers low-toner alerts; geenforce display readiness + token scope-binding; air-gap docker deploy kit

This commit is contained in:
2026-07-23 14:37:00 -04:00
parent 73b05e5b1c
commit c355eaae43
32 changed files with 2358 additions and 46 deletions

View File

@@ -0,0 +1,36 @@
"""apitokens.resourcescopes: pin a service token to specific resource scopes.
A geenforce.fetch token handed to a fleet (e.g. displays) should reach only its
own manifest scope(s) and the blobs those scopes ship, not every scope by name
or every blob by hash. This nullable JSON column carries that allowlist; NULL =
unrestricted, so every existing token keeps working unchanged. Idempotent.
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '7d30_apitoken_resourcescopes'
down_revision = '7d29_supportteam_webhookurl'
branch_labels = None
depends_on = None
def _has_column(bind, table, column):
inspector = sa.inspect(bind)
if table not in inspector.get_table_names():
return False
return column in {c['name'] for c in inspector.get_columns(table)}
def upgrade():
bind = op.get_bind()
if not _has_column(bind, 'apitokens', 'resourcescopes'):
op.add_column('apitokens',
sa.Column('resourcescopes', sa.Text(), nullable=True))
def downgrade():
bind = op.get_bind()
if _has_column(bind, 'apitokens', 'resourcescopes'):
op.drop_column('apitokens', 'resourcescopes')