Skip to content

Commit

Permalink
Merge branch 'dev' into web/policy-wizard
Browse files Browse the repository at this point in the history
* dev:
  web/flows: update flow background (#11044)
  web: bump API Client version (#11043)
  website/integrations: Correct Discord avatar code and add warning. (#11031)
  core, web: update translations (#11032)
  website: bump docusaurus-theme-openapi-docs from 4.0.0 to 4.0.1 in /website (#11034)
  core: bump ruff from 0.6.1 to 0.6.2 (#11035)
  core: bump goauthentik.io/api/v3 from 3.2024063.12 to 3.2024063.13 (#11036)
  web: bump the babel group across 1 directory with 3 updates (#11038)
  web: bump wireit from 0.14.7 to 0.14.8 in /web (#11039)
  web: bump @goauthentik/api from 2024.6.3-1723921843 to 2024.6.3-1724337552 in /web/sfe (#11040)
  enterprise: add up-to-date license status (#11042)
  • Loading branch information
kensternberg-authentik committed Aug 26, 2024
2 parents 1f1c15b + 5007476 commit 6943af5
Show file tree
Hide file tree
Showing 30 changed files with 712 additions and 276 deletions.
17 changes: 14 additions & 3 deletions authentik/enterprise/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
from django.utils.timezone import now
from django.utils.translation import gettext as _
from drf_spectacular.types import OpenApiTypes
from drf_spectacular.utils import extend_schema, inline_serializer
from drf_spectacular.utils import OpenApiParameter, extend_schema, inline_serializer
from rest_framework.decorators import action
from rest_framework.exceptions import ValidationError
from rest_framework.fields import CharField, IntegerField
Expand Down Expand Up @@ -86,7 +86,7 @@ class LicenseViewSet(UsedByMixin, ModelViewSet):
},
)
@action(detail=False, methods=["GET"])
def get_install_id(self, request: Request) -> Response:
def install_id(self, request: Request) -> Response:
"""Get install_id"""
return Response(
data={
Expand All @@ -99,11 +99,22 @@ def get_install_id(self, request: Request) -> Response:
responses={
200: LicenseSummarySerializer(),
},
parameters=[
OpenApiParameter(
name="cached",
location=OpenApiParameter.QUERY,
type=OpenApiTypes.BOOL,
default=True,
)
],
)
@action(detail=False, methods=["GET"], permission_classes=[IsAuthenticated])
def summary(self, request: Request) -> Response:
"""Get the total license status"""
response = LicenseSummarySerializer(instance=LicenseKey.cached_summary())
summary = LicenseKey.cached_summary()
if request.query_params.get("cached").lower() == "false":
summary = LicenseKey.get_total().summary()
response = LicenseSummarySerializer(instance=summary)
return Response(response.data)

@permission_required(None, ["authentik_enterprise.view_license"])
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ require (
github.com/spf13/cobra v1.8.1
github.com/stretchr/testify v1.9.0
github.com/wwt/guac v1.3.2
goauthentik.io/api/v3 v3.2024063.12
goauthentik.io/api/v3 v3.2024063.13
golang.org/x/exp v0.0.0-20230210204819-062eb4c674ab
golang.org/x/oauth2 v0.22.0
golang.org/x/sync v0.8.0
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -299,8 +299,8 @@ go.opentelemetry.io/otel/trace v1.24.0 h1:CsKnnL4dUAr/0llH9FKuc698G04IrpWV0MQA/Y
go.opentelemetry.io/otel/trace v1.24.0/go.mod h1:HPc3Xr/cOApsBI154IU0OI0HJexz+aw5uPdbs3UCjNU=
go.uber.org/goleak v1.2.1 h1:NBol2c7O1ZokfZ0LEU9K6Whx/KnwvepVetCUhtKja4A=
go.uber.org/goleak v1.2.1/go.mod h1:qlT2yGI9QafXHhZZLxlSuNsMw3FFLxBr+tBRlmO1xH4=
goauthentik.io/api/v3 v3.2024063.12 h1:NaxjcgeJkvaQbMaoQv14lMdn62MS6isFForm4/oTBq0=
goauthentik.io/api/v3 v3.2024063.12/go.mod h1:zz+mEZg8rY/7eEjkMGWJ2DnGqk+zqxuybGCGrR2O4Kw=
goauthentik.io/api/v3 v3.2024063.13 h1:zWFlrr+8NOaQOCPSRV1FhbDJ58+BPa9BqjNvl4T//s8=
goauthentik.io/api/v3 v3.2024063.13/go.mod h1:zz+mEZg8rY/7eEjkMGWJ2DnGqk+zqxuybGCGrR2O4Kw=
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
Expand Down
38 changes: 19 additions & 19 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 8 additions & 2 deletions schema.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5842,9 +5842,9 @@ paths:
schema:
$ref: '#/components/schemas/GenericError'
description: ''
/enterprise/license/get_install_id/:
/enterprise/license/install_id/:
get:
operationId: enterprise_license_get_install_id_retrieve
operationId: enterprise_license_install_id_retrieve
description: Get install_id
tags:
- enterprise
Expand Down Expand Up @@ -5873,6 +5873,12 @@ paths:
get:
operationId: enterprise_license_summary_retrieve
description: Get the total license status
parameters:
- in: query
name: cached
schema:
type: boolean
default: true
tags:
- enterprise
security:
Expand Down
Loading

0 comments on commit 6943af5

Please sign in to comment.