diff options
| author | James Elliott <james-d-elliott@users.noreply.github.com> | 2025-03-09 01:53:44 +1100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-03-09 01:53:44 +1100 |
| commit | 9241731a4dd5592b4a02b5352c903b4d06b6f4ab (patch) | |
| tree | 5184b98751912a261ff70fd8721b9cd4f1c98f1e /experimental/embed/types.go | |
| parent | bbcb38ab9ff35e69d5d52a71ab56346749f5e8b1 (diff) | |
feat(embed): make authelia embedable (#8841)
This adds a highly experimental option for developers looking to embed Authelia within another go binary.
Closes #5803
Signed-off-by: James Elliott <james-d-elliott@users.noreply.github.com>
Diffstat (limited to 'experimental/embed/types.go')
| -rw-r--r-- | experimental/embed/types.go | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/experimental/embed/types.go b/experimental/embed/types.go new file mode 100644 index 000000000..bd048206e --- /dev/null +++ b/experimental/embed/types.go @@ -0,0 +1,24 @@ +package embed + +import ( + "github.com/authelia/authelia/v4/internal/configuration/schema" + "github.com/authelia/authelia/v4/internal/middlewares" +) + +// Configuration is a type alias for the internal schema.Configuration type. It allows manually configuring Authelia +// and transitioning to the internal implementation. +type Configuration schema.Configuration + +// ToInternal converts this Configuration struct into a *schema.Configuration struct using a type cast. +func (c *Configuration) ToInternal() *schema.Configuration { + return (*schema.Configuration)(c) +} + +// Providers is a type alias for the internal middlewares.Providers type. It allows manually performing setup of the +// various Authelia providers and transitioning to the internal implementation. +type Providers middlewares.Providers + +// ToInternal converts this Providers struct into a middlewares.Providers struct using a type cast. +func (p Providers) ToInternal() middlewares.Providers { + return middlewares.Providers(p) +} |
