Files
authentik/web/packages/common
Ken Sternberg 06d8ea81e5 Merge branch 'main' into web/parts/common
* main: (77 commits)
  web: Ignore Storybook when running codespell. (#13454)
  core: bump ruff from 0.9.9 to 0.9.10 (#13448)
  core: bump webauthn from 2.5.1 to 2.5.2 (#13449)
  website/docs: backup and restore: remove extra period (#13440)
  website: bump prismjs from 1.29.0 to 1.30.0 in /website (#13456)
  web: bump prismjs from 1.29.0 to 1.30.0 in /web (#13455)
  web: admin interface: faster card load (#13331)
  web/admin: fix display bug for assigned users in application bindings in the wizard (#13435)
  website: bump the build group across 1 directory with 9 updates (#13442)
  core: bump django from 5.0.12 to 5.0.13 (#13425)
  providers/SCIM: fix object exists error for users, attempt to look up user ID in remote system (#13437)
  website/docs: sys mgmt: document authentik backups/restoration (#12943)
  website: fix build in docker (#13430)
  website/integrations: zipline: add (#13257)
  translate: Updates for file web/xliff/en.xlf in fr (#13431)
  lifecycle/aws: bump aws-cdk from 2.1002.0 to 2.1003.0 in /lifecycle/aws (#13426)
  translate: Updates for file web/xliff/en.xlf in zh_CN (#13428)
  translate: Updates for file web/xliff/en.xlf in zh-Hans (#13429)
  core, web: update translations (#13423)
  website: add a better edit this page element (#13391)
  ...
2025-03-11 07:14:02 -07:00
..
2025-02-28 14:35:26 -08:00
2025-02-28 14:35:26 -08:00

@goauthentik/common

The common package is a bit of a grab-bag of tools, utilities, and configuration details used throughout the Authentik front-end suite. Here, we'll try (emphasis on the try) to document what each part does.

  • ./api

The ./api folder contains helpers and plug-ins for communicating with the Authentik API. Its primary purpose is to provide the default configuration details for establishing a channel to the API, as well as figuring out the default locale, branding information, and even the favicon. (See what I said about it being a grab-bag?) It has its own list of todos.

  • /helpers/plex

Contains configuration tools and access for the Plex TV client. Used by all three primary interfaces, but again, not exactly a foundational tool.

  • /helpers/webauthn

Used entirely by the WebAuthn tools in the Flow interface.

  • /styles:

authentik's overrides for patternfly and dark mode.

TODO: Move this into its own package.

  • /ui:

Describes the schema of the UIConfig Attributes Object, which dictates certain details about UI behavior, such as the preliminary state of drawers, editors, and layouts. It also has an API call to fetch that UIConfig object from the server.

  • /constants.ts

Another grab-bag of configuration details: event names, default classnames for setting some visual details, web socket message type tokens, and the localstorage key.

  • /enums.ts

Contains one thing: a mapping of generic UI sizing terms to specific classnames in the CSS.

  • ./errors.ts

An error handling toolkit related to the ./api above.

  • ./events.ts

An extension of the API's "Event" types to assist in reporting server-side events to the user. Has nothing to do with the browser's internal Event type. Used entirely within ./admin, may be suitable to being moved there.

  • ./global.ts

A single function that retrieves any global information for the UI from the index.html file in which it was invoked. Used by our Django application to preload configuration information.

  • ./labels.ts,

Maps a variety of API tokens to human-readable labels, including those for:

  • Events
  • Severities
  • User Types
  • Stage Intent

It might make more sense to move these closer to where they're used, if their use is local to a single interface or component.

  • ./messages.ts

Contains one thing: a mapping of generic UI alert-level terms to specific classnames in the CSS.

  • ./sentry.ts

Sentry is an application monitoring package for finding code breakage. The Sentry configuration for all of our interfaces is kept here.

  • ./users.ts

Despite the plural name, this is entirely about getting the current user's configuration from the server. Used by all three major interfaces. Could probably be replaced by a context. (Possibly already has been.)

  • ./utils.ts

The classic junk drawer of UI development. A few string functions, a few utilities from YouMightNotNeedLodash, a slugifier, some date handling utilities, that sort of thing.

  • ./ws.ts

Sets up our web socket for receiving server-side events. Used by all three major interfaces.