Data Platform Libs
- Canonical
- Databases
Channel | Revision | Published | Runs on |
---|---|---|---|
latest/stable | 81 | 19 Nov 2024 | |
latest/edge | 82 | 04 Dec 2024 |
juju deploy data-platform-libs
Deploy universal operators easily with Juju, the Universal Operator Lifecycle Manager.
Platform:
charms.data_platform_libs.v0.data_secrets
-
- Last updated 09 Feb 2024
- Revision Library version 0.2
Secrets related helper classes/functions.
Index
class DataSecretsError
Description
A secret that we want to create already exists. None
class SecretAlreadyExistsError
Description
A secret that we want to create already exists. None
def
generate_secret_label(
charm: CharmBase,
scope: Scopes
)
Generate unique group_mappings for secrets within a relation context.
Description
Defined as a standalone function, as the choice on secret labels definition belongs to the Application Logic. To be kept separate from classes below, which are simply to provide a (smart) abstraction layer above Juju Secrets.
class CachedSecret
Abstraction layer above direct Juju access with caching.
Description
The data structure is precisely re-using/simulating Juju Secrets behavior, while also making sure not to fetch a secret multiple times within the same event scope.
Methods
CachedSecret. __init__( self , charm: CharmBase , label: str , secret_uri )
CachedSecret. add_secret( self , content , scope: Scopes )
Description
Create a new secret. None
CachedSecret. meta( self )
Description
Getting cached secret meta-information. None
CachedSecret. get_content( self )
Description
Getting cached secret content. None
CachedSecret. set_content( self , content )
Description
Setting cached secret content. None
CachedSecret. get_info( self )
Description
Wrapper function for get the corresponding call on the Secret object if any. None
class SecretCache
Description
A data structure storing CachedSecret objects. None
Methods
SecretCache. __init__( self , charm )
SecretCache. get( self , label: str , uri )
Description
Getting a secret from Juju Secret store or cache. None
SecretCache. add( self , label: str , content , scope: Scopes )
Description
Adding a secret to Juju Secret. None