Charmed MongoDB

Channel Revision Published Runs on
6/stable 164 26 Mar 2024
Ubuntu 22.04
6/candidate 164 26 Mar 2024
Ubuntu 22.04
6/beta 164 26 Mar 2024
Ubuntu 22.04
6/edge 170 17 Apr 2024
Ubuntu 22.04
5/stable 117 20 Apr 2023
Ubuntu 22.04
5/candidate 117 20 Apr 2023
Ubuntu 22.04
5/edge 139 21 Nov 2023
Ubuntu 22.04
3.6/stable 100 28 Apr 2023
Ubuntu 20.04 Ubuntu 18.04
3.6/candidate 100 13 Apr 2023
Ubuntu 20.04 Ubuntu 18.04
3.6/edge 100 03 Feb 2023
Ubuntu 20.04 Ubuntu 18.04
juju deploy mongodb --channel 6/stable
Show information

Platform:

Ubuntu
22.04

charms.mongodb.v0.mongodb_secrets

Secrets related helper classes/functions.


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