-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add an internal api so that we might revoke api keys (#1973)
* Add an internal api so that we might revoke api keys * Add tests for api keys revokation
- Loading branch information
Showing
6 changed files
with
179 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
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
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
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,26 @@ | ||
""" | ||
Revision ID: 0436_add_columns_api_keys | ||
Revises: 0435_update_email_templates_2.py | ||
Create Date: 2023-09-01 | ||
""" | ||
import sqlalchemy as sa | ||
from alembic import op | ||
from sqlalchemy.dialects.postgresql import JSONB | ||
|
||
revision = "0436_add_columns_api_keys" | ||
down_revision = "0435_update_email_templates_2" | ||
|
||
user = "postgres" | ||
timeout = 60 # in seconds, i.e. 1 minute | ||
|
||
|
||
def upgrade(): | ||
op.add_column("api_keys", sa.Column("compromised_key_info", JSONB, nullable=True)) | ||
op.add_column("api_keys_history", sa.Column("compromised_key_info", JSONB, nullable=True)) | ||
|
||
|
||
def downgrade(): | ||
op.drop_column("api_keys", "compromised_key_info") | ||
op.drop_column("api_keys_history", "compromised_key_info") |
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
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