HAProxy
| Channel | Revision | Published | Runs on |
|---|---|---|---|
| latest/stable | 147 | 30 Apr 2025 | |
| latest/stable | 66 | 08 Nov 2021 | |
| latest/candidate | 147 | 30 Apr 2025 | |
| latest/candidate | 64 | 14 Oct 2021 | |
| latest/beta | 147 | 30 Apr 2025 | |
| latest/edge | 147 | 29 Apr 2025 | |
| latest/edge | 37 | 11 Nov 2020 | |
| 2.8/stable | 216 | 20 Aug 2025 | |
| 2.8/edge | 274 | Today |
juju deploy haproxy
Deploy universal operators easily with Juju, the Universal Operator Lifecycle Manager.
Platform:
charms.haproxy.v0.spoe_auth
-
- Last updated 27 Nov 2025
- Revision Library version 0.2
SPOE-auth interface library.
Getting Started
To get started using the library, you need to first declare the library in
the charm-libs section of your charmcraft.yaml file:
charm-libs:
- lib: haproxy.spoe_auth
version: "0"
Then, fetch the library using charmcraft:
cd some-charm
charmcraft fetch-libs
Using the library as the Provider
The provider charm should expose the interface as shown below:
provides:
spoe-auth:
interface: spoe-auth
limit: 1
Then, to initialise the library:
from charms.haproxy.v0.spoe_auth import SpoeAuthProvider, HaproxyEvent
class SpoeAuthCharm(CharmBase):
def __init__(self, *args):
super().__init__(*args)
self.spoe_auth = SpoeAuthProvider(self, relation_name="spoe-auth")
self.framework.observe(
self.on.config_changed, self._on_config_changed
)
def _on_config_changed(self, event):
# Publish the SPOE auth configuration
self.spoe_auth.provide_spoe_auth_requirements(
spop_port=8081,
oidc_callback_port=5000,
event=HaproxyEvent.ON_HTTP_REQUEST,
var_authenticated="var.sess.is_authenticated",
var_redirect_url="var.sess.redirect_url",
cookie_name="auth_session",
hostname="auth.example.com",
oidc_callback_path="/oauth2/callback",
)
Index
def value_contains_invalid_characters(value: str)
Validate if value contains invalid haproxy config characters.
Arguments
The value to validate.
Returns
The validated value.
def validate_hostname(value: str)
Validate if value is a valid hostname per RFC 1123.
Arguments
The value to validate.
Returns
The validated value.
class DataValidationError
Description
Raised when data validation fails. None
class SpoeAuthInvalidRelationDataError
Description
Raised when data validation of the spoe-auth relation fails. None
class HaproxyEvent
Enumeration of HAProxy SPOE events.
Attributes
class SpoeAuthProviderAppData
Configuration model for SPOE authentication provider.
Attributes
class SpoeAuthProviderUnitData
spoe-auth provider unit data.
Attributes
class SpoeAuthProvider
SPOE auth interface provider implementation.
Attributes
Methods
SpoeAuthProvider. __init__( self , charm: CharmBase , relation_name: str )
Initialize the SpoeAuthProvider.
Arguments
The charm that is instantiating the library.
The name of the relation to bind to.
SpoeAuthProvider. relations( self )
The list of Relation instances associated with this relation_name.
Returns
The list of relations.
SpoeAuthProvider. provide_spoe_auth_requirements( self , relation: Relation , spop_port: int , oidc_callback_port: int , event: HaproxyEvent , message_name: str , var_authenticated: str , var_redirect_url: str , cookie_name: str , hostname: str , oidc_callback_path: str , unit_address )
Set the SPOE auth configuration in the application databag.
Arguments
The relation instance to set data on.
The port on the agent listening for SPOP.
The port on the agent handling OIDC callbacks.
The event that triggers SPOE messages.
The name of the SPOE message that the provider expects.
Name of the variable for auth status.
Name of the variable for IDP redirect URL.
Name of the authentication cookie.
The hostname HAProxy should route OIDC callbacks to.
Path for OIDC callback.
The address of the unit.
class SpoeAuthAvailableEvent
Description
SpoeAuthAvailableEvent custom event. None
class SpoeAuthRemovedEvent
Description
SpoeAuthRemovedEvent custom event. None
class SpoeAuthRequirerEvents
List of events that the SPOE auth requirer charm can leverage.
Attributes
class SpoeAuthRequirer
SPOE auth interface requirer implementation.
Attributes
Methods
SpoeAuthRequirer. __init__( self , charm: CharmBase , relation_name: str )
Initialize the SpoeAuthRequirer.
Arguments
The charm that is instantiating the library.
The name of the relation to bind to.
SpoeAuthRequirer. relation( self )
The relation instance associated with this relation_name.
Returns
The relation instance, or None if not available.
SpoeAuthRequirer. is_available( self )
Check if the SPOE auth configuration is available and valid.
Returns
True if configuration is available and valid, False otherwise.
SpoeAuthRequirer. get_data( self )
Get the SPOE auth configuration from the provider.
Returns
The SPOE auth configuration, or None if not available.
SpoeAuthRequirer. get_provider_unit_data( self , relation: Relation )
Fetch and validate the requirer's units data.
Arguments
The relation to fetch unit data from.
Returns
List of validated unit data from the provider.
SpoeAuthRequirer. get_provider_application_data( self , relation: Relation )
Fetch and validate the requirer's application databag.
Arguments
The relation to fetch application data from.
Returns
Validated application data from the requirer.