authentik fork
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.
Find a file
Ken Sternberg 6792bf8876
web: package up horizontal elements into their own components (#7053)
* web: laying the groundwork for future expansion

This commit is a hodge-podge of updates and changes to the web.  Functional changes:

- Makefile: Fixed a bug in the `help` section that prevented the WIDTH from being accurately
  calculated if `help` was included rather than in-lined.

- ESLint: Modified the "unused vars" rule so that variables starting with an underline are not
  considered by the rule.  This allows for elided variables in event handlers.  It's not a perfect
  solution-- a better one would be to use Typescript's function-specialization typing, but there are
  too many places where we elide or ignore some variables in a function's usage that switching over
  to specialization would be a huge lift.

- locale: It turns out, lit-locale does its own context management.  We don't need to have a context
  at all in this space, and that's one less listener we need to attach t othe DOM.

- ModalButton: A small thing, but using `nothing` instead of "html``" allows lit better control over
  rendering and reduces the number of actual renders of the page.

- FormGroup: Provided a means to modify the aria-label, rather than stick with the just the word
  "Details."  Specializing this field will both help users of screen readers in the future, and will
  allow test suites to find specific form groups now.

- RadioButton: provide a more consistent interface to the RadioButton.  First, we dispatch the
  events to the outside world, and we set the value locally so that the current `Form.ts` continues
  to behave as expected.  We also prevent the "button lost value" event from propagating; this
  presents a unified select-like interface to users of the RadioButtonGroup.  The current value
  semantics are preserved; other clients of the RadioButton do not see a change in behavior.

- EventEmitter: If the custom event detail is *not* an object, do not use the object-like semantics
  for forwarding it; just send it as-is.

- Comments: In the course of laying the groundwork for the application wizard, I throw a LOT of
  comments into the code, describing APIs, interfaces, class and function signatures, to better
  document the behavior inside and as signposts for future work.

* web: permit arrays to be sent in custom events without interpolation.

* actually use assignValue or rather serializeFieldRecursive

Signed-off-by: Jens Langhammer <jens@goauthentik.io>

* web: package up horizontal elements into their own components.

This commit introduces a number of "components."  Jens has this idiom:

```
   <ak-form-element-horizontal label=${msg("Name")} name="name" ?required=${true}>
       <input
           type="text"
           value="${ifDefined(this.instance?.name)}"
           class="pf-c-form-control"
           required
       />
   </ak-form-element-horizontal>
```

It's a very web-oriented idiom in that it's built out of two building blocks, the "element-horizontal" descriptor,
and the input object itself.  This idiom is repeated a lot throughout the code.  As an alternative, let's wrap
everything into an inheritable interface:

```
  <ak-text-input
      name="name"
      label=${msg("Name")}
      value="${ifDefined(this.instance?.name)}
      required
  >
  </ak-text-input>
```

This preserves all the information of the above, makes it much clearer what kind of interaction we're having
(sometimes the `type=` information in an input is lost or easily missed), and while it does require you know
that there are provided components rather than the pair of layout-behavior as in the original it also gives
the developer more precision over the look and feel of the components.

*Right now* these components are placed into the LightDOM, as they are in the existing source code, because
the Form handler has a need to be able to "peer into" the "element-horizontal" component to find the values
of the input objects.  In a future revision I hope to place the burden of type/value processing onto the
input objects themselves such that the form handler will need only look for the `.value` of the associated
input control.

Other fixes:

- update the FlowSearch() such that it actually emits an input event when its value changes.
- Disable the storybook shortcuts; on Chrome, at least, they get confused with simple inputs
- Fix an issue with precommit to not scan any Python with ESLint!  :-)

* web: provide storybook stories for the components

This commit provides storybook stories for the ak-horizontal-element wrappers.  A few
bugs were found along the way, including one rather nasty one from Radio where we
were still getting the "set/unset" pair in the wrong order, so I had to knuckle down
and fix the event handler properly.

* web: test oauth2 provider "guinea pig" for new components

I used the Oauth2 provider page as my experiment in seeing if the
horizontal-element wrappers could be used instead of the raw wrappers
themselves, and I wanted to make sure a test existed that asserts
that filling out THAT form in the ProvidersList and ProvidersForm
didn't break anything.

This commit updates the WDIO tests to do just that; the test is
simple, but it does exercise the `name` field of the Provider,
something not needed in the Wizard because it's set automatically
based on the Application name, and it even asserts that the new
Provider exists in the list of available Providers when it's done.

* web: making sure ESlint and Prettier are happy

* "fix" lint

Signed-off-by: Jens Langhammer <jens@goauthentik.io>

---------

