Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🎨 add license_key field (🗃️) #6978

Merged
Changes from 36 commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
9c815b8
renaming wallets to credit account for frontend
matusdrobuliak66 Dec 13, 2024
6abf9bd
fix rut export CSV usage
matusdrobuliak66 Dec 13, 2024
a99b7cd
Merge branch 'master' into introduce-vip-models-pricing-6-part
matusdrobuliak66 Dec 13, 2024
abccfab
Merge branch 'master' into introduce-vip-models-pricing-6-part
matusdrobuliak66 Dec 13, 2024
e060492
implement rut part of checkout/release license
matusdrobuliak66 Dec 13, 2024
200b1db
implement rut part of checkout/release license
matusdrobuliak66 Dec 13, 2024
7406371
adding tests to rut
matusdrobuliak66 Dec 13, 2024
c4e56df
checkout release functionality
matusdrobuliak66 Dec 13, 2024
504d2c8
webserver functionality
matusdrobuliak66 Dec 16, 2024
7839e46
Merge branch 'master' into introduce-vip-models-pricing-6-part
matusdrobuliak66 Dec 16, 2024
68068fb
improve playwright e2e test
matusdrobuliak66 Dec 16, 2024
5dd8efa
Merge branch 'master' into introduce-vip-models-pricing-6-part
matusdrobuliak66 Dec 16, 2024
b803038
merge master
matusdrobuliak66 Dec 17, 2024
3f30f05
add get and list license usages
matusdrobuliak66 Dec 17, 2024
c0d5c8e
wire checkout and release in webserver
matusdrobuliak66 Dec 17, 2024
4c269c3
wire checkout and release in webserver
matusdrobuliak66 Dec 17, 2024
4eaaf16
wire checkout and release in webserver
matusdrobuliak66 Dec 17, 2024
34d4577
adding unit tests in webserver
matusdrobuliak66 Dec 17, 2024
4826fa8
renaming
matusdrobuliak66 Dec 17, 2024
1eaba29
renaming
matusdrobuliak66 Dec 17, 2024
a43626d
renaming
matusdrobuliak66 Dec 17, 2024
7a1dcf7
renaming
matusdrobuliak66 Dec 17, 2024
2a0b64f
renaming
matusdrobuliak66 Dec 17, 2024
f8c6567
imporve error handling
matusdrobuliak66 Dec 17, 2024
f38de47
fix api server
matusdrobuliak66 Dec 17, 2024
a150857
fix failing tests
matusdrobuliak66 Dec 17, 2024
043b78b
Merge branch 'master' into introduce-vip-models-pricing-6-part
matusdrobuliak66 Dec 17, 2024
8b41ebf
fix available tests
matusdrobuliak66 Dec 17, 2024
de312d3
fix mypy
matusdrobuliak66 Dec 17, 2024
68ee78c
fix e2e tests
matusdrobuliak66 Dec 18, 2024
7e8313c
Merge branch 'master' into introduce-vip-models-pricing-6-part
matusdrobuliak66 Dec 18, 2024
1ee8886
review @sanderegg
matusdrobuliak66 Dec 18, 2024
84eb893
review @pcrespov
matusdrobuliak66 Dec 18, 2024
53a9fee
merge master
matusdrobuliak66 Dec 18, 2024
58e2f03
add license key
matusdrobuliak66 Dec 18, 2024
172d343
openapi specs
matusdrobuliak66 Dec 18, 2024
1ebc3cd
review @pcrespov
matusdrobuliak66 Dec 18, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -11,6 +11,7 @@
class LicensedItemGet(OutputSchema):
licensed_item_id: LicensedItemID
name: str
license_key: str | None
licensed_resource_type: LicensedResourceType
pricing_plan_id: PricingPlanId
created_at: datetime
@@ -21,6 +22,7 @@ class LicensedItemGet(OutputSchema):
{
"licensed_item_id": "0362b88b-91f8-4b41-867c-35544ad1f7a1",
"name": "best-model",
"license_key": "license-specific-key",
"licensed_resource_type": f"{LicensedResourceType.VIP_MODEL}",
"pricing_plan_id": "15",
"created_at": "2024-12-12 09:59:26.422140",
Original file line number Diff line number Diff line change
@@ -24,6 +24,7 @@ class LicensedResourceType(StrAutoEnum):
class LicensedItemDB(BaseModel):
licensed_item_id: LicensedItemID
name: str
license_key: str | None
licensed_resource_type: LicensedResourceType
pricing_plan_id: PricingPlanId
product_name: ProductName
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
"""add license key

Revision ID: d31c23845017
Revises: aa6da21a0055
Create Date: 2024-12-18 11:11:52.644534+00:00

"""
import sqlalchemy as sa
from alembic import op

# revision identifiers, used by Alembic.
revision = "d31c23845017"
down_revision = "aa6da21a0055"
branch_labels = None
depends_on = None


def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.add_column(
"licensed_items", sa.Column("license_key", sa.String(), nullable=True)
)
# ### end Alembic commands ###


def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.drop_column("licensed_items", "license_key")
# ### end Alembic commands ###
Original file line number Diff line number Diff line change
@@ -58,6 +58,11 @@ class LicensedResourceType(str, enum.Enum):
nullable=False,
doc="Product name",
),
sa.Column(
"license_key",
sa.String,
nullable=True,
matusdrobuliak66 marked this conversation as resolved.
Show resolved Hide resolved
),
column_created_datetime(timezone=True),
column_modified_datetime(timezone=True),
)
Original file line number Diff line number Diff line change
@@ -141,4 +141,5 @@ class LicensedItemGet(BaseModel):

assert set(LicensedItemGet.model_fields.keys()) == set(
_LicensedItemGet.model_fields.keys()
- {"license_key"} # TODO: @bisgaard-itis please expose
matusdrobuliak66 marked this conversation as resolved.
Show resolved Hide resolved
)
Original file line number Diff line number Diff line change
@@ -10342,6 +10342,11 @@ components:
name:
type: string
title: Name
licenseKey:
anyOf:
- type: string
- type: 'null'
title: Licensekey
licensedResourceType:
$ref: '#/components/schemas/LicensedResourceType'
pricingPlanId:
@@ -10361,6 +10366,7 @@ components:
required:
- licensedItemId
- name
- licenseKey
- licensedResourceType
- pricingPlanId
- createdAt
Original file line number Diff line number Diff line change
@@ -45,6 +45,7 @@ async def get_licensed_item(
return LicensedItemGet(
licensed_item_id=licensed_item_db.licensed_item_id,
name=licensed_item_db.name,
license_key=licensed_item_db.license_key,
licensed_resource_type=licensed_item_db.licensed_resource_type,
pricing_plan_id=licensed_item_db.pricing_plan_id,
created_at=licensed_item_db.created,
@@ -68,6 +69,7 @@ async def list_licensed_items(
LicensedItemGet(
licensed_item_id=licensed_item_db.licensed_item_id,
name=licensed_item_db.name,
license_key=licensed_item_db.license_key,
licensed_resource_type=licensed_item_db.licensed_resource_type,
pricing_plan_id=licensed_item_db.pricing_plan_id,
created_at=licensed_item_db.created,
Original file line number Diff line number Diff line change
@@ -36,6 +36,7 @@
_SELECTION_ARGS = (
licensed_items.c.licensed_item_id,
licensed_items.c.name,
licensed_items.c.license_key,
licensed_items.c.licensed_resource_type,
licensed_items.c.pricing_plan_id,
licensed_items.c.product_name,