Skip to content

Commit

Permalink
Merge branch 'main' into application-wizard-2-with-api-and-tests
Browse files Browse the repository at this point in the history
* main:
  enterprise: bump license usage task frequency (#7215)
  web: bump the storybook group in /web with 5 updates (#7212)
  web: bump the sentry group in /web with 2 updates (#7211)
  Revert "web: Updates to the Context and Tasks libraries from lit. (#7168)"
  web: bump @types/codemirror from 5.60.10 to 5.60.11 in /web (#7209)
  web: bump @types/chart.js from 2.9.38 to 2.9.39 in /web (#7206)
  web: bump pyright from 1.1.331 to 1.1.332 in /web (#7208)
  web: bump @types/grecaptcha from 3.0.5 to 3.0.6 in /web (#7207)
  • Loading branch information
kensternberg-authentik committed Oct 18, 2023
2 parents 2a31d89 + 6ba4f4d commit 5e1854f
Show file tree
Hide file tree
Showing 8 changed files with 4,533 additions and 1,209 deletions.
5 changes: 0 additions & 5 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,6 @@ updates:
esbuild:
patterns:
- "@esbuild/*"
rollup:
patterns:
- "@rollup/*"
- "rollup"
- "rollup-*"
- package-ecosystem: npm
directory: "/tests/wdio"
schedule:
Expand Down
3 changes: 3 additions & 0 deletions authentik/enterprise/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,9 @@ def is_valid(self) -> bool:

def record_usage(self):
"""Capture the current validity status and metrics and save them"""
threshold = now() - timedelta(hours=8)
if LicenseUsage.objects.filter(record_date__gte=threshold).exists():
return
LicenseUsage.objects.create(
user_count=self.get_default_user_count(),
external_user_count=self.get_external_user_count(),
Expand Down
2 changes: 1 addition & 1 deletion authentik/enterprise/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
CELERY_BEAT_SCHEDULE = {
"enterprise_calculate_license": {
"task": "authentik.enterprise.tasks.calculate_license",
"schedule": crontab(minute=fqdn_rand("calculate_license"), hour="*/8"),
"schedule": crontab(minute=fqdn_rand("calculate_license"), hour="*/2"),
"options": {"queue": "authentik_scheduled"},
}
}
3 changes: 1 addition & 2 deletions authentik/enterprise/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,4 @@
@CELERY_APP.task()
def calculate_license():
"""Calculate licensing status"""
total = LicenseKey.get_total()
total.record_usage()
LicenseKey.get_total().record_usage()
5,692 changes: 4,509 additions & 1,183 deletions web/package-lock.json

Large diffs are not rendered by default.

31 changes: 14 additions & 17 deletions web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,14 +39,14 @@
"@formatjs/intl-listformat": "^7.5.0",
"@fortawesome/fontawesome-free": "^6.4.2",
"@goauthentik/api": "^2023.8.3-1697470337",
"@lit/context": "^1.0.0",
"@lit-labs/context": "^0.4.1",
"@lit-labs/task": "^3.1.0",
"@lit/localize": "^0.11.4",
"@lit/task": "^1.0.0",
"@open-wc/lit-helpers": "^0.6.0",
"@patternfly/elements": "^2.4.0",
"@patternfly/patternfly": "^4.224.2",
"@sentry/browser": "^7.74.0",
"@sentry/tracing": "^7.74.0",
"@sentry/browser": "^7.74.1",
"@sentry/tracing": "^7.74.1",
"@webcomponents/webcomponentsjs": "^2.8.0",
"base64-js": "^1.5.1",
"chart.js": "^4.4.0",
Expand Down Expand Up @@ -82,15 +82,15 @@
"@rollup/plugin-replace": "^5.0.4",
"@rollup/plugin-terser": "^0.4.4",
"@rollup/plugin-typescript": "^11.1.5",
"@storybook/addon-essentials": "^7.4.6",
"@storybook/addon-links": "^7.4.6",
"@storybook/addon-essentials": "^7.5.0",
"@storybook/addon-links": "^7.5.0",
"@storybook/blocks": "^7.1.1",
"@storybook/web-components": "^7.4.6",
"@storybook/web-components-vite": "^7.4.6",
"@storybook/web-components": "^7.5.0",
"@storybook/web-components-vite": "^7.5.0",
"@trivago/prettier-plugin-sort-imports": "^4.2.0",
"@types/chart.js": "^2.9.38",
"@types/codemirror": "5.60.10",
"@types/grecaptcha": "^3.0.5",
"@types/chart.js": "^2.9.39",
"@types/codemirror": "5.60.11",
"@types/grecaptcha": "^3.0.6",
"@typescript-eslint/eslint-plugin": "^6.8.0",
"@typescript-eslint/parser": "^6.8.0",
"babel-plugin-macros": "^3.1.0",
Expand All @@ -106,14 +106,14 @@
"npm-run-all": "^4.1.5",
"prettier": "^3.0.3",
"pseudolocale": "^2.0.0",
"pyright": "^1.1.331",
"pyright": "^1.1.332",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"rollup": "^4.1.4",
"rollup-plugin-copy": "^3.5.0",
"rollup-plugin-cssimport": "^1.0.3",
"rollup-plugin-postcss-lit": "^2.1.0",
"storybook": "^7.4.6",
"storybook": "^7.5.0",
"storybook-addon-mock": "^4.3.0",
"ts-lit-plugin": "^1.2.1",
"tslib": "^2.6.2",
Expand All @@ -124,9 +124,6 @@
"optionalDependencies": {
"@esbuild/darwin-arm64": "^0.19.5",
"@esbuild/linux-amd64": "^0.18.11",
"@esbuild/linux-arm64": "^0.19.5",
"@rollup/rollup-darwin-arm64": "4.1.4",
"@rollup/rollup-linux-x64-gnu": "4.1.4",
"@rollup/rollup-linux-arm64-gnu": "4.1.4"
"@esbuild/linux-arm64": "^0.19.5"
}
}
4 changes: 4 additions & 0 deletions web/src/elements/ak-locale-context/context.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
import { createContext } from "@lit-labs/context";

export const localeContext = createContext<string>("locale");
export default localeContext;
2 changes: 1 addition & 1 deletion web/src/elements/buttons/SpinnerButton/BaseTaskButton.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { AKElement } from "@goauthentik/elements/Base";
import { PFSize } from "@goauthentik/elements/Spinner";
import { CustomEmitterElement } from "@goauthentik/elements/utils/eventEmitter";

import { Task, TaskStatus } from "@lit/task";
import { Task, TaskStatus } from "@lit-labs/task";
import { css, html } from "lit";

import PFButton from "@patternfly/patternfly/components/Button/button.css";
Expand Down

0 comments on commit 5e1854f

Please sign in to comment.