Skip to content

Commit

Permalink
Add get_admin_access_token to the charm so interaction with Secret an…
Browse files Browse the repository at this point in the history
…d Peer Data occurs only there
  • Loading branch information
amandahla committed Oct 16, 2023
1 parent a92271a commit 555b71f
Show file tree
Hide file tree
Showing 10 changed files with 168 additions and 879 deletions.
29 changes: 26 additions & 3 deletions src-docs/charm.py.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,20 @@
# <kbd>module</kbd> `charm.py`
Charm for Synapse on kubernetes.

**Global Variables**
---------------
- **JUJU_HAS_SECRETS**
- **PEER_RELATION_NAME**
- **SECRET_ID**
- **SECRET_KEY**


---

## <kbd>class</kbd> `SynapseCharm`
Charm the service.

<a href="../src/charm.py#L34"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>
<a href="../src/charm.py#L41"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>

### <kbd>function</kbd> `__init__`

Expand Down Expand Up @@ -69,7 +75,7 @@ Unit that this execution is responsible for.

---

<a href="../src/charm.py#L94"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>
<a href="../src/charm.py#L101"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>

### <kbd>function</kbd> `change_config`

Expand All @@ -81,7 +87,24 @@ Change configuration.

---

<a href="../src/charm.py#L84"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>
<a href="../src/charm.py#L211"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>

### <kbd>function</kbd> `get_admin_access_token`

```python
get_admin_access_token() → Optional[str]
```

Get admin access token.



**Returns:**
admin access token or None if fails.

---

<a href="../src/charm.py#L91"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>

### <kbd>function</kbd> `replan_nginx`

Expand Down
26 changes: 16 additions & 10 deletions src-docs/mjolnir.py.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ A class representing the Mjolnir plugin for Synapse application.

Mjolnir is a moderation tool for Matrix to be used to protect your server from malicious invites, spam messages etc. See https://github.com/matrix-org/mjolnir/ for more details about it.

<a href="../src/mjolnir.py#L30"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>
<a href="../src/mjolnir.py#L32"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>

### <kbd>function</kbd> `__init__`

Expand Down Expand Up @@ -46,12 +46,12 @@ Shortcut for more simple access the model.

---

<a href="../src/mjolnir.py#L119"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>
<a href="../src/mjolnir.py#L134"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>

### <kbd>function</kbd> `enable_mjolnir`

```python
enable_mjolnir() → None
enable_mjolnir(admin_access_token: str) → None
```

Enable mjolnir service.
Expand All @@ -68,27 +68,33 @@ The required steps to enable Mjolnir are:
- Override Mjolnir user rate limit.
- Finally, add Mjolnir pebble layer.



**Args:**

- <b>`admin_access_token`</b>: not empty admin access token.

---

<a href="../src/mjolnir.py#L101"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>
<a href="../src/mjolnir.py#L121"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>

### <kbd>function</kbd> `get_membership_room_id`

```python
get_membership_room_id() → Optional[str]
get_membership_room_id(admin_access_token: str) → Optional[str]
```

Check if membership room exists.



**Returns:**
The room id or None if is not found.
**Args:**

- <b>`admin_access_token`</b>: not empty admin access token.



**Raises:**

- <b>`AdminAccessTokenNotFoundError`</b>: if there is not admin access token.
**Returns:**
The room id or None if is not found.


71 changes: 0 additions & 71 deletions src-docs/secret_storage.py.md

This file was deleted.

Loading

0 comments on commit 555b71f

Please sign in to comment.