charmlibs-interfaces-certificate-transfer 1.0.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- charmlibs_interfaces_certificate_transfer-1.0.0/.gitignore +184 -0
- charmlibs_interfaces_certificate_transfer-1.0.0/CHANGELOG.md +3 -0
- charmlibs_interfaces_certificate_transfer-1.0.0/PKG-INFO +28 -0
- charmlibs_interfaces_certificate_transfer-1.0.0/README.md +11 -0
- charmlibs_interfaces_certificate_transfer-1.0.0/interface/v0/README.md +73 -0
- charmlibs_interfaces_certificate_transfer-1.0.0/interface/v0/interface.yaml +8 -0
- charmlibs_interfaces_certificate_transfer-1.0.0/interface/v0/schemas/provider.json +67 -0
- charmlibs_interfaces_certificate_transfer-1.0.0/interface/v0/schemas/requirer.json +22 -0
- charmlibs_interfaces_certificate_transfer-1.0.0/interface/v1/README.md +66 -0
- charmlibs_interfaces_certificate_transfer-1.0.0/interface/v1/interface.yaml +13 -0
- charmlibs_interfaces_certificate_transfer-1.0.0/interface/v1/schema.py +47 -0
- charmlibs_interfaces_certificate_transfer-1.0.0/pyproject.toml +81 -0
- charmlibs_interfaces_certificate_transfer-1.0.0/src/charmlibs/interfaces/certificate_transfer/__init__.py +134 -0
- charmlibs_interfaces_certificate_transfer-1.0.0/src/charmlibs/interfaces/certificate_transfer/_certificate_transfer.py +608 -0
- charmlibs_interfaces_certificate_transfer-1.0.0/src/charmlibs/interfaces/certificate_transfer/_version.py +15 -0
- charmlibs_interfaces_certificate_transfer-1.0.0/src/charmlibs/interfaces/certificate_transfer/py.typed +0 -0
- charmlibs_interfaces_certificate_transfer-1.0.0/tests/unit/test_certificate_transfer_provides_v1.py +720 -0
- charmlibs_interfaces_certificate_transfer-1.0.0/tests/unit/test_certificate_transfer_requires_v1.py +336 -0
- charmlibs_interfaces_certificate_transfer-1.0.0/uv.lock +463 -0
|
@@ -0,0 +1,184 @@
|
|
|
1
|
+
# Byte-compiled / optimized / DLL files
|
|
2
|
+
__pycache__/
|
|
3
|
+
*.py[cod]
|
|
4
|
+
*$py.class
|
|
5
|
+
|
|
6
|
+
# C extensions
|
|
7
|
+
*.so
|
|
8
|
+
|
|
9
|
+
# Distribution / packaging
|
|
10
|
+
.Python
|
|
11
|
+
build/
|
|
12
|
+
develop-eggs/
|
|
13
|
+
dist/
|
|
14
|
+
downloads/
|
|
15
|
+
eggs/
|
|
16
|
+
.eggs/
|
|
17
|
+
lib/
|
|
18
|
+
lib64/
|
|
19
|
+
parts/
|
|
20
|
+
sdist/
|
|
21
|
+
var/
|
|
22
|
+
wheels/
|
|
23
|
+
share/python-wheels/
|
|
24
|
+
*.egg-info/
|
|
25
|
+
.installed.cfg
|
|
26
|
+
*.egg
|
|
27
|
+
MANIFEST
|
|
28
|
+
|
|
29
|
+
# PyInstaller
|
|
30
|
+
# Usually these files are written by a python script from a template
|
|
31
|
+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
|
|
32
|
+
*.manifest
|
|
33
|
+
*.spec
|
|
34
|
+
|
|
35
|
+
# Installer logs
|
|
36
|
+
pip-log.txt
|
|
37
|
+
pip-delete-this-directory.txt
|
|
38
|
+
|
|
39
|
+
# Unit test / coverage reports
|
|
40
|
+
htmlcov/
|
|
41
|
+
.tox/
|
|
42
|
+
.nox/
|
|
43
|
+
.coverage
|
|
44
|
+
.coverage.*
|
|
45
|
+
.coverage-*
|
|
46
|
+
.cache
|
|
47
|
+
nosetests.xml
|
|
48
|
+
coverage.xml
|
|
49
|
+
*.cover
|
|
50
|
+
*.py,cover
|
|
51
|
+
.hypothesis/
|
|
52
|
+
.pytest_cache/
|
|
53
|
+
cover/
|
|
54
|
+
.report/
|
|
55
|
+
|
|
56
|
+
# Translations
|
|
57
|
+
*.mo
|
|
58
|
+
*.pot
|
|
59
|
+
|
|
60
|
+
# Django stuff:
|
|
61
|
+
*.log
|
|
62
|
+
local_settings.py
|
|
63
|
+
db.sqlite3
|
|
64
|
+
db.sqlite3-journal
|
|
65
|
+
|
|
66
|
+
# Flask stuff:
|
|
67
|
+
instance/
|
|
68
|
+
.webassets-cache
|
|
69
|
+
|
|
70
|
+
# Scrapy stuff:
|
|
71
|
+
.scrapy
|
|
72
|
+
|
|
73
|
+
# Sphinx documentation
|
|
74
|
+
docs/_build/
|
|
75
|
+
|
|
76
|
+
# PyBuilder
|
|
77
|
+
.pybuilder/
|
|
78
|
+
target/
|
|
79
|
+
|
|
80
|
+
# Jupyter Notebook
|
|
81
|
+
.ipynb_checkpoints
|
|
82
|
+
|
|
83
|
+
# IPython
|
|
84
|
+
profile_default/
|
|
85
|
+
ipython_config.py
|
|
86
|
+
|
|
87
|
+
# pyenv
|
|
88
|
+
# For a library or package, you might want to ignore these files since the code is
|
|
89
|
+
# intended to run in multiple environments; otherwise, check them in:
|
|
90
|
+
# .python-version
|
|
91
|
+
|
|
92
|
+
# pipenv
|
|
93
|
+
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
|
|
94
|
+
# However, in case of collaboration, if having platform-specific dependencies or dependencies
|
|
95
|
+
# having no cross-platform support, pipenv may install dependencies that don't work, or not
|
|
96
|
+
# install all needed dependencies.
|
|
97
|
+
#Pipfile.lock
|
|
98
|
+
|
|
99
|
+
# UV
|
|
100
|
+
# Similar to Pipfile.lock, it is generally recommended to include uv.lock in version control.
|
|
101
|
+
# This is especially recommended for binary packages to ensure reproducibility, and is more
|
|
102
|
+
# commonly ignored for libraries.
|
|
103
|
+
#uv.lock
|
|
104
|
+
|
|
105
|
+
# poetry
|
|
106
|
+
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
|
|
107
|
+
# This is especially recommended for binary packages to ensure reproducibility, and is more
|
|
108
|
+
# commonly ignored for libraries.
|
|
109
|
+
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
|
|
110
|
+
#poetry.lock
|
|
111
|
+
|
|
112
|
+
# pdm
|
|
113
|
+
# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
|
|
114
|
+
#pdm.lock
|
|
115
|
+
# pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
|
|
116
|
+
# in version control.
|
|
117
|
+
# https://pdm.fming.dev/latest/usage/project/#working-with-version-control
|
|
118
|
+
.pdm.toml
|
|
119
|
+
.pdm-python
|
|
120
|
+
.pdm-build/
|
|
121
|
+
|
|
122
|
+
# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
|
|
123
|
+
__pypackages__/
|
|
124
|
+
|
|
125
|
+
# Celery stuff
|
|
126
|
+
celerybeat-schedule
|
|
127
|
+
celerybeat.pid
|
|
128
|
+
|
|
129
|
+
# SageMath parsed files
|
|
130
|
+
*.sage.py
|
|
131
|
+
|
|
132
|
+
# Environments
|
|
133
|
+
.env
|
|
134
|
+
.venv
|
|
135
|
+
env/
|
|
136
|
+
venv/
|
|
137
|
+
ENV/
|
|
138
|
+
env.bak/
|
|
139
|
+
venv.bak/
|
|
140
|
+
|
|
141
|
+
# Spyder project settings
|
|
142
|
+
.spyderproject
|
|
143
|
+
.spyproject
|
|
144
|
+
|
|
145
|
+
# Rope project settings
|
|
146
|
+
.ropeproject
|
|
147
|
+
|
|
148
|
+
# mkdocs documentation
|
|
149
|
+
/site
|
|
150
|
+
|
|
151
|
+
# mypy
|
|
152
|
+
.mypy_cache/
|
|
153
|
+
.dmypy.json
|
|
154
|
+
dmypy.json
|
|
155
|
+
|
|
156
|
+
# Pyre type checker
|
|
157
|
+
.pyre/
|
|
158
|
+
|
|
159
|
+
# pytype static type analyzer
|
|
160
|
+
.pytype/
|
|
161
|
+
|
|
162
|
+
# Cython debug symbols
|
|
163
|
+
cython_debug/
|
|
164
|
+
|
|
165
|
+
# PyCharm
|
|
166
|
+
# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
|
|
167
|
+
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
|
|
168
|
+
# and can be added to the global gitignore or merged into this file. For a more nuclear
|
|
169
|
+
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
|
|
170
|
+
.idea/
|
|
171
|
+
|
|
172
|
+
# PyPI configuration file
|
|
173
|
+
.pypirc
|
|
174
|
+
|
|
175
|
+
# packed charms
|
|
176
|
+
.packed
|
|
177
|
+
|
|
178
|
+
# temporary directory for packing charms
|
|
179
|
+
.tmp
|
|
180
|
+
|
|
181
|
+
# uv.lock from example libraries as we don't commit these
|
|
182
|
+
.example/**/uv.lock
|
|
183
|
+
.tutorial/**/uv.lock
|
|
184
|
+
interfaces/.example/**/uv.lock
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: charmlibs-interfaces-certificate_transfer
|
|
3
|
+
Version: 1.0.0
|
|
4
|
+
Summary: The charmlibs.interfaces.certificate_transfer package.
|
|
5
|
+
Project-URL: Repository, https://github.com/canonical/charmlibs
|
|
6
|
+
Project-URL: Issues, https://github.com/canonical/charmlibs/issues
|
|
7
|
+
Author: The TLS team at Canonical
|
|
8
|
+
Classifier: Development Status :: 5 - Production/Stable
|
|
9
|
+
Classifier: Intended Audience :: Developers
|
|
10
|
+
Classifier: License :: OSI Approved :: Apache Software License
|
|
11
|
+
Classifier: Operating System :: POSIX :: Linux
|
|
12
|
+
Classifier: Programming Language :: Python :: 3
|
|
13
|
+
Requires-Python: >=3.10
|
|
14
|
+
Requires-Dist: ops
|
|
15
|
+
Requires-Dist: pydantic
|
|
16
|
+
Description-Content-Type: text/markdown
|
|
17
|
+
|
|
18
|
+
# charmlibs.interfaces.certificate_transfer
|
|
19
|
+
|
|
20
|
+
The `certificate_transfer` interface library.
|
|
21
|
+
|
|
22
|
+
To install, add `charmlibs-interfaces-certificate_transfer` to your Python dependencies. Then in your Python code, import as:
|
|
23
|
+
|
|
24
|
+
```py
|
|
25
|
+
from charmlibs.interfaces import certificate_transfer
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
See the [reference documentation](https://documentation.ubuntu.com/charmlibs/reference/charmlibs/interfaces/certificate_transfer).
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
# charmlibs.interfaces.certificate_transfer
|
|
2
|
+
|
|
3
|
+
The `certificate_transfer` interface library.
|
|
4
|
+
|
|
5
|
+
To install, add `charmlibs-interfaces-certificate_transfer` to your Python dependencies. Then in your Python code, import as:
|
|
6
|
+
|
|
7
|
+
```py
|
|
8
|
+
from charmlibs.interfaces import certificate_transfer
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
See the [reference documentation](https://documentation.ubuntu.com/charmlibs/reference/charmlibs/interfaces/certificate_transfer).
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
# `certificate_transfer/v0`
|
|
2
|
+
|
|
3
|
+
## Usage
|
|
4
|
+
|
|
5
|
+
Some charms require knowledge of public TLS certificates for trusted communication. This relation interface describes the expected behaviour of any charm claiming to be able to authenticate (or be authenticated) through TLS communication.
|
|
6
|
+
|
|
7
|
+
**Warning**: This relation interface should not be used by charms requiring certificates for themselves. Please use the `tls-certificates` interface for this usecase.
|
|
8
|
+
|
|
9
|
+
## Direction
|
|
10
|
+
|
|
11
|
+
```mermaid
|
|
12
|
+
flowchart TD
|
|
13
|
+
Requirer -- version --> Provider
|
|
14
|
+
Provider -- certificate, ca, chain, version --> Requirer
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
As with all Juju relations, the `certificate_transfer` interface consists of two parties: a Provider and a Requirer.
|
|
18
|
+
|
|
19
|
+
## Behavior
|
|
20
|
+
|
|
21
|
+
Both the Requirer and the Provider need to adhere to criteria to be considered compatible with the interface.
|
|
22
|
+
|
|
23
|
+
### Provider
|
|
24
|
+
|
|
25
|
+
- Is expected to provide a public certificate and/or a CA certificate and/or a CA chain.
|
|
26
|
+
|
|
27
|
+
### Requirer
|
|
28
|
+
|
|
29
|
+
- Is expected to use the provided certificate and/or CA certificate and/or chain to authenticate communications.
|
|
30
|
+
- Is expected to communicate the used version of the interface, in this case `0`.
|
|
31
|
+
|
|
32
|
+
## Relation Data
|
|
33
|
+
|
|
34
|
+
### Provider
|
|
35
|
+
|
|
36
|
+
[\[JSON Schema\]](./schemas/provider.json)
|
|
37
|
+
|
|
38
|
+
The provider writes a certificate, CA certificate and CA chain in its unit relation data. In newer patch versions of the library, it also writes the version
|
|
39
|
+
of the interface to the databag.
|
|
40
|
+
|
|
41
|
+
#### Example
|
|
42
|
+
|
|
43
|
+
```yaml
|
|
44
|
+
relation-info:
|
|
45
|
+
- endpoint: certificate_transfer
|
|
46
|
+
related-endpoint: certificate_transfer
|
|
47
|
+
unit-data:
|
|
48
|
+
certificate: "-----BEGIN CERTIFICATE-----\nMIIC6DCCAdCgAwIBAgIUW42TU9LSjEZLMCclWrvSwAsgRtcwDQYJKoZIhvcNAQEL\nBQAwIDELMAkGA1UEBhMCVVMxETAPBgNVBAMMCHdoYXRldmVyMB4XDTIzMDMyNDE4\nNDMxOVoXDTI0MDMyMzE4NDMxOVowPDELMAkGA1UEAwwCb2sxLTArBgNVBC0MJGUw\nNjVmMWI3LTE2OWEtNDE5YS1iNmQyLTc3OWJkOGM4NzIwNjCCASIwDQYJKoZIhvcN\nAQEBBQADggEPADCCAQoCggEBAK42ixoklDH5K5i1NxXo/AFACDa956pE5RA57wlC\nBfgUYaIDRmv7TUVJh6zoMZSD6wjSZl3QgP7UTTZeHbvs3QE9HUwEkH1Lo3a8vD3z\neqsE2vSnOkpWWnPbfxiQyrTm77/LAWBt7lRLRLdfL6WcucD3wsGqm58sWXM3HG0f\nSN7PHCZUFqU6MpkHw8DiKmht5hBgWG+Vq3Zw8MNaqpwb/NgST3yYdcZwb58G2FTS\nZvDSdUfRmD/mY7TpciYV8EFylXNNFkth8oGNLunR9adgZ+9IunfRKj1a7S5GSwXU\nAZDaojw+8k5i3ikztsWH11wAVCiLj/3euIqq95z8xGycnKcCAwEAATANBgkqhkiG\n9w0BAQsFAAOCAQEAWMvcaozgBrZ/MAxzTJmp5gZyLxmMNV6iT9dcqbwzDtDtBvA/\n46ux6ytAQ+A7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Van9rsI5TCThoylmaXW\nquEiZ2LObI+5faPzxSBhr9TjJlQamsd4ywout7pHKN8ZGqrCMRJ1jJbUfobu1n2k\nUOsY4+jzV1IRBXJzj64fLal4QhUNv341lAer6Vz3cAyRk7CK89b/DEY0x+jVpyZT\n1osx9JtsOmkDTgvdStGzq5kPKWOfjwHkmKQaZXliCgqbhzcCERppp1s/sX6K7nIh\n4lWiEmzUSD3Hngk51KGWlpZszO5KQ4cSZ3HUt/prg+tt0ROC3pY61k+m5dDUa9M8\nRtMI6iTjzSj/UV8DiAx0yeM+bKoy4jGeXmaL3g==\n-----END CERTIFICATE-----\n"
|
|
53
|
+
]
|
|
54
|
+
version: 0
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
### Requirer
|
|
58
|
+
|
|
59
|
+
[\[JSON Schema\]](./schemas/requirer.json)
|
|
60
|
+
|
|
61
|
+
In newer patch versions of the library, the requirer writes the version number of the interface to its application databag as soon as feasible.
|
|
62
|
+
|
|
63
|
+
For older version, the requirer does not write anything to its databags. The provider must assume version 0 in that case.
|
|
64
|
+
|
|
65
|
+
#### Example
|
|
66
|
+
|
|
67
|
+
```yaml
|
|
68
|
+
relation-info:
|
|
69
|
+
- endpoint: certificate_transfer
|
|
70
|
+
related-endpoint: certificate_transfer
|
|
71
|
+
app-data:
|
|
72
|
+
version: 0
|
|
73
|
+
```
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "http://json-schema.org/draft-07/schema",
|
|
3
|
+
"$id": "https://canonical.github.io/charm-relation-interfaces/interfaces/certificate_transfer/schemas/provider.json",
|
|
4
|
+
"type": "object",
|
|
5
|
+
"title": "`certificate_transfer` provider schema",
|
|
6
|
+
"description": "The `certificate_transfer` root schema comprises the entire provider application databag for this interface.",
|
|
7
|
+
"default": {},
|
|
8
|
+
"examples": [
|
|
9
|
+
{
|
|
10
|
+
"certificate": "-----BEGIN CERTIFICATE-----\nMIIC6DCCAdCgAwIBAgIUW42TU9L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"version": 0
|
|
17
|
+
}
|
|
18
|
+
],
|
|
19
|
+
"properties": {
|
|
20
|
+
"certificate": {
|
|
21
|
+
"$id": "#/properties/certificate",
|
|
22
|
+
"type": "string",
|
|
23
|
+
"title": "Public TLS certificate",
|
|
24
|
+
"description": "Public TLS certificate"
|
|
25
|
+
},
|
|
26
|
+
"ca": {
|
|
27
|
+
"$id": "#/properties/ca",
|
|
28
|
+
"type": "string",
|
|
29
|
+
"title": "CA public TLS certificate",
|
|
30
|
+
"description": "CA public TLS certificate"
|
|
31
|
+
},
|
|
32
|
+
"chain": {
|
|
33
|
+
"$id": "#/properties/chain",
|
|
34
|
+
"type": "array",
|
|
35
|
+
"items": {
|
|
36
|
+
"type": "string",
|
|
37
|
+
"$id": "#/properties/chain/items"
|
|
38
|
+
},
|
|
39
|
+
"title": "CA public TLS certificate chain",
|
|
40
|
+
"description": "CA public TLS certificate chain"
|
|
41
|
+
},
|
|
42
|
+
"version": {
|
|
43
|
+
"$id": "#/properties/version",
|
|
44
|
+
"type": "integer",
|
|
45
|
+
"title": "Interface version",
|
|
46
|
+
"description": "Version of the interface used by this databag"
|
|
47
|
+
}
|
|
48
|
+
},
|
|
49
|
+
"anyOf": [
|
|
50
|
+
{
|
|
51
|
+
"required": [
|
|
52
|
+
"certificate"
|
|
53
|
+
]
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
"required": [
|
|
57
|
+
"ca"
|
|
58
|
+
]
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
"required": [
|
|
62
|
+
"chain"
|
|
63
|
+
]
|
|
64
|
+
}
|
|
65
|
+
],
|
|
66
|
+
"additionalProperties": true
|
|
67
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "http://json-schema.org/draft-07/schema",
|
|
3
|
+
"$id": "https://canonical.github.io/charm-relation-interfaces/interfaces/certificate_transfer/schemas/requirer.json",
|
|
4
|
+
"type": "object",
|
|
5
|
+
"title": "`certificate_transfer` requirer schema",
|
|
6
|
+
"description": "The `certificate_transfer` root schema comprises the entire requirer databag for this interface.",
|
|
7
|
+
"default": {},
|
|
8
|
+
"examples": [
|
|
9
|
+
{
|
|
10
|
+
"version": 0
|
|
11
|
+
}
|
|
12
|
+
],
|
|
13
|
+
"properties": {
|
|
14
|
+
"version": {
|
|
15
|
+
"$id": "#/properties/version",
|
|
16
|
+
"type": "integer",
|
|
17
|
+
"title": "Interface version",
|
|
18
|
+
"description": "Version number of the interface"
|
|
19
|
+
}
|
|
20
|
+
},
|
|
21
|
+
"additionalProperties": true
|
|
22
|
+
}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
# `certificate_transfer/v1`
|
|
2
|
+
|
|
3
|
+
## Usage
|
|
4
|
+
|
|
5
|
+
Some charms require knowledge of public TLS certificates for trusted communication. This relation interface describes the expected behaviour of any charm claiming to be able to authenticate (or be authenticated) through TLS communication.
|
|
6
|
+
|
|
7
|
+
**Warning**: This relation interface should not be used by charms requiring certificates for themselves. Please use the `tls-certificates` interface for this usecase.
|
|
8
|
+
|
|
9
|
+
## Direction
|
|
10
|
+
|
|
11
|
+
```mermaid
|
|
12
|
+
flowchart TD
|
|
13
|
+
Requirer -- version --> Provider
|
|
14
|
+
Provider -- certificates, version --> Requirer
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
As with all Juju relations, the `certificate_transfer` interface consists of two parties: a Provider and a Requirer.
|
|
18
|
+
|
|
19
|
+
## Behavior
|
|
20
|
+
|
|
21
|
+
Both the Requirer and the Provider need to adhere to criteria to be considered compatible with the interface.
|
|
22
|
+
|
|
23
|
+
### Provider
|
|
24
|
+
|
|
25
|
+
- Is expected to provide a list of public certificates and/or CA certificates
|
|
26
|
+
- Is expected to provide the used version of the interface.
|
|
27
|
+
|
|
28
|
+
### Requirer
|
|
29
|
+
|
|
30
|
+
- Is expected to provide 1 as a version number and to use the provided certificates and/or CA certificates to authenticate communications.
|
|
31
|
+
|
|
32
|
+
## Relation Data
|
|
33
|
+
|
|
34
|
+
### Provider
|
|
35
|
+
|
|
36
|
+
[\[JSON Schema\]](./schema.py)
|
|
37
|
+
|
|
38
|
+
The provider writes any number of certficates to its relation data.
|
|
39
|
+
|
|
40
|
+
#### Example
|
|
41
|
+
|
|
42
|
+
```yaml
|
|
43
|
+
relation-info:
|
|
44
|
+
- endpoint: certificate_transfer
|
|
45
|
+
related-endpoint: certificate_transfer
|
|
46
|
+
app-data:
|
|
47
|
+
certificates:
|
|
48
|
+
- "-----BEGIN CERTIFICATE-----\nMIIC6DCCAdCgAwIBAgIUW42TU9LSjEZLMCclWrvSwAsgRtcwDQYJKoZIhvcNAQEL\nBQAwIDELMAkGA1UEBhMCVVMxETAPBgNVBAMMCHdoYXRldmVyMB4XDTIzMDMyNDE4\nNDMxOVoXDTI0MDMyMzE4NDMxOVowPDELMAkGA1UEAwwCb2sxLTArBgNVBC0MJGUw\nNjVmMWI3LTE2OWEtNDE5YS1iNmQyLTc3OWJkOGM4NzIwNjCCASIwDQYJKoZIhvcN\nAQEBBQADggEPADCCAQoCggEBAK42ixoklDH5K5i1NxXo/AFACDa956pE5RA57wlC\nBfgUYaIDRmv7TUVJh6zoMZSD6wjSZl3QgP7UTTZeHbvs3QE9HUwEkH1Lo3a8vD3z\neqsE2vSnOkpWWnPbfxiQyrTm77/LAWBt7lRLRLdfL6WcucD3wsGqm58sWXM3HG0f\nSN7PHCZUFqU6MpkHw8DiKmht5hBgWG+Vq3Zw8MNaqpwb/NgST3yYdcZwb58G2FTS\nZvDSdUfRmD/mY7TpciYV8EFylXNNFkth8oGNLunR9adgZ+9IunfRKj1a7S5GSwXU\nAZDaojw+8k5i3ikztsWH11wAVCiLj/3euIqq95z8xGycnKcCAwEAATANBgkqhkiG\n9w0BAQsFAAOCAQEAWMvcaozgBrZ/MAxzTJmp5gZyLxmMNV6iT9dcqbwzDtDtBvA/\n46ux6ytAQ+A7Bd3AubvozwCr1Id6g66ae0blWYRRZmF8fDdX/SBjIUkv7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u9A3NVQ\nXN9gsEvK9pdpfN4ZiflfGSLdhM1STHycLmhG6H5s7HklbukMRhQi+ejbSzm/wiw1\nipcxuKhSUIVNkTLusN5b+HE2gwF1fn0K0z5jWABy08huLgbaEKXJEx5/FKLZGJga\nfpIzAdf25kMTu3gggseaAmzyX3AtT1i8A8nqYfe8fnnVMkvud89kq5jErv/hlMC9\n49g5yWQR2jilYYM3j9BHDuB+Rs+YS5BCep1JnQ==\n-----END CERTIFICATE-----\n"
|
|
50
|
+
version: 1
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
### Requirer
|
|
54
|
+
|
|
55
|
+
[\[JSON Schema\]](./schema.py)
|
|
56
|
+
|
|
57
|
+
The requirer writes the version number of the interface to its application databag as soon as feasible.
|
|
58
|
+
|
|
59
|
+
#### Example
|
|
60
|
+
```yaml
|
|
61
|
+
relation-info:
|
|
62
|
+
- endpoint: certificate_transfer
|
|
63
|
+
related-endpoint: certificate_transfer
|
|
64
|
+
app-data:
|
|
65
|
+
version: 1
|
|
66
|
+
```
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
name: certificate_transfer
|
|
2
|
+
version: 1
|
|
3
|
+
status: draft
|
|
4
|
+
lib: charms.certificate_transfer_interface.certificate_transfer
|
|
5
|
+
summary: Receive public or CA certificates.
|
|
6
|
+
description: |
|
|
7
|
+
The `certificate_transfer` interface allows charms to receive public and/or CA certificates.
|
|
8
|
+
The provider charm shares its certificates with the requirer.
|
|
9
|
+
|
|
10
|
+
providers: []
|
|
11
|
+
requirers: []
|
|
12
|
+
|
|
13
|
+
maintainer: tls
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
"""This file defines the schemas for the provider and requirer sides of the `certificate_transfer` interface.
|
|
2
|
+
It exposes two interface_tester.schema_base.DataBagSchema subclasses called:
|
|
3
|
+
- ProviderSchema
|
|
4
|
+
- RequirerSchema
|
|
5
|
+
Examples:
|
|
6
|
+
ProviderSchema:
|
|
7
|
+
unit: <empty>
|
|
8
|
+
app: {
|
|
9
|
+
"certificates": [
|
|
10
|
+
"-----BEGIN CERTIFICATE----- ...",
|
|
11
|
+
"-----BEGIN CERTIFICATE----- ..."
|
|
12
|
+
]
|
|
13
|
+
}
|
|
14
|
+
RequirerSchema:
|
|
15
|
+
unit: <empty>
|
|
16
|
+
app: <empty>
|
|
17
|
+
"""
|
|
18
|
+
|
|
19
|
+
from interface_tester.schema_base import DataBagSchema
|
|
20
|
+
from pydantic import BaseModel, Field
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
class CertificateTransferProviderAppData(BaseModel):
|
|
24
|
+
certificates: set[str] = Field(
|
|
25
|
+
description="The set of certificates that will be transferred to a requirer"
|
|
26
|
+
)
|
|
27
|
+
version: int = Field(
|
|
28
|
+
description="The version of the interface used in this databag", default=1
|
|
29
|
+
)
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
class ProviderSchema(DataBagSchema):
|
|
33
|
+
"""Provider schema for certificate_transfer."""
|
|
34
|
+
|
|
35
|
+
app: CertificateTransferProviderAppData
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
class CertificateTransferRequirerAppData(BaseModel):
|
|
39
|
+
version: int = Field(
|
|
40
|
+
description="The version of the interface used by this requirer", default=1
|
|
41
|
+
)
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
class RequirerSchema(DataBagSchema):
|
|
45
|
+
"""Requirer schema for certificate_transfer."""
|
|
46
|
+
|
|
47
|
+
app: CertificateTransferRequirerAppData
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
[project]
|
|
2
|
+
name = "charmlibs-interfaces-certificate_transfer"
|
|
3
|
+
description = "The charmlibs.interfaces.certificate_transfer package."
|
|
4
|
+
readme = "README.md"
|
|
5
|
+
requires-python = ">=3.10"
|
|
6
|
+
authors = [
|
|
7
|
+
{name="The TLS team at Canonical"},
|
|
8
|
+
]
|
|
9
|
+
classifiers = [
|
|
10
|
+
"Programming Language :: Python :: 3",
|
|
11
|
+
"License :: OSI Approved :: Apache Software License",
|
|
12
|
+
"Intended Audience :: Developers",
|
|
13
|
+
"Operating System :: POSIX :: Linux",
|
|
14
|
+
"Development Status :: 5 - Production/Stable",
|
|
15
|
+
]
|
|
16
|
+
dynamic = ["version"]
|
|
17
|
+
dependencies = [
|
|
18
|
+
"ops",
|
|
19
|
+
"pydantic",
|
|
20
|
+
]
|
|
21
|
+
|
|
22
|
+
[dependency-groups]
|
|
23
|
+
lint = [ # installed for `just lint interfaces/certificate_transfer` (unit, functional, and integration are also installed)
|
|
24
|
+
]
|
|
25
|
+
unit = [ # installed for `just unit interfaces/certificate_transfer`
|
|
26
|
+
"ops[testing]",
|
|
27
|
+
"pytest"
|
|
28
|
+
]
|
|
29
|
+
functional = [ # installed for `just functional interfaces/certificate_transfer`
|
|
30
|
+
]
|
|
31
|
+
integration = [ # installed for `just integration interfaces/certificate_transfer`
|
|
32
|
+
]
|
|
33
|
+
|
|
34
|
+
[project.urls]
|
|
35
|
+
"Repository" = "https://github.com/canonical/charmlibs"
|
|
36
|
+
"Issues" = "https://github.com/canonical/charmlibs/issues"
|
|
37
|
+
|
|
38
|
+
[build-system]
|
|
39
|
+
requires = ["hatchling"]
|
|
40
|
+
build-backend = "hatchling.build"
|
|
41
|
+
|
|
42
|
+
[tool.hatch.build.targets.wheel]
|
|
43
|
+
packages = ["src/charmlibs"]
|
|
44
|
+
|
|
45
|
+
[tool.hatch.version]
|
|
46
|
+
path = "src/charmlibs/interfaces/certificate_transfer/_version.py"
|
|
47
|
+
|
|
48
|
+
[tool.ruff]
|
|
49
|
+
extend = "../../pyproject.toml"
|
|
50
|
+
src = ["src", "tests/unit", "tests/functional", "tests/integration"]
|
|
51
|
+
|
|
52
|
+
[tool.ruff.format]
|
|
53
|
+
quote-style = "preserve"
|
|
54
|
+
|
|
55
|
+
[tool.ruff.lint.extend-per-file-ignores]
|
|
56
|
+
"./**/schema.py" = [
|
|
57
|
+
"CPY", # copyright
|
|
58
|
+
"D", # docs
|
|
59
|
+
"E501", # line too long
|
|
60
|
+
]
|
|
61
|
+
"tests/**/*" = [
|
|
62
|
+
"E501",
|
|
63
|
+
]
|
|
64
|
+
|
|
65
|
+
[tool.pyright]
|
|
66
|
+
extends = "../../pyproject.toml"
|
|
67
|
+
include = ["src", "tests"]
|
|
68
|
+
pythonVersion = "3.10"
|
|
69
|
+
|
|
70
|
+
[tool.charmlibs.functional]
|
|
71
|
+
ubuntu = [] # ubuntu versions to run functional tests with, e.g. "24.04" (defaults to just "latest")
|
|
72
|
+
pebble = [] # pebble versions to run functional tests with, e.g. "v1.0.0", "master" (defaults to no pebble versions)
|
|
73
|
+
sudo = false # whether to run functional tests with sudo (defaults to false)
|
|
74
|
+
|
|
75
|
+
[tool.charmlibs.integration]
|
|
76
|
+
# tags to run integration tests with (defaults to running once with no tag, i.e. tags = [''])
|
|
77
|
+
# Available in CI in tests/integration/pack.sh and integration tests as CHARMLIBS_TAG
|
|
78
|
+
tags = [] # Not used by the pack.sh and integration tests generated by the template
|
|
79
|
+
|
|
80
|
+
[tool.ty.rules]
|
|
81
|
+
invalid-key = "warn"
|