-
Notifications
You must be signed in to change notification settings - Fork 299
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
mirror: increased registry user/pass max length (PROJQUAY-2712) (#945)
Increases the maximum length of external_registry_username and external_registry_password fields from 2048 to 4096. Some registries, e.g ECR, issue a token to be used as password, whose length is longer than 2048 after being encrypted and base64 encoded. Since JWT's specs do not specify a maximum length, we set the combined max length of these fields to approximately 8K, the default header size on most servers (including nginx), since these credentials will be passed in a auth header during the auth flow.
- Loading branch information
Showing
2 changed files
with
47 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
45 changes: 45 additions & 0 deletions
45
data/migrations/versions/d94d328733e4_increase_repomirrorconfig_char_size.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
"""Increase repomirrorconfig char size | ||
Revision ID: d94d328733e4 | ||
Revises: b43b44996c26 | ||
Create Date: 2022-04-12 14:16:07.660766 | ||
""" | ||
|
||
# revision identifiers, used by Alembic. | ||
revision = "d94d328733e4" | ||
down_revision = "b43b44996c26" | ||
|
||
import sqlalchemy as sa | ||
|
||
|
||
def upgrade(op, tables, tester): | ||
op.alter_column( | ||
"repomirrorconfig", | ||
"external_registry_username", | ||
type_=sa.String(length=4096), | ||
nullable=True, | ||
) | ||
|
||
op.alter_column( | ||
"repomirrorconfig", | ||
"external_registry_password", | ||
type_=sa.String(length=4096), | ||
nullable=True, | ||
) | ||
|
||
|
||
def downgrade(op, tables, tester): | ||
op.alter_column( | ||
"repomirrorconfig", | ||
"external_registry_username", | ||
type_=sa.String(length=2048), | ||
nullable=True, | ||
) | ||
|
||
op.alter_column( | ||
"repomirrorconfig", | ||
"external_registry_password", | ||
type_=sa.String(length=2048), | ||
nullable=True, | ||
) |