Signed-off-by: Jens Langhammer <jens@goauthentik.io>
Co-authored-by: Jens Langhammer <jens@goauthentik.io>
2023-10-04 13:07:52 -07:00
.github web: bump @typescript-eslint/parser from 6.7.3 to 6.7.4 in /web (#7041) 2023-10-02 19:34:55 +02:00
.vscode root: migrate bootstrap to blueprints (#6433) 2023-07-31 19:34:46 +02:00
authentik web/flows: bottom-align about text on flows page (#7051) 2023-10-03 14:10:10 +02:00
blueprints web/flows: bottom-align about text on flows page (#7051) 2023-10-03 14:10:10 +02:00
cmd web/flows: bottom-align about text on flows page (#7051) 2023-10-03 14:10:10 +02:00
internal internal: fix redis session store (#7011) 2023-09-28 21:06:27 +02:00
lifecycle web/flows: bottom-align about text on flows page (#7051) 2023-10-03 14:10:10 +02:00
locale translate: Updates for file locale/en/LC_MESSAGES/django.po in fr on branch main (#7065) 2023-10-04 18:59:24 +02:00
schemas providers: SCIM (#4835) 2023-03-06 19:39:08 +01:00
scripts providers/oauth2: fix id_token being saved incorrectly leading to lost claims (#6645) 2023-08-28 00:51:48 +02:00
tests web: package up horizontal elements into their own components (#7053) 2023-10-04 13:07:52 -07:00
web web: package up horizontal elements into their own components (#7053) 2023-10-04 13:07:52 -07:00
website Add meta description to black box blog post (#7049) 2023-10-03 10:39:11 -05:00
.bumpversion.cfg release: 2023.8.3 2023-09-11 18:55:08 +02:00
.dockerignore root: don't exclude enterprise from container image (#6956) 2023-09-22 16:22:16 +02:00
.editorconfig website: codespell with custom dictionary and CI (#5062) 2023-03-24 00:24:55 +01:00
.gitignore root: add generated Source docs (#5323) 2023-07-31 11:59:20 +02:00
CODE_OF_CONDUCT.md root: rework and expand security policy 2022-11-28 12:10:53 +01:00
CODEOWNERS web: bump the eslint group in /web with 1 update (#7039) 2023-10-02 19:37:32 +02:00
CONTRIBUTING.md website/developer-docs: move contributing to dev docs index and link contributing file (#5554) 2023-05-09 20:26:55 +02:00
docker-compose.yml release: 2023.8.3 2023-09-11 18:55:08 +02:00
Dockerfile root: fix missing /lifecycle in path 2023-09-27 17:49:30 +02:00
go.mod core: bump goauthentik.io/api/v3 from 3.2023083.3 to 3.2023083.4 (#7061) 2023-10-04 11:05:37 +02:00
go.sum core: bump goauthentik.io/api/v3 from 3.2023083.3 to 3.2023083.4 (#7061) 2023-10-04 11:05:37 +02:00
ldap.Dockerfile mount binds all around 2023-09-11 15:44:26 +02:00
LICENSE enterprise: initial license (#5293) 2023-04-19 16:13:45 +02:00
Makefile web: package up horizontal elements into their own components (#7053) 2023-10-04 13:07:52 -07:00
manage.py root: update deprecation warnings 2022-11-25 11:47:28 +01:00
poetry.lock core: bump django from 4.2.5 to 4.2.6 (#7066) 2023-10-04 19:24:06 +02:00
proxy.Dockerfile core: bump node from 20.5 to 20.6 (#6784) 2023-09-20 12:28:47 +02:00
pyproject.toml Merge branch 'version-2023.8' 2023-09-11 22:04:23 +02:00
radius.Dockerfile mount binds all around 2023-09-11 15:44:26 +02:00
README.md root: remove outdated sponsorship section on readme (#6973) 2023-09-25 16:38:50 +02:00
schema.yml web/flows: bottom-align about text on flows page (#7051) 2023-10-03 14:10:10 +02:00
SECURITY.md website: update 2023.8 release notes (#6666) 2023-08-29 19:57:14 +02:00

authentik logo


Join Discord GitHub Workflow Status GitHub Workflow Status GitHub Workflow Status Code Coverage Docker pulls Latest version

What is authentik?

authentik is an open-source Identity Provider that emphasizes flexibility and versatility. It can be seamlessly integrated into existing environments to support new protocols. authentik is also a great solution for implementing sign-up, recovery, and other similar features in your application, saving you the hassle of dealing with them.

Installation

For small/test setups it is recommended to use Docker Compose; refer to the documentation.

For bigger setups, there is a Helm Chart here. This is documented here.

Screenshots

Light Dark

Development

See Developer Documentation

Security

See SECURITY.md

Adoption and Contributions

Your organization uses authentik? We'd love to add your logo to the readme and our website! Email us @ hello@goauthentik.io or open a GitHub Issue/PR! For more information on how to contribute to authentik, please refer to our CONTRIBUTING.md file.