This repository has been archived on 2024-05-31. You can view files and clone it, but cannot push or open issues or pull requests.
authentik/web
Ken Sternberg afdf269869 web: funnel an API down to a single module
**Summary:**

Calls to _retrieve_, _create_, and _update_ Authenticators have been isolated into a module
functions and code accessing those features have been revised to use those functions.

**This commit**

Isolates the Authenticators APIs for `authenticatorsAllList`, `authenticatorsAdminAllList`,
`authenticators<Type>Destroy` and `authenticators<Type>Update` into a connector module, and updates
client code to use them. This eliminates the duplication of `deleteAuthenticatorDevice`, the code
for which was in both *Admin* and *User*, and creates a single source of truth for the DeviceType
strings that identify Device subtypes.

**Details**

One thing that's bothered me a lot is the way our APIs, starting on the Django side, start with a
base model and then "spread out" to incorporate many different inheritance models: different kinds
of Providers, different kinds of Outposts, and different kinds of authentication devices.

In a proper object-oriented system, we'd be granted access to the base class and have the power to
use it effectively as a generic, switchboarding on some RTTI or value type to handle the differences
between the concrete child types. The code generator we use does not provide that base model to UI
clients; "funnelling down" to create a sort of artificial base class on the client and then fanning
back out is an impractical and error-prone exercise.

But we still do a lot of switchboarding, which has three problems:

- Adding subtypes touches a lot of different code
- Distant implementations can miss a specific instance of a subtype
- Repeated use of strings as type handles can introduce spelling errors
- The [last line effect](https://link.springer.com/article/10.1007/s10664-016-9489-6) can introduce
  new and subtle bugs when cut-and-pasting prior examples
- Instances of the *same code* in multiple locations make for maintenance headaches

This patch introduces the concept of **connectors**, modules that provide CRUD functions for common
operations performed on objects of a specific subtype. It is *not* meant to replace concrete class
displays or manipulations, such as (using providers as an example) `ProxyProviderViewPage` or HTML
that is customized for a specific concrete type of provider.

For retrieving lists, deleting instances that can be addressed from the base class, or updating
objects — any place where which call among a collection of isomorphic APIs must be specifieda using
`switch/case` statements — the connector provides a single source of truth for how to recognize the
child types, which `switch/case` statements provide the utility, and what must be done to update
them.
2023-12-22 13:33:23 -08:00
..
.storybook web: fix storybook build after npm update (#7855) 2023-12-18 15:57:39 +01:00
authentik/sources sources/oauth: fix reddit (#5557) 2023-05-09 23:41:24 +02:00
icons web, website: compress images (#6121) 2023-08-02 12:06:03 +00:00
scripts web: fix storybook build after npm update (#7855) 2023-12-18 15:57:39 +01:00
src web: funnel an API down to a single module 2023-12-22 13:33:23 -08:00
xliff flows: add "require outpost" authentication_requirement (#7921) 2023-12-19 13:32:10 +01:00
.babelrc web/admin: simplify sidebar renderer (#6797) 2023-09-11 12:58:55 -07:00
.dockerignore root: fix references to helm chart 2021-06-13 14:30:44 +02:00
.eslintignore web: bump @typescript-eslint/eslint-plugin from 5.61.0 to 6.0.0 in /web (#6210) 2023-07-11 14:32:50 +02:00
.eslintrc.json web: laying the groundwork for future expansion (#7045) 2023-10-02 13:33:27 -07:00
.eslintrc.precommit.json web: Detangling some circular dependencies in Admin and User (#6852) 2023-09-13 10:16:24 -07:00
.gitignore web: the return of pseudolocalization (#7190) 2023-10-16 13:54:43 -07:00
.prettierignore enterprise: initial enterprise (#5721) 2023-07-17 17:57:08 +02:00
.prettierrc.json web: bump prettier from 2.8.8 to 3.0.0 in /web (#6329) 2023-07-21 18:19:19 +02:00
lit-localize.json web: locales: rename fr_FR to fr to match transifex 2023-10-02 13:31:21 +02:00
package-lock.json web: bump API Client version (#7924) 2023-12-19 12:46:04 +00:00
package.json web: bump API Client version (#7924) 2023-12-19 12:46:04 +00:00
README.md web: Add storybook (#5865) 2023-06-07 13:05:33 +02:00
robots.txt root: move webapp to /web (#347) 2020-11-28 19:43:42 +01:00
rollup.config.mjs web: refactor sidebar capabilities for categorical subsections (#7482) 2023-11-20 10:24:59 -08:00
rollup.proxy.mjs web: bump rollup from 2.79.1 to 3.28.1 in /web (#6616) 2023-08-24 17:13:03 +02:00
security.txt root: update supported versions 2023-01-20 14:23:21 +01:00
static.go outposts: release binary outposts (#1954) 2021-12-17 19:49:32 +00:00
static_outpost.go outposts: release binary outposts (#1954) 2021-12-17 19:49:32 +00:00
tsconfig.json web: funnel an API down to a single module 2023-12-22 13:33:23 -08:00
web-test-runner.config.mjs web: basic cleanup of buttons (#6107) 2023-07-18 08:29:42 -07:00

authentik WebUI

This is the default UI for the authentik server. The documentation is going to be a little sparse for awhile, but at least let's get started.

Comments

NOTE: The comments in this section are for specific changes to this repository that cannot be reliably documented any other way. For the most part, they contain comments related to custom settings in JSON files, which do not support comments.

  • tsconfig.json:
    • compilerOptions.useDefineForClassFields: false is required to make TSC use the "classic" form of field definition when compiling class definitions. Storybook does not handle the ESNext proposed definition mechanism (yet).
    • compilerOptions.plugins.ts-lit-plugin.rules.no-unknown-tag-name: "off": required to support rapidoc, which exports its tag late.
    • compilerOptions.plugins.ts-lit-plugin.rules.no-missing-import: "off": lit-analyzer currently does not support path aliases very well, and cannot find the definition files associated with imports using them.
    • compilerOptions.plugins.ts-lit-plugin.rules.no-incompatible-type-binding: "warn": lit-analyzer does not support generics well when parsing a subtype of HTMLElement. As a result, this threw too many errors to be supportable.