SAML Integrator
- By Canonical IS DevOps
Channel | Revision | Published | Runs on |
---|---|---|---|
latest/stable | 48 | 02 Apr 2024 | |
latest/edge | 50 | 03 May 2024 |
juju deploy saml-integrator
Deploy universal operators easily with Juju, the Universal Operator Lifecycle Manager.
Platform:
charms.saml_integrator.v0.smtp_integrator
-
- Last updated 27 Oct 2023
- Revision Library version 0.3
Library to manage the integration with the SMTP Integrator charm.
This library contains the Requires and Provides classes for handling the integration
between an application and a charm providing the smtp
and smtp-legacy
integrations.
If the requirer charm supports secrets, the preferred approach is to use the smtp
relation to leverage them.
This library also contains a SmtpRelationData
class to wrap the SMTP data that will
be shared via the integration.
Requirer Charm
from charms.smtp_integrator.v0 import SmtpDataAvailableEvent, SmtpRequires
class SmtpRequirerCharm(ops.CharmBase):
def __init__(self, *args):
super().__init__(*args)
self.smtp = smtp.SmtpRequires(self)
self.framework.observe(self.smtp.on.smtp_data_available, self._handler)
...
def _handler(self, events: SmtpDataAvailableEvent) -> None:
...
As shown above, the library provides a custom event to handle the scenario in which new SMTP data has been added or updated.
Provider Charm
Following the previous example, this is an example of the provider charm.
from charms.smtp_integrator.v0 import SmtpDataAvailableEvent, SmtpProvides
class SmtpProviderCharm(ops.CharmBase):
def __init__(self, *args):
super().__init__(*args)
self.smtp = SmtpProvides(self)
...
The SmtpProvides object wraps the list of relations into a relations
property
and provides an update_relation_data
method to update the relation data by passing
a SmtpRelationData
data object.
Index
class TransportSecurity
Represent the transport security values.
Attributes
class AuthType
Represent the auth type values.
Attributes
class SmtpRelationData
Represent the relation data.
Attributes
Methods
SmtpRelationData. to_relation_data( self )
Convert an instance of SmtpRelationData to the relation representation.
Returns
Dict containing the representation.
class SmtpDataAvailableEvent
Smtp event emitted when relation data has changed.
Attributes
Methods
SmtpDataAvailableEvent. host( self )
Description
Fetch the SMTP host from the relation. None
SmtpDataAvailableEvent. port( self )
Description
Fetch the SMTP port from the relation. None
SmtpDataAvailableEvent. user( self )
Description
Fetch the SMTP user from the relation. None
SmtpDataAvailableEvent. password( self )
Description
Fetch the SMTP password from the relation. None
SmtpDataAvailableEvent. password_id( self )
Description
Fetch the SMTP password from the relation. None
SmtpDataAvailableEvent. auth_type( self )
Description
Fetch the SMTP auth type from the relation. None
SmtpDataAvailableEvent. transport_security( self )
Description
Fetch the SMTP transport security protocol from the relation. None
SmtpDataAvailableEvent. domain( self )
Description
Fetch the SMTP domain from the relation. None
class SmtpRequiresEvents
SMTP events.
Attributes
Description
This class defines the events that a SMTP requirer can emit.
class SmtpRequires
Requirer side of the SMTP relation.
Attributes
Methods
SmtpRequires. __init__( self , charm , relation_name: str )
Construct.
Arguments
the provider charm.
the relation name.
class SmtpProvides
Provider side of the SMTP relation.
Attributes
Methods
SmtpProvides. __init__( self , charm , relation_name: str )
Construct.
Arguments
the provider charm.
the relation name.
SmtpProvides. relations( self )
The list of Relation instances associated with this relation_name.
Returns
List of relations to this charm.
SmtpProvides. update_relation_data( self , relation , smtp_data: SmtpRelationData )
Update the relation data.
Arguments
the relation for which to update the data.
a SmtpRelationData instance wrapping the data to be updated.