* web: fix esbuild issue with style sheets
Getting ESBuild, Lit, and Storybook to all agree on how to read and parse stylesheets is a serious
pain. This fix better identifies the value types (instances) being passed from various sources in
the repo to the three *different* kinds of style processors we're using (the native one, the
polyfill one, and whatever the heck Storybook does internally).
Falling back to using older CSS instantiating techniques one era at a time seems to do the trick.
It's ugly, but in the face of the aggressive styling we use to avoid Flashes of Unstyled Content
(FLoUC), it's the logic with which we're left.
In standard mode, the following warning appears on the console when running a Flow:
```
Autofocus processing was blocked because a document already has a focused element.
```
In compatibility mode, the following **error** appears on the console when running a Flow:
```
crawler-inject.js:1106 Uncaught TypeError: Failed to execute 'observe' on 'MutationObserver': parameter 1 is not of type 'Node'.
at initDomMutationObservers (crawler-inject.js:1106:18)
at crawler-inject.js:1114:24
at Array.forEach (<anonymous>)
at initDomMutationObservers (crawler-inject.js:1114:10)
at crawler-inject.js:1549:1
initDomMutationObservers @ crawler-inject.js:1106
(anonymous) @ crawler-inject.js:1114
initDomMutationObservers @ crawler-inject.js:1114
(anonymous) @ crawler-inject.js:1549
```
Despite this error, nothing seems to be broken and flows work as anticipated.
* web: preserve selected list when provider updates
The impulse to preserve the functionality of the system given a change of provider was... admirable,
but unnecessary in this case. A premature optimization that doesn't make a difference. Observations:
1. change from the client will bring a new `selected`. But changes from the outside shouldn't happen
once the interactive experience is "settled."
2. the client is perfectly capable of listening to the `change` event and reading the content of the
value list for selecteds. If the client is going to change the provider, it should provide the
most up-to-date copy of selecteds as well.
3. We set the selecteds from two locations: from the client on start-up, and from the "selected"
pane during user interaction. Anything more is risk. I shouldn't have taken that risk.
* web: fix esbuild issue with style sheets
Getting ESBuild, Lit, and Storybook to all agree on how to read and parse stylesheets is a serious
pain. This fix better identifies the value types (instances) being passed from various sources in
the repo to the three *different* kinds of style processors we're using (the native one, the
polyfill one, and whatever the heck Storybook does internally).
Falling back to using older CSS instantiating techniques one era at a time seems to do the trick.
It's ugly, but in the face of the aggressive styling we use to avoid Flashes of Unstyled Content
(FLoUC), it's the logic with which we're left.
In standard mode, the following warning appears on the console when running a Flow:
```
Autofocus processing was blocked because a document already has a focused element.
```
In compatibility mode, the following **error** appears on the console when running a Flow:
```
crawler-inject.js:1106 Uncaught TypeError: Failed to execute 'observe' on 'MutationObserver': parameter 1 is not of type 'Node'.
at initDomMutationObservers (crawler-inject.js:1106:18)
at crawler-inject.js:1114:24
at Array.forEach (<anonymous>)
at initDomMutationObservers (crawler-inject.js:1114:10)
at crawler-inject.js:1549:1
initDomMutationObservers @ crawler-inject.js:1106
(anonymous) @ crawler-inject.js:1114
initDomMutationObservers @ crawler-inject.js:1114
(anonymous) @ crawler-inject.js:1549
```
Despite this error, nothing seems to be broken and flows work as anticipated.
* web: fix application display length and capability
The User Application Library only shows the top 100 applications. This patch
strips what is passed out of the API fetch down to the bare minimum: the list of
applications. No pagination, no search strings, none of the items returned by
the API other than the application. It then fetches multiple pages of 100
until the user's Application list is exhausted, presenting the entire list to
the user.
The fetches are done simultaneously; a user with a thousand applications, if one
should exist, would start 9 downloads in parallel. The first fetch analyzes the
page count to determine how many *more* must be started, then starts them. This
should make an interesting stress-test.
Failures at the Django end are not well-handled, but then they have never been
well-handled. At best, the page is blank and the browser console will contain a
cryptic error message. That isn't fixed this time around, but it probably should
be.
This patch will have no effect until the [application pagination
bug](https://github.com/goauthentik/authentik/issues/9093) is fixed.
* Prettier has opinions.
* attempt to fix backend pagination
Signed-off-by: Jens Langhammer <jens@goauthentik.io>
* make page_number optional
Signed-off-by: Jens Langhammer <jens@goauthentik.io>
---------
Signed-off-by: Jens Langhammer <jens@goauthentik.io>
Co-authored-by: Jens Langhammer <jens@goauthentik.io>
web: bump @spotlightjs/spotlight in /web in the sentry group
Bumps the sentry group in /web with 1 update: @spotlightjs/spotlight.
Updates `@spotlightjs/spotlight` from 1.2.16 to 1.2.17
---
updated-dependencies:
- dependency-name: "@spotlightjs/spotlight"
dependency-type: direct:development
update-type: version-update:semver-patch
dependency-group: sentry
...
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
* web: fix esbuild issue with style sheets
Getting ESBuild, Lit, and Storybook to all agree on how to read and parse stylesheets is a serious
pain. This fix better identifies the value types (instances) being passed from various sources in
the repo to the three *different* kinds of style processors we're using (the native one, the
polyfill one, and whatever the heck Storybook does internally).
Falling back to using older CSS instantiating techniques one era at a time seems to do the trick.
It's ugly, but in the face of the aggressive styling we use to avoid Flashes of Unstyled Content
(FLoUC), it's the logic with which we're left.
In standard mode, the following warning appears on the console when running a Flow:
```
Autofocus processing was blocked because a document already has a focused element.
```
In compatibility mode, the following **error** appears on the console when running a Flow:
```
crawler-inject.js:1106 Uncaught TypeError: Failed to execute 'observe' on 'MutationObserver': parameter 1 is not of type 'Node'.
at initDomMutationObservers (crawler-inject.js:1106:18)
at crawler-inject.js:1114:24
at Array.forEach (<anonymous>)
at initDomMutationObservers (crawler-inject.js:1114:10)
at crawler-inject.js:1549:1
initDomMutationObservers @ crawler-inject.js:1106
(anonymous) @ crawler-inject.js:1114
initDomMutationObservers @ crawler-inject.js:1114
(anonymous) @ crawler-inject.js:1549
```
Despite this error, nothing seems to be broken and flows work as anticipated.
* web: ak-checkbox-group for short, static, multi-select events
Implements a checkbox groups web component, wholly independent of the API
(although it does implement the 'data-ak-control' protocol, including the
`json()` method that makes it easier to send the data to the Form handler). The
controller works much like multi-select: `value` returns an array of strings,
the `name` attribute associated with whatever it is you're asking about.
The `required` property only works if you give the whole item a name, as if it
were an input. Otherwise, it does nothing.
Giving it a `name` also activates the browser standard `formAssociated`
protocol; it works just fine for ordinary HTML forms, and presents to that
protocol the `FormValue` type, so any form using it will automagically convert
it into the CGI (Common Gateway Interface) format of, to use the example from
Storybook:
```
ak-test-checkgroup-input=funky&ak-test-checkgroup-input=invalid
```
Note that the classic CGI format is not automatically key/value; keys can appear
multiple times, and indicate that the value is an array of strings. Most modern
appservers understand this format. Some do not.
There's a full and complete JSDOC-like comment documenting the component. I
have even provided CSSPart sections for everything: the wrapper, each line, the
input and its associated label. The brave or foolhardy can mangle the CSS to
their hearts' content without having to know a thing about Patternfly.
* fix styling alignment with top line
Signed-off-by: Jens Langhammer <jens@goauthentik.io>
---------
Signed-off-by: Jens Langhammer <jens@goauthentik.io>
Co-authored-by: Jens Langhammer <jens@goauthentik.io>
* root: move database calls from ready() to dedicated startup signal
Signed-off-by: Jens Langhammer <jens@goauthentik.io>
* optimise gunicorn startup to only do DB code in one worker
Signed-off-by: Jens Langhammer <jens@goauthentik.io>
* always use 2 workers in compose
Signed-off-by: Jens Langhammer <jens@goauthentik.io>
* send startup signals for test runner
Signed-off-by: Jens Langhammer <jens@goauthentik.io>
* remove k8s import that isn't really needed
Signed-off-by: Jens Langhammer <jens@goauthentik.io>
* ci: bump nested actions
Signed-off-by: Jens Langhammer <jens@goauthentik.io>
* fix @reconcile_app not triggering reconcile due to changed functions
Signed-off-by: Jens Langhammer <jens@goauthentik.io>
* connect startup with uid
Signed-off-by: Jens Langhammer <jens@goauthentik.io>
* adjust some log levels
Signed-off-by: Jens Langhammer <jens@goauthentik.io>
* remove internal healthcheck
we didn't really use it to do anything, and we shouldn't have to since the live/ready probes are handled by django anyways and so the container runtime will restart the server if needed
Signed-off-by: Jens Langhammer <jens@goauthentik.io>
* add setproctitle for gunicorn and celery process titles
Signed-off-by: Jens Langhammer <jens@goauthentik.io>
* configure structlog early to use it
Signed-off-by: Jens Langhammer <jens@goauthentik.io>
* Revert "configure structlog early to use it"
This reverts commit 16778fdbbca0f5c474d376c2f85c6f8032c06044.
* Revert "adjust some log levels"
This reverts commit a129f7ab6aecf27f1206aea1ad8384ce897b74ad.
Signed-off-by: Jens Langhammer <jens@goauthentik.io>
# Conflicts:
# authentik/root/settings.py
* optimize startup to not spawn a bunch of one-off processes
Signed-off-by: Jens Langhammer <jens@goauthentik.io>
* idk why this shows up
Signed-off-by: Jens Langhammer <jens@goauthentik.io>
---------
Signed-off-by: Jens Langhammer <jens@goauthentik.io>
* web: fix esbuild issue with style sheets
Getting ESBuild, Lit, and Storybook to all agree on how to read and parse stylesheets is a serious
pain. This fix better identifies the value types (instances) being passed from various sources in
the repo to the three *different* kinds of style processors we're using (the native one, the
polyfill one, and whatever the heck Storybook does internally).
Falling back to using older CSS instantiating techniques one era at a time seems to do the trick.
It's ugly, but in the face of the aggressive styling we use to avoid Flashes of Unstyled Content
(FLoUC), it's the logic with which we're left.
In standard mode, the following warning appears on the console when running a Flow:
```
Autofocus processing was blocked because a document already has a focused element.
```
In compatibility mode, the following **error** appears on the console when running a Flow:
```
crawler-inject.js:1106 Uncaught TypeError: Failed to execute 'observe' on 'MutationObserver': parameter 1 is not of type 'Node'.
at initDomMutationObservers (crawler-inject.js:1106:18)
at crawler-inject.js:1114:24
at Array.forEach (<anonymous>)
at initDomMutationObservers (crawler-inject.js:1114:10)
at crawler-inject.js:1549:1
initDomMutationObservers @ crawler-inject.js:1106
(anonymous) @ crawler-inject.js:1114
initDomMutationObservers @ crawler-inject.js:1114
(anonymous) @ crawler-inject.js:1549
```
Despite this error, nothing seems to be broken and flows work as anticipated.
* web: move context controllers into reactive controller plugins
While I was working on the Patternfly 5 thing, I found myself cleaning up the
way our context controllers are plugged into the Interfaces. I realized a
couple of things that had bothered me before:
1. It does not matter where the context controller lives so long as the context
controller has a references to the LitElement that hosts it.
ReactiveControllers provide that reference.
2. ReactiveControllers are a perfect place to hide some of these details, so
that they don't have to clutter up our Interface declaration.
3. The ReactiveController `hostConnected()/hostDisconnected()` lifecycle is a
much better place to hook up our EVENT_REFRESH events to the contexts and
controllers that care about them than some random place in the loader cycle.
4. It's much easier to detect and control when an external change to a
context's state object, which is supposed to be a mirror of the context,
changes outside the controller, by using the `hostUpdate()` method. When the
controller causes a state change, the states will be the same, allowing us to
short out the potential infinite loop.
This commit also uses the symbol-as-property-name trick to guarantee the privacy
of some fields that should truly be private. They're unfindable and
inaddressible from the outside world. This is preferable to using the Private
Member syntax (the `#` prefix) because Babel, TypeScript, and ESBuild all use an
underlying registry of private names that "do not have good performance
characteristics if you create many instances of classes with private fields"
[ESBuild Caveats](https://esbuild.github.io/content-types/#javascript-caveats).
* web: fix esbuild issue with style sheets
Getting ESBuild, Lit, and Storybook to all agree on how to read and parse stylesheets is a serious
pain. This fix better identifies the value types (instances) being passed from various sources in
the repo to the three *different* kinds of style processors we're using (the native one, the
polyfill one, and whatever the heck Storybook does internally).
Falling back to using older CSS instantiating techniques one era at a time seems to do the trick.
It's ugly, but in the face of the aggressive styling we use to avoid Flashes of Unstyled Content
(FLoUC), it's the logic with which we're left.
In standard mode, the following warning appears on the console when running a Flow:
```
Autofocus processing was blocked because a document already has a focused element.
```
In compatibility mode, the following **error** appears on the console when running a Flow:
```
crawler-inject.js:1106 Uncaught TypeError: Failed to execute 'observe' on 'MutationObserver': parameter 1 is not of type 'Node'.
at initDomMutationObservers (crawler-inject.js:1106:18)
at crawler-inject.js:1114:24
at Array.forEach (<anonymous>)
at initDomMutationObservers (crawler-inject.js:1114:10)
at crawler-inject.js:1549:1
initDomMutationObservers @ crawler-inject.js:1106
(anonymous) @ crawler-inject.js:1114
initDomMutationObservers @ crawler-inject.js:1114
(anonymous) @ crawler-inject.js:1549
```
Despite this error, nothing seems to be broken and flows work as anticipated.
* web: maintenance. Split tsconfig into "base" and "build" variants.
This commit creates the now fairly standard split between the tsconfig "build" and "base"
variants. This split is useful in defining build variants that have a default set of
rules (such as library use, language constraints, and specialized plug-in checks) but
can be varied in "extension" files.
The most common use for this is to allow for IDE-specific versions of tsconfig (which
know only to look for `tsconfig.json`) while enabling providing more comprehensive
variants to build and lint systems.
This commit is intended to enable this behavior so that different versions of Patternfly
can be included in a slow, evolutionary way that won't create too many incomprehensibly
huge reviews in the coming days.
A comparison of the produced configs, derived by `tsc --showConfig`, between this branch
and _main_ show no difference in the output of the complete tsconfig.json used by the
compiler.
---
It annoys me, a *lot*, that Doug Crockford didn't allow comments in JSON files,
and both the NPM folks and the TSC folks have been obstinate in not permitting
alternative formats for their configuration files. This makes it impossible to
comment some of the most important and complicated files in our system.
* Restarted the webui docs folder. Docs should always live with the project.
* web: prettier has opinions.
* web: fix esbuild issue with style sheets
Getting ESBuild, Lit, and Storybook to all agree on how to read and parse stylesheets is a serious
pain. This fix better identifies the value types (instances) being passed from various sources in
the repo to the three *different* kinds of style processors we're using (the native one, the
polyfill one, and whatever the heck Storybook does internally).
Falling back to using older CSS instantiating techniques one era at a time seems to do the trick.
It's ugly, but in the face of the aggressive styling we use to avoid Flashes of Unstyled Content
(FLoUC), it's the logic with which we're left.
In standard mode, the following warning appears on the console when running a Flow:
```
Autofocus processing was blocked because a document already has a focused element.
```
In compatibility mode, the following **error** appears on the console when running a Flow:
```
crawler-inject.js:1106 Uncaught TypeError: Failed to execute 'observe' on 'MutationObserver': parameter 1 is not of type 'Node'.
at initDomMutationObservers (crawler-inject.js:1106:18)
at crawler-inject.js:1114:24
at Array.forEach (<anonymous>)
at initDomMutationObservers (crawler-inject.js:1114:10)
at crawler-inject.js:1549:1
initDomMutationObservers @ crawler-inject.js:1106
(anonymous) @ crawler-inject.js:1114
initDomMutationObservers @ crawler-inject.js:1114
(anonymous) @ crawler-inject.js:1549
```
Despite this error, nothing seems to be broken and flows work as anticipated.
* web: consistency pass
While investigating the viability of applying purgeCSS to Patternfly4, in order
to reduce the weight of our CSS, I found these four locations in our code (all
of them *my changes*, darnit), in which our usual `styles` declaration pattern
was inconsistent with our own standards. The LibraryPageImpl change would have
been too intrusive to make fully compliant. The objective here is to ensure that
our objects have *predictable* internal layouts for ease of future maintenance.